|
WebRTC Video Chat 1.1.4
|
This interface provides a cross-platform API (WebGL+native) to forward custom image data to WebRTC. More...
Public Member Functions | |
| void | AddDevice (string name, int width, int height, int fps) |
| Adds a new device. It will be treated by other parts of the asset as a camera device that has only one supported format using width, height and FPS you set via this method. | |
| void | RemoveDevice (string name) |
| Removes the device from the internal device list. | |
| bool | UpdateFrame (string name, byte[] dataBuffer, int width, int height, int rotation, bool firstRowIsBottom) |
| Updates frames via a byte[]. Width and Height should be the size you used in AddDevice. If width and height differ it is up to the platform specific layer how this is handled. | |
| bool | UpdateFrame (string name, IntPtr dataPtr, int length, int width, int height, int rotation, bool firstRowIsBottom) |
| WARNING: This method is inherently unsafe and can crash the application without triggering any useful exception / error message in C#. It will directly access the memory Updates frames via a byte[]. Width and Height should be the size you used in AddDevice. It is possible the lower layers will scale your image to fit the values from AddDevice though. | |
Properties | |
| VideoInputFormat | InputFormat [get] |
| Recommended video input format Returns the format the byte[] and dataPtr expect as input. Other formats might be supported via platform specific implementations. | |
This interface provides a cross-platform API (WebGL+native) to forward custom image data to WebRTC.
Make sure UnityCallFactory is initialized before using this.
| void Byn.Awrtc.IVideoInput.AddDevice | ( | string | name, |
| int | width, | ||
| int | height, | ||
| int | fps ) |
Adds a new device. It will be treated by other parts of the asset as a camera device that has only one supported format using width, height and FPS you set via this method.
Note that actual frame updates do not need to be done in the exact FPS but it is recommended to do so.
| name | name of the device. Can be used via MediaConfig.VideoDeviceName and will be returned by UnityCallFactory.GetVideoDevices() |
| width | Width of the images you want to deliver |
| height | Height of the images you want to deliver |
| fps | expected framerate you want to deliver |
| void Byn.Awrtc.IVideoInput.RemoveDevice | ( | string | name | ) |
Removes the device from the internal device list.
| name |
| bool Byn.Awrtc.IVideoInput.UpdateFrame | ( | string | name, |
| byte[] | dataBuffer, | ||
| int | width, | ||
| int | height, | ||
| int | rotation, | ||
| bool | firstRowIsBottom ) |
Updates frames via a byte[].
Width and Height should be the size you used in AddDevice. If width and height differ it is up to the platform specific layer how this is handled.
| name | Device name. Must be added before this call via AddDevice |
| dataBuffer | raw data of the image. Must be in the expected Format |
| width | width of the image you supply |
| height | height of the image you supply |
| rotation | Attaches a rotation value to the image. (might not work on all platforms) |
| firstRowIsBottom | Unity often has the frames up-side-down in memory. Set this to true to flip it |
| bool Byn.Awrtc.IVideoInput.UpdateFrame | ( | string | name, |
| IntPtr | dataPtr, | ||
| int | length, | ||
| int | width, | ||
| int | height, | ||
| int | rotation, | ||
| bool | firstRowIsBottom ) |
WARNING: This method is inherently unsafe and can crash the application without triggering any useful exception / error message in C#. It will directly access the memory Updates frames via a byte[].
Width and Height should be the size you used in AddDevice. It is possible the lower layers will scale your image to fit the values from AddDevice though.
| name | Device name. Must be added before this call via AddDevice |
| dataPtr | raw data of the image. Must be in the expected Format |
| length | Buffer length in bytes |
| width | width of the image you supply |
| height | height of the image you supply |
| rotation | Attaches a rotation value to the image. (might not work on all platforms) |
| firstRowIsBottom | Unity often has the frames up-side-down in memory. Set this to true to flip it |