WebKit Bugzilla
Attachment 372165 Details for
Bug 198875
: [MediaStream] Avoid roundoff error when setting AVCapture min/max frame rate
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198875-20190614190626.patch (text/plain), 5.01 KB, created by
Eric Carlson
on 2019-06-14 19:06:26 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eric Carlson
Created:
2019-06-14 19:06:26 PDT
Size:
5.01 KB
patch
obsolete
>Subversion Revision: 246201 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index ab9b3920492658ff0b8b04957dffec91f6c2aa92..7cf0184d92c6baf8272f3d274b4f806edfa34de0 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,15 @@ >+2019-06-14 Eric Carlson <eric.carlson@apple.com> >+ >+ [MediaStream] Avoid roundoff error when setting AVCapture min/max frame rate >+ https://bugs.webkit.org/show_bug.cgi?id=198875 >+ <rdar://problem/51768374> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wtf/MediaTime.h: >+ (WTF::LogArgument<MediaTime>::toString): >+ (WTF::LogArgument<MediaTimeRange>::toString): >+ > 2019-06-06 Caio Lima <ticaiolima@gmail.com> > > [JSCOnly] JSCOnly port is not building on macOS >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index af9788cdfc6cc4d724952e7d81ab9a7f218133e2..8db2e9959d201fcba75bcf9ab39262cb429d9436 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2019-06-14 Eric Carlson <eric.carlson@apple.com> >+ >+ [MediaStream] Avoid roundoff error when setting AVCapture min/max frame rate >+ https://bugs.webkit.org/show_bug.cgi?id=198875 >+ <rdar://problem/51768374> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * platform/graphics/MediaPlayer.h: >+ (WTF::LogArgument<MediaTime>::toString): Deleted, moved to MediaTime.h. >+ (WTF::LogArgument<MediaTimeRange>::toString): Deleted, moved to MediaTime.h. >+ >+ * platform/mediastream/mac/AVVideoCaptureSource.mm: >+ (WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate): Avoid roundoff error. >+ > 2019-06-07 Joonghun Park <jh718.park@samsung.com> > > Unreviewed. Use const TabSize& instead of TabSize to avoid unnecessary copy. >diff --git a/Source/WTF/wtf/MediaTime.h b/Source/WTF/wtf/MediaTime.h >index b3478fe9c0c063b857f0a30924eb1acc3c799eae..442d5ec1cc99c6ef69730339906fb8a15006cbc9 100644 >--- a/Source/WTF/wtf/MediaTime.h >+++ b/Source/WTF/wtf/MediaTime.h >@@ -174,6 +174,25 @@ bool MediaTime::decode(Decoder& decoder, MediaTime& time) > && decoder.decode(time.m_timeFlags); > } > >+template<typename Type> >+struct LogArgument; >+ >+template <> >+struct LogArgument<MediaTime> { >+ static String toString(const MediaTime& time) >+ { >+ return time.toJSONString(); >+ } >+}; >+ >+template <> >+struct LogArgument<MediaTimeRange> { >+ static String toString(const MediaTimeRange& range) >+ { >+ return range.toJSONString(); >+ } >+}; >+ > } > > using WTF::MediaTime; >diff --git a/Source/WebCore/platform/graphics/MediaPlayer.h b/Source/WebCore/platform/graphics/MediaPlayer.h >index 3e1263bbb63a387fe2c2fb4e16d0d07f7fce6de6..0ec33062b6f9461b6b3578744fc21f424a04c555 100644 >--- a/Source/WebCore/platform/graphics/MediaPlayer.h >+++ b/Source/WebCore/platform/graphics/MediaPlayer.h >@@ -632,27 +632,4 @@ public: > > } // namespace WebCore > >-namespace WTF { >- >-template<typename Type> >-struct LogArgument; >- >-template <> >-struct LogArgument<MediaTime> { >- static String toString(const MediaTime& time) >- { >- return time.toJSONString(); >- } >-}; >- >-template <> >-struct LogArgument<MediaTimeRange> { >- static String toString(const MediaTimeRange& range) >- { >- return range.toJSONString(); >- } >-}; >- >-} >- > #endif // ENABLE(VIDEO) >diff --git a/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm b/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm >index ef6db171732560eb36a48afb97502ace180d4e08..ff5d928b4019087d4a48d35a7ac029c24b782413 100644 >--- a/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm >+++ b/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm >@@ -327,9 +327,16 @@ void AVVideoCaptureSource::setSessionSizeAndFrameRate() > if (frameRateRange) { > m_currentFrameRate = clampTo(m_currentFrameRate, frameRateRange.minFrameRate, frameRateRange.maxFrameRate); > >- ALWAYS_LOG_IF(loggerPtr(), LOGIDENTIFIER, "setting frame rate to ", m_currentFrameRate); >- [device() setActiveVideoMinFrameDuration: CMTimeMake(1, m_currentFrameRate)]; >- [device() setActiveVideoMaxFrameDuration: CMTimeMake(1, m_currentFrameRate)]; >+ auto frameDuration = CMTimeMake(1, m_currentFrameRate); >+ if (CMTimeCompare(frameDuration, frameRateRange.minFrameDuration) < 0) >+ frameDuration = frameRateRange.minFrameDuration; >+ else if (CMTimeCompare(frameDuration, frameRateRange.maxFrameDuration) > 0) >+ frameDuration = frameRateRange.maxFrameDuration; >+ >+ ALWAYS_LOG_IF(loggerPtr(), LOGIDENTIFIER, "setting frame rate to ", m_currentFrameRate, ", duration ", PAL::toMediaTime(frameDuration)); >+ >+ [device() setActiveVideoMinFrameDuration: frameRateRange.maxFrameDuration]; >+ [device() setActiveVideoMaxFrameDuration: frameRateRange.maxFrameDuration]; > } else > ERROR_LOG_IF(loggerPtr(), LOGIDENTIFIER, "cannot find proper frame rate range for the selected preset\n"); >
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
Flags:
youennf
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198875
: 372165 |
372211