diff options
author | vacingfang <vacingfang@tencent.com> | 2020-04-11 20:54:11 +0800 |
---|---|---|
committer | Jun Zhao <barryjzhao@tencent.com> | 2020-04-23 08:05:15 +0800 |
commit | 103885d9557fdddbae6392fba9a84a268224caae (patch) | |
tree | ad387707bbfb8ff56f244ff6d5fb4fd8d9f300fa | |
parent | 0e1db79e37bb9d5ad1f647bd38f7381e2c5865fb (diff) | |
download | ffmpeg-103885d9557fdddbae6392fba9a84a268224caae.tar.gz |
lavutil: add DOVI related header
add DOVI related struct
Signed-off-by: vacingfang <vacingfang@tencent.com>
-rw-r--r-- | libavutil/Makefile | 2 | ||||
-rw-r--r-- | libavutil/dovi_meta.c | 35 | ||||
-rw-r--r-- | libavutil/dovi_meta.h | 70 |
3 files changed, 107 insertions, 0 deletions
diff --git a/libavutil/Makefile b/libavutil/Makefile index 8feb029a3a..966eec41aa 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -23,6 +23,7 @@ HEADERS = adler32.h \ des.h \ dict.h \ display.h \ + dovi_meta.h \ downmix_info.h \ encryption_info.h \ error.h \ @@ -112,6 +113,7 @@ OBJS = adler32.o \ des.o \ dict.o \ display.o \ + dovi_meta.o \ downmix_info.o \ encryption_info.o \ error.o \ diff --git a/libavutil/dovi_meta.c b/libavutil/dovi_meta.c new file mode 100644 index 0000000000..7bd08f6c54 --- /dev/null +++ b/libavutil/dovi_meta.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2020 Jun Zhao<barryjzhao@tencent.com> + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "dovi_meta.h" +#include "mem.h" + +AVDOVIDecoderConfigurationRecord *av_dovi_alloc(size_t *size) +{ + AVDOVIDecoderConfigurationRecord *dovi = + av_mallocz(sizeof(AVDOVIDecoderConfigurationRecord)); + if (!dovi) + return NULL; + + if (size) + *size = sizeof(*dovi); + + return dovi; +} diff --git a/libavutil/dovi_meta.h b/libavutil/dovi_meta.h new file mode 100644 index 0000000000..299911d434 --- /dev/null +++ b/libavutil/dovi_meta.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2020 Vacing Fang <vacingfang@tencent.com> + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * DOVI configuration + */ + + +#ifndef AVUTIL_DOVI_META_H +#define AVUTIL_DOVI_META_H + +#include <stdint.h> +#include <stddef.h> + +/* + * DOVI configuration + * ref: dolby-vision-bitstreams-within-the-iso-base-media-file-format-v2.1.2 + dolby-vision-bitstreams-in-mpeg-2-transport-stream-multiplex-v1.2 + * @code + * uint8_t dv_version_major, the major version number that the stream complies with + * uint8_t dv_version_minor, the minor version number that the stream complies with + * uint8_t dv_profile, the Dolby Vision profile + * uint8_t dv_level, the Dolby Vision level + * uint8_t rpu_present_flag + * uint8_t el_present_flag + * uint8_t bl_present_flag + * uint8_t dv_bl_signal_compatibility_id + * @endcode + * + * @note The struct must be allocated with av_dovi_alloc() and + * its size is not a part of the public ABI. + */ +typedef struct AVDOVIDecoderConfigurationRecord { + uint8_t dv_version_major; + uint8_t dv_version_minor; + uint8_t dv_profile; + uint8_t dv_level; + uint8_t rpu_present_flag; + uint8_t el_present_flag; + uint8_t bl_present_flag; + uint8_t dv_bl_signal_compatibility_id; +} AVDOVIDecoderConfigurationRecord; + +/** + * Allocate a AVDOVIDecoderConfigurationRecord structure and initialize its + * fields to default values. + * + * @return the newly allocated struct or NULL on failure + */ +AVDOVIDecoderConfigurationRecord *av_dovi_alloc(size_t *size); + +#endif /* AVUTIL_DOVI_META_H */ |