| 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 "media/capture/video/fake_video_capture_device.h" | 5 #include "media/capture/video/fake_video_capture_device.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 frame_cb_.Run(frame_format); | 94 frame_cb_.Run(frame_format); |
| 95 } | 95 } |
| 96 void OnIncomingCapturedVideoFrame( | 96 void OnIncomingCapturedVideoFrame( |
| 97 scoped_ptr<Buffer> buffer, | 97 scoped_ptr<Buffer> buffer, |
| 98 const scoped_refptr<media::VideoFrame>& frame, | 98 const scoped_refptr<media::VideoFrame>& frame, |
| 99 const base::TimeTicks& timestamp) { | 99 const base::TimeTicks& timestamp) { |
| 100 VideoCaptureFormat format(frame->natural_size(), 30.0, | 100 VideoCaptureFormat format(frame->natural_size(), 30.0, |
| 101 PIXEL_FORMAT_I420); | 101 PIXEL_FORMAT_I420); |
| 102 frame_cb_.Run(format); | 102 frame_cb_.Run(format); |
| 103 } | 103 } |
| 104 | 104 scoped_ptr<Buffer> ResurrectLastOutputBuffer( |
| 105 const gfx::Size& dimensions, |
| 106 media::VideoPixelFormat format, |
| 107 media::VideoPixelStorage storage) { |
| 108 return scoped_ptr<Buffer>(); |
| 109 } |
| 105 double GetBufferPoolUtilization() const override { return 0.0; } | 110 double GetBufferPoolUtilization() const override { return 0.0; } |
| 106 | 111 |
| 107 private: | 112 private: |
| 108 base::Callback<void(const VideoCaptureFormat&)> frame_cb_; | 113 base::Callback<void(const VideoCaptureFormat&)> frame_cb_; |
| 109 }; | 114 }; |
| 110 | 115 |
| 111 class DeviceEnumerationListener | 116 class DeviceEnumerationListener |
| 112 : public base::RefCounted<DeviceEnumerationListener> { | 117 : public base::RefCounted<DeviceEnumerationListener> { |
| 113 public: | 118 public: |
| 114 MOCK_METHOD1(OnEnumeratedDevicesCallbackPtr, | 119 MOCK_METHOD1(OnEnumeratedDevicesCallbackPtr, |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 } | 272 } |
| 268 } | 273 } |
| 269 | 274 |
| 270 INSTANTIATE_TEST_CASE_P(, | 275 INSTANTIATE_TEST_CASE_P(, |
| 271 FakeVideoCaptureDeviceCommandLineTest, | 276 FakeVideoCaptureDeviceCommandLineTest, |
| 272 Values(CommandLineTestData{"fps=-1", 5}, | 277 Values(CommandLineTestData{"fps=-1", 5}, |
| 273 CommandLineTestData{"fps=29.97", 29.97f}, | 278 CommandLineTestData{"fps=29.97", 29.97f}, |
| 274 CommandLineTestData{"fps=60", 60}, | 279 CommandLineTestData{"fps=60", 60}, |
| 275 CommandLineTestData{"fps=1000", 60})); | 280 CommandLineTestData{"fps=1000", 60})); |
| 276 }; // namespace media | 281 }; // namespace media |
| OLD | NEW |