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 17 matching lines...) Expand all Loading... |
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. | 32 // Deprecated methods, for backwards compatibility. |
33 // TODO(nisse): Delete when usage in Chrome and other applications | 33 // TODO(nisse): Delete when usage in Chrome and other applications |
34 // have been replaced by width() and height(). | 34 // have been replaced by width() and height(). |
35 virtual size_t GetWidth() const final { return width(); } | 35 virtual size_t GetWidth() const final { return width(); } |
36 virtual size_t GetHeight() const final { return height(); } | 36 virtual size_t GetHeight() const final { return height(); } |
37 | 37 |
38 // These can return NULL if the object is not backed by a buffer. | |
39 virtual const uint8_t* GetYPlane() const = 0; | |
40 virtual const uint8_t* GetUPlane() const = 0; | |
41 virtual const uint8_t* GetVPlane() const = 0; | |
42 virtual uint8_t* GetYPlane() = 0; | |
43 virtual uint8_t* GetUPlane() = 0; | |
44 virtual uint8_t* GetVPlane() = 0; | |
45 | |
46 virtual int32_t GetYPitch() const = 0; | |
47 virtual int32_t GetUPitch() const = 0; | |
48 virtual int32_t GetVPitch() const = 0; | |
49 | |
50 // Returns the handle of the underlying video frame. This is used when the | 38 // Returns the handle of the underlying video frame. This is used when the |
51 // frame is backed by a texture. The object should be destroyed when it is no | 39 // frame is backed by a texture. The object should be destroyed when it is no |
52 // longer in use, so the underlying resource can be freed. | 40 // longer in use, so the underlying resource can be freed. |
53 virtual void* GetNativeHandle() const = 0; | 41 virtual void* GetNativeHandle() const = 0; |
54 | 42 |
55 // Returns the underlying video frame buffer. This function is ok to call | 43 // Returns the underlying video frame buffer. This function is ok to call |
56 // multiple times, but the returned object will refer to the same memory. | 44 // multiple times, but the returned object will refer to the same memory. |
57 virtual rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer() | 45 virtual const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& |
58 const = 0; | 46 video_frame_buffer() const = 0; |
59 | 47 |
60 // System monotonic clock, same timebase as rtc::TimeMicros(). | 48 // System monotonic clock, same timebase as rtc::TimeMicros(). |
61 virtual int64_t timestamp_us() const = 0; | 49 virtual int64_t timestamp_us() const = 0; |
62 virtual void set_timestamp_us(int64_t time_us) = 0; | 50 virtual void set_timestamp_us(int64_t time_us) = 0; |
63 | 51 |
64 // Deprecated methods, for backwards compatibility. | 52 // Deprecated methods, for backwards compatibility. |
65 // TODO(nisse): Delete when usage in Chrome and other applications | 53 // TODO(nisse): Delete when usage in Chrome and other applications |
66 // have been replaced. | 54 // have been replaced. |
67 virtual int64_t GetTimeStamp() const { | 55 virtual int64_t GetTimeStamp() const { |
68 return rtc::kNumNanosecsPerMicrosec * timestamp_us(); | 56 return rtc::kNumNanosecsPerMicrosec * timestamp_us(); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // Creates an empty frame. | 138 // Creates an empty frame. |
151 virtual VideoFrame* CreateEmptyFrame(int w, | 139 virtual VideoFrame* CreateEmptyFrame(int w, |
152 int h, | 140 int h, |
153 int64_t timestamp_us) const = 0; | 141 int64_t timestamp_us) const = 0; |
154 virtual void set_rotation(webrtc::VideoRotation rotation) = 0; | 142 virtual void set_rotation(webrtc::VideoRotation rotation) = 0; |
155 }; | 143 }; |
156 | 144 |
157 } // namespace cricket | 145 } // namespace cricket |
158 | 146 |
159 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_ | 147 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_ |
OLD | NEW |