Index: webrtc/media/engine/webrtcvideoframe.h |
diff --git a/webrtc/media/engine/webrtcvideoframe.h b/webrtc/media/engine/webrtcvideoframe.h |
index cb280b5e153beb20b69adb9565073d64681dce08..d5d931a674c2e2ac34f40572d1e8d044a0e5d54b 100644 |
--- a/webrtc/media/engine/webrtcvideoframe.h |
+++ b/webrtc/media/engine/webrtcvideoframe.h |
@@ -27,6 +27,11 @@ struct CapturedFrame; |
class WebRtcVideoFrame : public VideoFrame { |
public: |
WebRtcVideoFrame(); |
+ // TODO(nisse): Find a way to transition to using us units for the |
+ // constructor and init methods. Maybe it's easiest to drop the |
+ // timestamp argument, and require a separate method call for |
+ // setting the timestamp? |
+ |
WebRtcVideoFrame(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer, |
int64_t time_stamp_ns, |
webrtc::VideoRotation rotation); |
@@ -47,8 +52,12 @@ class WebRtcVideoFrame : public VideoFrame { |
int64_t time_stamp_ns, |
webrtc::VideoRotation rotation); |
+ // The timestamp of the captured frame is expected to use the same |
+ // timescale and epoch as rtc::Time. Consider adding a warning |
pbos-webrtc
2016/04/13 12:04:04
Put your ldap in a TODO here for the Consider
nisse-webrtc
2016/04/13 13:02:12
Done.
|
+ // message, or even an RTC_DCHECK, if the time is too far off. |
bool Init(const CapturedFrame* frame, int dw, int dh, bool apply_rotation); |
+ void InitToEmptyBuffer(int w, int h); |
void InitToEmptyBuffer(int w, int h, int64_t time_stamp_ns); |
bool InitToBlack(int w, int h, int64_t time_stamp_ns); |
@@ -69,10 +78,9 @@ class WebRtcVideoFrame : public VideoFrame { |
rtc::scoped_refptr<webrtc::VideoFrameBuffer> GetVideoFrameBuffer() |
const override; |
- int64_t GetTimeStamp() const override { return time_stamp_ns_; } |
- void SetTimeStamp(int64_t time_stamp_ns) override { |
- time_stamp_ns_ = time_stamp_ns; |
- } |
+ /* System monotonic clock */ |
+ int64_t timestamp_us() const override { return timestamp_us_; } |
+ void set_timestamp_us(int64_t time_us) { timestamp_us_ = time_us; }; |
webrtc::VideoRotation GetVideoRotation() const override { |
return rotation_; |
@@ -103,7 +111,6 @@ class WebRtcVideoFrame : public VideoFrame { |
int dh, |
uint8_t* sample, |
size_t sample_size, |
- int64_t time_stamp_ns, |
webrtc::VideoRotation rotation, |
bool apply_rotation); |
@@ -113,7 +120,7 @@ class WebRtcVideoFrame : public VideoFrame { |
// An opaque reference counted handle that stores the pixel data. |
rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer_; |
- int64_t time_stamp_ns_; |
+ int64_t timestamp_us_; |
webrtc::VideoRotation rotation_; |
// This is mutable as the calculation is expensive but once calculated, it |