diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-09-22 19:35:00 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-09-24 09:32:27 +0200 |
commit | e0fd5317df193acb671e67f276a2ca2e5fa8c4b8 (patch) | |
tree | b7fb49d97958a1c1f6cca2fb36c32772fc208575 /sys/decklink/gstdecklinkvideosink.cpp | |
parent | 3417a1507657505cae943d161282dc72982c2241 (diff) | |
download | gstreamer-plugins-bad-e0fd5317df193acb671e67f276a2ca2e5fa8c4b8.tar.gz |
decklink: Disable inputs/outputs in PAUSED->READY to allow going to PAUSED again from there
https://bugzilla.gnome.org/show_bug.cgi?id=755426
Diffstat (limited to 'sys/decklink/gstdecklinkvideosink.cpp')
-rw-r--r-- | sys/decklink/gstdecklinkvideosink.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/sys/decklink/gstdecklinkvideosink.cpp b/sys/decklink/gstdecklinkvideosink.cpp index 520c50a4f..e1f520cbf 100644 --- a/sys/decklink/gstdecklinkvideosink.cpp +++ b/sys/decklink/gstdecklinkvideosink.cpp @@ -142,6 +142,7 @@ static GstFlowReturn gst_decklink_video_sink_render (GstBaseSink * bsink, GstBuffer * buffer); static gboolean gst_decklink_video_sink_open (GstBaseSink * bsink); static gboolean gst_decklink_video_sink_close (GstBaseSink * bsink); +static gboolean gst_decklink_video_sink_stop (GstDecklinkVideoSink * self); static gboolean gst_decklink_video_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query); @@ -539,7 +540,7 @@ gst_decklink_video_sink_open (GstBaseSink * bsink) GstDecklinkVideoSink *self = GST_DECKLINK_VIDEO_SINK_CAST (bsink); const GstDecklinkMode *mode; - GST_DEBUG_OBJECT (self, "Starting"); + GST_DEBUG_OBJECT (self, "Stopping"); self->output = gst_decklink_acquire_nth_output (self->device_number, @@ -569,7 +570,7 @@ gst_decklink_video_sink_close (GstBaseSink * bsink) { GstDecklinkVideoSink *self = GST_DECKLINK_VIDEO_SINK_CAST (bsink); - GST_DEBUG_OBJECT (self, "Stopping"); + GST_DEBUG_OBJECT (self, "Closing"); if (self->output) { g_mutex_lock (&self->output->lock); @@ -580,7 +581,6 @@ gst_decklink_video_sink_close (GstBaseSink * bsink) g_mutex_unlock (&self->output->lock); self->output->output->DisableVideoOutput (); - self->output->output->SetScheduledFrameCompletionCallback (NULL); gst_decklink_release_nth_output (self->device_number, GST_ELEMENT_CAST (self), FALSE); self->output = NULL; @@ -589,6 +589,23 @@ gst_decklink_video_sink_close (GstBaseSink * bsink) return TRUE; } +static gboolean +gst_decklink_video_sink_stop (GstDecklinkVideoSink * self) +{ + GST_DEBUG_OBJECT (self, "Stopping"); + + if (self->output && self->output->video_enabled) { + g_mutex_lock (&self->output->lock); + self->output->video_enabled = FALSE; + g_mutex_unlock (&self->output->lock); + + self->output->output->DisableVideoOutput (); + self->output->output->SetScheduledFrameCompletionCallback (NULL); + } + + return TRUE; +} + static void gst_decklink_video_sink_start_scheduled_playback (GstElement * element) { @@ -732,6 +749,7 @@ gst_decklink_video_sink_change_state (GstElement * element, self->output->clock_last_time = 0; self->output->clock_offset = 0; g_mutex_unlock (&self->output->lock); + gst_decklink_video_sink_stop (self); break; case GST_STATE_CHANGE_PLAYING_TO_PAUSED:{ GstClockTime start_time; |