mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-17 20:17:55 +02:00
mxf: Read field dominance flag
And export the information in field_order. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
parent
7d56f2fffc
commit
c716624853
@ -134,6 +134,9 @@ typedef struct {
|
|||||||
int width;
|
int width;
|
||||||
int height; /* Field height, not frame height */
|
int height; /* Field height, not frame height */
|
||||||
int frame_layout; /* See MXFFrameLayout enum */
|
int frame_layout; /* See MXFFrameLayout enum */
|
||||||
|
#define MXF_TFF 1
|
||||||
|
#define MXF_BFF 2
|
||||||
|
int field_dominance;
|
||||||
int channels;
|
int channels;
|
||||||
int bits_per_sample;
|
int bits_per_sample;
|
||||||
unsigned int component_depth;
|
unsigned int component_depth;
|
||||||
@ -830,6 +833,9 @@ static int mxf_read_generic_descriptor(void *arg, AVIOContext *pb, int tag, int
|
|||||||
descriptor->aspect_ratio.num = avio_rb32(pb);
|
descriptor->aspect_ratio.num = avio_rb32(pb);
|
||||||
descriptor->aspect_ratio.den = avio_rb32(pb);
|
descriptor->aspect_ratio.den = avio_rb32(pb);
|
||||||
break;
|
break;
|
||||||
|
case 0x3212:
|
||||||
|
descriptor->field_dominance = avio_r8(pb);
|
||||||
|
break;
|
||||||
case 0x3301:
|
case 0x3301:
|
||||||
descriptor->component_depth = avio_rb32(pb);
|
descriptor->component_depth = avio_rb32(pb);
|
||||||
break;
|
break;
|
||||||
@ -1507,6 +1513,19 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
|
|||||||
* It's also for compatibility with the old behavior. */
|
* It's also for compatibility with the old behavior. */
|
||||||
case SeparateFields:
|
case SeparateFields:
|
||||||
case MixedFields:
|
case MixedFields:
|
||||||
|
switch (descriptor->field_dominance) {
|
||||||
|
case MXF_TFF:
|
||||||
|
st->codec->field_order = AV_FIELD_TT;
|
||||||
|
break;
|
||||||
|
case MXF_BFF:
|
||||||
|
st->codec->field_order = AV_FIELD_BB;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
avpriv_request_sample(mxf->fc,
|
||||||
|
"Field dominance %d support",
|
||||||
|
descriptor->field_dominance);
|
||||||
|
break;
|
||||||
|
}
|
||||||
/* Turn field height into frame height. */
|
/* Turn field height into frame height. */
|
||||||
st->codec->height *= 2;
|
st->codec->height *= 2;
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user