#ifndef CHROME_BROWSER_MEDIA_CAST_TRANSPORT_HOST_FILTER_H_
#define CHROME_BROWSER_MEDIA_CAST_TRANSPORT_HOST_FILTER_H_
#include "base/id_map.h"
#include "base/time/default_tick_clock.h"
#include "chrome/common/cast_messages.h"
#include "content/public/browser/browser_message_filter.h"
#include "media/cast/cast_sender.h"
#include "media/cast/logging/logging_defines.h"
#include "media/cast/transport/cast_transport_sender.h"
namespace cast {
class CastTransportHostFilter : public content::BrowserMessageFilter {
public:
CastTransportHostFilter();
private:
virtual ~CastTransportHostFilter();
void NotifyStatusChange(
int32 channel_id,
media::cast::transport::CastTransportStatus result);
void ReceivedPacket(
int32 channel_id,
scoped_ptr<media::cast::transport::Packet> result);
void ReceivedRtpStatistics(
int32 channel_id,
bool audio,
const media::cast::transport::RtcpSenderInfo& sender_info,
base::TimeTicks time_sent,
uint32 rtp_timestamp);
void RawEvents(int32 channel_id,
const std::vector<media::cast::PacketEvent>& packet_events);
virtual bool OnMessageReceived(const IPC::Message& message,
bool* message_was_ok) OVERRIDE;
void OnInitializeAudio(
int32 channel_id,
const media::cast::transport::CastTransportAudioConfig& config);
void OnInitializeVideo(
int32 channel_id,
const media::cast::transport::CastTransportVideoConfig& config);
void OnInsertCodedAudioFrame(
int32 channel_id,
const media::cast::transport::EncodedAudioFrame& audio_frame,
base::TimeTicks recorded_time);
void OnInsertCodedVideoFrame(
int32 channel_id,
const media::cast::transport::EncodedVideoFrame& video_frame,
base::TimeTicks capture_time);
void OnSendRtcpFromRtpSender(
int32 channel_id,
const media::cast::transport::SendRtcpFromRtpSenderData& data,
const media::cast::transport::RtcpSenderInfo& sender_info,
const media::cast::transport::RtcpDlrrReportBlock& dlrr,
const media::cast::transport::RtcpSenderLogMessage& sender_log);
void OnResendPackets(
int32 channel_id,
bool is_audio,
const media::cast::MissingFramesAndPacketsMap& missing_packets);
void OnNew(
int32 channel_id,
const net::IPEndPoint& remote_end_point);
void OnDelete(int32 channel_id);
IDMap<media::cast::transport::CastTransportSender, IDMapOwnPointer> id_map_;
base::DefaultTickClock clock_;
DISALLOW_COPY_AND_ASSIGN(CastTransportHostFilter);
};
}
#endif