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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 class ExceptionState; | 38 class ExceptionState; |
39 | 39 |
40 class MediaStream FINAL | 40 class MediaStream FINAL |
41 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<MediaStre
am> | 41 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<MediaStre
am> |
42 , public URLRegistrable | 42 , public URLRegistrable |
43 , public MediaStreamDescriptorClient | 43 , public MediaStreamDescriptorClient |
44 , public EventTargetWithInlineData | 44 , public EventTargetWithInlineData |
45 , public ContextLifecycleObserver { | 45 , public ContextLifecycleObserver { |
46 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollectedWi
llBeGarbageCollectedFinalized<MediaStream>); | 46 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollectedWi
llBeGarbageCollectedFinalized<MediaStream>); |
47 USING_GARBAGE_COLLECTED_MIXIN(MediaStream); | 47 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaStream); |
48 public: | 48 public: |
49 static MediaStream* create(ExecutionContext*); | 49 static MediaStream* create(ExecutionContext*); |
50 static MediaStream* create(ExecutionContext*, MediaStream*); | 50 static MediaStream* create(ExecutionContext*, MediaStream*); |
51 static MediaStream* create(ExecutionContext*, const MediaStreamTrackVector&)
; | 51 static MediaStream* create(ExecutionContext*, const MediaStreamTrackVector&)
; |
52 static MediaStream* create(ExecutionContext*, MediaStreamDescriptor*); | 52 static MediaStream* create(ExecutionContext*, PassRefPtr<MediaStreamDescript
or>); |
53 virtual ~MediaStream(); | 53 virtual ~MediaStream(); |
54 | 54 |
55 // DEPRECATED | 55 // DEPRECATED |
56 String label() const { return m_descriptor->id(); } | 56 String label() const { return m_descriptor->id(); } |
57 | 57 |
58 String id() const { return m_descriptor->id(); } | 58 String id() const { return m_descriptor->id(); } |
59 | 59 |
60 void addTrack(MediaStreamTrack*, ExceptionState&); | 60 void addTrack(MediaStreamTrack*, ExceptionState&); |
61 void removeTrack(MediaStreamTrack*, ExceptionState&); | 61 void removeTrack(MediaStreamTrack*, ExceptionState&); |
62 MediaStreamTrack* getTrackById(String); | 62 MediaStreamTrack* getTrackById(String); |
(...skipping 20 matching lines...) Expand all Loading... |
83 // EventTarget | 83 // EventTarget |
84 virtual const AtomicString& interfaceName() const OVERRIDE; | 84 virtual const AtomicString& interfaceName() const OVERRIDE; |
85 virtual ExecutionContext* executionContext() const OVERRIDE; | 85 virtual ExecutionContext* executionContext() const OVERRIDE; |
86 | 86 |
87 // URLRegistrable | 87 // URLRegistrable |
88 virtual URLRegistry& registry() const OVERRIDE; | 88 virtual URLRegistry& registry() const OVERRIDE; |
89 | 89 |
90 virtual void trace(Visitor*) OVERRIDE; | 90 virtual void trace(Visitor*) OVERRIDE; |
91 | 91 |
92 private: | 92 private: |
93 MediaStream(ExecutionContext*, MediaStreamDescriptor*); | 93 MediaStream(ExecutionContext*, PassRefPtr<MediaStreamDescriptor>); |
94 MediaStream(ExecutionContext*, const MediaStreamTrackVector& audioTracks, co
nst MediaStreamTrackVector& videoTracks); | 94 MediaStream(ExecutionContext*, const MediaStreamTrackVector& audioTracks, co
nst MediaStreamTrackVector& videoTracks); |
95 | 95 |
96 // ContextLifecycleObserver | 96 // ContextLifecycleObserver |
97 virtual void contextDestroyed() OVERRIDE; | 97 virtual void contextDestroyed() OVERRIDE; |
98 | 98 |
99 // MediaStreamDescriptorClient | 99 // MediaStreamDescriptorClient |
100 virtual void addRemoteTrack(MediaStreamComponent*) OVERRIDE; | 100 virtual void addRemoteTrack(MediaStreamComponent*) OVERRIDE; |
101 virtual void removeRemoteTrack(MediaStreamComponent*) OVERRIDE; | 101 virtual void removeRemoteTrack(MediaStreamComponent*) OVERRIDE; |
102 | 102 |
103 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); | 103 void scheduleDispatchEvent(PassRefPtrWillBeRawPtr<Event>); |
104 void scheduledEventTimerFired(Timer<MediaStream>*); | 104 void scheduledEventTimerFired(Timer<MediaStream>*); |
105 | 105 |
106 bool m_stopped; | 106 bool m_stopped; |
107 | 107 |
108 MediaStreamTrackVector m_audioTracks; | 108 MediaStreamTrackVector m_audioTracks; |
109 MediaStreamTrackVector m_videoTracks; | 109 MediaStreamTrackVector m_videoTracks; |
110 Member<MediaStreamDescriptor> m_descriptor; | 110 RefPtr<MediaStreamDescriptor> m_descriptor; |
111 | 111 |
112 Timer<MediaStream> m_scheduledEventTimer; | 112 Timer<MediaStream> m_scheduledEventTimer; |
113 WillBeHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; | 113 WillBeHeapVector<RefPtrWillBeMember<Event> > m_scheduledEvents; |
114 }; | 114 }; |
115 | 115 |
116 typedef HeapVector<Member<MediaStream> > MediaStreamVector; | 116 typedef HeapVector<Member<MediaStream> > MediaStreamVector; |
117 | 117 |
118 } // namespace blink | 118 } // namespace blink |
119 | 119 |
120 #endif // MediaStream_h | 120 #endif // MediaStream_h |
OLD | NEW |