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 |
22 |
23 #include "xadynamicsourceitfadaptation.h" |
|
24 #include "xadynamicsourceitfadaptationmmf.h" |
23 #include "xadynamicsourceitfadaptationmmf.h" |
25 |
24 |
26 /***************************************************************************** |
25 /***************************************************************************** |
27 * Base interface XADynamicSourceItf implementation |
26 * Base interface XADynamicSourceItf implementation |
28 *****************************************************************************/ |
27 *****************************************************************************/ |
37 XADynamicSourceItfImpl* impl = (XADynamicSourceItfImpl*) (*self); |
36 XADynamicSourceItfImpl* impl = (XADynamicSourceItfImpl*) (*self); |
38 DEBUG_API("->XADynamicSourceItfImpl_SetSource"); |
37 DEBUG_API("->XADynamicSourceItfImpl_SetSource"); |
39 /* check casting */ |
38 /* check casting */ |
40 if (!impl || impl != impl->self || !pDataSource) |
39 if (!impl || impl != impl->self || !pDataSource) |
41 { |
40 { |
42 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");DEBUG_API("<-XADynamicSourceItfImpl_SetSource"); |
41 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
|
42 DEBUG_API("<-XADynamicSourceItfImpl_SetSource"); |
43 return XA_RESULT_PARAMETER_INVALID; |
43 return XA_RESULT_PARAMETER_INVALID; |
44 } |
44 } |
45 |
45 |
46 if (!impl->adaptCtx) |
46 if (!impl->adaptCtx) |
47 { |
47 { |
48 DEBUG_ERR("Adaptation not ready!!");DEBUG_ERR("XA_RESULT_INTERNAL_ERROR");DEBUG_API("<-XADynamicSourceItfImpl_SetSource"); |
48 DEBUG_ERR("Adaptation not ready!!"); |
|
49 DEBUG_ERR("XA_RESULT_INTERNAL_ERROR"); |
|
50 DEBUG_API("<-XADynamicSourceItfImpl_SetSource"); |
49 res = XA_RESULT_INTERNAL_ERROR; |
51 res = XA_RESULT_INTERNAL_ERROR; |
50 } |
52 } |
51 else |
53 else |
52 { |
54 { |
53 res = XACommon_CheckDataSource(pDataSource, NULL); |
55 res = XACommon_CheckDataSource(pDataSource, NULL); |
54 if (res == XA_RESULT_SUCCESS) |
56 if (res == XA_RESULT_SUCCESS) |
55 { |
57 { |
56 if (impl->adaptCtx->fwtype == FWMgrFWGST) |
58 if (impl->adaptCtx->fwtype == FWMgrFWMMF) |
57 { |
|
58 res = XADynamicSourceItfAdapt_SetSource( |
|
59 (XAAdaptationGstCtx*) impl->adaptCtx, pDataSource); |
|
60 } |
|
61 else |
|
62 { |
59 { |
63 res = XADynamicSourceItfAdaptMMF_SetSource( |
60 res = XADynamicSourceItfAdaptMMF_SetSource( |
64 (XAAdaptationMMFCtx*) impl->adaptCtx, pDataSource); |
61 (XAAdaptationMMFCtx*) impl->adaptCtx, pDataSource); |
65 } |
62 } |
66 } |
63 } |
89 /* init itf default implementation */ |
86 /* init itf default implementation */ |
90 self->itf.SetSource = XADynamicSourceItfImpl_SetSource; |
87 self->itf.SetSource = XADynamicSourceItfImpl_SetSource; |
91 /* init variables */ |
88 /* init variables */ |
92 self->adaptCtx = adaptCtx; |
89 self->adaptCtx = adaptCtx; |
93 self->self = self; |
90 self->self = self; |
94 }DEBUG_API("<-XADynamicSourceItfImpl_Create"); |
91 } |
|
92 DEBUG_API("<-XADynamicSourceItfImpl_Create"); |
95 return self; |
93 return self; |
96 } |
94 } |
97 |
95 |
98 /* void XADynamicSourceItfImpl_Free(XADynamicSourceItfImpl* self) |
96 /* void XADynamicSourceItfImpl_Free(XADynamicSourceItfImpl* self) |
99 * Description: Free all resources reserved at XADynamicSourceItfImpl_Create |
97 * Description: Free all resources reserved at XADynamicSourceItfImpl_Create |