1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_EVENT_HANDLER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_EVENT_HANDLER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/shared_memory.h"
10 #include "content/common/content_export.h"
18 typedef int VideoCaptureControllerID
;
20 // VideoCaptureControllerEventHandler is the interface for
21 // VideoCaptureController to notify clients about the events such as
22 // BufferReady, FrameInfo, Error, etc.
23 class CONTENT_EXPORT VideoCaptureControllerEventHandler
{
25 // An Error has occurred in the VideoCaptureDevice.
26 virtual void OnError(VideoCaptureControllerID id
) = 0;
28 // A buffer has been newly created.
29 virtual void OnBufferCreated(VideoCaptureControllerID id
,
30 base::SharedMemoryHandle handle
,
34 // A previously created buffer has been freed and will no longer be used.
35 virtual void OnBufferDestroyed(VideoCaptureControllerID id
,
38 // A buffer has been filled with a captured VideoFrame.
39 virtual void OnBufferReady(VideoCaptureControllerID id
,
41 const scoped_refptr
<media::VideoFrame
>& frame
,
42 const base::TimeTicks
& timestamp
) = 0;
44 // The capture session has ended and no more frames will be sent.
45 virtual void OnEnded(VideoCaptureControllerID id
) = 0;
48 virtual ~VideoCaptureControllerEventHandler() {}
51 } // namespace content
53 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_EVENT_HANDLER_H_