Hello,

i need access to the reference track of a stream in a mp4 file.
ISO/IEC 14496-12:2005 describes this as the track_ID of the Track Reference Box.
Here is my approach attached as a patch.

Best regards
________________________________
Visit our website: https://www.loewe.tv/int

[Facebook]<https://www.facebook.com/LoeweDeutschland>  [Instagram] 
<https://www.instagram.com/loewe.international/>   [Pinterest] 
<https://www.pinterest.com/loewetv/>   [YouTube] 
<http://www.youtube.com/user/loewe>

Loewe Technologies GmbH, Industriestraße 11, 96317 Kronach
Tel. +49 9261 99-500 • Fax +49 9261 99-515
c...@loewe.de<mailto:c...@loewe.de> • www.loewe.tv<https://www.loewe.tv>

Executive Management: Mark Hüsges, Hans-Henning Doerr, Peter Nortmann, Dr. Ralf 
Vogt • Registered Office: Kronach • Commercial Register: Amtsgericht Coburg HRB 
5443
From 43832ef5034e9712a9d3bf943bf962df55cbe639 Mon Sep 17 00:00:00 2001
From: gressermdm <dmitrij.gresser...@loewe.de>
Date: Thu, 20 Sep 2018 16:32:03 +0200
Subject: [PATCH] Access to the reference track (dolby vision) of a stream

---
 libavformat/avformat.h |  7 +++++++
 libavformat/mov.c      | 14 ++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index fdaffa5..30ef7eb 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1220,6 +1220,13 @@ typedef struct AVStream {
      * Must not be accessed in any way by callers.
      */
     AVStreamInternal *internal;
+
+    /**
+     * A reference to another dolby track.
+     * 0 indicates that no reference track is available.
+     * Only used for decoding.
+     */
+    int reference_track_dolby;
 } AVStream;
 
 #if FF_API_FORMAT_GET_SET
diff --git a/libavformat/mov.c b/libavformat/mov.c
index ec57a05..0e57778 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6658,6 +6658,19 @@ static int mov_read_dops(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     return 0;
 }
 
+static int mov_read_vdep(MOVContext *c, AVIOContext *pb, MOVAtom atom)
+{
+    int track_id;
+    AVStream *st;
+
+    track_id = (int)avio_rb32(pb);
+
+    st = c->fc->streams[c->fc->nb_streams-1];
+    st->reference_track_dolby = track_id;
+
+    return 0;
+}
+
 static const MOVParseTableEntry mov_default_parse_table[] = {
 { MKTAG('A','C','L','R'), mov_read_aclr },
 { MKTAG('A','P','R','G'), mov_read_avid },
@@ -6751,6 +6764,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = {
 { MKTAG('v','p','c','C'), mov_read_vpcc },
 { MKTAG('m','d','c','v'), mov_read_mdcv },
 { MKTAG('c','l','l','i'), mov_read_clli },
+{ MKTAG('v','d','e','p'), mov_read_vdep },
 { 0, NULL }
 };
 
-- 
2.7.4

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to