@@ -192,10 +192,12 @@ void LibargusEglCapturer::InitCamera() {
192192 Argus::UniqueObj<Argus::OutputStreamSettings> stream_settings (
193193 icapture_session_->createOutputStreamSettings (Argus::STREAM_TYPE_EGL));
194194 auto iegl_stream_settings = interface_cast<Argus::IEGLOutputStreamSettings>(stream_settings);
195- if (iegl_stream_settings) {
196- iegl_stream_settings->setPixelFormat (Argus::PIXEL_FMT_YCbCr_420_888);
197- iegl_stream_settings->setResolution (Argus::Size2D<uint32_t >(width_, height_));
195+ if (!iegl_stream_settings) {
196+ throw std::runtime_error (" Failed to get IEGLOutputStreamSettings" );
198197 }
198+ iegl_stream_settings->setEGLDisplay (EGL_NO_DISPLAY);
199+ iegl_stream_settings->setPixelFormat (Argus::PIXEL_FMT_YCbCr_420_888);
200+ iegl_stream_settings->setResolution (Argus::Size2D<uint32_t >(width_, height_));
199201
200202 output_stream_ = Argus::UniqueObj<Argus::OutputStream>(
201203 icapture_session_->createOutputStream (stream_settings.get ()));
@@ -300,7 +302,7 @@ rtc::scoped_refptr<webrtc::I420BufferInterface> LibargusEglCapturer::GetI420Fram
300302
301303void LibargusEglCapturer::StartCapture () {
302304 framesize_ = width_ * height_ + ((width_ + 1 ) / 2 ) * ((height_ + 1 ) / 2 ) * 2 ;
303- frame_buffer_ = V4L2FrameBuffer::Create (width_, height_, framesize_, V4L2_PIX_FMT_YUV420 );
305+ frame_buffer_ = V4L2FrameBuffer::Create (width_, height_, framesize_, format_ );
304306
305307 if (iegl_stream_->waitUntilConnected () != Argus::STATUS_OK) {
306308 ERROR_PRINT (" Stream failed to connect." );
0 commit comments