gst_event_new_step on video sink makes audio and video not synchronized. If this is intended, then document
I use fresh debian sid created nearly today, 2019-08-22. I have debian package "gstreamer1.0-x" installed and "gstreamer1.0-gl" not installed. dpkg -l gstreamer1.0-plugins-base
reports 1.16.0-2.
I downloaded https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm and saved it as /tmp/sintel_trailer-480p.webm .
I copy-pasted example code from https://gstreamer.freedesktop.org/documentation/tutorials/basic/playback-speed.html?gi-language=c and applied the following patch:
--- basic-tutorial-13.c 2019-08-22 18:42:12.795268788 +0000
+++ basic-tutorial-13-new.c 2019-08-22 19:42:21.366219110 +0000
@@ -93,6 +93,14 @@
case 'q':
g_main_loop_quit (data->loop);
break;
+ case 't':
+ if (data->video_sink == NULL) {
+ /* If we have not done so, obtain the sink through which we will send the step events */
+ g_object_get (data->pipeline, "video-sink", &data->video_sink, NULL);
+ }
+
+ gst_element_send_event (data->video_sink, gst_event_new_step (GST_FORMAT_TIME, 10 * GST_SECOND, 1.0, TRUE, FALSE));
+ break;
default:
break;
}
@@ -126,7 +134,7 @@
/* Build the pipeline */
data.pipeline =
gst_parse_launch
- ("playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm",
+ ("playbin uri=file:///tmp/sintel_trailer-480p.webm",
NULL);
/* Add a keyboard watch so we get notified of keystrokes */
I compiled this code and run it. And then I entered "t". And I see that audio and video become not synchronized. I expected them to be synchronized.
Is this a bug? If yes, then fix it. If no, then please document that this is intended behavior.
https://gstreamer.freedesktop.org/documentation/tutorials/basic/playback-speed.html?gi-language=c says that we should send seek events to video sink instead of whole pipeline. But it doesn't say that step events work differently. Moreover, example code sends step event to video sink. Canonical documentation for step events (i. e. https://gstreamer.freedesktop.org/documentation/gstreamer/gstevent.html?gi-language=c#gst_event_new_step ) doesn't say that (i. e. "you should send step event to whole pipeline"), too. So, if behavior I observed is intentional, then, please, document it. Both in https://gstreamer.freedesktop.org/documentation/tutorials/basic/playback-speed.html?gi-language=c (including provided code) and canonical step documentation ( https://gstreamer.freedesktop.org/documentation/gstreamer/gstevent.html?gi-language=c#gst_event_new_step )