[Session restore] Rename group name Enabled to Restore.
[chromium-blink-merge.git] / content / browser / renderer_host / media / video_capture_controller_event_handler.h
blob283def2f6d9bc6264ec9452cf6b37f443f3f2145
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"
12 namespace base {
13 class DictionaryValue;
14 class TimeTicks;
15 } // namespace base
17 namespace gfx {
18 class Rect;
19 class Size;
20 } // namespace gfx
22 namespace gpu {
23 struct MailboxHolder;
24 } // namespace gpu
26 namespace content {
28 typedef int VideoCaptureControllerID;
30 // VideoCaptureControllerEventHandler is the interface for
31 // VideoCaptureController to notify clients about the events such as
32 // BufferReady, FrameInfo, Error, etc.
33 class CONTENT_EXPORT VideoCaptureControllerEventHandler {
34 public:
35 // An Error has occurred in the VideoCaptureDevice.
36 virtual void OnError(VideoCaptureControllerID id) = 0;
38 // A buffer has been newly created.
39 virtual void OnBufferCreated(VideoCaptureControllerID id,
40 base::SharedMemoryHandle handle,
41 int length,
42 int buffer_id) = 0;
44 // A previously created buffer has been freed and will no longer be used.
45 virtual void OnBufferDestroyed(VideoCaptureControllerID id,
46 int buffer_id) = 0;
48 // A buffer has been filled with I420 video.
49 virtual void OnBufferReady(VideoCaptureControllerID id,
50 int buffer_id,
51 const gfx::Size& coded_size,
52 const gfx::Rect& visible_rect,
53 const base::TimeTicks& timestamp,
54 scoped_ptr<base::DictionaryValue> metadata) = 0;
56 // A texture mailbox buffer has been filled with data.
57 virtual void OnMailboxBufferReady(
58 VideoCaptureControllerID id,
59 int buffer_id,
60 const gpu::MailboxHolder& mailbox_holder,
61 const gfx::Size& packed_frame_size,
62 const base::TimeTicks& timestamp,
63 scoped_ptr<base::DictionaryValue> metadata) = 0;
65 // The capture session has ended and no more frames will be sent.
66 virtual void OnEnded(VideoCaptureControllerID id) = 0;
68 protected:
69 virtual ~VideoCaptureControllerEventHandler() {}
72 } // namespace content
74 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_EVENT_HANDLER_H_