| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_MEDIA_STREAM_ADAPTER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_MEDIA_STREAM_ADAPTER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_MEDIA_STREAM_ADAPTER_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_MEDIA_STREAM_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 ~WebRtcMediaStreamAdapter() override; | 37 ~WebRtcMediaStreamAdapter() override; |
| 38 | 38 |
| 39 bool IsEqual(const blink::WebMediaStream& web_stream) const { | 39 bool IsEqual(const blink::WebMediaStream& web_stream) const { |
| 40 return web_stream_.GetExtraData() == web_stream.GetExtraData(); | 40 return web_stream_.GetExtraData() == web_stream.GetExtraData(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 webrtc::MediaStreamInterface* webrtc_media_stream() const { | 43 webrtc::MediaStreamInterface* webrtc_media_stream() const { |
| 44 return webrtc_media_stream_.get(); | 44 return webrtc_media_stream_.get(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 const blink::WebMediaStream& web_stream() const { return web_stream_; } |
| 48 |
| 47 protected: | 49 protected: |
| 48 // MediaStreamObserver implementation. | 50 // MediaStreamObserver implementation. |
| 49 void TrackAdded(const blink::WebMediaStreamTrack& track) override; | 51 void TrackAdded(const blink::WebMediaStreamTrack& track) override; |
| 50 void TrackRemoved(const blink::WebMediaStreamTrack& track) override; | 52 void TrackRemoved(const blink::WebMediaStreamTrack& track) override; |
| 51 | 53 |
| 52 private: | 54 private: |
| 53 void AddAudioSinkToTrack(const blink::WebMediaStreamTrack& track); | 55 void AddAudioSinkToTrack(const blink::WebMediaStreamTrack& track); |
| 54 void AddVideoSinkToTrack(const blink::WebMediaStreamTrack& track); | 56 void AddVideoSinkToTrack(const blink::WebMediaStreamTrack& track); |
| 55 | 57 |
| 56 const blink::WebMediaStream web_stream_; | 58 const blink::WebMediaStream web_stream_; |
| 57 | 59 |
| 58 // Pointer to a PeerConnectionDependencyFactory, owned by the RenderThread. | 60 // Pointer to a PeerConnectionDependencyFactory, owned by the RenderThread. |
| 59 // It's valid for the lifetime of RenderThread. | 61 // It's valid for the lifetime of RenderThread. |
| 60 PeerConnectionDependencyFactory* const factory_; | 62 PeerConnectionDependencyFactory* const factory_; |
| 61 | 63 |
| 62 scoped_refptr<webrtc::MediaStreamInterface> webrtc_media_stream_; | 64 scoped_refptr<webrtc::MediaStreamInterface> webrtc_media_stream_; |
| 63 std::vector<std::unique_ptr<WebRtcAudioSink>> audio_sinks_; | 65 std::vector<std::unique_ptr<WebRtcAudioSink>> audio_sinks_; |
| 64 std::vector<std::unique_ptr<MediaStreamVideoWebRtcSink>> video_sinks_; | 66 std::vector<std::unique_ptr<MediaStreamVideoWebRtcSink>> video_sinks_; |
| 65 | 67 |
| 66 DISALLOW_COPY_AND_ASSIGN (WebRtcMediaStreamAdapter); | 68 DISALLOW_COPY_AND_ASSIGN (WebRtcMediaStreamAdapter); |
| 67 }; | 69 }; |
| 68 | 70 |
| 69 } // namespace content | 71 } // namespace content |
| 70 | 72 |
| 71 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_MEDIA_STREAM_ADAPTER_H_ | 73 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_WEBRTC_MEDIA_STREAM_ADAPTER_H_ |
| OLD | NEW |