khronosfws/openmax_al/src/engine/xacameracapabilitiesitf.c
changeset 16 43d09473c595
parent 12 5a06f39ad45b
equal deleted inserted replaced
14:80975da52420 16:43d09473c595
    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 "xaglobals.h"
    21 #include "xaglobals.h"
    22 #include "xacameracapabilitiesitf.h"
    22 #include "xacameracapabilitiesitf.h"
    23 #ifdef _GSTREAMER_BACKEND_  
    23   
    24 #include "XAStaticCapsAdaptation.h"
    24 
    25 #include "XAStaticCameraCapsAdaptation.h"
    25 #include "xastaticcameracapsadaptation.h"
    26 #endif
    26 
    27 
    27 
    28 static XACameraCapabilitiesItfImpl* GetImpl(XACameraCapabilitiesItf self)
    28 static XACameraCapabilitiesItfImpl* GetImpl(XACameraCapabilitiesItf self)
    29 {
    29 {
    30     if( self )
    30     if( self )
    31     {
    31     {
    55     {
    55     {
    56         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
    56         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
    57         DEBUG_API("<-XACameraCapabilitiesItfImpl_GetCameraCapabilities");
    57         DEBUG_API("<-XACameraCapabilitiesItfImpl_GetCameraCapabilities");
    58         return XA_RESULT_PARAMETER_INVALID;
    58         return XA_RESULT_PARAMETER_INVALID;
    59     }
    59     }
    60 #ifdef _GSTREAMER_BACKEND_  
    60   
    61     ret = XAStaticCameraCaps_GetCameraCapabilities(pIndex,pCameraDeviceID,pDescriptor);
    61     ret = XAStaticCameraCaps_GetCameraCapabilities(pIndex,pCameraDeviceID,pDescriptor);
    62 #endif
    62 
    63     DEBUG_API("<-XACameraCapabilitiesItfImpl_GetCameraCapabilities");
    63     DEBUG_API("<-XACameraCapabilitiesItfImpl_GetCameraCapabilities");
    64     return ret;
    64     return ret;
    65 }
    65 }
    66 
    66 
    67 
    67 
    81     {
    81     {
    82         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
    82         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
    83         DEBUG_API("<-XACameraCapabilitiesItfImpl_QueryFocusRegionPatterns");
    83         DEBUG_API("<-XACameraCapabilitiesItfImpl_QueryFocusRegionPatterns");
    84         return XA_RESULT_PARAMETER_INVALID;
    84         return XA_RESULT_PARAMETER_INVALID;
    85     }
    85     }
    86 #ifdef _GSTREAMER_BACKEND_  
    86   
    87     ret = XAStaticCameraCaps_QueryFocusRegionPatterns(
    87     ret = XAStaticCameraCaps_QueryFocusRegionPatterns(
    88             cameraDeviceID, pPatternID, pFocusPattern,pCustomPoints1,pCustomPoints2);
    88             cameraDeviceID, pPatternID, pFocusPattern,pCustomPoints1,pCustomPoints2);
    89 #endif
    89 
    90     DEBUG_API("<-XACameraCapabilitiesItfImpl_QueryFocusRegionPatterns");
    90     DEBUG_API("<-XACameraCapabilitiesItfImpl_QueryFocusRegionPatterns");
    91     return ret;
    91     return ret;
    92 }
    92 }
    93 
    93 
    94 
    94 
   106     {
   106     {
   107         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   107         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   108         DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedAutoLocks");
   108         DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedAutoLocks");
   109         return XA_RESULT_PARAMETER_INVALID;
   109         return XA_RESULT_PARAMETER_INVALID;
   110     }
   110     }
   111 #ifdef _GSTREAMER_BACKEND_  
   111   
   112     ret = XAStaticCameraCaps_GetSupportedAutoLocks(
   112     ret = XAStaticCameraCaps_GetSupportedAutoLocks(
   113                 cameraDeviceID, pNumCombinations, ppLocks);
   113                 cameraDeviceID, pNumCombinations, ppLocks);
   114 #endif
   114 
   115     DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedAutoLocks");
   115     DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedAutoLocks");
   116     return ret;
   116     return ret;
   117 }
   117 }
   118 
   118 
   119 
   119 
   134     {
   134     {
   135         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   135         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   136         DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedFocusManualSettings");
   136         DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedFocusManualSettings");
   137         return XA_RESULT_PARAMETER_INVALID;
   137         return XA_RESULT_PARAMETER_INVALID;
   138     }
   138     }
   139 #ifdef _GSTREAMER_BACKEND_  
   139   
   140     ret = XAStaticCameraCaps_GetSupportedFocusManualSettings(
   140     ret = XAStaticCameraCaps_GetSupportedFocusManualSettings(
   141             cameraDeviceID, macroEnabled,pMinValue, pMaxValue, pNumSettings, ppSettings);
   141             cameraDeviceID, macroEnabled,pMinValue, pMaxValue, pNumSettings, ppSettings);
   142 #endif
   142 
   143     DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedFocusManualSettings");
   143     DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedFocusManualSettings");
   144     return ret;
   144     return ret;
   145 }
   145 }
   146 
   146 
   147 
   147 
   161     {
   161     {
   162         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   162         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   163         DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedISOSensitivitySettings");
   163         DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedISOSensitivitySettings");
   164         return XA_RESULT_PARAMETER_INVALID;
   164         return XA_RESULT_PARAMETER_INVALID;
   165     }
   165     }
   166 #ifdef _GSTREAMER_BACKEND_  
   166   
   167     ret = XAStaticCameraCaps_GetSupportedISOSensitivitySettings(
   167     ret = XAStaticCameraCaps_GetSupportedISOSensitivitySettings(
   168                 cameraDeviceID, pMinValue, pMaxValue, pNumSettings, ppSettings );
   168                 cameraDeviceID, pMinValue, pMaxValue, pNumSettings, ppSettings );
   169 #endif
   169 
   170     DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedISOSensitivitySettings");
   170     DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedISOSensitivitySettings");
   171     return ret;
   171     return ret;
   172 }
   172 }
   173 
   173 
   174 
   174 
   188     {
   188     {
   189         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   189         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   190         DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedApertureManualSettings");
   190         DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedApertureManualSettings");
   191         return XA_RESULT_PARAMETER_INVALID;
   191         return XA_RESULT_PARAMETER_INVALID;
   192     }
   192     }
   193 #ifdef _GSTREAMER_BACKEND_  
   193   
   194     ret = XAStaticCameraCaps_GetSupportedApertureManualSettings(
   194     ret = XAStaticCameraCaps_GetSupportedApertureManualSettings(
   195                 cameraDeviceID, pMinValue, pMaxValue, pNumSettings, ppSettings );
   195                 cameraDeviceID, pMinValue, pMaxValue, pNumSettings, ppSettings );
   196 #endif
   196 
   197     DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedApertureManualSettings");
   197     DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedApertureManualSettings");
   198     return ret;
   198     return ret;
   199 }
   199 }
   200 
   200 
   201 
   201 
   215     {
   215     {
   216         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   216         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   217         DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedShutterSpeedManualSettings");
   217         DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedShutterSpeedManualSettings");
   218         return XA_RESULT_PARAMETER_INVALID;
   218         return XA_RESULT_PARAMETER_INVALID;
   219     }
   219     }
   220 #ifdef _GSTREAMER_BACKEND_  
   220   
   221     ret = XAStaticCameraCaps_GetSupportedShutterSpeedManualSettings(
   221     ret = XAStaticCameraCaps_GetSupportedShutterSpeedManualSettings(
   222                 cameraDeviceID, pMinValue, pMaxValue, pNumSettings, ppSettings);
   222                 cameraDeviceID, pMinValue, pMaxValue, pNumSettings, ppSettings);
   223 #endif
   223 
   224     DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedShutterSpeedManualSettings");
   224     DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedShutterSpeedManualSettings");
   225     return ret;
   225     return ret;
   226 }
   226 }
   227 
   227 
   228 
   228 
   242     {
   242     {
   243         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   243         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   244         DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedWhiteBalanceManualSettings");
   244         DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedWhiteBalanceManualSettings");
   245         return XA_RESULT_PARAMETER_INVALID;
   245         return XA_RESULT_PARAMETER_INVALID;
   246     }
   246     }
   247 #ifdef _GSTREAMER_BACKEND_  
   247   
   248     ret = XAStaticCameraCaps_GetSupportedWhiteBalanceManualSettings(
   248     ret = XAStaticCameraCaps_GetSupportedWhiteBalanceManualSettings(
   249                 cameraDeviceID, pMinValue, pMaxValue, pNumSettings, ppSettings);
   249                 cameraDeviceID, pMinValue, pMaxValue, pNumSettings, ppSettings);
   250 #endif
   250 
   251     DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedWhiteBalanceManualSettings");
   251     DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedWhiteBalanceManualSettings");
   252     return ret;
   252     return ret;
   253 }
   253 }
   254 
   254 
   255 
   255 
   271     {
   271     {
   272         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   272         DEBUG_ERR("XA_RESULT_PARAMETER_INVALID");
   273         DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedZoomSettings");
   273         DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedZoomSettings");
   274         return XA_RESULT_PARAMETER_INVALID;
   274         return XA_RESULT_PARAMETER_INVALID;
   275     }
   275     }
   276 #ifdef _GSTREAMER_BACKEND_  
   276   
   277     ret = XAStaticCameraCaps_GetSupportedZoomSettings(
   277     ret = XAStaticCameraCaps_GetSupportedZoomSettings(
   278                 cameraDeviceID, digitalEnabled, macroEnabled, pMaxValue,
   278                 cameraDeviceID, digitalEnabled, macroEnabled, pMaxValue,
   279                 pNumSettings, ppSettings, pSpeedSupported);
   279                 pNumSettings, ppSettings, pSpeedSupported);
   280 #endif
   280 
   281     DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedZoomSettings");
   281     DEBUG_API("<-XACameraCapabilitiesItfImpl_GetSupportedZoomSettings");
   282     return ret;
   282     return ret;
   283 }
   283 }
   284 
   284 
   285 #ifdef _GSTREAMER_BACKEND_  
   285   
   286 /**
   286 /**
   287  * XACameraCapabilitiesItfImpl -specific methods
   287  * XACameraCapabilitiesItfImpl -specific methods
   288  **/
   288  **/
   289 XACameraCapabilitiesItfImpl* XACameraCapabilitiesItfImpl_Create()
   289 XACameraCapabilitiesItfImpl* XACameraCapabilitiesItfImpl_Create(void)
   290 {
   290 {
   291     XACameraCapabilitiesItfImpl* self = (XACameraCapabilitiesItfImpl*)
   291     XACameraCapabilitiesItfImpl* self = (XACameraCapabilitiesItfImpl*)
   292         calloc(1,sizeof(XACameraCapabilitiesItfImpl));
   292         calloc(1,sizeof(XACameraCapabilitiesItfImpl));
   293     DEBUG_API("->XACameraCapabilitiesItfImpl_Create");
   293     DEBUG_API("->XACameraCapabilitiesItfImpl_Create");
   294 
   294 
   325     DEBUG_API("->XACameraCapabilitiesItfImpl_Free");
   325     DEBUG_API("->XACameraCapabilitiesItfImpl_Free");
   326     assert(self==self->self);
   326     assert(self==self->self);
   327     free(self);
   327     free(self);
   328     DEBUG_API("<-XACameraCapabilitiesItfImpl_Free");
   328     DEBUG_API("<-XACameraCapabilitiesItfImpl_Free");
   329 }
   329 }
   330 #endif
   330