Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: content/renderer/media/media_stream_source_extra_data.h

Issue 14346002: Connect webrtc MediaSourceInterface ready states with webkit WebMediaStreamSource (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_MEDIA_STREAM_SOURCE_EXTRA_DATA_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_SOURCE_EXTRA_DATA_H_
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_SOURCE_EXTRA_DATA_H_ 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_SOURCE_EXTRA_DATA_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "content/common/content_export.h" 9 #include "content/common/content_export.h"
10 #include "content/common/media/media_stream_options.h" 10 #include "content/common/media/media_stream_options.h"
11 #include "content/renderer/media/media_stream_source_observer.h"
11 #include "media/base/audio_capturer_source.h" 12 #include "media/base/audio_capturer_source.h"
12 #include "third_party/libjingle/source/talk/app/webrtc/videosourceinterface.h" 13 #include "third_party/libjingle/source/talk/app/webrtc/videosourceinterface.h"
13 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamSourc e.h" 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStreamSourc e.h"
14 15
15 namespace content { 16 namespace content {
16 17
17 class CONTENT_EXPORT MediaStreamSourceExtraData 18 class CONTENT_EXPORT MediaStreamSourceExtraData
18 : NON_EXPORTED_BASE(public WebKit::WebMediaStreamSource::ExtraData) { 19 : NON_EXPORTED_BASE(public WebKit::WebMediaStreamSource::ExtraData) {
19 public: 20 public:
20 21
21 explicit MediaStreamSourceExtraData( 22 explicit MediaStreamSourceExtraData(
22 const StreamDeviceInfo& device_info); 23 const StreamDeviceInfo& device_info);
23 explicit MediaStreamSourceExtraData( 24 explicit MediaStreamSourceExtraData(
24 media::AudioCapturerSource* source); 25 media::AudioCapturerSource* source);
25 virtual ~MediaStreamSourceExtraData(); 26 virtual ~MediaStreamSourceExtraData();
26 27
27 // Return device information about the camera or microphone. 28 // Return device information about the camera or microphone.
28 const StreamDeviceInfo& device_info() const { 29 const StreamDeviceInfo& device_info() const {
29 return device_info_; 30 return device_info_;
30 } 31 }
31 32
32 void SetVideoSource(webrtc::VideoSourceInterface* source) { 33 void SetVideoSource(webrtc::VideoSourceInterface* source) {
33 video_source_ = source; 34 video_source_ = source;
34 } 35 }
35 36
36 void SetLocalAudioSource(webrtc::AudioSourceInterface* source) { 37 void SetLocalAudioSource(webrtc::AudioSourceInterface* source) {
37 local_audio_source_ = source; 38 local_audio_source_ = source;
38 } 39 }
39 40
41 void SetSourceObserver(MediaStreamSourceObserver* observer) {
42 source_observer_.reset(observer);
tommi (sloooow) - chröme 2013/04/23 09:50:55 If the observer interface is implemented by an own
43 }
44
40 webrtc::VideoSourceInterface* video_source() { return video_source_; } 45 webrtc::VideoSourceInterface* video_source() { return video_source_; }
41 media::AudioCapturerSource* audio_source() { return audio_source_; } 46 media::AudioCapturerSource* audio_source() { return audio_source_; }
42 webrtc::AudioSourceInterface* local_audio_source() { 47 webrtc::AudioSourceInterface* local_audio_source() {
43 return local_audio_source_; 48 return local_audio_source_;
44 } 49 }
45 50
46 private: 51 private:
47 StreamDeviceInfo device_info_; 52 StreamDeviceInfo device_info_;
48 scoped_refptr<webrtc::VideoSourceInterface> video_source_; 53 scoped_refptr<webrtc::VideoSourceInterface> video_source_;
49 scoped_refptr<media::AudioCapturerSource> audio_source_; 54 scoped_refptr<media::AudioCapturerSource> audio_source_;
50 55
51 // This member holds an instance of webrtc::LocalAudioSource. This is used 56 // This member holds an instance of webrtc::LocalAudioSource. This is used
52 // as a container for audio options. 57 // as a container for audio options.
53 // TODO(hclam): This should be merged with |audio_source_| such that it 58 // TODO(hclam): This should be merged with |audio_source_| such that it
54 // carries audio options. 59 // carries audio options.
55 scoped_refptr<webrtc::AudioSourceInterface> local_audio_source_; 60 scoped_refptr<webrtc::AudioSourceInterface> local_audio_source_;
61 scoped_ptr<MediaStreamSourceObserver> source_observer_;
56 62
57 DISALLOW_COPY_AND_ASSIGN(MediaStreamSourceExtraData); 63 DISALLOW_COPY_AND_ASSIGN(MediaStreamSourceExtraData);
58 }; 64 };
59 65
60 } // namespace content 66 } // namespace content
61 67
62 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_SOURCE_EXTRA_DATA_H_ 68 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_SOURCE_EXTRA_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698