From: Haesu Gwon Date: Tue, 31 May 2022 08:16:59 +0000 (+0900) Subject: Fix bugs related display X-Git-Tag: submit/tizen/20220609.032959~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b667d1937d89a8496f637a58d489b07005a6b3d6;p=platform%2Fcore%2Fapi%2Fmediaeditor.git Fix bugs related display media_editor_display : Locally initialized variable is not assigned to mediaeditor handle. Some lines are excluded for coverage measurement. media_editor_test : The layer priority is used when add clip. [Version] 0.0.9 [Issue Type] Bug fix Change-Id: I5f28566aceb5e18ca2306c944a168c5a87cd480e --- diff --git a/packaging/capi-media-editor.spec b/packaging/capi-media-editor.spec index 1e6ae2d..b28401c 100644 --- a/packaging/capi-media-editor.spec +++ b/packaging/capi-media-editor.spec @@ -1,6 +1,6 @@ Name: capi-media-editor Summary: A Tizen Media Editor API -Version: 0.0.8 +Version: 0.0.9 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/media_editor_display.c b/src/media_editor_display.c index b0ad64b..a9f5267 100644 --- a/src/media_editor_display.c +++ b/src/media_editor_display.c @@ -44,6 +44,7 @@ static int __set_evas_display(mediaeditor_display_s *display) return MEDIAEDITOR_ERROR_NONE; } +//LCOV_EXCL_START static int __set_wl_sink(mediaeditor_s *_editor) { GstElement *videosink = NULL; @@ -82,6 +83,7 @@ static int __set_overlay_display(mediaeditor_s *_editor, mediaeditor_display_s * return MEDIAEDITOR_ERROR_NONE; } +//LCOV_EXCL_STOP static int __init_display(mediaeditor_display_s **display) { @@ -113,17 +115,19 @@ int _mediaeditor_set_display(mediaeditor_h editor, mediaeditor_display_type_e ty int ret = MEDIAEDITOR_ERROR_NONE; g_autoptr(GMutexLocker) locker = NULL; mediaeditor_s *_editor = (mediaeditor_s*)editor; - mediaeditor_display_s *_display = _editor->display; + mediaeditor_display_s *_display = NULL; RET_VAL_IF(_editor == NULL, MEDIAEDITOR_ERROR_INVALID_PARAMETER, "editor is NULL"); - if (_display == NULL) { - if ((ret = __init_display(&_display)) != MEDIAEDITOR_ERROR_NONE) { + if (_editor->display == NULL) { + if ((ret = __init_display(&_editor->display)) != MEDIAEDITOR_ERROR_NONE) { LOG_ERROR("failed to initialize display[0x%x]", ret); return ret; } } + _display = _editor->display; + LOG_DEBUG("mutex[%p]", &_display->mutex); locker = g_mutex_locker_new(&_display->mutex); diff --git a/test/media_editor_test.c b/test/media_editor_test.c index 826652d..d2d1999 100644 --- a/test/media_editor_test.c +++ b/test/media_editor_test.c @@ -187,13 +187,13 @@ static void start_preview() return; } - ret = mediaeditor_add_clip(heditor, "/tmp/test1.mp4", layer_priority, 0, G_TIME_SPAN_MILLISECOND * 10, 0, &clip_id); + ret = mediaeditor_add_clip(heditor, "/tmp/test1.mp4", layer_id, 0, G_TIME_SPAN_MILLISECOND * 3, 0, &clip_id); if (ret != MEDIAEDITOR_ERROR_NONE) { g_print("failed to add clip : error[0x%x]\n", ret); return; } - ret = mediaeditor_set_display(heditor, MEDIAEDITOR_DISPLAY_TYPE_EVAS, GET_DISPLAY(ad.eo)); + ret = mediaeditor_set_display(heditor, MEDIAEDITOR_DISPLAY_TYPE_OVERLAY, GET_DISPLAY(ad.win)); if (ret != MEDIAEDITOR_ERROR_NONE) { g_print("failed to set display : error[0x%x]\n", ret); return; @@ -230,7 +230,7 @@ static void start_render() return; } - ret = mediaeditor_add_clip(heditor, "/tmp/test1.mp4", layer_priority, 0, 100, 0, &clip_id); + ret = mediaeditor_add_clip(heditor, "/tmp/test1.mp4", layer_id, 0, 100, 0, &clip_id); if (ret != MEDIAEDITOR_ERROR_NONE) { g_print("failed to add clip : error[0x%x]\n", ret); return;