* Codec initializes slice-based threading with a main function
*/
#define FF_CODEC_CAP_SLICE_THREAD_HAS_MF (1 << 5)
+/*
+ * The codec supports frame threading and has inter-frame dependencies, so it
+ * uses ff_thread_report/await_progress().
+ */
+#define FF_CODEC_CAP_ALLOCATE_PROGRESS (1 << 6)
+
+/**
+ * AVCodec.codec_tags termination value
+ */
+#define FF_CODEC_TAGS_END -1
+
#ifdef TRACE
# define ff_tlog(ctx, ...) av_log(ctx, AV_LOG_TRACE, __VA_ARGS__)
#define FF_QSCALE_TYPE_H264 2
#define FF_QSCALE_TYPE_VP56 3
-#define FF_SANE_NB_CHANNELS 256U
+#define FF_SANE_NB_CHANNELS 512U
#define FF_SIGNBIT(x) ((x) >> CHAR_BIT * sizeof(x) - 1)
# define STRIDE_ALIGN 8
#endif
-typedef struct FramePool {
- /**
- * Pools for each data plane. For audio all the planes have the same size,
- * so only pools[0] is used.
- */
- AVBufferPool *pools[4];
-
- /*
- * Pool parameters
- */
- int format;
- int width, height;
- int stride_align[AV_NUM_DATA_POINTERS];
- int linesize[4];
- int planes;
- int channels;
- int samples;
-} FramePool;
-
typedef struct DecodeSimpleContext {
AVPacket *in_pkt;
AVFrame *out_frame;
*/
int is_copy;
- /**
- * Whether to allocate progress for frame threading.
- *
- * The codec must set it to 1 if it uses ff_thread_await/report_progress(),
- * then progress will be allocated in ff_thread_get_buffer(). The frames
- * then MUST be freed with ff_thread_release_buffer().
- *
- * If the codec does not need to call the progress functions (there are no
- * dependencies between the frames), it should leave this at 0. Then it can
- * decode straight to the user-provided frames (which the user will then
- * free with av_frame_unref()), there is no need to call
- * ff_thread_release_buffer().
- */
- int allocate_progress;
-
/**
* An audio frame with less than required samples has been submitted and
* padded with silence. Reject all subsequent frames.
AVFrame *to_free;
- FramePool *pool;
+ AVBufferRef *pool;
void *thread_ctx;
/* to prevent infinite loop on errors when draining */
int nb_draining_errors;
+
+ /* used when avctx flag AV_CODEC_FLAG_DROPCHANGED is set */
+ int changed_frames_dropped;
+ int initial_format;
+ int initial_width, initial_height;
+ int initial_sample_rate;
+ int initial_channels;
+ uint64_t initial_channel_layout;
} AVCodecInternal;
struct AVCodecDefault {
*/
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags);
+#define FF_REGET_BUFFER_FLAG_READONLY 1 ///< the returned buffer does not need to be writable
/**
- * Identical in function to av_frame_make_writable(), except it uses
- * ff_get_buffer() to allocate the buffer when needed.
+ * Identical in function to ff_get_buffer(), except it reuses the existing buffer
+ * if available.
*/
-int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame);
+int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame, int flags);
int ff_thread_can_start_frame(AVCodecContext *avctx);
int ff_side_data_set_encoder_stats(AVPacket *pkt, int quality, int64_t *error, int error_count, int pict_type);
+int ff_side_data_set_prft(AVPacket *pkt, int64_t timestamp);
+
/**
* Check AVFrame for A53 side data and allocate and fill SEI message with A53 info
*
int ff_int_from_list_or_default(void *ctx, const char * val_name, int val,
const int * array_valid_values, int default_value);
+void ff_dvdsub_parse_palette(uint32_t *palette, const char *p);
+
#if defined(_WIN32) && CONFIG_SHARED && !defined(BUILDING_avcodec)
# define av_export_avcodec __declspec(dllimport)
#else