videoio: fixed FFmpeg plugin build
authorMaksim Shabunin <maksim.shabunin@gmail.com>
Thu, 1 Dec 2022 12:13:52 +0000 (15:13 +0300)
committerMaksim Shabunin <maksim.shabunin@gmail.com>
Thu, 1 Dec 2022 17:26:08 +0000 (20:26 +0300)
modules/videoio/src/cap.cpp
modules/videoio/src/cap_interface.hpp

index 691fb9ab38d2e7d00092ff684dfcb3de5be35640..fa958e2c8f38fffdfd3d1f13552f8bccf8ba2a38 100644 (file)
@@ -698,29 +698,4 @@ int VideoWriter::fourcc(char c1, char c2, char c3, char c4)
     return (c1 & 255) + ((c2 & 255) << 8) + ((c3 & 255) << 16) + ((c4 & 255) << 24);
 }
 
-
-void applyMetadataRotation(const IVideoCapture& cap, OutputArray mat)
-{
-    bool rotation_auto = 0 != cap.getProperty(CAP_PROP_ORIENTATION_AUTO);
-    int rotation_angle = static_cast<int>(cap.getProperty(CAP_PROP_ORIENTATION_META));
-
-    if(!rotation_auto || rotation_angle%360 == 0)
-    {
-        return;
-    }
-
-    cv::RotateFlags flag;
-    if(rotation_angle == 90 || rotation_angle == -270) { // Rotate clockwise 90 degrees
-        flag = cv::ROTATE_90_CLOCKWISE;
-    } else if(rotation_angle == 270 || rotation_angle == -90) { // Rotate clockwise 270 degrees
-        flag = cv::ROTATE_90_COUNTERCLOCKWISE;
-    } else if(rotation_angle == 180 || rotation_angle == -180) { // Rotate clockwise 180 degrees
-        flag = cv::ROTATE_180;
-    } else { // Unsupported rotation
-        return;
-    }
-
-    cv::rotate(mat, mat, flag);
-}
-
 } // namespace cv
index 52639f3605a1d6ff5cce81ae2e4928cbc2f87c3a..d9a1148e9075d91f1b110ce653f23d9bbb57db83 100644 (file)
@@ -221,8 +221,6 @@ public:
     virtual int getCaptureDomain() { return CAP_ANY; } // Return the type of the capture object: CAP_DSHOW, etc...
 };
 
-void applyMetadataRotation(const IVideoCapture& cap, OutputArray mat);
-
 class IVideoWriter
 {
 public:
@@ -245,6 +243,34 @@ public:
 
 //===================================================
 
+// Utility
+
+static inline void applyMetadataRotation(const IVideoCapture& cap, OutputArray mat)
+{
+    bool rotation_auto = 0 != cap.getProperty(CAP_PROP_ORIENTATION_AUTO);
+    int rotation_angle = static_cast<int>(cap.getProperty(CAP_PROP_ORIENTATION_META));
+
+    if(!rotation_auto || rotation_angle%360 == 0)
+    {
+        return;
+    }
+
+    cv::RotateFlags flag;
+    if(rotation_angle == 90 || rotation_angle == -270) { // Rotate clockwise 90 degrees
+        flag = cv::ROTATE_90_CLOCKWISE;
+    } else if(rotation_angle == 270 || rotation_angle == -90) { // Rotate clockwise 270 degrees
+        flag = cv::ROTATE_90_COUNTERCLOCKWISE;
+    } else if(rotation_angle == 180 || rotation_angle == -180) { // Rotate clockwise 180 degrees
+        flag = cv::ROTATE_180;
+    } else { // Unsupported rotation
+        return;
+    }
+
+    cv::rotate(mat, mat, flag);
+}
+
+//===================================================
+
 // Wrapper
 
 class LegacyCapture : public IVideoCapture