#ifndef CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_VIDEO_TRACK_HOST_H_
#define CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_VIDEO_TRACK_HOST_H_
#include "base/compiler_specific.h"
#include "content/public/renderer/media_stream_video_sink.h"
#include "content/renderer/pepper/pepper_media_stream_track_host_base.h"
#include "media/base/video_frame.h"
#include "ppapi/c/ppb_video_frame.h"
#include "ppapi/shared_impl/media_stream_video_track_shared.h"
#include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
#include "ui/gfx/size.h"
namespace content {
class PepperMediaStreamVideoTrackHost : public PepperMediaStreamTrackHostBase,
public MediaStreamVideoSink {
public:
PepperMediaStreamVideoTrackHost(RendererPpapiHost* host,
PP_Instance instance,
PP_Resource resource,
const blink::WebMediaStreamTrack& track);
private:
virtual ~PepperMediaStreamVideoTrackHost();
void InitBuffers();
virtual void OnClose() OVERRIDE;
virtual void OnVideoFrame(
const scoped_refptr<media::VideoFrame>& frame) OVERRIDE;
virtual void DidConnectPendingHostToResource() OVERRIDE;
virtual int32_t OnResourceMessageReceived(
const IPC::Message& msg,
ppapi::host::HostMessageContext* context) OVERRIDE;
int32_t OnHostMsgConfigure(
ppapi::host::HostMessageContext* context,
const ppapi::MediaStreamVideoTrackShared::Attributes& attributes);
blink::WebMediaStreamTrack track_;
bool connected_;
int32_t number_of_buffers_;
gfx::Size source_frame_size_;
gfx::Size plugin_frame_size_;
PP_VideoFrame_Format source_frame_format_;
PP_VideoFrame_Format plugin_frame_format_;
uint32_t frame_data_size_;
DISALLOW_COPY_AND_ASSIGN(PepperMediaStreamVideoTrackHost);
};
}
#endif