Commit 66df1c2b authored by Marcin Radomski's avatar Marcin Radomski Committed by Commit Bot

Add never_timeout_connection field to OutputStreamParams proto

If set to true, mixer inactivity timer is not started, preventing the
mixer from dropping connection after kInactivityTimeout of no incoming
data.

Bug: b/138551750
Change-Id: Iacf3327a0b185e76d0976d2bc50a6a0b95de942b
Merge-With: eureka-internal/343509
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1960318Reviewed-by: default avatarKenneth MacKay <kmackay@chromium.org>
Commit-Queue: Marcin Radomski <dextero@google.com>
Auto-Submit: Marcin Radomski <dextero@google.com>
Cr-Commit-Position: refs/heads/master@{#724567}
parent 8234cb57
......@@ -55,6 +55,10 @@ message OutputStreamParams {
// If |true|, this stream will not be included in the mixer's stream counts.
optional bool ignore_for_stream_count = 14;
// If |true|, the receiver will not close the stream after a period of
// inactivity.
optional bool never_timeout_connection = 15;
}
// Indicates that we want to start playing the sample with PTS |start_pts|
......
......@@ -171,6 +171,7 @@ MixerInputConnection::MixerInputConnection(
io_task_runner_(base::ThreadTaskRunnerHandle::Get()),
max_queued_frames_(std::max(GetQueueSize(params), algorithm_fill_size_)),
start_threshold_frames_(GetStartThreshold(params)),
never_timeout_connection_(params.never_timeout_connection()),
fader_(this,
params.has_fade_frames()
? params.fade_frames()
......@@ -371,6 +372,10 @@ void MixerInputConnection::OnConnectionError() {
}
void MixerInputConnection::OnInactivityTimeout() {
if (never_timeout_connection_) {
return;
}
LOG(INFO) << "Timed out " << this << " due to inactivity";
OnConnectionError();
}
......
......@@ -156,6 +156,7 @@ class MixerInputConnection : public mixer_service::MixerSocket::Delegate,
// Only used on the IO thread.
bool audio_ready_for_playback_fired_ = false;
bool never_timeout_connection_ = false;
base::OneShotTimer inactivity_timer_;
bool connection_error_ = false;
int buffer_pool_frames_ = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment