[FFmpeg-devel] [PATCH v7 2/3] avformat/mxf: add platform local tag
Tomas Härdin
tjoppen at acc.umu.se
Thu Feb 4 20:37:18 EET 2021
tis 2021-02-02 klockan 20:47 +0800 skrev lance.lmwang at gmail.com:
> From: Limin Wang <lance.lmwang at gmail.com>
>
> Please check the string of platform with below command:
> ./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy out.mxf
> ./ffmpeg -i out.mxf
> ....
> application_platform: Lavf (linux)
>
> Reviewed-by: Tomas Härdin <tjoppen at acc.umu.se>
> Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> ---
> configure | 1 +
> libavformat/mxfenc.c | 4 ++++
> tests/ref/fate/copy-trac4914 | 2 +-
> tests/ref/fate/mxf-d10-user-comments | 2 +-
> tests/ref/fate/mxf-opatom-user-comments | 2 +-
> tests/ref/fate/mxf-reel_name | 2 +-
> tests/ref/fate/mxf-user-comments | 2 +-
> tests/ref/fate/time_base | 2 +-
> tests/ref/lavf/mxf | 6 +++---
> tests/ref/lavf/mxf_d10 | 2 +-
> tests/ref/lavf/mxf_dv25 | 2 +-
> tests/ref/lavf/mxf_dvcpro50 | 2 +-
> tests/ref/lavf/mxf_opatom | 2 +-
> tests/ref/lavf/mxf_opatom_audio | 2 +-
> 14 files changed, 19 insertions(+), 14 deletions(-)
>
> diff --git a/configure b/configure
> index df298b4..a092a6b 100755
> --- a/configure
> +++ b/configure
> @@ -7579,6 +7579,7 @@ cat > $TMPH <<EOF
> #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
> #define AVCONV_DATADIR "$(eval c_escape $datadir)"
> #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
> +#define OS_NAME $target_os
> #define av_restrict $restrict_keyword
> #define EXTERN_PREFIX "${extern_prefix}"
> #define EXTERN_ASM ${extern_prefix}
> diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
> index b0cfa87..39ab443 100644
> --- a/libavformat/mxfenc.c
> +++ b/libavformat/mxfenc.c
> @@ -752,12 +752,14 @@ static void store_version(AVFormatContext *s){
> avio_wb16(pb, 0); // release
> }
>
> +#define PLATFROM_IDENT "Lavf " AV_STRINGIFY((OS_NAME))
> static void mxf_write_identification(AVFormatContext *s)
> {
> MXFContext *mxf = s->priv_data;
> AVIOContext *pb = s->pb;
> const char *company = "FFmpeg";
> const char *product = s->oformat != &ff_mxf_opatom_muxer ? "OP1a Muxer" : "OPAtom Muxer";
> + const char *platform = s->flags & AVFMT_FLAG_BITEXACT ? "Lavf" : PLATFROM_IDENT;
> const char *version;
> int length;
>
> @@ -768,6 +770,7 @@ static void mxf_write_identification(AVFormatContext *s)
> "0.0.0" : AV_STRINGIFY(LIBAVFORMAT_VERSION);
> length = 100 +mxf_utf16_local_tag_length(company) +
> mxf_utf16_local_tag_length(product) +
> + mxf_utf16_local_tag_length(platform) +
> mxf_utf16_local_tag_length(version);
> klv_encode_ber_length(pb, length);
>
> @@ -786,6 +789,7 @@ static void mxf_write_identification(AVFormatContext *s)
> store_version(s);
>
> mxf_write_local_tag_utf16(s, 0x3C04, version); // Version String
> + mxf_write_local_tag_utf16(s, 0x3C08, platform); // Platform
I was going to say this is missing ToolkitVersion, but I see
store_version() writes that. So this looks OK.
/Tomas
More information about the ffmpeg-devel
mailing list