cinedec: add shutter and crop metadata

This commit is contained in:
Ben Hagen 2014-08-16 16:05:04 +02:00 committed by Michael Niedermayer
parent e7f3b507a3
commit 6928ea7eb0

View File

@ -225,7 +225,11 @@ static int cine_read_header(AVFormatContext *avctx)
return AVERROR_INVALIDDATA;
}
avio_skip(pb, 696); // Conv8Min ... ImHeightAcq
avio_skip(pb, 668); // Conv8Min ... Sensor
set_metadata_int(&st->metadata, "shutter_ns", avio_rl32(pb));
avio_skip(pb, 24); // EDRShutterNs ... ImHeightAcq
#define DESCRIPTION_SIZE 4096
description = av_malloc(DESCRIPTION_SIZE + 1);
@ -239,6 +243,14 @@ static int cine_read_header(AVFormatContext *avctx)
else
av_free(description);
avio_skip(pb, 1176); // RisingEdge ... cmUser
set_metadata_int(&st->metadata, "enable_crop", avio_rl32(pb));
set_metadata_int(&st->metadata, "crop_left", avio_rl32(pb));
set_metadata_int(&st->metadata, "crop_top", avio_rl32(pb));
set_metadata_int(&st->metadata, "crop_right", avio_rl32(pb));
set_metadata_int(&st->metadata, "crop_bottom", avio_rl32(pb));
/* parse image offsets */
avio_seek(pb, offImageOffsets, SEEK_SET);
for (i = 0; i < st->duration; i++)