decklink: Add support for all modes of Quad HDMI recorder

By extending the GstDecklinkModeEnum with the additional modes supported by the Quad HDMI recorder,
we avoid using mode = 0 in case any of these resolutions is returned by the card.

Fixes#3713

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7302>
This commit is contained in:
Benjamin Gräf 2024-08-08 14:36:19 +02:00 committed by GStreamer Marge Bot
parent 417c5e19b7
commit 2638d8135d
3 changed files with 226 additions and 64 deletions

File diff suppressed because one or more lines are too long

View file

@ -441,6 +441,23 @@ static const GstDecklinkMode modes[] = {
{bmdMode8kDCI50, 8192, 4320, 50, 1, false, UHD}, {bmdMode8kDCI50, 8192, 4320, 50, 1, false, UHD},
{bmdMode8kDCI5994, 8192, 4320, 60000, 1001, false, UHD}, {bmdMode8kDCI5994, 8192, 4320, 60000, 1001, false, UHD},
{bmdMode8kDCI60, 8192, 4320, 60, 1, false, UHD}, {bmdMode8kDCI60, 8192, 4320, 60, 1, false, UHD},
{bmdMode640x480p60, 640, 480, 60, 1, false, HD},
{bmdMode800x600p60, 800, 600, 60, 1, false, HD},
{bmdMode1440x900p50, 1440, 900, 50, 1, false, HD},
{bmdMode1440x900p60, 1440, 900, 60, 1, false, HD},
{bmdMode1440x1080p50, 1440, 1080, 50, 1, false, HD},
{bmdMode1440x1080p60, 1440, 1080, 60, 1, false, HD},
{bmdMode1600x1200p50, 1600, 1200, 50, 1, false, HD},
{bmdMode1600x1200p60, 1600, 1200, 60, 1, false, HD},
{bmdMode1920x1200p50, 1920, 1200, 50, 1, false, HD},
{bmdMode1920x1200p60, 1920, 1200, 60, 1, false, HD},
{bmdMode1920x1440p50, 1920, 1440, 50, 1, false, HD},
{bmdMode1920x1440p60, 1920, 1440, 60, 1, false, HD},
{bmdMode2560x1440p50, 2560, 1440, 50, 1, false, HD},
{bmdMode2560x1440p60, 2560, 1440, 60, 1, false, HD},
{bmdMode2560x1600p50, 2560, 1600, 50, 1, false, HD},
{bmdMode2560x1600p60, 2560, 1600, 60, 1, false, HD},
}; };
static const struct static const struct
@ -456,7 +473,7 @@ static const struct
{bmdFormat8BitARGB, 4, GST_VIDEO_FORMAT_ARGB}, {bmdFormat8BitARGB, 4, GST_VIDEO_FORMAT_ARGB},
{bmdFormat8BitBGRA, 4, GST_VIDEO_FORMAT_BGRA}, {bmdFormat8BitBGRA, 4, GST_VIDEO_FORMAT_BGRA},
{bmdFormat10BitRGB, 4, GST_VIDEO_FORMAT_r210}, {bmdFormat10BitRGB, 4, GST_VIDEO_FORMAT_r210},
/* Not yet supported /* Not yet supported
{bmdFormat12BitRGB, FIXME, FIXME}, {bmdFormat12BitRGB, FIXME, FIXME},
{bmdFormat12BitRGBLE, FIXME, FIXME}, {bmdFormat12BitRGBLE, FIXME, FIXME},
{bmdFormat10BitRGBXLE, FIXME, FIXME}, {bmdFormat10BitRGBXLE, FIXME, FIXME},
@ -516,7 +533,7 @@ static const struct
const GstDecklinkMode * const GstDecklinkMode *
gst_decklink_get_mode (GstDecklinkModeEnum e) gst_decklink_get_mode (GstDecklinkModeEnum e)
{ {
if (e < GST_DECKLINK_MODE_AUTO || e > GST_DECKLINK_MODE_8Kp60) if (e < GST_DECKLINK_MODE_AUTO || e > GST_DECKLINK_MODE_2560x1600p60)
return NULL; return NULL;
return &modes[e]; return &modes[e];
} }
@ -712,6 +729,54 @@ gst_decklink_get_mode_enum_from_bmd (BMDDisplayMode mode)
case bmdMode8kDCI60: case bmdMode8kDCI60:
displayMode = GST_DECKLINK_MODE_4Kp60; displayMode = GST_DECKLINK_MODE_4Kp60;
break; break;
case bmdMode640x480p60:
displayMode = GST_DECKLINK_MODE_640x480p60;
break;
case bmdMode800x600p60:
displayMode = GST_DECKLINK_MODE_800x600p60;
break;
case bmdMode1440x900p50:
displayMode = GST_DECKLINK_MODE_1440x900p50;
break;
case bmdMode1440x900p60:
displayMode = GST_DECKLINK_MODE_1440x900p60;
break;
case bmdMode1440x1080p50:
displayMode = GST_DECKLINK_MODE_1440x1080p50;
break;
case bmdMode1440x1080p60:
displayMode = GST_DECKLINK_MODE_1440x1080p60;
break;
case bmdMode1600x1200p50:
displayMode = GST_DECKLINK_MODE_1600x1200p50;
break;
case bmdMode1600x1200p60:
displayMode = GST_DECKLINK_MODE_1600x1200p60;
break;
case bmdMode1920x1200p50:
displayMode = GST_DECKLINK_MODE_1920x1200p50;
break;
case bmdMode1920x1200p60:
displayMode = GST_DECKLINK_MODE_1920x1200p60;
break;
case bmdMode1920x1440p50:
displayMode = GST_DECKLINK_MODE_1920x1440p50;
break;
case bmdMode1920x1440p60:
displayMode = GST_DECKLINK_MODE_1920x1440p60;
break;
case bmdMode2560x1440p50:
displayMode = GST_DECKLINK_MODE_2560x1440p50;
break;
case bmdMode2560x1440p60:
displayMode = GST_DECKLINK_MODE_2560x1440p60;
break;
case bmdMode2560x1600p50:
displayMode = GST_DECKLINK_MODE_2560x1600p50;
break;
case bmdMode2560x1600p60:
displayMode = GST_DECKLINK_MODE_2560x1600p60;
break;
default: default:
displayMode = (GstDecklinkModeEnum) - 1; displayMode = (GstDecklinkModeEnum) - 1;
break; break;

View file

@ -300,7 +300,104 @@ typedef enum {
* *
* Since: 1.22 * Since: 1.22
*/ */
GST_DECKLINK_MODE_8Kp60 GST_DECKLINK_MODE_8Kp60,
/**
* GstDecklinkModes::640x480p60
*
* Since: 1.26
*/
GST_DECKLINK_MODE_640x480p60,
/**
* GstDecklinkModes::800x600p60
*
* Since: 1.26
*/
GST_DECKLINK_MODE_800x600p60,
/**
* GstDecklinkModes::1440x900p50
*
* Since: 1.26
*/
GST_DECKLINK_MODE_1440x900p50,
/**
* GstDecklinkModes::1440x900p60
*
* Since: 1.26
*/
GST_DECKLINK_MODE_1440x900p60,
/**
* GstDecklinkModes::1440x1080p50
*
* Since: 1.26
*/
GST_DECKLINK_MODE_1440x1080p50,
/**
* GstDecklinkModes::1440x1080p60
*
* Since: 1.26
*/
GST_DECKLINK_MODE_1440x1080p60,
/**
* GstDecklinkModes::1600x1200p50
*
* Since: 1.26
*/
GST_DECKLINK_MODE_1600x1200p50,
/**
* GstDecklinkModes::1600x1200p60
*
* Since: 1.26
*/
GST_DECKLINK_MODE_1600x1200p60,
/**
* GstDecklinkModes::1920x1200p50
*
* Since: 1.26
*/
GST_DECKLINK_MODE_1920x1200p50,
/**
* GstDecklinkModes::1920x1200p60
*
* Since: 1.26
*/
GST_DECKLINK_MODE_1920x1200p60,
/**
* GstDecklinkModes::1920x1440p50
*
* Since: 1.26
*/
GST_DECKLINK_MODE_1920x1440p50,
/**
* GstDecklinkModes::1920x1440p60
*
* Since: 1.26
*/
GST_DECKLINK_MODE_1920x1440p60,
/**
* GstDecklinkModes::2560x1440p50
*
* Since: 1.26
*/
GST_DECKLINK_MODE_2560x1440p50,
/**
* GstDecklinkModes::2560x1440p60
*
* Since: 1.26
*/
GST_DECKLINK_MODE_2560x1440p60,
/**
* GstDecklinkModes::2560x1600p50
*
* Since: 1.26
*/
GST_DECKLINK_MODE_2560x1600p50,
/**
* GstDecklinkModes::2560x1600p60
*
* Since: 1.26
*/
GST_DECKLINK_MODE_2560x1600p60
} GstDecklinkModeEnum; } GstDecklinkModeEnum;
#define GST_TYPE_DECKLINK_MODE (gst_decklink_mode_get_type ()) #define GST_TYPE_DECKLINK_MODE (gst_decklink_mode_get_type ())
GType gst_decklink_mode_get_type (void); GType gst_decklink_mode_get_type (void);