| 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 29 matching lines...) Expand all Loading... |
| 40 namespace WebCore { | 40 namespace WebCore { |
| 41 | 41 |
| 42 class MediaStream : public RefCounted<MediaStream>, public MediaStreamDescriptor
Client, public EventTarget, public ContextDestructionObserver { | 42 class MediaStream : public RefCounted<MediaStream>, public MediaStreamDescriptor
Client, public EventTarget, public ContextDestructionObserver { |
| 43 public: | 43 public: |
| 44 static PassRefPtr<MediaStream> create(ScriptExecutionContext*); | 44 static PassRefPtr<MediaStream> create(ScriptExecutionContext*); |
| 45 static PassRefPtr<MediaStream> create(ScriptExecutionContext*, PassRefPtr<Me
diaStream>); | 45 static PassRefPtr<MediaStream> create(ScriptExecutionContext*, PassRefPtr<Me
diaStream>); |
| 46 static PassRefPtr<MediaStream> create(ScriptExecutionContext*, const MediaSt
reamTrackVector&); | 46 static PassRefPtr<MediaStream> create(ScriptExecutionContext*, const MediaSt
reamTrackVector&); |
| 47 static PassRefPtr<MediaStream> create(ScriptExecutionContext*, PassRefPtr<Me
diaStreamDescriptor>); | 47 static PassRefPtr<MediaStream> create(ScriptExecutionContext*, PassRefPtr<Me
diaStreamDescriptor>); |
| 48 virtual ~MediaStream(); | 48 virtual ~MediaStream(); |
| 49 | 49 |
| 50 // DEPRECATED | |
| 51 String label() const { return m_descriptor->id(); } | |
| 52 | |
| 53 String id() const { return m_descriptor->id(); } | 50 String id() const { return m_descriptor->id(); } |
| 54 | 51 |
| 55 void addTrack(PassRefPtr<MediaStreamTrack>, ExceptionCode&); | 52 void addTrack(PassRefPtr<MediaStreamTrack>, ExceptionCode&); |
| 56 void removeTrack(PassRefPtr<MediaStreamTrack>, ExceptionCode&); | 53 void removeTrack(PassRefPtr<MediaStreamTrack>, ExceptionCode&); |
| 57 MediaStreamTrack* getTrackById(String); | 54 MediaStreamTrack* getTrackById(String); |
| 58 | 55 |
| 59 MediaStreamTrackVector getAudioTracks() const { return m_audioTracks; } | 56 MediaStreamTrackVector getAudioTracks() const { return m_audioTracks; } |
| 60 MediaStreamTrackVector getVideoTracks() const { return m_videoTracks; } | 57 MediaStreamTrackVector getVideoTracks() const { return m_videoTracks; } |
| 61 | 58 |
| 62 bool ended() const; | 59 bool ended() const; |
| 60 void stop(); |
| 63 | 61 |
| 64 DEFINE_ATTRIBUTE_EVENT_LISTENER(ended); | 62 DEFINE_ATTRIBUTE_EVENT_LISTENER(ended); |
| 65 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack); | 63 DEFINE_ATTRIBUTE_EVENT_LISTENER(addtrack); |
| 66 DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack); | 64 DEFINE_ATTRIBUTE_EVENT_LISTENER(removetrack); |
| 67 | 65 |
| 68 // MediaStreamDescriptorClient | 66 // MediaStreamDescriptorClient |
| 69 virtual void trackEnded() OVERRIDE; | 67 virtual void trackEnded() OVERRIDE; |
| 70 virtual void streamEnded() OVERRIDE; | 68 virtual void streamEnded() OVERRIDE; |
| 71 | 69 |
| 72 virtual bool isLocal() const { return false; } | |
| 73 | |
| 74 MediaStreamDescriptor* descriptor() const { return m_descriptor.get(); } | 70 MediaStreamDescriptor* descriptor() const { return m_descriptor.get(); } |
| 75 | 71 |
| 76 // EventTarget | 72 // EventTarget |
| 77 virtual const AtomicString& interfaceName() const OVERRIDE; | 73 virtual const AtomicString& interfaceName() const OVERRIDE; |
| 78 virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE; | 74 virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE; |
| 79 | 75 |
| 80 using RefCounted<MediaStream>::ref; | 76 using RefCounted<MediaStream>::ref; |
| 81 using RefCounted<MediaStream>::deref; | 77 using RefCounted<MediaStream>::deref; |
| 82 | 78 |
| 83 protected: | 79 protected: |
| (...skipping 30 matching lines...) Expand all Loading... |
| 114 Vector<RefPtr<Event> > m_scheduledEvents; | 110 Vector<RefPtr<Event> > m_scheduledEvents; |
| 115 }; | 111 }; |
| 116 | 112 |
| 117 typedef Vector<RefPtr<MediaStream> > MediaStreamVector; | 113 typedef Vector<RefPtr<MediaStream> > MediaStreamVector; |
| 118 | 114 |
| 119 } // namespace WebCore | 115 } // namespace WebCore |
| 120 | 116 |
| 121 #endif // ENABLE(MEDIA_STREAM) | 117 #endif // ENABLE(MEDIA_STREAM) |
| 122 | 118 |
| 123 #endif // MediaStream_h | 119 #endif // MediaStream_h |
| OLD | NEW |