| 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" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 class Encryptor; | 23 class Encryptor; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace media { | 26 namespace media { |
| 27 namespace cast { | 27 namespace cast { |
| 28 | 28 |
| 29 class AudioDecoder; | 29 class AudioDecoder; |
| 30 class Framer; | 30 class Framer; |
| 31 class LocalRtpAudioData; | 31 class LocalRtpAudioData; |
| 32 class LocalRtpAudioFeedback; | 32 class LocalRtpAudioFeedback; |
| 33 class PacedPacketSender; | 33 class transport::PacedPacketSender; |
| 34 class RtpReceiver; | 34 class RtpReceiver; |
| 35 class RtpReceiverStatistics; | 35 class RtpReceiverStatistics; |
| 36 | 36 |
| 37 struct DecodedAudioCallbackData { | 37 struct DecodedAudioCallbackData { |
| 38 DecodedAudioCallbackData(); | 38 DecodedAudioCallbackData(); |
| 39 ~DecodedAudioCallbackData(); | 39 ~DecodedAudioCallbackData(); |
| 40 int number_of_10ms_blocks; | 40 int number_of_10ms_blocks; |
| 41 int desired_frequency; | 41 int desired_frequency; |
| 42 AudioFrameDecodedCallback callback; | 42 AudioFrameDecodedCallback callback; |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 // This class is not thread safe. Should only be called from the Main cast | 45 // This class is not thread safe. Should only be called from the Main cast |
| 46 // thread. | 46 // thread. |
| 47 class AudioReceiver : public base::NonThreadSafe, | 47 class AudioReceiver : public base::NonThreadSafe, |
| 48 public base::SupportsWeakPtr<AudioReceiver> { | 48 public base::SupportsWeakPtr<AudioReceiver> { |
| 49 public: | 49 public: |
| 50 AudioReceiver(scoped_refptr<CastEnvironment> cast_environment, | 50 AudioReceiver(scoped_refptr<CastEnvironment> cast_environment, |
| 51 const AudioReceiverConfig& audio_config, | 51 const AudioReceiverConfig& audio_config, |
| 52 PacedPacketSender* const packet_sender); | 52 transport::PacedPacketSender* const packet_sender); |
| 53 | 53 |
| 54 virtual ~AudioReceiver(); | 54 virtual ~AudioReceiver(); |
| 55 | 55 |
| 56 // Extract a raw audio frame from the cast receiver. | 56 // Extract a raw audio frame from the cast receiver. |
| 57 // Actual decoding will be preformed on a designated audio_decoder thread. | 57 // Actual decoding will be preformed on a designated audio_decoder thread. |
| 58 void GetRawAudioFrame(int number_of_10ms_blocks, | 58 void GetRawAudioFrame(int number_of_10ms_blocks, |
| 59 int desired_frequency, | 59 int desired_frequency, |
| 60 const AudioFrameDecodedCallback& callback); | 60 const AudioFrameDecodedCallback& callback); |
| 61 | 61 |
| 62 // Extract an encoded audio frame from the cast receiver. | 62 // Extract an encoded audio frame from the cast receiver. |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 std::string iv_mask_; | 134 std::string iv_mask_; |
| 135 | 135 |
| 136 std::list<AudioFrameEncodedCallback> queued_encoded_callbacks_; | 136 std::list<AudioFrameEncodedCallback> queued_encoded_callbacks_; |
| 137 std::list<DecodedAudioCallbackData> queued_decoded_callbacks_; | 137 std::list<DecodedAudioCallbackData> queued_decoded_callbacks_; |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 } // namespace cast | 140 } // namespace cast |
| 141 } // namespace media | 141 } // namespace media |
| 142 | 142 |
| 143 #endif // MEDIA_CAST_AUDIO_RECEIVER_AUDIO_RECEIVER_H_ | 143 #endif // MEDIA_CAST_AUDIO_RECEIVER_AUDIO_RECEIVER_H_ |
| OLD | NEW |