Index: services/video_capture/public/cpp/device_to_feedback_observer_adapter.h |
diff --git a/services/video_capture/public/cpp/device_to_feedback_observer_adapter.h b/services/video_capture/public/cpp/device_to_feedback_observer_adapter.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b35dab01d1701511cb2982cfd3f100a004cc5625 |
--- /dev/null |
+++ b/services/video_capture/public/cpp/device_to_feedback_observer_adapter.h |
@@ -0,0 +1,30 @@ |
+// 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_DEVICE_TO_FEEDBACK_OBSERVER_ADAPTER_H_ |
+#define SERVICES_VIDEO_CAPTURE_PUBLIC_CPP_DEVICE_TO_FEEDBACK_OBSERVER_ADAPTER_H_ |
+ |
+#include "media/capture/video/video_capture_device.h" |
+#include "services/video_capture/public/interfaces/device.mojom.h" |
+ |
+namespace video_capture { |
+ |
+// Adapter that allows a video_capture::mojom::Device to be used in place of |
+// a media::VideoFrameConsumerFeedbackObserver |
+class DeviceToFeedbackObserverAdapter |
+ : public media::VideoFrameConsumerFeedbackObserver { |
+ public: |
+ DeviceToFeedbackObserverAdapter(mojom::DevicePtr device); |
+ ~DeviceToFeedbackObserverAdapter() override; |
+ |
+ // media::VideoFrameConsumerFeedbackObserver: |
+ void OnUtilizationReport(int frame_feedback_id, double utilization) override; |
+ |
+ private: |
+ mojom::DevicePtr device_; |
+}; |
+ |
+} // namespace video_capture |
+ |
+#endif // SERVICES_VIDEO_CAPTURE_PUBLIC_CPP_DEVICE_TO_FEEDBACK_OBSERVER_ADAPTER_H_ |