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

Side by Side Diff: media/cast/receiver/frame_receiver.cc

Issue 839983002: Adding "target_frame_rate" variable in lieu of "max_frame_rate" for FrameReceiverConfig (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 | « media/cast/cast_config.cc ('k') | media/cast/receiver/frame_receiver_unittest.cc » ('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 "media/cast/receiver/frame_receiver.h" 5 #include "media/cast/receiver/frame_receiver.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/big_endian.h" 9 #include "base/big_endian.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 16 matching lines...) Expand all
27 : cast_environment_(cast_environment), 27 : cast_environment_(cast_environment),
28 transport_(transport), 28 transport_(transport),
29 packet_parser_(config.incoming_ssrc, config.rtp_payload_type), 29 packet_parser_(config.incoming_ssrc, config.rtp_payload_type),
30 stats_(cast_environment->Clock()), 30 stats_(cast_environment->Clock()),
31 event_media_type_(event_media_type), 31 event_media_type_(event_media_type),
32 event_subscriber_(kReceiverRtcpEventHistorySize, event_media_type), 32 event_subscriber_(kReceiverRtcpEventHistorySize, event_media_type),
33 rtp_timebase_(config.frequency), 33 rtp_timebase_(config.frequency),
34 target_playout_delay_( 34 target_playout_delay_(
35 base::TimeDelta::FromMilliseconds(config.rtp_max_delay_ms)), 35 base::TimeDelta::FromMilliseconds(config.rtp_max_delay_ms)),
36 expected_frame_duration_( 36 expected_frame_duration_(
37 base::TimeDelta::FromSeconds(1) / config.max_frame_rate), 37 base::TimeDelta::FromSeconds(1) / config.target_frame_rate),
38 reports_are_scheduled_(false), 38 reports_are_scheduled_(false),
39 framer_(cast_environment->Clock(), 39 framer_(cast_environment->Clock(),
40 this, 40 this,
41 config.incoming_ssrc, 41 config.incoming_ssrc,
42 true, 42 true,
43 config.rtp_max_delay_ms * config.max_frame_rate / 1000), 43 config.rtp_max_delay_ms * config.target_frame_rate / 1000),
44 rtcp_(RtcpCastMessageCallback(), 44 rtcp_(RtcpCastMessageCallback(),
45 RtcpRttCallback(), 45 RtcpRttCallback(),
46 RtcpLogMessageCallback(), 46 RtcpLogMessageCallback(),
47 cast_environment_->Clock(), 47 cast_environment_->Clock(),
48 NULL, 48 NULL,
49 config.feedback_ssrc, 49 config.feedback_ssrc,
50 config.incoming_ssrc), 50 config.incoming_ssrc),
51 is_waiting_for_consecutive_frame_(false), 51 is_waiting_for_consecutive_frame_(false),
52 lip_sync_drift_(ClockDriftSmoother::GetDefaultTimeConstant()), 52 lip_sync_drift_(ClockDriftSmoother::GetDefaultTimeConstant()),
53 rtcp_interval_(base::TimeDelta::FromMilliseconds(config.rtcp_interval)), 53 rtcp_interval_(base::TimeDelta::FromMilliseconds(config.rtcp_interval)),
54 weak_factory_(this) { 54 weak_factory_(this) {
55 transport_->AddValidSsrc(config.incoming_ssrc); 55 transport_->AddValidSsrc(config.incoming_ssrc);
56 DCHECK_GT(config.rtp_max_delay_ms, 0); 56 DCHECK_GT(config.rtp_max_delay_ms, 0);
57 DCHECK_GT(config.max_frame_rate, 0); 57 DCHECK_GT(config.target_frame_rate, 0);
58 decryptor_.Initialize(config.aes_key, config.aes_iv_mask); 58 decryptor_.Initialize(config.aes_key, config.aes_iv_mask);
59 cast_environment_->Logging()->AddRawEventSubscriber(&event_subscriber_); 59 cast_environment_->Logging()->AddRawEventSubscriber(&event_subscriber_);
60 memset(frame_id_to_rtp_timestamp_, 0, sizeof(frame_id_to_rtp_timestamp_)); 60 memset(frame_id_to_rtp_timestamp_, 0, sizeof(frame_id_to_rtp_timestamp_));
61 } 61 }
62 62
63 FrameReceiver::~FrameReceiver() { 63 FrameReceiver::~FrameReceiver() {
64 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); 64 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
65 cast_environment_->Logging()->RemoveRawEventSubscriber(&event_subscriber_); 65 cast_environment_->Logging()->RemoveRawEventSubscriber(&event_subscriber_);
66 } 66 }
67 67
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 rtcp_.ConvertToNTPAndSave(now), 341 rtcp_.ConvertToNTPAndSave(now),
342 NULL, 342 NULL,
343 base::TimeDelta(), 343 base::TimeDelta(),
344 NULL, 344 NULL,
345 &stats); 345 &stats);
346 ScheduleNextRtcpReport(); 346 ScheduleNextRtcpReport();
347 } 347 }
348 348
349 } // namespace cast 349 } // namespace cast
350 } // namespace media 350 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/cast_config.cc ('k') | media/cast/receiver/frame_receiver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698