Bug 1441145 - Hack the frame rotation through to CamerasParent and CamerasChild. r?jib draft
authorAndreas Pehrson <pehrsons@mozilla.com>
Fri, 02 Mar 2018 16:57:59 +0100
changeset 762520 9785013d5574da8c322e0a2ffe484950ab2e8e16
parent 760269 d6abea1cce397126b86f778c623a243819f2dd12
child 762521 2120f07576872ed1b5b153ce075900a343def066
push id101190
push userbmo:apehrson@mozilla.com
push dateFri, 02 Mar 2018 15:59:37 +0000
reviewersjib
bugs1441145
milestone60.0a1
Bug 1441145 - Hack the frame rotation through to CamerasParent and CamerasChild. r?jib MozReview-Commit-ID: 1UL1Ixkzl86
media/webrtc/trunk/webrtc/modules/video_capture/video_capture_impl.cc
--- a/media/webrtc/trunk/webrtc/modules/video_capture/video_capture_impl.cc
+++ b/media/webrtc/trunk/webrtc/modules/video_capture/video_capture_impl.cc
@@ -202,16 +202,23 @@ int32_t VideoCaptureImpl::IncomingFrame(
             return -1;
         }
 
         VideoFrame captureFrame(
             buffer, 0, rtc::TimeMillis(),
             !apply_rotation ? _rotateFrame : kVideoRotation_0);
         captureFrame.set_ntp_time_ms(captureTime);
 
+        // This is one ugly hack to let CamerasParent know what rotation
+        // the frame was captured at. Note that this goes against the intended
+        // meaning of rotation of the frame (how to rotate it before rendering).
+        // We do this so CamerasChild can scale to the proper dimensions
+        // later on in the pipe.
+        captureFrame.set_rotation(_rotateFrame);
+
         DeliverCapturedFrame(captureFrame);
     }
     else // Encoded format
     {
         assert(false);
         return -1;
     }