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

Side by Side Diff: services/video_capture/receiver_mojo_to_media_adapter.cc

Issue 2378943002: Let clients interact with VideoCaptureDeviceClient instead of VideoCaptureDevice (Closed)
Patch Set: * Rename a class * formatting 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "services/video_capture/receiver_mojo_to_media_adapter.h"
6
7 #include "media/mojo/common/media_type_converters.h"
8 #include "media/mojo/common/mojo_shared_buffer_video_frame.h"
9
10 namespace video_capture {
11
12 ReceiverMojoToMediaAdapter::ReceiverMojoToMediaAdapter(
13 mojom::VideoFrameReceiverPtr receiver,
14 const media::VideoCaptureParams& params)
15 : receiver_(std::move(receiver)) {
16 // TODO: remove |params| if not needed
mcasas 2016/10/05 17:24:00 Not needed now, right? Remove.
chfremer 2016/10/05 23:30:28 Done.
17 }
18
19 ReceiverMojoToMediaAdapter::~ReceiverMojoToMediaAdapter() = default;
20
21 void ReceiverMojoToMediaAdapter::OnIncomingCapturedVideoFrame(
22 std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> buffer,
23 const scoped_refptr<media::VideoFrame>& frame) {
24 // O: |frame| should already be backed by a MojoSharedBufferVideoFrame
25 // assuming we have used the correct buffer factory with the pool.
26 // TODO: what do we do for GPU memory buffers?
27 auto video_frame_ptr = media::mojom::VideoFrame::From(frame);
28 receiver_->OnIncomingCapturedVideoFrame(std::move(video_frame_ptr));
29 }
30
31 void ReceiverMojoToMediaAdapter::OnError() {
32 receiver_->OnError();
33 }
34
35 void ReceiverMojoToMediaAdapter::OnLog(const std::string& message) {
36 receiver_->OnLog(message);
37 }
38
39 void ReceiverMojoToMediaAdapter::OnBufferDestroyed(int buffer_id_to_drop) {
40 // TODO: is this needed?
41 // Q: How does client tell service that it is finished with a buffer?
mcasas 2016/10/05 17:24:00 This Qs have to turn into TODOs or, if observation
chfremer 2016/10/05 23:30:28 Done.
42 }
43
44 } // namespace video_capture
OLDNEW
« no previous file with comments | « services/video_capture/receiver_mojo_to_media_adapter.h ('k') | services/video_capture/video_capture_device_factory_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698