OLD | NEW |
---|---|
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 Loading... | |
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(VideoPixelFormat format, | 102 scoped_ptr<Buffer> ReserveOutputBuffer( |
103 const gfx::Size& dimensions) override { | 103 const gfx::Size& dimensions, |
104 media::VideoPixelFormat format, | |
105 media::VideoPixelStorage storage) override { | |
104 DoReserveOutputBuffer(); | 106 DoReserveOutputBuffer(); |
hubbe
2015/06/18 19:23:11
EXPECTs for format/storage?
mcasas
2015/06/19 02:58:36
Nope, normal VCDevices do not call this method,
so
| |
105 return scoped_ptr<Buffer>(); | 107 return scoped_ptr<Buffer>(); |
106 } | 108 } |
107 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer, | 109 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer, |
108 const VideoCaptureFormat& frame_format, | 110 const VideoCaptureFormat& frame_format, |
109 const base::TimeTicks& timestamp) override { | 111 const base::TimeTicks& timestamp) override { |
110 DoOnIncomingCapturedBuffer(); | 112 DoOnIncomingCapturedBuffer(); |
111 } | 113 } |
112 void OnIncomingCapturedVideoFrame(scoped_ptr<Buffer> buffer, | 114 void OnIncomingCapturedVideoFrame(scoped_ptr<Buffer> buffer, |
113 const scoped_refptr<VideoFrame>& frame, | 115 const scoped_refptr<VideoFrame>& frame, |
114 const base::TimeTicks& timestamp) override { | 116 const base::TimeTicks& timestamp) override { |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
468 // Use PIXEL_FORMAT_MAX to iterate all device names for testing | 470 // Use PIXEL_FORMAT_MAX to iterate all device names for testing |
469 // GetDeviceSupportedFormats(). | 471 // GetDeviceSupportedFormats(). |
470 scoped_ptr<VideoCaptureDevice::Name> name = | 472 scoped_ptr<VideoCaptureDevice::Name> name = |
471 GetFirstDeviceNameSupportingPixelFormat(PIXEL_FORMAT_MAX); | 473 GetFirstDeviceNameSupportingPixelFormat(PIXEL_FORMAT_MAX); |
472 // Verify no camera returned for PIXEL_FORMAT_MAX. Nothing else to test here | 474 // Verify no camera returned for PIXEL_FORMAT_MAX. Nothing else to test here |
473 // since we cannot forecast the hardware capabilities. | 475 // since we cannot forecast the hardware capabilities. |
474 ASSERT_FALSE(name); | 476 ASSERT_FALSE(name); |
475 } | 477 } |
476 | 478 |
477 }; // namespace media | 479 }; // namespace media |
OLD | NEW |