From patchwork Tue Aug 23 09:03:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: erkki.seppala.ext@nokia.com X-Patchwork-Id: 257 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.134 with SMTP id o128csp2180617vsd; Tue, 23 Aug 2016 02:06:42 -0700 (PDT) X-Received: by 10.194.103.3 with SMTP id fs3mr21259533wjb.115.1471943202163; Tue, 23 Aug 2016 02:06:42 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 9si2153526wjq.93.2016.08.23.02.06.41; Tue, 23 Aug 2016 02:06:42 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nokia.onmicrosoft.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE dis=NONE) header.from=nokia.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 79181689CF3; Tue, 23 Aug 2016 12:04:59 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0108.outbound.protection.outlook.com [104.47.1.108]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DCBF8689BF3 for ; Tue, 23 Aug 2016 12:04:11 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=8h/Xoi67iiCeQGQ12q0zlC92uD5Zte4MZxqQdKk4qFI=; b=YQ6xXmGRODf2gmUphlV/36F2Uj3Upgms9nZtR3pDm7f0jujZcujM/1D27aNdyhRZx8s9/7nCYpG8qOuicxVuEfPaavm/FsGrCwU5NpZjRkWq5C/4T09oxQvMWTFJeQFvzJTGUDdTzzncAFq7RnSMb5KeMC7VYkzC0XLqDazYLnk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=erkki.seppala.ext@nokia.com; Received: from erkkise-laptop.vincit.intranet (131.228.2.4) by AM5PR0701MB2530.eurprd07.prod.outlook.com (10.169.153.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.557.21; Tue, 23 Aug 2016 09:04:11 +0000 Received: by erkkise-laptop.vincit.intranet (Postfix, from userid 1000) id 60DF54449F0; Tue, 23 Aug 2016 12:04:04 +0300 (EEST) From: To: Date: Tue, 23 Aug 2016 12:03:28 +0300 Message-ID: <1471943019-14136-11-git-send-email-erkki.seppala.ext@nokia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1471943019-14136-1-git-send-email-erkki.seppala.ext@nokia.com> References: <1471943019-14136-1-git-send-email-erkki.seppala.ext@nokia.com> MIME-Version: 1.0 X-Originating-IP: [131.228.2.4] X-ClientProxiedBy: AM5PR0101CA0009.eurprd01.prod.exchangelabs.com (10.169.240.19) To AM5PR0701MB2530.eurprd07.prod.outlook.com (10.169.153.150) X-MS-Office365-Filtering-Correlation-Id: 5235cfb5-4b8f-45f3-e80e-08d3cb347321 X-Microsoft-Exchange-Diagnostics: 1; AM5PR0701MB2530; 2:/2RnmMfqaV6Ixd+rjCpCZMQwk+6K7wP8KxptML9L4SLIa+UvOOXPNzyjxHLDF5aJTXlAgTxXpS7nUhqVzBPBq1/nEIxofdaXo52hwrQrfnGIkX5cYkYQVqB++jaUEKNUpL1wt/rch5p2Jbb9gZcEWdcsjLRuUEgfM+r1nHD/ndDUeQ+GsW0QS3mf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w00KfHDS1EzXl9ZoSftzou4Ve5TqVMwkMl2HiC2hi94yhLsmLKNbj4bq2OY1+kyJ1BFfH3iWccRhwwAL2jyfTYBckytc7i4u9B0IJv3qpKeOe/TSndpPZL0P5m6pfzYfrd09O1LEXoYD9Pcp1Zf9sg6kslkh9H2/55v3Reb+K/JtC8zwjp2vnEmwvJoL8JdBHS3khAK8Fzg9M6M126kNLVTFtqGfFdbmy8/PwGnDcCEoOiDnLdVJYyZk0KMsts69d5/Dzjv9rleJaSz2tE7UPJBdMdnmAevcLcaIPlLuIL2/F58QjXlEAFYmW5dB3OyqGM5dzmO42UBTWd1hha X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(82608151540597); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:AM5PR0701MB2530; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0701MB2530; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0701MB2530; 4:wyotVQYF0WFlarMycqdBZFm4N1oZD6NP4DDsm2LcznDQSdcWrhzIIe9oV0LH4rFpzTk6rFFNkLWxR+wByXkjG/P/At+73N/ICYtK+auA1bfqwjCTkKo8GeXPwkiUc16kh0cDlF8Diu7no7BYu/3S7EcfrS3yAjx5QEvgKwoxheiHEZrRgElr09zCxSUyu60erl4T44GFzcHXckEpGpgHhfXed82bvgceDZFJKsL9DLGx9DBpiFOg3Wt8ZQhvrE3JgKTIK/GwaDwKFm/oZIPODgzyLUZwpArK0o7JuClLQtIYe5ZI9/eRcEZWi95ddmlzdsO3kgP5TSg7ENFdj6swYimwi8Kj3Aws9Oqg7eKBKnCd6rd/QJI5zcdqeueyW9ZddKvaLK8/gqOuT2hcKYEp0J5xaeQJOvOdMUWXvY3E9zEGW6mmGf68AXfCM+q3QHbfm2H612UP3iSxXofddJk/NA== X-Forefront-PRVS: 004395A01C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(189002)(199003)(305945005)(50986999)(5660300001)(7736002)(76176999)(92566002)(47776003)(33646002)(45336002)(50466002)(86152002)(46386002)(107886002)(90966002)(3846002)(42186005)(110136002)(586003)(6116002)(97736004)(7846002)(105586002)(66066001)(4001430100002)(86362001)(450100001)(2950100001)(2876002)(2906002)(52956003)(2870700001)(8676002)(68736007)(122856001)(5820100001)(101416001)(189998001)(4326007)(81166006)(19580395003)(229853001)(36756003)(81156014)(19580405001)(50226002)(106356001)(23676002)(2351001)(2004002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM5PR0701MB2530; H:erkkise-laptop.vincit.intranet; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: nokia.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTVQUjA3MDFNQjI1MzA7MjM6K0dyMGFSc0NNSHluaTd3TDVLcjREODdi?= =?utf-8?B?SGtmTVRIZ1I4bm42Mm9TU05zZUlmQnhmbGpxdDRjcTRoNnRuYXB5ZU5CTFNr?= =?utf-8?B?QWRsd25BeHFrdVl4d2J0bDJtcWl2RnNQUS9EWVZEdWNjMi9JUWhuZmwrWnpm?= =?utf-8?B?V2tMbjdtNGlwNWVVK1VHNzVzU1lvS3M2b3VKSnRZVlZ4Y0ZBaU1mb09jK0wx?= =?utf-8?B?MFlwNHFOUFNYWU5vY0NIY2l0MW4yTWJyTnYzKy9ReW9TSFBaYWIvOFNIcExq?= =?utf-8?B?VmtUR3czQ3JaV3RkVGpQNUhWVUp4dlRzNWFWM1dLMUxRdTZlMjYyMGhXTTcz?= =?utf-8?B?dmo1RmsyaThPandlM1FlNGlCUG1wT21HS3hpWmZ6Y0RGVW02Y3E3OThuTk5J?= =?utf-8?B?VHVpQit1WEkxWkhiK0lZMTM2T2ZzWklDbU0yK1ZHNU1PUWhQdmV2dFhjWmFm?= =?utf-8?B?TUQ5ZVFSb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:WdknC8546BP4q+F41UF/X/hNECNcW56pIgAvit/zTfevIKjPOPFRepLd1Y3GDU3YnZs5bp+GqQnHuGkdj/UlGNRhGflzzqQCJH2b1Qmpiy8=; 7:aFBaheI0JYq/Kl9MbPaIgr24eGNpYCffQqgQUno5/DTmNeZ1TqkxJ06QavsBqVHs1AflE57xRydmManxwI96BTDgei+w8J9yl9OKJgTfZGoU+XZF3qR44wm4cJt4EVBdTYv5eVDCbJNFZruRQ8cWmqAIOLInGoG/zCGzfML6Syx0XsDPhYS0IWwOiZ/uU2WYWzsrt7s+zD5/Z+E2Z1e8aZHaU9SWReuSxIWTTezTpliZhtTMqdLg8la4TFyXI+d4 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2016 09:04:11.9231 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0701MB2530 Subject: [FFmpeg-devel] [PATCH 10/21] libavformat/movenc: add the urim sample descriptor 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 Cc: =?UTF-8?q?Erkki=20Sepp=C3=A4l=C3=A4?= , OZOPlayer Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Erkki Seppälä This also adds libavformat/movmeta that contains the meta data information. Later commits will add public interfaces for accessing the data. Signed-off-by: Erkki Seppälä Signed-off-by: OZOPlayer --- libavcodec/avcodec.h | 18 ++++++++++- libavformat/isom.c | 1 + libavformat/movenc.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++++--- libavformat/movenc.h | 1 + libavformat/movmeta.h | 46 ++++++++++++++++++++++++++++ 5 files changed, 144 insertions(+), 5 deletions(-) create mode 100644 libavformat/movmeta.h diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 893b89b..36c85e9 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -1349,6 +1349,16 @@ typedef struct AVCPBProperties { * @{ */ +typedef struct AVTimedMetadata { + char meta_tag[4]; /** 4cc describing this metadata box type */ + int meta_length; /** length of data for the metadata type information */ + + char conf_tag[4]; /** configurationg box type 4cc, ie. 'conf' */ + int conf_length; /** length of the data for the configuration box */ + + /** followed by meta_length bytes of meta data followed by conf_length bytes of conf data */ +} AVTimedMetadata; + typedef struct AVTrackReferences { char tag[4]; /** 4cc used for describing this */ int nb_tracks; /** number of tracks */ @@ -1540,7 +1550,13 @@ enum AVPacketSideDataType { * (including the track list that follows it), for as long as * indicated by the key's length. */ - AV_PKT_DATA_TRACK_REFERENCES + AV_PKT_DATA_TRACK_REFERENCES, + + /** + * Configured the timed metadata parameters, such as the uri and + * meta data configuration. The key is of type AVTimedMetadata. + */ + AV_PKT_DATA_TIMED_METADATA_INFO }; #define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED diff --git a/libavformat/isom.c b/libavformat/isom.c index 1a90d00..473700f 100644 --- a/libavformat/isom.c +++ b/libavformat/isom.c @@ -357,6 +357,7 @@ const AVCodecTag ff_codec_movsubtitle_tags[] = { const AVCodecTag ff_codec_metadata_tags[] = { { AV_CODEC_ID_META, MKTAG('m', 'e', 't', 'a') }, + { AV_CODEC_ID_META, MKTAG('u', 'r', 'i', 'm') }, { AV_CODEC_ID_NONE, 0 }, }; diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 072e660..141f1a5 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -1552,6 +1552,69 @@ static int mov_write_fiel_tag(AVIOContext *pb, MOVTrack *track, int field_order) return 10; } +static int mov_write_urim_uri_box(AVIOContext *pb, const char *uri, int length) +{ + int64_t pos = avio_tell(pb); + avio_wb32(pb, 0); /* size */ + ffio_wfourcc(pb, "uri "); + avio_w8(pb, 0); /* version */ + avio_wb24(pb, 0); /* flags */ + + avio_write(pb, uri, length); /* uri */ + avio_w8(pb, 0); /* null-terminated */ + + return update_size(pb, pos); +} + +static int mov_write_conf_box(AVIOContext *pb, const uint8_t *data, int length, char* tag) +{ + int64_t pos = avio_tell(pb); + avio_wb32(pb, 0); /* size */ + ffio_wfourcc(pb, tag); + + avio_w8(pb, 0); /* version */ + avio_wb24(pb, 0); /* flags */ + + avio_write(pb, data, length); /* data */ + + return update_size(pb, pos); +} + +static int mov_write_meta_codec(AVIOContext *pb, MOVTrack *track) +{ + int64_t pos = avio_tell(pb); + + char *data; + char *tag; + + AVTimedMetadata *meta = + (void*) av_stream_get_side_data(track->st, AV_PKT_DATA_TIMED_METADATA_INFO, + NULL); + + av_assert0(meta); + + avio_wb32(pb, 0); /* size */ + ffio_wfourcc(pb, meta->meta_tag); + + avio_wb32(pb, 0); /* Reserved */ + avio_wb16(pb, 0); /* Reserved */ + avio_wb16(pb, 1); /* Data-reference index */ + + data = (char*) (meta + 1); + tag = meta->meta_tag; + if (tag[0] == 'u' && tag[1] == 'r' && tag[2] == 'i' && tag[3] == 'm') { + mov_write_urim_uri_box(pb, data, meta->meta_length); + data += meta->meta_length; + } + + if (meta->conf_length) { + mov_write_conf_box(pb, data, meta->conf_length, meta->conf_tag); + data += meta->conf_length; + } + + return update_size(pb, pos); +} + static int mov_write_subtitle_tag(AVIOContext *pb, MOVTrack *track) { int64_t pos = avio_tell(pb); @@ -1951,6 +2014,18 @@ static int mov_write_tmcd_tag(AVIOContext *pb, MOVTrack *track) return update_size(pb, pos); } +static int mov_write_data_tag(AVIOContext *pb, MOVTrack *track) +{ + if (track->par->codec_id == AV_CODEC_ID_META) + return mov_write_meta_codec(pb, track); + else if (track->par->codec_tag == MKTAG('t','m','c','d')) + return mov_write_tmcd_tag(pb, track); + else if (track->par->codec_tag == MKTAG('r','t','p',' ')) + return mov_write_rtp_tag(pb, track); + else + return 0; +} + static int mov_write_stsd_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext *mov, MOVTrack *track) { int64_t pos = avio_tell(pb); @@ -1962,12 +2037,10 @@ static int mov_write_stsd_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext mov_write_video_tag(pb, mov, track); else if (track->par->codec_type == AVMEDIA_TYPE_AUDIO) mov_write_audio_tag(s, pb, mov, track); + else if (track->par->codec_type == AVMEDIA_TYPE_DATA) + mov_write_data_tag(pb, track); else if (track->par->codec_type == AVMEDIA_TYPE_SUBTITLE) mov_write_subtitle_tag(pb, track); - else if (track->par->codec_tag == MKTAG('r','t','p',' ')) - mov_write_rtp_tag(pb, track); - else if (track->par->codec_tag == MKTAG('t','m','c','d')) - mov_write_tmcd_tag(pb, track); return update_size(pb, pos); } @@ -2309,6 +2382,8 @@ static int mov_write_minf_tag(AVFormatContext *s, AVIOContext *pb, MOVMuxContext mov_write_vmhd_tag(pb); else if (track->par->codec_type == AVMEDIA_TYPE_AUDIO) mov_write_smhd_tag(pb); + else if (track->par->codec_type == AVMEDIA_TYPE_DATA) + mov_write_nmhd_tag(pb); else if (track->par->codec_type == AVMEDIA_TYPE_SUBTITLE) { if (track->tag == MKTAG('t','e','x','t') || is_clcp_track(track)) { mov_write_gmhd_tag(pb, track); diff --git a/libavformat/movenc.h b/libavformat/movenc.h index 5bf9469..15aa4b3 100644 --- a/libavformat/movenc.h +++ b/libavformat/movenc.h @@ -26,6 +26,7 @@ #include "avformat.h" #include "movenccenc.h" +#include "movmeta.h" #define MOV_FRAG_INFO_ALLOC_INCREMENT 64 #define MOV_INDEX_CLUSTER_SIZE 1024 diff --git a/libavformat/movmeta.h b/libavformat/movmeta.h new file mode 100644 index 0000000..e57b381 --- /dev/null +++ b/libavformat/movmeta.h @@ -0,0 +1,46 @@ +/* + * MOV, 3GP, MP4 muxer + * Copyright (c) 2015 Erkki Seppälä + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFORMAT_MOVMETA_H +#define AVFORMAT_MOVMETA_H + +#include "avformat.h" + +typedef enum MOVMetaType { + MOV_META_NONE, + MOV_META_URIM +} MOVMetaType; + +typedef struct MOVConfMeta { + uint32_t tag; + int length; + void *data; +} MOVConfMeta; + +typedef struct MOVMeta { + uint32_t tag; + int length; + void *data; + + MOVConfMeta conf; +} MOVMeta; + +#endif /* AVFORMAT_MOVMETA_H */