RET_VAL_IF(info == NULL, false, "info is NULL");
switch (info->format) {
+ case MM_PIXEL_FORMAT_NV12:
case MM_PIXEL_FORMAT_I420:
case MM_PIXEL_FORMAT_YV12: {
int ret = TBM_SURFACE_ERROR_NONE;
+ uint32_t tbm_format;
tbm_surface_h ts;
tbm_surface_info_s ts_info;
unsigned int i;
- ts = tbm_surface_create(info->width, info->height, info->format == MM_PIXEL_FORMAT_I420 ? TBM_FORMAT_YUV420 : TBM_FORMAT_YVU420);
+ RET_VAL_IF(__get_tbm_surface_format(info->format, &tbm_format) != WEBRTC_ERROR_NONE, NULL, "could not get tbm format");
+
+ ts = tbm_surface_create(info->width, info->height, tbm_format);
RET_VAL_IF(ts == NULL, false, "failed to tbm_surface_create()");
ret = tbm_surface_get_info(ts, &ts_info);
tbm_surface_destroy(ts);
}
switch (info->format) {
+ case MM_PIXEL_FORMAT_NV12: {
+ src_stride[0] = src_stride[1] = GST_ROUND_UP_4(info->width);
+ src_offset[1] = src_stride[0] * GST_ROUND_UP_2(info->height);
+ dest_offset[0] = 0;
+ dest_offset[1] = info->stride[0] * info->elevation[0];
+
+ for (i = 0; i < info->plane_num; i++) {
+ src = mapinfo.data + src_offset[i];
+ dest = thandle.ptr + dest_offset[i];
+
+ if (i > 0)
+ k = 1;
+
+ for (j = 0; j < info->height >> k; j++) {
+ memcpy(dest, src, info->width);
+ src += src_stride[i];
+ dest += info->stride[i];
+ }
+ }
+ break;
+ }
case MM_PIXEL_FORMAT_I420:
case MM_PIXEL_FORMAT_YV12: {
int u_plane_idx = info->format == MM_PIXEL_FORMAT_I420 ? 1 : 2;
const char *videosink_factory_name;
GList *element_list = NULL;
bool display_is_set;
- int ret = WEBRTC_ERROR_NONE;
g_autoptr(GMutexLocker) locker = NULL;
RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
locker = g_mutex_locker_new(&sink->display->mutex);
#ifndef TIZEN_TV
if (sink->display->type == WEBRTC_DISPLAY_TYPE_OVERLAY && webrtc->ini.resource_acquisition.video_overlay) {
- if ((ret = _acquire_resource_for_type(webrtc, MM_RESOURCE_MANAGER_RES_TYPE_VIDEO_OVERLAY)))
+ int ret = _acquire_resource_for_type(webrtc, MM_RESOURCE_MANAGER_RES_TYPE_VIDEO_OVERLAY);
+ if (ret != WEBRTC_ERROR_NONE)
return ret;
}
#endif