summaryrefslogtreecommitdiff
path: root/libavformat/mxfenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-06 03:06:12 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-08 13:03:29 +0200
commit7630cce4b3096b6d0106a0f5dd4c5f497cc28a93 (patch)
tree8e48958bdf993a34f794d0a2e8e0ce219123b8d8 /libavformat/mxfenc.c
parent4b343f7c359bf402017e0bf56e48654c139e88cd (diff)
avformat/mxfenc: Allow overriding /manual setting of the signal standard
previous patch reviewed-by: tim nicholson <nichot20@yahoo.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mxfenc.c')
-rw-r--r--libavformat/mxfenc.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index c61274790f..db7d2bf455 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -316,6 +316,7 @@ typedef struct MXFContext {
uint32_t instance_number;
uint8_t umid[16]; ///< unique material identifier
int channel_count;
+ int signal_standard;
uint32_t tagged_value_count;
AVRational audio_edit_rate;
} MXFContext;
@@ -2104,6 +2105,8 @@ static int mxf_write_header(AVFormatContext *s)
sc->signal_standard = 1;
}
+ if (mxf->signal_standard >= 0)
+ sc->signal_standard = mxf->signal_standard;
} else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
if (st->codec->sample_rate != 48000) {
av_log(s, AV_LOG_ERROR, "only 48khz is implemented\n");
@@ -2627,7 +2630,28 @@ static int mxf_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int
mxf_interleave_get_packet, mxf_compare_timestamps);
}
+#define MXF_COMMON_OPTIONS \
+ { "signal_standard", "Force/set Sigal Standard",\
+ offsetof(MXFContext, signal_standard), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 7, AV_OPT_FLAG_ENCODING_PARAM, "signal_standard"},\
+ { "bt601", "ITU-R BT.601 and BT.656, also SMPTE 125M (525 and 625 line interlaced)",\
+ 0, AV_OPT_TYPE_CONST, {.i64 = 1}, -1, 7, AV_OPT_FLAG_ENCODING_PARAM, "signal_standard"},\
+ { "bt1358", "ITU-R BT.1358 and ITU-R BT.799-3, also SMPTE 293M (525 and 625 line progressive)",\
+ 0, AV_OPT_TYPE_CONST, {.i64 = 2}, -1, 7, AV_OPT_FLAG_ENCODING_PARAM, "signal_standard"},\
+ { "smpte347m", "SMPTE 347M (540 Mbps mappings)",\
+ 0, AV_OPT_TYPE_CONST, {.i64 = 3}, -1, 7, AV_OPT_FLAG_ENCODING_PARAM, "signal_standard"},\
+ { "smpte274m", "SMPTE 274M (1125 line)",\
+ 0, AV_OPT_TYPE_CONST, {.i64 = 4}, -1, 7, AV_OPT_FLAG_ENCODING_PARAM, "signal_standard"},\
+ { "smpte296m", "SMPTE 296M (750 line progressive)",\
+ 0, AV_OPT_TYPE_CONST, {.i64 = 5}, -1, 7, AV_OPT_FLAG_ENCODING_PARAM, "signal_standard"},\
+ { "smpte349m", "SMPTE 349M (1485 Mbps mappings)",\
+ 0, AV_OPT_TYPE_CONST, {.i64 = 6}, -1, 7, AV_OPT_FLAG_ENCODING_PARAM, "signal_standard"},\
+ { "smpte428", "SMPTE 428-1 DCDM",\
+ 0, AV_OPT_TYPE_CONST, {.i64 = 7}, -1, 7, AV_OPT_FLAG_ENCODING_PARAM, "signal_standard"},
+
+
+
static const AVOption mxf_options[] = {
+ MXF_COMMON_OPTIONS
{ NULL },
};
@@ -2641,6 +2665,7 @@ static const AVClass mxf_muxer_class = {
static const AVOption d10_options[] = {
{ "d10_channelcount", "Force/set channelcount in generic sound essence descriptor",
offsetof(MXFContext, channel_count), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 8, AV_OPT_FLAG_ENCODING_PARAM},
+ MXF_COMMON_OPTIONS
{ NULL },
};
@@ -2654,6 +2679,7 @@ static const AVClass mxf_d10_muxer_class = {
static const AVOption opatom_options[] = {
{ "mxf_audio_edit_rate", "Audio edit rate for timecode",
offsetof(MXFContext, audio_edit_rate), AV_OPT_TYPE_RATIONAL, {.dbl=25}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
+ MXF_COMMON_OPTIONS
{ NULL },
};