Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2022-01-03 11:55:11 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-01-04 13:59:02 +0300
commit78dc21b123e71ef49f45390d826a1c25e3805ec7 (patch)
tree10f9589d0795aa41370d77d1907e7e35e13b6382 /libavutil/dovi_meta.c
parent20b0b2be6c6f7c2c3949e4e004fad78748e76b9b (diff)
lavu/frame: Add Dolby Vision metadata side data type
In order to be able to extend this struct later (as the Dolby Vision RPU evolves), all of the 'container' structs are considered extensible, and the individual constituent fields must instead be accessed via offsets. The precedent for this style of access is set in <libavutil/detection_bbox.h> Signed-off-by: Niklas Haas <git@haasn.dev> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavutil/dovi_meta.c')
-rw-r--r--libavutil/dovi_meta.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/libavutil/dovi_meta.c b/libavutil/dovi_meta.c
index 7bd08f6c54..9c50da561e 100644
--- a/libavutil/dovi_meta.c
+++ b/libavutil/dovi_meta.c
@@ -33,3 +33,28 @@ AVDOVIDecoderConfigurationRecord *av_dovi_alloc(size_t *size)
return dovi;
}
+
+typedef struct AVDOVIMetadataInternal {
+ AVDOVIMetadata metadata;
+ AVDOVIRpuDataHeader header;
+ AVDOVIDataMapping mapping;
+ AVDOVIColorMetadata color;
+} AVDOVIMetadataInternal;
+
+AVDOVIMetadata *av_dovi_metadata_alloc(size_t *size)
+{
+ AVDOVIMetadataInternal *dovi = av_mallocz(sizeof(AVDOVIMetadataInternal));
+ if (!dovi)
+ return NULL;
+
+ if (size)
+ *size = sizeof(*dovi);
+
+ dovi->metadata = (struct AVDOVIMetadata) {
+ .header_offset = offsetof(AVDOVIMetadataInternal, header),
+ .mapping_offset = offsetof(AVDOVIMetadataInternal, mapping),
+ .color_offset = offsetof(AVDOVIMetadataInternal, color),
+ };
+
+ return &dovi->metadata;
+}