X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fmedia%2Fcast%2Faudio_receiver%2Faudio_receiver.h;h=23c318f825424879e4b68743f38140d137841cde;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=43f53914abd77fda21c0da3434459fa7f2b2bead;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/media/cast/audio_receiver/audio_receiver.h b/src/media/cast/audio_receiver/audio_receiver.h index 43f5391..23c318f 100644 --- a/src/media/cast/audio_receiver/audio_receiver.h +++ b/src/media/cast/audio_receiver/audio_receiver.h @@ -7,6 +7,7 @@ #include "base/basictypes.h" #include "base/callback.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" @@ -16,13 +17,10 @@ #include "media/cast/cast_config.h" #include "media/cast/cast_environment.h" #include "media/cast/cast_receiver.h" -#include "media/cast/rtcp/rtcp.h" // RtcpCastMessage +#include "media/cast/rtcp/receiver_rtcp_event_subscriber.h" +#include "media/cast/rtcp/rtcp.h" // RtcpCastMessage #include "media/cast/rtp_receiver/rtp_receiver_defines.h" // RtpCastHeader - -namespace crypto { -class Encryptor; -class SymmetricKey; -} +#include "media/cast/transport/utility/transport_encryption_handler.h" namespace media { namespace cast { @@ -55,21 +53,19 @@ class AudioReceiver : public base::NonThreadSafe, // Extract a raw audio frame from the cast receiver. // Actual decoding will be preformed on a designated audio_decoder thread. - void GetRawAudioFrame(int number_of_10ms_blocks, - int desired_frequency, + void GetRawAudioFrame(int number_of_10ms_blocks, int desired_frequency, const AudioFrameDecodedCallback& callback); // Extract an encoded audio frame from the cast receiver. void GetEncodedAudioFrame(const AudioFrameEncodedCallback& callback); // Should only be called from the main cast thread. - void IncomingPacket(const uint8* packet, size_t length, - const base::Closure callback); + void IncomingPacket(scoped_ptr packet); protected: - void IncomingParsedRtpPacket(const uint8* payload_data, - size_t payload_size, + void IncomingParsedRtpPacket(const uint8* payload_data, size_t payload_size, const RtpCastHeader& rtp_header); + private: friend class LocalRtpAudioData; friend class LocalRtpAudioFeedback; @@ -81,14 +77,12 @@ class AudioReceiver : public base::NonThreadSafe, bool PostEncodedAudioFrame( const AudioFrameEncodedCallback& callback, - uint32 rtp_timestamp, bool next_frame, scoped_ptr* encoded_frame); // Actual decoding implementation - should be called under the audio decoder // thread. - void DecodeAudioFrameThread(int number_of_10ms_blocks, - int desired_frequency, + void DecodeAudioFrameThread(int number_of_10ms_blocks, int desired_frequency, const AudioFrameDecodedCallback callback); void ReturnDecodedFrameWithPlayoutDelay( scoped_ptr audio_frame, uint32 rtp_timestamp, @@ -116,6 +110,11 @@ class AudioReceiver : public base::NonThreadSafe, void SendNextCastMessage(); scoped_refptr cast_environment_; + + // Subscribes to raw events. + // Processes raw audio events to be sent over to the cast sender via RTCP. + ReceiverRtcpEventSubscriber event_subscriber_; + base::WeakPtrFactory weak_factory_; const transport::AudioCodec codec_; @@ -131,13 +130,13 @@ class AudioReceiver : public base::NonThreadSafe, base::TimeDelta time_offset_; base::TimeTicks time_first_incoming_packet_; uint32 first_incoming_rtp_timestamp_; - scoped_ptr decryptor_; - scoped_ptr decryption_key_; - std::string iv_mask_; + transport::TransportEncryptionHandler decryptor_; base::TimeTicks last_playout_time_; std::list queued_encoded_callbacks_; std::list queued_decoded_callbacks_; + + DISALLOW_COPY_AND_ASSIGN(AudioReceiver); }; } // namespace cast