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

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

Issue 218763007: Update MediaStreamTrack::Stop to latest draft. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 6 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 | Annotate | Revision Log
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_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_
6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ 6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 private: 100 private:
101 webrtc::ObserverInterface* observer_; 101 webrtc::ObserverInterface* observer_;
102 MediaSourceInterface::SourceState state_; 102 MediaSourceInterface::SourceState state_;
103 webrtc::MediaConstraintsInterface::Constraints optional_constraints_; 103 webrtc::MediaConstraintsInterface::Constraints optional_constraints_;
104 webrtc::MediaConstraintsInterface::Constraints mandatory_constraints_; 104 webrtc::MediaConstraintsInterface::Constraints mandatory_constraints_;
105 }; 105 };
106 106
107 class MockWebRtcVideoTrack : public webrtc::VideoTrackInterface { 107 class MockWebRtcVideoTrack : public webrtc::VideoTrackInterface {
108 public: 108 public:
109 MockWebRtcVideoTrack(std::string id, 109 MockWebRtcVideoTrack(const std::string& id,
110 webrtc::VideoSourceInterface* source); 110 webrtc::VideoSourceInterface* source);
111 virtual void AddRenderer(webrtc::VideoRendererInterface* renderer) OVERRIDE; 111 virtual void AddRenderer(webrtc::VideoRendererInterface* renderer) OVERRIDE;
112 virtual void RemoveRenderer( 112 virtual void RemoveRenderer(
113 webrtc::VideoRendererInterface* renderer) OVERRIDE; 113 webrtc::VideoRendererInterface* renderer) OVERRIDE;
114 virtual std::string kind() const OVERRIDE; 114 virtual std::string kind() const OVERRIDE;
115 virtual std::string id() const OVERRIDE; 115 virtual std::string id() const OVERRIDE;
116 virtual bool enabled() const OVERRIDE; 116 virtual bool enabled() const OVERRIDE;
117 virtual TrackState state() const OVERRIDE; 117 virtual TrackState state() const OVERRIDE;
118 virtual bool set_enabled(bool enable) OVERRIDE; 118 virtual bool set_enabled(bool enable) OVERRIDE;
119 virtual bool set_state(TrackState new_state) OVERRIDE; 119 virtual bool set_state(TrackState new_state) OVERRIDE;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 const std::string& type, 200 const std::string& type,
201 const std::string& sdp, 201 const std::string& sdp,
202 webrtc::SdpParseError* error) OVERRIDE; 202 webrtc::SdpParseError* error) OVERRIDE;
203 virtual webrtc::IceCandidateInterface* CreateIceCandidate( 203 virtual webrtc::IceCandidateInterface* CreateIceCandidate(
204 const std::string& sdp_mid, 204 const std::string& sdp_mid,
205 int sdp_mline_index, 205 int sdp_mline_index,
206 const std::string& sdp) OVERRIDE; 206 const std::string& sdp) OVERRIDE;
207 207
208 virtual scoped_refptr<WebRtcAudioCapturer> CreateAudioCapturer( 208 virtual scoped_refptr<WebRtcAudioCapturer> CreateAudioCapturer(
209 int render_view_id, const StreamDeviceInfo& device_info, 209 int render_view_id, const StreamDeviceInfo& device_info,
210 const blink::WebMediaConstraints& constraints) OVERRIDE; 210 const blink::WebMediaConstraints& constraints,
211 MediaStreamAudioSource* audio_source) OVERRIDE;
212 void FailToCreateNextAudioCapturer() {
213 fail_to_create_next_audio_capturer_ = true;
214 }
211 215
212 virtual void StartLocalAudioTrack( 216 virtual void StartLocalAudioTrack(
213 WebRtcLocalAudioTrack* audio_track) OVERRIDE; 217 WebRtcLocalAudioTrack* audio_track) OVERRIDE;
214 218
215 MockAudioSource* last_audio_source() { return last_audio_source_.get(); } 219 MockAudioSource* last_audio_source() { return last_audio_source_.get(); }
216 MockVideoSource* last_video_source() { return last_video_source_.get(); } 220 MockVideoSource* last_video_source() { return last_video_source_.get(); }
217 221
218 private: 222 private:
223 bool fail_to_create_next_audio_capturer_;
219 scoped_refptr <MockAudioSource> last_audio_source_; 224 scoped_refptr <MockAudioSource> last_audio_source_;
220 scoped_refptr <MockVideoSource> last_video_source_; 225 scoped_refptr <MockVideoSource> last_video_source_;
221 226
222 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDependencyFactory); 227 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDependencyFactory);
223 }; 228 };
224 229
225 } // namespace content 230 } // namespace content
226 231
227 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ 232 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698