| 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> |
| 40 | 41 |
| 41 namespace blink { | 42 namespace blink { |
| 42 | 43 |
| 43 class PLATFORM_EXPORT MediaStreamDescriptorClient : public GarbageCollectedMixin
{ | 44 class PLATFORM_EXPORT MediaStreamDescriptorClient : public GarbageCollectedMixin
{ |
| 44 public: | 45 public: |
| 45 virtual ~MediaStreamDescriptorClient() { } | 46 virtual ~MediaStreamDescriptorClient() { } |
| 46 | 47 |
| 47 virtual void streamEnded() = 0; | 48 virtual void streamEnded() = 0; |
| 48 virtual void addRemoteTrack(MediaStreamComponent*) = 0; | 49 virtual void addRemoteTrack(MediaStreamComponent*) = 0; |
| 49 virtual void removeRemoteTrack(MediaStreamComponent*) = 0; | 50 virtual void removeRemoteTrack(MediaStreamComponent*) = 0; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 void addRemoteTrack(MediaStreamComponent*); | 83 void addRemoteTrack(MediaStreamComponent*); |
| 83 void removeRemoteTrack(MediaStreamComponent*); | 84 void removeRemoteTrack(MediaStreamComponent*); |
| 84 | 85 |
| 85 bool active() const { return m_active; } | 86 bool active() const { return m_active; } |
| 86 void setActive(bool active) { m_active = active; } | 87 void setActive(bool active) { m_active = active; } |
| 87 | 88 |
| 88 bool ended() const { return m_ended; } | 89 bool ended() const { return m_ended; } |
| 89 void setEnded() { m_ended = true; } | 90 void setEnded() { m_ended = true; } |
| 90 | 91 |
| 91 ExtraData* getExtraData() const { return m_extraData.get(); } | 92 ExtraData* getExtraData() const { return m_extraData.get(); } |
| 92 void setExtraData(PassOwnPtr<ExtraData> extraData) { m_extraData = std::move
(extraData); } | 93 void setExtraData(std::unique_ptr<ExtraData> extraData) { m_extraData = std:
:move(extraData); } |
| 93 | 94 |
| 94 // |m_extraData| may hold pointers to GC objects, and it may touch them in d
estruction. | 95 // |m_extraData| may hold pointers to GC objects, and it may touch them in d
estruction. |
| 95 // So this class is eagerly finalized to finalize |m_extraData| promptly. | 96 // So this class is eagerly finalized to finalize |m_extraData| promptly. |
| 96 EAGERLY_FINALIZE(); | 97 EAGERLY_FINALIZE(); |
| 97 DECLARE_TRACE(); | 98 DECLARE_TRACE(); |
| 98 | 99 |
| 99 private: | 100 private: |
| 100 MediaStreamDescriptor(const String& id, const MediaStreamSourceVector& audio
Sources, const MediaStreamSourceVector& videoSources); | 101 MediaStreamDescriptor(const String& id, const MediaStreamSourceVector& audio
Sources, const MediaStreamSourceVector& videoSources); |
| 101 MediaStreamDescriptor(const String& id, const MediaStreamComponentVector& au
dioComponents, const MediaStreamComponentVector& videoComponents); | 102 MediaStreamDescriptor(const String& id, const MediaStreamComponentVector& au
dioComponents, const MediaStreamComponentVector& videoComponents); |
| 102 | 103 |
| 103 Member<MediaStreamDescriptorClient> m_client; | 104 Member<MediaStreamDescriptorClient> m_client; |
| 104 String m_id; | 105 String m_id; |
| 105 HeapVector<Member<MediaStreamComponent>> m_audioComponents; | 106 HeapVector<Member<MediaStreamComponent>> m_audioComponents; |
| 106 HeapVector<Member<MediaStreamComponent>> m_videoComponents; | 107 HeapVector<Member<MediaStreamComponent>> m_videoComponents; |
| 107 bool m_active; | 108 bool m_active; |
| 108 bool m_ended; | 109 bool m_ended; |
| 109 | 110 |
| 110 OwnPtr<ExtraData> m_extraData; | 111 std::unique_ptr<ExtraData> m_extraData; |
| 111 }; | 112 }; |
| 112 | 113 |
| 113 typedef HeapVector<Member<MediaStreamDescriptor>> MediaStreamDescriptorVector; | 114 typedef HeapVector<Member<MediaStreamDescriptor>> MediaStreamDescriptorVector; |
| 114 | 115 |
| 115 } // namespace blink | 116 } // namespace blink |
| 116 | 117 |
| 117 #endif // MediaStreamDescriptor_h | 118 #endif // MediaStreamDescriptor_h |
| OLD | NEW |