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

Side by Side Diff: media/video/capture/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
« no previous file with comments | « media/video/capture/video_capture_device.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 int length, 92 int length,
93 const VideoCaptureFormat& format, 93 const VideoCaptureFormat& format,
94 int rotation, 94 int rotation,
95 const base::TimeTicks& timestamp) override { 95 const base::TimeTicks& timestamp) override {
96 ASSERT_GT(length, 0); 96 ASSERT_GT(length, 0);
97 ASSERT_TRUE(data != NULL); 97 ASSERT_TRUE(data != NULL);
98 main_thread_->PostTask(FROM_HERE, base::Bind(frame_cb_, format)); 98 main_thread_->PostTask(FROM_HERE, base::Bind(frame_cb_, format));
99 } 99 }
100 100
101 // Trampoline methods to workaround GMOCK problems with scoped_ptr<>. 101 // Trampoline methods to workaround GMOCK problems with scoped_ptr<>.
102 scoped_ptr<Buffer> ReserveOutputBuffer( 102 scoped_ptr<Buffer> ReserveOutputBuffer(VideoPixelFormat format,
103 const gfx::Size& dimensions, 103 const gfx::Size& dimensions) override {
104 media::VideoPixelFormat format,
105 media::VideoPixelStorage storage) override {
106 DoReserveOutputBuffer(); 104 DoReserveOutputBuffer();
107 NOTREACHED() << "This should never be called";
108 return scoped_ptr<Buffer>(); 105 return scoped_ptr<Buffer>();
109 } 106 }
110 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer, 107 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer,
111 const VideoCaptureFormat& frame_format, 108 const VideoCaptureFormat& frame_format,
112 const base::TimeTicks& timestamp) override { 109 const base::TimeTicks& timestamp) override {
113 DoOnIncomingCapturedBuffer(); 110 DoOnIncomingCapturedBuffer();
114 } 111 }
115 void OnIncomingCapturedVideoFrame(scoped_ptr<Buffer> buffer, 112 void OnIncomingCapturedVideoFrame(scoped_ptr<Buffer> buffer,
116 const scoped_refptr<VideoFrame>& frame, 113 const scoped_refptr<VideoFrame>& frame,
117 const base::TimeTicks& timestamp) override { 114 const base::TimeTicks& timestamp) override {
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 // Use PIXEL_FORMAT_MAX to iterate all device names for testing 468 // Use PIXEL_FORMAT_MAX to iterate all device names for testing
472 // GetDeviceSupportedFormats(). 469 // GetDeviceSupportedFormats().
473 scoped_ptr<VideoCaptureDevice::Name> name = 470 scoped_ptr<VideoCaptureDevice::Name> name =
474 GetFirstDeviceNameSupportingPixelFormat(PIXEL_FORMAT_MAX); 471 GetFirstDeviceNameSupportingPixelFormat(PIXEL_FORMAT_MAX);
475 // Verify no camera returned for PIXEL_FORMAT_MAX. Nothing else to test here 472 // Verify no camera returned for PIXEL_FORMAT_MAX. Nothing else to test here
476 // since we cannot forecast the hardware capabilities. 473 // since we cannot forecast the hardware capabilities.
477 ASSERT_FALSE(name); 474 ASSERT_FALSE(name);
478 } 475 }
479 476
480 }; // namespace media 477 }; // namespace media
OLDNEW
« no previous file with comments | « media/video/capture/video_capture_device.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698