webrtc_sink/source: Add const keywords 99/271899/1
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 8 Feb 2022 00:32:53 +0000 (09:32 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 3 Mar 2022 03:50:19 +0000 (12:50 +0900)
[Version] 0.2.160
[Issue Type] Improvement

Change-Id: Icd1575632033d62f245b29d4a7a8528ef879a02e
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/capi-media-webrtc.spec
src/webrtc_sink.c
src/webrtc_source.c

index c12c349c111ba62d799a0cf0a6add620b7ae4c88..81459057aa51cf608ff529f10b4347583c656345 100644 (file)
@@ -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
index 71348767f472f87f483546d7de52e53e1f16488f..1a8269a23ab969120e65195331b6b48abfb60086 100644 (file)
@@ -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
index 85e80206e8a1d727ce3964af5cd3032ba4bd5f4b..0a01638d27cc3f19ab0a75664cb9c270b3b6d560 100644 (file)
@@ -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");