From patchwork Wed May 27 10:50:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: leozhang X-Patchwork-Id: 19897 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 A63C944A537 for ; Wed, 27 May 2020 13:50:55 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7ABF168AD3D; Wed, 27 May 2020 13:50:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smg-bj-02.qiyi.com (unknown [202.108.14.100]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 816CA68AAA0 for ; Wed, 27 May 2020 13:50:47 +0300 (EEST) X-AuditID: ca6c0e64-fcdcd9e000000771-b8-5ece46056271 Received: from mail.iqiyi.com (Unknown_Domain [10.16.130.3]) by smg-bj-02.qiyi.com (Qiyi mail Gateway) with SMTP id 55.F9.01905.5064ECE5; Wed, 27 May 2020 18:50:45 +0800 (HKT) From: leozhang To: Date: Wed, 27 May 2020 18:50:34 +0800 Message-ID: <1590576634-98504-1-git-send-email-leozhang@qiyi.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.41.132.132] X-ClientProxiedBy: BJ-CAS32.iqiyi.pps (10.11.50.121) To EXCH28B.iqiyi.pps (10.16.148.55) Subject: [FFmpeg-devel] [RFC] avcodec/bsf: support operations on side data in AVBSFContext 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" Signed-off-by: leozhang --- Please note that this is not a formal patch firstly. I send this to sincerely request your suggestions/objections. And why need operating side data in AVBSFContext? Because I'm planning to create a bitstream filter which inject AV_PKT_DATA_SPHERICAL info, and transfer to AVCodecContext/AVStream. libavcodec/bsf.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/libavcodec/bsf.h b/libavcodec/bsf.h index 7ed5167..740fa78 100644 --- a/libavcodec/bsf.h +++ b/libavcodec/bsf.h @@ -93,6 +93,12 @@ typedef struct AVBSFContext { * filter in av_bsf_init(). */ AVRational time_base_out; + + /** + * Additional data associated with the entire bitstream. + */ + AVPacketSideData *side_data; + size_t nb_side_data; } AVBSFContext; typedef struct AVBitStreamFilter { @@ -318,6 +324,18 @@ int av_bsf_list_parse_str(const char *str, AVBSFContext **bsf); */ int av_bsf_get_null_filter(AVBSFContext **bsf); +/* + * functions To Be Implement +int av_bsf_add_side_data(AVBSFContext *bsf, enum AVPacketSideDataType type, + uint8_t *data, size_t size); + +uint8_t *av_bsf_new_side_data(AVBSFContext *bsf, + enum AVPacketSideDataType type, size_t size); + +uint8_t *av_bsf_get_side_data(const AVBSFContext *bsf, + enum AVPacketSideDataType type, size_t *size); + */ + /** * @} */