| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/media/webrtc/media_stream_remote_video_source.h" | 5 #include "content/renderer/media/webrtc/media_stream_remote_video_source.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 RemoteVideoSourceDelegate::~RemoteVideoSourceDelegate() { | 91 RemoteVideoSourceDelegate::~RemoteVideoSourceDelegate() { |
| 92 } | 92 } |
| 93 | 93 |
| 94 namespace { | 94 namespace { |
| 95 void DoNothing(const scoped_refptr<rtc::RefCountInterface>& ref) {} | 95 void DoNothing(const scoped_refptr<rtc::RefCountInterface>& ref) {} |
| 96 } // anonymous | 96 } // anonymous |
| 97 | 97 |
| 98 void MediaStreamRemoteVideoSource::RemoteVideoSourceDelegate::OnFrame( | 98 void MediaStreamRemoteVideoSource::RemoteVideoSourceDelegate::OnFrame( |
| 99 const cricket::VideoFrame& incoming_frame) { | 99 const cricket::VideoFrame& incoming_frame) { |
| 100 const base::TimeDelta incoming_timestamp = base::TimeDelta::FromMicroseconds( | 100 const base::TimeDelta incoming_timestamp = base::TimeDelta::FromMicroseconds( |
| 101 incoming_frame.GetTimeStamp() / rtc::kNumNanosecsPerMicrosec); | 101 incoming_frame.timestamp_us()); |
| 102 const base::TimeTicks render_time = | 102 const base::TimeTicks render_time = |
| 103 base::TimeTicks() + incoming_timestamp + time_diff_; | 103 base::TimeTicks() + incoming_timestamp + time_diff_; |
| 104 | 104 |
| 105 TRACE_EVENT1("webrtc", "RemoteVideoSourceDelegate::RenderFrame", | 105 TRACE_EVENT1("webrtc", "RemoteVideoSourceDelegate::RenderFrame", |
| 106 "Ideal Render Instant", render_time.ToInternalValue()); | 106 "Ideal Render Instant", render_time.ToInternalValue()); |
| 107 | 107 |
| 108 CHECK_NE(media::kNoTimestamp, incoming_timestamp); | 108 CHECK_NE(media::kNoTimestamp, incoming_timestamp); |
| 109 if (start_timestamp_ == media::kNoTimestamp) | 109 if (start_timestamp_ == media::kNoTimestamp) |
| 110 start_timestamp_ = incoming_timestamp; | 110 start_timestamp_ = incoming_timestamp; |
| 111 const base::TimeDelta elapsed_timestamp = | 111 const base::TimeDelta elapsed_timestamp = |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 case webrtc::MediaStreamTrackInterface::kEnded: | 241 case webrtc::MediaStreamTrackInterface::kEnded: |
| 242 SetReadyState(blink::WebMediaStreamSource::ReadyStateEnded); | 242 SetReadyState(blink::WebMediaStreamSource::ReadyStateEnded); |
| 243 break; | 243 break; |
| 244 default: | 244 default: |
| 245 NOTREACHED(); | 245 NOTREACHED(); |
| 246 break; | 246 break; |
| 247 } | 247 } |
| 248 } | 248 } |
| 249 | 249 |
| 250 } // namespace content | 250 } // namespace content |
| OLD | NEW |