OStreamBufferedSink Class Reference

#include <OStreamBufferedSink.hh>

Collaboration diagram for OStreamBufferedSink:

Collaboration graph
[legend]
List of all members.

Detailed Description

The MediaSink, from which this class derives, will receive RTP packets from the net. Then decapsulate them and pass to a "sinker" class. In this case it's this class. OStreamBufferedSink will pass the received packets, via callbacks, to other processing classes.

Definition at line 62 of file OStreamBufferedSink.hh.

Static Public Member Functions

static OStreamBufferedSink * createNew (UsageEnvironment &env, on_packet_video_received_cb *fv, const void *vid_callback_data, on_packet_audio_received_cb *fa, const void *aud_callback_data, const char *subsession_codec, int stream_id, const char *receiving_iface, unsigned int buffer_size=200000)
 Creates and returns a new instance of OStreamBufferedSink.

Protected Member Functions

 OStreamBufferedSink (UsageEnvironment &env, on_packet_video_received_cb *fv, const void *vid_callback_data, on_packet_audio_received_cb *fa, const void *aud_callback_data, const char *subsession_codec, int stream_id, const char *receiving_iface, unsigned buffer_size)
 Constructor.
virtual ~OStreamBufferedSink ()
virtual void afterGettingFrame1 (unsigned frameSize, struct timeval presentationTime)

Static Protected Member Functions

static void afterGettingFrame (void *clientData, unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)

Protected Attributes

on_packet_video_received_cb * f_on_packet_video_received_cb
 Callback function to which the frames will be delivered to.
on_packet_audio_received_cb * f_on_packet_audio_received_cb
 Callback function to which the frames will be delivered to.

Private Member Functions

bool parse_codec_str ()
 Parse the codec string and set the _subsession_codec_id parameter.
virtual Boolean continuePlaying ()
 Redefined virtual function.

Private Attributes

unsigned char * _packet_buffer
 The received packet data will be put on this buffer.
unsigned int _packet_buffer_size
 Buffer size.
char * _subsession_codec_str
 Char to specity the codec id.
ostream_decoding_type _subsession_codec_id
 Enum to wrap ffmpeg CodecID parameter.
int _stream_id
 Stream id associated with this class.
OStreamVideoDecoder * _video_decoder
 VideoDecoder.
const void * _callback_video_data_packet_receiver
 Callback data for video data.
const void * _callback_audio_data_packet_receiver
 Callback data for audio data.


Constructor & Destructor Documentation

OStreamBufferedSink::OStreamBufferedSink ( UsageEnvironment &  env,
on_packet_video_received_cb *  fv,
const void *  vid_callback_data,
on_packet_audio_received_cb *  fa,
const void *  aud_callback_data,
const char *  subsession_codec,
int  stream_id,
const char *  receiving_iface,
unsigned  buffer_size 
) [protected]

See also:
createNew

Referenced by createNew().

Here is the caller graph for this function:

OStreamBufferedSink::~OStreamBufferedSink (  )  [protected, virtual]

Definition at line 90 of file OStreamBufferedSink.cpp.

References _packet_buffer, _subsession_codec_str, _video_decoder, and NULL.


Member Function Documentation

void OStreamBufferedSink::afterGettingFrame ( void *  clientData,
unsigned  frameSize,
unsigned  numTruncatedBytes,
struct timeval  presentationTime,
unsigned  durationInMicroseconds 
) [static, protected]

See also:
MP3FromPCM

Definition at line 122 of file OStreamBufferedSink.cpp.

References afterGettingFrame1().

Referenced by continuePlaying().

Here is the call graph for this function:

Here is the caller graph for this function:

void OStreamBufferedSink::afterGettingFrame1 ( unsigned  frameSize,
struct timeval  presentationTime 
) [protected, virtual]

See also:
MP3FromPCM

Definition at line 134 of file OStreamBufferedSink.cpp.

References _callback_audio_data_packet_receiver, _callback_video_data_packet_receiver, _packet_buffer, _stream_id, _subsession_codec_id, _video_decoder, continuePlaying(), OStreamVideoDecoder::decode_video_frame(), f_on_packet_audio_received_cb, f_on_packet_video_received_cb, OSTREAM_DECODING_H263P, OSTREAM_DECODING_MJPEG, and OSTREAM_DECODING_MP3.

