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 "xadynamicsourceitf.h" |
21 #include "xadynamicsourceitf.h" |
22 #ifdef _GSTREAMER_BACKEND_ |
22 |
23 #include "XAAdaptationContextBase.h" |
23 #include "xadynamicsourceitfadaptation.h" |
24 #include "XADynamicSourceItfAdaptation.h" |
24 #include "xadynamicsourceitfadaptationmmf.h" |
25 #endif |
25 |
26 |
26 |
27 /***************************************************************************** |
27 /***************************************************************************** |
28 * Base interface XADynamicSourceItf implementation |
28 * Base interface XADynamicSourceItf implementation |
29 *****************************************************************************/ |
29 *****************************************************************************/ |
30 |
30 |
42 { |
42 { |
43 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
43 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
44 DEBUG_API("<-XADynamicSourceItfImpl_SetSource"); |
44 DEBUG_API("<-XADynamicSourceItfImpl_SetSource"); |
45 return XA_RESULT_PARAMETER_INVALID; |
45 return XA_RESULT_PARAMETER_INVALID; |
46 } |
46 } |
47 #ifdef _GSTREAMER_BACKEND_ |
47 |
48 if( !impl->adaptCtx ) |
48 if( !impl->adaptCtx ) |
49 { |
49 { |
50 DEBUG_ERR("Adaptation not ready!!"); |
50 DEBUG_ERR("Adaptation not ready!!"); |
51 DEBUG_ERR("XA_RESULT_INTERNAL_ERROR"); |
51 DEBUG_ERR("XA_RESULT_INTERNAL_ERROR"); |
52 DEBUG_API("<-XADynamicSourceItfImpl_SetSource"); |
52 DEBUG_API("<-XADynamicSourceItfImpl_SetSource"); |
55 else |
55 else |
56 { |
56 { |
57 res = XACommon_CheckDataSource(pDataSource,NULL); |
57 res = XACommon_CheckDataSource(pDataSource,NULL); |
58 if(res==XA_RESULT_SUCCESS) |
58 if(res==XA_RESULT_SUCCESS) |
59 { |
59 { |
60 res = XADynamicSourceItfAdapt_SetSource(impl->adaptCtx, pDataSource ); |
60 if(impl->adaptCtx->fwtype == FWMgrFWGST) |
|
61 { |
|
62 res = XADynamicSourceItfAdapt_SetSource((XAAdaptationGstCtx*)impl->adaptCtx, pDataSource ); |
|
63 } |
|
64 else |
|
65 { |
|
66 res = XADynamicSourceItfAdaptMMF_SetSource((XAAdaptationMMFCtx*)impl->adaptCtx, pDataSource ); |
|
67 } |
61 } |
68 } |
62 } |
69 } |
63 #endif |
70 |
64 DEBUG_API("<-XADynamicSourceItfImpl_SetSource"); |
71 DEBUG_API("<-XADynamicSourceItfImpl_SetSource"); |
65 return res; |
72 return res; |
66 } |
73 } |
67 |
74 |
68 /***************************************************************************** |
75 /***************************************************************************** |
69 * XADynamicSourceItfImpl -specific methods |
76 * XADynamicSourceItfImpl -specific methods |
70 *****************************************************************************/ |
77 *****************************************************************************/ |
71 #ifdef _GSTREAMER_BACKEND_ |
|
72 |
78 |
73 /* XADynamicSourceItfImpl* XADynamicSourceItfImpl_Create() |
79 /* XADynamicSourceItfImpl* XADynamicSourceItfImpl_Create() |
74 * Description: Allocate and initialize DynamicSourceItfImpl |
80 * Description: Allocate and initialize DynamicSourceItfImpl |
75 */ |
81 */ |
76 XADynamicSourceItfImpl* XADynamicSourceItfImpl_Create( XAAdaptationBaseCtx *adaptCtx ) |
82 XADynamicSourceItfImpl* XADynamicSourceItfImpl_Create( XAAdaptationBaseCtx *adaptCtx ) |
77 { |
83 { |
78 XADynamicSourceItfImpl* self = (XADynamicSourceItfImpl*) |
84 XADynamicSourceItfImpl* self = (XADynamicSourceItfImpl*) |
79 calloc(1,sizeof(XADynamicSourceItfImpl)); |
85 calloc(1,sizeof(XADynamicSourceItfImpl)); |
|
86 |
80 DEBUG_API("->XADynamicSourceItfImpl_Create"); |
87 DEBUG_API("->XADynamicSourceItfImpl_Create"); |
81 if( self ) |
88 if( self ) |
82 { |
89 { |
83 /* init itf default implementation */ |
90 /* init itf default implementation */ |
84 self->itf.SetSource = XADynamicSourceItfImpl_SetSource; |
91 self->itf.SetSource = XADynamicSourceItfImpl_SetSource; |