static bool obs_init_textures(struct obs_video_info *ovi) { struct obs_video *video = &obs->video; size_t i; for (i = 0; i < NUM_TEXTURES; i++) { video->copy_surfaces[i] = gs_create_stagesurface( ovi->output_width, ovi->output_height, GS_RGBA); if (!video->copy_surfaces[i]) return false; video->render_textures[i] = gs_create_texture( ovi->base_width, ovi->base_height, GS_RGBA, 1, NULL, GS_RENDERTARGET); if (!video->render_textures[i]) return false; video->output_textures[i] = gs_create_texture( ovi->output_width, ovi->output_height, GS_RGBA, 1, NULL, GS_RENDERTARGET); if (!video->output_textures[i]) return false; } return true; }
static bool obs_init_textures(struct obs_video_info *ovi) { struct obs_core_video *video = &obs->video; bool yuv = format_is_yuv(ovi->output_format); uint32_t output_height = video->gpu_conversion ? video->conversion_height : ovi->output_height; size_t i; for (i = 0; i < NUM_TEXTURES; i++) { video->copy_surfaces[i] = gs_create_stagesurface( ovi->output_width, output_height, GS_RGBA); if (!video->copy_surfaces[i]) return false; video->render_textures[i] = gs_create_texture( ovi->base_width, ovi->base_height, GS_RGBA, 1, NULL, GS_RENDERTARGET); if (!video->render_textures[i]) return false; video->output_textures[i] = gs_create_texture( ovi->output_width, ovi->output_height, GS_RGBA, 1, NULL, GS_RENDERTARGET); if (!video->output_textures[i]) return false; if (yuv) source_frame_init(&video->convert_frames[i], ovi->output_format, ovi->output_width, ovi->output_height); } return true; }