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

Unified Diff: media/cast/net/cast_transport_impl.h

Issue 2048033003: Refactoring: CastTransport InitializeAudio/InitializeVideo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments. Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cast/net/cast_transport_defines.h ('k') | media/cast/net/cast_transport_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/net/cast_transport_impl.h
diff --git a/media/cast/net/cast_transport_impl.h b/media/cast/net/cast_transport_impl.h
index 5dff2b51a8809af664acbf1e02fb4bdef91ca14b..98462fa8fa7ccf02b2960fe20c75491b5877c6bb 100644
--- a/media/cast/net/cast_transport_impl.h
+++ b/media/cast/net/cast_transport_impl.h
@@ -65,10 +65,8 @@ class CastTransportImpl final : public CastTransport {
~CastTransportImpl() final;
// CastTransport implementation for sending.
- void InitializeAudio(const CastTransportRtpConfig& config,
- std::unique_ptr<RtcpObserver> rtcp_observer) final;
- void InitializeVideo(const CastTransportRtpConfig& config,
- std::unique_ptr<RtcpObserver> rtcp_observer) final;
+ void InitializeStream(const CastTransportRtpConfig& config,
+ std::unique_ptr<RtcpObserver> rtcp_observer) final;
void InsertFrame(uint32_t ssrc, const EncodedFrame& frame) final;
void SendSenderReport(uint32_t ssrc,
@@ -116,6 +114,8 @@ class CastTransportImpl final : public CastTransport {
// Handle received RTCP messages on RTP sender.
class RtcpClient;
+ struct RtpStreamSession;
+
FRIEND_TEST_ALL_PREFIXES(CastTransportImplTest, NacksCancelRetransmits);
FRIEND_TEST_ALL_PREFIXES(CastTransportImplTest, CancelRetransmits);
FRIEND_TEST_ALL_PREFIXES(CastTransportImplTest, Kickstart);
@@ -160,25 +160,6 @@ class CastTransportImpl final : public CastTransport {
// Packet sender that performs pacing.
PacedSender pacer_;
- // Packetizer for audio and video frames.
- std::unique_ptr<RtpSender> audio_sender_;
- std::unique_ptr<RtpSender> video_sender_;
-
- // Maintains RTCP session for audio and video.
- std::unique_ptr<SenderRtcpSession> audio_rtcp_session_;
- std::unique_ptr<SenderRtcpSession> video_rtcp_session_;
-
- // RTCP observer for SenderRtcpSession.
- std::unique_ptr<RtcpObserver> audio_rtcp_observer_;
- std::unique_ptr<RtcpObserver> video_rtcp_observer_;
-
- // Encrypts data in EncodedFrames before they are sent. Note that it's
- // important for the encryption to happen here, in code that would execute in
- // the main browser process, for security reasons. This helps to mitigate
- // the damage that could be caused by a compromised renderer process.
- TransportEncryptionHandler audio_encryptor_;
- TransportEncryptionHandler video_encryptor_;
-
// Right after a frame is sent we record the number of bytes sent to the
// socket. We record the corresponding bytes sent for the most recent ACKed
// audio packet.
@@ -199,6 +180,11 @@ class CastTransportImpl final : public CastTransport {
std::unique_ptr<RtcpBuilder> rtcp_builder_at_rtp_receiver_;
+ // Records the initialized stream sessions on RTP sender. The sender SSRC is
+ // used as key since it is unique for each RTP stream.
+ using SessionMap = std::map<uint32_t, std::unique_ptr<RtpStreamSession>>;
+ SessionMap sessions_;
+
base::WeakPtrFactory<CastTransportImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(CastTransportImpl);
« no previous file with comments | « media/cast/net/cast_transport_defines.h ('k') | media/cast/net/cast_transport_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698