diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2017-07-05 13:59:12 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-07-05 14:03:07 +0300 |
commit | 4706447ddcad2b5360c28b47983960f03b5f1e45 (patch) | |
tree | ed5bc9151d58fdd163dceb23a944ed25165df3d3 /gst/mxf | |
parent | 1e646472e7fde7e3668d1f1fafa134de34c98c80 (diff) |
mxfmetadata: Set field-order correctly for interlaced video
Diffstat (limited to 'gst/mxf')
-rw-r--r-- | gst/mxf/mxfmetadata.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/gst/mxf/mxfmetadata.c b/gst/mxf/mxfmetadata.c index 8f095926b..2860b6847 100644 --- a/gst/mxf/mxfmetadata.c +++ b/gst/mxf/mxfmetadata.c @@ -4968,6 +4968,14 @@ void mxf_metadata_generic_picture_essence_descriptor_set_caps || self->frame_layout == 4) { height *= 2; gst_caps_set_simple (caps, "interlaced", G_TYPE_BOOLEAN, TRUE, NULL); + + if (self->field_dominance == 2) { + gst_caps_set_simple (caps, "field-order", G_TYPE_STRING, + "bottom-field-first", NULL); + } else { + gst_caps_set_simple (caps, "field-order", G_TYPE_STRING, + "top-field-first", NULL); + } } if (width == 0 || height == 0) { @@ -5014,6 +5022,7 @@ gboolean MXFMetadataFileDescriptor *f = (MXFMetadataFileDescriptor *) self; GstStructure *s; gboolean interlaced = FALSE; + const gchar *field_order = NULL; g_return_val_if_fail (MXF_IS_METADATA_GENERIC_PICTURE_ESSENCE_DESCRIPTOR (self), FALSE); @@ -5021,10 +5030,16 @@ gboolean s = gst_caps_get_structure (caps, 0); - if (!gst_structure_get_boolean (s, "interlaced", &interlaced) || !interlaced) + if (!gst_structure_get_boolean (s, "interlaced", &interlaced) || !interlaced) { self->frame_layout = 0; - else + } else { self->frame_layout = 3; + field_order = gst_structure_get_string (s, "field-order"); + if (!field_order || strcmp (field_order, "top-field-first") == 0) + self->field_dominance = 1; + else + self->field_dominance = 2; + } if (!gst_structure_get_fraction (s, "framerate", &fps_n, &fps_d)) { GST_ERROR ("Invalid framerate"); |