Segment event generation at source plugin (Push mode)
AshishS
tattibits at gmail.com
Wed Sep 10 06:50:54 PDT 2014
Hi Muller,
Thanks for the advice.
Below are details.
I am writing a source plugin derived from GstBaseSrc
GObject
+----GstObject
+----GstElement
+----GstBaseSrc
+----GstMySrc
I wan't plugin to play media from http stream (Play/Pause/Stop is working
fine, Seeks are not allowed), Plugin will be initiated in push mode with
GST_FORMAT_BYTES as supported format and check_get_range() is set to false.
Now while normal play i want to Fast forward with different speeds.
I tried pushing the new segment event but it failed at audiosink with format
not supported message. Below sample code, i was pushing this event while
pipeline in playing state and from my source plugin's create() call.
GstEvent * newSegEvent = gst_event_new_new_segment(FALSE, 2.0 ,
GST_FORMAT_BYTES, 0, -1 , currentBytePosInStream);
result = gst_pad_push_event (pad, newSegEvent);
Then i tried gst_base_src_new_seamless_segment() which works fine first
time, but not consistent when i re change the play speed.
So, please let me know how to go about it, please do let me know if you need
more details.
Thanks,
Ashish S
Tim Müller wrote
> On Wed, 2014-09-10 at 05:53 -0700, AshishS wrote:
>
> Hi,
>
> the reason you might not be getting any response to your questions is
> that it's really quite unclear what you are trying to do exactly. If you
> tell us a bit more about what kind of element you're writing and what
> you are trying to do exactly, people can probably point you in the right
> direction. It would also be good to know which GStreamer version you're
> using.
>
> It is quite unlikely that you will need to use new_seamless_segment()
> unless you're writing a DVD source or similar.
>
> Cheers
> -Tim
>
>>
>> I am using below
>>
>> =======
>> /**
>> * gst_base_src_new_seamless_segment:
>> * @src: The source
>> * @start: The new start value for the segment
>> * @stop: Stop value for the new segment
>> * @position: The position value for the new segent
>> *
>> * Prepare a new seamless segment for emission downstream. This function
>> must
>> * only be called by derived sub-classes, and only from the create()
>> function,
>> * as the stream-lock needs to be held.
>> *
>> * The format for the new segment will be the current format of the
>> source,
>> as
>> * configured with gst_base_src_set_format()
>> *
>> * Returns: %TRUE if preparation of the seamless segment succeeded.
>> *
>> * Since: 0.10.26
>> */
>> gboolean
>> gst_base_src_new_seamless_segment (GstBaseSrc * src, gint64 start, gint64
>> stop,
>> gint64 position)
>> ======
>>
>> I am calling this from create function in my source plugin,
>>
>> when i call as below first time:-
>> ===
>> basesrc->segment.rate = 2.0;
>> ret = gst_base_src_new_seamless_segment(basesrc, 0, stopPos : -1,
>> currPos)
>> ===
>> Media play immediately with 2x speed, now when I want to reset to 1.0
>> rate,
>> i do below
>> ===
>> basesrc->segment.rate = 1.0;
>> ret = gst_base_src_new_seamless_segment(basesrc, 0, stopPos : -1,
>> currPos)
>> ===
>> This time play hang's around for 5min, then starts playing at 1x speed.
>>
>> Why play hangs, what is going wrong here please let me know? except the
>> comment for the function in "gstbasesrc.c" i did not found any much
>> information how it works.
>>
>> Please let me know the correct behavior and some knowledge sharing on the
>> same
>>
>> Thanks
>> Ashish S
>>
>>
>>
>> --
>> View this message in context:
>> http://gstreamer-devel.966125.n4.nabble.com/Segment-event-generation-at-source-plugin-Push-mode-tp4668625p4668634.html
>> Sent from the GStreamer-devel mailing list archive at Nabble.com.
>> _______________________________________________
>> gstreamer-devel mailing list
>>
> gstreamer-devel at .freedesktop
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> --
> Tim Müller, Centricular Ltd - http://www.centricular.com
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at .freedesktop
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Segment-event-generation-at-source-plugin-Push-mode-tp4668625p4668638.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list