Revert "Convert native handles to buffers before encoding."
This reverts commit a831dc3a7d10a1fbaa258ee6b1ca6cfc7e91c5ca to unblock rolling into Chromium. BUG=4081 TBR=magjed@webrtc.org Review URL: https://webrtc-codereview.appspot.com/55549004 Cr-Commit-Position: refs/heads/master@{#9354}
This commit is contained in:
@ -200,10 +200,6 @@ void VCMGenericEncoder::OnDroppedFrame() {
|
||||
encoder_->OnDroppedFrame();
|
||||
}
|
||||
|
||||
bool VCMGenericEncoder::SupportsNativeHandle() const {
|
||||
return encoder_->SupportsNativeHandle();
|
||||
}
|
||||
|
||||
/***************************
|
||||
* Callback Implementation
|
||||
***************************/
|
||||
|
||||
@ -138,8 +138,6 @@ public:
|
||||
|
||||
void OnDroppedFrame();
|
||||
|
||||
bool SupportsNativeHandle() const;
|
||||
|
||||
private:
|
||||
VideoEncoder* const encoder_;
|
||||
VideoEncoderRateObserver* const rate_observer_;
|
||||
|
||||
@ -321,16 +321,8 @@ int32_t VideoSender::AddVideoFrame(const VideoFrame& videoFrame,
|
||||
LOG(LS_ERROR) << "Incoming frame doesn't match set resolution. Dropping.";
|
||||
return VCM_PARAMETER_ERROR;
|
||||
}
|
||||
VideoFrame converted_frame = videoFrame;
|
||||
if (converted_frame.native_handle() && !_encoder->SupportsNativeHandle()) {
|
||||
// This module only supports software encoding.
|
||||
// TODO(pbos): Offload conversion from the encoder thread.
|
||||
converted_frame = converted_frame.ConvertNativeToI420Frame();
|
||||
CHECK(!converted_frame.IsZeroSize())
|
||||
<< "Frame conversion failed, won't be able to encode frame.";
|
||||
}
|
||||
int32_t ret =
|
||||
_encoder->Encode(converted_frame, codecSpecificInfo, _nextFrameTypes);
|
||||
_encoder->Encode(videoFrame, codecSpecificInfo, _nextFrameTypes);
|
||||
if (ret < 0) {
|
||||
LOG(LS_ERROR) << "Failed to encode frame. Error code: " << ret;
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user