28 #include <mfx/mfxvideo.h>
71 static const char *uid_hevcenc_sw =
"15dd936825ad475ea34e35f3f54217a6";
75 "load_plugins is not empty, but load_plugin is not set to 'none'."
76 "The load_plugin value will be ignored.\n");
107 int n_filtered =
NULL;
111 if (avpkt->
size > 3 && !avpkt->
data[0] &&
112 !avpkt->
data[1] && !avpkt->
data[2] && 1==avpkt->
data[3]) {
119 &p_filtered, &n_filtered,
122 pkt_filtered.
pts = avpkt->
pts;
123 pkt_filtered.
data = p_filtered;
124 pkt_filtered.
size = n_filtered;
128 if (p_filtered != avpkt->
data)
130 return ret > 0 ? avpkt->
size : ret;
144 #define OFFSET(x) offsetof(QSVH2645Context, x)
145 #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
147 #if CONFIG_HEVC_QSV_DECODER
155 static const AVOption hevc_options[] = {
162 {
"load_plugins",
"A :-separate list of hexadecimal plugin UIDs to load in an internal session",
167 static const AVClass hevc_class = {
170 .option = hevc_options,
174 AVCodec ff_hevc_qsv_decoder = {
185 .priv_class = &hevc_class,
192 #if CONFIG_H264_QSV_DECODER
212 AVCodec ff_h264_qsv_decoder = {
214 .long_name =
NULL_IF_CONFIG_SMALL(
"H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (Intel Quick Sync Video acceleration)"),
223 .priv_class = &
class,
AVBitStreamFilterContext * bsf
int ff_qsv_decode(AVCodecContext *avctx, QSVContext *q, AVFrame *frame, int *got_frame, AVPacket *avpkt)
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
static void flush(AVCodecContext *avctx)
#define AV_LOG_WARNING
Something somehow does not look correct.
#define LIBAVUTIL_VERSION_INT
static av_cold int init(AVCodecContext *avctx)
static av_cold int qsv_decode_close(AVCodecContext *avctx)
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
void ff_qsv_decode_reset(AVCodecContext *avctx, QSVContext *q)
int ff_qsv_decode_close(QSVContext *q)
const OptionDef options[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_bitstream_filter_close(AVBitStreamFilterContext *bsf)
Release bitstream filter context.
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
const char * name
Name of the codec implementation.
#define ASYNC_DEPTH_DEFAULT
const char * name
Name of the hardware accelerated codec.
static void qsv_decode_flush(AVCodecContext *avctx)
AVBitStreamFilterContext * av_bitstream_filter_init(const char *name)
Create and initialize a bitstream filter context given a bitstream filter name.
int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe)
Filter bitstream.
Libavcodec external API header.
char * av_strdup(const char *s)
Duplicate the string s.
main external API structure.
a very simple circular buffer FIFO implementation
Describe the class of an AVClass context structure.
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
static int qsv_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static enum AVPixelFormat pix_fmts[]
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
static av_cold int qsv_decode_init(AVCodecContext *avctx)
common internal api header.
common internal and external API header
AVPixelFormat
Pixel format.
This structure stores compressed data.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...