* @return @c 0 on success,
* otherwise a negative error value
* @retval #WEBRTC_ERROR_NONE Successful
+ * @retval #WEBRTC_ERROR_NOT_SUPPORTED Not supported
* @retval #WEBRTC_ERROR_PERMISSION_DENIED Permission denied
* @retval #WEBRTC_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #WEBRTC_ERROR_INVALID_OPERATION Invalid operation
#include "webrtc.h"
#include "webrtc_private.h"
+#define _WEBRTC_FEATURE_CAMERA "http://tizen.org/feature/camera"
+#define _WEBRTC_FEATURE_MICROPHONE "http://tizen.org/feature/microphone"
#define _WEBRTC_PRIVILEGE_INTERNET "http://tizen.org/privilege/internet"
#define _WEBRTC_PRIVILEGE_CAMERA "http://tizen.org/privilege/camera"
#define _WEBRTC_PRIVILEGE_RECORDER "http://tizen.org/privilege/recorder"
int ret = WEBRTC_ERROR_NONE;
webrtc_s *_webrtc = (webrtc_s*)webrtc;
- RET_VAL_IF(_webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
- RET_VAL_IF(source_id == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source_id is NULL");
-
- if (type == WEBRTC_MEDIA_SOURCE_TYPE_CAMERA)
+ if (type == WEBRTC_MEDIA_SOURCE_TYPE_CAMERA) {
+ RET_ERR_IF_FEATURE_IS_NOT_SUPPORTED(_WEBRTC_FEATURE_CAMERA);
RET_ERR_IF_PRIVILEGE_IS_NOT_ALLOWED(_WEBRTC_PRIVILEGE_CAMERA);
- else if (type == WEBRTC_MEDIA_SOURCE_TYPE_MIC)
+ } else if (type == WEBRTC_MEDIA_SOURCE_TYPE_MIC) {
+ RET_ERR_IF_FEATURE_IS_NOT_SUPPORTED(_WEBRTC_FEATURE_MICROPHONE);
RET_ERR_IF_PRIVILEGE_IS_NOT_ALLOWED(_WEBRTC_PRIVILEGE_RECORDER);
+ }
+
+ RET_VAL_IF(_webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
+ RET_VAL_IF(source_id == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source_id is NULL");
g_mutex_lock(&_webrtc->mutex);