Merge "Extract setup_frame_size and update_frame_context functions." into experimental