#include <OStreamReceiver.hh>
Definition at line 49 of file OStreamReceiver.hh.
Public Member Functions | |
OStreamReceiver (const char *dest_rtsp_url, on_packet_video_received_cb *f_on_packet_video_received_cb, const void *video_callback_data, on_packet_audio_received_cb *f_on_packet_audio_received_cb, const void *audio_callback_data, const char *receiving_iface="0.0.0.0", unsigned int sink_buffer_size=200000) | |
Constructor. | |
virtual | ~OStreamReceiver () |
int | isReadyToStream () |
Check the receiving status. | |
int | startReceiving () |
Start to receive. | |
void | stopReceiving () |
Commands the stop of the receiving session. | |
Static Public Member Functions | |
static void | subsessionAfterPlaying (void *mediaSubSess) |
Static members: mainly to manage callbacks functions. | |
static void | subsessionByeHandler (void *mediaSubSess) |
static void | startPlayingStreams (void *OStreamReceiverClassPointer) |
static void | checkForPacketArrival (void *OStreamReceiverClassPointer) |
Private Member Functions | |
bool | createRTSPClient () |
Create a new RTSPClient internally stored. | |
bool | createMediaSession () |
Create a new MediaSession internally stored. | |
int | getSDPDescriptionFromURL (char const *url) |
Retrieves the SDP description from the specified url. | |
void | setupStreams () |
Setup the internal streams. | |
bool | clientStartPlayingSession () |
Start the playing session. | |
bool | clientSetupSubsession (void *mediaSubSess) |
void | closeMediaSinks () |
void | shutdown () |
Shutdown the client and the connections, e.g. | |
Private Attributes | |
on_packet_video_received_cb * | f_on_packet_video_received_cb |
callback functions to which the frames will be delivered | |
on_packet_audio_received_cb * | f_on_packet_audio_received_cb |
callback functions to which the frames will be delivered | |
int | _error_status |
Last error status. | |
double | _end_time |
SDP end time. | |
char * | _sdp_description |
The SDP Description, something like "Session streamed by Omnimeeting". | |
const char * | _client_protocol_name |
Protocol name. | |
char | _watch_variable |
This var is used to exit the event-driven loop made by LiveMedia on receiving. | |
unsigned int | _sink_buffer_size |
The Sink Buffer Size. | |
const void * | _callback_video_data_client |
Callback video data. | |
const void * | _callback_audio_data_client |
Callback audio data. | |
char * | _receiving_iface |
Receiving interface. | |
UsageEnvironment * | _env |
TaskScheduler * | _scheduler |
RTSPClient * | _rtsp_client |
TaskToken | _arrival_check_timer_task |
MediaSession * | _media_session |
A data structure that represents a session that consists of potentially multiple (audio and/or video) sub-sessions (This data structure is used for media *receivers* - i.e., clients. |
OStreamReceiver::OStreamReceiver | ( | const char * | dest_rtsp_url, | |
on_packet_video_received_cb * | f_on_packet_video_received_cb, | |||
const void * | video_callback_data, | |||
on_packet_audio_received_cb * | f_on_packet_audio_received_cb, | |||
const void * | audio_callback_data, | |||
const char * | receiving_iface = "0.0.0.0" , |
|||
unsigned int | sink_buffer_size = 200000 | |||
) |
dest_rtsp_url | Something like "rtsp://12.23.34.45:8554/testStream" | |
f_on_packet_video_received_cb | Callback function. Will be used by the Sink Class [video]. | |
video_callback_data | Callback data for video parsing function. | |
f_on_packet_audio_received_cb | Callback function. Will be used by the Sink Class [audio]. | |
audio_callback_data | Callback data for audio parsing function. | |
receiving_iface | FIXME. won't work for now. Defaults to "0.0.0.0" | |
sink_buffer_size | Size of the internal buffer will have. |
Definition at line 26 of file OStreamReceiver.cpp.
References _arrival_check_timer_task, _client_protocol_name, _end_time, _env, _error_status, _media_session, _receiving_iface, _scheduler, _watch_variable, createMediaSession(), createRTSPClient(), ERROR_FAILED_CREATE_MEDIASESSION, ERROR_FAILED_CREATE_RTSP_CLIENT, ERROR_FAILED_SDP_DESCRIPTION, ERROR_NORMAL_STATUS, getSDPDescriptionFromURL(), NULL, and shutdown().
Here is the call graph for this function:
OStreamReceiver::~OStreamReceiver | ( | ) | [virtual] |
Definition at line 77 of file OStreamReceiver.cpp.
References _env, _receiving_iface, _scheduler, _sdp_description, and NULL.
void OStreamReceiver::checkForPacketArrival | ( | void * | OStreamReceiverClassPointer | ) | [static] |
Definition at line 307 of file OStreamReceiver.cpp.
References _arrival_check_timer_task, _env, _error_status, _media_session, ERROR_NORMAL_STATUS, and NULL.
Referenced by startPlayingStreams().
Here is the caller graph for this function:
bool OStreamReceiver::clientSetupSubsession | ( | void * | mediaSubSess | ) | [private] |
Definition at line 117 of file OStreamReceiver.cpp.
References _rtsp_client.
Referenced by setupStreams().
Here is the caller graph for this function:
bool OStreamReceiver::clientStartPlayingSession | ( | ) | [private] |
Definition at line 105 of file OStreamReceiver.cpp.
References _media_session, and _rtsp_client.
Referenced by startPlayingStreams().
Here is the caller graph for this function:
void OStreamReceiver::closeMediaSinks | ( | ) | [private] |
Definition at line 129 of file OStreamReceiver.cpp.
References _media_session, and NULL.
Referenced by startReceiving().
Here is the caller graph for this function:
bool OStreamReceiver::createMediaSession | ( | ) | [private] |
Definition at line 471 of file OStreamReceiver.cpp.
References _env, _media_session, _sdp_description, and NULL.
Referenced by OStreamReceiver().
Here is the caller graph for this function:
bool OStreamReceiver::createRTSPClient | ( | ) | [private] |
Definition at line 455 of file OStreamReceiver.cpp.
References _env, _rtsp_client, and NULL.
Referenced by OStreamReceiver().
Here is the caller graph for this function:
int OStreamReceiver::getSDPDescriptionFromURL | ( | char const * | url | ) | [private] |
url | Something like "rtsp://12.23.34.45:8554/testStream" |
Definition at line 436 of file OStreamReceiver.cpp.
References _env, _rtsp_client, _sdp_description, and NULL.
Referenced by OStreamReceiver().
Here is the caller graph for this function:
int OStreamReceiver::isReadyToStream | ( | ) |
Definition at line 95 of file OStreamReceiver.cpp.
References _error_status.
Referenced by ReceiverCtrlThread::Entry().
Here is the caller graph for this function:
void OStreamReceiver::setupStreams | ( | ) | [private] |
Definition at line 403 of file OStreamReceiver.cpp.
References _env, _error_status, _media_session, clientSetupSubsession(), ERROR_FAILED_SETUP_STREAMS, NULL, and shutdown().
Referenced by startReceiving().
Here is the call graph for this function:
Here is the caller graph for this function:
void OStreamReceiver::shutdown | ( | ) | [private] |
sockets etc. This is called when a "stop receive" command is issued.
Definition at line 148 of file OStreamReceiver.cpp.
References _arrival_check_timer_task, _env, and _watch_variable.
Referenced by OStreamReceiver(), setupStreams(), startPlayingStreams(), startReceiving(), and stopReceiving().
Here is the caller graph for this function:
void OStreamReceiver::startPlayingStreams | ( | void * | OStreamReceiverClassPointer | ) | [static] |
Definition at line 356 of file OStreamReceiver.cpp.
References _end_time, _env, _media_session, checkForPacketArrival(), clientStartPlayingSession(), and shutdown().
Referenced by startReceiving().
Here is the call graph for this function:
Here is the caller graph for this function:
int OStreamReceiver::startReceiving | ( | ) |
Definition at line 169 of file OStreamReceiver.cpp.
References _callback_audio_data_client, _callback_video_data_client, _env, _error_status, _media_session, _receiving_iface, _rtsp_client, _sink_buffer_size, _watch_variable, closeMediaSinks(), OStreamBufferedSink::createNew(), ERROR_FAILED_FILE_SINK_CREATION, ERROR_FAILED_TO_CREATE_RECEIVER, ERROR_NORMAL_STATUS, f_on_packet_audio_received_cb, f_on_packet_video_received_cb, NULL, setupStreams(), shutdown(), startPlayingStreams(), subsessionAfterPlaying(), and subsessionByeHandler().
Referenced by ReceiverCtrlThread::Entry().
Here is the call graph for this function:
Here is the caller graph for this function:
void OStreamReceiver::stopReceiving | ( | ) |
Definition at line 298 of file OStreamReceiver.cpp.
References shutdown().
Referenced by ReceiverCtrlThread::StopReceiving().
Here is the call graph for this function:
Here is the caller graph for this function:
void OStreamReceiver::subsessionAfterPlaying | ( | void * | mediaSubSess | ) | [static] |
Definition at line 384 of file OStreamReceiver.cpp.
References NULL.
Referenced by startReceiving(), and subsessionByeHandler().
Here is the caller graph for this function:
void OStreamReceiver::subsessionByeHandler | ( | void * | mediaSubSess | ) | [static] |
Definition at line 289 of file OStreamReceiver.cpp.
References subsessionAfterPlaying().
Referenced by startReceiving().
Here is the call graph for this function:
Here is the caller graph for this function:
TaskToken OStreamReceiver::_arrival_check_timer_task [private] |
Definition at line 184 of file OStreamReceiver.hh.
Referenced by checkForPacketArrival(), OStreamReceiver(), and shutdown().
const void* OStreamReceiver::_callback_audio_data_client [private] |
const void* OStreamReceiver::_callback_video_data_client [private] |
const char* OStreamReceiver::_client_protocol_name [private] |
Usually set at "RTSP"
Definition at line 159 of file OStreamReceiver.hh.
Referenced by OStreamReceiver().
double OStreamReceiver::_end_time [private] |
Definition at line 153 of file OStreamReceiver.hh.
Referenced by OStreamReceiver(), and startPlayingStreams().
UsageEnvironment* OStreamReceiver::_env [private] |
Definition at line 181 of file OStreamReceiver.hh.
Referenced by checkForPacketArrival(), createMediaSession(), createRTSPClient(), getSDPDescriptionFromURL(), OStreamReceiver(), setupStreams(), shutdown(), startPlayingStreams(), startReceiving(), and ~OStreamReceiver().
int OStreamReceiver::_error_status [private] |
Definition at line 150 of file OStreamReceiver.hh.
Referenced by checkForPacketArrival(), isReadyToStream(), OStreamReceiver(), setupStreams(), and startReceiving().
MediaSession* OStreamReceiver::_media_session [private] |
For media streamers, use "ServerMediaSession" instead.)
Definition at line 193 of file OStreamReceiver.hh.
Referenced by checkForPacketArrival(), clientStartPlayingSession(), closeMediaSinks(), createMediaSession(), OStreamReceiver(), setupStreams(), startPlayingStreams(), and startReceiving().
char* OStreamReceiver::_receiving_iface [private] |
Definition at line 178 of file OStreamReceiver.hh.
Referenced by OStreamReceiver(), startReceiving(), and ~OStreamReceiver().
RTSPClient* OStreamReceiver::_rtsp_client [private] |
Definition at line 183 of file OStreamReceiver.hh.
Referenced by clientSetupSubsession(), clientStartPlayingSession(), createRTSPClient(), getSDPDescriptionFromURL(), and startReceiving().
TaskScheduler* OStreamReceiver::_scheduler [private] |
Definition at line 182 of file OStreamReceiver.hh.
Referenced by OStreamReceiver(), and ~OStreamReceiver().
char* OStreamReceiver::_sdp_description [private] |
Definition at line 156 of file OStreamReceiver.hh.
Referenced by createMediaSession(), getSDPDescriptionFromURL(), and ~OStreamReceiver().
unsigned int OStreamReceiver::_sink_buffer_size [private] |
This should be set quite high or there will be problems receiving for instance large JPEG frames.
Definition at line 169 of file OStreamReceiver.hh.
Referenced by startReceiving().
char OStreamReceiver::_watch_variable [private] |
Definition at line 162 of file OStreamReceiver.hh.
Referenced by OStreamReceiver(), shutdown(), and startReceiving().