From: Younghwan Date: Fri, 2 Sep 2016 09:03:54 +0000 (+0900) Subject: Allow application to set segment time X-Git-Tag: submit/tizen/20160907.074000~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fef84ba8315818d287ff0304005c1fcb69f917dc;p=platform%2Fupstream%2Fgstreamer.git Allow application to set segment time Change-Id: I481d79b2f5a9628151dfb6ceb113c68b3d4e4883 --- diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index 6ab4816045..5303736dc5 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -204,6 +204,9 @@ enum #define DEFAULT_NUM_BUFFERS -1 #define DEFAULT_TYPEFIND FALSE #define DEFAULT_DO_TIMESTAMP FALSE +#ifdef GST_TIZEN_TV +#define DEFAULT_SEGMENT_TIME -1 +#endif enum { @@ -212,6 +215,9 @@ enum PROP_NUM_BUFFERS, PROP_TYPEFIND, PROP_DO_TIMESTAMP +#ifdef GST_TIZEN_TV + ,PROP_UPDATE_SEGMENT +#endif }; #define GST_BASE_SRC_GET_PRIVATE(obj) \ @@ -395,6 +401,13 @@ gst_base_src_class_init (GstBaseSrcClass * klass) g_param_spec_boolean ("do-timestamp", "Do timestamp", "Apply current stream time to buffers", DEFAULT_DO_TIMESTAMP, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +#ifdef GST_TIZEN_TV + g_object_class_install_property (gobject_class, PROP_UPDATE_SEGMENT, + g_param_spec_int64 ("update-segment", "Update Segment", + "Timestamp that application want to set (-1 unlimited)", + -1, G_MAXINT64, DEFAULT_SEGMENT_TIME, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); +#endif gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_base_src_change_state); @@ -798,6 +811,31 @@ gst_base_src_set_do_timestamp (GstBaseSrc * src, gboolean timestamp) GST_OBJECT_UNLOCK (src); } +#ifdef GST_TIZEN_TV +/** +*gst_base_src_update_segment: +*@src: the source +*@timestamp: timestamp to set +*/ +void +gst_base_src_update_segment (GstBaseSrc * src, gint64 timestamp) +{ + g_return_if_fail (GST_IS_BASE_SRC (src)); + + GST_OBJECT_LOCK (src); + if (timestamp != -1) { + GST_DEBUG_OBJECT (src, + "udpate the segment parameter for es player resume playback,%lld", + timestamp); + src->segment.start = timestamp; + src->segment.time = timestamp; + src->segment.position = timestamp; + } + GST_OBJECT_UNLOCK (src); + GST_DEBUG_OBJECT (src, "udpate the segment end"); +} +#endif + /** * gst_base_src_get_do_timestamp: * @src: the source diff --git a/libs/gst/base/gstbasesrc.h b/libs/gst/base/gstbasesrc.h index 4ddfda9052..f5ecb09aae 100644 --- a/libs/gst/base/gstbasesrc.h +++ b/libs/gst/base/gstbasesrc.h @@ -271,6 +271,9 @@ void gst_base_src_get_allocator (GstBaseSrc *src, GstAllocator **allocator, GstAllocationParams *params); +#ifdef GST_TIZEN_TV +void gst_base_src_update_segment (GstBaseSrc * src, gint64 timestamp); +#endif G_END_DECLS