| 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 20 matching lines...) Expand all Loading... |
| 31 #include "core/dom/EventTarget.h" | 31 #include "core/dom/EventTarget.h" |
| 32 #include "core/html/URLRegistry.h" | 32 #include "core/html/URLRegistry.h" |
| 33 #include "core/platform/Timer.h" | 33 #include "core/platform/Timer.h" |
| 34 #include "core/platform/mediastream/MediaStreamDescriptor.h" | 34 #include "core/platform/mediastream/MediaStreamDescriptor.h" |
| 35 #include "modules/mediastream/MediaStreamTrack.h" | 35 #include "modules/mediastream/MediaStreamTrack.h" |
| 36 #include "wtf/RefCounted.h" | 36 #include "wtf/RefCounted.h" |
| 37 #include "wtf/RefPtr.h" | 37 #include "wtf/RefPtr.h" |
| 38 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 class ExceptionState; | 41 typedef int ExceptionCode; |
| 42 | 42 |
| 43 class MediaStream : public RefCounted<MediaStream>, public ScriptWrappable, publ
ic URLRegistrable, public MediaStreamDescriptorClient, public EventTarget, publi
c ContextLifecycleObserver { | 43 class MediaStream : public RefCounted<MediaStream>, public ScriptWrappable, publ
ic URLRegistrable, public MediaStreamDescriptorClient, public EventTarget, publi
c ContextLifecycleObserver { |
| 44 public: | 44 public: |
| 45 static PassRefPtr<MediaStream> create(ScriptExecutionContext*); | 45 static PassRefPtr<MediaStream> create(ScriptExecutionContext*); |
| 46 static PassRefPtr<MediaStream> create(ScriptExecutionContext*, PassRefPtr<Me
diaStream>); | 46 static PassRefPtr<MediaStream> create(ScriptExecutionContext*, PassRefPtr<Me
diaStream>); |
| 47 static PassRefPtr<MediaStream> create(ScriptExecutionContext*, const MediaSt
reamTrackVector&); | 47 static PassRefPtr<MediaStream> create(ScriptExecutionContext*, const MediaSt
reamTrackVector&); |
| 48 static PassRefPtr<MediaStream> create(ScriptExecutionContext*, PassRefPtr<Me
diaStreamDescriptor>); | 48 static PassRefPtr<MediaStream> create(ScriptExecutionContext*, PassRefPtr<Me
diaStreamDescriptor>); |
| 49 virtual ~MediaStream(); | 49 virtual ~MediaStream(); |
| 50 | 50 |
| 51 // DEPRECATED | 51 // DEPRECATED |
| 52 String label() const { return m_descriptor->id(); } | 52 String label() const { return m_descriptor->id(); } |
| 53 | 53 |
| 54 String id() const { return m_descriptor->id(); } | 54 String id() const { return m_descriptor->id(); } |
| 55 | 55 |
| 56 void addTrack(PassRefPtr<MediaStreamTrack>, ExceptionState&); | 56 void addTrack(PassRefPtr<MediaStreamTrack>, ExceptionCode&); |
| 57 void removeTrack(PassRefPtr<MediaStreamTrack>, ExceptionState&); | 57 void removeTrack(PassRefPtr<MediaStreamTrack>, ExceptionCode&); |
| 58 MediaStreamTrack* getTrackById(String); | 58 MediaStreamTrack* getTrackById(String); |
| 59 | 59 |
| 60 MediaStreamTrackVector getAudioTracks() const { return m_audioTracks; } | 60 MediaStreamTrackVector getAudioTracks() const { return m_audioTracks; } |
| 61 MediaStreamTrackVector getVideoTracks() const { return m_videoTracks; } | 61 MediaStreamTrackVector getVideoTracks() const { return m_videoTracks; } |
| 62 | 62 |
| 63 bool ended() const; | 63 bool ended() const; |
| 64 void stop(); | 64 void stop(); |
| 65 | 65 |
| 66 DEFINE_ATTRIBUTE_EVENT_LISTENER(ended); | 66 DEFINE_ATTRIBUTE_EVENT_LISTENER(ended); |
| 67 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack); | 67 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 Timer<MediaStream> m_scheduledEventTimer; | 116 Timer<MediaStream> m_scheduledEventTimer; |
| 117 Vector<RefPtr<Event> > m_scheduledEvents; | 117 Vector<RefPtr<Event> > m_scheduledEvents; |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 typedef Vector<RefPtr<MediaStream> > MediaStreamVector; | 120 typedef Vector<RefPtr<MediaStream> > MediaStreamVector; |
| 121 | 121 |
| 122 } // namespace WebCore | 122 } // namespace WebCore |
| 123 | 123 |
| 124 #endif // MediaStream_h | 124 #endif // MediaStream_h |
| OLD | NEW |