Fix bugs related display 43/275743/3
authorHaesu Gwon <haesu.gwon@samsung.com>
Tue, 31 May 2022 08:16:59 +0000 (17:16 +0900)
committerHaesu Gwon <haesu.gwon@samsung.com>
Thu, 2 Jun 2022 02:08:15 +0000 (11:08 +0900)
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

packaging/capi-media-editor.spec
src/media_editor_display.c
test/media_editor_test.c

index 1e6ae2d4c8a48553e310a844ca98e6598cbcaf9e..b28401cd3efaa36cec0031790e626f27724eee6b 100644 (file)
@@ -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
index b0ad64b675bbf7a2ad8c10bfa01cf04b60e12d04..a9f5267230baa755f80518e27baba103b10e0f52 100644 (file)
@@ -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);
index 826652dffce21f691647f244a70a79d36489a341..d2d1999c0163edd4668857dc18d0a5761e9db4ed 100644 (file)
@@ -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;