From: Sangchul Lee Date: Thu, 21 Oct 2021 01:36:12 +0000 (+0900) Subject: Apply macros to exclude lines from coverage measurement #2 X-Git-Tag: submit/tizen/20211028.055213~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ab441e120ad04236bce2b09cae20d8ffe00ebba9;p=platform%2Fcore%2Fapi%2Fwebrtc.git Apply macros to exclude lines from coverage measurement #2 [Version] 0.2.136 [Issue Type] Line coverage Change-Id: I472ebce3a0748d0056ec929a920388262f1e1288 Signed-off-by: Sangchul Lee --- diff --git a/packaging/capi-media-webrtc.spec b/packaging/capi-media-webrtc.spec index ac77e418..a12b938b 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.135 +Version: 0.2.136 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/webrtc_data_channel.c b/src/webrtc_data_channel.c index 472f8098..7812b134 100644 --- a/src/webrtc_data_channel.c +++ b/src/webrtc_data_channel.c @@ -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) { diff --git a/src/webrtc_display.c b/src/webrtc_display.c index 36165974..6efa1cd7 100644 --- a/src/webrtc_display.c +++ b/src/webrtc_display.c @@ -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) { diff --git a/src/webrtc_private.c b/src/webrtc_private.c index f53c714c..5cf5b103 100644 --- a/src/webrtc_private.c +++ b/src/webrtc_private.c @@ -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) { diff --git a/src/webrtc_resource.c b/src/webrtc_resource.c index 08608548..7e92cae8 100644 --- a/src/webrtc_resource.c +++ b/src/webrtc_resource.c @@ -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) { diff --git a/src/webrtc_restriction.c b/src/webrtc_restriction.c index a37f6203..b8f3ece3 100644 --- a/src/webrtc_restriction.c +++ b/src/webrtc_restriction.c @@ -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); diff --git a/src/webrtc_sink.c b/src/webrtc_sink.c index 828ade24..b5f478ba 100644 --- a/src/webrtc_sink.c +++ b/src/webrtc_sink.c @@ -19,6 +19,7 @@ #include #include +//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 diff --git a/src/webrtc_source.c b/src/webrtc_source.c index a8558347..bf68f4b0 100644 --- a/src/webrtc_source.c +++ b/src/webrtc_source.c @@ -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) { diff --git a/src/webrtc_tbm.c b/src/webrtc_tbm.c index 8654d7fc..b8c424ad 100644 --- a/src/webrtc_tbm.c +++ b/src/webrtc_tbm.c @@ -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