diff options
author | anujk.sharma <anujk.sharma@samsung.com> | 2015-01-08 13:21:07 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-08 21:22:36 +0000 |
commit | 080a59d7e7691befd122564c73bb353050e3c1dc (patch) | |
tree | 73ab9ab16647e6929f980c588e3b5fa1de4c5bab /media | |
parent | 372d19064a31240d9808b2ea60d377e47f1e7295 (diff) | |
download | chromium_src-080a59d7e7691befd122564c73bb353050e3c1dc.zip chromium_src-080a59d7e7691befd122564c73bb353050e3c1dc.tar.gz chromium_src-080a59d7e7691befd122564c73bb353050e3c1dc.tar.bz2 |
Adding "target_frame_rate" variable in lieu of "max_frame_rate" for FrameReceiverConfig structure.
BUG=447205
Review URL: https://codereview.chromium.org/839983002
Cr-Commit-Position: refs/heads/master@{#310600}
Diffstat (limited to 'media')
-rw-r--r-- | media/cast/cast_config.cc | 2 | ||||
-rw-r--r-- | media/cast/cast_config.h | 2 | ||||
-rw-r--r-- | media/cast/receiver/frame_receiver.cc | 6 | ||||
-rw-r--r-- | media/cast/receiver/frame_receiver_unittest.cc | 10 | ||||
-rw-r--r-- | media/cast/test/cast_benchmarks.cc | 4 | ||||
-rw-r--r-- | media/cast/test/end2end_unittest.cc | 5 | ||||
-rw-r--r-- | media/cast/test/receiver.cc | 2 | ||||
-rw-r--r-- | media/cast/test/utility/default_config.cc | 6 |
8 files changed, 19 insertions, 18 deletions
diff --git a/media/cast/cast_config.cc b/media/cast/cast_config.cc index c0add09..e371cea 100644 --- a/media/cast/cast_config.cc +++ b/media/cast/cast_config.cc @@ -67,7 +67,7 @@ FrameReceiverConfig::FrameReceiverConfig() rtp_payload_type(0), frequency(0), channels(0), - max_frame_rate(0), + target_frame_rate(0), codec(CODEC_UNKNOWN) {} FrameReceiverConfig::~FrameReceiverConfig() {} diff --git a/media/cast/cast_config.h b/media/cast/cast_config.h index 868a149..446b1e0 100644 --- a/media/cast/cast_config.h +++ b/media/cast/cast_config.h @@ -145,7 +145,7 @@ struct FrameReceiverConfig { // The target frame rate. For audio, this is normally 100 (i.e., frames have // a duration of 10ms each). For video, this is normally 30, but any frame // rate is supported. - int max_frame_rate; // TODO(miu): Rename to target_frame_rate. + int target_frame_rate; // Codec used for the compression of signal data. // TODO(miu): Merge the AudioCodec and VideoCodec enums into one so this union diff --git a/media/cast/receiver/frame_receiver.cc b/media/cast/receiver/frame_receiver.cc index c1155d0..7f0594a 100644 --- a/media/cast/receiver/frame_receiver.cc +++ b/media/cast/receiver/frame_receiver.cc @@ -34,13 +34,13 @@ FrameReceiver::FrameReceiver( target_playout_delay_( base::TimeDelta::FromMilliseconds(config.rtp_max_delay_ms)), expected_frame_duration_( - base::TimeDelta::FromSeconds(1) / config.max_frame_rate), + base::TimeDelta::FromSeconds(1) / config.target_frame_rate), reports_are_scheduled_(false), framer_(cast_environment->Clock(), this, config.incoming_ssrc, true, - config.rtp_max_delay_ms * config.max_frame_rate / 1000), + config.rtp_max_delay_ms * config.target_frame_rate / 1000), rtcp_(RtcpCastMessageCallback(), RtcpRttCallback(), RtcpLogMessageCallback(), @@ -54,7 +54,7 @@ FrameReceiver::FrameReceiver( weak_factory_(this) { transport_->AddValidSsrc(config.incoming_ssrc); DCHECK_GT(config.rtp_max_delay_ms, 0); - DCHECK_GT(config.max_frame_rate, 0); + DCHECK_GT(config.target_frame_rate, 0); decryptor_.Initialize(config.aes_key, config.aes_iv_mask); cast_environment_->Logging()->AddRawEventSubscriber(&event_subscriber_); memset(frame_id_to_rtp_timestamp_, 0, sizeof(frame_id_to_rtp_timestamp_)); diff --git a/media/cast/receiver/frame_receiver_unittest.cc b/media/cast/receiver/frame_receiver_unittest.cc index 42bc4e3..8e4781e 100644 --- a/media/cast/receiver/frame_receiver_unittest.cc +++ b/media/cast/receiver/frame_receiver_unittest.cc @@ -105,7 +105,7 @@ class FrameReceiverTest : public ::testing::Test { config_.rtp_max_delay_ms = kPlayoutDelayMillis; // Note: Frame rate must divide 1000 without remainder so the test code // doesn't have to account for rounding errors. - config_.max_frame_rate = 25; + config_.target_frame_rate = 25; receiver_.reset(new FrameReceiver( cast_environment_, config_, VIDEO_EVENT, &mock_transport_)); @@ -217,9 +217,9 @@ TEST_F(FrameReceiverTest, ReceivesFramesSkippingWhenAppropriate) { .WillRepeatedly(testing::Return()); const uint32 rtp_advance_per_frame = - config_.frequency / config_.max_frame_rate; + config_.frequency / config_.target_frame_rate; const base::TimeDelta time_advance_per_frame = - base::TimeDelta::FromSeconds(1) / config_.max_frame_rate; + base::TimeDelta::FromSeconds(1) / config_.target_frame_rate; // Feed and process lip sync in receiver. FeedLipSyncInfoIntoReceiver(); @@ -320,9 +320,9 @@ TEST_F(FrameReceiverTest, ReceivesFramesRefusingToSkipAny) { .WillRepeatedly(testing::Return()); const uint32 rtp_advance_per_frame = - config_.frequency / config_.max_frame_rate; + config_.frequency / config_.target_frame_rate; const base::TimeDelta time_advance_per_frame = - base::TimeDelta::FromSeconds(1) / config_.max_frame_rate; + base::TimeDelta::FromSeconds(1) / config_.target_frame_rate; // Feed and process lip sync in receiver. FeedLipSyncInfoIntoReceiver(); diff --git a/media/cast/test/cast_benchmarks.cc b/media/cast/test/cast_benchmarks.cc index 214f3a5..a38f2be 100644 --- a/media/cast/test/cast_benchmarks.cc +++ b/media/cast/test/cast_benchmarks.cc @@ -256,7 +256,7 @@ class RunOneBenchmark { audio_sender_config_.rtp_payload_type; audio_receiver_config_.frequency = audio_sender_config_.frequency; audio_receiver_config_.channels = kAudioChannels; - audio_receiver_config_.max_frame_rate = 100; + audio_receiver_config_.target_frame_rate = 100; audio_receiver_config_.codec = audio_sender_config_.codec; audio_receiver_config_.rtp_max_delay_ms = kTargetPlayoutDelayMs; @@ -292,7 +292,7 @@ class RunOneBenchmark { video_receiver_config_.codec = video_sender_config_.codec; video_receiver_config_.frequency = kVideoFrequency; video_receiver_config_.channels = 1; - video_receiver_config_.max_frame_rate = 100; + video_receiver_config_.target_frame_rate = 100; video_receiver_config_.rtp_max_delay_ms = kTargetPlayoutDelayMs; } diff --git a/media/cast/test/end2end_unittest.cc b/media/cast/test/end2end_unittest.cc index ed7118d..13d915b 100644 --- a/media/cast/test/end2end_unittest.cc +++ b/media/cast/test/end2end_unittest.cc @@ -488,7 +488,7 @@ class End2EndTest : public ::testing::Test { audio_sender_config_.rtp_payload_type; audio_receiver_config_.frequency = audio_sender_config_.frequency; audio_receiver_config_.channels = kAudioChannels; - audio_receiver_config_.max_frame_rate = 100; + audio_receiver_config_.target_frame_rate = 100; audio_receiver_config_.codec = audio_sender_config_.codec; test_receiver_audio_callback_->SetExpectedSamplingFrequency( @@ -520,7 +520,8 @@ class End2EndTest : public ::testing::Test { video_sender_config_.rtp_payload_type; video_receiver_config_.frequency = kVideoFrequency; video_receiver_config_.channels = 1; - video_receiver_config_.max_frame_rate = video_sender_config_.max_frame_rate; + video_receiver_config_.target_frame_rate = + video_sender_config_.max_frame_rate; video_receiver_config_.codec = video_sender_config_.codec; } diff --git a/media/cast/test/receiver.cc b/media/cast/test/receiver.cc index f30e749..e930034 100644 --- a/media/cast/test/receiver.cc +++ b/media/cast/test/receiver.cc @@ -194,7 +194,7 @@ class NaivePlayer : public InProcessReceiver, // Maximum age is the duration of 3 video frames. 3 was chosen // arbitrarily, but seems to work well. max_frame_age_(base::TimeDelta::FromSeconds(1) * 3 / - video_config.max_frame_rate), + video_config.target_frame_rate), #if defined(USE_X11) render_(0, 0, window_width, window_height, "Cast_receiver"), #endif // defined(USE_X11) diff --git a/media/cast/test/utility/default_config.cc b/media/cast/test/utility/default_config.cc index bec36fc..1becf60 100644 --- a/media/cast/test/utility/default_config.cc +++ b/media/cast/test/utility/default_config.cc @@ -33,7 +33,7 @@ FrameReceiverConfig GetDefaultAudioReceiverConfig() { config.rtp_payload_type = 127; config.frequency = 48000; config.channels = 2; - config.max_frame_rate = 100; // 10ms of signal per frame + config.target_frame_rate = 100; // 10ms of signal per frame config.codec = media::cast::CODEC_AUDIO_OPUS; return config; } @@ -46,7 +46,7 @@ FrameReceiverConfig GetDefaultVideoReceiverConfig() { config.rtp_payload_type = 96; config.frequency = kVideoFrequency; config.channels = 1; - config.max_frame_rate = kDefaultMaxFrameRate; + config.target_frame_rate = kDefaultMaxFrameRate; config.codec = media::cast::CODEC_VIDEO_VP8; return config; } @@ -79,7 +79,7 @@ VideoSenderConfig GetDefaultVideoSenderConfig() { config.max_bitrate = 4000000; config.min_bitrate = 2000000; config.start_bitrate = 4000000; - config.max_frame_rate = recv_config.max_frame_rate; + config.max_frame_rate = recv_config.target_frame_rate; config.max_number_of_video_buffers_used = 1; config.codec = recv_config.codec; config.number_of_encode_threads = 2; |