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

Unified Diff: services/video_capture/receiver_mojo_to_media_adapter.cc

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
« no previous file with comments | « services/video_capture/receiver_mojo_to_media_adapter.h ('k') | services/video_capture/service_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/video_capture/receiver_mojo_to_media_adapter.cc
diff --git a/services/video_capture/receiver_mojo_to_media_adapter.cc b/services/video_capture/receiver_mojo_to_media_adapter.cc
index 70292d4e67f870d1a7f35ca74589a2cdde11f5be..769c3f9a874c7e5743c8f130c8b96ed96c71d989 100644
--- a/services/video_capture/receiver_mojo_to_media_adapter.cc
+++ b/services/video_capture/receiver_mojo_to_media_adapter.cc
@@ -4,6 +4,27 @@
#include "services/video_capture/receiver_mojo_to_media_adapter.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
+
+namespace {
+
+class ScopedAccessPermissionMediaToMojoAdapter
+ : public video_capture::mojom::ScopedAccessPermission {
+ public:
+ ScopedAccessPermissionMediaToMojoAdapter(
+ std::unique_ptr<
+ media::VideoCaptureDevice::Client::Buffer::ScopedAccessPermission>
+ access_permission)
+ : access_permission_(std::move(access_permission)) {}
+
+ private:
+ std::unique_ptr<
+ media::VideoCaptureDevice::Client::Buffer::ScopedAccessPermission>
+ access_permission_;
+};
+
+} // anonymous namespace
+
namespace video_capture {
ReceiverMojoToMediaAdapter::ReceiverMojoToMediaAdapter(
@@ -16,7 +37,8 @@ void ReceiverMojoToMediaAdapter::OnNewBufferHandle(
int buffer_id,
std::unique_ptr<media::VideoCaptureDevice::Client::Buffer::HandleProvider>
handle_provider) {
- NOTIMPLEMENTED();
+ receiver_->OnNewBufferHandle(
+ buffer_id, handle_provider->GetHandleForInterProcessTransit());
}
void ReceiverMojoToMediaAdapter::OnFrameReadyInBuffer(
@@ -24,9 +46,20 @@ void ReceiverMojoToMediaAdapter::OnFrameReadyInBuffer(
int frame_feedback_id,
std::unique_ptr<
media::VideoCaptureDevice::Client::Buffer::ScopedAccessPermission>
- buffer_usage_reservation,
+ access_permission,
media::mojom::VideoFrameInfoPtr frame_info) {
- NOTIMPLEMENTED();
+ mojom::ScopedAccessPermissionPtr access_permission_proxy;
+ mojo::MakeStrongBinding<mojom::ScopedAccessPermission>(
+ base::MakeUnique<ScopedAccessPermissionMediaToMojoAdapter>(
+ std::move(access_permission)),
+ mojo::MakeRequest(&access_permission_proxy));
+ receiver_->OnFrameReadyInBuffer(buffer_id, frame_feedback_id,
+ std::move(access_permission_proxy),
+ std::move(frame_info));
+}
+
+void ReceiverMojoToMediaAdapter::OnBufferRetired(int buffer_id) {
+ receiver_->OnBufferRetired(buffer_id);
}
void ReceiverMojoToMediaAdapter::OnError() {
@@ -42,11 +75,7 @@ void ReceiverMojoToMediaAdapter::OnStarted() {
}
void ReceiverMojoToMediaAdapter::OnStartedUsingGpuDecode() {
- NOTIMPLEMENTED();
-}
-
-void ReceiverMojoToMediaAdapter::OnBufferRetired(int buffer_id) {
- NOTIMPLEMENTED();
+ receiver_->OnStartedUsingGpuDecode();
}
} // namespace video_capture
« no previous file with comments | « services/video_capture/receiver_mojo_to_media_adapter.h ('k') | services/video_capture/service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698