FFmpeg
qsvvpp.h
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 /**
20  * @file
21  * Intel Quick Sync Video VPP base function
22  */
23 
24 #ifndef AVFILTER_QSVVPP_H
25 #define AVFILTER_QSVVPP_H
26 
27 #include <mfx/mfxvideo.h>
28 
29 #include "avfilter.h"
30 
31 #define FF_INLINK_IDX(link) ((int)((link)->dstpad - (link)->dst->input_pads))
32 #define FF_OUTLINK_IDX(link) ((int)((link)->srcpad - (link)->src->output_pads))
33 
34 #define QSV_VERSION_ATLEAST(MAJOR, MINOR) \
35  (MFX_VERSION_MAJOR > (MAJOR) || \
36  MFX_VERSION_MAJOR == (MAJOR) && MFX_VERSION_MINOR >= (MINOR))
37 
38 #define QSV_RUNTIME_VERSION_ATLEAST(MFX_VERSION, MAJOR, MINOR) \
39  ((MFX_VERSION.Major > (MAJOR)) || \
40  (MFX_VERSION.Major == (MAJOR) && MFX_VERSION.Minor >= (MINOR)))
41 
42 typedef struct QSVVPPContext QSVVPPContext;
43 
44 typedef struct QSVVPPCrop {
45  int in_idx; ///< Input index
46  int x, y, w, h; ///< Crop rectangle
47 } QSVVPPCrop;
48 
49 typedef struct QSVVPPParam {
50  /* default is ff_filter_frame */
52 
53  /* To fill with MFX enhanced filter configurations */
55  mfxExtBuffer **ext_buf;
56 
57  /* Real output format */
59 
60  /* Crop information for each input, if needed */
61  int num_crop;
63 } QSVVPPParam;
64 
65 /* create and initialize the QSV session */
67 
68 /* release the resources (eg.surfaces) */
69 int ff_qsvvpp_free(QSVVPPContext **vpp);
70 
71 /* vpp filter frame and call the cb if needed */
73 
74 #endif /* AVFILTER_QSVVPP_H */
QSVVPPCrop::in_idx
int in_idx
Input index.
Definition: qsvvpp.h:45
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
QSVVPPParam::crop
QSVVPPCrop * crop
Definition: qsvvpp.h:62
QSVVPPParam::out_sw_format
enum AVPixelFormat out_sw_format
Definition: qsvvpp.h:58
ff_qsvvpp_filter_frame
int ff_qsvvpp_filter_frame(QSVVPPContext *vpp, AVFilterLink *inlink, AVFrame *frame)
Definition: qsvvpp.c:688
inlink
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
Definition: filter_design.txt:212
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:295
ff_qsvvpp_free
int ff_qsvvpp_free(QSVVPPContext **vpp)
Definition: qsvvpp.c:664
ff_qsvvpp_create
int ff_qsvvpp_create(AVFilterContext *avctx, QSVVPPContext **vpp, QSVVPPParam *param)
Definition: qsvvpp.c:561
QSVVPPCrop::w
int w
Definition: qsvvpp.h:46
QSVVPPContext
Definition: qsvvpp.c:48
QSVVPPParam::num_crop
int num_crop
Definition: qsvvpp.h:61
QSVVPPParam
Definition: qsvvpp.h:49
QSVVPPCrop::x
int x
Definition: qsvvpp.h:46
QSVVPPParam::num_ext_buf
int num_ext_buf
Definition: qsvvpp.h:54
QSVVPPParam::filter_frame
int(* filter_frame)(AVFilterLink *outlink, AVFrame *frame)
Definition: qsvvpp.h:51
frame
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:264
QSVVPPCrop::h
int h
Crop rectangle.
Definition: qsvvpp.h:46
QSVVPPCrop::y
int y
Definition: qsvvpp.h:46
avfilter.h
AVFilterContext
An instance of a filter.
Definition: avfilter.h:338
QSVVPPCrop
Definition: qsvvpp.h:44
int
int
Definition: ffmpeg_filter.c:191
QSVVPPParam::ext_buf
mfxExtBuffer ** ext_buf
Definition: qsvvpp.h:55