WebKit Bugzilla
Attachment 347214 Details for
Bug 187756
: Change the input camera in the sources & outputs example on Safari (11) with M.Way camera
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-187756-20180815153948.patch (text/plain), 4.74 KB, created by
youenn fablet
on 2018-08-15 15:39:49 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2018-08-15 15:39:49 PDT
Size:
4.74 KB
patch
obsolete
>Subversion Revision: 234848 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 6eb7da9f613a06de1b4518e02133c48f9bc75bcd..a943dedf025dd027def75716c695e0a71ad7c835 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,27 @@ >+2018-08-15 Youenn Fablet <youenn@apple.com> >+ >+ Change the input camera in the sources & outputs example on Safari (11) with M.Way camera >+ https://bugs.webkit.org/show_bug.cgi?id=187756 >+ <rdar://problem/42332178> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Covered by manual testing. >+ >+ 640x480x30fps is added as ideal constraints to getUserMedia if none other is added to provide consistent behavior. >+ Some cameras do not support 30fps as they have discrete frame rate ranges. >+ Before the patch, we were rejecting getUserMedia promise if the 'ideal' frameRate was not supported. >+ After the patch, we do not check whether frame rate is supported if it is not mandatory. >+ At capture time, we will still try to apply frame rate change and if not supported, the frame rate will not be set to 30 fps. >+ >+ While we could surface discrete width/height/frame rate ranges, it seems best to fix the issue this way. >+ In the future, we might implement video interpolation for width/height/framerate at WebCore level. >+ >+ * platform/mediastream/RealtimeMediaSource.cpp: >+ (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate): >+ (WebCore::RealtimeMediaSource::supportsConstraint const): >+ (WebCore::RealtimeMediaSource::supportsConstraints): >+ > 2018-08-14 Antoine Quint <graouts@apple.com> > > [Web Animations] Crash under AnimationTimeline::cancelOrRemoveDeclarativeAnimation() >diff --git a/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp b/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp >index bfe4d6de1c8340682a1f7ee29e8c94585fe0bce8..952119ccab319afc6f1a339e2812e0f6b9564da9 100644 >--- a/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp >+++ b/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp >@@ -246,8 +246,10 @@ bool RealtimeMediaSource::supportsSizeAndFrameRate(std::optional<IntConstraint> > } > > distance = std::min(distance, constraintDistance); >- auto range = capabilities.width(); >- width = widthConstraint->valueForCapabilityRange(size().width(), range.rangeMin().asInt, range.rangeMax().asInt); >+ if (widthConstraint->isMandatory()) { >+ auto range = capabilities.width(); >+ width = widthConstraint->valueForCapabilityRange(size().width(), range.rangeMin().asInt, range.rangeMax().asInt); >+ } > } > > std::optional<int> height; >@@ -259,8 +261,10 @@ bool RealtimeMediaSource::supportsSizeAndFrameRate(std::optional<IntConstraint> > } > > distance = std::min(distance, constraintDistance); >- auto range = capabilities.height(); >- height = heightConstraint->valueForCapabilityRange(size().height(), range.rangeMin().asInt, range.rangeMax().asInt); >+ if (heightConstraint->isMandatory()) { >+ auto range = capabilities.height(); >+ height = heightConstraint->valueForCapabilityRange(size().height(), range.rangeMin().asInt, range.rangeMax().asInt); >+ } > } > > std::optional<double> frameRate; >@@ -272,8 +276,10 @@ bool RealtimeMediaSource::supportsSizeAndFrameRate(std::optional<IntConstraint> > } > > distance = std::min(distance, constraintDistance); >- auto range = capabilities.frameRate(); >- frameRate = frameRateConstraint->valueForCapabilityRange(this->frameRate(), range.rangeMin().asDouble, range.rangeMax().asDouble); >+ if (frameRateConstraint->isMandatory()) { >+ auto range = capabilities.frameRate(); >+ frameRate = frameRateConstraint->valueForCapabilityRange(this->frameRate(), range.rangeMin().asDouble, range.rangeMax().asDouble); >+ } > } > > // Each of the non-null values is supported individually, see if they all can be applied at the same time. >@@ -286,7 +292,7 @@ bool RealtimeMediaSource::supportsSizeAndFrameRate(std::optional<IntConstraint> > badConstraint = frameRateConstraint->name(); > return false; > } >- >+ > return true; > } > >@@ -754,7 +760,7 @@ bool RealtimeMediaSource::supportsConstraint(const MediaConstraint& constraint) > // Unknown (or unsupported) constraints should be ignored. > break; > } >- >+ > return false; > } > >@@ -765,7 +771,7 @@ bool RealtimeMediaSource::supportsConstraints(const MediaConstraints& constraint > FlattenedConstraint candidates; > if (!selectSettings(constraints, candidates, invalidConstraint, SelectType::ForSupportsConstraints)) > return false; >- >+ > return true; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 187756
:
345245
| 347214 |
347265