+ // The live frame just shows the RGBA texture we just rendered.
+ // It owns rgba_tex now.
+ DisplayFrame live_frame;
+ live_frame.chain = display_chain.get();
+ live_frame.setup_chain = [this, rgba_tex]{
+ display_input->set_texture_num(rgba_tex);
+ };
+ live_frame.ready_fence = fence;
+ live_frame.input_frames = {};
+ live_frame.temp_textures = { rgba_tex };
+ output_channel[OUTPUT_LIVE].output_frame(live_frame);
+
+ // The preview frame shows the first input. Note that the textures
+ // are owned by the input frame, not the display frame.
+ const PBOFrameAllocator::Userdata *input0_userdata = (const PBOFrameAllocator::Userdata *)bmusb_current_rendering_frame[0]->userdata;
+ GLuint input0_y_tex = input0_userdata->tex_y;
+ GLuint input0_cbcr_tex = input0_userdata->tex_cbcr;
+ DisplayFrame preview_frame;
+ preview_frame.chain = preview_chain.get();
+ preview_frame.setup_chain = [this, input0_y_tex, input0_cbcr_tex]{
+ preview_input->set_texture_num(0, input0_y_tex);
+ preview_input->set_texture_num(1, input0_cbcr_tex);
+ };
+ preview_frame.ready_fence = fence;
+ preview_frame.input_frames = { bmusb_current_rendering_frame[0] };
+ preview_frame.temp_textures = {};
+ output_channel[OUTPUT_PREVIEW].output_frame(preview_frame);