FFmpeg
decode_bsf.h
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #ifndef AVCODEC_DECODE_BSF_H
20 #define AVCODEC_DECODE_BSF_H
21 
22 #include <stdint.h>
23 
24 #include "avcodec.h"
25 #include "bsf.h"
26 #include "internal.h"
27 
28 /**
29  * Helper function for decoders that may use a BSF that changes extradata.
30  * This function will get the extradata from the BSF.
31  */
32 static inline void ff_decode_get_extradata(const AVCodecContext *avctx,
33  const uint8_t **extradata,
34  int *extradata_size)
35 {
36  // Given that we unconditionally insert a null BSF when no BSF is
37  // explicitly requested, we can just use the BSF's par_out here.
38  *extradata = avctx->internal->bsf->par_out->extradata;
39  *extradata_size = avctx->internal->bsf->par_out->extradata_size;
40 }
41 
42 #endif /* AVCODEC_DECODE_BSF_H */
AVCodecParameters::extradata
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
Definition: codec_par.h:69
internal.h
bsf.h
AVBSFContext::par_out
AVCodecParameters * par_out
Parameters of the output stream.
Definition: bsf.h:96
AVCodecContext::internal
struct AVCodecInternal * internal
Private context used for internal data.
Definition: avcodec.h:466
ff_decode_get_extradata
static void ff_decode_get_extradata(const AVCodecContext *avctx, const uint8_t **extradata, int *extradata_size)
Helper function for decoders that may use a BSF that changes extradata.
Definition: decode_bsf.h:32
AVCodecParameters::extradata_size
int extradata_size
Size of the extradata content in bytes.
Definition: codec_par.h:73
AVCodecInternal::bsf
struct AVBSFContext * bsf
Definition: internal.h:84
avcodec.h
AVCodecContext
main external API structure.
Definition: avcodec.h:431