40 #define CODEC_MIME "video/avc"
77 int nal_length_size = 0;
82 memset(&ps, 0,
sizeof(ps));
96 &ps, &is_avc, &nal_length_size, 0, avctx);
200 while (!*got_frame) {
261 .
name =
"h264_mediacodec",
void av_bsf_free(AVBSFContext **ctx)
Free a bitstream filter context and everything associated with it; write NULL into the supplied point...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
static void flush(AVCodecContext *avctx)
AVBufferRef * sps_list[MAX_SPS_COUNT]
static av_cold int init(AVCodecContext *avctx)
The bitstream filter state.
const AVBitStreamFilter * av_bsf_get_by_name(const char *name)
int av_bsf_init(AVBSFContext *ctx)
Prepare the filter for use, after all the parameters and options have been set.
int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int(*func)(void *, void *, int))
Feed data from a user-supplied callback to an AVFifoBuffer.
int av_bsf_alloc(const AVBitStreamFilter *filter, AVBSFContext **ctx)
Allocate a context for a given bitstream filter.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int av_bsf_receive_packet(AVBSFContext *ctx, AVPacket *pkt)
Retrieve a filtered packet.
int av_fifo_space(const AVFifoBuffer *f)
Return the amount of space in bytes in the AVFifoBuffer, that is the amount of data you can write int...
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
int ff_h264_decode_extradata(const uint8_t *data, int size, H264ParamSets *ps, int *is_avc, int *nal_length_size, int err_recognition, void *logctx)
#define AVERROR_EOF
End of file.
void av_fifo_free(AVFifoBuffer *f)
Free an AVFifoBuffer.
int av_packet_ref(AVPacket *dst, const AVPacket *src)
Setup a new reference to the data described by a given packet.
H.264 / AVC / MPEG-4 part10 codec.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void(*func)(void *, void *, int))
Feed data from an AVFifoBuffer to a user-supplied callback.
simple assert() macros that are a bit more flexible than ISO C assert().
const char * name
Name of the codec implementation.
int width
picture width / height.
int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt)
Submit a packet for filtering.
#define AVERROR_BSF_NOT_FOUND
Bitstream filter not found.
#define AV_LOG_INFO
Standard information.
Libavcodec external API header.
AVBufferRef * pps_list[MAX_PPS_COUNT]
int av_fifo_size(const AVFifoBuffer *f)
Return the amount of data in bytes in the AVFifoBuffer, that is the amount of data you can read from ...
int av_fifo_realloc2(AVFifoBuffer *f, unsigned int new_size)
Resize an AVFifoBuffer.
main external API structure.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
uint8_t * data
The data buffer.
a very simple circular buffer FIFO implementation
static const char * format
int avcodec_parameters_from_context(AVCodecParameters *par, const AVCodecContext *codec)
Fill the parameters struct based on the values from the supplied codec context.
#define FF_CODEC_CAP_SETS_PKT_DTS
Decoders marked with FF_CODEC_CAP_SETS_PKT_DTS want to set AVFrame.pkt_dts manually.
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
common internal api header.
common internal and external API header
void av_init_packet(AVPacket *pkt)
Initialize optional fields of a packet with default values.
AVFifoBuffer * av_fifo_alloc(unsigned int size)
Initialize an AVFifoBuffer.
void ff_h264_ps_uninit(H264ParamSets *ps)
Uninit H264 param sets structure.
void av_fifo_reset(AVFifoBuffer *f)
Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied...
#define AVERROR_EXTERNAL
Generic error in an external library.
This structure stores compressed data.
AVCodecParameters * par_in
Parameters of the input stream.