Referenced by afterGettingFrame().

Here is the call graph for this function:

Here is the caller graph for this function:

Boolean OStreamBufferedSink::continuePlaying (  )  [private, virtual]

Definition at line 105 of file OStreamBufferedSink.cpp.

References _packet_buffer, _packet_buffer_size, afterGettingFrame(), and NULL.

Referenced by afterGettingFrame1().

Here is the call graph for this function:

Here is the caller graph for this function:

OStreamBufferedSink * OStreamBufferedSink::createNew ( UsageEnvironment &  env,
on_packet_video_received_cb *  fv,
const void *  vid_callback_data,
on_packet_audio_received_cb *  fa,
const void *  aud_callback_data,
const char *  subsession_codec,
int  stream_id,
const char *  receiving_iface,
unsigned int  buffer_size = 200000 
) [static]

Parameters:
env UsageEnvironment see LiveMedia doc. here http://www.live555.com/liveMedia/public/doxygen/html
fv Callback func where to pass the video packets.
vid_callback_data Callback video data.
fa Callback func where to pass the audio packets.
aud_callback_data Callback audio data.
subsession_codec String that identifies the codec. Something like "H263-1998".
stream_id The stream id to manage. It's useful for multi-stream of single-stream modes.
receiving_iface A string to represent the receiving interface. FIXME. Won't work for now.
buffer_size Should be at least as large as the largest expected. Defaults to 200000.

Definition at line 79 of file OStreamBufferedSink.cpp.

References OStreamBufferedSink().

Referenced by OStreamReceiver::startReceiving().

Here is the call graph for this function:

Here is the caller graph for this function:

bool OStreamBufferedSink::parse_codec_str (  )  [private]

Definition at line 178 of file OStreamBufferedSink.cpp.

References _subsession_codec_id, _subsession_codec_str, NULL, OSTREAM_DECODING_H263P, OSTREAM_DECODING_MJPEG, and OSTREAM_DECODING_MP3.


Member Data Documentation

const void* OStreamBufferedSink::_callback_audio_data_packet_receiver [private]

Definition at line 150 of file OStreamBufferedSink.hh.

Referenced by afterGettingFrame1().

const void* OStreamBufferedSink::_callback_video_data_packet_receiver [private]

Definition at line 147 of file OStreamBufferedSink.hh.

Referenced by afterGettingFrame1().

unsigned char* OStreamBufferedSink::_packet_buffer [private]

Definition at line 126 of file OStreamBufferedSink.hh.

Referenced by afterGettingFrame1(), continuePlaying(), and ~OStreamBufferedSink().

unsigned int OStreamBufferedSink::_packet_buffer_size [private]

Definition at line 129 of file OStreamBufferedSink.hh.

Referenced by continuePlaying().

int OStreamBufferedSink::_stream_id [private]

Definition at line 138 of file OStreamBufferedSink.hh.

Referenced by afterGettingFrame1().

ostream_decoding_type OStreamBufferedSink::_subsession_codec_id [private]

Definition at line 135 of file OStreamBufferedSink.hh.

Referenced by afterGettingFrame1(), and parse_codec_str().

char* OStreamBufferedSink::_subsession_codec_str [private]

Definition at line 132 of file OStreamBufferedSink.hh.

Referenced by parse_codec_str(), and ~OStreamBufferedSink().

OStreamVideoDecoder* OStreamBufferedSink::_video_decoder [private]

See also:
OStreamVideoDecoder.

Definition at line 144 of file OStreamBufferedSink.hh.

Referenced by afterGettingFrame1(), and ~OStreamBufferedSink().

on_packet_audio_received_cb* OStreamBufferedSink::f_on_packet_audio_received_cb [protected]

Definition at line 115 of file OStreamBufferedSink.hh.

Referenced by afterGettingFrame1().

on_packet_video_received_cb* OStreamBufferedSink::f_on_packet_video_received_cb [protected]

Definition at line 112 of file OStreamBufferedSink.hh.

Referenced by afterGettingFrame1().


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