17 |
17 |
18 #include <stdio.h> |
18 #include <stdio.h> |
19 #include <stdlib.h> |
19 #include <stdlib.h> |
20 #include <assert.h> |
20 #include <assert.h> |
21 #include "xavideopostprocessingitf.h" |
21 #include "xavideopostprocessingitf.h" |
22 #ifdef _GSTREAMER_BACKEND_ |
22 |
23 #include "XAVideoPostProsessingItfAdaptation.h" |
23 #include "xavideopostprosessingitfadaptation.h" |
24 #endif |
24 |
25 /** |
25 /** |
26 * XAVideoPostProcessingItfImpl* GetImpl(XAVideoPostProcessingItf self) |
26 * XAVideoPostProcessingItfImpl* GetImpl(XAVideoPostProcessingItf self) |
27 * Description: Validated interface pointer and cast it to implementations pointer. |
27 * Description: Validated interface pointer and cast it to implementations pointer. |
28 **/ |
28 **/ |
29 static XAVideoPostProcessingItfImpl* GetImpl(XAVideoPostProcessingItf self) |
29 static XAVideoPostProcessingItfImpl* GetImpl(XAVideoPostProcessingItf self) |
104 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
104 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
105 DEBUG_API("<-XAVideoPostProcessingItfImpl_IsArbitraryRotationSupported"); |
105 DEBUG_API("<-XAVideoPostProcessingItfImpl_IsArbitraryRotationSupported"); |
106 /* invalid parameter */ |
106 /* invalid parameter */ |
107 return XA_RESULT_PARAMETER_INVALID; |
107 return XA_RESULT_PARAMETER_INVALID; |
108 } |
108 } |
109 #ifdef _GSTREAMER_BACKEND_ |
109 |
110 ret = XAVideoPostProcessingItfAdapt_ThreadEntry(impl->adapCtx); |
110 ret = XAAdaptationBase_ThreadEntry(impl->adapCtx); |
111 if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED ) |
111 if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED ) |
112 { |
112 { |
113 DEBUG_API("<-XAVideoPostProcessingItfImpl_IsArbitraryRotationSupported"); |
113 DEBUG_API("<-XAVideoPostProcessingItfImpl_IsArbitraryRotationSupported"); |
114 return ret; |
114 return ret; |
115 } |
115 } |
116 |
116 |
117 ret = XAVideoPostProcessingItfAdapt_IsArbitraryRotationSupported(impl->adapCtx, |
117 ret = XAVideoPostProcessingItfAdapt_IsArbitraryRotationSupported((XAAdaptationGstCtx*)impl->adapCtx, |
118 pSupported); |
118 pSupported); |
119 |
119 |
120 if(ret == XA_RESULT_SUCCESS) |
120 if(ret == XA_RESULT_SUCCESS) |
121 { |
121 { |
122 impl->supported = *pSupported; |
122 impl->supported = *pSupported; |
123 } |
123 } |
124 |
124 |
125 XAVideoPostProcessingItfAdapt_ThreadExit(impl->adapCtx); |
125 XAAdaptationBase_ThreadExit(impl->adapCtx); |
126 #endif |
126 |
127 DEBUG_API("<-XAVideoPostProcessingItfImpl_IsArbitraryRotationSupported"); |
127 DEBUG_API("<-XAVideoPostProcessingItfImpl_IsArbitraryRotationSupported"); |
128 return ret; |
128 return ret; |
129 } |
129 } |
130 |
130 |
131 /** |
131 /** |
262 DEBUG_API("<-XAVideoPostProcessingItfImpl_Commit"); |
262 DEBUG_API("<-XAVideoPostProcessingItfImpl_Commit"); |
263 /* invalid parameter */ |
263 /* invalid parameter */ |
264 return XA_RESULT_PARAMETER_INVALID; |
264 return XA_RESULT_PARAMETER_INVALID; |
265 } |
265 } |
266 |
266 |
267 #ifdef _GSTREAMER_BACKEND_ |
267 |
268 ret = XAVideoPostProcessingItfAdapt_ThreadEntry(impl->adapCtx); |
268 ret = XAAdaptationBase_ThreadEntry(impl->adapCtx); |
269 if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED ) |
269 if( ret == XA_RESULT_PARAMETER_INVALID || ret == XA_RESULT_PRECONDITIONS_VIOLATED ) |
270 { |
270 { |
271 DEBUG_API("<-XAVideoPostProcessingItfImpl_Commit"); |
271 DEBUG_API("<-XAVideoPostProcessingItfImpl_Commit"); |
272 return ret; |
272 return ret; |
273 } |
273 } |
274 |
274 |
275 ret = XAVideoPostProcessingItfAdapt_Commit(impl->adapCtx, |
275 ret = XAVideoPostProcessingItfAdapt_Commit((XAAdaptationGstCtx*)impl->adapCtx, |
276 impl->rotation, |
276 impl->rotation, |
277 impl->scaleOptions, |
277 impl->scaleOptions, |
278 impl->backgroundColor, |
278 impl->backgroundColor, |
279 impl->renderingHints, |
279 impl->renderingHints, |
280 &impl->srcRect, |
280 &impl->srcRect, |
293 impl->isDestRect = XA_BOOLEAN_FALSE; |
293 impl->isDestRect = XA_BOOLEAN_FALSE; |
294 impl->isSrcRect = XA_BOOLEAN_FALSE; |
294 impl->isSrcRect = XA_BOOLEAN_FALSE; |
295 impl->isScaleOptions = XA_BOOLEAN_FALSE; |
295 impl->isScaleOptions = XA_BOOLEAN_FALSE; |
296 } |
296 } |
297 |
297 |
298 XAVideoPostProcessingItfAdapt_ThreadExit(impl->adapCtx); |
298 XAAdaptationBase_ThreadExit(impl->adapCtx); |
299 #endif |
299 |
300 DEBUG_API("<-XAVideoPostProcessingItfImpl_Commit"); |
300 DEBUG_API("<-XAVideoPostProcessingItfImpl_Commit"); |
301 return ret; |
301 return ret; |
302 } |
302 } |
303 |
303 |
304 /** |
304 /** |
305 * XAVideoPostProcessingItfImpl -specific methods |
305 * XAVideoPostProcessingItfImpl -specific methods |
306 **/ |
306 **/ |
307 #ifdef _GSTREAMER_BACKEND_ |
|
308 |
|
309 /** |
307 /** |
310 * XAVideoPostProcessingItfImpl* XAVideoPostProcessingItfImpl_Create() |
308 * XAVideoPostProcessingItfImpl* XAVideoPostProcessingItfImpl_Create() |
311 * @return XAVideoPostProcessingItfImpl* - Pointer to VideoPostProcessingItf interface implementation |
309 * @return XAVideoPostProcessingItfImpl* - Pointer to VideoPostProcessingItf interface implementation |
312 **/ |
310 **/ |
313 XAVideoPostProcessingItfImpl* XAVideoPostProcessingItfImpl_Create(XAAdaptationBaseCtx *adapCtx) |
311 XAVideoPostProcessingItfImpl* XAVideoPostProcessingItfImpl_Create(XAAdaptationBaseCtx *adapCtx) |