Src element changes stream position by itself

Vladan Jovanovic vladan.jovanovic at gmail.com
Tue Apr 25 11:50:21 UTC 2023


On Wed, Apr 5, 2023 at 9:17 PM Nicolas Dufresne <nicolas at ndufresne.ca>
wrote:

>
>
> Basically looking for a way for src element to keep its stream position
> and just continue where it was prior to being added to a new pipeline.
>
>
> Best is to write a minimal test app to show the issue, its is a bit too
> abstract to understand what is going on for you.
>
>
> Took a while due to vacation etc. but here is the test app to demonstrate
the core of the issue. Use following steps:

   1. ./video_switch_test1 video1_uri video2_uri
      - This will start video1_uri playback on window1
      2. wait for about 10sec (so that the issue is easier to notice)
   3. Press s+<ENTER> in console
   - This will start video2_uri playback on window2
      - After some time video2_uri window2 will close and video2_uri
      playback should just continue on window1 (from position where it was on
      window2)
      - Instead, what will happen is that video2_uri playback starts on
      window1, BUT its position changes so it continues playback from where
      video1_uri was at that time (so if you waited for 10 seconds it will skip
      10 seconds and continue from there).
   4. At any time you can press i+<ENTER> to get both pipelines dumped to
   dotfile for easier understanding of the setup.

Code is pretty straightforward and relies on two blocking probes to block
the two separate pipelines prior to exchanging elements (when processing
GST_MESSAGE_APPLICATION message).

Trying to understand why element playing video2_uri (by default it's
uridecodebin3) changes position of the stream after being moved from
backup-pipeline to main-pipeline. Any help appreciated.

br,
Vladan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230425/61938c09/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: meson.build
Type: application/octet-stream
Size: 762 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230425/61938c09/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: video_switch_test.c
Type: application/octet-stream
Size: 13085 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230425/61938c09/attachment-0003.obj>


More information about the gstreamer-devel mailing list