#ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_EVENT_HANDLER_H_
#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_EVENT_HANDLER_H_
#include "base/memory/shared_memory.h"
#include "base/time/time.h"
#include "content/common/content_export.h"
namespace gpu {
struct MailboxHolder;
}
namespace media {
class VideoCaptureFormat;
}
namespace content {
struct CONTENT_EXPORT VideoCaptureControllerID {
explicit VideoCaptureControllerID(int device_id);
bool operator<(const VideoCaptureControllerID& vc) const;
bool operator==(const VideoCaptureControllerID& vc) const;
int device_id;
};
class CONTENT_EXPORT VideoCaptureControllerEventHandler {
public:
virtual void OnError(const VideoCaptureControllerID& id) = 0;
virtual void OnBufferCreated(const VideoCaptureControllerID& id,
base::SharedMemoryHandle handle,
int length,
int buffer_id) = 0;
virtual void OnBufferDestroyed(const VideoCaptureControllerID& id,
int buffer_id) = 0;
virtual void OnBufferReady(const VideoCaptureControllerID& id,
int buffer_id,
const media::VideoCaptureFormat& format,
base::TimeTicks timestamp) = 0;
virtual void OnMailboxBufferReady(const VideoCaptureControllerID& id,
int buffer_id,
const gpu::MailboxHolder& mailbox_holder,
const media::VideoCaptureFormat& format,
base::TimeTicks timestamp) = 0;
virtual void OnEnded(const VideoCaptureControllerID& id) = 0;
protected:
virtual ~VideoCaptureControllerEventHandler() {}
};
}
#endif