GCond cond;
GMutex mutex;
GList *bo_list; /* for decoded video data by sw codec */
+ int bo_size;
} webrtc_tbm_s;
typedef struct _webrtc_display {
webrtc_tbm_s *_alloc_tbm(void);
void _release_tbm(webrtc_tbm_s *tbm);
void _create_tbm_bo_list(webrtc_tbm_s *tbm, int bo_size, int list_length);
+void _destroy_tbm_bo_list(webrtc_tbm_s *tbm);
void *_get_unused_tbm_bo(webrtc_tbm_s *tbm, unsigned int timeout_sec);
void _release_tbm_bo(webrtc_tbm_s *tbm, void *bo);
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 */
g_free(tbm_bo);
}
-static void __destroy_tbm_bo_list(webrtc_tbm_s *tbm)
+void _destroy_tbm_bo_list(webrtc_tbm_s *tbm)
{
g_autoptr(GMutexLocker) locker = NULL;
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)
{
RET_IF(tbm == NULL, "tbm is NULL");
- __destroy_tbm_bo_list(tbm);
+ _destroy_tbm_bo_list(tbm);
g_mutex_lock(&tbm->mutex);