Chromium Code Reviews| Index: webrtc/media/engine/webrtcvideoframe.h |
| diff --git a/webrtc/media/engine/webrtcvideoframe.h b/webrtc/media/engine/webrtcvideoframe.h |
| index cb280b5e153beb20b69adb9565073d64681dce08..2913e8b429b9df3e021c4b892355d32cc91c7dd8 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? |
|
perkj_webrtc
2016/04/08 14:52:18
I hope not...
Can't you just create a new ctor wh
nisse-webrtc
2016/04/11 06:58:56
That should work. Sounds a little hackish, but may
|
| + |
| WebRtcVideoFrame(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer, |
| int64_t time_stamp_ns, |
| webrtc::VideoRotation rotation); |
| @@ -49,6 +54,7 @@ class WebRtcVideoFrame : public VideoFrame { |
| 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 +75,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 +108,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 +117,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 |