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

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

Issue 13616004: Switch event type when a capture device has been stopped from the render process. This make sure th… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed code review comments. Created 7 years, 8 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
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 // VideoCaptureHost serves video capture related messages from 5 // VideoCaptureHost serves video capture related messages from
6 // VideoCaptureMessageFilter which lives inside the render process. 6 // VideoCaptureMessageFilter which lives inside the render process.
7 // 7 //
8 // This class is owned by BrowserRenderProcessHost, and instantiated on UI 8 // This class is owned by BrowserRenderProcessHost, and instantiated on UI
9 // thread, but all other operations and method calls happen on IO thread. 9 // thread, but all other operations and method calls happen on IO thread.
10 // 10 //
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 virtual void OnBufferCreated(const VideoCaptureControllerID& id, 64 virtual void OnBufferCreated(const VideoCaptureControllerID& id,
65 base::SharedMemoryHandle handle, 65 base::SharedMemoryHandle handle,
66 int length, int buffer_id) OVERRIDE; 66 int length, int buffer_id) OVERRIDE;
67 virtual void OnBufferReady(const VideoCaptureControllerID& id, 67 virtual void OnBufferReady(const VideoCaptureControllerID& id,
68 int buffer_id, 68 int buffer_id,
69 base::Time timestamp) OVERRIDE; 69 base::Time timestamp) OVERRIDE;
70 virtual void OnFrameInfo(const VideoCaptureControllerID& id, 70 virtual void OnFrameInfo(const VideoCaptureControllerID& id,
71 int width, 71 int width,
72 int height, 72 int height,
73 int frame_per_second) OVERRIDE; 73 int frame_per_second) OVERRIDE;
74 virtual void OnPaused(const VideoCaptureControllerID& id) OVERRIDE; 74 virtual void OnEnded(const VideoCaptureControllerID& id) OVERRIDE;
75 75
76 private: 76 private:
77 friend class BrowserThread; 77 friend class BrowserThread;
78 friend class base::DeleteHelper<VideoCaptureHost>; 78 friend class base::DeleteHelper<VideoCaptureHost>;
79 friend class MockVideoCaptureHost; 79 friend class MockVideoCaptureHost;
80 friend class VideoCaptureHostTest; 80 friend class VideoCaptureHostTest;
81 81
82 virtual ~VideoCaptureHost(); 82 virtual ~VideoCaptureHost();
83 83
84 // IPC message: Start capture on the VideoCaptureDevice referenced by 84 // IPC message: Start capture on the VideoCaptureDevice referenced by
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // to the VideoCaptureMessageFilter. 121 // to the VideoCaptureMessageFilter.
122 void DoSendFrameInfoOnIOThread( 122 void DoSendFrameInfoOnIOThread(
123 const VideoCaptureControllerID& controller_id, 123 const VideoCaptureControllerID& controller_id,
124 int width, 124 int width,
125 int height, 125 int height,
126 int frame_per_second); 126 int frame_per_second);
127 127
128 // Handle error coming from VideoCaptureDevice. 128 // Handle error coming from VideoCaptureDevice.
129 void DoHandleErrorOnIOThread(const VideoCaptureControllerID& controller_id); 129 void DoHandleErrorOnIOThread(const VideoCaptureControllerID& controller_id);
130 130
131 void DoPausedOnIOThread(const VideoCaptureControllerID& controller_id); 131 void DoEndedOnIOThread(const VideoCaptureControllerID& controller_id);
132 132
133 void DeleteVideoCaptureControllerOnIOThread( 133 void DeleteVideoCaptureControllerOnIOThread(
134 const VideoCaptureControllerID& controller_id); 134 const VideoCaptureControllerID& controller_id);
135 135
136 // Returns the video capture manager. This is a virtual function so that 136 // Returns the video capture manager. This is a virtual function so that
137 // the unit tests can inject their own MediaStreamManager. 137 // the unit tests can inject their own MediaStreamManager.
138 virtual VideoCaptureManager* GetVideoCaptureManager(); 138 virtual VideoCaptureManager* GetVideoCaptureManager();
139 139
140 struct Entry; 140 struct Entry;
141 typedef std::map<VideoCaptureControllerID, Entry*> EntryMap; 141 typedef std::map<VideoCaptureControllerID, Entry*> EntryMap;
142 // A map of VideoCaptureControllerID to its state and VideoCaptureController. 142 // A map of VideoCaptureControllerID to its state and VideoCaptureController.
143 EntryMap entries_; 143 EntryMap entries_;
144 144
145 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost); 145 DISALLOW_COPY_AND_ASSIGN(VideoCaptureHost);
146 }; 146 };
147 147
148 } // namespace content 148 } // namespace content
149 149
150 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_ 150 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698