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

Side by Side Diff: content/renderer/media/video_capture_impl_unittest.cc

Issue 2419793003: media: Use native video enum types in media mojo interfaces (Closed)
Patch Set: media: Use native video enum types in media mojo interfaces Created 4 years, 2 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 (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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/shared_memory.h" 8 #include "base/memory/shared_memory.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "content/child/child_process.h" 10 #include "content/child/child_process.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 void BufferReceived(int buffer_id, const gfx::Size& size) { 129 void BufferReceived(int buffer_id, const gfx::Size& size) {
130 mojom::VideoFrameInfoPtr info = mojom::VideoFrameInfo::New(); 130 mojom::VideoFrameInfoPtr info = mojom::VideoFrameInfo::New();
131 131
132 const base::TimeTicks now = base::TimeTicks::Now(); 132 const base::TimeTicks now = base::TimeTicks::Now();
133 media::VideoFrameMetadata frame_metadata; 133 media::VideoFrameMetadata frame_metadata;
134 frame_metadata.SetTimeTicks(media::VideoFrameMetadata::REFERENCE_TIME, now); 134 frame_metadata.SetTimeTicks(media::VideoFrameMetadata::REFERENCE_TIME, now);
135 frame_metadata.MergeInternalValuesInto(&info->metadata); 135 frame_metadata.MergeInternalValuesInto(&info->metadata);
136 136
137 info->timestamp = now - base::TimeTicks(); 137 info->timestamp = now - base::TimeTicks();
138 info->pixel_format = media::mojom::VideoFormat::I420; 138 info->pixel_format = media::PIXEL_FORMAT_I420;
139 info->storage_type = media::PIXEL_STORAGE_CPU; 139 info->storage_type = media::PIXEL_STORAGE_CPU;
140 info->coded_size = size; 140 info->coded_size = size;
141 info->visible_rect = gfx::Rect(size); 141 info->visible_rect = gfx::Rect(size);
142 142
143 video_capture_impl_->OnBufferReady(buffer_id, std::move(info)); 143 video_capture_impl_->OnBufferReady(buffer_id, std::move(info));
144 } 144 }
145 145
146 void BufferDestroyed(int buffer_id) { 146 void BufferDestroyed(int buffer_id) {
147 video_capture_impl_->OnBufferDestroyed(buffer_id); 147 video_capture_impl_->OnBufferDestroyed(buffer_id);
148 } 148 }
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 EXPECT_CALL(mock_video_capture_host_, DoStart(_, kSessionId, params_small_)); 340 EXPECT_CALL(mock_video_capture_host_, DoStart(_, kSessionId, params_small_));
341 341
342 StartCapture(0, params_small_); 342 StartCapture(0, params_small_);
343 343
344 OnStateChanged(mojom::VideoCaptureState::FAILED); 344 OnStateChanged(mojom::VideoCaptureState::FAILED);
345 345
346 StopCapture(0); 346 StopCapture(0);
347 } 347 }
348 348
349 } // namespace content 349 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/video_capture_impl.cc ('k') | media/base/ipc/media_param_traits_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698