Chromium Code Reviews| 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_RECEIVER_AUDIO_RECEIVER_H_ | 5 #ifndef MEDIA_CAST_AUDIO_RECEIVER_AUDIO_RECEIVER_H_ |
| 6 #define MEDIA_CAST_AUDIO_RECEIVER_AUDIO_RECEIVER_H_ | 6 #define MEDIA_CAST_AUDIO_RECEIVER_AUDIO_RECEIVER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/threading/non_thread_safe.h" | 13 #include "base/threading/non_thread_safe.h" |
| 14 #include "base/time/tick_clock.h" | 14 #include "base/time/tick_clock.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "crypto/encryptor.h" | |
| 16 #include "media/cast/cast_config.h" | 17 #include "media/cast/cast_config.h" |
| 17 #include "media/cast/cast_environment.h" | 18 #include "media/cast/cast_environment.h" |
| 18 #include "media/cast/cast_receiver.h" | 19 #include "media/cast/cast_receiver.h" |
| 19 #include "media/cast/rtcp/rtcp.h" // RtcpCastMessage | 20 #include "media/cast/rtcp/rtcp.h" // RtcpCastMessage |
| 20 #include "media/cast/rtp_common/rtp_defines.h" // RtpCastHeader | 21 #include "media/cast/rtp_common/rtp_defines.h" // RtpCastHeader |
| 21 | 22 |
| 22 namespace media { | 23 namespace media { |
| 23 namespace cast { | 24 namespace cast { |
| 24 | 25 |
| 25 class AudioDecoder; | 26 class AudioDecoder; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 74 | 75 |
| 75 // Actual decoding implementation - should be called under the audio decoder | 76 // Actual decoding implementation - should be called under the audio decoder |
| 76 // thread. | 77 // thread. |
| 77 void DecodeAudioFrameThread(int number_of_10ms_blocks, | 78 void DecodeAudioFrameThread(int number_of_10ms_blocks, |
| 78 int desired_frequency, | 79 int desired_frequency, |
| 79 const AudioFrameDecodedCallback callback); | 80 const AudioFrameDecodedCallback callback); |
| 80 | 81 |
| 81 // Return the playout time based on the current time and rtp timestamp. | 82 // Return the playout time based on the current time and rtp timestamp. |
| 82 base::TimeTicks GetPlayoutTime(base::TimeTicks now, uint32 rtp_timestamp); | 83 base::TimeTicks GetPlayoutTime(base::TimeTicks now, uint32 rtp_timestamp); |
| 83 | 84 |
| 85 bool DecryptAudioFrame(const EncodedAudioFrame* encrypted_frame, | |
|
Alpha Left Google
2013/11/07 01:10:11
Please add a comment about the parameters. Which o
pwestin
2013/11/07 17:16:04
it felt weird allowing the scoped ptr being empty
| |
| 86 EncodedAudioFrame* audio_frame); | |
| 87 | |
| 84 // Schedule the next RTCP report. | 88 // Schedule the next RTCP report. |
| 85 void ScheduleNextRtcpReport(); | 89 void ScheduleNextRtcpReport(); |
| 86 | 90 |
| 87 // Actually send the next RTCP report. | 91 // Actually send the next RTCP report. |
| 88 void SendNextRtcpReport(); | 92 void SendNextRtcpReport(); |
| 89 | 93 |
| 90 // Schedule timing for the next cast message. | 94 // Schedule timing for the next cast message. |
| 91 void ScheduleNextCastMessage(); | 95 void ScheduleNextCastMessage(); |
| 92 | 96 |
| 93 // Actually send the next cast message. | 97 // Actually send the next cast message. |
| 94 void SendNextCastMessage(); | 98 void SendNextCastMessage(); |
| 95 | 99 |
| 96 scoped_refptr<CastEnvironment> cast_environment_; | 100 scoped_refptr<CastEnvironment> cast_environment_; |
| 97 base::WeakPtrFactory<AudioReceiver> weak_factory_; | 101 base::WeakPtrFactory<AudioReceiver> weak_factory_; |
| 98 | 102 |
| 99 const AudioCodec codec_; | 103 const AudioCodec codec_; |
| 100 const uint32 incoming_ssrc_; | 104 const uint32 incoming_ssrc_; |
| 101 const int frequency_; | 105 const int frequency_; |
| 102 base::TimeDelta target_delay_delta_; | 106 base::TimeDelta target_delay_delta_; |
| 103 scoped_ptr<Framer> audio_buffer_; | 107 scoped_ptr<Framer> audio_buffer_; |
| 104 scoped_refptr<AudioDecoder> audio_decoder_; | 108 scoped_refptr<AudioDecoder> audio_decoder_; |
| 105 scoped_ptr<LocalRtpAudioData> incoming_payload_callback_; | 109 scoped_ptr<LocalRtpAudioData> incoming_payload_callback_; |
| 106 scoped_ptr<LocalRtpAudioFeedback> incoming_payload_feedback_; | 110 scoped_ptr<LocalRtpAudioFeedback> incoming_payload_feedback_; |
| 107 scoped_ptr<RtpReceiver> rtp_receiver_; | 111 scoped_ptr<RtpReceiver> rtp_receiver_; |
| 108 scoped_ptr<Rtcp> rtcp_; | 112 scoped_ptr<Rtcp> rtcp_; |
| 109 scoped_ptr<RtpReceiverStatistics> rtp_audio_receiver_statistics_; | 113 scoped_ptr<RtpReceiverStatistics> rtp_audio_receiver_statistics_; |
| 110 base::TimeDelta time_offset_; | 114 base::TimeDelta time_offset_; |
| 111 base::TimeTicks time_first_incoming_packet_; | 115 base::TimeTicks time_first_incoming_packet_; |
| 112 uint32 first_incoming_rtp_timestamp_; | 116 uint32 first_incoming_rtp_timestamp_; |
| 117 scoped_ptr<crypto::Encryptor> decryptor_; | |
| 118 std::string iv_mask_; | |
| 113 | 119 |
| 114 std::list<AudioFrameEncodedCallback> queued_encoded_callbacks_; | 120 std::list<AudioFrameEncodedCallback> queued_encoded_callbacks_; |
| 115 }; | 121 }; |
| 116 | 122 |
| 117 } // namespace cast | 123 } // namespace cast |
| 118 } // namespace media | 124 } // namespace media |
| 119 | 125 |
| 120 #endif // MEDIA_CAST_AUDIO_RECEIVER_AUDIO_RECEIVER_H_ | 126 #endif // MEDIA_CAST_AUDIO_RECEIVER_AUDIO_RECEIVER_H_ |
| OLD | NEW |