56 "-hwaccel cuvid should only be used for one-to-one CUVID transcoding "
57 "with no (software) filters.\n");
92 if (!ost->
enc->pix_fmts)
136 err = cuDeviceGet(&device, 0);
143 err = cuCtxCreate(&cuda_ctx, CU_CTX_SCHED_BLOCKING_SYNC, device);
153 device_hwctx = device_ctx->
hwctx;
156 err = cuCtxPopCurrent(&dummy);
170 device_hwctx = device_ctx->
hwctx;
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
AVBufferRef * hw_frames_ctx
static enum AVPixelFormat pix_fmt
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
enum AVPixelFormat format
The pixel format identifying the underlying HW surface type.
int cuvid_transcode_init(OutputStream *ost)
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
void * hwctx
The format-specific data, allocated and freed by libavutil along with this context.
static void cuvid_ctx_free(AVHWDeviceContext *ctx)
#define AV_LOG_VERBOSE
Detailed information.
An API-specific header for AV_HWDEVICE_TYPE_CUDA.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void(* free)(struct AVHWDeviceContext *ctx)
This field may be set by the caller before calling av_hwdevice_ctx_init().
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
enum AVHWDeviceType type
This field identifies the underlying API used for hardware access.
enum AVPixelFormat * pix_fmts
array of supported pixel formats, or NULL if unknown, array is terminated by -1
AVBufferRef * hw_frames_ctx
Encoding only.
HW acceleration through CUDA.
AVBufferRef * av_hwdevice_ctx_alloc(enum AVHWDeviceType type)
Allocate an AVHWDeviceContext for a given pixel format.
main external API structure.
uint8_t * data
The data buffer.
int av_hwdevice_ctx_init(AVBufferRef *ref)
Finalize the device context before use.
This struct is allocated as AVHWDeviceContext.hwctx.
This struct describes a set or pool of "hardware" frames (i.e.
int cuvid_init(AVCodecContext *avctx)
A reference to a data buffer.
AVBufferRef * av_hwframe_ctx_alloc(AVBufferRef *device_ref_in)
Allocate an AVHWFramesContext tied to a given device context.
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
AVBufferRef * hw_device_ctx
static void cuvid_uninit(AVCodecContext *avctx)
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
AVPixelFormat
Pixel format.
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
void * opaque
Private data of the user, can be used to carry app specific stuff.
InputStream ** input_streams