From patchwork Mon Aug 27 19:57:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stebbins X-Patchwork-Id: 10152 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:12c4:0:0:0:0:0 with SMTP id 65-v6csp6809271jap; Mon, 27 Aug 2018 12:57:24 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ0RH640799sQtR787NR/U52IQoxO3Z4VUXHIF/1Dqz01IUpkmT/SNygL1v+SdUevrVoQPx X-Received: by 2002:a1c:2dc8:: with SMTP id t191-v6mr6760189wmt.94.1535399843972; Mon, 27 Aug 2018 12:57:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535399843; cv=none; d=google.com; s=arc-20160816; b=ObIW5dU+SfZ1gBOYhFc55LzIC9uMcXVQYVLlutYp1y5kpUujUVpEZy1ikxWA0D6h4n z5bC92ZYkYNjaM96ywsSQ/EkEPlrsyoTMb5gUioVaO+CCSCUIgMoZdZQMDreHHUsKuT/ YZUjj5Uz+JLN/eX97vgywGal0sUVzZKdDy1EPUUdjnRTRewYQ1cQsNCSJ/M04+CYbqwG SiHXbuSEbzZ6boS17UEXUK5jTFJ0bTuXzkEm0OijeMKjcMlZXP9w+db09+V2zUPEfXMT XwLs/d1BRSeqvGL0wPEqCBjXIcifSMx03Ahzm6ux4Vppwqx88cU6n8OcZ4SQ8/rRxHax NDTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to:arc-authentication-results; bh=rI2w8U7ZhuSFNS9CMv3+cKl+PE2amOMHLqIT41yxAAg=; b=k7BXa7l+nY81NOperG1yFcux6sl9FrxrPMLA4zoSYNG7K/IPiowCapz55Jj77rz7/U U9tmq6axRBn6YO4xra2Q5SWMpZdQ6mA5iBzzoSVc5LFfZhlahTjcNplznTqx3hpXkArd MGGrwnHZpHm2MFrrjGDItY6WuXL2ahleyWdpHuWcXh8Jh1nhEaG8Yc/kc5AgCL19VFaE 8cc08ojQQI8JWDWbG5KNM9yafYWUutjn3vv/Rvq+OZhqemS/whkgdclp7tJo31eMqK06 1LKQguk7Yw0GTBN7d8+c6QqSdYgLybRnRKpi7mmctDfl2sAXxE16zuop0bkAlw+AkLgu vtRA== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i96-v6si95407wri.359.2018.08.27.12.57.23; Mon, 27 Aug 2018 12:57:23 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4E6AA6897E6; Mon, 27 Aug 2018 22:57:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail.jetheaddev.com (mail.jetheaddev.com [70.164.99.34]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 28484680351 for ; Mon, 27 Aug 2018 22:57:13 +0300 (EEST) Received: from dionysus.jetheaddev.com (10.13.12.63) by cas.jetheaddev.com (192.168.13.27) with Microsoft SMTP Server (TLS) id 14.3.351.0; Mon, 27 Aug 2018 12:57:14 -0700 Received: from dionysus.jetheaddev.com (localhost [127.0.0.1]) by dionysus.jetheaddev.com (8.15.2/8.14.7) with ESMTP id w7RJvEnq025449 for ; Mon, 27 Aug 2018 12:57:14 -0700 Received: (from jstebbins@localhost) by dionysus.jetheaddev.com (8.15.2/8.15.2/Submit) id w7RJvEnG025448 for ffmpeg-devel@ffmpeg.org; Mon, 27 Aug 2018 12:57:14 -0700 From: John Stebbins To: Date: Mon, 27 Aug 2018 12:57:07 -0700 Message-ID: <20180827195709.25396-1-jstebbins@jetheaddev.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.13.12.63] Subject: [FFmpeg-devel] [PATCH 1/4] lavf/mov: add AVCodecTag entry for GoPro metadata 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" This allows for validation of the track type --- libavformat/isom.c | 5 +++++ libavformat/isom.h | 1 + libavformat/mov.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/libavformat/isom.c b/libavformat/isom.c index ce66d1bcd4..ca9d22e4f7 100644 --- a/libavformat/isom.c +++ b/libavformat/isom.c @@ -374,6 +374,11 @@ const AVCodecTag ff_codec_movsubtitle_tags[] = { { AV_CODEC_ID_NONE, 0 }, }; +const AVCodecTag ff_codec_movdata_tags[] = { + { AV_CODEC_ID_BIN_DATA, MKTAG('g', 'p', 'm', 'd') }, + { AV_CODEC_ID_NONE, 0 }, +}; + /* map numeric codes from mdhd atom to ISO 639 */ /* cf. QTFileFormat.pdf p253, qtff.pdf p205 */ /* http://developer.apple.com/documentation/mac/Text/Text-368.html */ diff --git a/libavformat/isom.h b/libavformat/isom.h index 51abea52de..f3a7a8633d 100644 --- a/libavformat/isom.h +++ b/libavformat/isom.h @@ -41,6 +41,7 @@ extern const AVCodecTag ff_mp4_obj_type[]; extern const AVCodecTag ff_codec_movvideo_tags[]; extern const AVCodecTag ff_codec_movaudio_tags[]; extern const AVCodecTag ff_codec_movsubtitle_tags[]; +extern const AVCodecTag ff_codec_movdata_tags[]; int ff_mov_iso639_to_lang(const char lang[4], int mp4); int ff_mov_lang_to_iso639(unsigned code, char to[4]); diff --git a/libavformat/mov.c b/libavformat/mov.c index d66f4e338c..8915e3b9e0 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2034,6 +2034,8 @@ static int mov_codec_id(AVStream *st, uint32_t format) id = ff_codec_get_id(ff_codec_movsubtitle_tags, format); if (id > 0) st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE; + else + id = ff_codec_get_id(ff_codec_movdata_tags, format); } } @@ -2507,6 +2509,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) mov_parse_stsd_subtitle(c, pb, st, sc, size - (avio_tell(pb) - start_pos)); } else { + st->codecpar->codec_id = id; ret = mov_parse_stsd_data(c, pb, st, sc, size - (avio_tell(pb) - start_pos)); if (ret < 0)