Apply macros to exclude lines from coverage measurement #2 98/265498/1
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 21 Oct 2021 01:36:12 +0000 (10:36 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 21 Oct 2021 01:37:59 +0000 (10:37 +0900)
[Version] 0.2.136
[Issue Type] Line coverage

Change-Id: I472ebce3a0748d0056ec929a920388262f1e1288
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/capi-media-webrtc.spec
src/webrtc_data_channel.c
src/webrtc_display.c
src/webrtc_private.c
src/webrtc_resource.c
src/webrtc_restriction.c
src/webrtc_sink.c
src/webrtc_source.c
src/webrtc_tbm.c

index ac77e418e84c6736b2e6859cea1b20d100c294cf..a12b938ba2659297183e95970b8b0351b0450c20 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.2.135
+Version:    0.2.136
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 472f809801f62513917607e6a6db71e595ee386b..7812b13402b1023ffdd3cdc2cb9f005818b16e91 100644 (file)
@@ -17,6 +17,7 @@
 #include "webrtc.h"
 #include "webrtc_private.h"
 
+//LCOV_EXCL_START
 static void __data_channel_on_open_cb(GObject *data_channel, gpointer user_data)
 {
        webrtc_data_channel_s *channel = (webrtc_data_channel_s *)user_data;
@@ -155,6 +156,7 @@ void _webrtcbin_on_data_channel_cb(GstElement *webrtcbin, GObject *data_channel,
 
        __invoke_data_channel_cb(webrtc, channel);
 }
+//LCOV_EXCL_STOP
 
 int _create_data_channel(webrtc_s *webrtc, const char *label, bundle *options, webrtc_data_channel_s **channel)
 {
index 36165974b3f7072d396eb2686b7293ca53669791..6efa1cd7a36b88cb8fc71305707db4b72265da34 100644 (file)
@@ -44,6 +44,7 @@ typedef struct _media_packet_finalize_data_s {
        video_decoded_data_info_s *info;
 } media_packet_finalize_data_s;
 
+//LCOV_EXCL_START
 static guint32 __convert_fourcc_string_to_value(const gchar *format_name)
 {
        return format_name[0] | (format_name[1] << 8) | (format_name[2] << 16) | (format_name[3] << 24);
@@ -636,6 +637,7 @@ void _video_stream_decoded_cb(GstElement *object, GstBuffer *buffer, GstPad *pad
 
        mm_display_interface_evas_render(display->mm_display, packet);
 }
+//LCOV_EXCL_STOP
 
 static int __set_overlay_display(webrtc_display_s *display)
 {
index f53c714c79958663f226df7a7b2c3e1bd70da8ca..5cf5b10389ec14289b207263d0fd917cb01aafbd 100644 (file)
@@ -80,6 +80,7 @@ static ice_connection_state_info_s __ice_connection_state_info[] = {
        [GST_WEBRTC_ICE_CONNECTION_STATE_CLOSED] = { "CLOSED", WEBRTC_ICE_CONNECTION_STATE_CLOSED },
 };
 
+//LCOV_EXCL_START
 static const char *__get_error_string(webrtc_error_e error)
 {
        switch (error) {
@@ -108,6 +109,7 @@ static const char *__get_error_string(webrtc_error_e error)
                return "(invalid error)";
        }
 }
+//LCOV_EXCL_STOP
 
 void _generate_dot(GstElement *pipeline, const gchar *name)
 {
@@ -232,6 +234,7 @@ void _invoke_state_changed_cb(webrtc_s *webrtc, webrtc_state_e old, webrtc_state
        GENERATE_DOT(webrtc, webrtc->gst.pipeline, "%s.state_%s", GST_ELEMENT_NAME(webrtc->gst.pipeline), __state_str[webrtc->state]);
 }
 
+//LCOV_EXCL_START
 static void __invoke_error_cb(webrtc_s *webrtc, webrtc_error_e error)
 {
        RET_IF(webrtc == NULL, "webrtc is NULL");
@@ -261,6 +264,7 @@ static void __invoke_peer_connection_state_change_cb(webrtc_s *webrtc, GstWebRTC
                LOG_DEBUG("<<< end of the callback");
        }
 }
+//LCOV_EXCL_STOP
 
 static void __invoke_signaling_state_change_cb(webrtc_s *webrtc, GstWebRTCPeerConnectionState state)
 {
@@ -296,6 +300,7 @@ static void __invoke_ice_gathering_state_change_cb(webrtc_s *webrtc, GstWebRTCIC
        }
 }
 
+//LCOV_EXCL_START
 static void __invoke_ice_connection_state_change_cb(webrtc_s *webrtc, GstWebRTCICEConnectionState state)
 {
        webrtc_callbacks_s *cb;
@@ -394,6 +399,7 @@ static gboolean __bus_watch_cb(GstBus *bus, GstMessage *message, gpointer user_d
 
        return TRUE;
 }
+//LCOV_EXCL_STOP
 
 typedef enum _post_idle_cb_type_e {
        POST_IDLE_CB_TYPE_STATE,
@@ -493,6 +499,7 @@ void _post_state_cb_in_idle(webrtc_s *webrtc, webrtc_state_e new_state)
        LOG_DEBUG("state will be changed [%s] -> [%s]", __state_str[webrtc->state], __state_str[new_state]);
 }
 
+//LCOV_EXCL_START
 void _post_error_cb_in_idle(webrtc_s *webrtc, webrtc_error_e error)
 {
        idle_userdata_s *data;
@@ -524,6 +531,7 @@ static void __post_peer_connection_state_change_cb_in_idle(webrtc_s *webrtc, web
 
        LOG_DEBUG("connection state will be changed to [%u]", state);
 }
+//LCOV_EXCL_STOP
 
 static void __post_signaling_state_change_cb_in_idle(webrtc_s *webrtc, webrtc_signaling_state_e state)
 {
@@ -557,6 +565,7 @@ static void __post_ice_gathering_state_change_cb_in_idle(webrtc_s *webrtc, webrt
        LOG_DEBUG("ICE gathering state will be changed to [%u]", state);
 }
 
+//LCOV_EXCL_START
 static void __post_ice_connection_state_change_cb_in_idle(webrtc_s *webrtc, webrtc_ice_connection_state_e state)
 {
        idle_userdata_s *data;
@@ -572,6 +581,7 @@ static void __post_ice_connection_state_change_cb_in_idle(webrtc_s *webrtc, webr
 
        LOG_DEBUG("ICE connection state will be changed to [%u]", state);
 }
+//LCOV_EXCL_STOP
 
 GstElement *_create_element(const char *factory_name, const char *name)
 {
@@ -842,6 +852,7 @@ static void __webrtcbin_on_ice_candidate_cb(GstElement *webrtcbin, guint mlinein
        free(_param_candidate);
 }
 
+//LCOV_EXCL_START
 static void __webrtcbin_peer_connection_state_cb(GstElement *webrtcbin, GParamSpec * pspec, gpointer user_data)
 {
        webrtc_s *webrtc = (webrtc_s *)user_data;
@@ -873,6 +884,7 @@ static void __webrtcbin_peer_connection_state_cb(GstElement *webrtcbin, GParamSp
                break;
        }
 }
+//LCOV_EXCL_STOP
 
 static void __webrtcbin_signaling_state_cb(GstElement *webrtcbin, GParamSpec * pspec, gpointer user_data)
 {
@@ -906,6 +918,7 @@ static void __webrtcbin_ice_gathering_state_cb(GstElement *webrtcbin, GParamSpec
        __post_ice_gathering_state_change_cb_in_idle(webrtc, state);
 }
 
+//LCOV_EXCL_START
 static void __webrtcbin_ice_connection_state_cb(GstElement *webrtcbin, GParamSpec *pspec, gpointer user_data)
 {
        webrtc_s *webrtc = (webrtc_s *)user_data;
@@ -924,6 +937,7 @@ static void __webrtcbin_ice_connection_state_cb(GstElement *webrtcbin, GParamSpe
        if (state == GST_WEBRTC_ICE_CONNECTION_STATE_FAILED)
                __invoke_error_cb(webrtc, WEBRTC_ERROR_CONNECTION_FAILED);
 }
+//LCOV_EXCL_STOP
 
 static GstPad* __add_no_target_ghostpad(GstBin *bin, const char *pad_name, bool is_src)
 {
@@ -953,6 +967,7 @@ static GstPad* __add_no_target_ghostpad(GstBin *bin, const char *pad_name, bool
        return ghost_pad;
 }
 
+//LCOV_EXCL_START
 static bool __is_existing_pad(webrtc_gst_slot_s *source, const char *pad_name)
 {
        GstIterator *iter = NULL;
@@ -978,6 +993,7 @@ static bool __is_existing_pad(webrtc_gst_slot_s *source, const char *pad_name)
 
        return exist;
 }
+//LCOV_EXCL_STOP
 
 int _add_no_target_ghostpad_to_slot(webrtc_gst_slot_s *slot, bool is_src, GstPad **new_pad)
 {
@@ -1059,6 +1075,7 @@ static void __webrtcbin_transceiver_set_ulpfec_red(webrtc_s *webrtc, unsigned in
        gst_object_unref(rtpbin);
 }
 
+//LCOV_EXCL_START
 static int __get_media_type_from_pad(GstPad *pad, bool *is_video)
 {
        GstCaps *caps;
@@ -1087,6 +1104,7 @@ static int __get_media_type_from_pad(GstPad *pad, bool *is_video)
 
        return WEBRTC_ERROR_NONE;
 }
+//LCOV_EXCL_STOP
 
 static void __webrtcbin_pad_added_cb(GstElement *webrtcbin, GstPad *new_pad, gpointer user_data)
 {
@@ -1119,6 +1137,7 @@ static void __webrtcbin_pad_added_cb(GstElement *webrtcbin, GstPad *new_pad, gpo
        GENERATE_DOT(webrtc, webrtc->gst.pipeline, "%s.webrtcbin-%s", GST_ELEMENT_NAME(webrtc->gst.pipeline), GST_PAD_NAME(new_pad));
 }
 
+//LCOV_EXCL_START
 static void __webrtcbin_no_more_pads_cb(GstElement *webrtcbin, gpointer user_data)
 {
        webrtc_s *webrtc = (webrtc_s *)user_data;
@@ -1128,6 +1147,7 @@ static void __webrtcbin_no_more_pads_cb(GstElement *webrtcbin, gpointer user_dat
 
        LOG_DEBUG_LEAVE();
 }
+//LCOV_EXCL_STOP
 
 static void __webrtcbin_on_new_transceiver_cb(GstElement *webrtcbin, GstWebRTCRTPTransceiver *transceiver, gpointer user_data)
 {
index 08608548603b6f8ee95f7aed3bb82209deeb9440..7e92cae84f084dc78901cc51079fc6c8d09b3ab6 100644 (file)
@@ -35,6 +35,7 @@ int _acquire_resource_if_needed(webrtc_s *webrtc)
        return ret;
 }
 
+//LCOV_EXCL_START
 static int __resource_release_cb(mm_resource_manager_h mgr,
                mm_resource_manager_res_h res, void *user_data)
 {
@@ -62,6 +63,7 @@ static int __resource_release_cb(mm_resource_manager_h mgr,
 
        return ret;
 }
+//LCOV_EXCL_STOP
 
 int _create_resource_manager(webrtc_s *webrtc)
 {
index a37f6203f666955567e8c206f655b3baaeff8812..b8f3ece384dd493b92e648889be27a9ebafd594c 100644 (file)
@@ -37,11 +37,13 @@ int _check_privilege(const char *privilege)
        LOG_DEBUG("smack_label[%s] uid[%s]\n", smack_label, uid);
 
        cynara_ret = cynara_check(cynara_h, smack_label, "", uid, privilege);
+//LCOV_EXCL_START
        if (cynara_ret != CYNARA_API_ACCESS_ALLOWED) {
                LOG_ERROR("NOT ALLOWED, privilege[%s], cynara_ret[%d]", privilege, cynara_ret);
                ret = WEBRTC_ERROR_PERMISSION_DENIED;
                goto exit;
        }
+//LCOV_EXCL_STOP
 
        LOG_INFO("ALLOWED, privilege[%s]", privilege);
 
@@ -58,13 +60,17 @@ int _check_feature(const char *feature)
        RET_VAL_IF(feature == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "feature is NULL");
 
        if (system_info_get_platform_bool(feature, &supported) != SYSTEM_INFO_ERROR_NONE) {
+//LCOV_EXCL_START
                LOG_ERROR("failed to system_info_get_platform_bool(), feature[%s]", feature);
                return WEBRTC_ERROR_INVALID_OPERATION;
+//LCOV_EXCL_STOP
        }
 
        if (!supported) {
+//LCOV_EXCL_START
                LOG_ERROR("feature[%s] is not supported", feature);
                return WEBRTC_ERROR_NOT_SUPPORTED;
+//LCOV_EXCL_STOP
        }
 
        LOG_INFO("feature[%s] is supported", feature);
index 828ade24c74852027cd32aef88df80fd2169e59d..b5f478ba9ec0e115b9eb05461f110930de5b6c08 100644 (file)
@@ -19,6 +19,7 @@
 #include <gst/video/videooverlay.h>
 #include <media_packet_internal.h>
 
+//LCOV_EXCL_START
 bool _is_owner_of_track_build_context(webrtc_s *webrtc, unsigned int track_id)
 {
        GMainContext *context;
@@ -1068,3 +1069,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
index a85583474806a1f97adde1e976b650e177542d5e..bf68f4b04c8da19c1f0d94e92836880eb7b2457b 100644 (file)
@@ -559,6 +559,7 @@ static GstCaps *__make_default_encoded_caps(webrtc_gst_slot_s *source, webrtc_in
        return caps;
 }
 
+//LCOV_EXCL_START
 /* Use g_free() to free the media_type parameter. */
 static GstCaps *__make_encoded_caps_from_media_format(webrtc_gst_slot_s *source, gchar **media_type)
 {
@@ -616,6 +617,7 @@ static GstCaps *__make_encoded_caps_from_media_format(webrtc_gst_slot_s *source,
 
        return caps;
 }
+//LCOV_EXCL_STOP
 
 static GstCaps *__make_rtp_caps(const gchar *media_type, unsigned int payload_id)
 {
@@ -970,6 +972,7 @@ error:
        return WEBRTC_ERROR_INVALID_OPERATION;
 }
 
+//LCOV_EXCL_START
 static int __create_rest_of_elements_for_encoded_format(webrtc_s *webrtc, webrtc_gst_slot_s *source,
        GstElement **payloader, GstElement **queue, GstElement **capsfilter)
 {
@@ -1019,6 +1022,7 @@ static int __create_rest_of_elements_for_encoded_format(webrtc_s *webrtc, webrtc
 
        return WEBRTC_ERROR_NONE;
 }
+//LCOV_EXCL_STOP
 
 static const char *__get_default_element(int type)
 {
@@ -1542,6 +1546,7 @@ exit:
        return ret;
 }
 
+//LCOV_EXCL_START
 static int __build_custom_videosrc(webrtc_s *webrtc, webrtc_gst_slot_s *source)
 {
        int ret = WEBRTC_ERROR_NONE;
@@ -2106,6 +2111,7 @@ static gboolean __filesrc_pipeline_bus_watch_cb(GstBus *bus, GstMessage *message
 
        return TRUE;
 }
+//LCOV_EXCL_STOP
 
 static void __destroy_filesrc_pipeline(webrtc_gst_slot_s *source)
 {
@@ -2306,6 +2312,7 @@ exit:
        return ret;
 }
 
+//LCOV_EXCL_START
 static int __complete_mediapacketsrc_from_encoded_format(webrtc_s *webrtc, webrtc_gst_slot_s *source)
 {
        int ret = WEBRTC_ERROR_NONE;
@@ -2348,6 +2355,7 @@ static int __complete_mediapacketsrc_from_encoded_format(webrtc_s *webrtc, webrt
 
        return _set_ghost_pad_target(*src_pad, capsfilter, true);
 }
+//LCOV_EXCL_STOP
 
 static int __build_source_bin(webrtc_s *webrtc, webrtc_gst_slot_s *source)
 {
@@ -3018,6 +3026,7 @@ bool _check_if_format_is_set_to_packet_sources(webrtc_s *webrtc)
        return true;
 }
 
+//LCOV_EXCL_START
 static void __release_filesrc_resources(webrtc_gst_slot_s *source)
 {
        GstElement *appsrc = NULL;
@@ -3074,7 +3083,6 @@ static void __release_filesrc_resources(webrtc_gst_slot_s *source)
        source->media_types = 0;
 }
 
-//LCOV_EXCL_START
 int _set_media_path(webrtc_s *webrtc, unsigned int source_id, const char *path)
 {
        webrtc_gst_slot_s *source = NULL;
@@ -3243,6 +3251,7 @@ static void __memory_finalize_cb(packet_buffer_s *packet_buffer)
        g_free(packet_buffer);
 }
 
+//LCOV_EXCL_START
 static GstBuffer* __make_buffer_from_zerocopy_video_packet(webrtc_gst_slot_s *source, media_packet_h packet)
 {
        int ret = MEDIA_PACKET_ERROR_NONE;
@@ -3311,6 +3320,7 @@ static GstBuffer* __make_buffer_from_zerocopy_video_packet(webrtc_gst_slot_s *so
 
        return buffer;
 }
+//LCOV_EXCL_STOP
 
 int _push_media_packet(webrtc_s *webrtc, unsigned int source_id, media_packet_h packet)
 {
@@ -3435,6 +3445,7 @@ exit:
        return ret;
 }
 
+//LCOV_EXCL_START
 static GstPadProbeReturn __camerasrc_probe_cb(GstPad *pad,  GstPadProbeInfo *info, gpointer u_data)
 {
        GstBuffer *buffer = gst_pad_probe_info_get_buffer(info);
@@ -3531,6 +3542,7 @@ static int __mute_videosrc(webrtc_gst_slot_s *source, bool mute)
 
        return WEBRTC_ERROR_NONE;
 }
+//LCOV_EXCL_STOP
 
 static int __mute_videotestsrc(webrtc_gst_slot_s *source, bool mute)
 {
@@ -3592,6 +3604,7 @@ int _set_video_mute(webrtc_s *webrtc, unsigned int source_id, bool mute)
        return ret;
 }
 
+//LCOV_EXCL_START
 int _set_audio_mute(webrtc_s *webrtc, unsigned int source_id, bool mute)
 {
        webrtc_gst_slot_s *source = NULL;
@@ -3629,6 +3642,7 @@ int _set_audio_mute(webrtc_s *webrtc, unsigned int source_id, bool mute)
 
        return WEBRTC_ERROR_NONE;
 }
+//LCOV_EXCL_STOP
 
 int _get_video_mute(webrtc_s *webrtc, unsigned int source_id, bool *muted)
 {
@@ -3660,6 +3674,7 @@ int _get_video_mute(webrtc_s *webrtc, unsigned int source_id, bool *muted)
        return WEBRTC_ERROR_NONE;
 }
 
+//LCOV_EXCL_START
 int _get_audio_mute(webrtc_s *webrtc, unsigned int source_id, bool *muted)
 {
        webrtc_gst_slot_s *source = NULL;
@@ -3697,6 +3712,7 @@ int _get_audio_mute(webrtc_s *webrtc, unsigned int source_id, bool *muted)
 
        return WEBRTC_ERROR_NONE;
 }
+//LCOV_EXCL_STOP
 
 static int __build_loopback_audiosink(webrtc_gst_slot_s *source, GstElement *link_with)
 {
@@ -3846,6 +3862,7 @@ static int __build_loopback_videosink(webrtc_gst_slot_s *source, GstElement *lin
        return WEBRTC_ERROR_NONE;
 }
 
+//LCOV_EXCL_START
 static void __loopback_decodebin_pad_added_cb(GstElement *decodebin, GstPad *new_pad, gpointer user_data)
 {
        int ret = WEBRTC_ERROR_NONE;
@@ -3886,6 +3903,7 @@ static void __loopback_decodebin_pad_added_cb(GstElement *decodebin, GstPad *new
                _post_error_cb_in_idle(source->webrtc, ret);
        }
 }
+//LCOV_EXCL_STOP
 
 static int __build_loopback_render_pipeline(webrtc_s *webrtc, webrtc_gst_slot_s *source, media_type_e type, unsigned int *track_id)
 {
index 8654d7fc2d3e4c64f980d582503b9cc0846b635d..b8c424ad5673261c340862cd663317e0b7f4d5f6 100644 (file)
@@ -17,6 +17,7 @@
 #include "webrtc.h"
 #include "webrtc_private.h"
 
+//LCOV_EXCL_START
 static void __tbm_bo_destroy_cb(webrtc_tbm_bo_s *tbm_bo)
 {
        if (tbm_bo == NULL)
@@ -172,3 +173,4 @@ void _release_tbm(webrtc_tbm_s *tbm)
 
        g_free(tbm);
 }
+//LCOV_EXCL_STOP
\ No newline at end of file