[FFmpeg-cvslog] avformat/av1: add support for passing through MP4/Matroska av1c
Jan Ekström
git at videolan.org
Tue Nov 24 10:27:35 EET 2020
ffmpeg | branch: master | Jan Ekström <jeebjp at gmail.com> | Mon Nov 23 18:00:44 2020 +0200| [4688017d9a1c2633c5888de5a0580d29e7680d54] | committer: Jan Ekström
avformat/av1: add support for passing through MP4/Matroska av1c
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4688017d9a1c2633c5888de5a0580d29e7680d54
---
libavformat/av1.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/libavformat/av1.c b/libavformat/av1.c
index 0cbffb1fd8..5512c4e0f7 100644
--- a/libavformat/av1.c
+++ b/libavformat/av1.c
@@ -375,6 +375,20 @@ int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size)
if (size <= 0)
return AVERROR_INVALIDDATA;
+ if (buf[0] & 0x80) {
+ // first bit is nonzero, the passed data does not consist purely of
+ // OBUs. Expect that the data is already in AV1CodecConfigurationRecord
+ // format.
+ int config_record_version = buf[0] & 0x7f;
+ if (config_record_version != 1 || size < 4) {
+ return AVERROR_INVALIDDATA;
+ }
+
+ avio_write(pb, buf, size);
+
+ return 0;
+ }
+
ret = avio_open_dyn_buf(&meta_pb);
if (ret < 0)
return ret;
More information about the ffmpeg-cvslog
mailing list