OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_AUDIO_SENDER_H_ | 5 #ifndef MEDIA_CAST_AUDIO_SENDER_H_ |
6 #define MEDIA_CAST_AUDIO_SENDER_H_ | 6 #define MEDIA_CAST_AUDIO_SENDER_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/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "base/threading/non_thread_safe.h" | 12 #include "base/threading/non_thread_safe.h" |
13 #include "base/time/tick_clock.h" | 13 #include "base/time/tick_clock.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "crypto/encryptor.h" |
15 #include "media/cast/cast_config.h" | 16 #include "media/cast/cast_config.h" |
16 #include "media/cast/cast_environment.h" | 17 #include "media/cast/cast_environment.h" |
17 #include "media/cast/rtcp/rtcp.h" | 18 #include "media/cast/rtcp/rtcp.h" |
18 #include "media/cast/rtp_sender/rtp_sender.h" | 19 #include "media/cast/rtp_sender/rtp_sender.h" |
19 | 20 |
20 namespace media { | 21 namespace media { |
21 namespace cast { | 22 namespace cast { |
22 | 23 |
23 class AudioEncoder; | 24 class AudioEncoder; |
24 class LocalRtcpAudioSenderFeedback; | 25 class LocalRtcpAudioSenderFeedback; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 protected: | 60 protected: |
60 void SendEncodedAudioFrame(scoped_ptr<EncodedAudioFrame> audio_frame, | 61 void SendEncodedAudioFrame(scoped_ptr<EncodedAudioFrame> audio_frame, |
61 const base::TimeTicks& recorded_time); | 62 const base::TimeTicks& recorded_time); |
62 | 63 |
63 private: | 64 private: |
64 friend class LocalRtcpAudioSenderFeedback; | 65 friend class LocalRtcpAudioSenderFeedback; |
65 | 66 |
66 void ResendPackets( | 67 void ResendPackets( |
67 const MissingFramesAndPacketsMap& missing_frames_and_packets); | 68 const MissingFramesAndPacketsMap& missing_frames_and_packets); |
68 | 69 |
| 70 // Caller must allocate the destination |encrypted_frame|. The data member |
| 71 // will be resized to hold the encrypted size. |
| 72 bool EncryptAudioFrame(const EncodedAudioFrame& audio_frame, |
| 73 EncodedAudioFrame* encrypted_frame); |
| 74 |
69 void ScheduleNextRtcpReport(); | 75 void ScheduleNextRtcpReport(); |
70 void SendRtcpReport(); | 76 void SendRtcpReport(); |
71 | 77 |
72 base::WeakPtrFactory<AudioSender> weak_factory_; | 78 base::WeakPtrFactory<AudioSender> weak_factory_; |
73 | 79 |
74 const uint32 incoming_feedback_ssrc_; | 80 const uint32 incoming_feedback_ssrc_; |
75 scoped_refptr<CastEnvironment> cast_environment_; | 81 scoped_refptr<CastEnvironment> cast_environment_; |
76 scoped_refptr<AudioEncoder> audio_encoder_; | 82 scoped_refptr<AudioEncoder> audio_encoder_; |
77 RtpSender rtp_sender_; | 83 RtpSender rtp_sender_; |
78 scoped_ptr<LocalRtpSenderStatistics> rtp_audio_sender_statistics_; | 84 scoped_ptr<LocalRtpSenderStatistics> rtp_audio_sender_statistics_; |
79 scoped_ptr<LocalRtcpAudioSenderFeedback> rtcp_feedback_; | 85 scoped_ptr<LocalRtcpAudioSenderFeedback> rtcp_feedback_; |
80 Rtcp rtcp_; | 86 Rtcp rtcp_; |
| 87 scoped_ptr<crypto::Encryptor> encryptor_; |
| 88 std::string iv_mask_; |
81 | 89 |
82 DISALLOW_COPY_AND_ASSIGN(AudioSender); | 90 DISALLOW_COPY_AND_ASSIGN(AudioSender); |
83 }; | 91 }; |
84 | 92 |
85 } // namespace cast | 93 } // namespace cast |
86 } // namespace media | 94 } // namespace media |
87 | 95 |
88 #endif // MEDIA_CAST_AUDIO_SENDER_H_ | 96 #endif // MEDIA_CAST_AUDIO_SENDER_H_ |
89 | 97 |
OLD | NEW |