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

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

Issue 129923002: Implements MediaStreamVideoSource. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implements MediaStreamVideoSource. 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.h
===================================================================
--- content/renderer/media/mock_media_stream_dependency_factory.h (revision 244998)
+++ content/renderer/media/mock_media_stream_dependency_factory.h (working copy)
@@ -11,11 +11,29 @@
#include "base/compiler_specific.h"
#include "content/renderer/media/media_stream_dependency_factory.h"
#include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface.h"
+#include "third_party/libjingle/source/talk/media/base/videorenderer.h"
namespace content {
class WebAudioCapturerSource;
+class MockVideoRenderer : public cricket::VideoRenderer {
+ public:
+ MockVideoRenderer();
+ virtual ~MockVideoRenderer();
+ virtual bool SetSize(int width, int height, int reserved) OVERRIDE;
+ virtual bool RenderFrame(const cricket::VideoFrame* frame) OVERRIDE;
+
+ int width() const { return width_; }
+ int height() const { return height_; }
+ int num() const { return num_; }
+
+ private:
+ int width_;
+ int height_;
+ int num_;
+};
+
class MockVideoSource : public webrtc::VideoSourceInterface {
public:
MockVideoSource();
@@ -36,6 +54,11 @@
// Set the video capturer.
void SetVideoCapturer(cricket::VideoCapturer* capturer);
+ // Test helpers.
+ int GetLastFrameWidth() const { return renderer_.width(); }
+ int GetLastFrameHeight() const { return renderer_.height(); }
+ int GetFrameNum() const { return renderer_.num(); }
+
protected:
virtual ~MockVideoSource();
@@ -45,6 +68,7 @@
std::vector<webrtc::ObserverInterface*> observers_;
MediaSourceInterface::SourceState state_;
scoped_ptr<cricket::VideoCapturer> capturer_;
+ MockVideoRenderer renderer_;
};
class MockAudioSource : public webrtc::AudioSourceInterface {
@@ -128,6 +152,10 @@
int video_session_id,
bool is_screencast,
const webrtc::MediaConstraintsInterface* constraints) OVERRIDE;
+ virtual scoped_refptr<webrtc::VideoSourceInterface>
+ CreateVideoSource(
+ cricket::VideoCapturer* capturer,
+ const webrtc::MediaConstraintsInterface* constraints) OVERRIDE;
virtual scoped_refptr<WebAudioCapturerSource> CreateWebAudioSource(
blink::WebMediaStreamSource* source,
const RTCMediaConstraints& constraints) OVERRIDE;

Powered by Google App Engine
This is Rietveld 408576698