qsvdec.h 2.13 KB
Newer Older
1 2 3 4 5
/*
 * Intel MediaSDK QSV utility functions
 *
 * copyright (c) 2013 Luca Barbato
 *
6
 * This file is part of FFmpeg.
7
 *
8
 * FFmpeg is free software; you can redistribute it and/or
9 10 11 12
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
13
 * FFmpeg is distributed in the hope that it will be useful,
14 15 16 17 18
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
19
 * License along with FFmpeg; if not, write to the Free Software
20 21 22
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

Anton Khirnov's avatar
Anton Khirnov committed
23 24
#ifndef AVCODEC_QSVDEC_H
#define AVCODEC_QSVDEC_H
25 26 27 28 29 30

#include <stdint.h>
#include <sys/types.h>

#include <mfx/mfxvideo.h>

31
#include "libavutil/fifo.h"
32 33 34 35
#include "libavutil/frame.h"
#include "libavutil/pixfmt.h"

#include "avcodec.h"
36
#include "qsv_internal.h"
37 38 39 40 41 42 43

typedef struct QSVContext {
    // the session used for decoding
    mfxSession session;

    // the session we allocated internally, in case the caller did not provide
    // one
44 45 46
    mfxSession internal_session;

    QSVFramesContext frames_ctx;
47 48 49 50 51 52

    /**
     * a linked list of frames currently being used by QSV
     */
    QSVFrame *work_frames;

53
    AVFifoBuffer *async_fifo;
54
    int zero_consume_run;
55

56 57 58 59
    // the internal parser and codec context for parsing the data
    AVCodecParserContext *parser;
    AVCodecContext *avctx_internal;
    enum AVPixelFormat orig_pix_fmt;
60
    uint32_t fourcc;
61
    mfxFrameInfo frame_info;
62

63 64 65 66
    // options set by the caller
    int async_depth;
    int iopattern;

67 68
    char *load_plugins;

69 70 71 72
    mfxExtBuffer **ext_buffers;
    int         nb_ext_buffers;
} QSVContext;

73 74
int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q,
                        AVFrame *frame, int *got_frame, AVPacket *pkt);
75

76
void ff_qsv_decode_flush(AVCodecContext *avctx, QSVContext *q);
77

78
int ff_qsv_decode_close(QSVContext *q);
79

Anton Khirnov's avatar
Anton Khirnov committed
80
#endif /* AVCODEC_QSVDEC_H */