#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
#define DEFAULT_START_POSITION 0
+#define DEFAULT_STREAM_INFO_MESSAGE TRUE
#endif
enum
#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
PROP_START_POSITION,
PROP_RESUME_POSITION,
+ PROP_POST_STREAM_INFO_MESSAGE,
#endif
PROP_TCP_TIMEOUT,
PROP_LATENCY,
"Set resume position before PLAYING request after pause.",
0, G_MAXUINT64, DEFAULT_START_POSITION,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (gobject_class, PROP_POST_STREAM_INFO_MESSAGE,
+ g_param_spec_uint64 ("stream-info-message", "set stream info message",
+ "Send stream info message when stream is opened.",
+ 0, G_MAXUINT64, DEFAULT_STREAM_INFO_MESSAGE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
#endif
g_object_class_install_property (gobject_class, PROP_TCP_TIMEOUT,
g_param_spec_uint64 ("tcp-timeout", "TCP Timeout",
GST_DEBUG_OBJECT (rtspsrc, "src->last_pos value set to %" GST_TIME_FORMAT,
GST_TIME_ARGS (rtspsrc->last_pos));
break;
+ case PROP_POST_STREAM_INFO_MESSAGE:
+ rtspsrc->post_stream_info_message = g_value_get_boolean (value);
+ GST_INFO_OBJECT (rtspsrc, "src->post_stream_info_message value set to %d", rtspsrc->post_stream_info_message);
+ break;
#endif
case PROP_TCP_TIMEOUT:
gst_rtspsrc_set_tcp_timeout (rtspsrc, g_value_get_uint64 (value));
case PROP_RESUME_POSITION:
g_value_set_uint64 (value, rtspsrc->last_pos);
break;
+ case PROP_POST_STREAM_INFO_MESSAGE:
+ g_value_set_boolean (value, rtspsrc->post_stream_info_message);
+ break;
#endif
case PROP_TCP_TIMEOUT:
g_value_set_uint64 (value, rtspsrc->tcp_timeout);
gst_rtspsrc_loop_complete_cmd (GstRTSPSrc * src, gint cmd)
{
#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
- GstMessage *s;
+ GstMessage *s = NULL;
GST_WARNING_OBJECT (src, "Got cmd %s", cmd_to_string (cmd));
#endif
switch (cmd) {
case CMD_OPEN:
#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
- GST_DEBUG_OBJECT (src,
- "rtsp_duration %" GST_TIME_FORMAT
- ", rtsp_audio_codec %s , rtsp_video_codec %s , rtsp_video_frame_size %s",
- GST_TIME_ARGS (src->segment.duration), src->audio_codec,
- src->video_codec, src->video_frame_size);
-
- /* post message */
- s = gst_message_new_element (GST_OBJECT_CAST (src),
- gst_structure_new ("rtspsrc_properties",
- "rtsp_duration", G_TYPE_UINT64, src->segment.duration,
- "rtsp_audio_codec", G_TYPE_STRING, src->audio_codec,
- "rtsp_video_codec", G_TYPE_STRING, src->video_codec,
- "rtsp_video_frame_size", G_TYPE_STRING, src->video_frame_size,
- NULL));
-
- gst_element_post_message (GST_ELEMENT_CAST (src), s);
+ if (src->post_stream_info_message) {
+ GST_DEBUG_OBJECT (src,
+ "rtsp_duration %" GST_TIME_FORMAT
+ ", rtsp_audio_codec %s , rtsp_video_codec %s , rtsp_video_frame_size %s",
+ GST_TIME_ARGS (src->segment.duration), src->audio_codec,
+ src->video_codec, src->video_frame_size);
+
+ /* post message */
+ s = gst_message_new_element (GST_OBJECT_CAST (src),
+ gst_structure_new ("rtspsrc_properties",
+ "rtsp_duration", G_TYPE_UINT64, src->segment.duration,
+ "rtsp_audio_codec", G_TYPE_STRING, src->audio_codec,
+ "rtsp_video_codec", G_TYPE_STRING, src->video_codec,
+ "rtsp_video_frame_size", G_TYPE_STRING, src->video_frame_size,
+ NULL));
+
+ gst_element_post_message (GST_ELEMENT_CAST (src), s);
+ }
#endif
GST_ELEMENT_PROGRESS (src, COMPLETE, "open", ("Opened Stream"));
#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
- /* rtspsrc PAUSE state should be here for parsing sdp before PAUSE state changed. */
- g_mutex_lock (&(src)->pause_lock);
- g_cond_signal (&(src)->open_end);
- g_mutex_unlock (&(src)->pause_lock);
+ if (s) {
+ /* rtspsrc PAUSE state should be here for parsing sdp before PAUSE state changed. */
+ g_mutex_lock (&(src)->pause_lock);
+ g_cond_signal (&(src)->open_end);
+ g_mutex_unlock (&(src)->pause_lock);
+ }
#endif
break;
case CMD_PLAY:
case CMD_OPEN:
GST_ELEMENT_PROGRESS (src, ERROR, "open", ("Open failed"));
#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
- /* Ending conditional wait for pause when open fails.*/
- g_mutex_lock (&(src)->pause_lock);
- g_cond_signal (&(src)->open_end);
- g_mutex_unlock (&(src)->pause_lock);
- GST_WARNING_OBJECT (src,
- "ending conditional wait for pause as open is failed.");
+ if (src->post_stream_info_message) {
+ /* Ending conditional wait for pause when open fails.*/
+ g_mutex_lock (&(src)->pause_lock);
+ g_cond_signal (&(src)->open_end);
+ g_mutex_unlock (&(src)->pause_lock);
+ GST_WARNING_OBJECT (src,
+ "ending conditional wait for pause as open is failed.");
+ }
#endif
break;
case CMD_PLAY:
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
- /* don't change to PAUSE state before complete stream opend.
- see gst_rtspsrc_loop_complete_cmd() */
- g_mutex_lock (&(rtspsrc)->pause_lock);
- end_time = g_get_monotonic_time () + 10 * G_TIME_SPAN_SECOND;
- if (!g_cond_wait_until (&(rtspsrc)->open_end, &(rtspsrc)->pause_lock,
- end_time)) {
- GST_WARNING_OBJECT (rtspsrc,
- "time out: stream opend is not completed yet..");
+ if (rtspsrc->post_stream_info_message) {
+ /* don't change to PAUSE state before complete stream opend.
+ see gst_rtspsrc_loop_complete_cmd() */
+ g_mutex_lock (&(rtspsrc)->pause_lock);
+ end_time = g_get_monotonic_time () + 10 * G_TIME_SPAN_SECOND;
+ if (!g_cond_wait_until (&(rtspsrc)->open_end, &(rtspsrc)->pause_lock,
+ end_time)) {
+ GST_WARNING_OBJECT (rtspsrc,
+ "time out: stream opend is not completed yet..");
+ }
+ g_mutex_unlock (&(rtspsrc)->pause_lock);
}
- g_mutex_unlock (&(rtspsrc)->pause_lock);
#endif
if (rtspsrc->is_live)
ret = GST_STATE_CHANGE_NO_PREROLL;