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

Unified Diff: content/renderer/media/mock_media_stream_dependency_factory.cc

Issue 131763002: Adds MediaStreamSource, MediaStreamAudioSource and MediaStreamVideoCaptureDeviceSource (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/mock_media_stream_dependency_factory.cc
diff --git a/content/renderer/media/mock_media_stream_dependency_factory.cc b/content/renderer/media/mock_media_stream_dependency_factory.cc
index bdcb69aef60051ca067df9943af1e0bb703379c3..0fd8150639e90b31a58a075be1ef67373144655b 100644
--- a/content/renderer/media/mock_media_stream_dependency_factory.cc
+++ b/content/renderer/media/mock_media_stream_dependency_factory.cc
@@ -136,7 +136,7 @@ bool MockVideoRenderer::RenderFrame(const cricket::VideoFrame* frame) {
MockAudioSource::MockAudioSource(
const webrtc::MediaConstraintsInterface* constraints)
: observer_(NULL),
- state_(MediaSourceInterface::kInitializing),
+ state_(MediaSourceInterface::kLive),
optional_constraints_(constraints->GetOptional()),
mandatory_constraints_(constraints->GetMandatory()) {
}
@@ -152,21 +152,6 @@ void MockAudioSource::UnregisterObserver(webrtc::ObserverInterface* observer) {
observer_ = NULL;
}
-void MockAudioSource::SetLive() {
- DCHECK(state_ == MediaSourceInterface::kInitializing ||
- state_ == MediaSourceInterface::kLive);
- state_ = MediaSourceInterface::kLive;
- if (observer_)
- observer_->OnChanged();
-}
-
-void MockAudioSource::SetEnded() {
- DCHECK_NE(MediaSourceInterface::kEnded, state_);
- state_ = MediaSourceInterface::kEnded;
- if (observer_)
- observer_->OnChanged();
-}
-
webrtc::MediaSourceInterface::SourceState MockAudioSource::state() const {
return state_;
}
@@ -384,28 +369,17 @@ class MockIceCandidate : public IceCandidateInterface {
};
MockMediaStreamDependencyFactory::MockMediaStreamDependencyFactory()
- : MediaStreamDependencyFactory(NULL),
- mock_pc_factory_created_(false) {
+ : MediaStreamDependencyFactory(NULL) {
}
MockMediaStreamDependencyFactory::~MockMediaStreamDependencyFactory() {}
-bool MockMediaStreamDependencyFactory::EnsurePeerConnectionFactory() {
- mock_pc_factory_created_ = true;
- return true;
-}
-
-bool MockMediaStreamDependencyFactory::PeerConnectionFactoryCreated() {
- return mock_pc_factory_created_;
-}
-
scoped_refptr<webrtc::PeerConnectionInterface>
MockMediaStreamDependencyFactory::CreatePeerConnection(
const webrtc::PeerConnectionInterface::IceServers& ice_servers,
const webrtc::MediaConstraintsInterface* constraints,
blink::WebFrame* frame,
webrtc::PeerConnectionObserver* observer) {
- DCHECK(mock_pc_factory_created_);
return new talk_base::RefCountedObject<MockPeerConnectionImpl>(this);
}
@@ -417,13 +391,9 @@ MockMediaStreamDependencyFactory::CreateLocalAudioSource(
return last_audio_source_;
}
-scoped_refptr<webrtc::VideoSourceInterface>
-MockMediaStreamDependencyFactory::CreateLocalVideoSource(
- int video_session_id,
- bool is_screencast,
- const webrtc::MediaConstraintsInterface* constraints) {
- last_video_source_ = new talk_base::RefCountedObject<MockVideoSource>();
- return last_video_source_;
+cricket::VideoCapturer* MockMediaStreamDependencyFactory::CreateVideoCapturer(
+ const StreamDeviceInfo& info) {
+ return NULL;
}
scoped_refptr<webrtc::VideoSourceInterface>
@@ -445,7 +415,6 @@ MockMediaStreamDependencyFactory::CreateWebAudioSource(
scoped_refptr<webrtc::MediaStreamInterface>
MockMediaStreamDependencyFactory::CreateLocalMediaStream(
const std::string& label) {
- DCHECK(mock_pc_factory_created_);
return new talk_base::RefCountedObject<MockMediaStream>(label);
}
@@ -453,7 +422,6 @@ scoped_refptr<webrtc::VideoTrackInterface>
MockMediaStreamDependencyFactory::CreateLocalVideoTrack(
const std::string& id,
webrtc::VideoSourceInterface* source) {
- DCHECK(mock_pc_factory_created_);
scoped_refptr<webrtc::VideoTrackInterface> track(
new talk_base::RefCountedObject<MockLocalVideoTrack>(
id, source));
@@ -464,8 +432,6 @@ scoped_refptr<webrtc::VideoTrackInterface>
MockMediaStreamDependencyFactory::CreateLocalVideoTrack(
const std::string& id,
cricket::VideoCapturer* capturer) {
- DCHECK(mock_pc_factory_created_);
-
scoped_refptr<MockVideoSource> source =
new talk_base::RefCountedObject<MockVideoSource>();
source->SetVideoCapturer(capturer);
@@ -479,7 +445,6 @@ MockMediaStreamDependencyFactory::CreateLocalAudioTrack(
const scoped_refptr<WebRtcAudioCapturer>& capturer,
WebAudioCapturerSource* webaudio_source,
webrtc::AudioSourceInterface* source) {
- DCHECK(mock_pc_factory_created_);
blink::WebMediaConstraints constraints;
scoped_refptr<WebRtcAudioCapturer> audio_capturer = capturer ?
capturer : WebRtcAudioCapturer::CreateCapturer(-1, StreamDeviceInfo(),
« no previous file with comments | « content/renderer/media/mock_media_stream_dependency_factory.h ('k') | content/renderer/media/rtc_peer_connection_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698