Include detected video format in warning message if it is different from the configured one

This commit is contained in:
Sebastian Dröge 2021-08-18 11:36:24 +03:00
parent 4d95164c0c
commit 08308c28a2

View file

@ -1687,16 +1687,25 @@ restart:
} else if (current_video_format != effective_video_format && } else if (current_video_format != effective_video_format &&
current_video_format != self->video_format) { current_video_format != self->video_format) {
// TODO: Handle GST_AJA_VIDEO_FORMAT_AUTO here // TODO: Handle GST_AJA_VIDEO_FORMAT_AUTO here
std::string current_string =
NTV2VideoFormatToString(current_video_format);
std::string configured_string =
NTV2VideoFormatToString(self->video_format);
std::string effective_string =
NTV2VideoFormatToString(effective_video_format);
GST_DEBUG_OBJECT(self, GST_DEBUG_OBJECT(self,
"Different input format %u than configured %u " "Different input format %s than configured %s "
"(effective %u), waiting", "(effective %s), waiting",
current_video_format, self->video_format, current_string.c_str(), configured_string.c_str(),
effective_video_format); effective_string.c_str());
g_mutex_unlock(&self->queue_lock); g_mutex_unlock(&self->queue_lock);
frames_dropped_last = G_MAXUINT64; frames_dropped_last = G_MAXUINT64;
if (have_signal) { if (have_signal) {
GST_ELEMENT_WARNING(GST_ELEMENT(self), RESOURCE, READ, ("Signal lost"), GST_ELEMENT_WARNING(GST_ELEMENT(self), RESOURCE, READ, ("Signal lost"),
("Different input source was detected")); ("Different input source (%s) was detected",
current_string.c_str()));
have_signal = FALSE; have_signal = FALSE;
} }
self->device->device->WaitForInputVerticalInterrupt(self->channel); self->device->device->WaitForInputVerticalInterrupt(self->channel);