| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/desktop_capture_device_aura.h" | 5 #include "content/browser/media/capture/desktop_capture_device_aura.h" |
| 6 | 6 |
| 7 #include "base/synchronization/waitable_event.h" | 7 #include "base/synchronization/waitable_event.h" |
| 8 #include "content/browser/browser_thread_impl.h" | 8 #include "content/browser/browser_thread_impl.h" |
| 9 #include "content/public/browser/desktop_media_id.h" | 9 #include "content/public/browser/desktop_media_id.h" |
| 10 #include "media/base/video_capture_types.h" | 10 #include "media/base/video_capture_types.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 size_t v_stride, | 50 size_t v_stride, |
| 51 const media::VideoCaptureFormat& frame_format, | 51 const media::VideoCaptureFormat& frame_format, |
| 52 int clockwise_rotation, | 52 int clockwise_rotation, |
| 53 const base::TimeTicks& timestamp)); | 53 const base::TimeTicks& timestamp)); |
| 54 MOCK_METHOD0(DoReserveOutputBuffer, void(void)); | 54 MOCK_METHOD0(DoReserveOutputBuffer, void(void)); |
| 55 MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void)); | 55 MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void)); |
| 56 MOCK_METHOD0(DoOnIncomingCapturedVideoFrame, void(void)); | 56 MOCK_METHOD0(DoOnIncomingCapturedVideoFrame, void(void)); |
| 57 MOCK_METHOD1(OnError, void(const std::string& reason)); | 57 MOCK_METHOD1(OnError, void(const std::string& reason)); |
| 58 | 58 |
| 59 // Trampoline methods to workaround GMOCK problems with scoped_ptr<>. | 59 // Trampoline methods to workaround GMOCK problems with scoped_ptr<>. |
| 60 scoped_ptr<Buffer> ReserveOutputBuffer(media::VideoPixelFormat format, | 60 scoped_ptr<Buffer> ReserveOutputBuffer( |
| 61 const gfx::Size& dimensions) override { | 61 const gfx::Size& dimensions, |
| 62 media::VideoPixelFormat format, |
| 63 media::VideoPixelStorage storage) override { |
| 64 EXPECT_TRUE((format == media::PIXEL_FORMAT_I420 && |
| 65 storage == media::PIXEL_STORAGE_CPU) || |
| 66 (format == media::PIXEL_FORMAT_ARGB && |
| 67 storage == media::PIXEL_STORAGE_TEXTURE)); |
| 62 DoReserveOutputBuffer(); | 68 DoReserveOutputBuffer(); |
| 63 return scoped_ptr<Buffer>(); | 69 return scoped_ptr<Buffer>(); |
| 64 } | 70 } |
| 65 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer, | 71 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer, |
| 66 const media::VideoCaptureFormat& frame_format, | 72 const media::VideoCaptureFormat& frame_format, |
| 67 const base::TimeTicks& timestamp) override { | 73 const base::TimeTicks& timestamp) override { |
| 68 DoOnIncomingCapturedBuffer(); | 74 DoOnIncomingCapturedBuffer(); |
| 69 } | 75 } |
| 70 void OnIncomingCapturedVideoFrame( | 76 void OnIncomingCapturedVideoFrame( |
| 71 scoped_ptr<Buffer> buffer, | 77 scoped_ptr<Buffer> buffer, |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 media::VideoCaptureParams capture_params; | 145 media::VideoCaptureParams capture_params; |
| 140 capture_params.requested_format.frame_size.SetSize(640, 480); | 146 capture_params.requested_format.frame_size.SetSize(640, 480); |
| 141 capture_params.requested_format.frame_rate = kFrameRate; | 147 capture_params.requested_format.frame_rate = kFrameRate; |
| 142 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; | 148 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; |
| 143 capture_device->AllocateAndStart(capture_params, client.Pass()); | 149 capture_device->AllocateAndStart(capture_params, client.Pass()); |
| 144 capture_device->StopAndDeAllocate(); | 150 capture_device->StopAndDeAllocate(); |
| 145 } | 151 } |
| 146 | 152 |
| 147 } // namespace | 153 } // namespace |
| 148 } // namespace content | 154 } // namespace content |
| OLD | NEW |