Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: remoting/client/software_video_renderer.cc

Issue 836183002: Rename sequence_number to timestamp. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/client/software_video_renderer.h ('k') | remoting/host/chromoting_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "remoting/client/software_video_renderer.h" 5 #include "remoting/client/software_video_renderer.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 SchedulePaint(); 311 SchedulePaint();
312 } 312 }
313 } 313 }
314 314
315 SoftwareVideoRenderer::SoftwareVideoRenderer( 315 SoftwareVideoRenderer::SoftwareVideoRenderer(
316 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 316 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
317 scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner, 317 scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner,
318 scoped_refptr<FrameConsumerProxy> consumer) 318 scoped_refptr<FrameConsumerProxy> consumer)
319 : decode_task_runner_(decode_task_runner), 319 : decode_task_runner_(decode_task_runner),
320 core_(new Core(main_task_runner, decode_task_runner, consumer)), 320 core_(new Core(main_task_runner, decode_task_runner, consumer)),
321 latest_sequence_number_(0), 321 latest_event_timestamp_(0),
322 weak_factory_(this) { 322 weak_factory_(this) {
323 DCHECK(CalledOnValidThread()); 323 DCHECK(CalledOnValidThread());
324 } 324 }
325 325
326 SoftwareVideoRenderer::~SoftwareVideoRenderer() { 326 SoftwareVideoRenderer::~SoftwareVideoRenderer() {
327 DCHECK(CalledOnValidThread()); 327 DCHECK(CalledOnValidThread());
328 decode_task_runner_->DeleteSoon(FROM_HERE, core_.release()); 328 decode_task_runner_->DeleteSoon(FROM_HERE, core_.release());
329 } 329 }
330 330
331 void SoftwareVideoRenderer::OnSessionConfig( 331 void SoftwareVideoRenderer::OnSessionConfig(
(...skipping 22 matching lines...) Expand all
354 354
355 // Add one frame to the counter. 355 // Add one frame to the counter.
356 stats_.video_frame_rate()->Record(1); 356 stats_.video_frame_rate()->Record(1);
357 357
358 // Record other statistics received from host. 358 // Record other statistics received from host.
359 stats_.video_bandwidth()->Record(packet->data().size()); 359 stats_.video_bandwidth()->Record(packet->data().size());
360 if (packet->has_capture_time_ms()) 360 if (packet->has_capture_time_ms())
361 stats_.video_capture_ms()->Record(packet->capture_time_ms()); 361 stats_.video_capture_ms()->Record(packet->capture_time_ms());
362 if (packet->has_encode_time_ms()) 362 if (packet->has_encode_time_ms())
363 stats_.video_encode_ms()->Record(packet->encode_time_ms()); 363 stats_.video_encode_ms()->Record(packet->encode_time_ms());
364 if (packet->has_client_sequence_number() && 364 if (packet->has_latest_event_timestamp() &&
365 packet->client_sequence_number() > latest_sequence_number_) { 365 packet->latest_event_timestamp() > latest_event_timestamp_) {
366 latest_sequence_number_ = packet->client_sequence_number(); 366 latest_event_timestamp_ = packet->latest_event_timestamp();
367 base::TimeDelta round_trip_latency = 367 base::TimeDelta round_trip_latency =
368 base::Time::Now() - 368 base::Time::Now() -
369 base::Time::FromInternalValue(packet->client_sequence_number()); 369 base::Time::FromInternalValue(packet->latest_event_timestamp());
370 stats_.round_trip_ms()->Record(round_trip_latency.InMilliseconds()); 370 stats_.round_trip_ms()->Record(round_trip_latency.InMilliseconds());
371 } 371 }
372 372
373 // Measure the latency between the last packet being received and presented. 373 // Measure the latency between the last packet being received and presented.
374 base::Time decode_start = base::Time::Now(); 374 base::Time decode_start = base::Time::Now();
375 375
376 base::Closure decode_done = base::Bind(&SoftwareVideoRenderer::OnPacketDone, 376 base::Closure decode_done = base::Bind(&SoftwareVideoRenderer::OnPacketDone,
377 weak_factory_.GetWeakPtr(), 377 weak_factory_.GetWeakPtr(),
378 decode_start, done); 378 decode_start, done);
379 379
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 DCHECK(CalledOnValidThread()); 416 DCHECK(CalledOnValidThread());
417 417
418 // Record the latency between the packet being received and presented. 418 // Record the latency between the packet being received and presented.
419 stats_.video_decode_ms()->Record( 419 stats_.video_decode_ms()->Record(
420 (base::Time::Now() - decode_start).InMilliseconds()); 420 (base::Time::Now() - decode_start).InMilliseconds());
421 421
422 done.Run(); 422 done.Run();
423 } 423 }
424 424
425 } // namespace remoting 425 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/software_video_renderer.h ('k') | remoting/host/chromoting_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698