WebKit Bugzilla
Attachment 359084 Details for
Bug 193412
: Correctly handle rotation for local video playback
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193412-20190114153143.patch (text/plain), 4.56 KB, created by
youenn fablet
on 2019-01-14 15:31:43 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2019-01-14 15:31:43 PST
Size:
4.56 KB
patch
obsolete
>Subversion Revision: 239774 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 63394d701f2531582bcb2ddc2a6d087d7b10b596..72d5cb49dcffa5d10ad4b68fbcf5ab00b4c7df7f 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2019-01-14 Youenn Fablet <youenn@apple.com> >+ >+ Correctly handle rotation for local video playback >+ https://bugs.webkit.org/show_bug.cgi?id=193412 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update AVVideoCaptureSource to compute the size given to settings after rotating the sample. >+ This ensures computing the size of video elements appropriately. >+ Also makes sure to notify observers of size change whenever rotation happens as settings() call will provide a different size. >+ Covered by manual testing as we do not have yet emulation of local capture with rotation. >+ >+ * platform/mediastream/RealtimeMediaSource.cpp: >+ (WebCore::RealtimeMediaSource::setIntrinsicSize): >+ * platform/mediastream/mac/AVVideoCaptureSource.mm: >+ (WebCore::AVVideoCaptureSource::settings): >+ (WebCore::AVVideoCaptureSource::computeSampleRotation): >+ > 2019-01-09 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC][MarginCollapsing] Add support for peculiar cases. >diff --git a/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp b/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp >index e4e5a9880fe4dd697c8a2299c4b26ec4de11a8ac..96cf5d99c3bb25e29c2f6bb396c8b5b802679196 100644 >--- a/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp >+++ b/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp >@@ -890,9 +890,10 @@ void RealtimeMediaSource::setIntrinsicSize(const IntSize& size) > if (m_intrinsicSize == size) > return; > >+ auto currentSize = this->size(); > m_intrinsicSize = size; > >- if (m_intrinsicSize != m_size) >+ if (currentSize != this->size()) > notifySettingsDidChangeObservers({ RealtimeMediaSourceSettings::Flag::Width, RealtimeMediaSourceSettings::Flag::Height }); > } > >diff --git a/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm b/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm >index 8a00f04517d973f9d5bc7d3a8d3e35f536fed05b..16bb821539f05cda2b495d98244b76909fd1a8e6 100644 >--- a/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm >+++ b/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm >@@ -260,7 +260,11 @@ const RealtimeMediaSourceSettings& AVVideoCaptureSource::settings() > settings.setFacingMode(RealtimeMediaSourceSettings::Unknown); > > settings.setFrameRate(frameRate()); >- auto& size = this->size(); >+ >+ auto size = this->size(); >+ if (m_sampleRotation == MediaSample::VideoRotation::Left || m_sampleRotation == MediaSample::VideoRotation::Right) >+ size = size.transposedSize(); >+ > settings.setWidth(size.width()); > settings.setHeight(size.height()); > settings.setDeviceId(hashedId()); >@@ -501,25 +505,31 @@ void AVVideoCaptureSource::orientationChanged(int orientation) > void AVVideoCaptureSource::computeSampleRotation() > { > bool frontCamera = [device() position] == AVCaptureDevicePositionFront; >+ MediaSample::VideoRotation sampleRotation; > switch (m_sensorOrientation - m_deviceOrientation) { > case 0: >- m_sampleRotation = MediaSample::VideoRotation::None; >+ sampleRotation = MediaSample::VideoRotation::None; > break; > case 180: > case -180: >- m_sampleRotation = MediaSample::VideoRotation::UpsideDown; >+ sampleRotation = MediaSample::VideoRotation::UpsideDown; > break; > case 90: >- m_sampleRotation = frontCamera ? MediaSample::VideoRotation::Left : MediaSample::VideoRotation::Right; >+ sampleRotation = frontCamera ? MediaSample::VideoRotation::Left : MediaSample::VideoRotation::Right; > break; > case -90: > case -270: >- m_sampleRotation = frontCamera ? MediaSample::VideoRotation::Right : MediaSample::VideoRotation::Left; >+ sampleRotation = frontCamera ? MediaSample::VideoRotation::Right : MediaSample::VideoRotation::Left; > break; > default: > ASSERT_NOT_REACHED(); >- m_sampleRotation = MediaSample::VideoRotation::None; >+ sampleRotation = MediaSample::VideoRotation::None; > } >+ if (sampleRotation == m_sampleRotation) >+ return; >+ >+ m_sampleRotation = sampleRotation; >+ notifySettingsDidChangeObservers({ RealtimeMediaSourceSettings::Flag::Width, RealtimeMediaSourceSettings::Flag::Height }); > } > > void AVVideoCaptureSource::processNewFrame(Ref<MediaSample>&& sample)
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 193412
: 359084