+#ifdef TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER
+ if (!V4L2_TYPE_IS_OUTPUT (v4l2object->type) &&
+ v4l2object->mode == GST_V4L2_IO_DMABUF) {
+ tbm_surface_h tmp_surface = NULL;
+ int width = GST_VIDEO_INFO_WIDTH (&v4l2object->info);
+ int height = GST_VIDEO_INFO_HEIGHT (&v4l2object->info);
+
+ tmp_surface = tbm_surface_create (width, height,
+ __get_tbm_format (GST_VIDEO_INFO_FORMAT (&v4l2object->info)));
+ if (tmp_surface) {
+ tbm_surface_get_info (tmp_surface, &allocator->s_info);
+ GST_INFO_OBJECT (allocator, "[%dx%d] -> tbm surface info[%dx%d]",
+ width, height, allocator->s_info.width, allocator->s_info.height);
+ tbm_surface_destroy (tmp_surface);
+ } else {
+ GST_ERROR_OBJECT (allocator, "[%dx%d] surface failed", width, height);
+ }
+
+ allocator->bufmgr = tbm_bufmgr_init (-1);
+ if (!allocator->bufmgr) {
+ GST_ERROR_OBJECT (allocator, "tbm bufmgr failed");
+ gst_object_unref (allocator);
+ return NULL;
+ }
+ }
+#endif /* TIZEN_FEATURE_TBM_SUPPORT_FOR_V4L2_DECODER */