summaryrefslogtreecommitdiff
path: root/sys/decklink
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2017-02-01 16:45:53 +0200
committerSebastian Dröge <sebastian@centricular.com>2017-02-01 16:45:53 +0200
commit8d723c5fe1d35faa58214adc401d565f3a98d7ef (patch)
tree4aeab036397bff705bff96015d3a3def29c14196 /sys/decklink
parent21a9a8985163c6cdadb673af369401f974a8afe9 (diff)
downloadgstreamer-plugins-bad-8d723c5fe1d35faa58214adc401d565f3a98d7ef.tar.gz
decklinkvideosink: Do nothing if set_caps() is called with basically the same caps again
and error out here already otherwise. We currently don't support reconfiguration here and it can't happen really either unless the auto mode is selected.
Diffstat (limited to 'sys/decklink')
-rw-r--r--sys/decklink/gstdecklinkvideosink.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/sys/decklink/gstdecklinkvideosink.cpp b/sys/decklink/gstdecklinkvideosink.cpp
index f0f79e9cc..4881ff8e0 100644
--- a/sys/decklink/gstdecklinkvideosink.cpp
+++ b/sys/decklink/gstdecklinkvideosink.cpp
@@ -336,12 +336,32 @@ gst_decklink_video_sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
const GstDecklinkMode *mode;
HRESULT ret;
BMDVideoOutputFlags flags;
+ GstVideoInfo info;
GST_DEBUG_OBJECT (self, "Setting caps %" GST_PTR_FORMAT, caps);
- if (!gst_video_info_from_caps (&self->info, caps))
+ if (!gst_video_info_from_caps (&info, caps))
return FALSE;
+
+ g_mutex_lock (&self->output->lock);
+ if (self->output->video_enabled) {
+ if (self->info.finfo->format == info.finfo->format &&
+ self->info.width == info.width && self->info.height == info.height) {
+ // FIXME: We should also consider the framerate as it is used
+ // for mode selection below in auto mode
+ GST_DEBUG_OBJECT (self, "Nothing relevant has changed");
+ self->info = info;
+ g_mutex_unlock (&self->output->lock);
+ return TRUE;
+ } else {
+ GST_DEBUG_OBJECT (self, "Reconfiguration not supported at this point");
+ g_mutex_unlock (&self->output->lock);
+ return FALSE;
+ }
+ }
+ g_mutex_unlock (&self->output->lock);
+
self->output->output->SetScheduledFrameCompletionCallback (new
GStreamerVideoOutputCallback (self));
@@ -387,6 +407,7 @@ gst_decklink_video_sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
return FALSE;
}
+ self->info = info;
g_mutex_lock (&self->output->lock);
self->output->mode = mode;
self->output->video_enabled = TRUE;