#ifndef CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_VIDEO_SOURCE_H_
#define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_VIDEO_SOURCE_H_
#include "content/renderer/media/media_stream_video_source.h"
namespace content {
class MockMediaStreamVideoSource
: public MediaStreamVideoSource {
public:
MockMediaStreamVideoSource(MediaStreamDependencyFactory* factory,
bool manual_get_supported_formats);
virtual ~MockMediaStreamVideoSource();
void StartMockedSource();
void FailToStartMockedSource();
bool SourceHasAttemptedToStart() { return attempted_to_start_; }
void SetSupportedFormats(const media::VideoCaptureFormats& formats) {
supported_formats_ = formats;
}
void CompleteGetSupportedFormats();
const media::VideoCaptureParams& start_params() const { return params_; }
int max_requested_height() const { return max_requested_height_; }
int max_requested_width() const { return max_requested_width_; }
using MediaStreamVideoSource::DeliverVideoFrame;
protected:
virtual void GetCurrentSupportedFormats(
int max_requested_height,
int max_requested_width) OVERRIDE;
virtual void StartSourceImpl(
const media::VideoCaptureParams& params) OVERRIDE;
virtual void StopSourceImpl() OVERRIDE;
private:
media::VideoCaptureParams params_;
media::VideoCaptureFormats supported_formats_;
bool manual_get_supported_formats_;
int max_requested_height_;
int max_requested_width_;
bool attempted_to_start_;
};
}
#endif