#ifndef MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_
#define MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/non_thread_safe.h"
#include "base/time/tick_clock.h"
#include "media/cast/logging/logging_defines.h"
#include "media/cast/transport/cast_transport_config.h"
#include "media/cast/transport/cast_transport_defines.h"
namespace net {
class NetLog;
}
namespace media {
namespace cast {
namespace transport {
typedef base::Callback<void(CastTransportStatus status)>
CastTransportStatusCallback;
typedef base::Callback<void(const RtcpSenderInfo& sender_info,
base::TimeTicks time_sent,
uint32 rtp_timestamp)> CastTransportRtpStatistics;
typedef base::Callback<void(const std::vector<PacketEvent>&)>
BulkRawEventsCallback;
class CastTransportSender : public base::NonThreadSafe {
public:
static scoped_ptr<CastTransportSender> Create(
net::NetLog* net_log,
base::TickClock* clock,
const net::IPEndPoint& remote_end_point,
const CastTransportStatusCallback& status_callback,
const BulkRawEventsCallback& raw_events_callback,
base::TimeDelta raw_events_callback_interval,
const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner);
virtual ~CastTransportSender() {}
virtual void InitializeAudio(const CastTransportAudioConfig& config) = 0;
virtual void InitializeVideo(const CastTransportVideoConfig& config) = 0;
virtual void SetPacketReceiver(
const PacketReceiverCallback& packet_receiver) = 0;
virtual void InsertCodedAudioFrame(const EncodedAudioFrame* audio_frame,
const base::TimeTicks& recorded_time) = 0;
virtual void InsertCodedVideoFrame(const EncodedVideoFrame* video_frame,
const base::TimeTicks& capture_time) = 0;
virtual void SendRtcpFromRtpSender(uint32 packet_type_flags,
const RtcpSenderInfo& sender_info,
const RtcpDlrrReportBlock& dlrr,
const RtcpSenderLogMessage& sender_log,
uint32 sending_ssrc,
const std::string& c_name) = 0;
virtual void ResendPackets(
bool is_audio,
const MissingFramesAndPacketsMap& missing_packets) = 0;
virtual void SubscribeAudioRtpStatsCallback(
const CastTransportRtpStatistics& callback) = 0;
virtual void SubscribeVideoRtpStatsCallback(
const CastTransportRtpStatistics& callback) = 0;
};
}
}
}
#endif