Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

DvEncoderVideoPipeYUV Class Reference

YUV Pipe for encodedv. More...

Inheritance diagram for DvEncoderVideoPipeYUV:

Inheritance graph
[legend]
Collaboration diagram for DvEncoderVideoPipeYUV:

Collaboration graph
[legend]
List of all members.

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 YUV422 image to the pipe.
bool CloseVideo ()
 Close the video pipe.

Private Attributes

int width
int height
int m_pid
int m_writer
GError * m_error

Detailed Description

YUV Pipe for encodedv.

Note that this is not supported by libdv.

Definition at line 683 of file kino_av_pipe.cc.


Member Function Documentation

bool DvEncoderVideoPipeYUV::CloseVideo  )  [virtual]
 

Close the video pipe.

Implements KinoVideoPipe.

Definition at line 737 of file kino_av_pipe.cc.

References m_writer, sigpipe_clear(), and sigpipe_get().

00738 {
00739     sigpipe_clear();
00740     close( m_writer );
00741     return sigpipe_get() == 0;
00742 }

bool DvEncoderVideoPipeYUV::OpenVideoPipe char *  pipe,
int  width,
int  height,
bool  interlaced = true
[virtual]
 

Open the video pipe.

Implements KinoVideoPipe.

Definition at line 700 of file kino_av_pipe.cc.

References m_error, m_pid, m_writer, sigpipe_clear(), and sigpipe_get().

00701 {
00702     sigpipe_clear();
00703     char * args[ 4 ];
00704 
00705     args[ 0 ] = "/bin/sh";
00706     args[ 1 ] = "-c";
00707     args[ 2 ] = ( char * )pipe;
00708     args[ 3 ] = NULL;
00709 
00710     g_spawn_async_with_pipes( ".", args, NULL, G_SPAWN_LEAVE_DESCRIPTORS_OPEN, NULL, NULL, &m_pid, &m_writer, NULL, NULL, &m_error );
00711 
00712     this->width = width;
00713     this->height = height;
00714     char output[ 256 ];
00715     sprintf( output, "YUV4MPEG2 W%d H%d F%s %s XYSCSS=422\n", width, height,
00716             height == 576 ? "25:1 A118:81" : "30000:1001 A40:33", interlaced ? "Ib" : "Ip" );
00717     write( m_writer, output, strlen( output ) );
00718     return m_writer != -1 && sigpipe_get() == 0;
00719 }

bool DvEncoderVideoPipeYUV::OutputVideoFrame uint8_t *  frame,
int  size
[virtual]
 

Output a YUV422 image to the pipe.

Implements KinoVideoPipe.

Definition at line 724 of file kino_av_pipe.cc.

References m_writer, sigpipe_clear(), and sigpipe_get().

00725 {
00726     sigpipe_clear();
00727     char output[ 256 ];
00728     sprintf( output, "FRAME\n" );
00729     write( m_writer, output, strlen( output ) );
00730     write( m_writer, frame, size );
00731     return sigpipe_get() == 0;
00732 }


Member Data Documentation

int DvEncoderVideoPipeYUV::height [private]
 

Definition at line 687 of file kino_av_pipe.cc.

GError* DvEncoderVideoPipeYUV::m_error [private]
 

Definition at line 689 of file kino_av_pipe.cc.

Referenced by OpenVideoPipe().

int DvEncoderVideoPipeYUV::m_pid [private]
 

Definition at line 688 of file kino_av_pipe.cc.

Referenced by OpenVideoPipe().

int DvEncoderVideoPipeYUV::m_writer [private]
 

Definition at line 688 of file kino_av_pipe.cc.

Referenced by CloseVideo(), OpenVideoPipe(), and OutputVideoFrame().

int DvEncoderVideoPipeYUV::width [private]
 

Definition at line 686 of file kino_av_pipe.cc.


The documentation for this class was generated from the following file:
Generated on Sun Mar 11 22:12:48 2007 for Kino by  doxygen 1.4.2