OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 class VideoFrame { | 22 class VideoFrame { |
23 public: | 23 public: |
24 VideoFrame() {} | 24 VideoFrame() {} |
25 virtual ~VideoFrame() {} | 25 virtual ~VideoFrame() {} |
26 | 26 |
27 // Basic accessors. | 27 // Basic accessors. |
28 // Note this is the width and height without rotation applied. | 28 // Note this is the width and height without rotation applied. |
29 virtual int width() const = 0; | 29 virtual int width() const = 0; |
30 virtual int height() const = 0; | 30 virtual int height() const = 0; |
31 | 31 |
32 // Deprecated methods, for backwards compatibility. | |
33 // TODO(nisse): Delete when usage in Chrome and other applications | |
34 // have been replaced by width() and height(). | |
35 virtual size_t GetWidth() const final { return width(); } | |
36 virtual size_t GetHeight() const final { return height(); } | |
37 | |
38 // Returns the handle of the underlying video frame. This is used when the | |
39 // frame is backed by a texture. The object should be destroyed when it is no | |
40 // longer in use, so the underlying resource can be freed. | |
41 virtual void* GetNativeHandle() const = 0; | |
42 | |
43 // Returns the underlying video frame buffer. This function is ok to call | 32 // Returns the underlying video frame buffer. This function is ok to call |
44 // multiple times, but the returned object will refer to the same memory. | 33 // multiple times, but the returned object will refer to the same memory. |
45 virtual const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& | 34 virtual const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& |
46 video_frame_buffer() const = 0; | 35 video_frame_buffer() const = 0; |
47 | 36 |
48 // System monotonic clock, same timebase as rtc::TimeMicros(). | 37 // System monotonic clock, same timebase as rtc::TimeMicros(). |
49 virtual int64_t timestamp_us() const = 0; | 38 virtual int64_t timestamp_us() const = 0; |
50 virtual void set_timestamp_us(int64_t time_us) = 0; | 39 virtual void set_timestamp_us(int64_t time_us) = 0; |
51 | 40 |
52 // Deprecated methods, for backwards compatibility. | 41 // Deprecated methods, for backwards compatibility. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // Creates an empty frame. | 127 // Creates an empty frame. |
139 virtual VideoFrame* CreateEmptyFrame(int w, | 128 virtual VideoFrame* CreateEmptyFrame(int w, |
140 int h, | 129 int h, |
141 int64_t timestamp_us) const = 0; | 130 int64_t timestamp_us) const = 0; |
142 virtual void set_rotation(webrtc::VideoRotation rotation) = 0; | 131 virtual void set_rotation(webrtc::VideoRotation rotation) = 0; |
143 }; | 132 }; |
144 | 133 |
145 } // namespace cricket | 134 } // namespace cricket |
146 | 135 |
147 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_ | 136 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_ |
OLD | NEW |