Chromium Code Reviews| Index: media/cast/audio_sender/audio_sender.h |
| diff --git a/media/cast/audio_sender/audio_sender.h b/media/cast/audio_sender/audio_sender.h |
| index c633b076c8a7edff836f85de206784c45b3e1e98..0ac619df6855c902cfdd7497be7ed6d8efd0c136 100644 |
| --- a/media/cast/audio_sender/audio_sender.h |
| +++ b/media/cast/audio_sender/audio_sender.h |
| @@ -16,7 +16,7 @@ |
| #include "media/cast/cast_config.h" |
| #include "media/cast/rtcp/rtcp.h" |
| #include "media/cast/rtp_timestamp_helper.h" |
| -#include "media/cast/transport/rtp_sender/rtp_sender.h" |
| +#include "media/cast/transport/utility/transport_encryption_handler.h" |
| namespace media { |
| namespace cast { |
| @@ -36,18 +36,17 @@ class AudioSender : public RtcpSenderFeedback, |
| virtual ~AudioSender(); |
| CastInitializationStatus InitializationResult() const { |
| - return cast_initialization_cb_; |
| + return cast_initialization_status_; |
| } |
| + // Note: It is invalid to call this method if InitializationResult() returns |
| + // anything but STATUS_AUDIO_INITIALIZED. |
| void InsertAudio(scoped_ptr<AudioBus> audio_bus, |
| const base::TimeTicks& recorded_time); |
| // Only called from the main cast thread. |
| void IncomingRtcpPacket(scoped_ptr<Packet> packet); |
| - protected: |
| - void SendEncodedAudioFrame(scoped_ptr<transport::EncodedFrame> audio_frame); |
| - |
| private: |
| void ResendPackets( |
| const MissingFramesAndPacketsMap& missing_frames_and_packets); |
| @@ -55,6 +54,11 @@ class AudioSender : public RtcpSenderFeedback, |
| void ScheduleNextRtcpReport(); |
| void SendRtcpReport(bool schedule_future_reports); |
| + // Called by the |audio_encoder_| with the next EncodedFrame to send. If |
| + // encryption is enabled, |encoded_frame->data| is encrypted before sending |
| + // using |transport_sender_|. |
| + void SendEncodedAudioFrame(scoped_ptr<transport::EncodedFrame> audio_frame); |
| + |
| virtual void OnReceivedCastFeedback(const RtcpCastMessage& cast_feedback) |
| OVERRIDE; |
| @@ -64,7 +68,12 @@ class AudioSender : public RtcpSenderFeedback, |
| RtpTimestampHelper rtp_timestamp_helper_; |
| Rtcp rtcp_; |
| int num_aggressive_rtcp_reports_sent_; |
| - CastInitializationStatus cast_initialization_cb_; |
| + |
| + // Encrypts data in EncodedFrames before they are sent. |
| + transport::TransportEncryptionHandler encryptor_; |
|
Alpha Left Google
2014/06/03 20:01:52
It is by design to have encryption done in the tra
miu
2014/06/03 21:55:15
Done.
|
| + |
| + // If this sender is ready for use, this is STATUS_AUDIO_INITIALIZED. |
| + CastInitializationStatus cast_initialization_status_; |
| // Used to map the lower 8 bits of the frame id to a RTP timestamp. This is |
| // good enough as we only use it for logging. |