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

Unified Diff: services/video_capture/public/cpp/receiver_media_to_mojo_adapter.h

Issue 2818513003: [Mojo Video Capture] Adapt video_capture service to refactored video capture stack (Closed)
Patch Set: Fix compile errors Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: services/video_capture/public/cpp/receiver_media_to_mojo_adapter.h
diff --git a/services/video_capture/public/cpp/receiver_media_to_mojo_adapter.h b/services/video_capture/public/cpp/receiver_media_to_mojo_adapter.h
new file mode 100644
index 0000000000000000000000000000000000000000..98d073fe6561db88c53f52c85af28796a4b428a7
--- /dev/null
+++ b/services/video_capture/public/cpp/receiver_media_to_mojo_adapter.h
@@ -0,0 +1,39 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SERVICES_VIDEO_CAPTURE_PUBLIC_CPP_RECEIVER_MEDIA_TO_MOJO_ADAPTER_H_
+#define SERVICES_VIDEO_CAPTURE_PUBLIC_CPP_RECEIVER_MEDIA_TO_MOJO_ADAPTER_H_
+
+#include "media/capture/video/video_frame_receiver.h"
+#include "services/video_capture/public/interfaces/receiver.mojom.h"
+
+namespace video_capture {
+
+// Adapter that allows a media::VideoFrameReceiver to be used in place of
+// a mojom::VideoFrameReceiver.
+class ReceiverMediaToMojoAdapter : public mojom::Receiver {
+ public:
+ ReceiverMediaToMojoAdapter(
+ std::unique_ptr<media::VideoFrameReceiver> receiver);
+ ~ReceiverMediaToMojoAdapter() override;
+
+ // video_capture::mojom::Receiver:
+ void OnNewBufferHandle(int32_t buffer_id,
+ mojo::ScopedSharedBufferHandle buffer_handle) override;
+ void OnFrameReadyInBuffer(
+ int32_t buffer_id,
+ int32_t frame_feedback_id,
+ mojom::ScopedAccessPermissionPtr access_permission,
+ media::mojom::VideoFrameInfoPtr frame_info) override;
+ void OnBufferRetired(int32_t buffer_id) override;
+ void OnError() override;
+ void OnLog(const std::string& message) override;
+
+ private:
+ std::unique_ptr<media::VideoFrameReceiver> receiver_;
+};
+
+} // namespace video_capture
+
+#endif // SERVICES_VIDEO_CAPTURE_PUBLIC_CPP_RECEIVER_MEDIA_TO_MOJO_ADAPTER_H_

Powered by Google App Engine
This is Rietveld 408576698