Bug 171284 - getUserMedia video streams should follow device orientation
Summary: getUserMedia video streams should follow device orientation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-04-25 12:52 PDT by youenn fablet
Modified: 2017-04-28 17:39 PDT (History)
7 users (show)

See Also:


Attachments
Patch (74.14 KB, patch)
2017-04-25 14:49 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (74.34 KB, patch)
2017-04-25 15:51 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (74.38 KB, patch)
2017-04-25 16:24 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Fixing GTK build (76.27 KB, patch)
2017-04-26 11:30 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (81.97 KB, patch)
2017-04-27 16:16 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (80.31 KB, patch)
2017-04-27 16:22 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (78.61 KB, patch)
2017-04-27 16:42 PDT, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (78.07 KB, patch)
2017-04-28 14:34 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2017-04-25 12:52:34 PDT
Following orientation allows keeping the camera capturing the scene even if rotating the device.
Comment 1 youenn fablet 2017-04-25 14:49:24 PDT
Created attachment 308150 [details]
Patch
Comment 2 youenn fablet 2017-04-25 14:58:54 PDT
(In reply to youenn fablet from comment #1)
> Created attachment 308150 [details]
> Patch

WIP doing also some refactoring in the capture factories.
Comment 3 youenn fablet 2017-04-25 15:51:22 PDT
Created attachment 308154 [details]
Patch
Comment 4 youenn fablet 2017-04-25 16:24:04 PDT
Created attachment 308161 [details]
Patch
Comment 5 Build Bot 2017-04-25 16:25:28 PDT
Attachment 308161 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/mediastream/RealtimeMediaSource.h:247:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebCore/platform/mediastream/RealtimeMediaSource.h:248:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
Total errors found: 2 in 38 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 youenn fablet 2017-04-26 11:30:30 PDT
Created attachment 308271 [details]
Fixing GTK build
Comment 7 youenn fablet 2017-04-26 11:31:38 PDT
(In reply to youenn fablet from comment #6)
> Created attachment 308271 [details]
> Fixing GTK build

orientation adaptation in AVVideoCaptureSource is untested and probably broken now. Will do some manual testing. Interested in feedback on the overall design and refactoring.
Comment 8 Build Bot 2017-04-26 11:33:24 PDT
Attachment 308271 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/mediastream/RealtimeMediaSource.h:247:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebCore/platform/mediastream/RealtimeMediaSource.h:248:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
Total errors found: 2 in 39 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Jon Lee 2017-04-26 13:30:42 PDT
<rdar://problem/31671907>
Comment 10 youenn fablet 2017-04-27 16:16:47 PDT
Created attachment 308470 [details]
Patch
Comment 11 youenn fablet 2017-04-27 16:22:03 PDT
Created attachment 308472 [details]
Patch
Comment 12 Build Bot 2017-04-27 16:24:42 PDT
Attachment 308472 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm:467:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/WebCore/platform/mediastream/RealtimeMediaSource.h:247:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebCore/platform/mediastream/RealtimeMediaSource.h:248:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
Total errors found: 3 in 39 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 13 youenn fablet 2017-04-27 16:42:54 PDT
Created attachment 308475 [details]
Patch
Comment 14 Build Bot 2017-04-27 16:46:14 PDT
Attachment 308475 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm:467:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/WebCore/platform/mediastream/RealtimeMediaSource.h:247:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebCore/platform/mediastream/RealtimeMediaSource.h:248:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
Total errors found: 3 in 38 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 15 Eric Carlson 2017-04-28 10:58:49 PDT
Comment on attachment 308475 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=308475&action=review

> Source/WebCore/platform/mediastream/RealtimeMediaSource.h:250
> +    operator bool()  const { return !!captureSource; }

Is the "!!" necessary?

> Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:167
> +    // FIXME: Do something with m_deviceOrientation

Nit: you could not that this is https://bugs.webkit.org/show_bug.cgi?id=169822.

> Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:140
> +        if (!!audioSource)

Why is the "!!" necessary since CaptureSourceOrError has an operator bool()?

> Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:149
> +        if (!!videoSource)

Ditto.

> Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp:91
> +            if (!!sourceOrError && sourceOrError.captureSource->supportsConstraints(audioConstraints, invalidConstraint))

Ditto.

> Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp:139
> +            if (!!sourceOrError)

Ditto.

> Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp:143
> +            if (!!sourceOrError)

Ditto.

> Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp:152
> +            if (!!sourceOrError)

Ditto.

> Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp:156
> +            if (!!sourceOrError)

Ditto.

> Source/WebKit2/UIProcess/Cocoa/UserMediaCaptureManagerProxy.cpp:144
> +    succeeded = !!sourceOrError;

Ditto.

> Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp:101
> -    ASSERT(!idToHistoryItemMap().contains(itemID));
> +//    ASSERT(!idToHistoryItemMap().contains(itemID));

Oops!
Comment 16 youenn fablet 2017-04-28 14:34:38 PDT
Created attachment 308597 [details]
Patch for landing
Comment 17 Build Bot 2017-04-28 14:38:09 PDT
Attachment 308597 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm:467:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/WebCore/platform/mediastream/RealtimeMediaSource.h:247:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
ERROR: Source/WebCore/platform/mediastream/RealtimeMediaSource.h:248:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent] [4]
Total errors found: 3 in 38 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 18 WebKit Commit Bot 2017-04-28 16:26:35 PDT
Comment on attachment 308597 [details]
Patch for landing

Clearing flags on attachment: 308597

Committed r215955: <http://trac.webkit.org/changeset/215955>
Comment 19 WebKit Commit Bot 2017-04-28 16:26:37 PDT
All reviewed patches have been landed.  Closing bug.
Comment 20 youenn fablet 2017-04-28 17:39:42 PDT
Thanks for the review.
I took all of it in https://bugs.webkit.org/show_bug.cgi?id=171466

> > Source/WebCore/platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:167
> > +    // FIXME: Do something with m_deviceOrientation
> 
> Nit: you could not that this is
> https://bugs.webkit.org/show_bug.cgi?id=169822.

Done

> > Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:140
> > +        if (!!audioSource)
> 
> Why is the "!!" necessary since CaptureSourceOrError has an operator bool()?

Done for all these.


> > Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp:101
> > -    ASSERT(!idToHistoryItemMap().contains(itemID));
> > +//    ASSERT(!idToHistoryItemMap().contains(itemID));
> 
> Oops!

Fixed.