Reformat files
This commit is contained in:
parent
d8f5282892
commit
783839a0b0
|
@ -30,7 +30,11 @@ namespace WebViewStream
|
||||||
BoxCollider boxCollider = canvas.GetComponent<BoxCollider>();
|
BoxCollider boxCollider = canvas.GetComponent<BoxCollider>();
|
||||||
if (boxCollider != null)
|
if (boxCollider != null)
|
||||||
{
|
{
|
||||||
boxCollider.size = new Vector3(boxCollider.size.x, isVisible ? 400 : 370, boxCollider.size.z);
|
boxCollider.size = new Vector3(
|
||||||
|
boxCollider.size.x,
|
||||||
|
isVisible ? 400 : 370,
|
||||||
|
boxCollider.size.z
|
||||||
|
);
|
||||||
boxCollider.center = new Vector3(0, isVisible ? 0 : -16, 0);
|
boxCollider.center = new Vector3(0, isVisible ? 0 : -16, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,10 @@ namespace WebViewStream
|
||||||
|
|
||||||
canvas.transform.position =
|
canvas.transform.position =
|
||||||
cameraTransform.position + cameraTransform.TransformDirection(localOffset);
|
cameraTransform.position + cameraTransform.TransformDirection(localOffset);
|
||||||
canvas.transform.rotation = Quaternion.LookRotation(cameraTransform.forward, cameraTransform.up);
|
canvas.transform.rotation = Quaternion.LookRotation(
|
||||||
|
cameraTransform.forward,
|
||||||
|
cameraTransform.up
|
||||||
|
);
|
||||||
|
|
||||||
localOffset = new Vector3(
|
localOffset = new Vector3(
|
||||||
localOffset.x + endpointLoader.GetItemWidth(canvas),
|
localOffset.x + endpointLoader.GetItemWidth(canvas),
|
||||||
|
|
|
@ -86,7 +86,11 @@ namespace WebViewStream
|
||||||
}
|
}
|
||||||
|
|
||||||
udpClient = new UdpClient();
|
udpClient = new UdpClient();
|
||||||
udpClient.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
|
udpClient.Client.SetSocketOption(
|
||||||
|
SocketOptionLevel.Socket,
|
||||||
|
SocketOptionName.ReuseAddress,
|
||||||
|
true
|
||||||
|
);
|
||||||
udpClient.Client.Bind(new IPEndPoint(defaultIP, multicastPort));
|
udpClient.Client.Bind(new IPEndPoint(defaultIP, multicastPort));
|
||||||
udpClient.JoinMulticastGroup(IPAddress.Parse(multicastAddress), defaultIP);
|
udpClient.JoinMulticastGroup(IPAddress.Parse(multicastAddress), defaultIP);
|
||||||
|
|
||||||
|
@ -109,7 +113,11 @@ namespace WebViewStream
|
||||||
byte[] query = CreateMdnsQuery(serviceName);
|
byte[] query = CreateMdnsQuery(serviceName);
|
||||||
Debug.Log($"Sending mDNS query for {serviceName}");
|
Debug.Log($"Sending mDNS query for {serviceName}");
|
||||||
|
|
||||||
udpClient.Send(query, query.Length, new IPEndPoint(IPAddress.Parse(multicastAddress), multicastPort));
|
udpClient.Send(
|
||||||
|
query,
|
||||||
|
query.Length,
|
||||||
|
new IPEndPoint(IPAddress.Parse(multicastAddress), multicastPort)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte[] CreateMdnsQuery(string serviceName)
|
private byte[] CreateMdnsQuery(string serviceName)
|
||||||
|
@ -262,7 +270,9 @@ namespace WebViewStream
|
||||||
|
|
||||||
if (recordType == 1) // A Record
|
if (recordType == 1) // A Record
|
||||||
{
|
{
|
||||||
IPAddress ipAddress = new IPAddress(new ArraySegment<byte>(data, offset, dataLength).ToArray());
|
IPAddress ipAddress = new IPAddress(
|
||||||
|
new ArraySegment<byte>(data, offset, dataLength).ToArray()
|
||||||
|
);
|
||||||
receivedIp = ipAddress.ToString();
|
receivedIp = ipAddress.ToString();
|
||||||
receivedHost = name;
|
receivedHost = name;
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,14 +101,19 @@ namespace WebViewStream
|
||||||
Resolution cameraResolution = new Resolution();
|
Resolution cameraResolution = new Resolution();
|
||||||
foreach (Resolution resolution in VideoCapture.SupportedResolutions)
|
foreach (Resolution resolution in VideoCapture.SupportedResolutions)
|
||||||
{
|
{
|
||||||
if (resolution.width * resolution.height > cameraResolution.width * cameraResolution.height)
|
if (
|
||||||
|
resolution.width * resolution.height
|
||||||
|
> cameraResolution.width * cameraResolution.height
|
||||||
|
)
|
||||||
{
|
{
|
||||||
cameraResolution = resolution;
|
cameraResolution = resolution;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float cameraFramerate = 0.0f;
|
float cameraFramerate = 0.0f;
|
||||||
foreach (float framerate in VideoCapture.GetSupportedFrameRatesForResolution(cameraResolution))
|
foreach (
|
||||||
|
float framerate in VideoCapture.GetSupportedFrameRatesForResolution(cameraResolution)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if (framerate > cameraFramerate)
|
if (framerate > cameraFramerate)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue