68#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(55, 75, 100)
71#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(56, 39, 100)
77 if (strcmp(str,
"help") == 0) {
78 char msg[
STR_LEN] =
"Available decode accelerations:";
134 hwaccel->
copy =
false;
153#ifdef HWACC_COMMON_IMPL
155int create_hw_device_ctx(
enum AVHWDeviceType
type, AVBufferRef **device_ref){
156 const char *device_paths[] = { NULL,
"/dev/dri/renderD128" };
159 for(
size_t i = 0; i <
sizeof(device_paths) /
sizeof(*device_paths); i++){
160 ret = av_hwdevice_ctx_create(device_ref,
type, device_paths[i], NULL, 0);
169int create_hw_frame_ctx(AVBufferRef *device_ref,
172 enum AVPixelFormat format,
173 enum AVPixelFormat sw_format,
177 *ctx = av_hwframe_ctx_alloc(device_ref);
183 AVHWFramesContext *frames_ctx = (AVHWFramesContext *)(
void *) (*ctx)->data;
184 frames_ctx->format = format;
185 frames_ctx->width = width;
186 frames_ctx->height = height;
187 frames_ctx->sw_format = sw_format;
188 frames_ctx->initial_pool_size = decode_surfaces;
190 int ret = av_hwframe_ctx_init(*ctx);
192 av_buffer_unref(ctx);
208 av_frame_unref(
frame);
struct video_frame * frame
int color_printf(const char *format,...)
void log_msg(int level, const char *format,...)
#define LOG_LEVEL_ERROR
general errors
enum AVPixelFormat av_pixfmt
const char * hw_accel_to_str(enum hw_accel_type type)
enum hw_accel_type hw_accel_from_pixfmt(enum AVPixelFormat pixfmt)
void hwaccel_state_init(struct hw_accel_state *hwaccel)
Initializes hw_accel_state structure.
enum hw_accel_type hw_accel_from_str(const char *str)
static const struct @20 accel_str_map[]
void hwaccel_state_reset(struct hw_accel_state *hwaccel)
Uninitializes existing acceleration and resets hw_accel_state to initial state.
codec_t hw_accel_to_ug_pixfmt(enum hw_accel_type type)
This file contains functions related to hw acceleration.
#define AV_PIX_FMT_VULKAN
@ STR_LEN
"standard" string length placeholder
void(* uninit)(struct hw_accel_state *)
Optional uninit function ptr.
AVFrame * tmp_frame
Temporary frame used when copying.
void * ctx
Type depends on hwaccel type.
bool copy
Specifies whether to use the copy mode.
This file contains some common data types.
@ VIDEO_CODEC_NONE
dummy color spec
@ HW_VDPAU
VDPAU hardware surface.
@ DRM_PRIME
DRM Prime buffer, data contains struct drm_prime_frame.