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

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

Issue 12090109: Tab Capture: Backing store readbacks to YV12 VideoFrames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes suggested by wjia Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // VideoCaptureController is the glue between VideoCaptureHost, 5 // VideoCaptureController is the glue between VideoCaptureHost,
6 // VideoCaptureManager and VideoCaptureDevice. 6 // VideoCaptureManager and VideoCaptureDevice.
7 // It provides functions for VideoCaptureHost to start a VideoCaptureDevice and 7 // It provides functions for VideoCaptureHost to start a VideoCaptureDevice and
8 // is responsible for keeping track of shared DIBs and filling them with I420 8 // is responsible for keeping track of shared DIBs and filling them with I420
9 // video frames for IPC communication between VideoCaptureHost and 9 // video frames for IPC communication between VideoCaptureHost and
10 // VideoCaptureMessageFilter. 10 // VideoCaptureMessageFilter.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // prematurely closed. 58 // prematurely closed.
59 void StopSession(int session_id); 59 void StopSession(int session_id);
60 60
61 // Return a buffer previously given in 61 // Return a buffer previously given in
62 // VideoCaptureControllerEventHandler::OnBufferReady. 62 // VideoCaptureControllerEventHandler::OnBufferReady.
63 void ReturnBuffer(const VideoCaptureControllerID& id, 63 void ReturnBuffer(const VideoCaptureControllerID& id,
64 VideoCaptureControllerEventHandler* event_handler, 64 VideoCaptureControllerEventHandler* event_handler,
65 int buffer_id); 65 int buffer_id);
66 66
67 // Implement media::VideoCaptureDevice::EventHandler. 67 // Implement media::VideoCaptureDevice::EventHandler.
68 virtual void OnIncomingCapturedFrame(const uint8* data, 68 virtual void OnIncomingCapturedFrame(const uint8* data, int length,
69 int length,
70 base::Time timestamp) OVERRIDE; 69 base::Time timestamp) OVERRIDE;
wjia(left Chromium) 2013/02/10 06:55:06 nit: For function declarations and definitions, pu
ncarter (slow) 2013/02/11 02:12:42 Done.
70 virtual void OnIncomingCapturedVideoFrame(media::VideoFrame* frame,
71 base::Time timestamp) OVERRIDE;
71 virtual void OnError() OVERRIDE; 72 virtual void OnError() OVERRIDE;
72 virtual void OnFrameInfo( 73 virtual void OnFrameInfo(
73 const media::VideoCaptureCapability& info) OVERRIDE; 74 const media::VideoCaptureCapability& info) OVERRIDE;
74 75
75 protected: 76 protected:
76 virtual ~VideoCaptureController(); 77 virtual ~VideoCaptureController();
77 78
78 private: 79 private:
79 friend class base::RefCountedThreadSafe<VideoCaptureController>; 80 friend class base::RefCountedThreadSafe<VideoCaptureController>;
80 81
(...skipping 20 matching lines...) Expand all
101 const ControllerClients& clients); 102 const ControllerClients& clients);
102 // Find a client of |session_id| in |clients|. 103 // Find a client of |session_id| in |clients|.
103 ControllerClient* FindClient( 104 ControllerClient* FindClient(
104 int session_id, 105 int session_id,
105 const ControllerClients& clients); 106 const ControllerClients& clients);
106 // Decide what to do after kStopping state. Dependent on events, controller 107 // Decide what to do after kStopping state. Dependent on events, controller
107 // can stay in kStopping state, or go to kStopped, or restart capture. 108 // can stay in kStopping state, or go to kStopped, or restart capture.
108 void PostStopping(); 109 void PostStopping();
109 // Check if any DIB is used by client. 110 // Check if any DIB is used by client.
110 bool ClientHasDIB(); 111 bool ClientHasDIB();
112 // DIB allocator. Locate a free DIB object, reserve it, and return its id
113 // as well as pointers to its color planes. Returns true if successful.
114 bool ReserveSharedMemory(int* buffer_id_out,
115 uint8** yplane,
116 uint8** uplane,
117 uint8** vplane);
111 118
112 // Lock to protect free_dibs_ and owned_dibs_. 119 // Lock to protect free_dibs_ and owned_dibs_.
113 base::Lock lock_; 120 base::Lock lock_;
114 121
115 struct SharedDIB; 122 struct SharedDIB;
116 typedef std::map<int /*buffer_id*/, SharedDIB*> DIBMap; 123 typedef std::map<int /*buffer_id*/, SharedDIB*> DIBMap;
117 // All DIBs created by this object. 124 // All DIBs created by this object.
118 // It's modified only on IO thread. 125 // It's modified only on IO thread.
119 DIBMap owned_dibs_; 126 DIBMap owned_dibs_;
120 127
(...skipping 21 matching lines...) Expand all
142 149
143 bool device_in_use_; 150 bool device_in_use_;
144 VideoCaptureState state_; 151 VideoCaptureState state_;
145 152
146 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureController); 153 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureController);
147 }; 154 };
148 155
149 } // namespace content 156 } // namespace content
150 157
151 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_ 158 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698