Add support for HD psf modes in ajasrc

This commit is contained in:
Sebastian Dröge 2022-09-15 11:00:37 +03:00
parent 3dbbf20451
commit 1f6ea294db
3 changed files with 49 additions and 12 deletions

View file

@ -47,6 +47,10 @@ static const FormatMapEntry format_map[] = {
NTV2_FORMAT_UNKNOWN},
{GST_AJA_VIDEO_FORMAT_720p_6000, NTV2_FORMAT_720p_6000,
NTV2_FORMAT_UNKNOWN},
{GST_AJA_VIDEO_FORMAT_1080psf_2398, NTV2_FORMAT_1080psf_2398,
NTV2_FORMAT_UNKNOWN},
{GST_AJA_VIDEO_FORMAT_1080psf_2400, NTV2_FORMAT_1080psf_2400,
NTV2_FORMAT_UNKNOWN},
{GST_AJA_VIDEO_FORMAT_1080p_2997, NTV2_FORMAT_1080p_2997,
NTV2_FORMAT_UNKNOWN},
{GST_AJA_VIDEO_FORMAT_1080p_3000, NTV2_FORMAT_1080p_3000,
@ -59,16 +63,22 @@ static const FormatMapEntry format_map[] = {
NTV2_FORMAT_UNKNOWN},
{GST_AJA_VIDEO_FORMAT_720p_5000, NTV2_FORMAT_720p_5000,
NTV2_FORMAT_UNKNOWN},
{GST_AJA_VIDEO_FORMAT_720p_2398, NTV2_FORMAT_720p_2398,
NTV2_FORMAT_UNKNOWN},
{GST_AJA_VIDEO_FORMAT_720p_5000, NTV2_FORMAT_720p_2500,
NTV2_FORMAT_UNKNOWN},
{GST_AJA_VIDEO_FORMAT_1080p_5000_A, NTV2_FORMAT_1080p_5000_A,
NTV2_FORMAT_UNKNOWN},
{GST_AJA_VIDEO_FORMAT_1080p_5994_A, NTV2_FORMAT_1080p_5994_A,
NTV2_FORMAT_UNKNOWN},
{GST_AJA_VIDEO_FORMAT_1080p_6000_A, NTV2_FORMAT_1080p_6000_A,
NTV2_FORMAT_UNKNOWN},
{GST_AJA_VIDEO_FORMAT_720p_2398, NTV2_FORMAT_720p_2398,
NTV2_FORMAT_UNKNOWN},
{GST_AJA_VIDEO_FORMAT_720p_5000, NTV2_FORMAT_720p_2500,
NTV2_FORMAT_UNKNOWN},
{GST_AJA_VIDEO_FORMAT_1080psf_2500_2, NTV2_FORMAT_1080psf_2500_2,
NTV2_FORMAT_UNKNOWN},
{GST_AJA_VIDEO_FORMAT_1080psf_2997_2, NTV2_FORMAT_1080psf_2997_2,
NTV2_FORMAT_UNKNOWN},
{GST_AJA_VIDEO_FORMAT_1080psf_3000_2, NTV2_FORMAT_1080psf_3000_2,
NTV2_FORMAT_UNKNOWN},
{GST_AJA_VIDEO_FORMAT_625_5000, NTV2_FORMAT_625_5000, NTV2_FORMAT_UNKNOWN},
{GST_AJA_VIDEO_FORMAT_525_5994, NTV2_FORMAT_525_5994, NTV2_FORMAT_UNKNOWN},
@ -283,11 +293,12 @@ bool gst_video_info_from_ntv2_video_format(GstVideoInfo *info,
info->par_n = 12;
info->par_d = 11;
}
info->interlace_mode = !::IsProgressiveTransport(format)
? GST_VIDEO_INTERLACE_MODE_INTERLEAVED
: GST_VIDEO_INTERLACE_MODE_PROGRESSIVE;
info->interlace_mode =
(!::IsProgressivePicture(format) && !NTV2_IS_PSF_VIDEO_FORMAT(format))
? GST_VIDEO_INTERLACE_MODE_INTERLEAVED
: GST_VIDEO_INTERLACE_MODE_PROGRESSIVE;
if (!::IsProgressiveTransport(format)) {
if (!::IsProgressiveTransport(format) && !NTV2_IS_PSF_VIDEO_FORMAT(format)) {
NTV2SmpteLineNumber line_number = ::GetSmpteLineNumber(standard);
if (line_number.firstFieldTop) {
@ -947,17 +958,22 @@ GType gst_aja_video_format_get_type(void) {
{GST_AJA_VIDEO_FORMAT_1080i_6000, "1080i-6000", "1080i 6000"},
{GST_AJA_VIDEO_FORMAT_720p_5994, "720p-5994", "720p 5994"},
{GST_AJA_VIDEO_FORMAT_720p_6000, "720p-6000", "720p 6000"},
{GST_AJA_VIDEO_FORMAT_1080psf_2398, "1080psf-2398", "1080psf 2398"},
{GST_AJA_VIDEO_FORMAT_1080psf_2400, "1080psf-2400", "1080psf 2400"},
{GST_AJA_VIDEO_FORMAT_1080p_2997, "1080p-2997", "1080p 2997"},
{GST_AJA_VIDEO_FORMAT_1080p_3000, "1080p-3000", "1080p 3000"},
{GST_AJA_VIDEO_FORMAT_1080p_2500, "1080p-2500", "1080p 2500"},
{GST_AJA_VIDEO_FORMAT_1080p_2398, "1080p-2398", "1080p 2398"},
{GST_AJA_VIDEO_FORMAT_1080p_2400, "1080p-2400", "1080p 2400"},
{GST_AJA_VIDEO_FORMAT_720p_5000, "720p-5000", "720p 5000"},
{GST_AJA_VIDEO_FORMAT_720p_2398, "720p-2398", "720p 2398"},
{GST_AJA_VIDEO_FORMAT_720p_2500, "720p-2500", "720p 2500"},
{GST_AJA_VIDEO_FORMAT_1080p_5000_A, "1080p-5000-a", "1080p 5000 A"},
{GST_AJA_VIDEO_FORMAT_1080p_5994_A, "1080p-5994-a", "1080p 5994 A"},
{GST_AJA_VIDEO_FORMAT_1080p_6000_A, "1080p-6000-a", "1080p 6000 A"},
{GST_AJA_VIDEO_FORMAT_720p_2398, "720p-2398", "720p 2398"},
{GST_AJA_VIDEO_FORMAT_720p_2500, "720p-2500", "720p 2500"},
{GST_AJA_VIDEO_FORMAT_1080psf_2500_2, "1080psf-2500-2", "1080psf 2500 2"},
{GST_AJA_VIDEO_FORMAT_1080psf_2997_2, "1080psf-2997-2", "1080psf 2997 2"},
{GST_AJA_VIDEO_FORMAT_1080psf_3000_2, "1080psf-3000-2", "1080psf 3000 2"},
{GST_AJA_VIDEO_FORMAT_625_5000, "625-5000", "625 5000"},
{GST_AJA_VIDEO_FORMAT_525_5994, "525-5994", "525 5994"},

View file

@ -193,17 +193,22 @@ typedef enum {
GST_AJA_VIDEO_FORMAT_1080i_6000,
GST_AJA_VIDEO_FORMAT_720p_5994,
GST_AJA_VIDEO_FORMAT_720p_6000,
GST_AJA_VIDEO_FORMAT_1080psf_2398,
GST_AJA_VIDEO_FORMAT_1080psf_2400,
GST_AJA_VIDEO_FORMAT_1080p_2997,
GST_AJA_VIDEO_FORMAT_1080p_3000,
GST_AJA_VIDEO_FORMAT_1080p_2500,
GST_AJA_VIDEO_FORMAT_1080p_2398,
GST_AJA_VIDEO_FORMAT_1080p_2400,
GST_AJA_VIDEO_FORMAT_720p_5000,
GST_AJA_VIDEO_FORMAT_720p_2398,
GST_AJA_VIDEO_FORMAT_720p_2500,
GST_AJA_VIDEO_FORMAT_1080p_5000_A,
GST_AJA_VIDEO_FORMAT_1080p_5994_A,
GST_AJA_VIDEO_FORMAT_1080p_6000_A,
GST_AJA_VIDEO_FORMAT_720p_2398,
GST_AJA_VIDEO_FORMAT_720p_2500,
GST_AJA_VIDEO_FORMAT_1080psf_2500_2,
GST_AJA_VIDEO_FORMAT_1080psf_2997_2,
GST_AJA_VIDEO_FORMAT_1080psf_3000_2,
GST_AJA_VIDEO_FORMAT_625_5000,
GST_AJA_VIDEO_FORMAT_525_5994,
GST_AJA_VIDEO_FORMAT_525_2398,

View file

@ -2142,6 +2142,22 @@ restart:
effective_video_format =
::GetQuarterSizedVideoFormat(effective_video_format);
}
switch (self->video_format) {
case NTV2_FORMAT_1080psf_2500_2:
if (current_video_format == NTV2_FORMAT_1080i_5000)
current_video_format = NTV2_FORMAT_1080psf_2500_2;
break;
case NTV2_FORMAT_1080psf_2997_2:
if (current_video_format == NTV2_FORMAT_1080i_5994)
current_video_format = NTV2_FORMAT_1080psf_2997_2;
break;
case NTV2_FORMAT_1080psf_3000_2:
if (current_video_format == NTV2_FORMAT_1080i_6000)
current_video_format = NTV2_FORMAT_1080psf_3000_2;
break;
default:
break;
}
if (current_video_format == ::NTV2_FORMAT_UNKNOWN || !all_quads_equal) {
if (self->video_format_setting == GST_AJA_VIDEO_FORMAT_AUTO)