#ifndef MEDIA_CAST_CAST_RECEIVER_IMPL_H_
#define MEDIA_CAST_CAST_RECEIVER_IMPL_H_
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "media/cast/audio_receiver/audio_receiver.h"
#include "media/cast/cast_config.h"
#include "media/cast/cast_environment.h"
#include "media/cast/cast_receiver.h"
#include "media/cast/transport/pacing/paced_sender.h"
#include "media/cast/video_receiver/video_receiver.h"
namespace media {
namespace cast {
class CastReceiverImpl : public CastReceiver {
public:
CastReceiverImpl(scoped_refptr<CastEnvironment> cast_environment,
const AudioReceiverConfig& audio_config,
const VideoReceiverConfig& video_config,
transport::PacketSender* const packet_sender);
virtual ~CastReceiverImpl();
virtual transport::PacketReceiverCallback packet_receiver() OVERRIDE;
virtual scoped_refptr<FrameReceiver> frame_receiver() OVERRIDE;
private:
void ReceivedPacket(scoped_ptr<Packet> packet);
void UpdateTargetDelay(base::TimeDelta target_delay_ms);
transport::PacedSender pacer_;
AudioReceiver audio_receiver_;
VideoReceiver video_receiver_;
scoped_refptr<FrameReceiver> frame_receiver_;
scoped_refptr<CastEnvironment> cast_environment_;
const uint32 ssrc_of_audio_sender_;
const uint32 ssrc_of_video_sender_;
DISALLOW_COPY_AND_ASSIGN(CastReceiverImpl);
};
}
}
#endif