diff --git a/inc/V4l2Capturer.h b/inc/V4l2Capturer.h index e0125b84..6f08fe4d 100644 --- a/inc/V4l2Capturer.h +++ b/inc/V4l2Capturer.h @@ -89,11 +89,11 @@ class V4l2Capturer : public rtc::VideoSourceInterface { char* buffer = new char[m_capture->getBufferSize()]; int frameSize = m_capture->read(buffer, m_capture->getBufferSize()); - int64_t ts = std::chrono::high_resolution_clock::now().time_since_epoch().count()/1000/1000; - rtc::scoped_refptr encodedData = webrtc::EncodedImageBuffer::Create((uint8_t*)buffer, frameSize); - rtc::scoped_refptr frameBuffer = new rtc::RefCountedObject(m_capture->getWidth(), m_capture->getHeight(), encodedData); + delete [] buffer; + int64_t ts = std::chrono::high_resolution_clock::now().time_since_epoch().count()/1000/1000; + rtc::scoped_refptr frameBuffer = new rtc::RefCountedObject(m_capture->getWidth(), m_capture->getHeight(), encodedData); webrtc::VideoFrame frame = webrtc::VideoFrame::Builder() .set_video_frame_buffer(frameBuffer) .set_rotation(webrtc::kVideoRotation_0)