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

Side by Side Diff: public/platform/WebMediaStream.h

Issue 16753003: Revert "Remove MediaStreamDescriptor and call/use WebMediaStream directly" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 10 matching lines...) Expand all
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */ 23 */
24 24
25 #ifndef WebMediaStream_h 25 #ifndef WebMediaStream_h
26 #define WebMediaStream_h 26 #define WebMediaStream_h
27 27
28 #include "WebCommon.h" 28 #include "WebCommon.h"
29 #include "WebNonCopyable.h" 29 #include "WebNonCopyable.h"
30 #include "WebPrivatePtr.h" 30 #include "WebPrivatePtr.h"
31 #include "WebString.h"
32 #include "WebVector.h" 31 #include "WebVector.h"
33 32
34 namespace WebCore { 33 namespace WebCore {
35 class MediaStreamComponent; 34 class MediaStreamDescriptor;
36 } 35 }
37 36
38 namespace WebKit { 37 namespace WebKit {
39 38
40 class WebMediaStreamClient;
41 class WebMediaStreamPrivate;
42 class WebMediaStreamSource; 39 class WebMediaStreamSource;
43 class WebMediaStreamTrack; 40 class WebMediaStreamTrack;
41 class WebString;
44 42
45 class WebMediaStream { 43 class WebMediaStream {
46 public: 44 public:
47 class ExtraData { 45 class ExtraData {
48 public: 46 public:
49 virtual ~ExtraData() { } 47 virtual ~ExtraData() { }
50 }; 48 };
51 49
52 WebMediaStream() { } 50 WebMediaStream() { }
53 WebMediaStream(const WebMediaStream& other) { assign(other); } 51 WebMediaStream(const WebMediaStream& other) { assign(other); }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 void videoSources(WebVector<WebMediaStreamTrack>& tracks) const { videoTrack s(tracks); } 84 void videoSources(WebVector<WebMediaStreamTrack>& tracks) const { videoTrack s(tracks); }
87 85
88 // Extra data associated with this WebMediaStream. 86 // Extra data associated with this WebMediaStream.
89 // If non-null, the extra data pointer will be deleted when the object is de stroyed. 87 // If non-null, the extra data pointer will be deleted when the object is de stroyed.
90 // Setting the extra data pointer will cause any existing non-null 88 // Setting the extra data pointer will cause any existing non-null
91 // extra data pointer to be deleted. 89 // extra data pointer to be deleted.
92 WEBKIT_EXPORT ExtraData* extraData() const; 90 WEBKIT_EXPORT ExtraData* extraData() const;
93 WEBKIT_EXPORT void setExtraData(ExtraData*); 91 WEBKIT_EXPORT void setExtraData(ExtraData*);
94 92
95 #if WEBKIT_IMPLEMENTATION 93 #if WEBKIT_IMPLEMENTATION
96 WebMediaStream(WebMediaStreamPrivate*); 94 WebMediaStream(WebCore::MediaStreamDescriptor*);
97 WebMediaStream(const WebString& label, const WebVector<WebMediaStreamSource> & audioSources, const WebVector<WebMediaStreamSource>& videoSources) 95 WebMediaStream(const WTF::PassRefPtr<WebCore::MediaStreamDescriptor>&);
98 { 96 operator WTF::PassRefPtr<WebCore::MediaStreamDescriptor>() const;
99 this->initialize(label, audioSources, videoSources); 97 operator WebCore::MediaStreamDescriptor*() const;
100 } 98 WebMediaStream& operator=(const WTF::PassRefPtr<WebCore::MediaStreamDescript or>&);
101 WebMediaStream(const WebVector<WebMediaStreamTrack>& audioTracks, const WebV ector<WebMediaStreamTrack>& videoTracks)
102 {
103 this->initialize(audioTracks, videoTracks);
104 }
105
106 unsigned numberOfAudioComponents() const;
107 WebCore::MediaStreamComponent* audioComponent(unsigned index) const;
108
109 unsigned numberOfVideoComponents() const;
110 WebCore::MediaStreamComponent* videoComponent(unsigned index) const;
111
112 void addComponent(WebCore::MediaStreamComponent*);
113 void removeComponent(WebCore::MediaStreamComponent*);
114
115 void trackEnded();
116 void streamEnded();
117
118 bool ended() const;
119 void setEnded();
120
121 WebKit::WebMediaStreamClient* client();
122 void setClient(WebKit::WebMediaStreamClient*);
123 #endif 99 #endif
124 100
125 private: 101 private:
126 WebPrivatePtr<WebMediaStreamPrivate> m_private; 102 WebPrivatePtr<WebCore::MediaStreamDescriptor> m_private;
127 }; 103 };
128 104
129 } // namespace WebKit 105 } // namespace WebKit
130 106
131 #endif // WebMediaStream_h 107 #endif // WebMediaStream_h
OLDNEW
« no previous file with comments | « Source/modules/webaudio/MediaStreamAudioDestinationNode.cpp ('k') | public/platform/WebMediaStreamCenterClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698