OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_REMOTE_MEDIA_STREAM_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_REMOTE_MEDIA_STREAM_IMPL_H_ |
6 #define CONTENT_RENDERER_MEDIA_REMOTE_MEDIA_STREAM_IMPL_H_ | 6 #define CONTENT_RENDERER_MEDIA_REMOTE_MEDIA_STREAM_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
12 #include "base/threading/non_thread_safe.h" | 12 #include "base/threading/non_thread_safe.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" | 14 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" |
15 #include "third_party/WebKit/public/platform/WebMediaStream.h" | 15 #include "third_party/WebKit/public/platform/WebMediaStream.h" |
16 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" | 16 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" |
17 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 17 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 | 20 |
21 class RemoteMediaStreamTrackObserver; | 21 class RemoteMediaStreamTrackAdapter; |
22 | 22 |
23 // RemoteMediaStreamImpl serves as a container and glue between remote webrtc | 23 // RemoteMediaStreamImpl serves as a container and glue between remote webrtc |
24 // MediaStreams and WebKit MediaStreams. For each remote MediaStream received | 24 // MediaStreams and WebKit MediaStreams. For each remote MediaStream received |
25 // on a PeerConnection a RemoteMediaStreamImpl instance is created and | 25 // on a PeerConnection a RemoteMediaStreamImpl instance is created and |
26 // owned by RtcPeerConnection. | 26 // owned by RtcPeerConnection. |
27 class CONTENT_EXPORT RemoteMediaStreamImpl | 27 class CONTENT_EXPORT RemoteMediaStreamImpl |
28 : NON_EXPORTED_BASE(public webrtc::ObserverInterface), | 28 : NON_EXPORTED_BASE(public webrtc::ObserverInterface), |
29 NON_EXPORTED_BASE(public base::NonThreadSafe) { | 29 NON_EXPORTED_BASE(public base::NonThreadSafe) { |
30 public: | 30 public: |
31 explicit RemoteMediaStreamImpl( | 31 explicit RemoteMediaStreamImpl( |
32 webrtc::MediaStreamInterface* webrtc_stream); | 32 webrtc::MediaStreamInterface* webrtc_stream); |
33 virtual ~RemoteMediaStreamImpl(); | 33 virtual ~RemoteMediaStreamImpl(); |
34 | 34 |
35 const blink::WebMediaStream& webkit_stream() { return webkit_stream_; } | 35 const blink::WebMediaStream& webkit_stream() { return webkit_stream_; } |
36 | 36 |
37 private: | 37 private: |
38 // webrtc::ObserverInterface implementation. | 38 // webrtc::ObserverInterface implementation. |
39 virtual void OnChanged() OVERRIDE; | 39 virtual void OnChanged() OVERRIDE; |
40 | 40 |
41 scoped_refptr<webrtc::MediaStreamInterface> webrtc_stream_; | 41 scoped_refptr<webrtc::MediaStreamInterface> webrtc_stream_; |
42 ScopedVector<RemoteMediaStreamTrackObserver> audio_track_observers_; | 42 ScopedVector<RemoteMediaStreamTrackAdapter> video_track_observers_; |
43 ScopedVector<RemoteMediaStreamTrackObserver> video_track_observers_; | 43 ScopedVector<RemoteMediaStreamTrackAdapter> audio_track_observers_; |
44 blink::WebMediaStream webkit_stream_; | 44 blink::WebMediaStream webkit_stream_; |
45 | 45 |
46 DISALLOW_COPY_AND_ASSIGN(RemoteMediaStreamImpl); | 46 DISALLOW_COPY_AND_ASSIGN(RemoteMediaStreamImpl); |
47 }; | 47 }; |
48 | 48 |
49 } // namespace content | 49 } // namespace content |
50 | 50 |
51 #endif // CONTENT_RENDERER_MEDIA_REMOTE_MEDIA_STREAM_IMPL_H_ | 51 #endif // CONTENT_RENDERER_MEDIA_REMOTE_MEDIA_STREAM_IMPL_H_ |
OLD | NEW |