| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Ericsson AB. All rights reserved. | 2 * Copyright (C) 2011 Ericsson AB. All rights reserved. |
| 3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. 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 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 #ifndef MediaStreamDescriptor_h | 32 #ifndef MediaStreamDescriptor_h |
| 33 #define MediaStreamDescriptor_h | 33 #define MediaStreamDescriptor_h |
| 34 | 34 |
| 35 #include "platform/mediastream/MediaStreamComponent.h" | 35 #include "platform/mediastream/MediaStreamComponent.h" |
| 36 #include "platform/mediastream/MediaStreamSource.h" | 36 #include "platform/mediastream/MediaStreamSource.h" |
| 37 #include "wtf/Allocator.h" | 37 #include "wtf/Allocator.h" |
| 38 #include "wtf/Forward.h" | 38 #include "wtf/Forward.h" |
| 39 #include "wtf/Vector.h" | 39 #include "wtf/Vector.h" |
| 40 #include <memory> | |
| 41 | 40 |
| 42 namespace blink { | 41 namespace blink { |
| 43 | 42 |
| 44 class PLATFORM_EXPORT MediaStreamDescriptorClient : public GarbageCollectedMixin
{ | 43 class PLATFORM_EXPORT MediaStreamDescriptorClient : public GarbageCollectedMixin
{ |
| 45 public: | 44 public: |
| 46 virtual ~MediaStreamDescriptorClient() { } | 45 virtual ~MediaStreamDescriptorClient() { } |
| 47 | 46 |
| 48 virtual void streamEnded() = 0; | 47 virtual void streamEnded() = 0; |
| 49 virtual void addRemoteTrack(MediaStreamComponent*) = 0; | 48 virtual void addRemoteTrack(MediaStreamComponent*) = 0; |
| 50 virtual void removeRemoteTrack(MediaStreamComponent*) = 0; | 49 virtual void removeRemoteTrack(MediaStreamComponent*) = 0; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 void addRemoteTrack(MediaStreamComponent*); | 82 void addRemoteTrack(MediaStreamComponent*); |
| 84 void removeRemoteTrack(MediaStreamComponent*); | 83 void removeRemoteTrack(MediaStreamComponent*); |
| 85 | 84 |
| 86 bool active() const { return m_active; } | 85 bool active() const { return m_active; } |
| 87 void setActive(bool active) { m_active = active; } | 86 void setActive(bool active) { m_active = active; } |
| 88 | 87 |
| 89 bool ended() const { return m_ended; } | 88 bool ended() const { return m_ended; } |
| 90 void setEnded() { m_ended = true; } | 89 void setEnded() { m_ended = true; } |
| 91 | 90 |
| 92 ExtraData* getExtraData() const { return m_extraData.get(); } | 91 ExtraData* getExtraData() const { return m_extraData.get(); } |
| 93 void setExtraData(std::unique_ptr<ExtraData> extraData) { m_extraData = std:
:move(extraData); } | 92 void setExtraData(PassOwnPtr<ExtraData> extraData) { m_extraData = std::move
(extraData); } |
| 94 | 93 |
| 95 // |m_extraData| may hold pointers to GC objects, and it may touch them in d
estruction. | 94 // |m_extraData| may hold pointers to GC objects, and it may touch them in d
estruction. |
| 96 // So this class is eagerly finalized to finalize |m_extraData| promptly. | 95 // So this class is eagerly finalized to finalize |m_extraData| promptly. |
| 97 EAGERLY_FINALIZE(); | 96 EAGERLY_FINALIZE(); |
| 98 DECLARE_TRACE(); | 97 DECLARE_TRACE(); |
| 99 | 98 |
| 100 private: | 99 private: |
| 101 MediaStreamDescriptor(const String& id, const MediaStreamSourceVector& audio
Sources, const MediaStreamSourceVector& videoSources); | 100 MediaStreamDescriptor(const String& id, const MediaStreamSourceVector& audio
Sources, const MediaStreamSourceVector& videoSources); |
| 102 MediaStreamDescriptor(const String& id, const MediaStreamComponentVector& au
dioComponents, const MediaStreamComponentVector& videoComponents); | 101 MediaStreamDescriptor(const String& id, const MediaStreamComponentVector& au
dioComponents, const MediaStreamComponentVector& videoComponents); |
| 103 | 102 |
| 104 Member<MediaStreamDescriptorClient> m_client; | 103 Member<MediaStreamDescriptorClient> m_client; |
| 105 String m_id; | 104 String m_id; |
| 106 HeapVector<Member<MediaStreamComponent>> m_audioComponents; | 105 HeapVector<Member<MediaStreamComponent>> m_audioComponents; |
| 107 HeapVector<Member<MediaStreamComponent>> m_videoComponents; | 106 HeapVector<Member<MediaStreamComponent>> m_videoComponents; |
| 108 bool m_active; | 107 bool m_active; |
| 109 bool m_ended; | 108 bool m_ended; |
| 110 | 109 |
| 111 std::unique_ptr<ExtraData> m_extraData; | 110 OwnPtr<ExtraData> m_extraData; |
| 112 }; | 111 }; |
| 113 | 112 |
| 114 typedef HeapVector<Member<MediaStreamDescriptor>> MediaStreamDescriptorVector; | 113 typedef HeapVector<Member<MediaStreamDescriptor>> MediaStreamDescriptorVector; |
| 115 | 114 |
| 116 } // namespace blink | 115 } // namespace blink |
| 117 | 116 |
| 118 #endif // MediaStreamDescriptor_h | 117 #endif // MediaStreamDescriptor_h |
| OLD | NEW |