Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(405)

Side by Side Diff: content/browser/renderer_host/media/video_capture_controller_event_handler.h

Issue 1267883002: Pass GpuMemoryBuffer backed VideoFrame from browser to renderer processes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gmbtracker-multiple
Patch Set: Rebase Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_EVENT_HANDL ER_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_EVENT_HANDL ER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_EVENT_HANDL ER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_EVENT_HANDL ER_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 #include "ui/gfx/geometry/size.h"
12 #include "ui/gfx/gpu_memory_buffer.h"
11 13
12 namespace media { 14 namespace media {
13 class VideoFrame; 15 class VideoFrame;
14 } // namespace media 16 } // namespace media
15 17
16 namespace content { 18 namespace content {
17 19
18 typedef int VideoCaptureControllerID; 20 typedef int VideoCaptureControllerID;
19 21
20 // VideoCaptureControllerEventHandler is the interface for 22 // VideoCaptureControllerEventHandler is the interface for
21 // VideoCaptureController to notify clients about the events such as 23 // VideoCaptureController to notify clients about the events such as
22 // BufferReady, FrameInfo, Error, etc. 24 // BufferReady, FrameInfo, Error, etc.
23 class CONTENT_EXPORT VideoCaptureControllerEventHandler { 25 class CONTENT_EXPORT VideoCaptureControllerEventHandler {
24 public: 26 public:
25 // An Error has occurred in the VideoCaptureDevice. 27 // An Error has occurred in the VideoCaptureDevice.
26 virtual void OnError(VideoCaptureControllerID id) = 0; 28 virtual void OnError(VideoCaptureControllerID id) = 0;
27 29
28 // A buffer has been newly created. 30 // A buffer has been newly created.
29 virtual void OnBufferCreated(VideoCaptureControllerID id, 31 virtual void OnBufferCreated(VideoCaptureControllerID id,
30 base::SharedMemoryHandle handle, 32 base::SharedMemoryHandle handle,
31 int length, 33 int length,
32 int buffer_id) = 0; 34 int buffer_id) = 0;
33 35
36 // A GpuMemoryBuffer backed buffer has been newly created.
37 virtual void OnBufferCreated2(
38 VideoCaptureControllerID id,
39 const std::vector<gfx::GpuMemoryBufferHandle>& handles,
40 const gfx::Size& size,
41 int buffer_id) = 0;
42
34 // A previously created buffer has been freed and will no longer be used. 43 // A previously created buffer has been freed and will no longer be used.
35 virtual void OnBufferDestroyed(VideoCaptureControllerID id, 44 virtual void OnBufferDestroyed(VideoCaptureControllerID id,
36 int buffer_id) = 0; 45 int buffer_id) = 0;
37 46
38 // A buffer has been filled with a captured VideoFrame. 47 // A buffer has been filled with a captured VideoFrame.
39 virtual void OnBufferReady(VideoCaptureControllerID id, 48 virtual void OnBufferReady(VideoCaptureControllerID id,
40 int buffer_id, 49 int buffer_id,
41 const scoped_refptr<media::VideoFrame>& frame, 50 const scoped_refptr<media::VideoFrame>& frame,
42 const base::TimeTicks& timestamp) = 0; 51 const base::TimeTicks& timestamp) = 0;
43 52
44 // The capture session has ended and no more frames will be sent. 53 // The capture session has ended and no more frames will be sent.
45 virtual void OnEnded(VideoCaptureControllerID id) = 0; 54 virtual void OnEnded(VideoCaptureControllerID id) = 0;
46 55
47 protected: 56 protected:
48 virtual ~VideoCaptureControllerEventHandler() {} 57 virtual ~VideoCaptureControllerEventHandler() {}
49 }; 58 };
50 59
51 } // namespace content 60 } // namespace content
52 61
53 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_EVENT_HA NDLER_H_ 62 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_EVENT_HA NDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698