OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_CONTROLLER_EVENT_HANDL ER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_EVENT_HANDL ER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_EVENT_HANDL ER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_EVENT_HANDL ER_H_ |
7 | 7 |
8 #include "base/shared_memory.h" | 8 #include "base/shared_memory.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 | 11 |
12 // ID used for identifying an object of VideoCaptureController. | 12 // ID used for identifying an object of VideoCaptureController. |
13 struct CONTENT_EXPORT VideoCaptureControllerID { | 13 struct CONTENT_EXPORT VideoCaptureControllerID { |
14 VideoCaptureControllerID(int device_id); | 14 explicit VideoCaptureControllerID(int device_id); |
15 | 15 |
16 bool operator<(const VideoCaptureControllerID& vc) const; | 16 bool operator<(const VideoCaptureControllerID& vc) const; |
17 bool operator==(const VideoCaptureControllerID& vc) const; | |
17 | 18 |
18 int device_id; | 19 int device_id; |
19 }; | 20 }; |
20 | 21 |
21 // VideoCaptureControllerEventHandler is the interface for | 22 // VideoCaptureControllerEventHandler is the interface for |
22 // VideoCaptureController to notify clients about the events such as | 23 // VideoCaptureController to notify clients about the events such as |
23 // BufferReady, FrameInfo, Error, etc. | 24 // BufferReady, FrameInfo, Error, etc. |
24 class CONTENT_EXPORT VideoCaptureControllerEventHandler { | 25 class CONTENT_EXPORT VideoCaptureControllerEventHandler { |
25 public: | 26 public: |
26 // An Error has occurred in the VideoCaptureDevice. | 27 // An Error has occurred in the VideoCaptureDevice. |
27 virtual void OnError(const VideoCaptureControllerID& id) = 0; | 28 virtual void OnError(const VideoCaptureControllerID& id) = 0; |
28 | 29 |
29 // A buffer has been newly created. | 30 // A buffer has been newly created. |
30 virtual void OnBufferCreated(const VideoCaptureControllerID& id, | 31 virtual void OnBufferCreated(const VideoCaptureControllerID& id, |
31 base::SharedMemoryHandle handle, | 32 base::SharedMemoryHandle handle, |
32 int length, int buffer_id) = 0; | 33 int length, int buffer_id) = 0; |
33 | 34 |
34 // A buffer has been filled with I420 video. | 35 // A buffer has been filled with I420 video. |
35 virtual void OnBufferReady(const VideoCaptureControllerID& id, | 36 virtual void OnBufferReady(const VideoCaptureControllerID& id, |
36 int buffer_id, | 37 int buffer_id, |
37 base::Time timestamp) = 0; | 38 base::Time timestamp) = 0; |
38 | 39 |
39 // The frame resolution the VideoCaptureDevice capture video in. | 40 // The frame resolution the VideoCaptureDevice capture video in. |
40 virtual void OnFrameInfo(const VideoCaptureControllerID& id, | 41 virtual void OnFrameInfo(const VideoCaptureControllerID& id, |
41 int width, | 42 int width, |
42 int height, | 43 int height, |
43 int frame_rate) = 0; | 44 int frame_rate) = 0; |
44 | 45 |
45 // Report that this object can be deleted. | 46 // Report that this object can be deleted. |
46 virtual void OnReadyToDelete(const VideoCaptureControllerID& id) = 0; | 47 virtual void OnReadyToDelete(const VideoCaptureControllerID& id) = 0; |
perkj_chrome
2011/11/02 09:18:13
Should you put OnReadyToDelete in a separate inter
wjia(left Chromium)
2011/11/03 07:02:02
I didn't change the function name. It should be On
| |
47 | 48 |
48 protected: | 49 protected: |
49 virtual ~VideoCaptureControllerEventHandler() {} | 50 virtual ~VideoCaptureControllerEventHandler() {} |
50 }; | 51 }; |
51 | 52 |
52 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_EVENT_HA NDLER_H_ | 53 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_EVENT_HA NDLER_H_ |
OLD | NEW |