#ifndef MEDIA_CAST_TRANSPORT_TRANSPORT_AUDIO_SENDER_H_
#define MEDIA_CAST_TRANSPORT_TRANSPORT_AUDIO_SENDER_H_
#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/non_thread_safe.h"
#include "media/cast/transport/rtp_sender/rtp_sender.h"
#include "media/cast/transport/utility/transport_encryption_handler.h"
namespace media {
namespace cast {
class LoggingImpl;
namespace transport {
class PacedSender;
class TransportAudioSender : public base::NonThreadSafe {
public:
TransportAudioSender(
const CastTransportAudioConfig& config,
base::TickClock* clock,
LoggingImpl* logging,
const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner,
PacedSender* const paced_packet_sender);
virtual ~TransportAudioSender();
void InsertCodedAudioFrame(const EncodedAudioFrame* audio_frame,
const base::TimeTicks& recorded_time);
void ResendPackets(
const MissingFramesAndPacketsMap& missing_frames_and_packets);
bool initialized() const { return initialized_; }
void SubscribeAudioRtpStatsCallback(
const CastTransportRtpStatistics& callback);
private:
friend class LocalRtcpAudioSenderFeedback;
bool EncryptAudioFrame(const EncodedAudioFrame& audio_frame,
EncodedAudioFrame* encrypted_frame);
RtpSender rtp_sender_;
TransportEncryptionHandler encryptor_;
bool initialized_;
DISALLOW_IMPLICIT_CONSTRUCTORS(TransportAudioSender);
};
}
}
}
#endif