-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathARVideoFormat.cs
62 lines (48 loc) · 1.58 KB
/
ARVideoFormat.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using System.Runtime.InteropServices;
using AOT;
namespace UnityEngine.XR.iOS
{
public struct UnityARVideoFormat {
public IntPtr videoFormatPtr;
public float imageResolutionWidth;
public float imageResolutionHeight;
public int framesPerSecond;
#if UNITY_EDITOR
private static void EnumerateVideoFormats(VideoFormatEnumerator videoFormatEnumerator)
{
}
private static void EnumerateFaceTrackingVideoFormats(VideoFormatEnumerator videoFormatEnumerator)
{
}
#else
[DllImport("__Internal")]
private static extern void EnumerateVideoFormats(VideoFormatEnumerator videoFormatEnumerator);
[DllImport("__Internal")]
private static extern void EnumerateFaceTrackingVideoFormats(VideoFormatEnumerator videoFormatEnumerator);
#endif
static List<UnityARVideoFormat> videoFormatsList;
public static List<UnityARVideoFormat> SupportedVideoFormats()
{
videoFormatsList = new List<UnityARVideoFormat> ();
EnumerateVideoFormats (AddToVFList);
return videoFormatsList;
}
public static List<UnityARVideoFormat> SupportedFaceTrackingVideoFormats()
{
videoFormatsList = new List<UnityARVideoFormat> ();
EnumerateFaceTrackingVideoFormats(AddToVFList);
return videoFormatsList;
}
[MonoPInvokeCallback(typeof(VideoFormatEnumerator))]
private static void AddToVFList(UnityARVideoFormat newFormat)
{
Debug.Log ("New Format returned");
videoFormatsList.Add (newFormat);
}
}
public delegate void VideoFormatEnumerator(UnityARVideoFormat videoFormat);
}