OStreamVideoDecoder Class Reference

#include <OStreamVideoDecoder.hh>

List of all members.


Detailed Description

Utility class with reusable code. Depends on libavcodec/libavformat. Decodes encoded data [h263+, mjpeg] to IplImages or, extendable, to other formats.

Definition at line 34 of file OStreamVideoDecoder.hh.

Public Member Functions

 OStreamVideoDecoder (unsigned int io_buf_size, ostream_decoding_type decoding_type, int fps=25, PixelFormat opencv_pix_fmt=PIX_FMT_BGR24)
 Constructor.
virtual ~OStreamVideoDecoder ()
IplImage * decode_video_frame (unsigned char *buf, int buf_size)
 Decode a buffer into a IplImage.

Private Member Functions

bool decoder_initialize ()
 Initialize the decoder.
AVFrame * create_avframe (int pixel_format, int frame_width, int frame_height)
 Create an AVFrame.

Private Attributes

bool _initialized
 Specify whether the class is initialized or not.
unsigned char * _internal_buffer
 Internal buffer used for conversions.
int _internal_buffer_size
int _decoding_type
int _fps
 Frames Per Second.
AVCodec * _codec_decode
AVCodecContext * _codec_context
AVFrame * _decoded_frame
AVFrame * _opencv_ready_frame
PixelFormat _opencv_pix_fmt


Constructor & Destructor Documentation

OStreamVideoDecoder::OStreamVideoDecoder ( unsigned int  io_buf_size,
ostream_decoding_type  decoding_type,
int  fps = 25,
PixelFormat  opencv_pix_fmt = PIX_FMT_BGR24 
)

Parameters:
io_buf_size Internal buffer size used to store encoded frames. This must be <= fMaxSize, or liveMedia libraries will crash.
decoding_type ostream_decoding_type parameter.
fps Frames Per Second
opencv_pix_fmt Speaking about OpenCV and IplImages, they usually set BGR as their main format, but with the new display system, wxImage, it's better to have RGB format, so that we can avoid a conversion.

Definition at line 23 of file OStreamVideoDecoder.cpp.

References _initialized, _internal_buffer, _internal_buffer_size, _opencv_ready_frame, DEBUG_PRINT, decoder_initialize(), and NULL.

Here is the call graph for this function:

OStreamVideoDecoder::~OStreamVideoDecoder (  )  [virtual]

Definition at line 49 of file OStreamVideoDecoder.cpp.

References _codec_context, and _internal_buffer.


Member Function Documentation

AVFrame * OStreamVideoDecoder::create_avframe ( int  pixel_format,
int  frame_width,
int  frame_height 
) [private]

Parameters:
pixel_format Pixel format of the resulting AVFrame. It's mainly used as temporary buffer for conversions.
frame_width Width of the frame.
frame_height Height of the frame.
Returns:
A new AVFrame.
See also:
ffmpeg doc.

Definition at line 97 of file OStreamVideoDecoder.cpp.

References NULL.

Referenced by decode_video_frame().

Here is the caller graph for this function:

IplImage * OStreamVideoDecoder::decode_video_frame ( unsigned char *  buf,
int  buf_size 
)

Parameters:
buf Buffer with encoded data.
buf_size Buffer size.
Returns:
A IplImage, which is the next image in the decoded video stream.

Definition at line 120 of file OStreamVideoDecoder.cpp.

References _codec_context, _decoded_frame, _decoding_type, _opencv_pix_fmt, _opencv_ready_frame, create_avframe(), DEBUG_PRINT, NULL, OSTREAM_DECODING_H263P, and OSTREAM_DECODING_MJPEG.

Referenced by OStreamBufferedSink::afterGettingFrame1().

Here is the call graph for this function:

Here is the caller graph for this function:

bool OStreamVideoDecoder::decoder_initialize (  )  [private]

Returns:
true on success, false on insuccess.

Definition at line 58 of file OStreamVideoDecoder.cpp.

References _codec_context, _codec_decode, _decoded_frame, _decoding_type, DEBUG_PRINT, OSTREAM_DECODING_H263P, and OSTREAM_DECODING_MJPEG.

Referenced by OStreamVideoDecoder().

Here is the caller graph for this function:


Member Data Documentation

AVCodecContext* OStreamVideoDecoder::_codec_context [private]

See also:
ffmpeg doc for this struct

Definition at line 97 of file OStreamVideoDecoder.hh.

Referenced by decode_video_frame(), decoder_initialize(), and ~OStreamVideoDecoder().

AVCodec* OStreamVideoDecoder::_codec_decode [private]

See also:
ffmpeg doc for this struct

Definition at line 94 of file OStreamVideoDecoder.hh.

Referenced by decoder_initialize().

AVFrame* OStreamVideoDecoder::_decoded_frame [private]

See also:
ffmpeg doc for this struct

Definition at line 100 of file OStreamVideoDecoder.hh.

Referenced by decode_video_frame(), and decoder_initialize().

int OStreamVideoDecoder::_decoding_type [private]

See also:
ostream_decoding_type

Definition at line 88 of file OStreamVideoDecoder.hh.

Referenced by decode_video_frame(), and decoder_initialize().

int OStreamVideoDecoder::_fps [private]

Definition at line 91 of file OStreamVideoDecoder.hh.

bool OStreamVideoDecoder::_initialized [private]

Definition at line 81 of file OStreamVideoDecoder.hh.

Referenced by OStreamVideoDecoder().

unsigned char* OStreamVideoDecoder::_internal_buffer [private]

Definition at line 84 of file OStreamVideoDecoder.hh.

Referenced by OStreamVideoDecoder(), and ~OStreamVideoDecoder().

int OStreamVideoDecoder::_internal_buffer_size [private]

Definition at line 85 of file OStreamVideoDecoder.hh.

Referenced by OStreamVideoDecoder().

PixelFormat OStreamVideoDecoder::_opencv_pix_fmt [private]

See also:
ffmpeg doc for this struct

Definition at line 106 of file OStreamVideoDecoder.hh.

Referenced by decode_video_frame().

AVFrame* OStreamVideoDecoder::_opencv_ready_frame [private]

See also:
ffmpeg doc for this struct

Definition at line 103 of file OStreamVideoDecoder.hh.

Referenced by decode_video_frame(), and OStreamVideoDecoder().


The documentation for this class was generated from the following files:
Generated on Tue Dec 26 10:38:47 2006 for Omnimeeting by  doxygen 1.4.7