webrtc_sink/source: Add const keywords 29/270529/2 submit/tizen/20220208.045606
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 8 Feb 2022 00:32:53 +0000 (09:32 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 8 Feb 2022 00:33:43 +0000 (09:33 +0900)
[Version] 0.3.53
[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 a3ea7bb2b3ed65b0792395b5927c21d944899671..062e3b712ce04ea8acad57ad4a6e21a8fb10cb63 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.3.52
+Version:    0.3.53
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index d1a72956613a2b5e07cb596a38342a0d2e00ad3f..48b9b864df1995ac658f1b9c3f12886a8a4f1b57 100644 (file)
@@ -342,7 +342,7 @@ static void __invoke_track_added_cb(webrtc_s *webrtc, const gchar *name, bool is
 
 static void __decodebin_element_added_cb(GstElement *decodebin, GstElement *element, gpointer 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;
        gchar *factory_name = NULL;
 
        RET_IF(decodebin == NULL, "decodebin is NULL");
@@ -706,7 +706,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");
@@ -1064,7 +1064,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");
@@ -1099,7 +1099,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");
index 8cc07cd6afb6443414bbbd91f16f94ff66ed1de9..7dcb701f06da99e5d972a9b21afa61d9e6f8d6a5 100644 (file)
@@ -1810,7 +1810,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");
@@ -2937,8 +2937,8 @@ int _set_transceiver_direction(webrtc_s *webrtc, unsigned int source_id, webrtc_
 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_gst_slot_s *source;
-       GstWebRTCRTPTransceiver *trans;
+       const webrtc_gst_slot_s *source;
+       const GstWebRTCRTPTransceiver *trans;
 
        RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
        RET_VAL_IF(direction == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "direction is NULL");
@@ -3001,7 +3001,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");
@@ -3065,7 +3065,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");
@@ -3118,7 +3118,7 @@ int _set_video_framerate(webrtc_s *webrtc, unsigned int source_id, int framerate
 
 int _get_video_framerate(webrtc_s *webrtc, unsigned int source_id, int *framerate)
 {
-       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(framerate == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "framerate is NULL");
@@ -3136,7 +3136,7 @@ int _get_video_framerate(webrtc_s *webrtc, unsigned int source_id, int *framerat
 
 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;
@@ -3230,7 +3230,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);
@@ -3242,7 +3242,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");
 
@@ -3360,7 +3360,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)) {
@@ -3378,7 +3378,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");
 
@@ -3882,7 +3882,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");
@@ -3913,7 +3913,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");
@@ -4161,7 +4161,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");
@@ -4403,7 +4403,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);
@@ -4440,7 +4440,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);
@@ -4607,7 +4607,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;
+       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");