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 |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/time.h" | 12 #include "base/time.h" |
13 #include "media/base/media_export.h" | 13 #include "media/base/media_export.h" |
14 #include "media/base/video_frame.h" | 14 #include "media/base/video_frame.h" |
15 #include "media/video/capture/video_capture_types.h" | 15 #include "media/video/capture/video_capture_types.h" |
16 | 16 |
17 namespace media { | 17 namespace media { |
18 | 18 |
19 class EncodedVideoSource; | |
20 | |
19 class MEDIA_EXPORT VideoCapture { | 21 class MEDIA_EXPORT VideoCapture { |
20 public: | 22 public: |
21 // TODO(wjia): consider merging with media::VideoFrame if possible. | 23 // TODO(wjia): consider merging with media::VideoFrame if possible. |
22 class VideoFrameBuffer : public base::RefCountedThreadSafe<VideoFrameBuffer> { | 24 class VideoFrameBuffer : public base::RefCountedThreadSafe<VideoFrameBuffer> { |
23 public: | 25 public: |
24 VideoFrameBuffer() | 26 VideoFrameBuffer() |
25 : width(0), | 27 : width(0), |
26 height(0), | 28 height(0), |
27 stride(0), | 29 stride(0), |
28 buffer_size(0), | 30 buffer_size(0), |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 virtual void StopCapture(EventHandler* handler) = 0; | 91 virtual void StopCapture(EventHandler* handler) = 0; |
90 | 92 |
91 // Feed buffer to video capture when done with it. | 93 // Feed buffer to video capture when done with it. |
92 virtual void FeedBuffer(scoped_refptr<VideoFrameBuffer> buffer) = 0; | 94 virtual void FeedBuffer(scoped_refptr<VideoFrameBuffer> buffer) = 0; |
93 | 95 |
94 virtual bool CaptureStarted() = 0; | 96 virtual bool CaptureStarted() = 0; |
95 virtual int CaptureWidth() = 0; | 97 virtual int CaptureWidth() = 0; |
96 virtual int CaptureHeight() = 0; | 98 virtual int CaptureHeight() = 0; |
97 virtual int CaptureFrameRate() = 0; | 99 virtual int CaptureFrameRate() = 0; |
98 | 100 |
101 // Tells the client whether platform and camera has encoding support. | |
102 // The operation of encoder is tied to capture controlled by the functions | |
103 // of VideoCapture interface. E.g. calling VideoCapture::StopCapture() will | |
104 // also stop the streaming of encoded streams. | |
Ami GONE FROM CHROMIUM
2013/06/08 00:18:01
This is not enough information. For example it im
hshi1
2013/06/11 17:49:42
I realized it is completely unnecessary to change
| |
105 // All platforms or cameras may have not encoding support available. | |
Ami GONE FROM CHROMIUM
2013/06/08 00:18:01
Comment is written as if this returns a bool, not
Ami GONE FROM CHROMIUM
2013/06/08 00:18:01
If this was impl'd to return NULL (in a new video_
hshi1
2013/06/11 17:49:42
N/A (file reverted).
hshi1
2013/06/11 17:49:42
N/A (file reverted).
| |
106 virtual EncodedVideoSource* GetEncodedVideoSource() = 0; | |
Ami GONE FROM CHROMIUM
2013/06/08 00:18:01
What are the ownership semantics of the returned p
hshi1
2013/06/11 17:49:42
N/A (file reverted).
| |
107 | |
99 protected: | 108 protected: |
100 virtual ~VideoCapture() {} | 109 virtual ~VideoCapture() {} |
101 | 110 |
102 private: | 111 private: |
103 DISALLOW_COPY_AND_ASSIGN(VideoCapture); | 112 DISALLOW_COPY_AND_ASSIGN(VideoCapture); |
104 }; | 113 }; |
105 | 114 |
106 } // namespace media | 115 } // namespace media |
107 | 116 |
108 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_H_ | 117 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_H_ |
OLD | NEW |