| 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/location.h" | 7 #include "base/location.h" |
| 8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
| 9 #include "content/browser/browser_thread_impl.h" | 9 #include "content/browser/browser_thread_impl.h" |
| 10 #include "content/public/browser/desktop_media_id.h" | 10 #include "content/public/browser/desktop_media_id.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 MOCK_METHOD0(DoOnIncomingCapturedVideoFrame, void(void)); | 57 MOCK_METHOD0(DoOnIncomingCapturedVideoFrame, void(void)); |
| 58 MOCK_METHOD2(OnError, | 58 MOCK_METHOD2(OnError, |
| 59 void(const tracked_objects::Location& from_here, | 59 void(const tracked_objects::Location& from_here, |
| 60 const std::string& reason)); | 60 const std::string& reason)); |
| 61 | 61 |
| 62 // Trampoline methods to workaround GMOCK problems with scoped_ptr<>. | 62 // Trampoline methods to workaround GMOCK problems with scoped_ptr<>. |
| 63 scoped_ptr<Buffer> ReserveOutputBuffer( | 63 scoped_ptr<Buffer> ReserveOutputBuffer( |
| 64 const gfx::Size& dimensions, | 64 const gfx::Size& dimensions, |
| 65 media::VideoPixelFormat format, | 65 media::VideoPixelFormat format, |
| 66 media::VideoPixelStorage storage) override { | 66 media::VideoPixelStorage storage) override { |
| 67 EXPECT_TRUE((format == media::PIXEL_FORMAT_I420 && | 67 EXPECT_EQ(media::PIXEL_FORMAT_I420, format); |
| 68 storage == media::PIXEL_STORAGE_CPU) || | 68 EXPECT_EQ(media::PIXEL_STORAGE_CPU, storage); |
| 69 (format == media::PIXEL_FORMAT_ARGB && | |
| 70 storage == media::PIXEL_STORAGE_TEXTURE)); | |
| 71 DoReserveOutputBuffer(); | 69 DoReserveOutputBuffer(); |
| 72 return scoped_ptr<Buffer>(); | 70 return scoped_ptr<Buffer>(); |
| 73 } | 71 } |
| 74 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer, | 72 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer, |
| 75 const media::VideoCaptureFormat& frame_format, | 73 const media::VideoCaptureFormat& frame_format, |
| 76 const base::TimeTicks& timestamp) override { | 74 const base::TimeTicks& timestamp) override { |
| 77 DoOnIncomingCapturedBuffer(); | 75 DoOnIncomingCapturedBuffer(); |
| 78 } | 76 } |
| 79 void OnIncomingCapturedVideoFrame( | 77 void OnIncomingCapturedVideoFrame( |
| 80 scoped_ptr<Buffer> buffer, | 78 scoped_ptr<Buffer> buffer, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 media::VideoCaptureParams capture_params; | 148 media::VideoCaptureParams capture_params; |
| 151 capture_params.requested_format.frame_size.SetSize(640, 480); | 149 capture_params.requested_format.frame_size.SetSize(640, 480); |
| 152 capture_params.requested_format.frame_rate = kFrameRate; | 150 capture_params.requested_format.frame_rate = kFrameRate; |
| 153 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; | 151 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; |
| 154 capture_device->AllocateAndStart(capture_params, client.Pass()); | 152 capture_device->AllocateAndStart(capture_params, client.Pass()); |
| 155 capture_device->StopAndDeAllocate(); | 153 capture_device->StopAndDeAllocate(); |
| 156 } | 154 } |
| 157 | 155 |
| 158 } // namespace | 156 } // namespace |
| 159 } // namespace content | 157 } // namespace content |
| OLD | NEW |