63 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
63 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
64 DEBUG_API("<-XADeviceVolumeItfImpl_GetVolumeScale"); |
64 DEBUG_API("<-XADeviceVolumeItfImpl_GetVolumeScale"); |
65 return XA_RESULT_PARAMETER_INVALID; |
65 return XA_RESULT_PARAMETER_INVALID; |
66 } |
66 } |
67 |
67 |
68 #ifdef _GSTREAMER_BACKEND_ |
68 |
69 ret = XADeviceVolumeItfAdapt_IsDeviceIDSupported(impl->adapCtx, deviceID, &supported); |
69 ret = XADeviceVolumeItfAdapt_IsDeviceIDSupported((XAAdaptationGstCtx*)impl->adapCtx, deviceID, &supported); |
70 #endif |
70 |
71 if( ret != XA_RESULT_SUCCESS || supported != XA_BOOLEAN_TRUE ) |
71 if( ret != XA_RESULT_SUCCESS || supported != XA_BOOLEAN_TRUE ) |
72 { |
72 { |
73 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
73 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
74 DEBUG_API("<-XADeviceVolumeItfImpl_GetVolumeScale"); |
74 DEBUG_API("<-XADeviceVolumeItfImpl_GetVolumeScale"); |
75 return XA_RESULT_PARAMETER_INVALID; |
75 return XA_RESULT_PARAMETER_INVALID; |
92 XAuint32 deviceID, |
92 XAuint32 deviceID, |
93 XAint32 volume) |
93 XAint32 volume) |
94 { |
94 { |
95 XADeviceVolumeItfImpl* impl = GetImpl(self); |
95 XADeviceVolumeItfImpl* impl = GetImpl(self); |
96 XAresult ret = XA_RESULT_SUCCESS; |
96 XAresult ret = XA_RESULT_SUCCESS; |
97 #ifdef _GSTREAMER_BACKEND_ |
97 |
98 XAboolean supported = XA_BOOLEAN_FALSE; |
98 XAboolean supported = XA_BOOLEAN_FALSE; |
99 #endif |
99 |
100 DEBUG_API("->XADeviceVolumeItfImpl_SetVolume"); |
100 DEBUG_API("->XADeviceVolumeItfImpl_SetVolume"); |
101 |
101 |
102 if( !impl || volume < impl->minVolume || volume > impl->maxVolume ) |
102 if( !impl || volume < impl->minVolume || volume > impl->maxVolume ) |
103 { |
103 { |
104 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
104 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
105 DEBUG_API("<-XADeviceVolumeItfImpl_SetVolume"); |
105 DEBUG_API("<-XADeviceVolumeItfImpl_SetVolume"); |
106 return XA_RESULT_PARAMETER_INVALID; |
106 return XA_RESULT_PARAMETER_INVALID; |
107 } |
107 } |
108 |
108 |
109 #ifdef _GSTREAMER_BACKEND_ |
109 |
110 ret = XADeviceVolumeItfAdapt_IsDeviceIDSupported(impl->adapCtx, deviceID, &supported); |
110 ret = XADeviceVolumeItfAdapt_IsDeviceIDSupported((XAAdaptationGstCtx*)impl->adapCtx, deviceID, &supported); |
111 if( ret != XA_RESULT_SUCCESS || supported != XA_BOOLEAN_TRUE ) |
111 if( ret != XA_RESULT_SUCCESS || supported != XA_BOOLEAN_TRUE ) |
112 { |
112 { |
113 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
113 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
114 DEBUG_API("<-XADeviceVolumeItfImpl_SetVolume"); |
114 DEBUG_API("<-XADeviceVolumeItfImpl_SetVolume"); |
115 return XA_RESULT_PARAMETER_INVALID; |
115 return XA_RESULT_PARAMETER_INVALID; |
116 } |
116 } |
117 |
117 |
118 ret = XADeviceVolumeItfAdapt_SetVolume(impl->adapCtx, deviceID, volume); |
118 ret = XADeviceVolumeItfAdapt_SetVolume((XAAdaptationGstCtx*)impl->adapCtx, deviceID, volume); |
119 |
119 |
120 if( ret == XA_RESULT_SUCCESS ) |
120 if( ret == XA_RESULT_SUCCESS ) |
121 { |
121 { |
122 impl->curVolume = volume; |
122 impl->curVolume = volume; |
123 } |
123 } |
124 #endif |
124 |
125 DEBUG_API("<-XADeviceVolumeItfImpl_SetVolume"); |
125 DEBUG_API("<-XADeviceVolumeItfImpl_SetVolume"); |
126 return ret; |
126 return ret; |
127 } |
127 } |
128 |
128 |
129 /* XAresult XADeviceVolumeItfImpl_GetVolume( XADeviceVolumeItf self, |
129 /* XAresult XADeviceVolumeItfImpl_GetVolume( XADeviceVolumeItf self, |
145 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
145 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
146 DEBUG_API("<-XADeviceVolumeItfImpl_GetVolume"); |
146 DEBUG_API("<-XADeviceVolumeItfImpl_GetVolume"); |
147 return XA_RESULT_PARAMETER_INVALID; |
147 return XA_RESULT_PARAMETER_INVALID; |
148 } |
148 } |
149 |
149 |
150 #ifdef _GSTREAMER_BACKEND_ |
150 |
151 ret = XADeviceVolumeItfAdapt_IsDeviceIDSupported(impl->adapCtx, deviceID, &supported); |
151 ret = XADeviceVolumeItfAdapt_IsDeviceIDSupported((XAAdaptationGstCtx*)impl->adapCtx, deviceID, &supported); |
152 #endif |
152 |
153 if( ret != XA_RESULT_SUCCESS || supported != XA_BOOLEAN_TRUE ) |
153 if( ret != XA_RESULT_SUCCESS || supported != XA_BOOLEAN_TRUE ) |
154 { |
154 { |
155 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
155 DEBUG_ERR("XA_RESULT_PARAMETER_INVALID"); |
156 DEBUG_API("<-XADeviceVolumeItfImpl_GetVolume"); |
156 DEBUG_API("<-XADeviceVolumeItfImpl_GetVolume"); |
157 return XA_RESULT_PARAMETER_INVALID; |
157 return XA_RESULT_PARAMETER_INVALID; |
162 } |
162 } |
163 |
163 |
164 /** |
164 /** |
165 * XADeviceVolumeItfImpl -specific methods |
165 * XADeviceVolumeItfImpl -specific methods |
166 **/ |
166 **/ |
167 #ifdef _GSTREAMER_BACKEND_ |
167 |
168 /** |
168 /** |
169 * XADeviceVolumeItfImpl* XADeviceVolumeItfImpl_Create(XAAdaptationBaseCtx *adapCtx) |
169 * XADeviceVolumeItfImpl* XADeviceVolumeItfImpl_Create(XAAdaptationBaseCtx *adapCtx) |
170 * Description: Allocate and initialize DeviceVolumeImpl |
170 * Description: Allocate and initialize DeviceVolumeImpl |
171 **/ |
171 **/ |
172 XADeviceVolumeItfImpl* XADeviceVolumeItfImpl_Create(XAAdaptationBaseCtx *adapCtx) |
172 XADeviceVolumeItfImpl* XADeviceVolumeItfImpl_Create(XAAdaptationBaseCtx *adapCtx) |