mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
decklinkvideosrc: respect pixel format property even if mode is set to auto
Before this patch, if mode=auto and video-format!=auto, video-format would always be ignored, and get set to 8bit-yuv, or if detected to be RGB444, then it would be set to 8bit-argb. This change respects video-format if it is set to 10bit-yuv (v210) or 8bit-bgra, even when mode=auto. Closes #772
This commit is contained in:
parent
503f54eda0
commit
1a360a1c65
2 changed files with 9 additions and 2 deletions
|
@ -791,12 +791,18 @@ public:
|
|||
VideoInputFormatChanged (BMDVideoInputFormatChangedEvents,
|
||||
IDeckLinkDisplayMode * mode, BMDDetectedVideoInputFormatFlags formatFlags)
|
||||
{
|
||||
BMDPixelFormat pixelFormat = bmdFormat8BitYUV;
|
||||
BMDPixelFormat pixelFormat;
|
||||
|
||||
GST_INFO ("Video input format changed");
|
||||
|
||||
if (formatFlags & bmdDetectedVideoInputRGB444)
|
||||
if ((formatFlags & bmdDetectedVideoInputRGB444)
|
||||
&& m_input->format == bmdFormat8BitYUV) {
|
||||
/* user-set format was auto or 8BitYUV, change to RGB */
|
||||
pixelFormat = bmdFormat8BitARGB;
|
||||
} else {
|
||||
/* use the user-set format, defaulting to 8BitYUV */
|
||||
pixelFormat = m_input->format;
|
||||
}
|
||||
|
||||
g_mutex_lock (&m_input->lock);
|
||||
m_input->input->PauseStreams ();
|
||||
|
|
|
@ -1134,6 +1134,7 @@ gst_decklink_video_src_open (GstDecklinkVideoSrc * self)
|
|||
g_assert (mode != NULL);
|
||||
g_mutex_lock (&self->input->lock);
|
||||
self->input->mode = mode;
|
||||
self->input->format = self->caps_format;
|
||||
self->input->got_video_frame = gst_decklink_video_src_got_frame;
|
||||
self->input->start_streams = gst_decklink_video_src_start_streams;
|
||||
g_mutex_unlock (&self->input->lock);
|
||||
|
|
Loading…
Reference in a new issue