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

Side by Side Diff: content/browser/media/capture/desktop_capture_device_aura_unittest.cc

Issue 1983193002: Decouple capture timestamp and reference time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 23 matching lines...) Expand all
34 class VideoFrame; 34 class VideoFrame;
35 } // namespace media 35 } // namespace media
36 36
37 namespace content { 37 namespace content {
38 namespace { 38 namespace {
39 39
40 const int kFrameRate = 30; 40 const int kFrameRate = 30;
41 41
42 class MockDeviceClient : public media::VideoCaptureDevice::Client { 42 class MockDeviceClient : public media::VideoCaptureDevice::Client {
43 public: 43 public:
44 MOCK_METHOD5(OnIncomingCapturedData, 44 MOCK_METHOD6(OnIncomingCapturedData,
45 void(const uint8_t* data, 45 void(const uint8_t* data,
46 int length, 46 int length,
47 const media::VideoCaptureFormat& frame_format, 47 const media::VideoCaptureFormat& frame_format,
48 int rotation, 48 int rotation,
49 const base::TimeTicks& timestamp)); 49 base::TimeTicks reference_time,
50 MOCK_METHOD9(OnIncomingCapturedYuvData, 50 base::TimeDelta tiemstamp));
51 void(const uint8_t* y_data,
52 const uint8_t* u_data,
53 const uint8_t* v_data,
54 size_t y_stride,
55 size_t u_stride,
56 size_t v_stride,
57 const media::VideoCaptureFormat& frame_format,
58 int clockwise_rotation,
59 const base::TimeTicks& timestamp));
60 MOCK_METHOD0(DoReserveOutputBuffer, void(void)); 51 MOCK_METHOD0(DoReserveOutputBuffer, void(void));
61 MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void)); 52 MOCK_METHOD0(DoOnIncomingCapturedBuffer, void(void));
62 MOCK_METHOD0(DoOnIncomingCapturedVideoFrame, void(void)); 53 MOCK_METHOD0(DoOnIncomingCapturedVideoFrame, void(void));
63 MOCK_METHOD0(DoResurrectLastOutputBuffer, void(void)); 54 MOCK_METHOD0(DoResurrectLastOutputBuffer, void(void));
64 MOCK_METHOD2(OnError, 55 MOCK_METHOD2(OnError,
65 void(const tracked_objects::Location& from_here, 56 void(const tracked_objects::Location& from_here,
66 const std::string& reason)); 57 const std::string& reason));
67 58
68 // Trampoline methods to workaround GMOCK problems with std::unique_ptr<>. 59 // Trampoline methods to workaround GMOCK problems with std::unique_ptr<>.
69 std::unique_ptr<Buffer> ReserveOutputBuffer( 60 std::unique_ptr<Buffer> ReserveOutputBuffer(
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 media::VideoCaptureParams capture_params; 153 media::VideoCaptureParams capture_params;
163 capture_params.requested_format.frame_size.SetSize(640, 480); 154 capture_params.requested_format.frame_size.SetSize(640, 480);
164 capture_params.requested_format.frame_rate = kFrameRate; 155 capture_params.requested_format.frame_rate = kFrameRate;
165 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420; 156 capture_params.requested_format.pixel_format = media::PIXEL_FORMAT_I420;
166 capture_device->AllocateAndStart(capture_params, std::move(client)); 157 capture_device->AllocateAndStart(capture_params, std::move(client));
167 capture_device->StopAndDeAllocate(); 158 capture_device->StopAndDeAllocate();
168 } 159 }
169 160
170 } // namespace 161 } // namespace
171 } // namespace content 162 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698