WinGui: Fix another instance of the Caliburn vs Json.net sillyness where objects...
[HandBrake.git] / libhb / qsv_filter_pp.h
blobe7037032115a5fd4937deb2c46a45a6f24df8fd5
1 /* ********************************************************************* *\
3 Copyright (C) 2013 Intel Corporation. All rights reserved.
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7 - Redistributions of source code must retain the above copyright notice,
8 this list of conditions and the following disclaimer.
9 - Redistributions in binary form must reproduce the above copyright notice,
10 this list of conditions and the following disclaimer in the documentation
11 and/or other materials provided with the distribution.
12 - Neither the name of Intel Corporation nor the names of its contributors
13 may be used to endorse or promote products derived from this software
14 without specific prior written permission.
16 THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS" AND ANY EXPRESS OR
17 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT,
20 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 \* ********************************************************************* */
29 #ifndef QSV_FILTER_PP_H
30 #define QSV_FILTER_PP_H
32 #include "msdk/mfxplugin.h"
34 extern hb_buffer_t *link_buf_list( hb_filter_private_t *pv );
36 struct qsv_filter_task_s;
38 typedef struct{
39 mfxFrameAllocator *alloc;
40 mfxStatus (*process)(struct qsv_filter_task_s*,void*);
41 mfxCoreInterface *core;
42 }qsv_filter_processor_t;
44 typedef struct qsv_filter_task_s{
45 mfxFrameSurface1 *in;
46 mfxFrameSurface1 *out;
47 int busy;
48 hb_filter_private_t *pv;
49 qsv_filter_processor_t processor;
50 } qsv_filter_task_t;
52 typedef struct qsv_filter_private_s{
54 int is_init_done;
56 mfxCoreInterface *core;
57 mfxVideoParam *videoparam;
58 mfxPluginParam pluginparam;
60 hb_filter_private_t *pv;
62 mfxPlugin plug;
63 hb_list_t *tasks;
64 } qsv_filter_t;
66 typedef struct hb_qsv_sync_s{
67 int frame_go;
68 int status;
69 hb_cond_t *frame_completed;
70 hb_lock_t *frame_completed_lock;
72 hb_buffer_t *in;
73 hb_buffer_t *out;
74 } hb_qsv_sync_t;
76 typedef struct hb_filter_private_s
78 hb_job_t *job;
79 hb_list_t *list;
81 hb_qsv_sync_t pre;
82 hb_qsv_sync_t pre_busy;
84 hb_qsv_sync_t post;
85 hb_qsv_sync_t post_busy;
87 av_qsv_space *vpp_space;
88 hb_list_t *qsv_user;
90 struct SwsContext* sws_context_to_nv12;
91 struct SwsContext* sws_context_from_nv12;
92 } hb_filter_private_t_qsv;
94 // methods to be called by Media SDK
95 mfxStatus MFX_CDECL qsv_PluginInit(mfxHDL pthis, mfxCoreInterface *core);
96 mfxStatus MFX_CDECL qsv_PluginClose (mfxHDL pthis);
97 mfxStatus MFX_CDECL qsv_GetPluginParam(mfxHDL pthis, mfxPluginParam *par);
98 mfxStatus MFX_CDECL qsv_Submit(mfxHDL pthis, const mfxHDL *in, mfxU32 in_num, const mfxHDL *out, mfxU32 out_num, mfxThreadTask *task);
99 mfxStatus MFX_CDECL qsv_Execute(mfxHDL pthis, mfxThreadTask task, mfxU32 uid_p, mfxU32 uid_a);
100 mfxStatus MFX_CDECL qsv_FreeResources(mfxHDL pthis, mfxThreadTask task, mfxStatus sts);
102 // methods to be called by us
103 mfxStatus plugin_init(qsv_filter_t*,mfxVideoParam*);
104 mfxStatus plugin_close(qsv_filter_t*);
106 //internal functions
107 mfxExtBuffer* get_ext_buffer(mfxExtBuffer**, mfxU32, mfxU32);
108 int get_free_task(hb_list_t*);
109 mfxStatus process_filter(qsv_filter_task_t*,void*);
110 mfxStatus lock_frame(mfxFrameAllocator *,mfxFrameSurface1*);
111 mfxStatus unlock_frame(mfxFrameAllocator *,mfxFrameSurface1*);
114 #endif //QSV_FILTER_PP_H