From cd9dd48c66bc8e401685feaad3c4b54243541bf6 Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Thu, 5 Jul 2012 17:59:05 +0200 Subject: [PATCH] Send Step Events only to one sink. --- gst-sdk/tutorials/basic-tutorial-13.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gst-sdk/tutorials/basic-tutorial-13.c b/gst-sdk/tutorials/basic-tutorial-13.c index d6a07182e9..3dd9a06bf6 100644 --- a/gst-sdk/tutorials/basic-tutorial-13.c +++ b/gst-sdk/tutorials/basic-tutorial-13.c @@ -69,7 +69,12 @@ static gboolean handle_keyboard (GIOChannel *source, GIOCondition cond, CustomDa send_seek_event (data); break; case 'n': - gst_element_send_event (data->pipeline, + 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_BUFFERS, 1, data->rate, TRUE, FALSE)); g_print ("Stepping one frame\n"); break; @@ -106,7 +111,8 @@ int main(int argc, char *argv[]) { " 'Q' to quit\n"); /* Build the pipeline */ - data.pipeline = gst_parse_launch ("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL); +// data.pipeline = gst_parse_launch ("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm", NULL); + data.pipeline = gst_parse_launch ("playbin2 uri=file:///f:/media/sintel/sintel_trailer-480p.webm", NULL); /* Add a keyboard watch so we get notified of keystrokes */ #ifdef _WIN32