#include <stdatomic.h>
#include "avcodec.h"
#include "avcodec_internal.h"
#include "codec_desc.h"
#include "codec_internal.h"
#include "decode.h"
#include "hwaccel_internal.h"
#include "hwconfig.h"
#include "internal.h"
#include "pthread_internal.h"
#include "refstruct.h"
#include "thread.h"
#include "threadframe.h"
#include "version_major.h"
#include "libavutil/avassert.h"
#include "libavutil/buffer.h"
#include "libavutil/common.h"
#include "libavutil/cpu.h"
#include "libavutil/frame.h"
#include "libavutil/internal.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/thread.h"
enum { … };
enum { … };
ThreadFrameProgress;
PerThreadContext;
FrameThreadContext;
static int hwaccel_serial(const AVCodecContext *avctx)
{ … }
static void async_lock(FrameThreadContext *fctx)
{ … }
static void async_unlock(FrameThreadContext *fctx)
{ … }
static void thread_set_name(PerThreadContext *p)
{ … }
static attribute_align_arg void *frame_worker_thread(void *arg)
{ … }
static int update_context_from_thread(AVCodecContext *dst, const AVCodecContext *src, int for_user)
{ … }
static int update_context_from_user(AVCodecContext *dst, const AVCodecContext *src)
{ … }
static int submit_packet(PerThreadContext *p, AVCodecContext *user_avctx,
AVPacket *avpkt)
{ … }
int ff_thread_decode_frame(AVCodecContext *avctx,
AVFrame *picture, int *got_picture_ptr,
AVPacket *avpkt)
{ … }
void ff_thread_report_progress(ThreadFrame *f, int n, int field)
{ … }
void ff_thread_await_progress(const ThreadFrame *f, int n, int field)
{ … }
void ff_thread_finish_setup(AVCodecContext *avctx) { … }
static void park_frame_worker_threads(FrameThreadContext *fctx, int thread_count)
{ … }
#define OFF …
DEFINE_OFFSET_ARRAY(…);
#undef OFF
#define OFF …
DEFINE_OFFSET_ARRAY(…);
#undef OFF
void ff_frame_thread_free(AVCodecContext *avctx, int thread_count)
{ … }
static av_cold int init_thread(PerThreadContext *p, int *threads_to_free,
FrameThreadContext *fctx, AVCodecContext *avctx,
const FFCodec *codec, int first)
{ … }
int ff_frame_thread_init(AVCodecContext *avctx)
{ … }
void ff_thread_flush(AVCodecContext *avctx)
{ … }
int ff_thread_can_start_frame(AVCodecContext *avctx)
{ … }
static int thread_get_buffer_internal(AVCodecContext *avctx, AVFrame *f, int flags)
{ … }
int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f, int flags)
{ … }
int ff_thread_get_ext_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
{ … }
void ff_thread_release_ext_buffer(ThreadFrame *f)
{ … }
enum ThreadingStatus ff_thread_sync_ref(AVCodecContext *avctx, size_t offset)
{ … }