Skip to content

Commit b3e6214

Browse files
committed
v1.6.6
Updated NatCorder version to 1.6.6. Updated NatShare version to 1.2.1.
1 parent a63e220 commit b3e6214

File tree

4 files changed

+35
-15
lines changed

4 files changed

+35
-15
lines changed

Assets/NatCorderWithOpenCVForUnityExample/NatCorderWithOpenCVForUnityExample.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class NatCorderWithOpenCVForUnityExample : MonoBehaviour
99
{
1010
public static string GetNatCorderVersion()
1111
{
12-
return "1.6.4";
12+
return "1.6.6";
1313
}
1414

1515
public Text exampleTitle;

Assets/NatCorderWithOpenCVForUnityExample/VideoRecordingExample/ComicFilter.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@ public class ComicFilter
1919
Mat kernel_dilate;
2020
Mat kernel_erode;
2121
Size blurSize;
22-
int brackThresh;
22+
int blackThresh;
2323
bool drawMainLine;
2424
bool useNoiseFilter;
2525

2626

27-
public ComicFilter(int brackThresh = 60, int grayThresh = 120, int thickness = 5, bool useNoiseFilter = true)
27+
public ComicFilter(int blackThresh = 60, int grayThresh = 120, int thickness = 5, bool useNoiseFilter = true)
2828
{
29-
this.brackThresh = brackThresh;
29+
this.blackThresh = blackThresh;
3030
this.drawMainLine = (thickness != 0);
3131
this.useNoiseFilter = useNoiseFilter;
3232

3333
grayLUT = new Mat(1, 256, CvType.CV_8UC1);
3434
byte[] lutArray = new byte[256];
3535
for (int i = 0; i < lutArray.Length; i++)
3636
{
37-
if (brackThresh <= i && i < grayThresh)
37+
if (blackThresh <= i && i < grayThresh)
3838
lutArray[i] = 255;
3939
}
4040
Utils.copyToMat(lutArray, grayLUT);
@@ -108,7 +108,7 @@ public void Process(Mat src, Mat dst, bool isBGR = false)
108108

109109

110110
// binarize.
111-
Imgproc.threshold(grayMat, grayDstMat, brackThresh, 255.0, Imgproc.THRESH_BINARY);
111+
Imgproc.threshold(grayMat, grayDstMat, blackThresh, 255.0, Imgproc.THRESH_BINARY);
112112

113113
// draw striped screentone.
114114
Core.LUT(grayMat, grayLUT, maskMat);

Assets/NatCorderWithOpenCVForUnityExample/VideoRecordingExample/VideoRecordingExample.cs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using NatCorder;
22
using NatCorder.Clocks;
33
using NatCorder.Inputs;
4-
using NatShareU;
4+
using NatShare;
55
using OpenCVForUnity.CoreModule;
66
using OpenCVForUnity.ImgprocModule;
77
using OpenCVForUnity.UnityUtils;
@@ -809,11 +809,16 @@ public void OnShareButtonClick()
809809
if (isVideoPlaying || isVideoRecording || string.IsNullOrEmpty(videoPath))
810810
return;
811811

812-
NatShare.Share(videoPath,
813-
() =>
812+
using (var payload = new SharePayload("NatCorderWithOpenCVForUnityExample",
813+
completionHandler: () =>
814814
{
815-
Debug.Log("sharing is complete.");
816-
});
815+
Debug.Log("User shared video!");
816+
}
817+
))
818+
{
819+
payload.AddText("User shared video!");
820+
payload.AddMedia(videoPath);
821+
}
817822
}
818823

819824
/// <summary>
@@ -826,7 +831,15 @@ public void OnSaveToCameraRollButtonClick()
826831
if (isVideoPlaying || isVideoRecording || string.IsNullOrEmpty(videoPath))
827832
return;
828833

829-
NatShare.SaveToCameraRoll(videoPath, "NatCorderWithOpenCVForUnityExample");
834+
using (var payload = new SavePayload("NatCorderWithOpenCVForUnityExample",
835+
completionHandler: () =>
836+
{
837+
Debug.Log("User saved video to camera roll!");
838+
}
839+
))
840+
{
841+
payload.AddMedia(videoPath);
842+
}
830843
}
831844

832845
public enum ResolutionPreset

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
## Environment
88
* Anddroid (Pixel) / iOS (iPhone8, iPhone6s)
9-
* Unity >= 2018.3+
9+
* Unity >= 2018.3+ (Unity 2019.2 or higher is recommended due to [the Unity issue](https://issuetracker.unity3d.com/issues/android-video-player-cannot-play-files-located-in-the-persistent-data-directory-on-android-10?_ga=2.235187912.870386860.1577555830-195736471.1541757609))
1010
* Scripting backend MONO / IL2CPP
11-
* [NatCorder - Video Recording API](https://assetstore.unity.com/packages/tools/integration/natcorder-video-recording-api-102645?aid=1011l4ehR) 1.6.4+
12-
* [NatShare - Mobile Sharing API](https://assetstore.unity.com/packages/tools/integration/natshare-mobile-sharing-api-117705?aid=1011l4ehR) 1.1f3+
11+
* [NatCorder - Video Recording API](https://assetstore.unity.com/packages/tools/integration/natcorder-video-recording-api-102645?aid=1011l4ehR) 1.6.6+
12+
* [NatShare - Mobile Sharing API](https://assetstore.unity.com/packages/tools/integration/natshare-mobile-sharing-api-117705?aid=1011l4ehR) 1.2.1+
1313
* [OpenCV for Unity](https://assetstore.unity.com/packages/tools/integration/opencv-for-unity-21088?aid=1011l4ehR) 2.3.7+
1414

1515

@@ -31,10 +31,17 @@
3131
1. Import the NatCorderWithOpenCVForUnityExample.unitypackage.
3232
1. Change the "Minimum API Level" to 24 or higher in the "Player Settings (Androd)" Inspector.
3333
1. Change the "Target minimum iOS Version" to 11 or higher in the "Player Settings (iOS)" Inspector.
34+
* Set the reason for accessing the camera in "cameraUsageDescription".
3435
1. Add the "Assets/NatCorderWithOpenCVForUnityExample/*.unity" files to the "Scenes In Build" list in the "Build Settings" window.
3536
1. Build and Deploy to Android and iOS.
3637

3738

39+
## iOS Instructions
40+
After building an Xcode project from Unity, add the following keys to the `Info.plist` file with a good description:
41+
- `NSPhotoLibraryUsageDescription`
42+
- `NSPhotoLibraryAddUsageDescription`
43+
44+
3845
## ScreenShot
3946
![screenshot01.jpg](screenshot01.jpg)
4047

0 commit comments

Comments
 (0)