OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_IMPL_H_ | 5 #ifndef MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_IMPL_H_ |
6 #define MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_IMPL_H_ | 6 #define MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_IMPL_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/time/tick_clock.h" | 11 #include "base/time/tick_clock.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "base/timer/timer.h" | 13 #include "base/timer/timer.h" |
14 #include "media/cast/logging/logging_defines.h" | 14 #include "media/cast/logging/logging_defines.h" |
15 #include "media/cast/logging/simple_event_subscriber.h" | 15 #include "media/cast/logging/simple_event_subscriber.h" |
16 #include "media/cast/transport/cast_transport_config.h" | 16 #include "media/cast/transport/cast_transport_config.h" |
17 #include "media/cast/transport/cast_transport_sender.h" | 17 #include "media/cast/transport/cast_transport_sender.h" |
18 #include "media/cast/transport/pacing/paced_sender.h" | 18 #include "media/cast/transport/pacing/paced_sender.h" |
19 #include "media/cast/transport/rtcp/rtcp_builder.h" | 19 #include "media/cast/transport/rtcp/rtcp_builder.h" |
20 #include "media/cast/transport/transport_audio_sender.h" | 20 #include "media/cast/transport/rtp_sender/rtp_sender.h" |
21 #include "media/cast/transport/transport_video_sender.h" | 21 #include "media/cast/transport/utility/transport_encryption_handler.h" |
22 | 22 |
23 namespace media { | 23 namespace media { |
24 namespace cast { | 24 namespace cast { |
25 namespace transport { | 25 namespace transport { |
26 | 26 |
27 class CastTransportSenderImpl : public CastTransportSender { | 27 class CastTransportSenderImpl : public CastTransportSender { |
28 public: | 28 public: |
29 // external_transport is only used for testing. | 29 // external_transport is only used for testing. |
30 // Note that SetPacketReceiver does not work if an external | 30 // Note that SetPacketReceiver does not work if an external |
31 // transport is provided. | 31 // transport is provided. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 void SendRawEvents(); | 75 void SendRawEvents(); |
76 | 76 |
77 base::TickClock* clock_; // Not owned by this class. | 77 base::TickClock* clock_; // Not owned by this class. |
78 CastTransportStatusCallback status_callback_; | 78 CastTransportStatusCallback status_callback_; |
79 scoped_refptr<base::SingleThreadTaskRunner> transport_task_runner_; | 79 scoped_refptr<base::SingleThreadTaskRunner> transport_task_runner_; |
80 | 80 |
81 scoped_ptr<UdpTransport> transport_; | 81 scoped_ptr<UdpTransport> transport_; |
82 LoggingImpl logging_; | 82 LoggingImpl logging_; |
83 PacedSender pacer_; | 83 PacedSender pacer_; |
84 RtcpBuilder rtcp_builder_; | 84 RtcpBuilder rtcp_builder_; |
85 scoped_ptr<TransportAudioSender> audio_sender_; | 85 scoped_ptr<RtpSender> audio_sender_; |
86 scoped_ptr<TransportVideoSender> video_sender_; | 86 scoped_ptr<RtpSender> video_sender_; |
| 87 |
| 88 // Encrypts data in EncodedFrames before they are sent. Note that it's |
| 89 // important for the encryption to happen here, in code that would execute in |
| 90 // the main browser process, for security reasons. This helps to mitigate |
| 91 // the damage that could be caused by a compromised renderer process. |
| 92 TransportEncryptionHandler audio_encryptor_; |
| 93 TransportEncryptionHandler video_encryptor_; |
87 | 94 |
88 // This is non-null iff |raw_events_callback_| is non-null. | 95 // This is non-null iff |raw_events_callback_| is non-null. |
89 scoped_ptr<SimpleEventSubscriber> event_subscriber_; | 96 scoped_ptr<SimpleEventSubscriber> event_subscriber_; |
90 base::RepeatingTimer<CastTransportSenderImpl> raw_events_timer_; | 97 base::RepeatingTimer<CastTransportSenderImpl> raw_events_timer_; |
91 | 98 |
92 BulkRawEventsCallback raw_events_callback_; | 99 BulkRawEventsCallback raw_events_callback_; |
93 | 100 |
94 DISALLOW_COPY_AND_ASSIGN(CastTransportSenderImpl); | 101 DISALLOW_COPY_AND_ASSIGN(CastTransportSenderImpl); |
95 }; | 102 }; |
96 | 103 |
97 } // namespace transport | 104 } // namespace transport |
98 } // namespace cast | 105 } // namespace cast |
99 } // namespace media | 106 } // namespace media |
100 | 107 |
101 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_IMPL_H_ | 108 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_IMPL_H_ |
OLD | NEW |