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 "xaplaybackrateitf.h" |
21 #include "xaplaybackrateitf.h" |
22 |
22 |
23 #include "xaplaybackrateitfadaptation.h" |
|
24 #include "xaplaybackrateitfadaptationmmf.h" |
23 #include "xaplaybackrateitfadaptationmmf.h" |
25 |
24 |
26 #include "xathreadsafety.h" |
25 #include "xathreadsafety.h" |
27 |
26 |
28 static XAPlaybackRateItfImpl* GetImpl(XAPlaybackRateItf self) |
27 static XAPlaybackRateItfImpl* GetImpl(XAPlaybackRateItf self) |
55 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
54 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
56 DEBUG_API("<-XAPlaybackRateItfImpl_SetRate"); |
55 DEBUG_API("<-XAPlaybackRateItfImpl_SetRate"); |
57 return XA_RESULT_PARAMETER_INVALID; |
56 return XA_RESULT_PARAMETER_INVALID; |
58 } |
57 } |
59 |
58 |
60 if(impl->adaptCtx->fwtype == FWMgrFWGST) |
59 if(impl->adaptCtx->fwtype == FWMgrFWMMF) |
61 { |
|
62 res = XAPlaybackRateItfAdapt_SetRate((XAAdaptationGstCtx*)impl->adaptCtx, rate); |
|
63 } |
|
64 else if(impl->adaptCtx->fwtype == FWMgrFWMMF) |
|
65 { |
60 { |
66 res = XAPlaybackRateItfAdaptMMF_SetRate((XAAdaptationMMFCtx*)impl->adaptCtx, rate); |
61 res = XAPlaybackRateItfAdaptMMF_SetRate((XAAdaptationMMFCtx*)impl->adaptCtx, rate); |
67 } |
62 } |
68 else |
63 else |
69 { |
64 { |
91 { |
86 { |
92 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
87 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
93 DEBUG_API("<-XAPlaybackRateItfImpl_GetRate"); |
88 DEBUG_API("<-XAPlaybackRateItfImpl_GetRate"); |
94 return XA_RESULT_PARAMETER_INVALID; |
89 return XA_RESULT_PARAMETER_INVALID; |
95 } |
90 } |
96 if(impl->adaptCtx->fwtype == FWMgrFWGST) |
91 |
97 { |
92 if(impl->adaptCtx->fwtype == FWMgrFWMMF) |
98 *pRate = impl->currentRate; |
|
99 } |
|
100 else if(impl->adaptCtx->fwtype == FWMgrFWMMF) |
|
101 { |
93 { |
102 *pRate = impl->currentRate; |
94 *pRate = impl->currentRate; |
103 } |
95 } |
104 else |
96 else |
105 { |
97 { |
125 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
117 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
126 DEBUG_API("<-XAPlaybackRateItfImpl_SetPropertyConstraints"); |
118 DEBUG_API("<-XAPlaybackRateItfImpl_SetPropertyConstraints"); |
127 return XA_RESULT_PARAMETER_INVALID; |
119 return XA_RESULT_PARAMETER_INVALID; |
128 } |
120 } |
129 |
121 |
130 if(impl->adaptCtx->fwtype == FWMgrFWGST) |
122 if(impl->adaptCtx->fwtype == FWMgrFWMMF) |
131 { |
|
132 /* set to adaptation */ |
|
133 res = XAPlaybackRateItfAdapt_SetPropertyConstraints((XAAdaptationGstCtx*)impl->adaptCtx, constraints); |
|
134 } |
|
135 else if(impl->adaptCtx->fwtype == FWMgrFWMMF) |
|
136 { |
123 { |
137 /* set to adaptation */ |
124 /* set to adaptation */ |
138 res = XAPlaybackRateItfAdaptMMF_SetPropertyConstraints((XAAdaptationMMFCtx*)impl->adaptCtx, constraints); |
125 res = XAPlaybackRateItfAdaptMMF_SetPropertyConstraints((XAAdaptationMMFCtx*)impl->adaptCtx, constraints); |
139 } |
126 } |
140 else |
127 else |
160 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
147 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
161 DEBUG_API("<-XAPlaybackRateItfImpl_GetProperties"); |
148 DEBUG_API("<-XAPlaybackRateItfImpl_GetProperties"); |
162 return XA_RESULT_PARAMETER_INVALID; |
149 return XA_RESULT_PARAMETER_INVALID; |
163 } |
150 } |
164 |
151 |
165 if(impl->adaptCtx->fwtype == FWMgrFWGST) |
152 if(impl->adaptCtx->fwtype == FWMgrFWMMF) |
166 { |
|
167 /* needs to be queried from adaptation */ |
|
168 res = XAPlaybackRateItfAdapt_GetProperties((XAAdaptationGstCtx*)impl->adaptCtx, pProperties); |
|
169 } |
|
170 else if(impl->adaptCtx->fwtype == FWMgrFWMMF) |
|
171 { |
153 { |
172 /* needs to be queried from adaptation */ |
154 /* needs to be queried from adaptation */ |
173 res = XAPlaybackRateItfAdaptMMF_GetProperties((XAAdaptationMMFCtx*)impl->adaptCtx, pProperties); |
155 res = XAPlaybackRateItfAdaptMMF_GetProperties((XAAdaptationMMFCtx*)impl->adaptCtx, pProperties); |
174 } |
156 } |
175 else |
157 else |
198 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
180 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
199 DEBUG_API("<-XAPlaybackRateItfImpl_GetCapabilitiesOfRate"); |
181 DEBUG_API("<-XAPlaybackRateItfImpl_GetCapabilitiesOfRate"); |
200 return XA_RESULT_PARAMETER_INVALID; |
182 return XA_RESULT_PARAMETER_INVALID; |
201 } |
183 } |
202 |
184 |
203 if(impl->adaptCtx->fwtype == FWMgrFWGST) |
185 if(impl->adaptCtx->fwtype == FWMgrFWMMF) |
204 { |
|
205 /* needs to be queried from adaptation */ |
|
206 res = XAPlaybackRateItfAdapt_GetCapabilitiesOfRate((XAAdaptationGstCtx*)impl->adaptCtx, rate, pCapabilities); |
|
207 } |
|
208 else if(impl->adaptCtx->fwtype == FWMgrFWMMF) |
|
209 { |
186 { |
210 /* needs to be queried from adaptation */ |
187 /* needs to be queried from adaptation */ |
211 res = XAPlaybackRateItfAdaptMMF_GetCapabilitiesOfRate((XAAdaptationMMFCtx*)impl->adaptCtx, rate, pCapabilities); |
188 res = XAPlaybackRateItfAdaptMMF_GetCapabilitiesOfRate((XAAdaptationMMFCtx*)impl->adaptCtx, rate, pCapabilities); |
212 } |
189 } |
213 else |
190 else |
238 XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer ); |
215 XA_IMPL_THREAD_SAFETY_EXIT( XATSMediaPlayer ); |
239 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
216 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
240 DEBUG_API("<-XAPlaybackRateItfImpl_GetRateRange"); |
217 DEBUG_API("<-XAPlaybackRateItfImpl_GetRateRange"); |
241 return XA_RESULT_PARAMETER_INVALID; |
218 return XA_RESULT_PARAMETER_INVALID; |
242 } |
219 } |
243 if(impl->adaptCtx->fwtype == FWMgrFWGST) |
220 |
244 { |
221 if(impl->adaptCtx->fwtype == FWMgrFWMMF) |
245 /* needs to be queried from adaptation */ |
|
246 res = XAPlaybackRateItfAdapt_GetRateRange((XAAdaptationGstCtx*)impl->adaptCtx, index, pMinRate, |
|
247 pMaxRate,pStepSize, pCapabilities); |
|
248 } |
|
249 else if(impl->adaptCtx->fwtype == FWMgrFWMMF) |
|
250 { |
222 { |
251 /* needs to be queried from adaptation */ |
223 /* needs to be queried from adaptation */ |
252 res = XAPlaybackRateItfAdaptMMF_GetRateRange((XAAdaptationMMFCtx*)impl->adaptCtx, index, pMinRate, |
224 res = XAPlaybackRateItfAdaptMMF_GetRateRange((XAAdaptationMMFCtx*)impl->adaptCtx, index, pMinRate, |
253 pMaxRate,pStepSize, pCapabilities); |
225 pMaxRate,pStepSize, pCapabilities); |
254 } |
226 } |