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

Side by Side Diff: media/video/capture/video_capture_device.h

Issue 10391065: handle the case when device is closed before media pipeline is fully initialized. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: code review Created 8 years, 6 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 | « content/renderer/media/capture_video_decoder.cc ('k') | no next file » | 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 // VideoCaptureDevice is the abstract base class for realizing video capture 5 // VideoCaptureDevice is the abstract base class for realizing video capture
6 // device support in Chromium. It provides the interface for OS dependent 6 // device support in Chromium. It provides the interface for OS dependent
7 // implementations. 7 // implementations.
8 // The class is created and functions are invoked on a thread owned by 8 // The class is created and functions are invoked on a thread owned by
9 // VideoCaptureManager. Capturing is done on other threads depended on the OS 9 // VideoCaptureManager. Capturing is done on other threads depended on the OS
10 // specific implementation. 10 // specific implementation.
(...skipping 16 matching lines...) Expand all
27 struct Name { 27 struct Name {
28 // Friendly name of a device 28 // Friendly name of a device
29 std::string device_name; 29 std::string device_name;
30 30
31 // Unique name of a device. Even if there are multiple devices with the same 31 // Unique name of a device. Even if there are multiple devices with the same
32 // friendly name connected to the computer this will be unique. 32 // friendly name connected to the computer this will be unique.
33 std::string unique_id; 33 std::string unique_id;
34 }; 34 };
35 typedef std::list<Name> Names; 35 typedef std::list<Name> Names;
36 36
37 class EventHandler { 37 class MEDIA_EXPORT EventHandler {
38 public: 38 public:
39 // Captured a new video frame. 39 // Captured a new video frame.
40 virtual void OnIncomingCapturedFrame(const uint8* data, 40 virtual void OnIncomingCapturedFrame(const uint8* data,
41 int length, 41 int length,
42 base::Time timestamp) = 0; 42 base::Time timestamp) = 0;
43 // An error has occurred that can not be handled 43 // An error has occurred that can not be handled
44 // and VideoCaptureDevice must be DeAllocated. 44 // and VideoCaptureDevice must be DeAllocated.
45 virtual void OnError() = 0; 45 virtual void OnError() = 0;
46 // Called when VideoCaptureDevice::Allocate has been called 46 // Called when VideoCaptureDevice::Allocate has been called
47 // to inform of the resulting frame size and color format. 47 // to inform of the resulting frame size and color format.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // state it was when created. 79 // state it was when created.
80 virtual void DeAllocate() = 0; 80 virtual void DeAllocate() = 0;
81 81
82 // Get the name of the capture device. 82 // Get the name of the capture device.
83 virtual const Name& device_name() = 0; 83 virtual const Name& device_name() = 0;
84 }; 84 };
85 85
86 } // namespace media 86 } // namespace media
87 87
88 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ 88 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_
OLDNEW
« no previous file with comments | « content/renderer/media/capture_video_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698