FFmpeg
|
#include <stdatomic.h>
#include "frame_thread_encoder.h"
#include "libavutil/avassert.h"
#include "libavutil/cpu.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/thread.h"
#include "avcodec.h"
#include "avcodec_internal.h"
#include "codec_par.h"
#include "encode.h"
#include "internal.h"
#include "pthread_internal.h"
Go to the source code of this file.
Data Structures | |
struct | Task |
struct | ThreadContext |
Macros | |
#define | MAX_THREADS 64 |
#define | BUFFER_SIZE (MAX_THREADS + 2) |
#define | OFF(member) offsetof(ThreadContext, member) |
#define | DUP_MATRIX(m) |
Functions | |
DEFINE_OFFSET_ARRAY (ThreadContext, thread_ctx, pthread_init_cnt,(OFF(task_fifo_mutex), OFF(finished_task_mutex)),(OFF(task_fifo_cond), OFF(finished_task_cond))) | |
static void *attribute_align_arg | worker (void *v) |
av_cold int | ff_frame_thread_encoder_init (AVCodecContext *avctx) |
Initialize frame thread encoder. More... | |
av_cold void | ff_frame_thread_encoder_free (AVCodecContext *avctx) |
int | ff_thread_video_encode_frame (AVCodecContext *avctx, AVPacket *pkt, AVFrame *frame, int *got_packet_ptr) |
#define MAX_THREADS 64 |
Definition at line 37 of file frame_thread_encoder.c.
#define BUFFER_SIZE (MAX_THREADS + 2) |
Definition at line 42 of file frame_thread_encoder.c.
#define OFF | ( | member | ) | offsetof(ThreadContext, member) |
Definition at line 72 of file frame_thread_encoder.c.
#define DUP_MATRIX | ( | m | ) |
DEFINE_OFFSET_ARRAY | ( | ThreadContext | , |
thread_ctx | , | ||
pthread_init_cnt | , | ||
(OFF(task_fifo_mutex), OFF(finished_task_mutex)) | , | ||
(OFF(task_fifo_cond), OFF(finished_task_cond)) | |||
) |
|
static |
Definition at line 78 of file frame_thread_encoder.c.
Referenced by ff_frame_thread_encoder_init().
av_cold int ff_frame_thread_encoder_init | ( | AVCodecContext * | avctx | ) |
Initialize frame thread encoder.
Definition at line 120 of file frame_thread_encoder.c.
Referenced by ff_encode_preinit().
av_cold void ff_frame_thread_encoder_free | ( | AVCodecContext * | avctx | ) |
Definition at line 275 of file frame_thread_encoder.c.
Referenced by ff_codec_close(), and ff_frame_thread_encoder_init().
int ff_thread_video_encode_frame | ( | AVCodecContext * | avctx, |
AVPacket * | pkt, | ||
AVFrame * | frame, | ||
int * | got_packet_ptr | ||
) |
Definition at line 301 of file frame_thread_encoder.c.
Referenced by encode_simple_internal().