aboutsummaryrefslogtreecommitdiff
path: root/cast/standalone_sender/looping_file_cast_agent.cc
diff options
context:
space:
mode:
authorJordan Bayles <jophba@chromium.org>2021-06-28 16:46:18 -0700
committerOpenscreen LUCI CQ <openscreen-scoped@luci-project-accounts.iam.gserviceaccount.com>2021-06-29 00:07:41 +0000
commit8ac28e195414974bf38a249270e4e842790c82f7 (patch)
treebf860be47c013cd8cba8ba8a43f65c680184ed39 /cast/standalone_sender/looping_file_cast_agent.cc
parent43bb3ea9ad8731ac539b299b77b71ba98b0a2767 (diff)
downloadopenscreen-8ac28e195414974bf38a249270e4e842790c82f7.tar.gz
[Cast Streaming] Allow playing file only once
Currently, the looping file sender plays the video over and over again. In some cases, like testing, we want to only play the video once. This patch adds a new command line argument that stops the sender after the video finishes playing. Bug: b/191492654 Change-Id: I97a2f1e211037abd09ac21ee482c9f95502ba821 Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2986060 Commit-Queue: Jordan Bayles <jophba@chromium.org> Reviewed-by: Ryan Keane <rwkeane@google.com>
Diffstat (limited to 'cast/standalone_sender/looping_file_cast_agent.cc')
-rw-r--r--cast/standalone_sender/looping_file_cast_agent.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/cast/standalone_sender/looping_file_cast_agent.cc b/cast/standalone_sender/looping_file_cast_agent.cc
index 70d489de..ce9826de 100644
--- a/cast/standalone_sender/looping_file_cast_agent.cc
+++ b/cast/standalone_sender/looping_file_cast_agent.cc
@@ -291,8 +291,8 @@ void LoopingFileCastAgent::OnNegotiated(
}
file_sender_ = std::make_unique<LoopingFileSender>(
- environment_.get(), connection_settings_->path_to_file.c_str(), session,
- std::move(senders), connection_settings_->max_bitrate);
+ environment_.get(), connection_settings_.value(), session,
+ std::move(senders), [this]() { shutdown_callback_(); });
}
void LoopingFileCastAgent::OnRemotingNegotiated(
@@ -307,8 +307,8 @@ void LoopingFileCastAgent::OnRemotingNegotiated(
}
file_sender_ = std::make_unique<LoopingFileSender>(
- environment_.get(), connection_settings_->path_to_file.c_str(), session,
- std::move(negotiation.senders), connection_settings_->max_bitrate);
+ environment_.get(), connection_settings_.value(), session,
+ std::move(negotiation.senders), [this]() { shutdown_callback_(); });
}
void LoopingFileCastAgent::OnError(const SenderSession* session, Error error) {