Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 // Internal | |
|
Peter Beverloo
2016/04/21 14:11:46
I see that this has to be exposed because UserMedi
hta - Chromium
2016/04/24 09:58:26
More explanation added. There will be an applyCons
| |
| 77 void setConstraints(const WebMediaConstraints&); | |
| 78 | |
| 73 DEFINE_ATTRIBUTE_EVENT_LISTENER(mute); | 79 DEFINE_ATTRIBUTE_EVENT_LISTENER(mute); |
| 74 DEFINE_ATTRIBUTE_EVENT_LISTENER(unmute); | 80 DEFINE_ATTRIBUTE_EVENT_LISTENER(unmute); |
| 75 DEFINE_ATTRIBUTE_EVENT_LISTENER(ended); | 81 DEFINE_ATTRIBUTE_EVENT_LISTENER(ended); |
| 76 | 82 |
| 77 MediaStreamComponent* component() { return m_component; } | 83 MediaStreamComponent* component() { return m_component; } |
| 78 bool ended() const; | 84 bool ended() const; |
| 79 | 85 |
| 80 void registerMediaStream(MediaStream*); | 86 void registerMediaStream(MediaStream*); |
| 81 void unregisterMediaStream(MediaStream*); | 87 void unregisterMediaStream(MediaStream*); |
| 82 | 88 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 102 // MediaStreamSourceObserver | 108 // MediaStreamSourceObserver |
| 103 void sourceChangedState() override; | 109 void sourceChangedState() override; |
| 104 | 110 |
| 105 void propagateTrackEnded(); | 111 void propagateTrackEnded(); |
| 106 | 112 |
| 107 MediaStreamSource::ReadyState m_readyState; | 113 MediaStreamSource::ReadyState m_readyState; |
| 108 HeapHashSet<Member<MediaStream>> m_registeredMediaStreams; | 114 HeapHashSet<Member<MediaStream>> m_registeredMediaStreams; |
| 109 bool m_isIteratingRegisteredMediaStreams; | 115 bool m_isIteratingRegisteredMediaStreams; |
| 110 bool m_stopped; | 116 bool m_stopped; |
| 111 Member<MediaStreamComponent> m_component; | 117 Member<MediaStreamComponent> m_component; |
| 118 WebMediaConstraints m_constraints; | |
| 112 }; | 119 }; |
| 113 | 120 |
| 114 typedef HeapVector<Member<MediaStreamTrack>> MediaStreamTrackVector; | 121 typedef HeapVector<Member<MediaStreamTrack>> MediaStreamTrackVector; |
| 115 | 122 |
| 116 } // namespace blink | 123 } // namespace blink |
| 117 | 124 |
| 118 #endif // MediaStreamTrack_h | 125 #endif // MediaStreamTrack_h |
| OLD | NEW |