From 78889a37ee964adf8a85c28d9e6b90e4c61b942d Mon Sep 17 00:00:00 2001 From: Sangchul Lee Date: Tue, 8 Feb 2022 09:32:53 +0900 Subject: [PATCH] webrtc_sink/source: Add const keywords [Version] 0.2.160 [Issue Type] Improvement Change-Id: Icd1575632033d62f245b29d4a7a8528ef879a02e Signed-off-by: Sangchul Lee --- packaging/capi-media-webrtc.spec | 2 +- src/webrtc_sink.c | 8 ++++---- src/webrtc_source.c | 32 ++++++++++++++++---------------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index c12c349c..81459057 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.159 +Version: 0.2.160 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/webrtc_sink.c b/src/webrtc_sink.c index 71348767..1a8269a2 100644 --- a/src/webrtc_sink.c +++ b/src/webrtc_sink.c @@ -677,7 +677,7 @@ error: static int __media_packet_finalize_cb(media_packet_h packet, int error_code, void *user_data) { - webrtc_gst_slot_s *sink = (webrtc_gst_slot_s *)user_data; + const webrtc_gst_slot_s *sink = (webrtc_gst_slot_s *)user_data; GstBuffer *buffer = NULL; RET_VAL_IF(sink == NULL, MEDIA_PACKET_FINALIZE, "sink is NULL"); @@ -1033,7 +1033,7 @@ int _set_display_mode_to_sink(webrtc_s *webrtc, unsigned int track_id, webrtc_di int _get_display_mode_from_sink(webrtc_s *webrtc, unsigned int track_id, webrtc_display_mode_e *mode) { - webrtc_gst_slot_s *sink; + const webrtc_gst_slot_s *sink; RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL"); RET_VAL_IF(track_id == 0, WEBRTC_ERROR_INVALID_PARAMETER, "track id is 0"); @@ -1068,7 +1068,7 @@ int _set_display_visible_to_sink(webrtc_s *webrtc, unsigned int track_id, bool v int _get_display_visible_from_sink(webrtc_s *webrtc, unsigned int track_id, bool *visible) { - webrtc_gst_slot_s *sink; + const webrtc_gst_slot_s *sink; RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL"); RET_VAL_IF(track_id == 0, WEBRTC_ERROR_INVALID_PARAMETER, "track id is 0"); @@ -1083,4 +1083,4 @@ int _get_display_visible_from_sink(webrtc_s *webrtc, unsigned int track_id, bool return WEBRTC_ERROR_NONE; } -//LCOV_EXCL_STOP \ No newline at end of file +//LCOV_EXCL_STOP diff --git a/src/webrtc_source.c b/src/webrtc_source.c index 85e80206..0a01638d 100644 --- a/src/webrtc_source.c +++ b/src/webrtc_source.c @@ -1707,7 +1707,7 @@ static int __build_filesrc_bin(webrtc_gst_slot_s *source, media_type_e media_typ GstElement *queue = NULL; GstElement *capsfilter = NULL; GList *element_list = NULL; - int av_idx = GET_AV_IDX_BY_TYPE(media_type); + const int av_idx = GET_AV_IDX_BY_TYPE(media_type); RET_VAL_IF(source == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source is NULL"); RET_VAL_IF(source->bin == NULL, WEBRTC_ERROR_INVALID_OPERATION, "bin is NULL"); @@ -2816,8 +2816,8 @@ end: int _get_transceiver_direction(webrtc_s *webrtc, unsigned int source_id, webrtc_media_type_e media_type, webrtc_transceiver_direction_e *direction) { int ret = WEBRTC_ERROR_INVALID_OPERATION; - webrtc_gst_slot_s *source; - GstWebRTCRTPTransceiver *trans; + const webrtc_gst_slot_s *source; + const GstWebRTCRTPTransceiver *trans; GArray *transceivers; int mline; guint i; @@ -2894,7 +2894,7 @@ int _set_pause(webrtc_s *webrtc, unsigned int source_id, webrtc_media_type_e med int _get_pause(webrtc_s *webrtc, unsigned int source_id, webrtc_media_type_e media_type, bool *paused) { - webrtc_gst_slot_s *source; + const webrtc_gst_slot_s *source; RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL"); RET_VAL_IF(paused == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "paused is NULL"); @@ -2959,7 +2959,7 @@ int _set_video_resolution(webrtc_s *webrtc, unsigned int source_id, int width, i int _get_video_resolution(webrtc_s *webrtc, unsigned int source_id, int *width, int *height) { - webrtc_gst_slot_s *source; + const webrtc_gst_slot_s *source; RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL"); RET_VAL_IF(width == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "width is NULL"); @@ -2979,7 +2979,7 @@ int _get_video_resolution(webrtc_s *webrtc, unsigned int source_id, int *width, int _set_sound_stream_info(webrtc_s *webrtc, unsigned int source_id, sound_stream_info_h stream_info) { - webrtc_gst_slot_s *source; + const webrtc_gst_slot_s *source; GstElement *element; int ret; bool available = false; @@ -3073,7 +3073,7 @@ error: static gboolean __check_format_is_not_set_cb(gpointer key, gpointer value, gpointer user_data) { - webrtc_gst_slot_s *source = value; + const webrtc_gst_slot_s *source = (webrtc_gst_slot_s *)value; if (source->type == GPOINTER_TO_INT(user_data)) { LOG_INFO("found media packet source[%p, id:%u, media_format:%p]", source, source->id, source->media_format); @@ -3085,7 +3085,7 @@ static gboolean __check_format_is_not_set_cb(gpointer key, gpointer value, gpoin bool _check_if_format_is_set_to_packet_sources(webrtc_s *webrtc) { - webrtc_gst_slot_s *source; + const webrtc_gst_slot_s *source; RET_VAL_IF(webrtc == NULL, false, "webrtc is NULL"); @@ -3203,7 +3203,7 @@ int _set_media_path(webrtc_s *webrtc, unsigned int source_id, const char *path) static gboolean __check_path_is_not_set_cb(gpointer key, gpointer value, gpointer user_data) { - webrtc_gst_slot_s *source = (webrtc_gst_slot_s *)value; + const webrtc_gst_slot_s *source = (webrtc_gst_slot_s *)value; gchar *location = NULL; if (source->type == GPOINTER_TO_INT(user_data)) { @@ -3221,7 +3221,7 @@ static gboolean __check_path_is_not_set_cb(gpointer key, gpointer value, gpointe bool _check_if_path_is_set_to_file_sources(webrtc_s *webrtc) { - webrtc_gst_slot_s *source; + const webrtc_gst_slot_s *source; RET_VAL_IF(webrtc == NULL, false, "webrtc is NULL"); @@ -3725,7 +3725,7 @@ int _set_audio_mute(webrtc_s *webrtc, unsigned int source_id, bool mute) int _get_video_mute(webrtc_s *webrtc, unsigned int source_id, bool *muted) { - webrtc_gst_slot_s *source = NULL; + const webrtc_gst_slot_s *source; 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"); @@ -3756,7 +3756,7 @@ int _get_video_mute(webrtc_s *webrtc, unsigned int source_id, bool *muted) //LCOV_EXCL_START int _get_audio_mute(webrtc_s *webrtc, unsigned int source_id, bool *muted) { - webrtc_gst_slot_s *source = NULL; + const webrtc_gst_slot_s *source; GstElement *volume = NULL; RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL"); @@ -3998,7 +3998,7 @@ static int __build_loopback_render_pipeline(webrtc_s *webrtc, webrtc_gst_slot_s { GstElement *appsrc; gchar *pipeline_name; - int idx = GET_AV_IDX_BY_TYPE(type); + const int idx = GET_AV_IDX_BY_TYPE(type); RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL"); RET_VAL_IF(source == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "source is NULL"); @@ -4184,7 +4184,7 @@ int _set_display_mode_to_loopback(webrtc_s *webrtc, unsigned int track_id, webrt int _get_display_mode_from_loopback(webrtc_s *webrtc, unsigned int track_id, webrtc_display_mode_e *mode) { - webrtc_gst_slot_s *source; + const webrtc_gst_slot_s *source; RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL"); RET_VAL_IF(track_id < TRACK_ID_THRESHOLD_OF_LOOPBACK, WEBRTC_ERROR_INVALID_PARAMETER, "invalid track_id(%d)", track_id); @@ -4221,7 +4221,7 @@ int _set_display_visible_to_loopback(webrtc_s *webrtc, unsigned int track_id, bo int _get_display_visible_from_loopback(webrtc_s *webrtc, unsigned int track_id, bool *visible) { - webrtc_gst_slot_s *source; + const webrtc_gst_slot_s *source; RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL"); RET_VAL_IF(track_id < TRACK_ID_THRESHOLD_OF_LOOPBACK, WEBRTC_ERROR_INVALID_PARAMETER, "invalid track_id(%d)", track_id); @@ -4375,7 +4375,7 @@ int _set_filesrc_looping(webrtc_s *webrtc, unsigned int source_id, bool looping) int _get_filesrc_looping(webrtc_s * webrtc, unsigned int source_id, bool *looping) { - webrtc_gst_slot_s *source = NULL; + const webrtc_gst_slot_s *source; 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"); -- 2.34.1