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> video_frame_buffer() | 57 virtual rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer() |
58 const = 0; | 58 const = 0; |
59 | 59 |
60 // System monotonic clock, same timebase as rtc::TimeMicros(). | 60 virtual int64_t GetTimeStamp() const = 0; |
61 virtual int64_t timestamp_us() const = 0; | 61 virtual void SetTimeStamp(int64_t time_stamp) = 0; |
62 virtual void set_timestamp_us(int64_t time_us) = 0; | |
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 virtual void SetTimeStamp(int64_t time_ns) { | |
71 set_timestamp_us(time_ns / rtc::kNumNanosecsPerMicrosec); | |
72 } | |
73 | 62 |
74 // Indicates the rotation angle in degrees. | 63 // Indicates the rotation angle in degrees. |
75 virtual webrtc::VideoRotation rotation() const = 0; | 64 virtual webrtc::VideoRotation rotation() const = 0; |
76 | 65 |
77 // Make a shallow copy of the frame. The frame buffer itself is not copied. | 66 // Make a shallow copy of the frame. The frame buffer itself is not copied. |
78 // Both the current and new VideoFrame will share a single reference-counted | 67 // Both the current and new VideoFrame will share a single reference-counted |
79 // frame buffer. | 68 // frame buffer. |
80 virtual VideoFrame *Copy() const = 0; | 69 virtual VideoFrame *Copy() const = 0; |
81 | 70 |
82 // Since VideoFrame supports shallow copy and the internal frame buffer might | 71 // Since VideoFrame supports shallow copy and the internal frame buffer might |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // take the nearest-point. The parameter "crop" controls whether to crop this | 130 // take the nearest-point. The parameter "crop" controls whether to crop this |
142 // frame to the aspect ratio of the given dimensions before stretching. | 131 // frame to the aspect ratio of the given dimensions before stretching. |
143 virtual bool CopyToPlanes(uint8_t* dst_y, | 132 virtual bool CopyToPlanes(uint8_t* dst_y, |
144 uint8_t* dst_u, | 133 uint8_t* dst_u, |
145 uint8_t* dst_v, | 134 uint8_t* dst_v, |
146 int32_t dst_pitch_y, | 135 int32_t dst_pitch_y, |
147 int32_t dst_pitch_u, | 136 int32_t dst_pitch_u, |
148 int32_t dst_pitch_v) const; | 137 int32_t dst_pitch_v) const; |
149 | 138 |
150 // Creates an empty frame. | 139 // Creates an empty frame. |
151 virtual VideoFrame* CreateEmptyFrame(int w, | 140 virtual VideoFrame *CreateEmptyFrame(int w, int h, |
152 int h, | 141 int64_t time_stamp) const = 0; |
153 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 |