From: backto.kim Date: Mon, 6 Sep 2021 07:43:01 +0000 (+0900) Subject: move webrtc_file_source_set_path() to internal X-Git-Tag: submit/tizen/20210907.040339^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=527edbb0b4c4c1ef4295d25f81cb627543da8fcd;p=platform%2Fcore%2Fapi%2Fwebrtc.git move webrtc_file_source_set_path() to internal [Version] 0.2.94 [Issue Type] API Change-Id: I8913184b8ab51d85f70fdcfda0aec0dc585645d8 --- diff --git a/include/webrtc.h b/include/webrtc.h index f07aae62..22398ed2 100644 --- a/include/webrtc.h +++ b/include/webrtc.h @@ -1046,25 +1046,6 @@ int webrtc_media_packet_source_set_format(webrtc_h webrtc, unsigned int source_i */ int webrtc_media_packet_source_push_packet(webrtc_h webrtc, unsigned int source_id, media_packet_h packet); -/** - * @brief Sets media path to the file source. - * @since_tizen 6.5 - * @remarks %http://tizen.org/privilege/mediastorage is needed if path is relevant to internal media storage.\n - * %http://tizen.org/privilege/externalstorage is needed if path is relevant to external media storage. - * @param[in] webrtc WebRTC handle - * @param[in] source_id The file source id - * @param[in] path The media path - * @return @c 0 on success, - * otherwise a negative error value - * @retval #WEBRTC_ERROR_NONE Successful - * @retval #WEBRTC_ERROR_PERMISSION_DENIED Permission denied - * @retval #WEBRTC_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #WEBRTC_ERROR_INVALID_STATE Invalid state - * @pre Add file source to @a webrtc to get @a source_id by calling webrtc_add_media_source(). - * @pre @a webrtc state must be set to #WEBRTC_STATE_IDLE. - */ -int webrtc_file_source_set_path(webrtc_h webrtc, unsigned int source_id, const char *path); - /** * @} */ diff --git a/include/webrtc_internal.h b/include/webrtc_internal.h index 0eddfbf6..60e78262 100644 --- a/include/webrtc_internal.h +++ b/include/webrtc_internal.h @@ -152,6 +152,26 @@ int webrtc_media_source_set_video_loopback_to_ecore_wl(webrtc_h webrtc, unsigned */ int webrtc_add_media_source_internal(webrtc_h webrtc, webrtc_media_source_type_internal_e type, unsigned int *source_id); +/** + * @internal + * @brief Sets media path to the file source. + * @since_tizen 6.5 + * @remarks %http://tizen.org/privilege/mediastorage is needed if path is relevant to internal media storage.\n + * %http://tizen.org/privilege/externalstorage is needed if path is relevant to external media storage. + * @param[in] webrtc WebRTC handle + * @param[in] source_id The file source id + * @param[in] path The media path + * @return @c 0 on success, + * otherwise a negative error value + * @retval #WEBRTC_ERROR_NONE Successful + * @retval #WEBRTC_ERROR_PERMISSION_DENIED Permission denied + * @retval #WEBRTC_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #WEBRTC_ERROR_INVALID_STATE Invalid state + * @pre Add file source to @a webrtc to get @a source_id by calling webrtc_add_media_source(). + * @pre @a webrtc state must be set to #WEBRTC_STATE_IDLE. + */ +int webrtc_file_source_set_path(webrtc_h webrtc, unsigned int source_id, const char *path); + /** * @internal * @brief Creates a signaling server for private network. diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index a99c55c9..bf25b1c6 100644 --- a/packaging/capi-media-webrtc.spec +++ b/packaging/capi-media-webrtc.spec @@ -1,6 +1,6 @@ Name: capi-media-webrtc Summary: A WebRTC library in Tizen Native API -Version: 0.2.93 +Version: 0.2.94 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/webrtc.c b/src/webrtc.c index c0123e64..17858efd 100644 --- a/src/webrtc.c +++ b/src/webrtc.c @@ -587,25 +587,6 @@ int webrtc_media_packet_source_push_packet(webrtc_h webrtc, unsigned int source_ return ret; } -int webrtc_file_source_set_path(webrtc_h webrtc, unsigned int source_id, const char *path) -{ - int ret = WEBRTC_ERROR_NONE; - g_autoptr(GMutexLocker) locker = NULL; - webrtc_s *_webrtc = (webrtc_s*)webrtc; - - RET_VAL_IF(_webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL"); - RET_VAL_IF(source_id == 0, WEBRTC_ERROR_INVALID_PARAMETER, "source_id is 0"); - RET_VAL_IF(path == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "path is NULL"); - - locker = g_mutex_locker_new(&_webrtc->mutex); - - RET_VAL_IF(_webrtc->state != WEBRTC_STATE_IDLE, WEBRTC_ERROR_INVALID_STATE, "the state should be IDLE"); - - ret = _set_media_path(_webrtc, source_id, path); - - return ret; -} - int webrtc_set_sound_stream_info(webrtc_h webrtc, unsigned int track_id, sound_stream_info_h stream_info) { int ret = WEBRTC_ERROR_NONE; diff --git a/src/webrtc_internal.c b/src/webrtc_internal.c index 95fc1e67..8ec24779 100644 --- a/src/webrtc_internal.c +++ b/src/webrtc_internal.c @@ -76,4 +76,20 @@ int webrtc_add_media_source_internal(webrtc_h webrtc, webrtc_media_source_type_i LOG_INFO("source_id[%u]", *source_id); return ret; +} + +int webrtc_file_source_set_path(webrtc_h webrtc, unsigned int source_id, const char *path) +{ + g_autoptr(GMutexLocker) locker = NULL; + webrtc_s *_webrtc = (webrtc_s*)webrtc; + + RET_VAL_IF(_webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL"); + RET_VAL_IF(source_id == 0, WEBRTC_ERROR_INVALID_PARAMETER, "source_id is 0"); + RET_VAL_IF(path == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "path is NULL"); + + locker = g_mutex_locker_new(&_webrtc->mutex); + + RET_VAL_IF(_webrtc->state != WEBRTC_STATE_IDLE, WEBRTC_ERROR_INVALID_STATE, "the state should be IDLE"); + + return _set_media_path(_webrtc, source_id, path); } \ No newline at end of file