RealtimeOutgoingVideoSource should pass frame timestamp
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Jul 2017 18:43:23 +0000 (18:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Jul 2017 18:43:23 +0000 (18:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=174055

Patch by Youenn Fablet <youenn@apple.com> on 2017-07-02
Reviewed by Eric Carlson.

Covered by manual testing since this only affects video encoding quality.

* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::sendFrame):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219058 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp

index 25ce602..0059ea5 100644 (file)
@@ -1,3 +1,15 @@
+2017-07-02  Youenn Fablet  <youenn@apple.com>
+
+        RealtimeOutgoingVideoSource should pass frame timestamp
+        https://bugs.webkit.org/show_bug.cgi?id=174055
+
+        Reviewed by Eric Carlson.
+
+        Covered by manual testing since this only affects video encoding quality.
+
+        * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
+        (WebCore::RealtimeOutgoingVideoSource::sendFrame):
+
 2017-07-01  Dan Bernstein  <mitz@apple.com>
 
         <rdar://problem/33096441> r219055 broke non-iOS builds.
index 0a28209..3f450df 100644 (file)
@@ -35,6 +35,7 @@
 #include <webrtc/api/video/i420_buffer.h>
 #include <webrtc/common_video/libyuv/include/webrtc_libyuv.h>
 #include <webrtc/sdk/objc/Framework/Classes/Video/corevideo_frame_buffer.h>
+#include <wtf/CurrentTime.h>
 #include <wtf/MainThread.h>
 
 #include "CoreMediaSoftLink.h"
@@ -185,7 +186,8 @@ void RealtimeOutgoingVideoSource::sendOneBlackFrame()
 
 void RealtimeOutgoingVideoSource::sendFrame(rtc::scoped_refptr<webrtc::VideoFrameBuffer>&& buffer)
 {
-    webrtc::VideoFrame frame(buffer, 0, 0, m_shouldApplyRotation ? webrtc::kVideoRotation_0 : m_currentRotation);
+    int64_t timestampMicroSeconds = monotonicallyIncreasingTimeMS() * 1000;
+    webrtc::VideoFrame frame(buffer, m_shouldApplyRotation ? webrtc::kVideoRotation_0 : m_currentRotation, timestampMicroSeconds);
     for (auto* sink : m_sinks)
         sink->OnFrame(frame);
 }