mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
avcodecmap: Configure field order in the context if we can
https://bugzilla.gnome.org/show_bug.cgi?id=771376
This commit is contained in:
parent
fb9fea0223
commit
d2e65754b3
1 changed files with 17 additions and 0 deletions
|
@ -2426,6 +2426,7 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps,
|
||||||
const GValue *par = NULL;
|
const GValue *par = NULL;
|
||||||
const gchar *fmt;
|
const gchar *fmt;
|
||||||
GstVideoFormat format = GST_VIDEO_FORMAT_UNKNOWN;
|
GstVideoFormat format = GST_VIDEO_FORMAT_UNKNOWN;
|
||||||
|
const gchar *s;
|
||||||
|
|
||||||
GST_DEBUG ("converting caps %" GST_PTR_FORMAT, caps);
|
GST_DEBUG ("converting caps %" GST_PTR_FORMAT, caps);
|
||||||
g_return_if_fail (gst_caps_get_size (caps) == 1);
|
g_return_if_fail (gst_caps_get_size (caps) == 1);
|
||||||
|
@ -2541,6 +2542,22 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps,
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s = gst_structure_get_string (structure, "interlaced-mode");
|
||||||
|
if (s) {
|
||||||
|
if (strcmp (s, "progressive") == 0) {
|
||||||
|
context->field_order = AV_FIELD_PROGRESSIVE;
|
||||||
|
} else if (strcmp (s, "interleaved") == 0) {
|
||||||
|
s = gst_structure_get_string (structure, "field-order");
|
||||||
|
if (s) {
|
||||||
|
if (strcmp (s, "top-field-first") == 0) {
|
||||||
|
context->field_order = AV_FIELD_TT;
|
||||||
|
} else if (strcmp (s, "bottom-field-first") == 0) {
|
||||||
|
context->field_order = AV_FIELD_TB;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|
Loading…
Reference in a new issue