| 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 28 matching lines...) Expand all Loading... |
| 39 class AudioSourceProvider; | 39 class AudioSourceProvider; |
| 40 class ExceptionState; | 40 class ExceptionState; |
| 41 class MediaStreamComponent; | 41 class MediaStreamComponent; |
| 42 class MediaStreamTrackSourcesCallback; | 42 class MediaStreamTrackSourcesCallback; |
| 43 | 43 |
| 44 class MODULES_EXPORT MediaStreamTrack final | 44 class MODULES_EXPORT MediaStreamTrack final |
| 45 : public RefCountedGarbageCollectedEventTargetWithInlineData<MediaStreamTrac
k> | 45 : public RefCountedGarbageCollectedEventTargetWithInlineData<MediaStreamTrac
k> |
| 46 , public ActiveDOMObject | 46 , public ActiveDOMObject |
| 47 , public MediaStreamSource::Observer { | 47 , public MediaStreamSource::Observer { |
| 48 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(MediaStreamTrack); | 48 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(MediaStreamTrack); |
| 49 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaStreamTrack); | 49 USING_GARBAGE_COLLECTED_MIXIN(MediaStreamTrack); |
| 50 DEFINE_WRAPPERTYPEINFO(); | 50 DEFINE_WRAPPERTYPEINFO(); |
| 51 public: | 51 public: |
| 52 static MediaStreamTrack* create(ExecutionContext*, MediaStreamComponent*); | 52 static MediaStreamTrack* create(ExecutionContext*, MediaStreamComponent*); |
| 53 ~MediaStreamTrack() override; | 53 ~MediaStreamTrack() override; |
| 54 | 54 |
| 55 String kind() const; | 55 String kind() const; |
| 56 String id() const; | 56 String id() const; |
| 57 String label() const; | 57 String label() const; |
| 58 bool remote() const; | 58 bool remote() const; |
| 59 bool readonly() const; | 59 bool readonly() const; |
| 60 | 60 |
| 61 bool enabled() const; | 61 bool enabled() const; |
| 62 void setEnabled(bool); | 62 void setEnabled(bool); |
| 63 | 63 |
| 64 bool muted() const; | 64 bool muted() const; |
| 65 | 65 |
| 66 String readyState() const; | 66 String readyState() const; |
| 67 | 67 |
| 68 static void getSources(ExecutionContext*, MediaStreamTrackSourcesCallback*,
ExceptionState&); | 68 static void getSources(ExecutionContext*, MediaStreamTrackSourcesCallback*,
ExceptionState&); |
| 69 void stopTrack(ExceptionState&); | 69 void stopTrack(ExceptionState&); |
| 70 MediaStreamTrack* clone(ExecutionContext*); | 70 MediaStreamTrack* clone(ExecutionContext*); |
| 71 | 71 |
| 72 DEFINE_ATTRIBUTE_EVENT_LISTENER(mute); | 72 DEFINE_ATTRIBUTE_EVENT_LISTENER(mute); |
| 73 DEFINE_ATTRIBUTE_EVENT_LISTENER(unmute); | 73 DEFINE_ATTRIBUTE_EVENT_LISTENER(unmute); |
| 74 DEFINE_ATTRIBUTE_EVENT_LISTENER(ended); | 74 DEFINE_ATTRIBUTE_EVENT_LISTENER(ended); |
| 75 | 75 |
| 76 MediaStreamComponent* component(); | 76 MediaStreamComponent* component() { return m_component; } |
| 77 bool ended() const; | 77 bool ended() const; |
| 78 | 78 |
| 79 void registerMediaStream(MediaStream*); | 79 void registerMediaStream(MediaStream*); |
| 80 void unregisterMediaStream(MediaStream*); | 80 void unregisterMediaStream(MediaStream*); |
| 81 | 81 |
| 82 // EventTarget | 82 // EventTarget |
| 83 const AtomicString& interfaceName() const override; | 83 const AtomicString& interfaceName() const override; |
| 84 ExecutionContext* executionContext() const override; | 84 ExecutionContext* executionContext() const override; |
| 85 | 85 |
| 86 // ActiveDOMObject | 86 // ActiveDOMObject |
| (...skipping 10 matching lines...) Expand all Loading... |
| 97 | 97 |
| 98 // MediaStreamSourceObserver | 98 // MediaStreamSourceObserver |
| 99 void sourceChangedState() override; | 99 void sourceChangedState() override; |
| 100 | 100 |
| 101 void propagateTrackEnded(); | 101 void propagateTrackEnded(); |
| 102 | 102 |
| 103 MediaStreamSource::ReadyState m_readyState; | 103 MediaStreamSource::ReadyState m_readyState; |
| 104 HeapHashSet<Member<MediaStream>> m_registeredMediaStreams; | 104 HeapHashSet<Member<MediaStream>> m_registeredMediaStreams; |
| 105 bool m_isIteratingRegisteredMediaStreams; | 105 bool m_isIteratingRegisteredMediaStreams; |
| 106 bool m_stopped; | 106 bool m_stopped; |
| 107 RefPtr<MediaStreamComponent> m_component; | 107 Member<MediaStreamComponent> m_component; |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 typedef HeapVector<Member<MediaStreamTrack>> MediaStreamTrackVector; | 110 typedef HeapVector<Member<MediaStreamTrack>> MediaStreamTrackVector; |
| 111 | 111 |
| 112 } // namespace blink | 112 } // namespace blink |
| 113 | 113 |
| 114 #endif // MediaStreamTrack_h | 114 #endif // MediaStreamTrack_h |
| OLD | NEW |