#define DEFAULT_MAX_STREAMS G_MAXUINT
#define DEFAULT_MAX_TS_OFFSET_ADJUSTMENT G_GUINT64_CONSTANT(0)
#define DEFAULT_MAX_TS_OFFSET G_GINT64_CONSTANT(3000000000)
+#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
+#define DEFAULT_RTSP_USE_BUFFERING FALSE
+#endif
enum
{
PROP_MAX_STREAMS,
PROP_MAX_TS_OFFSET_ADJUSTMENT,
PROP_MAX_TS_OFFSET,
+#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
+ PROP_USE_RTSP_BUFFERING /* use for player RTSP buffering */
+#endif
};
#define GST_RTP_BIN_RTCP_SYNC_TYPE (gst_rtp_bin_rtcp_sync_get_type())
goto no_demux;
}
#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
- if (session->bin->buffer_mode == RTP_JITTER_BUFFER_MODE_SLAVE)
+ if (rtpbin->use_rtsp_buffering &&
+ rtpbin->buffer_mode == RTP_JITTER_BUFFER_MODE_SLAVE) {
if (!(queue2 = gst_element_factory_make ("queue2", NULL)))
goto no_queue2;
+ }
#endif
stream = g_new0 (GstRtpBinStream, 1);
stream->ssrc = ssrc;
"changed to 0 (no limit)", 0, G_MAXINT64, DEFAULT_MAX_TS_OFFSET,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
+ g_object_class_install_property (gobject_class, PROP_USE_RTSP_BUFFERING,
+ g_param_spec_boolean ("use-rtsp-buffering", "Use RTSP buffering",
+ "Use RTSP buffering in RTP_JITTER_BUFFER_MODE_SLAVE buffer mode",
+ DEFAULT_RTSP_USE_BUFFERING,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+#endif
+
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_rtp_bin_change_state);
gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_rtp_bin_request_new_pad);
rtpbin->max_ts_offset_adjustment = DEFAULT_MAX_TS_OFFSET_ADJUSTMENT;
rtpbin->max_ts_offset = DEFAULT_MAX_TS_OFFSET;
rtpbin->max_ts_offset_is_set = FALSE;
+#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
+ rtpbin->use_rtsp_buffering = FALSE;
+#endif
/* some default SDES entries */
cname = g_strdup_printf ("user%u@host-%x", g_random_int (), g_random_int ());
rtpbin = GST_RTP_BIN (object);
switch (prop_id) {
+#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
+ case PROP_USE_RTSP_BUFFERING:
+ GST_RTP_BIN_LOCK (rtpbin);
+ rtpbin->use_rtsp_buffering = g_value_get_boolean (value);
+ GST_RTP_BIN_UNLOCK (rtpbin);
+ break;
+#endif
case PROP_LATENCY:
GST_RTP_BIN_LOCK (rtpbin);
rtpbin->latency_ms = g_value_get_uint (value);
rtpbin = GST_RTP_BIN (object);
switch (prop_id) {
+#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
+ case PROP_USE_RTSP_BUFFERING:
+ GST_RTP_BIN_LOCK (rtpbin);
+ g_value_set_boolean (value, rtpbin->use_rtsp_buffering);
+ GST_RTP_BIN_UNLOCK (rtpbin);
+ break;
+#endif
case PROP_LATENCY:
GST_RTP_BIN_LOCK (rtpbin);
g_value_set_uint (value, rtpbin->latency_ms);
streams = g_slist_next (streams)) {
GstRtpBinStream *stream = (GstRtpBinStream *) streams->data;
#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
- GstPad *temp_pad_src = NULL;
- GstCaps *temp_caps_src = NULL;
- GstStructure *caps_structure;
- const gchar *caps_str_media = NULL;
- temp_pad_src = gst_element_get_static_pad (stream->buffer, "src");
- temp_caps_src = gst_pad_get_current_caps (temp_pad_src);
- GST_DEBUG_OBJECT (bin,
- "stream %p percent %d : temp_caps_src=%" GST_PTR_FORMAT,
- stream, stream->percent, temp_caps_src);
- if (temp_caps_src) {
- caps_structure = gst_caps_get_structure (temp_caps_src, 0);
- caps_str_media =
- gst_structure_get_string (caps_structure, "media");
- if (caps_str_media != NULL) {
- if ((strcmp (caps_str_media, "video") != 0)
- && (strcmp (caps_str_media, "audio") != 0)) {
- GST_DEBUG_OBJECT (bin,
- "Non Audio/Video Stream.. ignoring the same !!");
- gst_caps_unref (temp_caps_src);
- gst_object_unref (temp_pad_src);
- continue;
- } else if (stream->percent >= 100) {
- /* Most of the time buffering icon displays in rtsp playback.
- Optimizing the buffering updation code. Whenever any stream percentage
- reaches 100 do not post buffering messages. */
- if (stream->prev_percent < 100)
- buffering_flag = TRUE;
- else
- update_buffering_status = FALSE;
+ if (rtpbin->use_rtsp_buffering &&
+ rtpbin->buffer_mode == RTP_JITTER_BUFFER_MODE_SLAVE) {
+ GstPad *temp_pad_src = NULL;
+ GstCaps *temp_caps_src = NULL;
+ GstStructure *caps_structure;
+ const gchar *caps_str_media = NULL;
+ temp_pad_src = gst_element_get_static_pad (stream->buffer, "src");
+ temp_caps_src = gst_pad_get_current_caps (temp_pad_src);
+ GST_DEBUG_OBJECT (bin,
+ "stream %p percent %d : temp_caps_src=%" GST_PTR_FORMAT,
+ stream, stream->percent, temp_caps_src);
+ if (temp_caps_src) {
+ caps_structure = gst_caps_get_structure (temp_caps_src, 0);
+ caps_str_media =
+ gst_structure_get_string (caps_structure, "media");
+ if (caps_str_media != NULL) {
+ if ((strcmp (caps_str_media, "video") != 0)
+ && (strcmp (caps_str_media, "audio") != 0)) {
+ GST_DEBUG_OBJECT (bin,
+ "Non Audio/Video Stream.. ignoring the same !!");
+ gst_caps_unref (temp_caps_src);
+ gst_object_unref (temp_pad_src);
+ continue;
+ } else if (stream->percent >= 100) {
+ /* Most of the time buffering icon displays in rtsp playback.
+ Optimizing the buffering updation code. Whenever any stream percentage
+ reaches 100 do not post buffering messages. */
+ if (stream->prev_percent < 100)
+ buffering_flag = TRUE;
+ else
+ update_buffering_status = FALSE;
+ }
}
+ gst_caps_unref (temp_caps_src);
}
- gst_caps_unref (temp_caps_src);
+ gst_object_unref (temp_pad_src);
+ /* Updating prev stream percentage */
+ stream->prev_percent = stream->percent;
+ } else {
+ GST_DEBUG_OBJECT (bin, "stream %p percent %d", stream,
+ stream->percent);
}
- gst_object_unref (temp_pad_src);
#else
GST_DEBUG_OBJECT (bin, "stream %p percent %d", stream,
stream->percent);
/* find min percent */
if (min_percent > stream->percent)
min_percent = stream->percent;
-#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
- /* Updating prev stream percentage */
- stream->prev_percent = stream->percent;
-#endif
}
} else {
GST_INFO_OBJECT (bin,
}
GST_DEBUG_OBJECT (bin, "min percent %d", min_percent);
#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
- if (rtpbin->buffer_mode != RTP_JITTER_BUFFER_MODE_SLAVE) {
- if (rtpbin->buffering) {
- if (min_percent == 100) {
- rtpbin->buffering = FALSE;
- active = TRUE;
- change = TRUE;
- }
- } else {
- if (min_percent < 100) {
- /* pause the streams */
- rtpbin->buffering = TRUE;
- active = FALSE;
- change = TRUE;
- }
- }
- }
-#else
+ if (!(rtpbin->use_rtsp_buffering &&
+ rtpbin->buffer_mode == RTP_JITTER_BUFFER_MODE_SLAVE)) {
+#endif
if (rtpbin->buffering) {
if (min_percent == 100) {
rtpbin->buffering = FALSE;
change = TRUE;
}
}
+#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
+ }
#endif
GST_RTP_BIN_UNLOCK (rtpbin);
gst_message_unref (message);
#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
- if (rtpbin->buffer_mode == RTP_JITTER_BUFFER_MODE_SLAVE) {
+ if (rtpbin->use_rtsp_buffering &&
+ rtpbin->buffer_mode == RTP_JITTER_BUFFER_MODE_SLAVE) {
if (update_buffering_status == FALSE)
break;
if (buffering_flag) {
buffering_left);
#ifdef TIZEN_FEATURE_RTSP_MODIFICATION
- if (rtpbin->buffer_mode == RTP_JITTER_BUFFER_MODE_SLAVE)
+ if (rtpbin->use_rtsp_buffering &&
+ rtpbin->buffer_mode == RTP_JITTER_BUFFER_MODE_SLAVE)
goto slave_buffering;
#endif
if (G_UNLIKELY (change)) {