Inheritance diagram for DvEncoderVideoPipePGM:


Public Member Functions | |
| bool | OpenVideoPipe (char *pipe, int width, int height, bool interlaced=true) |
| Open the video pipe. | |
| bool | OutputVideoFrame (uint8_t *frame, int size) |
| Output a YUV420P image to the pipe. | |
| bool | CloseVideo () |
| Close DV Encode pipe. | |
Private Attributes | |
| int | width |
| int | height |
| int | m_pid |
| int | m_writer |
| GError * | m_error |
Definition at line 747 of file kino_av_pipe.cc.
|
|
Close DV Encode pipe.
Implements KinoVideoPipe. Definition at line 808 of file kino_av_pipe.cc. References m_writer, sigpipe_clear(), and sigpipe_get(). 00809 {
00810 sigpipe_clear();
00811 close( m_writer );
00812 return sigpipe_get() == 0;
00813 }
|
|
||||||||||||||||||||
|
Open the video pipe.
Implements KinoVideoPipe. Definition at line 764 of file kino_av_pipe.cc. References m_error, m_pid, m_writer, sigpipe_clear(), and sigpipe_get(). 00765 {
00766 sigpipe_clear();
00767 char * args[ 4 ];
00768
00769 args[ 0 ] = "/bin/sh";
00770 args[ 1 ] = "-c";
00771 args[ 2 ] = ( char * )pipe;
00772 args[ 3 ] = NULL;
00773
00774 g_spawn_async_with_pipes( ".", args, NULL, G_SPAWN_LEAVE_DESCRIPTORS_OPEN, NULL, NULL, &m_pid, &m_writer, NULL, NULL, &m_error );
00775
00776 this->width = width;
00777 this->height = height;
00778 return m_writer != -1 && sigpipe_get() == 0;
00779 }
|
|
||||||||||||
|
Output a YUV420P image to the pipe.
Implements KinoVideoPipe. Definition at line 784 of file kino_av_pipe.cc. References height, m_writer, sigpipe_clear(), sigpipe_get(), and width. 00785 {
00786 sigpipe_clear();
00787 char output[ 256 ];
00788 sprintf( output, "P5\n%d %d\n255\n", width, height * 3 / 2 );
00789 write( m_writer, output, strlen( output ) );
00790 write( m_writer, frame, width * height );
00791 int h = height >> 1;
00792 int w = width >> 1;
00793 uint8_t *ptr1 = frame + width * height;
00794 uint8_t *ptr2 = ptr1 + ( w * h ) ;
00795 for ( int i = 0; i < h; i++ )
00796 {
00797 write( m_writer, ptr1, w );
00798 write( m_writer, ptr2, w );
00799 ptr1 += w;
00800 ptr2 += w;
00801 }
00802 return sigpipe_get() == 0;
00803 }
|
|
|
Definition at line 751 of file kino_av_pipe.cc. Referenced by OutputVideoFrame(). |
|
|
Definition at line 753 of file kino_av_pipe.cc. Referenced by OpenVideoPipe(). |
|
|
Definition at line 752 of file kino_av_pipe.cc. Referenced by OpenVideoPipe(). |
|
|
Definition at line 752 of file kino_av_pipe.cc. Referenced by CloseVideo(), OpenVideoPipe(), and OutputVideoFrame(). |
|
|
Definition at line 750 of file kino_av_pipe.cc. Referenced by OutputVideoFrame(). |
1.4.2