diff options
author | Jordan Bayles <jophba@chromium.org> | 2021-07-01 15:13:23 -0700 |
---|---|---|
committer | Openscreen LUCI CQ <openscreen-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2021-07-01 22:52:43 +0000 |
commit | 2e2730fe0190f72dadd631176d2f380b4a6186a8 (patch) | |
tree | 16948b153573e25eafe4dfc986de016013faeed3 /cast/standalone_sender/looping_file_cast_agent.h | |
parent | f2d9d267c1363c42d6eef6f9190033af98fb236b (diff) | |
download | openscreen-2e2730fe0190f72dadd631176d2f380b4a6186a8.tar.gz |
[Cast Streaming] Add codec negotiation over RPC
This patch adds support for negotiating codec information over the RPC
messenger class for both the standalone sender and receiver.
Although a full remoting implementation in the standalone
implementations is not a goal and not particularly practical, it is
important that we exercise the public remoting APIs and get basic usage
and flows handled in our library.
To that end, this patch specifically adds support for sending
RPC_DS_INITIALIZE and RPC_DS_INITIALIZE_CALLBACK messages, simulating
the process of setting up a remoting media stream and demuxer in Chrome.
NOTE: this does not enable "true" remoting--the standalone sender is
still decoding and reencoding the video. For "true" remoting support we
need the ability to unpack raw frames (probably exclusively from a WebM
container that holds VP8 frames) and pass them directly.
In future patches, we can also consider adding additional features to
the standalone implementation, such as play/pause and volume control
methods.
Bug: b/190078859
Change-Id: I49c2acb537aa3c647b8c3a53c9545f5eb3893982
Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2973373
Commit-Queue: Jordan Bayles <jophba@chromium.org>
Reviewed-by: mark a. foltz <mfoltz@chromium.org>
Diffstat (limited to 'cast/standalone_sender/looping_file_cast_agent.h')
-rw-r--r-- | cast/standalone_sender/looping_file_cast_agent.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cast/standalone_sender/looping_file_cast_agent.h b/cast/standalone_sender/looping_file_cast_agent.h index cff0f6ba..895d1324 100644 --- a/cast/standalone_sender/looping_file_cast_agent.h +++ b/cast/standalone_sender/looping_file_cast_agent.h @@ -21,6 +21,7 @@ #include "cast/sender/public/sender_socket_factory.h" #include "cast/standalone_sender/connection_settings.h" #include "cast/standalone_sender/looping_file_sender.h" +#include "cast/standalone_sender/remoting_sender.h" #include "cast/streaming/environment.h" #include "cast/streaming/sender_session.h" #include "platform/api/scoped_wake_lock.h" @@ -134,6 +135,15 @@ class LoopingFileCastAgent final SenderSession::RemotingNegotiation negotiation) override; void OnError(const SenderSession* session, Error error) override; + // Callback for when the RemotingSender indicates that the receiver + // is ready. + void OnRemotingReceiverReady(); + + // Starts the remoting sender. This may occur when remoting is "ready" if the + // session is already negotiated, or upon session negotiation if the receiver + // is already ready. + void StartRemotingSenders(); + // Helper for stopping the current session, and/or unwinding a remote // connection request (pre-session). This ensures LoopingFileCastAgent is in a // terminal shutdown state. @@ -168,6 +178,17 @@ class LoopingFileCastAgent final std::unique_ptr<Environment> environment_; std::unique_ptr<SenderSession> current_session_; std::unique_ptr<LoopingFileSender> file_sender_; + + // Remoting specific member variables. + std::unique_ptr<RemotingSender> remoting_sender_; + + // Set when remoting is successfully negotiated. However, remoting streams + // won't start until |is_ready_for_remoting_| is true. + std::unique_ptr<SenderSession::RemotingNegotiation> current_negotiation_; + + // Set to true when the remoting receiver is ready. However, remoting streams + // won't start until remoting is successfully negotiated. + bool is_ready_for_remoting_ = false; }; } // namespace cast |