#ifndef MEDIA_CAST_TRANSPORT_RTP_SENDER_RTP_SENDER_H_
#define MEDIA_CAST_TRANSPORT_RTP_SENDER_RTP_SENDER_H_
#include <map>
#include <set>
#include "base/memory/scoped_ptr.h"
#include "base/time/tick_clock.h"
#include "base/time/time.h"
#include "base/memory/weak_ptr.h"
#include "media/cast/cast_config.h"
#include "media/cast/cast_environment.h"
#include "media/cast/transport/cast_transport_defines.h"
#include "media/cast/transport/cast_transport_sender.h"
#include "media/cast/transport/pacing/paced_sender.h"
#include "media/cast/transport/rtp_sender/packet_storage/packet_storage.h"
#include "media/cast/transport/rtp_sender/rtp_packetizer/rtp_packetizer.h"
namespace media {
namespace cast {
class LoggingImpl;
namespace transport {
class RtpSender {
public:
RtpSender(
base::TickClock* clock,
LoggingImpl* logging,
const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner,
PacedSender* const transport);
~RtpSender();
void InitializeAudio(const CastTransportAudioConfig& config);
void InitializeVideo(const CastTransportVideoConfig& config);
void IncomingEncodedVideoFrame(const EncodedVideoFrame* video_frame,
const base::TimeTicks& capture_time);
void IncomingEncodedAudioFrame(const EncodedAudioFrame* audio_frame,
const base::TimeTicks& recorded_time);
void ResendPackets(const MissingFramesAndPacketsMap& missing_packets);
void SubscribeRtpStatsCallback(const CastTransportRtpStatistics& callback);
private:
void ScheduleNextStatsReport();
void RtpStatistics();
void UpdateSequenceNumber(Packet* packet);
base::TickClock* clock_;
LoggingImpl* logging_;
RtpPacketizerConfig config_;
scoped_ptr<RtpPacketizer> packetizer_;
scoped_ptr<PacketStorage> storage_;
PacedSender* const transport_;
CastTransportRtpStatistics stats_callback_;
scoped_refptr<base::SingleThreadTaskRunner> transport_task_runner_;
base::WeakPtrFactory<RtpSender> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(RtpSender);
};
}
}
}
#endif