43#define AMF_VIDEO_DECODER_OUTPUT_FORMAT L"OutputDecodeFormat"
60 AMFSurface *surface = (AMFSurface*)(
data);
61 surface->pVtbl->Release(surface);
66 if( AMF_GET_MAJOR_VERSION(amf_device_ctx->
version) <= 1 &&
67 AMF_GET_MINOR_VERSION(amf_device_ctx->
version) <= 4 &&
68 AMF_GET_SUBMINOR_VERSION(amf_device_ctx->
version) < 36)
81 amf_int64 color_profile;
88 ctx->resolution_changed = 0;
92 codec_id = AMFVideoDecoderUVD_H264_AVC;
95 codec_id = AMFVideoDecoderHW_H265_HEVC;
96 if(no_bitness_detect){
98 codec_id = AMFVideoDecoderHW_H265_MAIN10;
103 if(no_bitness_detect){
105 codec_id = AMFVideoDecoderHW_VP9_10BIT;
122 AMF_ASSIGN_PROPERTY_BOOL(res,
ctx->decoder, AMF_VIDEO_DECODER_FULL_RANGE_COLOR, 1);
124 AMF_ASSIGN_PROPERTY_BOOL(res,
ctx->decoder, AMF_VIDEO_DECODER_FULL_RANGE_COLOR, 0);
127 if (color_profile != AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN)
128 AMF_ASSIGN_PROPERTY_INT64(res,
ctx->decoder, AMF_VIDEO_DECODER_COLOR_PROFILE, color_profile);
130 AMF_ASSIGN_PROPERTY_INT64(res,
ctx->decoder, AMF_VIDEO_DECODER_COLOR_TRANSFER_CHARACTERISTIC, (amf_int64)avctx->
color_trc);
133 AMF_ASSIGN_PROPERTY_INT64(res,
ctx->decoder, AMF_VIDEO_DECODER_COLOR_PRIMARIES, (amf_int64)avctx->
color_primaries);
135 if (
ctx->timestamp_mode != -1)
136 AMF_ASSIGN_PROPERTY_INT64(res,
ctx->decoder, AMF_TIMESTAMP_MODE,
ctx->timestamp_mode);
137 if (
ctx->decoder_mode != -1)
138 AMF_ASSIGN_PROPERTY_INT64(res,
ctx->decoder, AMF_VIDEO_DECODER_REORDER_MODE,
ctx->decoder_mode);
139 if (
ctx->dpb_size != -1)
140 AMF_ASSIGN_PROPERTY_INT64(res,
ctx->decoder, AMF_VIDEO_DECODER_DPB_SIZE,
ctx->dpb_size);
141 if (
ctx->lowlatency != -1)
142 AMF_ASSIGN_PROPERTY_INT64(res,
ctx->decoder, AMF_VIDEO_DECODER_LOW_LATENCY,
ctx->lowlatency);
143 if (
ctx->smart_access_video != -1) {
144 AMF_ASSIGN_PROPERTY_INT64(res,
ctx->decoder, AMF_VIDEO_DECODER_ENABLE_SMART_ACCESS_VIDEO,
ctx->smart_access_video != 0);
146 av_log(avctx,
AV_LOG_ERROR,
"The Smart Access Video is not supported by AMF decoder.\n");
151 if (
ctx->smart_access_video != 0) {
152 AMF_ASSIGN_PROPERTY_INT64(res,
ctx->decoder, AMF_VIDEO_DECODER_LOW_LATENCY,
true);
153 av_log(avctx,
AV_LOG_INFO,
"The Smart Access Video set low latency mode for decoder.\n");
157 if (
ctx->skip_transfer_sav != -1)
158 AMF_ASSIGN_PROPERTY_INT64(res,
ctx->decoder, AMF_VIDEO_DECODER_SKIP_TRANSFER_SMART_ACCESS_VIDEO,
ctx->skip_transfer_sav);
160 if (
ctx->copy_output != -1)
161 AMF_ASSIGN_PROPERTY_INT64(res,
ctx->decoder, AMF_VIDEO_DECODER_SURFACE_COPY,
ctx->copy_output);
164 const uint8_t *extradata;
167 res = amf_device_ctx->
context->pVtbl->AllocBuffer(amf_device_ctx->
context, AMF_MEMORY_HOST, extradata_size, &
buffer);
169 memcpy(
buffer->pVtbl->GetNative(
buffer), extradata, extradata_size);
170 AMF_ASSIGN_PROPERTY_INTERFACE(res,
ctx->decoder, AMF_VIDEO_DECODER_EXTRADATA,
buffer);
175 if (
ctx->surface_pool_size == -1) {
176 ctx->surface_pool_size = pool_size;
185 if (
ctx->surface_pool_size > 100)
186 ctx->surface_pool_size = 100;
188 AMF_ASSIGN_PROPERTY_INT64(res,
ctx->decoder, AMF_VIDEO_DECODER_SURFACE_POOL_SIZE,
ctx->surface_pool_size);
189 res =
ctx->decoder->pVtbl->Init(
ctx->decoder, AMF_SURFACE_UNKNOWN, avctx->
width, avctx->
height);
202 ctx->decoder->pVtbl->Terminate(
ctx->decoder);
203 ctx->decoder->pVtbl->Release(
ctx->decoder);
228 hwframes_ctx->
width = new_width;
229 hwframes_ctx->
height = new_height;
244 int new_width,
int new_height)
260 ctx->dimensions_initialized = 0;
299 AMFVariantStruct format_var = {0};
318 }
else if (avctx->
width > 0 && avctx->
height > 0) {
319 frames_w = avctx->
width;
355 case AMF_COLOR_PRIMARIES_UNDEFINED:
356 case AMF_COLOR_PRIMARIES_UNSPECIFIED:
357 case AMF_COLOR_PRIMARIES_RESERVED:
371 case AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED:
372 case AMF_COLOR_TRANSFER_CHARACTERISTIC_UNSPECIFIED:
373 case AMF_COLOR_TRANSFER_CHARACTERISTIC_RESERVED:
385 case AMF_COLOR_RANGE_FULL:
387 case AMF_COLOR_RANGE_STUDIO:
397 case AMF_VIDEO_CONVERTER_COLOR_PROFILE_601:
398 case AMF_VIDEO_CONVERTER_COLOR_PROFILE_FULL_601:
400 case AMF_VIDEO_CONVERTER_COLOR_PROFILE_709:
401 case AMF_VIDEO_CONVERTER_COLOR_PROFILE_FULL_709:
403 case AMF_VIDEO_CONVERTER_COLOR_PROFILE_2020:
404 case AMF_VIDEO_CONVERTER_COLOR_PROFILE_FULL_2020:
414 AMFVariantStruct var = {0};
421 res = surface->pVtbl->GetProperty(surface, AMF_VIDEO_DECODER_COLOR_PRIMARIES, &var);
424 AMFVariantClear(&var);
426 res = surface->pVtbl->GetProperty(surface, AMF_VIDEO_DECODER_COLOR_TRANSFER_CHARACTERISTIC, &var);
428 trc =
amf_to_av_trc((
enum AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM)var.int64Value);
429 AMFVariantClear(&var);
431 res = surface->pVtbl->GetProperty(surface, AMF_VIDEO_DECODER_COLOR_PROFILE, &var);
434 AMFVariantClear(&var);
438 res = surface->pVtbl->GetProperty(surface, AMF_VIDEO_DECODER_COLOR_RANGE, &var);
441 AMFVariantClear(&var);
449 frame->color_trc = trc;
450 frame->colorspace = colorspace;
457 AMFVariantStruct var;
458 res = AMFVariantInit(&var);
460 res =
object->pVtbl->GetProperty(
object,
name, &var);
462 if (var.type == AMF_VARIANT_INTERFACE) {
463 AMFGuid guid_AMFBuffer = IID_AMFBuffer();
464 AMFInterface *amf_interface = AMFVariantInterface(&var);
465 res = amf_interface->pVtbl->QueryInterface(amf_interface, &guid_AMFBuffer, (
void**)
val);
467 res = AMF_INVALID_DATA_TYPE;
470 AMFVariantClear(&var);
477 AMFBuffer *hdrmeta_buffer =
NULL;
478 AMFHDRMetadata *hdrmeta;
491 hdrmeta_buffer->pVtbl->Release(hdrmeta_buffer);
495 hdrmeta = (AMFHDRMetadata *)hdrmeta_buffer->pVtbl->GetNative(hdrmeta_buffer);
497 hdrmeta_buffer->pVtbl->Release(hdrmeta_buffer);
502 hdrmeta_buffer->pVtbl->Release(hdrmeta_buffer);
508 AMFVariantStruct var = {0};
535 frame->data[0] = (uint8_t *)surface;
537 format_amf = surface->pVtbl->GetFormat(surface);
541 ret = surface->pVtbl->Convert(surface, AMF_MEMORY_HOST);
544 for (
i = 0;
i < surface->pVtbl->GetPlanesCount(surface);
i++) {
545 plane = surface->pVtbl->GetPlaneAt(surface,
i);
546 frame->data[
i] = plane->pVtbl->GetNative(plane);
547 frame->linesize[
i] = plane->pVtbl->GetHPitch(plane);
555 format_amf = surface->pVtbl->GetFormat(surface);
562 frame->pts = surface->pVtbl->GetPts(surface);
564 surface->pVtbl->GetProperty(surface,
L"FFMPEG:dts", &var);
565 frame->pkt_dts = var.int64Value;
567 frame->duration = surface->pVtbl->GetDuration(surface);
568 if (
frame->duration < 0)
583 AMF_RESULT ret = AMF_OK;
584 AMFSurface *surface =
NULL;
585 AMFData *data_out =
NULL;
587 ret =
ctx->decoder->pVtbl->QueryOutput(
ctx->decoder, &data_out);
588 if (ret != AMF_OK && ret != AMF_REPEAT) {
591 if (data_out ==
NULL) {
596 AMFGuid guid = IID_AMFSurface();
597 data_out->pVtbl->QueryInterface(data_out, &guid, (
void**)&surface);
598 data_out->pVtbl->Release(data_out);
608 surface->pVtbl->Release(surface);
622 AMF_ASSIGN_PROPERTY_INT64(res,
buffer,
L"FFMPEG:dts",
pkt->dts);
633 AMFContext *ctxt = amf_device_ctx->
context;
636 AMFBuffer *buf =
NULL;
644 err = buf->pVtbl->SetSize(buf,
pkt->size);
645 AMF_RETURN_IF_FALSE(ctxt, err == AMF_OK, err,
"amf_buffer_from_packet() - SetSize failed");
647 mem = buf->pVtbl->GetNative(buf);
651 memcpy(mem,
pkt->data,
pkt->size);
660 AMFVariantStruct size_var = {0};
661 AMF_RESULT res = AMF_OK;
663 res =
ctx->decoder->pVtbl->GetProperty(
ctx->decoder, AMF_VIDEO_DECODER_CURRENT_SIZE, &size_var);
664 if (res == AMF_OK && size_var.sizeValue.width > 0 && size_var.sizeValue.height > 0) {
665 avctx->
width = size_var.sizeValue.width;
666 avctx->
height = size_var.sizeValue.height;
670 ctx->dimensions_initialized = 1;
689 if(
ctx->resolution_changed)
690 ctx->resolution_changed = 0;
699 ctx->decoder->pVtbl->Drain(
ctx->decoder);
710 res =
ctx->decoder->pVtbl->SubmitInput(
ctx->decoder, (AMFData*) buf);
711 if(res == AMF_DECODER_NO_FREE_SURFACES)
715 }
while (res == AMF_DECODER_NO_FREE_SURFACES);
717 buf->pVtbl->Release(buf);
719 if(res == AMF_DECODER_NO_FREE_SURFACES) {
721 av_log(avctx,
AV_LOG_VERBOSE,
"SubmitInput() returned NO_FREE_SURFACES and came out of loop - should never happen\n");
723 }
else if (res == AMF_RESOLUTION_CHANGED) {
725 ctx->decoder->pVtbl->Drain(
ctx->decoder);
728 ctx->resolution_changed = 1;
730 }
else if (res != AMF_OK && res != AMF_NEED_MORE_INPUT && res != AMF_REPEAT) {
739 if (!
ctx->dimensions_initialized)
741 }
else if (res == AMF_REPEAT)
744 else if (res == AMF_EOF) {
747 if(
ctx->resolution_changed){
749 AMFVariantStruct size_var = {0};
750 AMFVariantStruct format_var = {0};
751 res =
ctx->decoder->pVtbl->GetProperty(
ctx->decoder, AMF_VIDEO_DECODER_CURRENT_SIZE, &size_var);
756 avctx->
width = size_var.sizeValue.width;
757 avctx->
height = size_var.sizeValue.height;
777 return got_frame ? 0 :
AVERROR(EAGAIN);
783 ctx->decoder->pVtbl->Flush(
ctx->decoder);
786#define OFFSET(x) offsetof(AMFDecoderContext, x)
787#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
791 {
"decoder_mode",
"Decoder mode",
OFFSET(decoder_mode),
AV_OPT_TYPE_INT, { .i64 = -1 }, -1, AMF_VIDEO_DECODER_MODE_LOW_LATENCY,
VD,
"decoder_mode" },
792 {
"regular",
"DPB delay is based on number of reference frames + 1", 0,
AV_OPT_TYPE_CONST, { .i64 = AMF_VIDEO_DECODER_MODE_REGULAR }, 0, 0,
VD,
"decoder_mode" },
793 {
"compliant",
"DPB delay is based on profile - up to 16", 0,
AV_OPT_TYPE_CONST, { .i64 = AMF_VIDEO_DECODER_MODE_COMPLIANT }, 0, 0,
VD,
"decoder_mode" },
794 {
"low_latency",
"DPB delay is 0", 0,
AV_OPT_TYPE_CONST, { .i64 = AMF_VIDEO_DECODER_MODE_LOW_LATENCY }, 0, 0,
VD,
"decoder_mode" },
797 {
"timestamp_mode",
"Timestamp mode",
OFFSET(timestamp_mode),
AV_OPT_TYPE_INT, { .i64 = AMF_TS_SORT }, -1, AMF_TS_DECODE,
VD,
"timestamp_mode" },
798 {
"presentation",
"Preserve timestamps from input to output", 0,
AV_OPT_TYPE_CONST, { .i64 = AMF_TS_PRESENTATION }, 0, 0,
VD,
"timestamp_mode" },
799 {
"sort",
"Resort PTS list", 0,
AV_OPT_TYPE_CONST, { .i64 = AMF_TS_SORT }, 0, 0,
VD,
"timestamp_mode" },
800 {
"decode",
"Decode order", 0,
AV_OPT_TYPE_CONST, { .i64 = AMF_TS_DECODE }, 0, 0,
VD,
"timestamp_mode" },
803 {
"surface_pool_size",
"Number of surfaces in the decode pool",
OFFSET(surface_pool_size),
AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX,
VD,
NULL },
808 {
"skip_transfer_sav",
"Skip transfer on another GPU when SAV enabled",
OFFSET(skip_transfer_sav),
AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1,
VD,
NULL },
821#define DEFINE_AMF_DECODER(x, X, bsf_name) \
822const FFCodec ff_##x##_amf_decoder = { \
823 .p.name = #x "_amf", \
824 CODEC_LONG_NAME(#X " AMD AMF video decoder"), \
825 .priv_data_size = sizeof(AMFDecoderContext), \
826 .p.type = AVMEDIA_TYPE_VIDEO, \
827 .p.id = AV_CODEC_ID_##X, \
828 .init = amf_decode_init, \
829 FF_CODEC_RECEIVE_FRAME_CB(amf_decode_frame), \
830 .flush = amf_decode_flush, \
831 .close = amf_decode_close, \
833 .p.capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING, \
834 .p.priv_class = &amf_decode_class, \
835 .hw_configs = amf_hw_configs, \
836 .p.wrapper_name = "amf", \
837 .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, \
static double val(void *priv, double ch)
static int amf_legacy_driver_no_bitness_detect(AVAMFDeviceContext *amf_device_ctx)
static enum AVColorTransferCharacteristic amf_to_av_trc(enum AMF_COLOR_TRANSFER_CHARACTERISTIC_ENUM trc)
static AMF_RESULT amf_update_buffer_properties(AVCodecContext *avctx, AMFBuffer *buffer, const AVPacket *pkt)
#define AMF_VIDEO_DECODER_OUTPUT_FORMAT
static int amf_amfsurface_to_avframe(AVCodecContext *avctx, AMFSurface *surface, AVFrame *frame)
static void amf_init_dimensions(AVCodecContext *avctx)
static int amf_init_frames_context(AVCodecContext *avctx, int sw_format, int new_width, int new_height)
static int amf_init_decoder(AVCodecContext *avctx)
static int amf_color_trc_valid(enum AVColorTransferCharacteristic trc)
static int amf_attach_hdr_metadata(AVCodecContext *avctx, AMFSurface *surface, AVFrame *frame)
static void amf_read_surface_color(AVCodecContext *avctx, AMFSurface *surface, AVFrame *frame)
static enum AVColorPrimaries amf_to_av_primaries(enum AMF_COLOR_PRIMARIES_ENUM pri)
static int amf_decode_frame(AVCodecContext *avctx, struct AVFrame *frame)
static AMF_RESULT amf_receive_frame(AVCodecContext *avctx, AVFrame *frame)
#define DEFINE_AMF_DECODER(x, X, bsf_name)
static void amf_decode_flush(AVCodecContext *avctx)
static enum AVColorSpace amf_to_av_colorspace(enum AMF_VIDEO_CONVERTER_COLOR_PROFILE_ENUM profile)
static AMF_RESULT amf_buffer_from_packet(AVCodecContext *avctx, const AVPacket *pkt, AMFBuffer **buffer)
static int amf_decode_close(AVCodecContext *avctx)
static void amf_free_amfsurface(void *opaque, uint8_t *data)
static const AVCodecHWConfigInternal *const amf_hw_configs[]
static const AVClass amf_decode_class
static int amf_color_primaries_valid(enum AVColorPrimaries pri)
static enum AVColorRange amf_to_av_range(enum AMF_COLOR_RANGE_ENUM range)
static int amf_reinit_frames_context(AVCodecContext *avctx, int sw_format, int new_width, int new_height)
static AMF_RESULT amf_get_property_buffer(AMFData *object, const wchar_t *name, AMFBuffer **val)
static int amf_decode_init(AVCodecContext *avctx)
#define AMF_RETURN_IF_FALSE(avctx, exp, ret_value,...)
Error handling helper.
static AVFormatContext * ctx
#define FF_THREAD_FRAME
Decode more than one frame at once.
#define i(width, name, range_min, range_max)
int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
Set various frame properties from the codec context / packet data.
int ff_attach_decode_data(AVCodecContext *avctx, AVFrame *frame)
int ff_decode_get_packet(AVCodecContext *avctx, AVPacket *pkt)
Called by decoders to get the next packet for decoding.
static void ff_decode_get_extradata(const AVCodecContext *avctx, const uint8_t **extradata, int *extradata_size)
Helper function for decoders that may use a BSF that changes extradata.
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX
The codec supports this format via the hw_frames_ctx interface.
@ AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX
The codec supports this format via the hw_device_ctx interface.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
AVBufferRef * av_buffer_ref(const AVBufferRef *buf)
Create a new reference to an AVBuffer.
#define AV_BUFFER_FLAG_READONLY
Always treat the buffer as read-only, even when it has only one reference.
AVBufferRef * av_buffer_create(uint8_t *data, size_t size, void(*free)(void *opaque, uint8_t *data), void *opaque, int flags)
Create an AVBuffer from an existing array.
#define AVERROR_ENCODER_NOT_FOUND
Encoder not found.
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
#define AVERROR_EOF
End of file.
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define AV_LOG_VERBOSE
Detailed information.
#define AV_LOG_INFO
Standard information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
#define LIBAVUTIL_VERSION_INT
static AVBufferRef * hw_device_ctx
int av_hwdevice_ctx_create(AVBufferRef **pdevice_ref, enum AVHWDeviceType type, const char *device, AVDictionary *opts, int flags)
Open a device of the specified type and create an AVHWDeviceContext for it.
int av_hwdevice_ctx_create_derived(AVBufferRef **dst_ref_ptr, enum AVHWDeviceType type, AVBufferRef *src_ref, int flags)
Create a new device of the specified type from an existing device.
int av_hwframe_ctx_init(AVBufferRef *ref)
Finalize the context before use.
AVBufferRef * av_hwframe_ctx_alloc(AVBufferRef *device_ref_in)
Allocate an AVHWFramesContext tied to a given device context.
int av_amf_attach_hdr_metadata(AVFrame *frame, const AMFHDRMetadata *hdrmeta)
enum AVPixelFormat av_amf_to_av_format(enum AMF_SURFACE_FORMAT fmt)
enum AMF_VIDEO_CONVERTER_COLOR_PROFILE_ENUM av_amf_get_color_profile(enum AVColorRange color_range, enum AVColorSpace color_space)
#define AMF_GOTO_FAIL_IF_FALSE(avctx, exp, ret_value,...)
An API-specific header for AV_HWDEVICE_TYPE_D3D11VA.
An API-specific header for AV_HWDEVICE_TYPE_DXVA2.
const char * av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
const char * av_color_primaries_name(enum AVColorPrimaries primaries)
#define AV_PIX_FMT_YUV420P10
AVColorRange
Visual content value range.
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
@ AVCOL_RANGE_UNSPECIFIED
@ AVCOL_RANGE_JPEG
Full range content.
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
@ AV_PIX_FMT_AMF_SURFACE
HW acceleration through AMF.
AVColorPrimaries
Chromaticity coordinates of the source primaries.
AVColorTransferCharacteristic
Color Transfer Characteristic.
@ AVCOL_TRC_SMPTE2084
SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems.
AVColorSpace
YUV colorspace type.
@ AVCOL_SPC_BT709
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / derived in SMPTE RP 177 Annex B
@ AVCOL_SPC_BT2020_NCL
ITU-R BT2020 non-constant luminance system.
@ AVCOL_SPC_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
static int copy_output(SANMVideoContext *ctx, int sanm)
This struct is allocated as AVHWDeviceContext.hwctx.
int64_t version
version of AMF runtime
uint8_t * data
The data buffer.
Describe the class of an AVClass context structure.
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
enum AVPixelFormat sw_pix_fmt
Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
AVBufferRef * hw_frames_ctx
A reference to the AVHWFramesContext describing the input (for encoding) or output (decoding) frames.
int active_thread_type
Which multithreading methods are in use by the codec.
const struct AVCodec * codec
enum AVColorSpace colorspace
YUV colorspace type.
int thread_count
thread count is used to decide how many independent tasks should be passed to execute()
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
AVBufferRef * hw_device_ctx
A reference to the AVHWDeviceContext describing the device which will be used by a hardware encoder/d...
int extra_hw_frames
Video decoding only.
int coded_width
Bitstream width / height, may be different from width/height e.g.
This structure describes decoded (raw) audio or video data.
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
enum AVHWDeviceType type
This field identifies the underlying API used for hardware access.
This struct describes a set or pool of "hardware" frames (i.e.
enum AVPixelFormat format
The pixel format identifying the underlying HW surface type.
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
int initial_pool_size
Initial size of the frame pool.
int width
The allocated dimensions of the frames in this pool.
This structure stores compressed data.
int av_usleep(unsigned usec)
Sleep for a period of time.