Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Unified Diff: webrtc/modules/video_coding/codecs/test/videoprocessor.cc

Issue 2906053002: Update I420Buffer to new VideoFrameBuffer interface (Closed)
Patch Set: Make const versions of Get functions Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/video_coding/codecs/test/videoprocessor.cc
diff --git a/webrtc/modules/video_coding/codecs/test/videoprocessor.cc b/webrtc/modules/video_coding/codecs/test/videoprocessor.cc
index 623c417ff53bdfab4f0b3d840d906c0df5d13d34..5b4ad42a807c8d0af4732d7c56d046423173fb06 100644
--- a/webrtc/modules/video_coding/codecs/test/videoprocessor.cc
+++ b/webrtc/modules/video_coding/codecs/test/videoprocessor.cc
@@ -246,7 +246,7 @@ bool VideoProcessorImpl::ProcessFrame(int frame_number) {
<< "Must process frames without gaps.";
RTC_DCHECK(initialized_) << "Attempting to use uninitialized VideoProcessor";
- rtc::scoped_refptr<VideoFrameBuffer> buffer(
+ rtc::scoped_refptr<I420BufferInterface> buffer(
analysis_frame_reader_->ReadFrame());
if (!buffer) {
@@ -465,12 +465,7 @@ void VideoProcessorImpl::FrameDecoded(const VideoFrame& image) {
rtc::scoped_refptr<I420Buffer> scaled_buffer(I420Buffer::Create(
config_.codec_settings->width, config_.codec_settings->height));
// Should be the same aspect ratio, no cropping needed.
- if (image.video_frame_buffer()->native_handle()) {
- scaled_buffer->ScaleFrom(
- *image.video_frame_buffer()->NativeToI420Buffer());
- } else {
- scaled_buffer->ScaleFrom(*image.video_frame_buffer());
- }
+ scaled_buffer->ScaleFrom(*image.video_frame_buffer()->ToI420());
size_t length = CalcBufferSize(VideoType::kI420, scaled_buffer->width(),
scaled_buffer->height());
@@ -482,14 +477,8 @@ void VideoProcessorImpl::FrameDecoded(const VideoFrame& image) {
size_t length =
CalcBufferSize(VideoType::kI420, image.width(), image.height());
extracted_buffer.SetSize(length);
- if (image.video_frame_buffer()->native_handle()) {
- extracted_length =
- ExtractBuffer(image.video_frame_buffer()->NativeToI420Buffer(),
- length, extracted_buffer.data());
- } else {
- extracted_length = ExtractBuffer(image.video_frame_buffer(), length,
- extracted_buffer.data());
- }
+ extracted_length = ExtractBuffer(image.video_frame_buffer()->ToI420(),
+ length, extracted_buffer.data());
}
RTC_DCHECK_EQ(extracted_length, analysis_frame_writer_->FrameLength());
« no previous file with comments | « webrtc/media/base/videocapturer.cc ('k') | webrtc/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698