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

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

Issue 183113004: Make sure MediaStreamVideoSource support cropping. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/media_stream_video_source.h
diff --git a/content/renderer/media/media_stream_video_source.h b/content/renderer/media/media_stream_video_source.h
index 6f4fc442aafaa4621ba7f6d05ad6b47f1a730cd8..ef203cb5086d880b78a4b019da49149b45eb0ca1 100644
--- a/content/renderer/media/media_stream_video_source.h
+++ b/content/renderer/media/media_stream_video_source.h
@@ -12,6 +12,7 @@
#include "content/renderer/media/media_stream_dependency_factory.h"
#include "content/renderer/media/media_stream_source.h"
#include "media/base/video_frame.h"
+#include "media/base/video_frame_pool.h"
#include "media/video/capture/video_capture_types.h"
#include "third_party/WebKit/public/platform/WebMediaConstraints.h"
#include "third_party/WebKit/public/platform/WebMediaStreamSource.h"
@@ -118,11 +119,13 @@ class CONTENT_EXPORT MediaStreamVideoSource
// Finds the first constraints in |requested_constraints_| that can be
// fulfilled. |best_format| is set to the video resolution that can be
- // fulfilled. |resulting_constraints| is set to the found constraints in
+ // fulfilled. |frame_output_size| is the requested frame size after cropping.
+ // |resulting_constraints| is set to the found constraints in
// |requested_constraints_|.
bool FindBestFormatWithConstraints(
const media::VideoCaptureFormats& formats,
media::VideoCaptureFormat* best_format,
+ gfx::Size* frame_output_size,
blink::WebMediaConstraints* resulting_constraints);
// Trigger all cached callbacks from AddTrack. AddTrack is successful
@@ -141,6 +144,7 @@ class CONTENT_EXPORT MediaStreamVideoSource
media::VideoCaptureFormat current_format_;
blink::WebMediaConstraints current_constraints_;
+ gfx::Size frame_output_size_;
struct RequestedConstraints {
RequestedConstraints(const blink::WebMediaConstraints& constraints,
@@ -154,6 +158,9 @@ class CONTENT_EXPORT MediaStreamVideoSource
media::VideoCaptureFormats supported_formats_;
+
+ // Video frame pool used if cropping is needed.
+ media::VideoFramePool frame_pool_;
// TODO(perkj): The below classes use webrtc/libjingle types. The goal is to
// get rid of them as far as possible.
MediaStreamDependencyFactory* factory_;

Powered by Google App Engine
This is Rietveld 408576698