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

Unified Diff: media/capture/video/chromeos/camera_hal_delegate.h

Issue 2878233002: media: add ArcCamera3Service Mojo service (Closed)
Patch Set: Created 3 years, 7 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: media/capture/video/chromeos/camera_hal_delegate.h
diff --git a/media/capture/video/chromeos/camera_hal_delegate.h b/media/capture/video/chromeos/camera_hal_delegate.h
index 7089c4eceb630cb0547276e96209f8077165194b..7c67f67ac03f1d0e1f73cd5b44a744dc8e677b5c 100644
--- a/media/capture/video/chromeos/camera_hal_delegate.h
+++ b/media/capture/video/chromeos/camera_hal_delegate.h
@@ -8,6 +8,7 @@
#include "base/macros.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/thread.h"
+#include "media/capture/video/chromeos/arc_camera3_service.h"
#include "media/capture/video/chromeos/mojo/arc_camera3.mojom.h"
#include "media/capture/video/video_capture_device_factory.h"
#include "media/capture/video_capture_types.h"
@@ -25,10 +26,11 @@ class CAPTURE_EXPORT CameraHalDelegate final
explicit CameraHalDelegate(
const scoped_refptr<base::SingleThreadTaskRunner> module_task_runner);
+ // TODO(jcliang): Update docstring.
// Establishes the Mojo IPC channel to the camera HAL adapter. This method
// should be called before any other methods of CameraHalDelegate is called.
// Called by VideoCaptureDeviceFactoryChromeOS::Init on the browser IO thread.
- bool StartCameraModuleIpc();
+ void Start();
// Delegation methods for the VideoCaptureDeviceFactory interface. These
// methods are called by VideoCaptureDeviceFactoryChromeOS directly. They
@@ -60,6 +62,25 @@ class CAPTURE_EXPORT CameraHalDelegate final
~CameraHalDelegate();
+ class LocalCameraClient : public ArcCamera3Service::CameraClientObserver {
+ public:
+ LocalCameraClient(scoped_refptr<CameraHalDelegate> camera_hal_delegate);
+
+ void NotifyCameraHalRegistered(arc::mojom::CameraModulePtr camera_module);
+
+ private:
+ scoped_refptr<CameraHalDelegate> camera_hal_delegate_;
+ DISALLOW_IMPLICIT_CONSTRUCTORS(LocalCameraClient);
+ };
+
+ void SetCameraModule(arc::mojom::CameraModulePtrInfo camera_module_ptr_info);
+ base::WaitableEvent camera_module_set_;
+
+ // Mojo connection error handler. On Mojo connection error, the handler will
+ // try to re-establish the Mojo connection to the camera HAL.
+ void SetConnectionErrorHandlerOnModuleThread();
+ void HandleMojoConnectionErrorOnModuleThread();
+
// Resets the Mojo interface and bindings.
void ResetMojoInterfaceOnModuleThread(base::WaitableEvent* interface_closed);

Powered by Google App Engine
This is Rietveld 408576698