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

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

Issue 2878233002: media: add ArcCamera3Service Mojo service (Closed)
Patch Set: rebase on latest patch set of issue 2837273004 Created 3 years, 6 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 e8dc849dd8e8f0879302ee9123b0d262262326fa..9330f61e084e9fb292cfa414996d3f4e5bd84c8d 100644
--- a/media/capture/video/chromeos/camera_hal_delegate.h
+++ b/media/capture/video/chromeos/camera_hal_delegate.h
@@ -13,6 +13,7 @@
#include "base/sequence_checker.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"
@@ -36,9 +37,8 @@ class CAPTURE_EXPORT CameraHalDelegate final
explicit CameraHalDelegate(
scoped_refptr<base::SingleThreadTaskRunner> ipc_task_runner);
- // Establishes the Mojo IPC channel to the camera HAL adapter. This method
- // should be called before any other methods of CameraHalDelegate is called.
- bool StartCameraModuleIpc();
+ // Registers the camera client observer to the ArcCamera3Service Mojo service.
+ void RegisterCameraClient();
// Resets |camera_module_| and |camera_module_callbacks_|.
void Reset();
@@ -77,7 +77,25 @@ class CAPTURE_EXPORT CameraHalDelegate final
friend class CameraHalDelegateTest;
friend class CameraDeviceDelegateTest;
- void StartForTesting(arc::mojom::CameraModulePtrInfo info);
+
+ 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();
« no previous file with comments | « media/capture/video/chromeos/camera_device_delegate_unittest.cc ('k') | media/capture/video/chromeos/camera_hal_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698