OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "wtf/Vector.h" | 36 #include "wtf/Vector.h" |
37 | 37 |
38 namespace blink { | 38 namespace blink { |
39 | 39 |
40 namespace { | 40 namespace { |
41 | 41 |
42 class ExtraDataContainer : public MediaStreamDescriptor::ExtraData { | 42 class ExtraDataContainer : public MediaStreamDescriptor::ExtraData { |
43 public: | 43 public: |
44 ExtraDataContainer(PassOwnPtr<WebMediaStream::ExtraData> extraData) : m_extr
aData(std::move(extraData)) { } | 44 ExtraDataContainer(PassOwnPtr<WebMediaStream::ExtraData> extraData) : m_extr
aData(std::move(extraData)) { } |
45 | 45 |
46 WebMediaStream::ExtraData* extraData() { return m_extraData.get(); } | 46 WebMediaStream::ExtraData* getExtraData() { return m_extraData.get(); } |
47 | 47 |
48 private: | 48 private: |
49 OwnPtr<WebMediaStream::ExtraData> m_extraData; | 49 OwnPtr<WebMediaStream::ExtraData> m_extraData; |
50 }; | 50 }; |
51 | 51 |
52 } // namespace | 52 } // namespace |
53 | 53 |
54 WebMediaStream::WebMediaStream(MediaStreamDescriptor* mediaStreamDescriptor) | 54 WebMediaStream::WebMediaStream(MediaStreamDescriptor* mediaStreamDescriptor) |
55 : m_private(mediaStreamDescriptor) | 55 : m_private(mediaStreamDescriptor) |
56 { | 56 { |
57 } | 57 } |
58 | 58 |
59 void WebMediaStream::reset() | 59 void WebMediaStream::reset() |
60 { | 60 { |
61 m_private.reset(); | 61 m_private.reset(); |
62 } | 62 } |
63 | 63 |
64 WebString WebMediaStream::id() const | 64 WebString WebMediaStream::id() const |
65 { | 65 { |
66 return m_private->id(); | 66 return m_private->id(); |
67 } | 67 } |
68 | 68 |
69 WebMediaStream::ExtraData* WebMediaStream::extraData() const | 69 WebMediaStream::ExtraData* WebMediaStream::getExtraData() const |
70 { | 70 { |
71 MediaStreamDescriptor::ExtraData* data = m_private->extraData(); | 71 MediaStreamDescriptor::ExtraData* data = m_private->getExtraData(); |
72 if (!data) | 72 if (!data) |
73 return 0; | 73 return 0; |
74 return static_cast<ExtraDataContainer*>(data)->extraData(); | 74 return static_cast<ExtraDataContainer*>(data)->getExtraData(); |
75 } | 75 } |
76 | 76 |
77 void WebMediaStream::setExtraData(ExtraData* extraData) | 77 void WebMediaStream::setExtraData(ExtraData* extraData) |
78 { | 78 { |
79 m_private->setExtraData(adoptPtr(new ExtraDataContainer(adoptPtr(extraData))
)); | 79 m_private->setExtraData(adoptPtr(new ExtraDataContainer(adoptPtr(extraData))
)); |
80 } | 80 } |
81 | 81 |
82 void WebMediaStream::audioTracks(WebVector<WebMediaStreamTrack>& webTracks) cons
t | 82 void WebMediaStream::audioTracks(WebVector<WebMediaStreamTrack>& webTracks) cons
t |
83 { | 83 { |
84 size_t numberOfTracks = m_private->numberOfAudioComponents(); | 84 size_t numberOfTracks = m_private->numberOfAudioComponents(); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 } | 138 } |
139 m_private = MediaStreamDescriptor::create(label, audio, video); | 139 m_private = MediaStreamDescriptor::create(label, audio, video); |
140 } | 140 } |
141 | 141 |
142 void WebMediaStream::assign(const WebMediaStream& other) | 142 void WebMediaStream::assign(const WebMediaStream& other) |
143 { | 143 { |
144 m_private = other.m_private; | 144 m_private = other.m_private; |
145 } | 145 } |
146 | 146 |
147 } // namespace blink | 147 } // namespace blink |
OLD | NEW |