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

Side by Side Diff: content/browser/renderer_host/media/video_capture_host.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
« no previous file with comments | « no previous file | content/common/video_capture.mojom » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/browser/renderer_host/media/video_capture_host.h" 5 #include "content/browser/renderer_host/media/video_capture_host.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 return; 89 return;
90 90
91 if (!base::ContainsKey(device_id_to_observer_map_, controller_id)) 91 if (!base::ContainsKey(device_id_to_observer_map_, controller_id))
92 return; 92 return;
93 93
94 mojom::VideoFrameInfoPtr info = mojom::VideoFrameInfo::New(); 94 mojom::VideoFrameInfoPtr info = mojom::VideoFrameInfo::New();
95 info->timestamp = video_frame->timestamp(); 95 info->timestamp = video_frame->timestamp();
96 video_frame->metadata()->MergeInternalValuesInto(&info->metadata); 96 video_frame->metadata()->MergeInternalValuesInto(&info->metadata);
97 97
98 DCHECK_EQ(media::PIXEL_FORMAT_I420, video_frame->format()); 98 DCHECK_EQ(media::PIXEL_FORMAT_I420, video_frame->format());
99 info->pixel_format = media::mojom::VideoFormat::I420; 99 info->pixel_format = media::PIXEL_FORMAT_I420;
100 info->storage_type = media::PIXEL_STORAGE_CPU; 100 info->storage_type = media::PIXEL_STORAGE_CPU;
101 info->coded_size = video_frame->coded_size(); 101 info->coded_size = video_frame->coded_size();
102 info->visible_rect = video_frame->visible_rect(); 102 info->visible_rect = video_frame->visible_rect();
103 103
104 device_id_to_observer_map_[controller_id]->OnBufferReady(buffer_id, 104 device_id_to_observer_map_[controller_id]->OnBufferReady(buffer_id,
105 std::move(info)); 105 std::move(info));
106 } 106 }
107 107
108 void VideoCaptureHost::OnEnded(VideoCaptureControllerID controller_id) { 108 void VideoCaptureHost::OnEnded(VideoCaptureControllerID controller_id) {
109 DVLOG(1) << __func__; 109 DVLOG(1) << __func__;
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 const base::WeakPtr<VideoCaptureController> controller = it->second; 325 const base::WeakPtr<VideoCaptureController> controller = it->second;
326 controllers_.erase(it); 326 controllers_.erase(it);
327 if (!controller) 327 if (!controller)
328 return; 328 return;
329 329
330 media_stream_manager_->video_capture_manager()->StopCaptureForClient( 330 media_stream_manager_->video_capture_manager()->StopCaptureForClient(
331 controller.get(), controller_id, this, on_error); 331 controller.get(), controller_id, this, on_error);
332 } 332 }
333 333
334 } // namespace content 334 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/common/video_capture.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698