Index: webrtc/modules/video_coding/video_sender.cc |
diff --git a/webrtc/modules/video_coding/video_sender.cc b/webrtc/modules/video_coding/video_sender.cc |
index b9c5ea547a40865cc18e1eb49c657504c22c31cc..e2c0d1f8a93581b8910526592e608faa68f1a6b7 100644 |
--- a/webrtc/modules/video_coding/video_sender.cc |
+++ b/webrtc/modules/video_coding/video_sender.cc |
@@ -288,9 +288,17 @@ int32_t VideoSender::AddVideoFrame(const VideoFrame& videoFrame, |
!_encoder->SupportsNativeHandle()) { |
// This module only supports software encoding. |
// TODO(pbos): Offload conversion from the encoder thread. |
- converted_frame = converted_frame.ConvertNativeToI420Frame(); |
- RTC_CHECK(!converted_frame.IsZeroSize()) |
- << "Frame conversion failed, won't be able to encode frame."; |
+ rtc::scoped_refptr<VideoFrameBuffer> converted_buffer( |
+ converted_frame.video_frame_buffer()->NativeToI420Buffer()); |
+ |
+ if (!converted_buffer) { |
+ LOG(LS_ERROR) << "Frame conversion failed, dropping frame."; |
+ return VCM_PARAMETER_ERROR; |
+ } |
+ converted_frame = VideoFrame(converted_buffer, |
+ converted_frame.timestamp(), |
+ converted_frame.render_time_ms(), |
+ converted_frame.rotation()); |
} |
int32_t ret = |
_encoder->Encode(converted_frame, codecSpecificInfo, next_frame_types); |