libavcodec/qsvdec.h
4e08c821
 /*
  * Intel MediaSDK QSV utility functions
  *
  * copyright (c) 2013 Luca Barbato
  *
841e9f43
  * This file is part of FFmpeg.
4e08c821
  *
841e9f43
  * FFmpeg is free software; you can redistribute it and/or
4e08c821
  * 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.
  *
841e9f43
  * FFmpeg is distributed in the hope that it will be useful,
4e08c821
  * 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
841e9f43
  * License along with FFmpeg; if not, write to the Free Software
4e08c821
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
b04d009b
 #ifndef AVCODEC_QSVDEC_H
 #define AVCODEC_QSVDEC_H
4e08c821
 
 #include <stdint.h>
 #include <sys/types.h>
 
 #include <mfx/mfxvideo.h>
 
f5c4d38c
 #include "libavutil/fifo.h"
4e08c821
 #include "libavutil/frame.h"
 #include "libavutil/pixfmt.h"
 
 #include "avcodec.h"
758fbc54
 #include "hwaccel.h"
72b7441a
 #include "qsv_internal.h"
4e08c821
 
 typedef struct QSVContext {
     // the session used for decoding
     mfxSession session;
 
     // the session we allocated internally, in case the caller did not provide
     // one
1f26a231
     mfxSession internal_session;
 
     QSVFramesContext frames_ctx;
4e08c821
 
     /**
      * a linked list of frames currently being used by QSV
      */
     QSVFrame *work_frames;
 
f5c4d38c
     AVFifoBuffer *async_fifo;
0940b748
     int zero_consume_run;
d50ab820
 
1f26a231
     // the internal parser and codec context for parsing the data
     AVCodecParserContext *parser;
     AVCodecContext *avctx_internal;
     enum AVPixelFormat orig_pix_fmt;
536bb17e
     uint32_t fourcc;
ce320cf1
     mfxFrameInfo frame_info;
cc167f7e
 
4e08c821
     // options set by the caller
     int async_depth;
     int iopattern;
 
41d47ea8
     char *load_plugins;
 
4e08c821
     mfxExtBuffer **ext_buffers;
     int         nb_ext_buffers;
 } QSVContext;
 
758fbc54
 extern const AVCodecHWConfigInternal *ff_qsv_hw_configs[];
 
1f26a231
 int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q,
                         AVFrame *frame, int *got_frame, AVPacket *pkt);
4e08c821
 
1f26a231
 void ff_qsv_decode_flush(AVCodecContext *avctx, QSVContext *q);
3f8e2e99
 
9ba27c23
 int ff_qsv_decode_close(QSVContext *q);
4e08c821
 
b04d009b
 #endif /* AVCODEC_QSVDEC_H */