| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 void OnBufferCreated(VideoCaptureControllerID id, | 43 void OnBufferCreated(VideoCaptureControllerID id, |
| 44 mojo::ScopedSharedBufferHandle handle, | 44 mojo::ScopedSharedBufferHandle handle, |
| 45 int length, | 45 int length, |
| 46 int buffer_id) override; | 46 int buffer_id) override; |
| 47 void OnBufferDestroyed(VideoCaptureControllerID id, | 47 void OnBufferDestroyed(VideoCaptureControllerID id, |
| 48 int buffer_id) override; | 48 int buffer_id) override; |
| 49 void OnBufferReady(VideoCaptureControllerID id, | 49 void OnBufferReady(VideoCaptureControllerID id, |
| 50 int buffer_id, | 50 int buffer_id, |
| 51 const scoped_refptr<media::VideoFrame>& frame) override; | 51 const scoped_refptr<media::VideoFrame>& frame) override; |
| 52 void OnEnded(VideoCaptureControllerID id) override; | 52 void OnEnded(VideoCaptureControllerID id) override; |
| 53 void OnStarted(VideoCaptureControllerID id) override; |
| 53 | 54 |
| 54 // mojom::VideoCaptureHost implementation | 55 // mojom::VideoCaptureHost implementation |
| 55 void Start(int32_t device_id, | 56 void Start(int32_t device_id, |
| 56 int32_t session_id, | 57 int32_t session_id, |
| 57 const media::VideoCaptureParams& params, | 58 const media::VideoCaptureParams& params, |
| 58 mojom::VideoCaptureObserverPtr observer) override; | 59 mojom::VideoCaptureObserverPtr observer) override; |
| 59 void Stop(int32_t device_id) override; | 60 void Stop(int32_t device_id) override; |
| 60 void Pause(int32_t device_id) override; | 61 void Pause(int32_t device_id) override; |
| 61 void Resume(int32_t device_id, | 62 void Resume(int32_t device_id, |
| 62 int32_t session_id, | 63 int32_t session_id, |
| 63 const media::VideoCaptureParams& params) override; | 64 const media::VideoCaptureParams& params) override; |
| 64 void RequestRefreshFrame(int32_t device_id) override; | 65 void RequestRefreshFrame(int32_t device_id) override; |
| 65 void ReleaseBuffer(int32_t device_id, | 66 void ReleaseBuffer(int32_t device_id, |
| 66 int32_t buffer_id, | 67 int32_t buffer_id, |
| 67 double consumer_resource_utilization) override; | 68 double consumer_resource_utilization) override; |
| 68 void GetDeviceSupportedFormats( | 69 void GetDeviceSupportedFormats( |
| 69 int32_t device_id, | 70 int32_t device_id, |
| 70 int32_t session_id, | 71 int32_t session_id, |
| 71 const GetDeviceSupportedFormatsCallback& callback) override; | 72 const GetDeviceSupportedFormatsCallback& callback) override; |
| 72 void GetDeviceFormatsInUse( | 73 void GetDeviceFormatsInUse( |
| 73 int32_t device_id, | 74 int32_t device_id, |
| 74 int32_t session_id, | 75 int32_t session_id, |
| 75 const GetDeviceFormatsInUseCallback& callback) override; | 76 const GetDeviceFormatsInUseCallback& callback) override; |
| 76 | 77 |
| 77 void DoError(VideoCaptureControllerID id); | 78 void DoError(VideoCaptureControllerID id); |
| 78 void DoEnded(VideoCaptureControllerID id); | 79 void DoEnded(VideoCaptureControllerID id); |
| 80 void DoStarted(VideoCaptureControllerID id); |
| 79 | 81 |
| 80 // Bound as callback for VideoCaptureManager::StartCaptureForClient(). | 82 // Bound as callback for VideoCaptureManager::StartCaptureForClient(). |
| 81 void OnControllerAdded( | 83 void OnControllerAdded( |
| 82 int device_id, | 84 int device_id, |
| 83 const base::WeakPtr<VideoCaptureController>& controller); | 85 const base::WeakPtr<VideoCaptureController>& controller); |
| 84 | 86 |
| 85 // Helper function that deletes the controller and tells VideoCaptureManager | 87 // Helper function that deletes the controller and tells VideoCaptureManager |
| 86 // to StopCaptureForClient(). |on_error| is true if this is triggered by | 88 // to StopCaptureForClient(). |on_error| is true if this is triggered by |
| 87 // VideoCaptureControllerEventHandler::OnError. | 89 // VideoCaptureControllerEventHandler::OnError. |
| 88 void DeleteVideoCaptureController(VideoCaptureControllerID controller_id, | 90 void DeleteVideoCaptureController(VideoCaptureControllerID controller_id, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 101 std::map<int32_t, mojom::VideoCaptureObserverPtr> device_id_to_observer_map_; | 103 std::map<int32_t, mojom::VideoCaptureObserverPtr> device_id_to_observer_map_; |
| 102 | 104 |
| 103 base::WeakPtrFactory<VideoCaptureHost> weak_factory_; | 105 base::WeakPtrFactory<VideoCaptureHost> weak_factory_; |
| 104 | 106 |
| 105 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); | 107 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); |
| 106 }; | 108 }; |
| 107 | 109 |
| 108 } // namespace content | 110 } // namespace content |
| 109 | 111 |
| 110 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ | 112 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ |
| OLD | NEW |