#include "libavutil/buffer.h"
#include "libavutil/channel_layout.h"
+#include "libavutil/fifo.h"
#include "libavutil/mathematics.h"
#include "libavutil/pixfmt.h"
#include "avcodec.h"
* uses ff_thread_report/await_progress().
*/
#define FF_CODEC_CAP_ALLOCATE_PROGRESS (1 << 6)
+/**
+ * Codec handles avctx->thread_count == 0 (auto) internally.
+ */
+#define FF_CODEC_CAP_AUTO_THREADS (1 << 7)
/**
* AVCodec.codec_tags termination value
typedef struct DecodeSimpleContext {
AVPacket *in_pkt;
- AVFrame *out_frame;
} DecodeSimpleContext;
typedef struct EncodeSimpleContext {
*/
int last_audio_frame;
- AVFrame *to_free;
-
AVBufferRef *pool;
void *thread_ctx;
* for decoding.
*/
AVPacket *last_pkt_props;
+ AVFifoBuffer *pkt_props;
/**
* temporary buffer used for encoders to store their bitstream
EncodeSimpleContext es;
+ /**
+ * If this is set, then AVCodec->close (if existing) needs to be called
+ * for the parent AVCodecContext.
+ */
+ int needs_close;
+
/**
* Number of audio samples to skip at the start of the next decoded frame
*/
AVPacket *buffer_pkt;
AVFrame *buffer_frame;
int draining_done;
- int compat_decode_warned;
- /* this variable is set by the decoder internals to signal to the old
- * API compat wrappers the amount of data consumed from the last packet */
- size_t compat_decode_consumed;
- /* when a partial packet has been consumed, this stores the remaining size
- * of the packet (that should be submitted in the next decode call */
- size_t compat_decode_partial_size;
- AVFrame *compat_decode_frame;
- AVPacket *compat_encode_packet;
int showed_multi_packet_warning;
int avpriv_h264_has_num_reorder_frames(AVCodecContext *avctx);
-/**
- * Call avcodec_open2 recursively by decrementing counter, unlocking mutex,
- * calling the function and then restoring again. Assumes the mutex is
- * already locked
- */
-int ff_codec_open2_recursive(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options);
-
-/**
- * Finalize buf into extradata and set its size appropriately.
- */
-int avpriv_bprint_to_extradata(AVCodecContext *avctx, struct AVBPrint *buf);
-
const uint8_t *avpriv_find_start_code(const uint8_t *p,
const uint8_t *end,
uint32_t *state);
*/
int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt);
-/**
- * Set various frame properties from the codec context / packet data.
- */
-int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame);
-
/**
* Add a CPB properties side data to an encoding context.
*/
AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx);
-/**
- * Check AVFrame for A53 side data and allocate and fill SEI message with A53 info
- *
- * @param frame Raw frame to get A53 side data from
- * @param prefix_len Number of bytes to allocate before SEI message
- * @param data Pointer to a variable to store allocated memory
- * Upon return the variable will hold NULL on error or if frame has no A53 info.
- * Otherwise it will point to prefix_len uninitialized bytes followed by
- * *sei_size SEI message
- * @param sei_size Pointer to a variable to store generated SEI message length
- * @return Zero on success, negative error code on failure
- */
-int ff_alloc_a53_sei(const AVFrame *frame, size_t prefix_len,
- void **data, size_t *sei_size);
-
/**
* Check AVFrame for S12M timecode side data and allocate and fill TC SEI message with timecode info
*
* @param frame Raw frame to get S12M timecode side data from
+ * @param rate The frame rate
* @param prefix_len Number of bytes to allocate before SEI message
* @param data Pointer to a variable to store allocated memory
* Upon return the variable will hold NULL on error or if frame has no S12M timecode info.
* @param sei_size Pointer to a variable to store generated SEI message length
* @return Zero on success, negative error code on failure
*/
-int ff_alloc_timecode_sei(const AVFrame *frame, size_t prefix_len,
+int ff_alloc_timecode_sei(const AVFrame *frame, AVRational rate, size_t prefix_len,
void **data, size_t *sei_size);
/**