mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 19:55:32 +00:00
decklink: Fix support for HW without output
Devices suitable for decklinksrc may not have any output, hence querying the input returns NULL. Add support for all cases where input/output/config may be missing. https://bugzilla.gnome.org/show_bug.cgi?id=727306
This commit is contained in:
parent
68309bd215
commit
1c1cc73a3b
3 changed files with 18 additions and 0 deletions
|
@ -244,6 +244,11 @@ init_devices (void)
|
||||||
|
|
||||||
ret = iterator->Next (&decklink);
|
ret = iterator->Next (&decklink);
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
|
if (i == 10) {
|
||||||
|
GST_WARNING ("this hardware has more then 10 devices");
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
n_devices = i;
|
n_devices = i;
|
||||||
|
|
|
@ -321,6 +321,7 @@ gst_decklink_sink_finalize (GObject * object)
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME: post error messages for the misc. failures */
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_decklink_sink_start (GstDecklinkSink * decklinksink)
|
gst_decklink_sink_start (GstDecklinkSink * decklinksink)
|
||||||
{
|
{
|
||||||
|
@ -335,6 +336,10 @@ gst_decklink_sink_start (GstDecklinkSink * decklinksink)
|
||||||
}
|
}
|
||||||
|
|
||||||
decklinksink->output = gst_decklink_get_nth_output (decklinksink->device_number);
|
decklinksink->output = gst_decklink_get_nth_output (decklinksink->device_number);
|
||||||
|
if (!decklinksink->decklink) {
|
||||||
|
GST_WARNING ("no output for device %d", decklinksink->device_number);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
decklinksink->output->SetAudioCallback (decklinksink->callback);
|
decklinksink->output->SetAudioCallback (decklinksink->callback);
|
||||||
|
|
||||||
|
|
|
@ -424,6 +424,10 @@ gst_decklink_src_start (GstElement * element)
|
||||||
}
|
}
|
||||||
|
|
||||||
decklinksrc->input = gst_decklink_get_nth_input (decklinksrc->device_number);
|
decklinksrc->input = gst_decklink_get_nth_input (decklinksrc->device_number);
|
||||||
|
if (decklinksrc->input == NULL) {
|
||||||
|
GST_ERROR ("no input source for device %i", decklinksrc->device_number);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
delegate = new DeckLinkCaptureDelegate ();
|
delegate = new DeckLinkCaptureDelegate ();
|
||||||
delegate->priv = decklinksrc;
|
delegate->priv = decklinksrc;
|
||||||
|
@ -435,6 +439,10 @@ gst_decklink_src_start (GstElement * element)
|
||||||
|
|
||||||
decklinksrc->config = gst_decklink_get_nth_config (decklinksrc->device_number);
|
decklinksrc->config = gst_decklink_get_nth_config (decklinksrc->device_number);
|
||||||
config = decklinksrc->config;
|
config = decklinksrc->config;
|
||||||
|
if (decklinksrc->config == NULL) {
|
||||||
|
GST_ERROR ("no config for device %i", decklinksrc->device_number);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
switch (decklinksrc->connection) {
|
switch (decklinksrc->connection) {
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue