summaryrefslogtreecommitdiffstats
path: root/content/renderer/media/media_stream_video_source.h
diff options
context:
space:
mode:
authormiu <miu@chromium.org>2015-05-09 15:17:15 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-09 22:17:45 +0000
commitf79202747a089a00f653e5827409c779395bda70 (patch)
treed2818030a1838573579d94e5727cb29786855b88 /content/renderer/media/media_stream_video_source.h
parent238eaa368547ea4a87f5ea605c927e9013d3da92 (diff)
downloadchromium_src-f79202747a089a00f653e5827409c779395bda70.zip
chromium_src-f79202747a089a00f653e5827409c779395bda70.tar.gz
chromium_src-f79202747a089a00f653e5827409c779395bda70.tar.bz2
New resolution change policies for desktop and tab capture.
This change replaces the "fixed" versus "variable" resolution change policies with a 3-tier set: fixed, variable with fixed aspect ratio, and variable at any aspect ratio. This allows users of the desktop and tab capture APIs to specify minimum and maximum resolutions, and from those, a resolution change policy is determined. The policy is used by the desktop and tab capture implementation to activate or disable sender-side letterboxing of screen-capture content. BUG=473336 NOPRESUBMIT=true NOTRY=true Review URL: https://codereview.chromium.org/1124263004 Cr-Commit-Position: refs/heads/master@{#329056}
Diffstat (limited to 'content/renderer/media/media_stream_video_source.h')
-rw-r--r--content/renderer/media/media_stream_video_source.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/content/renderer/media/media_stream_video_source.h b/content/renderer/media/media_stream_video_source.h
index 3e2cbff..496bb85 100644
--- a/content/renderer/media/media_stream_video_source.h
+++ b/content/renderer/media/media_stream_video_source.h
@@ -70,7 +70,7 @@ class CONTENT_EXPORT MediaStreamVideoSource
static const char kMinAspectRatio[]; // minAspectRatio
static const char kMaxAspectRatio[]; // maxAspectRatio
static const char kMaxWidth[]; // maxWidth
- static const char kMinWidth[]; // minWidthOnCaptureFormats
+ static const char kMinWidth[]; // minWidth
static const char kMaxHeight[]; // maxHeight
static const char kMinHeight[]; // minHeight
static const char kMaxFrameRate[]; // maxFrameRate
@@ -107,12 +107,15 @@ class CONTENT_EXPORT MediaStreamVideoSource
double max_requested_frame_rate,
const VideoCaptureDeviceFormatsCB& callback) = 0;
- // An implementation must start capture frames using the resolution in
- // |params|. When the source has started or the source failed to start
- // OnStartDone must be called. An implementation must call
- // |frame_callback| on the IO thread with the captured frames.
+ // An implementation must start capturing frames using the requested
+ // |format|. The fulfilled |constraints| are provided as additional context,
+ // and may be used to modify the behavior of the source. When the source has
+ // started or the source failed to start OnStartDone must be called. An
+ // implementation must call |frame_callback| on the IO thread with the
+ // captured frames.
virtual void StartSourceImpl(
const media::VideoCaptureFormat& format,
+ const blink::WebMediaConstraints& constraints,
const VideoCaptureDeliverFrameCB& frame_callback) = 0;
void OnStartDone(MediaStreamRequestResult result);
@@ -133,12 +136,14 @@ class CONTENT_EXPORT MediaStreamVideoSource
private:
void OnSupportedFormats(const media::VideoCaptureFormats& formats);
- // Finds the first constraints in |requested_constraints_| that can be
- // fulfilled. |best_format| is set to the video resolution that can be
- // fulfilled.
+ // Finds the first WebMediaConstraints in |requested_constraints_| that allows
+ // the use of one of the |formats|. |best_format| and |fulfilled_constraints|
+ // are set to the results of this search-and-match operation. Returns false
+ // if no WebMediaConstraints allow the use any of the |formats|.
bool FindBestFormatWithConstraints(
const media::VideoCaptureFormats& formats,
- media::VideoCaptureFormat* best_format);
+ media::VideoCaptureFormat* best_format,
+ blink::WebMediaConstraints* fulfilled_constraints);
// Trigger all cached callbacks from AddTrack. AddTrack is successful
// if the capture delegate has started and the constraints provided in