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

Side by Side Diff: content/browser/media/capture/web_contents_video_capture_device_unittest.cc

Issue 1204843004: Revert of Video Capture: extract storage info from pixel format in VideoCaptureFormat. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/media/capture/web_contents_video_capture_device.h" 5 #include "content/browser/media/capture/web_contents_video_capture_device.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/debug/debugger.h" 8 #include "base/debug/debugger.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/test/test_timeouts.h" 10 #include "base/test/test_timeouts.h"
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 size_t y_stride, 342 size_t y_stride,
343 size_t u_stride, 343 size_t u_stride,
344 size_t v_stride, 344 size_t v_stride,
345 const media::VideoCaptureFormat& frame_format, 345 const media::VideoCaptureFormat& frame_format,
346 int clockwise_rotation, 346 int clockwise_rotation,
347 const base::TimeTicks& timestamp)); 347 const base::TimeTicks& timestamp));
348 348
349 MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void)); 349 MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void));
350 350
351 scoped_ptr<media::VideoCaptureDevice::Client::Buffer> ReserveOutputBuffer( 351 scoped_ptr<media::VideoCaptureDevice::Client::Buffer> ReserveOutputBuffer(
352 const gfx::Size& dimensions,
353 media::VideoPixelFormat format, 352 media::VideoPixelFormat format,
354 media::VideoPixelStorage storage) override { 353 const gfx::Size& dimensions) override {
355 CHECK_EQ(format, media::PIXEL_FORMAT_I420); 354 CHECK_EQ(format, media::PIXEL_FORMAT_I420);
356 int buffer_id_to_drop = VideoCaptureBufferPool::kInvalidId; // Ignored. 355 int buffer_id_to_drop = VideoCaptureBufferPool::kInvalidId; // Ignored.
357 const int buffer_id = buffer_pool_->ReserveForProducer( 356 int buffer_id = buffer_pool_->ReserveForProducer(format, dimensions,
358 format, storage, dimensions, &buffer_id_to_drop); 357 &buffer_id_to_drop);
359 if (buffer_id == VideoCaptureBufferPool::kInvalidId) 358 if (buffer_id == VideoCaptureBufferPool::kInvalidId)
360 return NULL; 359 return NULL;
361 360
362 return scoped_ptr<media::VideoCaptureDevice::Client::Buffer>( 361 return scoped_ptr<media::VideoCaptureDevice::Client::Buffer>(
363 new AutoReleaseBuffer( 362 new AutoReleaseBuffer(
364 buffer_pool_, buffer_pool_->GetBufferHandle(buffer_id), buffer_id)); 363 buffer_pool_, buffer_pool_->GetBufferHandle(buffer_id), buffer_id));
365 } 364 }
366 // Trampoline method to workaround GMOCK problems with scoped_ptr<>. 365 // Trampoline method to workaround GMOCK problems with scoped_ptr<>.
367 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer, 366 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer,
368 const media::VideoCaptureFormat& frame_format, 367 const media::VideoCaptureFormat& frame_format,
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColorAndFrameSize( 1065 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColorAndFrameSize(
1067 SK_ColorBLACK, gfx::Size(kTestWidth, 1066 SK_ColorBLACK, gfx::Size(kTestWidth,
1068 kTestWidth * arbitrary_source_size.height() / 1067 kTestWidth * arbitrary_source_size.height() /
1069 arbitrary_source_size.width()))); 1068 arbitrary_source_size.width())));
1070 1069
1071 device()->StopAndDeAllocate(); 1070 device()->StopAndDeAllocate();
1072 } 1071 }
1073 1072
1074 } // namespace 1073 } // namespace
1075 } // namespace content 1074 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/media/capture/desktop_capture_device_unittest.cc ('k') | content/browser/media/media_internals_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698