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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 // Returns the handle of the underlying video frame. This is used when the | 50 // 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 | 51 // 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. | 52 // longer in use, so the underlying resource can be freed. |
53 virtual void* GetNativeHandle() const = 0; | 53 virtual void* GetNativeHandle() const = 0; |
54 | 54 |
55 // Returns the underlying video frame buffer. This function is ok to call | 55 // 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. | 56 // multiple times, but the returned object will refer to the same memory. |
57 virtual rtc::scoped_refptr<webrtc::VideoFrameBuffer> GetVideoFrameBuffer() | 57 virtual rtc::scoped_refptr<webrtc::VideoFrameBuffer> GetVideoFrameBuffer() |
58 const = 0; | 58 const = 0; |
59 | 59 |
60 virtual int64_t GetTimeStamp() const = 0; | 60 // System monotonic clock, same timebase as rtc::TimeMicros(). |
61 virtual void SetTimeStamp(int64_t time_stamp) = 0; | 61 virtual int64_t timestamp_us() const = 0; |
62 virtual void set_timestamp_us(int64_t time_us) = 0; | |
perkj_webrtc
2016/04/08 08:22:49
no need for set_timestamp. See motivation below.
| |
63 | |
64 // Deprecated methods, for backwards compatibility. | |
65 // TODO(nisse): Delete when usage in Chrome and other applications | |
66 // have been replaced. | |
67 virtual int64_t GetTimeStamp() const { | |
68 return rtc::kNumNanosecsPerMicrosec * timestamp_us(); | |
69 } | |
70 // Also used as a helper method for WebRtcVideoFrame methods with ns input. | |
71 virtual void SetTimeStamp(int64_t time_ns) { | |
perkj_webrtc
2016/04/08 08:22:49
Can we deprecate this? Creating VideoFrames is ver
nisse-webrtc
2016/04/08 09:15:43
Typical use, in videoframefactory,
output_fra
| |
72 set_timestamp_us(time_ns / rtc::kNumNanosecsPerMicrosec); | |
73 } | |
62 | 74 |
63 // Indicates the rotation angle in degrees. | 75 // Indicates the rotation angle in degrees. |
64 virtual webrtc::VideoRotation GetVideoRotation() const = 0; | 76 virtual webrtc::VideoRotation GetVideoRotation() const = 0; |
65 | 77 |
66 // Make a shallow copy of the frame. The frame buffer itself is not copied. | 78 // Make a shallow copy of the frame. The frame buffer itself is not copied. |
67 // Both the current and new VideoFrame will share a single reference-counted | 79 // Both the current and new VideoFrame will share a single reference-counted |
68 // frame buffer. | 80 // frame buffer. |
69 virtual VideoFrame *Copy() const = 0; | 81 virtual VideoFrame *Copy() const = 0; |
70 | 82 |
71 // Since VideoFrame supports shallow copy and the internal frame buffer might | 83 // Since VideoFrame supports shallow copy and the internal frame buffer might |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
131 // frame to the aspect ratio of the given dimensions before stretching. | 143 // frame to the aspect ratio of the given dimensions before stretching. |
132 virtual bool CopyToPlanes(uint8_t* dst_y, | 144 virtual bool CopyToPlanes(uint8_t* dst_y, |
133 uint8_t* dst_u, | 145 uint8_t* dst_u, |
134 uint8_t* dst_v, | 146 uint8_t* dst_v, |
135 int32_t dst_pitch_y, | 147 int32_t dst_pitch_y, |
136 int32_t dst_pitch_u, | 148 int32_t dst_pitch_u, |
137 int32_t dst_pitch_v) const; | 149 int32_t dst_pitch_v) const; |
138 | 150 |
139 // Creates an empty frame. | 151 // Creates an empty frame. |
140 virtual VideoFrame *CreateEmptyFrame(int w, int h, | 152 virtual VideoFrame *CreateEmptyFrame(int w, int h, |
141 int64_t time_stamp) const = 0; | 153 int64_t timestamp_us) const = 0; |
142 virtual void SetRotation(webrtc::VideoRotation rotation) = 0; | 154 virtual void SetRotation(webrtc::VideoRotation rotation) = 0; |
143 }; | 155 }; |
144 | 156 |
145 } // namespace cricket | 157 } // namespace cricket |
146 | 158 |
147 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_ | 159 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_ |
OLD | NEW |