| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 int count_frames_checked_; | 174 int count_frames_checked_; |
| 175 | 175 |
| 176 DISALLOW_COPY_AND_ASSIGN(EndToEndFrameChecker); | 176 DISALLOW_COPY_AND_ASSIGN(EndToEndFrameChecker); |
| 177 }; | 177 }; |
| 178 | 178 |
| 179 void CreateFrameAndMemsetPlane(VideoFrameFactory* const video_frame_factory) { | 179 void CreateFrameAndMemsetPlane(VideoFrameFactory* const video_frame_factory) { |
| 180 const scoped_refptr<media::VideoFrame> video_frame = | 180 const scoped_refptr<media::VideoFrame> video_frame = |
| 181 video_frame_factory->MaybeCreateFrame( | 181 video_frame_factory->MaybeCreateFrame( |
| 182 gfx::Size(kVideoWidth, kVideoHeight), base::TimeDelta()); | 182 gfx::Size(kVideoWidth, kVideoHeight), base::TimeDelta()); |
| 183 ASSERT_TRUE(video_frame.get()); | 183 ASSERT_TRUE(video_frame.get()); |
| 184 auto* cv_pixel_buffer = video_frame->cv_pixel_buffer(); | 184 auto* cv_pixel_buffer = video_frame->CvPixelBuffer(); |
| 185 ASSERT_TRUE(cv_pixel_buffer); | 185 ASSERT_TRUE(cv_pixel_buffer); |
| 186 CVPixelBufferLockBaseAddress(cv_pixel_buffer, 0); | 186 CVPixelBufferLockBaseAddress(cv_pixel_buffer, 0); |
| 187 auto* ptr = CVPixelBufferGetBaseAddressOfPlane(cv_pixel_buffer, 0); | 187 auto* ptr = CVPixelBufferGetBaseAddressOfPlane(cv_pixel_buffer, 0); |
| 188 ASSERT_TRUE(ptr); | 188 ASSERT_TRUE(ptr); |
| 189 memset(ptr, 0xfe, CVPixelBufferGetBytesPerRowOfPlane(cv_pixel_buffer, 0) * | 189 memset(ptr, 0xfe, CVPixelBufferGetBytesPerRowOfPlane(cv_pixel_buffer, 0) * |
| 190 CVPixelBufferGetHeightOfPlane(cv_pixel_buffer, 0)); | 190 CVPixelBufferGetHeightOfPlane(cv_pixel_buffer, 0)); |
| 191 CVPixelBufferUnlockBaseAddress(cv_pixel_buffer, 0); | 191 CVPixelBufferUnlockBaseAddress(cv_pixel_buffer, 0); |
| 192 } | 192 } |
| 193 | 193 |
| 194 void NoopFrameEncodedCallback( | 194 void NoopFrameEncodedCallback( |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 gfx::Size(kVideoWidth, kVideoHeight), base::TimeDelta())); | 407 gfx::Size(kVideoWidth, kVideoHeight), base::TimeDelta())); |
| 408 | 408 |
| 409 // After a power resume event, the factory should produce frames right away | 409 // After a power resume event, the factory should produce frames right away |
| 410 // because the encoder re-initializes on its own. | 410 // because the encoder re-initializes on its own. |
| 411 power_source_->GenerateResumeEvent(); | 411 power_source_->GenerateResumeEvent(); |
| 412 CreateFrameAndMemsetPlane(video_frame_factory.get()); | 412 CreateFrameAndMemsetPlane(video_frame_factory.get()); |
| 413 } | 413 } |
| 414 | 414 |
| 415 } // namespace cast | 415 } // namespace cast |
| 416 } // namespace media | 416 } // namespace media |
| OLD | NEW |