webrtc_source: Fix typos 25/267025/1
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 9 Nov 2021 06:56:05 +0000 (15:56 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Wed, 24 Nov 2021 08:28:52 +0000 (17:28 +0900)
DEFAULT_NAME_XXX should be ELEMENT_NAME_XXX.

[Version] 0.2.150
[Issue Type] Typo fix

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

index 6129f3a0916ae9f45a2c3ef1534b98949ed39aba..417d991206a5390a7499559d2286a3bfc8e91cd0 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.2.149
+Version:    0.2.150
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 532d7a4a47316e257bf42eae525c0cdef161b342..1695d12c02a7c2d2f8e30622a0bdd01dfbfe0dbc 100644 (file)
 #define ELEMENT_NAME_VIDEO_MUTE_SRC          "videoMuteSrc"
 #define ELEMENT_NAME_VOLUME                  "volume"
 #define ELEMENT_NAME_MIC_SRC                 "micSrc"
-#define DEFAULT_NAME_FILE_SRC                "fileSrc"
-#define DEFAULT_NAME_AUDIO_QUEUE             "audioQueue"
-#define DEFAULT_NAME_VIDEO_QUEUE             "videoQueue"
-#define DEFAULT_NAME_AUDIO_CAPSFILTER        "audioCapsfilter"
-#define DEFAULT_NAME_VIDEO_CAPSFILTER        "videoCapsfilter"
-#define DEFAULT_NAME_AUDIO_PAYLOADER         "audioPayloader"
-#define DEFAULT_NAME_VIDEO_PAYLOADER         "videoPayloader"
-#define DEFAULT_NAME_VIDEOCROP               "videoCrop"
-#define DEFAULT_NAME_SCREENSRC               "waylandSrc"
-#define DEFAULT_NAME_AUDIO_FAKESINK          "audioFakeSink"
-#define DEFAULT_NAME_VIDEO_FAKESINK          "videoFakeSink"
-#define DEFAULT_NAME_AUDIO_APPSRC            "audioAppsrc"
-#define DEFAULT_NAME_VIDEO_APPSRC            "videoAppsrc"
+#define ELEMENT_NAME_FILE_SRC                "fileSrc"
+#define ELEMENT_NAME_AUDIO_QUEUE             "audioQueue"
+#define ELEMENT_NAME_VIDEO_QUEUE             "videoQueue"
+#define ELEMENT_NAME_AUDIO_CAPSFILTER        "audioCapsfilter"
+#define ELEMENT_NAME_VIDEO_CAPSFILTER        "videoCapsfilter"
+#define ELEMENT_NAME_AUDIO_PAYLOADER         "audioPayloader"
+#define ELEMENT_NAME_VIDEO_PAYLOADER         "videoPayloader"
+#define ELEMENT_NAME_VIDEOCROP               "videoCrop"
+#define ELEMENT_NAME_SCREENSRC               "waylandSrc"
+#define ELEMENT_NAME_AUDIO_FAKESINK          "audioFakeSink"
+#define ELEMENT_NAME_VIDEO_FAKESINK          "videoFakeSink"
+#define ELEMENT_NAME_AUDIO_APPSRC            "audioAppsrc"
+#define ELEMENT_NAME_VIDEO_APPSRC            "videoAppsrc"
 
 #define APPEND_ELEMENT(x_list, x_element) \
 do { \
@@ -112,18 +112,18 @@ typedef struct {
 
 static av_mapping_table_s _av_tbl[AV_IDX_MAX] = {
        {
-               DEFAULT_NAME_AUDIO_APPSRC,
-               DEFAULT_NAME_AUDIO_QUEUE,
-               DEFAULT_NAME_AUDIO_PAYLOADER,
-               DEFAULT_NAME_AUDIO_CAPSFILTER,
-               DEFAULT_NAME_AUDIO_FAKESINK,
+               ELEMENT_NAME_AUDIO_APPSRC,
+               ELEMENT_NAME_AUDIO_QUEUE,
+               ELEMENT_NAME_AUDIO_PAYLOADER,
+               ELEMENT_NAME_AUDIO_CAPSFILTER,
+               ELEMENT_NAME_AUDIO_FAKESINK,
        },
        {
-               DEFAULT_NAME_VIDEO_APPSRC,
-               DEFAULT_NAME_VIDEO_QUEUE,
-               DEFAULT_NAME_VIDEO_PAYLOADER,
-               DEFAULT_NAME_VIDEO_CAPSFILTER,
-               DEFAULT_NAME_VIDEO_FAKESINK,
+               ELEMENT_NAME_VIDEO_APPSRC,
+               ELEMENT_NAME_VIDEO_QUEUE,
+               ELEMENT_NAME_VIDEO_PAYLOADER,
+               ELEMENT_NAME_VIDEO_CAPSFILTER,
+               ELEMENT_NAME_VIDEO_FAKESINK,
        }
 };
 
@@ -899,7 +899,7 @@ static int __create_rest_of_elements(webrtc_s *webrtc, webrtc_gst_slot_s *source
        }
 
        if (source->type == WEBRTC_MEDIA_SOURCE_TYPE_SCREEN && !source->zerocopy_enabled) {
-               if (!(videocrop = _create_element(DEFAULT_ELEMENT_VIDEOCROP, DEFAULT_NAME_VIDEOCROP)))
+               if (!(videocrop = _create_element(DEFAULT_ELEMENT_VIDEOCROP, ELEMENT_NAME_VIDEOCROP)))
                        goto error;
                APPEND_ELEMENT(*element_list, videocrop);
        }
@@ -1296,7 +1296,7 @@ static int __build_screensrc(webrtc_s *webrtc, webrtc_gst_slot_s *source)
        source->media_types = MEDIA_TYPE_VIDEO;
        source->zerocopy_enabled = __is_hw_encoder_used(webrtc, source->type, source->media_types);
 
-       if (!(screensrc = _create_element(__get_source_element(webrtc, WEBRTC_MEDIA_SOURCE_TYPE_SCREEN), DEFAULT_NAME_SCREENSRC)))
+       if (!(screensrc = _create_element(__get_source_element(webrtc, WEBRTC_MEDIA_SOURCE_TYPE_SCREEN), ELEMENT_NAME_SCREENSRC)))
                return WEBRTC_ERROR_INVALID_OPERATION;
        APPEND_ELEMENT(switch_src_list, screensrc);
 
@@ -1803,7 +1803,7 @@ static void __filesrc_pipeline_audio_stream_handoff_cb(GstElement *object, GstBu
        webrtc_gst_slot_s *source = data;
        GstFlowReturn gst_ret = GST_FLOW_OK;
 
-       g_signal_emit_by_name(gst_bin_get_by_name(source->bin, DEFAULT_NAME_AUDIO_APPSRC), "push-buffer", buffer, &gst_ret, NULL);
+       g_signal_emit_by_name(gst_bin_get_by_name(source->bin, ELEMENT_NAME_AUDIO_APPSRC), "push-buffer", buffer, &gst_ret, NULL);
        if (gst_ret != GST_FLOW_OK)
                LOG_ERROR("failed to 'push-buffer', gst_ret[0x%x]", gst_ret);
 }
@@ -1813,7 +1813,7 @@ static void __filesrc_pipeline_video_stream_handoff_cb(GstElement *object, GstBu
        webrtc_gst_slot_s *source = data;
        GstFlowReturn gst_ret = GST_FLOW_OK;
 
-       g_signal_emit_by_name(gst_bin_get_by_name(source->bin, DEFAULT_NAME_VIDEO_APPSRC), "push-buffer", buffer, &gst_ret, NULL);
+       g_signal_emit_by_name(gst_bin_get_by_name(source->bin, ELEMENT_NAME_VIDEO_APPSRC), "push-buffer", buffer, &gst_ret, NULL);
        if (gst_ret != GST_FLOW_OK)
                LOG_ERROR("failed to 'push-buffer', gst_ret[0x%x]", gst_ret);
 }
@@ -1828,9 +1828,9 @@ static GstPadProbeReturn __fakesink_probe_cb(GstPad *pad,  GstPadProbeInfo *info
        gst_structure_get(gst_caps_get_structure(gst_pad_get_current_caps(pad), 0), "media", G_TYPE_STRING, &media, NULL);
 
        if (g_strrstr(media, "audio"))
-               appsrc = gst_bin_get_by_name(source->bin, DEFAULT_NAME_AUDIO_APPSRC);
+               appsrc = gst_bin_get_by_name(source->bin, ELEMENT_NAME_AUDIO_APPSRC);
        else
-               appsrc = gst_bin_get_by_name(source->bin, DEFAULT_NAME_VIDEO_APPSRC);
+               appsrc = gst_bin_get_by_name(source->bin, ELEMENT_NAME_VIDEO_APPSRC);
 
        RET_VAL_IF(appsrc == NULL, GST_PAD_PROBE_OK, "There is no appsrc for [%s]", media);
 
@@ -2197,7 +2197,7 @@ static int __build_filesrc_pipeline(webrtc_s *webrtc, webrtc_gst_slot_s *source)
                goto error;
        }
 
-       if (!(filesrc = _create_element(DEFAULT_ELEMENT_FILESRC, DEFAULT_NAME_FILE_SRC)))
+       if (!(filesrc = _create_element(DEFAULT_ELEMENT_FILESRC, ELEMENT_NAME_FILE_SRC)))
                goto error;
 
        if (!(decodebin = _create_element("decodebin", NULL))) {
@@ -3178,7 +3178,7 @@ int _set_media_path(webrtc_s *webrtc, unsigned int source_id, const char *path)
                }
        }
 
-       filesrc = gst_bin_get_by_name(GST_BIN(source->filesrc_pipeline), DEFAULT_NAME_FILE_SRC);
+       filesrc = gst_bin_get_by_name(GST_BIN(source->filesrc_pipeline), ELEMENT_NAME_FILE_SRC);
        RET_VAL_IF(filesrc == NULL, WEBRTC_ERROR_INVALID_OPERATION, "filesrc is NULL");
 
        g_object_get(G_OBJECT(filesrc), "location", &location, NULL);
@@ -3202,7 +3202,7 @@ static gboolean __check_path_is_not_set_cb(gpointer key, gpointer value, gpointe
 
        if (source->type == GPOINTER_TO_INT(user_data)) {
                LOG_INFO("found file source[%p, id:%u]", source, source->id);
-               g_object_get(G_OBJECT(gst_bin_get_by_name(GST_BIN(source->filesrc_pipeline), DEFAULT_NAME_FILE_SRC)), "location", &location, NULL);
+               g_object_get(G_OBJECT(gst_bin_get_by_name(GST_BIN(source->filesrc_pipeline), ELEMENT_NAME_FILE_SRC)), "location", &location, NULL);
 
                if (!location)
                        return TRUE;
@@ -4252,10 +4252,10 @@ int _set_screen_source_crop(webrtc_s *webrtc, unsigned int source_id, int x, int
        RET_VAL_IF(width == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "width is NULL");
        RET_VAL_IF(height == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "height is NULL");
 
-       screen_source =  gst_bin_get_by_name(source->bin, DEFAULT_NAME_SCREENSRC);
+       screen_source =  gst_bin_get_by_name(source->bin, ELEMENT_NAME_SCREENSRC);
        RET_VAL_IF(screen_source == NULL, WEBRTC_ERROR_INVALID_OPERATION, "sreen_source is NULL");
 
-       videocrop =  gst_bin_get_by_name(source->bin, DEFAULT_NAME_VIDEOCROP);
+       videocrop =  gst_bin_get_by_name(source->bin, ELEMENT_NAME_VIDEOCROP);
        RET_VAL_IF(videocrop == NULL, WEBRTC_ERROR_INVALID_OPERATION, "videocrop is NULL");
 
        LOG_INFO("set source crop x:%d, y:%d, width:%d, height:%d, mode:%s", x, y, w, h, (portrait_mode) ? "portrait" : "landscape");
@@ -4307,10 +4307,10 @@ int _unset_screen_source_crop(webrtc_s *webrtc, unsigned int source_id)
        RET_VAL_IF((source = _get_slot_by_id(webrtc->gst.source_slots, source_id)) == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "could not find source");
        RET_VAL_IF(source->type != WEBRTC_MEDIA_SOURCE_TYPE_SCREEN, WEBRTC_ERROR_INVALID_PARAMETER, "source type is not screen");
 
-       screen_source =  gst_bin_get_by_name(source->bin, DEFAULT_NAME_SCREENSRC);
+       screen_source =  gst_bin_get_by_name(source->bin, ELEMENT_NAME_SCREENSRC);
        RET_VAL_IF(screen_source == NULL, WEBRTC_ERROR_INVALID_OPERATION, "sreen_source is NULL");
 
-       videocrop =  gst_bin_get_by_name(source->bin, DEFAULT_NAME_VIDEOCROP);
+       videocrop =  gst_bin_get_by_name(source->bin, ELEMENT_NAME_VIDEOCROP);
        RET_VAL_IF(videocrop == NULL, WEBRTC_ERROR_INVALID_OPERATION, "videocrop is NULL");
 
        g_object_get(G_OBJECT(videocrop), "left", &left, "right", &right, "top", &top, "bottom", &bottom, NULL);