webrtc_display: Destroy tbm bo list when bo size has been changed 94/312694/1 accepted/tizen/7.0/unified/20240613.133448 accepted/tizen/7.0/unified/20240613.150057 accepted/tizen/7.0/unified/20240613.162045
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 13 Jun 2024 05:33:48 +0000 (14:33 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 13 Jun 2024 05:45:21 +0000 (14:45 +0900)
It is related to dynamic resolution change in case of EVAS rendering.
It has fixed the crash due to the invalid bo size when facing this case.

[Version] 0.3.302
[Issue Type] Bug fix

Change-Id: Idd0ef5467acf39ca667c5a6b41505858e12f06d2
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
include/webrtc_private.h
packaging/capi-media-webrtc.spec
src/webrtc_display.c
src/webrtc_tbm.c

index 3061d6a2d6fc0629e0823c62b2bee4e33da8721b..06989328e509be5c13aa3652e507390591452924 100644 (file)
@@ -418,6 +418,7 @@ typedef struct _webrtc_tbm_s {
        GCond cond;
        GMutex mutex;
        GList *bo_list;    /* for decoded video data by sw codec */
+       int bo_size;
 } webrtc_tbm_s;
 
 typedef struct _webrtc_display {
index bd32714d6bcbbc89191803035d208c5b0daa6402..68b033b3a36086799fe673e9b643aed0f7a05493 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-webrtc
 Summary:    A WebRTC library in Tizen Native API
-Version:    0.3.301
+Version:    0.3.302
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 9a522edf7f3e42acd046cd45e98bcb679c1e04e2..57c484829977b073da263c31d354521469f8d400 100644 (file)
@@ -369,6 +369,10 @@ static bool __swcodec_set_bo(webrtc_display_s *display, video_decoded_data_info_
                goto ERROR;
        }
 
+       if (display->tbm->bo_list &&
+               display->tbm->bo_size != info->bo_size)
+               _destroy_tbm_bo_list(display->tbm);
+
        if (display->tbm->bo_list == NULL) {
                LOG_DEBUG("MMPixelFormatType[%d]", info->format);
                _create_tbm_bo_list(display->tbm, info->bo_size, 10); /* FIXME: use ini file to get list length */
index 2d80bb7783e84b296f382661ed614e915fcacdeb..1bff98c59a40729f95c959276b943f4677c603c0 100644 (file)
@@ -77,7 +77,10 @@ void _create_tbm_bo_list(webrtc_tbm_s *tbm, int bo_size, int list_length)
                LOG_DEBUG("bo[%p] is created", tbm_bo->bo);
                tbm->bo_list = g_list_append(tbm->bo_list, tbm_bo);
        }
-       LOG_DEBUG("tbm->bo_list[%p, length:%d] is created", tbm->bo_list, g_list_length(tbm->bo_list));
+       tbm->bo_size = bo_size;
+
+       LOG_INFO("tbm[bo_list[%p, length:%d], bo_size:%d] is created",
+               tbm->bo_list, g_list_length(tbm->bo_list), tbm->bo_size);
 }
 
 void *_get_unused_tbm_bo(webrtc_tbm_s *tbm, unsigned int timeout_sec)
@@ -178,4 +181,4 @@ void _release_tbm(webrtc_tbm_s *tbm)
 
        g_free(tbm);
 }
-//LCOV_EXCL_STOP
\ No newline at end of file
+//LCOV_EXCL_STOP