28 #include <mfx/mfxvideo.h>
82 int n_filtered =
NULL;
86 if (avpkt->
size > 3 && !avpkt->
data[0] &&
87 !avpkt->
data[1] && !avpkt->
data[2] && 1==avpkt->
data[3]) {
94 &p_filtered, &n_filtered,
97 pkt_filtered.
pts = avpkt->
pts;
98 pkt_filtered.
data = p_filtered;
99 pkt_filtered.
size = n_filtered;
103 if (p_filtered != avpkt->
data)
105 return ret > 0 ? avpkt->
size :
ret;
126 #define OFFSET(x) offsetof(QSVH264Context, x)
127 #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
142 .long_name =
NULL_IF_CONFIG_SMALL(
"H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (Intel Quick Sync Video acceleration)"),
151 .priv_class = &
class,
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)
AVCodec ff_h264_qsv_decoder
#define LIBAVUTIL_VERSION_INT
static av_cold int init(AVCodecContext *avctx)
static const AVOption options[]
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
AVBitStreamFilterContext * bsf
int ff_qsv_decode_close(QSVContext *q)
#define CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
#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.
const char * name
Name of the codec implementation.
Libavcodec external API header.
AVHWAccel ff_h264_qsv_hwaccel
#define ASYNC_DEPTH_DEFAULT
const char * name
Name of the hardware accelerated codec.
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.
main external API structure.
a very simple circular buffer FIFO implementation
Describe the class of an AVClass context structure.
static int qsv_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
HW acceleration through QSV, data[3] contains a pointer to the mfxFrameSurface1 structure.
static av_cold int qsv_decode_close(AVCodecContext *avctx)
static void qsv_decode_flush(AVCodecContext *avctx)
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
common internal api header.
common internal and external API header
static av_cold int qsv_decode_init(AVCodecContext *avctx)
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...