Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 void set_timestamp(uint32_t timestamp) { timestamp_rtp_ = timestamp; } | 64 void set_timestamp(uint32_t timestamp) { timestamp_rtp_ = timestamp; } |
| 65 | 65 |
| 66 // Get frame timestamp (90kHz). | 66 // Get frame timestamp (90kHz). |
| 67 uint32_t timestamp() const { return timestamp_rtp_; } | 67 uint32_t timestamp() const { return timestamp_rtp_; } |
| 68 | 68 |
| 69 // For now, transport_frame_id and rtp timestamp are the same. | 69 // For now, transport_frame_id and rtp timestamp are the same. |
| 70 // TODO(nisse): Must be handled differently for QUIC. | 70 // TODO(nisse): Must be handled differently for QUIC. |
| 71 uint32_t transport_frame_id() const { return timestamp(); } | 71 uint32_t transport_frame_id() const { return timestamp(); } |
| 72 | 72 |
| 73 // Set capture ntp time in milliseconds. | 73 // Set capture ntp time in milliseconds. |
| 74 // TODO(nisse): Deprecated. Migrate all users to timestamp_us(). | |
|
stefan-webrtc
2017/01/25 15:38:51
May want to use RTC_DEPRECATED?
nisse-webrtc
2017/01/25 15:52:11
Due to the widespread use of the -Werror option (t
| |
| 74 void set_ntp_time_ms(int64_t ntp_time_ms) { ntp_time_ms_ = ntp_time_ms; } | 75 void set_ntp_time_ms(int64_t ntp_time_ms) { ntp_time_ms_ = ntp_time_ms; } |
| 75 | 76 |
| 76 // Get capture ntp time in milliseconds. | 77 // Get capture ntp time in milliseconds. |
| 78 // TODO(nisse): Deprecated. Migrate all users to timestamp_us(). | |
| 77 int64_t ntp_time_ms() const { return ntp_time_ms_; } | 79 int64_t ntp_time_ms() const { return ntp_time_ms_; } |
| 78 | 80 |
| 79 // Naming convention for Coordination of Video Orientation. Please see | 81 // Naming convention for Coordination of Video Orientation. Please see |
| 80 // http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/ts_126 114v120700p.pdf | 82 // http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/ts_126 114v120700p.pdf |
| 81 // | 83 // |
| 82 // "pending rotation" or "pending" = a frame that has a VideoRotation > 0. | 84 // "pending rotation" or "pending" = a frame that has a VideoRotation > 0. |
| 83 // | 85 // |
| 84 // "not pending" = a frame that has a VideoRotation == 0. | 86 // "not pending" = a frame that has a VideoRotation == 0. |
| 85 // | 87 // |
| 86 // "apply rotation" = modify a frame from being "pending" to being "not | 88 // "apply rotation" = modify a frame from being "pending" to being "not |
| 87 // pending" rotation (a no-op for "unrotated"). | 89 // pending" rotation (a no-op for "unrotated"). |
| 88 // | 90 // |
| 89 VideoRotation rotation() const { return rotation_; } | 91 VideoRotation rotation() const { return rotation_; } |
| 90 void set_rotation(VideoRotation rotation) { rotation_ = rotation; } | 92 void set_rotation(VideoRotation rotation) { rotation_ = rotation; } |
| 91 | 93 |
| 92 // Set render time in milliseconds. | |
| 93 void set_render_time_ms(int64_t render_time_ms); | |
| 94 | |
| 95 // Get render time in milliseconds. | 94 // Get render time in milliseconds. |
| 95 // TODO(nisse): Deprecated. Migrate all users to timestamp_us(). | |
| 96 int64_t render_time_ms() const; | 96 int64_t render_time_ms() const; |
| 97 | 97 |
| 98 // Return the underlying buffer. Never nullptr for a properly | 98 // Return the underlying buffer. Never nullptr for a properly |
| 99 // initialized VideoFrame. | 99 // initialized VideoFrame. |
| 100 rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer() const; | 100 rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer() const; |
| 101 | 101 |
| 102 // TODO(nisse): Deprecated. | 102 // TODO(nisse): Deprecated. |
| 103 // Return true if the frame is stored in a texture. | 103 // Return true if the frame is stored in a texture. |
| 104 bool is_texture() const { | 104 bool is_texture() const { |
| 105 return video_frame_buffer()->native_handle() != nullptr; | 105 return video_frame_buffer()->native_handle() != nullptr; |
| 106 } | 106 } |
| 107 | 107 |
| 108 private: | 108 private: |
| 109 // An opaque reference counted handle that stores the pixel data. | 109 // An opaque reference counted handle that stores the pixel data. |
| 110 rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer_; | 110 rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer_; |
| 111 uint32_t timestamp_rtp_; | 111 uint32_t timestamp_rtp_; |
| 112 int64_t ntp_time_ms_; | 112 int64_t ntp_time_ms_; |
| 113 int64_t timestamp_us_; | 113 int64_t timestamp_us_; |
| 114 VideoRotation rotation_; | 114 VideoRotation rotation_; |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 } // namespace webrtc | 117 } // namespace webrtc |
| 118 | 118 |
| 119 #endif // WEBRTC_API_VIDEO_VIDEO_FRAME_H_ | 119 #endif // WEBRTC_API_VIDEO_VIDEO_FRAME_H_ |
| OLD | NEW |