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 // This file contains abstract classes used for media filter to handle video | 5 // This file contains abstract classes used for media filter to handle video |
6 // capture devices. | 6 // capture devices. |
7 | 7 |
8 #ifndef MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_H_ | 8 #ifndef MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_H_ |
9 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_H_ | 9 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_H_ |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 virtual void OnRemoved(VideoCapture* capture) = 0; | 63 virtual void OnRemoved(VideoCapture* capture) = 0; |
64 | 64 |
65 // Notify client that a buffer is available. | 65 // Notify client that a buffer is available. |
66 virtual void OnBufferReady(VideoCapture* capture, | 66 virtual void OnBufferReady(VideoCapture* capture, |
67 scoped_refptr<VideoFrameBuffer> buffer) = 0; | 67 scoped_refptr<VideoFrameBuffer> buffer) = 0; |
68 | 68 |
69 // Notify client about device info. | 69 // Notify client about device info. |
70 virtual void OnDeviceInfoReceived( | 70 virtual void OnDeviceInfoReceived( |
71 VideoCapture* capture, | 71 VideoCapture* capture, |
72 const VideoCaptureParams& device_info) = 0; | 72 const VideoCaptureParams& device_info) = 0; |
| 73 |
| 74 protected: |
| 75 virtual ~EventHandler() {} |
73 }; | 76 }; |
74 | 77 |
75 VideoCapture() {} | 78 VideoCapture() {} |
76 virtual ~VideoCapture() {} | |
77 | 79 |
78 // Request video capture to start capturing with |capability|. | 80 // Request video capture to start capturing with |capability|. |
79 // Also register |handler| with video capture for event handling. | 81 // Also register |handler| with video capture for event handling. |
80 // |handler| must remain valid until it has received |OnRemoved()|. | 82 // |handler| must remain valid until it has received |OnRemoved()|. |
81 virtual void StartCapture(EventHandler* handler, | 83 virtual void StartCapture(EventHandler* handler, |
82 const VideoCaptureCapability& capability) = 0; | 84 const VideoCaptureCapability& capability) = 0; |
83 | 85 |
84 // Request video capture to stop capturing for client |handler|. | 86 // Request video capture to stop capturing for client |handler|. |
85 // |handler| must remain valid until it has received |OnRemoved()|. | 87 // |handler| must remain valid until it has received |OnRemoved()|. |
86 virtual void StopCapture(EventHandler* handler) = 0; | 88 virtual void StopCapture(EventHandler* handler) = 0; |
87 | 89 |
88 // Feed buffer to video capture when done with it. | 90 // Feed buffer to video capture when done with it. |
89 virtual void FeedBuffer(scoped_refptr<VideoFrameBuffer> buffer) = 0; | 91 virtual void FeedBuffer(scoped_refptr<VideoFrameBuffer> buffer) = 0; |
90 | 92 |
91 virtual bool CaptureStarted() = 0; | 93 virtual bool CaptureStarted() = 0; |
92 virtual int CaptureWidth() = 0; | 94 virtual int CaptureWidth() = 0; |
93 virtual int CaptureHeight() = 0; | 95 virtual int CaptureHeight() = 0; |
94 virtual int CaptureFrameRate() = 0; | 96 virtual int CaptureFrameRate() = 0; |
95 | 97 |
| 98 protected: |
| 99 virtual ~VideoCapture() {} |
| 100 |
96 private: | 101 private: |
97 DISALLOW_COPY_AND_ASSIGN(VideoCapture); | 102 DISALLOW_COPY_AND_ASSIGN(VideoCapture); |
98 }; | 103 }; |
99 | 104 |
100 } // namespace media | 105 } // namespace media |
101 | 106 |
102 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_H_ | 107 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_H_ |
OLD | NEW |