From patchwork Tue Oct 16 17:25:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitrij.Gresserman@loewe.de X-Patchwork-Id: 10685 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 94551446E43 for ; Tue, 16 Oct 2018 20:25:04 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E99FB68A31C; Tue, 16 Oct 2018 20:24:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from krocs001.loewe.de (krocs001.loewe.de [195.243.0.123]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BF13168A103 for ; Tue, 16 Oct 2018 20:24:39 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by krocs001.loewe.de (Postfix) with ESMTP id 42ZMdD2CQVz1X2lt for ; Tue, 16 Oct 2018 19:25:04 +0200 (CEST) X-Virus-Scanned: amavisd-new at loewe.de Received: from krocs001.loewe.de ([127.0.0.1]) by localhost (krocs001.loewe.de [127.0.0.1]) (amavisd-new, port 2025) with ESMTP id fwu01RhBEYAr for ; Tue, 16 Oct 2018 19:25:02 +0200 (CEST) Received: from vmex10a.loewe.de (vmex10a.loewe.de [10.12.3.11]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by krocs001.loewe.de (Postfix) with ESMTPS id 42ZMdB5tPfz1X2lM for ; Tue, 16 Oct 2018 19:25:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=loewe.de; s=krocs001; t=1539710702; bh=uClHNyYiMW+jVmdtSybveP3PZWApxPXZWvB+K0SbDn4=; h=From:To:Subject:Date; b=1/71tPQxuA/4QJ7dwMAXnsBdJyhSM40UKKwHsn5QBvLcKMh2RI+0G6K2xkouA4iU4 QADAgxwSGr8Od/yM8p/ueEH86thJMpE3gTvk2H8ZUhbuoXyzvv92bRjoE4qXPDkMZE Qd6k/ENiaqwIqIFQTHw/hTJ5j31JjyaLl/W74148= Received: from CQEX10.loewe.de ([::1]) by VMEX10a.loewe.de ([::1]) with mapi id 14.03.0389.001; Tue, 16 Oct 2018 19:25:02 +0200 From: To: Thread-Topic: #7496: Access to the reference track (dolby vision) of a stream Thread-Index: AQHUZXS7cWGeWqZruESLHJ5u4NvFUg== Date: Tue, 16 Oct 2018 17:25:01 +0000 Message-ID: Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [192.168.14.27] MIME-Version: 1.0 Subject: [FFmpeg-devel] #7496: Access to the reference track (dolby vision) of a stream X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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] [Instagram] [Pinterest] [YouTube] Loewe Technologies GmbH, Industriestraße 11, 96317 Kronach Tel. +49 9261 99-500 • Fax +49 9261 99-515 ccc@loewe.de • 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 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