Commit f9a8b843 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

decklink: Print the Decklink API error return values in debug output in all places

parent 957ea18b
......@@ -764,7 +764,8 @@ public:
} else {
res = dtc->GetComponents (&hours, &minutes, &seconds, &frames);
if (res != S_OK) {
GST_ERROR ("Could not get components for timecode %p", dtc);
GST_ERROR ("Could not get components for timecode %p: 0x%08x", dtc,
res);
hours = 0;
minutes = 0;
seconds = 0;
......@@ -914,7 +915,8 @@ init_devices (gpointer data)
ret = decklink->QueryInterface (IID_IDeckLinkInput,
(void **) &devices[i].input.input);
if (ret != S_OK) {
GST_WARNING ("selected device does not have input interface");
GST_WARNING ("selected device does not have input interface: 0x%08x",
ret);
} else {
devices[i].input.device = decklink;
devices[i].input.clock = gst_decklink_clock_new ("GstDecklinkInputClock");
......@@ -928,7 +930,8 @@ init_devices (gpointer data)
ret = decklink->QueryInterface (IID_IDeckLinkOutput,
(void **) &devices[i].output.output);
if (ret != S_OK) {
GST_WARNING ("selected device does not have output interface");
GST_WARNING ("selected device does not have output interface: 0x%08x",
ret);
} else {
devices[i].output.device = decklink;
devices[i].output.clock =
......@@ -940,14 +943,16 @@ init_devices (gpointer data)
ret = decklink->QueryInterface (IID_IDeckLinkConfiguration,
(void **) &devices[i].input.config);
if (ret != S_OK) {
GST_WARNING ("selected device does not have config interface");
GST_WARNING ("selected device does not have config interface: 0x%08x",
ret);
}
ret = decklink->QueryInterface (IID_IDeckLinkAttributes,
(void **) &devices[i].input.attributes);
devices[i].output.attributes = devices[i].input.attributes;
if (ret != S_OK) {
GST_WARNING ("selected device does not have attributes interface");
GST_WARNING ("selected device does not have attributes interface: 0x%08x",
ret);
}
ret = iterator->Next (&decklink);
......
......@@ -310,13 +310,16 @@ gst_decklink_audio_sink_ringbuffer_delay (GstAudioRingBuffer * rb)
GstDecklinkAudioSinkRingBuffer *self =
GST_DECKLINK_AUDIO_SINK_RING_BUFFER_CAST (rb);
guint ret = 0;
HRESULT res = S_OK;
if (self->output) {
if (self->output->output->GetBufferedAudioSampleFrameCount (&ret) != S_OK)
if ((res =
self->output->output->GetBufferedAudioSampleFrameCount (&ret)) !=
S_OK)
ret = 0;
}
GST_DEBUG_OBJECT (self->sink, "Delay: %u", ret);
GST_DEBUG_OBJECT (self->sink, "Delay: %u (0x%08x)", ret, res);
return ret;
}
......
......@@ -367,7 +367,7 @@ gst_decklink_audio_src_set_caps (GstBaseSrc * bsrc, GstCaps * caps)
self->input->config->SetInt (bmdDeckLinkConfigAudioInputConnection,
conn);
if (ret != S_OK) {
GST_ERROR ("set configuration (audio input connection)");
GST_ERROR ("set configuration (audio input connection): 0x%08x", ret);
return FALSE;
}
}
......@@ -375,7 +375,7 @@ gst_decklink_audio_src_set_caps (GstBaseSrc * bsrc, GstCaps * caps)
ret = self->input->input->EnableAudioInput (bmdAudioSampleRate48kHz,
sample_depth, 2);
if (ret != S_OK) {
GST_WARNING_OBJECT (self, "Failed to enable audio input");
GST_WARNING_OBJECT (self, "Failed to enable audio input: 0x%08x", ret);
return FALSE;
}
......
......@@ -378,7 +378,7 @@ gst_decklink_video_sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
ret = self->output->output->EnableVideoOutput (mode->mode, flags);
if (ret != S_OK) {
GST_WARNING_OBJECT (self, "Failed to enable video output");
GST_WARNING_OBJECT (self, "Failed to enable video output: 0x%08x", ret);
return FALSE;
}
......
......@@ -346,7 +346,8 @@ gst_decklink_video_src_set_caps (GstBaseSrc * bsrc, GstCaps * caps)
ret = self->input->config->SetInt (bmdDeckLinkConfigVideoInputConnection,
gst_decklink_get_connection (self->connection));
if (ret != S_OK) {
GST_ERROR_OBJECT (self, "Failed to set configuration (input source)");
GST_ERROR_OBJECT (self,
"Failed to set configuration (input source): 0x%08x", ret);
return FALSE;
}
......@@ -355,7 +356,7 @@ gst_decklink_video_src_set_caps (GstBaseSrc * bsrc, GstCaps * caps)
bmdAnalogVideoFlagCompositeSetup75);
if (ret != S_OK) {
GST_ERROR_OBJECT (self,
"Failed to set configuration (composite setup)");
"Failed to set configuration (composite setup): 0x%08x", ret);
return FALSE;
}
}
......@@ -371,7 +372,8 @@ gst_decklink_video_src_set_caps (GstBaseSrc * bsrc, GstCaps * caps)
attributes->GetFlag (BMDDeckLinkSupportsInputFormatDetection,
&autoDetection);
if (ret != S_OK) {
GST_ERROR_OBJECT (self, "Failed to get attribute (autodetection)");
GST_ERROR_OBJECT (self,
"Failed to get attribute (autodetection): 0x%08x", ret);
return FALSE;
}
if (autoDetection)
......@@ -389,7 +391,7 @@ gst_decklink_video_src_set_caps (GstBaseSrc * bsrc, GstCaps * caps)
format = self->caps_format;
ret = self->input->input->EnableVideoInput (mode->mode, format, flags);
if (ret != S_OK) {
GST_WARNING_OBJECT (self, "Failed to enable video input");
GST_WARNING_OBJECT (self, "Failed to enable video input: 0x%08x", ret);
return FALSE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment