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

Side by Side Diff: third_party/WebKit/Source/modules/mediastream/MediaStreamTrack.h

Issue 1910463002: Implement MediaStreamTrack.getConstraints (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments on layout test Created 4 years, 7 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 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Ericsson AB. All rights reserved. 3 * Copyright (C) 2011 Ericsson AB. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 15 matching lines...) Expand all
26 #ifndef MediaStreamTrack_h 26 #ifndef MediaStreamTrack_h
27 #define MediaStreamTrack_h 27 #define MediaStreamTrack_h
28 28
29 #include "bindings/core/v8/ActiveScriptWrappable.h" 29 #include "bindings/core/v8/ActiveScriptWrappable.h"
30 #include "core/dom/ActiveDOMObject.h" 30 #include "core/dom/ActiveDOMObject.h"
31 #include "modules/EventTargetModules.h" 31 #include "modules/EventTargetModules.h"
32 #include "modules/ModulesExport.h" 32 #include "modules/ModulesExport.h"
33 #include "modules/mediastream/SourceInfo.h" 33 #include "modules/mediastream/SourceInfo.h"
34 #include "platform/mediastream/MediaStreamDescriptor.h" 34 #include "platform/mediastream/MediaStreamDescriptor.h"
35 #include "platform/mediastream/MediaStreamSource.h" 35 #include "platform/mediastream/MediaStreamSource.h"
36 #include "public/platform/WebMediaConstraints.h"
36 #include "wtf/Forward.h" 37 #include "wtf/Forward.h"
37 38
38 namespace blink { 39 namespace blink {
39 40
40 class AudioSourceProvider; 41 class AudioSourceProvider;
41 class ExceptionState; 42 class ExceptionState;
42 class MediaStreamComponent; 43 class MediaTrackConstraints;
43 class MediaStreamTrackSourcesCallback; 44 class MediaStreamTrackSourcesCallback;
44 45
45 class MODULES_EXPORT MediaStreamTrack 46 class MODULES_EXPORT MediaStreamTrack
46 : public EventTargetWithInlineData 47 : public EventTargetWithInlineData
47 , public ActiveScriptWrappable 48 , public ActiveScriptWrappable
48 , public ActiveDOMObject 49 , public ActiveDOMObject
49 , public MediaStreamSource::Observer { 50 , public MediaStreamSource::Observer {
50 USING_GARBAGE_COLLECTED_MIXIN(MediaStreamTrack); 51 USING_GARBAGE_COLLECTED_MIXIN(MediaStreamTrack);
51 DEFINE_WRAPPERTYPEINFO(); 52 DEFINE_WRAPPERTYPEINFO();
52 public: 53 public:
(...skipping 10 matching lines...) Expand all
63 void setEnabled(bool); 64 void setEnabled(bool);
64 65
65 bool muted() const; 66 bool muted() const;
66 67
67 String readyState() const; 68 String readyState() const;
68 69
69 static void getSources(ExecutionContext*, MediaStreamTrackSourcesCallback*, ExceptionState&); 70 static void getSources(ExecutionContext*, MediaStreamTrackSourcesCallback*, ExceptionState&);
70 void stopTrack(ExceptionState&); 71 void stopTrack(ExceptionState&);
71 virtual MediaStreamTrack* clone(ExecutionContext*); 72 virtual MediaStreamTrack* clone(ExecutionContext*);
72 73
74 void getConstraints(MediaTrackConstraints&);
75
76 // This function is called when constrains have been successfully applied.
77 // Called from UserMediaRequest when it succeeds. It is not IDL-exposed.
78 void setConstraints(const WebMediaConstraints&);
79
73 DEFINE_ATTRIBUTE_EVENT_LISTENER(mute); 80 DEFINE_ATTRIBUTE_EVENT_LISTENER(mute);
74 DEFINE_ATTRIBUTE_EVENT_LISTENER(unmute); 81 DEFINE_ATTRIBUTE_EVENT_LISTENER(unmute);
75 DEFINE_ATTRIBUTE_EVENT_LISTENER(ended); 82 DEFINE_ATTRIBUTE_EVENT_LISTENER(ended);
76 83
77 MediaStreamComponent* component() { return m_component; } 84 MediaStreamComponent* component() { return m_component; }
78 bool ended() const; 85 bool ended() const;
79 86
80 void registerMediaStream(MediaStream*); 87 void registerMediaStream(MediaStream*);
81 void unregisterMediaStream(MediaStream*); 88 void unregisterMediaStream(MediaStream*);
82 89
(...skipping 19 matching lines...) Expand all
102 // MediaStreamSourceObserver 109 // MediaStreamSourceObserver
103 void sourceChangedState() override; 110 void sourceChangedState() override;
104 111
105 void propagateTrackEnded(); 112 void propagateTrackEnded();
106 113
107 MediaStreamSource::ReadyState m_readyState; 114 MediaStreamSource::ReadyState m_readyState;
108 HeapHashSet<Member<MediaStream>> m_registeredMediaStreams; 115 HeapHashSet<Member<MediaStream>> m_registeredMediaStreams;
109 bool m_isIteratingRegisteredMediaStreams; 116 bool m_isIteratingRegisteredMediaStreams;
110 bool m_stopped; 117 bool m_stopped;
111 Member<MediaStreamComponent> m_component; 118 Member<MediaStreamComponent> m_component;
119 WebMediaConstraints m_constraints;
112 }; 120 };
113 121
114 typedef HeapVector<Member<MediaStreamTrack>> MediaStreamTrackVector; 122 typedef HeapVector<Member<MediaStreamTrack>> MediaStreamTrackVector;
115 123
116 } // namespace blink 124 } // namespace blink
117 125
118 #endif // MediaStreamTrack_h 126 #endif // MediaStreamTrack_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698