From patchwork Fri Dec 22 14:35:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: misty@brew.sh X-Patchwork-Id: 6909 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.79.195 with SMTP id r64csp2739120jad; Fri, 22 Dec 2017 11:49:38 -0800 (PST) X-Google-Smtp-Source: ACJfBosDGfdNjCRu7u1qKsUbjmZs6HlUbH4mNFpt91pkkHtFHdcLHpJJ5ySxrYeUnrCDt7nSqU2l X-Received: by 10.28.202.11 with SMTP id a11mr13935295wmg.77.1513972178512; Fri, 22 Dec 2017 11:49:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513972178; cv=none; d=google.com; s=arc-20160816; b=EpnrURRYxU2iGT9YLaDF/hZdgca04pN8IdhTdBA/Zfqmpfv5xS7A2T0bAdLX0bPPeJ b07TnUQNNnN/CUQ0VWt+8OcwWZ61yzD4UFqkNrMg+BUUbciPwQAH+R9luIQQ8YN667Qc 0NAKq4JbZTGtyy78XlWOtUQdOsxeiXE7KMEA6vZ+v9UnEwTEnHKLWHQT+di1YkIqWteC bOAcJRLr221zGVDq+zwe+IoNyE/bjvAETmBD9CwByVt3wKrZwO6mlu9lfCm9RvNzo0rO x8gYpuzfd87k0qgJ8gUZ1pYHVUUnr7tOKcklk+Cvri1pDc7CqCUk9jhncOR95cV9eb2r CnQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=WPEdlkO2wIdtlm6ppzaYJDpNvd1ZISmQqYNLlm/DFjQ=; b=H94uZuGrNdh8TsvUCVhlKrnIHbGx3z4H+z/FBw3iqdxCuiPUjIpZIIpIOwgHDI2kfW AuG7vMCPn3QxeTr3W7AWbIQKmkXz2onx/k5YGjBTDHYcg04KoYgu12uy9tIv+o6YnCfm 1U0KPCNRkqfDDa9pr2hD1bNg6OvQji6SoZxBsioVaLbG9xX7t2ewzVi8BymyRvGwhozC sNWKtCHh9DR+J3A9w/ZP4ASAyVdGoL4crPTSpS3R3va+EhMyQ5YQQ+cbzgJEIpTj3gbL RVKn8RFXI4vnpelsYzozc6nPUjS8s5yeNfWaR0i1UcgZU5otpVuMRyugC0WxE7K5TLqr I5DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=d88GNnY1; 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 w134si6917080wmd.253.2017.12.22.11.49.37; Fri, 22 Dec 2017 11:49:38 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=d88GNnY1; 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 7B7D0680A18; Fri, 22 Dec 2017 21:49:24 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg0-f50.google.com (mail-pg0-f50.google.com [74.125.83.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 55F2A680450 for ; Fri, 22 Dec 2017 16:36:05 +0200 (EET) Received: by mail-pg0-f50.google.com with SMTP id j9so14561849pgc.11 for ; Fri, 22 Dec 2017 06:36:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=r+L37KLkYO/HlR93nHAeRzjm+77uraT+cTPpPaFtfo0=; b=d88GNnY120JWozLi33HlR9MIbUf4h4z91Zut6cTQJ7SfCj7MDRQ8rJ9f4eWsVp8KML V7jqaXMoAb2zioUSbmQOkJqlnWm+iRbGtT5pWcEx3Eqsjsk2e+vAdK+D8cpjkinijHDy c+9SZtSNEcB4KJHdp2XyyjqPKFyA0KsQ5M83tpzrAIc4YFSd6iRkyDnjQV+SgYAeQfoT 90YCBtVg8aV9UNigZ5fyAVf1okFEgHHW8iHTQv31j7D6B1gHWA9tGwaastmqiF4RuRmi vCllHmghLIVcbOk2LTiktjLKFfbYQJcPhpOhu2fM4UkJZfYekJ36QEI80ziW4xN9aR7I IqIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=r+L37KLkYO/HlR93nHAeRzjm+77uraT+cTPpPaFtfo0=; b=WIcI5MucsLTnrqfQATmBPK+rjeiRhtl1Ucfk03V9ddlm7QxNH2X6/7QhIPfST/9NGn 22EMInSBn5YY72m/UmLifRUUfcEM7zaQ3zIPkJXUxAamp75fkZK2f32kei/1M4M/4I1B XtEi9z9/KpuYi0YCfqgUw7rRYe2UdmIqDW1tY16WIiOkXHT1x6CsiHanZlKj8cO+KWRh uZx0DeyKEVaUP8brrPbkaZMZc+wiqSuBmnXxAZFrmbreatEoZgPhpAVoio6/GSTSpbfJ hcdfHSNvrx36M8o+b8Fc1teGTEv2m3qmfB85qOe6AAyCSKE+4GrjaaMLCEamPFhpgg7p xVhw== X-Gm-Message-State: AKGB3mKIs8XIM94cq+N3ApN4ytRLkykEnBdGkaUYICEEdtsPEfv9AfKh DkI28QwUlT8fAZb47E7/g+O5Lnv7 X-Received: by 10.98.156.204 with SMTP id u73mr14497064pfk.8.1513953375331; Fri, 22 Dec 2017 06:36:15 -0800 (PST) Received: from localhost.localdomain (220-253-129-240.dyn.iinet.net.au. [220.253.129.240]) by smtp.gmail.com with ESMTPSA id 73sm47522026pfr.145.2017.12.22.06.36.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Dec 2017 06:36:14 -0800 (PST) From: misty@brew.sh To: ffmpeg-devel@ffmpeg.org Date: Fri, 22 Dec 2017 22:35:08 +0800 Message-Id: <20171222143512.92271-2-misty@brew.sh> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171222143512.92271-1-misty@brew.sh> References: <20171222143512.92271-1-misty@brew.sh> X-Mailman-Approved-At: Fri, 22 Dec 2017 21:49:23 +0200 Subject: [FFmpeg-devel] [PATCH 1/5] oma: move some constants into libavcodec 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: Misty De Meo MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Misty De Meo Most of the constants in libavcodec/oma aren't specific to libavformat; moving them into libavcodec makes them available to libavcodec as well as keeping them compatible with libavformat. ff_oma_codec_tags uses a libavformat-specific type, so it has been left in libavformat. --- Changelog | 1 + libavcodec/oma.c | 40 ++++++++++++++++++++++++++++++++++++++++ libavcodec/oma.h | 37 +++++++++++++++++++++++++++++++++++++ libavcodec/version.h | 2 +- libavformat/oma.c | 18 ------------------ libavformat/oma.h | 13 +------------ libavformat/omadec.c | 1 + libavformat/omaenc.c | 1 + libavformat/version.h | 2 +- 9 files changed, 83 insertions(+), 32 deletions(-) create mode 100644 libavcodec/oma.c create mode 100644 libavcodec/oma.h diff --git a/Changelog b/Changelog index ee48876128..31e720091c 100644 --- a/Changelog +++ b/Changelog @@ -27,6 +27,7 @@ version : - video setrange filter - nsp demuxer - support LibreSSL (via libtls) +- Move some OMA constants from libavformat into libavcodec version 3.4: diff --git a/libavcodec/oma.c b/libavcodec/oma.c new file mode 100644 index 0000000000..dbc763f291 --- /dev/null +++ b/libavcodec/oma.c @@ -0,0 +1,40 @@ +/* + * Sony OpenMG (OMA) common data + * + * 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 + */ + +#include "internal.h" +#include "oma.h" +#include "libavcodec/avcodec.h" +#include "libavutil/channel_layout.h" + +const uint16_t ff_oma_srate_tab[8] = { 320, 441, 480, 882, 960, 0 }; + +/** map ATRAC-X channel id to internal channel layout */ +const uint64_t ff_oma_chid_to_native_layout[7] = { + AV_CH_LAYOUT_MONO, + AV_CH_LAYOUT_STEREO, + AV_CH_LAYOUT_SURROUND, + AV_CH_LAYOUT_4POINT0, + AV_CH_LAYOUT_5POINT1_BACK, + AV_CH_LAYOUT_6POINT1_BACK, + AV_CH_LAYOUT_7POINT1 +}; + +/** map ATRAC-X channel id to total number of channels */ +const int ff_oma_chid_to_num_channels[7] = {1, 2, 3, 4, 6, 7, 8}; diff --git a/libavcodec/oma.h b/libavcodec/oma.h new file mode 100644 index 0000000000..7f6731839d --- /dev/null +++ b/libavcodec/oma.h @@ -0,0 +1,37 @@ +/* + * Sony OpenMG (OMA) common data + * + * 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 AVCODEC_OMA_H +#define AVCODEC_OMA_H + +#include + +#include "internal.h" + +#define EA3_HEADER_SIZE 96 +#define ID3v2_EA3_MAGIC "ea3" +#define OMA_ENC_HEADER_SIZE 16 + +extern const uint16_t ff_oma_srate_tab[8]; + +extern const uint64_t ff_oma_chid_to_native_layout[7]; +extern const int ff_oma_chid_to_num_channels[7]; + +#endif /* AVCODEC_OMA_H */ diff --git a/libavcodec/version.h b/libavcodec/version.h index d55de89797..d48857578d 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -29,7 +29,7 @@ #define LIBAVCODEC_VERSION_MAJOR 58 #define LIBAVCODEC_VERSION_MINOR 8 -#define LIBAVCODEC_VERSION_MICRO 100 +#define LIBAVCODEC_VERSION_MICRO 101 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ diff --git a/libavformat/oma.c b/libavformat/oma.c index f7ae3c9948..86347e6062 100644 --- a/libavformat/oma.c +++ b/libavformat/oma.c @@ -20,10 +20,6 @@ #include "internal.h" #include "oma.h" -#include "libavcodec/avcodec.h" -#include "libavutil/channel_layout.h" - -const uint16_t ff_oma_srate_tab[8] = { 320, 441, 480, 882, 960, 0 }; const AVCodecTag ff_oma_codec_tags[] = { { AV_CODEC_ID_ATRAC3, OMA_CODECID_ATRAC3 }, @@ -34,17 +30,3 @@ const AVCodecTag ff_oma_codec_tags[] = { { AV_CODEC_ID_ATRAC3AL, OMA_CODECID_ATRAC3AL }, { 0 }, }; - -/** map ATRAC-X channel id to internal channel layout */ -const uint64_t ff_oma_chid_to_native_layout[7] = { - AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - AV_CH_LAYOUT_SURROUND, - AV_CH_LAYOUT_4POINT0, - AV_CH_LAYOUT_5POINT1_BACK, - AV_CH_LAYOUT_6POINT1_BACK, - AV_CH_LAYOUT_7POINT1 -}; - -/** map ATRAC-X channel id to total number of channels */ -const int ff_oma_chid_to_num_channels[7] = {1, 2, 3, 4, 6, 7, 8}; diff --git a/libavformat/oma.h b/libavformat/oma.h index 36fd0125e4..4417deeb4d 100644 --- a/libavformat/oma.h +++ b/libavformat/oma.h @@ -21,14 +21,8 @@ #ifndef AVFORMAT_OMA_H #define AVFORMAT_OMA_H -#include - #include "internal.h" -#define EA3_HEADER_SIZE 96 -#define ID3v2_EA3_MAGIC "ea3" -#define OMA_ENC_HEADER_SIZE 16 - enum { OMA_CODECID_ATRAC3 = 0, OMA_CODECID_ATRAC3P = 1, @@ -39,11 +33,6 @@ enum { OMA_CODECID_ATRAC3AL = 34, }; -extern const uint16_t ff_oma_srate_tab[8]; - extern const AVCodecTag ff_oma_codec_tags[]; -extern const uint64_t ff_oma_chid_to_native_layout[7]; -extern const int ff_oma_chid_to_num_channels[7]; - -#endif /* AVFORMAT_OMA_H */ +#endif /* AVFORMAT_OMA_H */ \ No newline at end of file diff --git a/libavformat/omadec.c b/libavformat/omadec.c index 423d52b3aa..ccefd6c1bc 100644 --- a/libavformat/omadec.c +++ b/libavformat/omadec.c @@ -48,6 +48,7 @@ #include "libavutil/intreadwrite.h" #include "libavutil/des.h" #include "libavutil/mathematics.h" +#include "libavcodec/oma.h" #include "oma.h" #include "pcm.h" #include "id3v2.h" diff --git a/libavformat/omaenc.c b/libavformat/omaenc.c index 7952808bf8..6e72c3ee85 100644 --- a/libavformat/omaenc.c +++ b/libavformat/omaenc.c @@ -24,6 +24,7 @@ #include "avio_internal.h" #include "id3v2.h" #include "internal.h" +#include "libavcodec/oma.h" #include "oma.h" #include "rawenc.h" diff --git a/libavformat/version.h b/libavformat/version.h index 5ced041f0a..6453d4559f 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -33,7 +33,7 @@ // Also please add any ticket numbers that you believe might be affected here #define LIBAVFORMAT_VERSION_MAJOR 58 #define LIBAVFORMAT_VERSION_MINOR 3 -#define LIBAVFORMAT_VERSION_MICRO 100 +#define LIBAVFORMAT_VERSION_MICRO 101 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \