Class VideoStreamReceiver
Component for receiving video streams.
Implements
Inherited Members
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Namespace: Unity.RenderStreaming
Assembly: Unity.RenderStreaming.dll
Syntax
[AddComponentMenu("Render Streaming/Video Stream Receiver")]
public class VideoStreamReceiver : StreamReceiverBase, IStreamReceiver
Fields
OnUpdateReceiveTexture
Event triggered when the received texture is updated.
Declaration
public VideoStreamReceiver.OnUpdateReceiveTextureHandler OnUpdateReceiveTexture
Field Value
Type | Description |
---|---|
VideoStreamReceiver.OnUpdateReceiveTextureHandler |
Properties
codec
Gets the codec information for the video stream.
Declaration
public VideoCodecInfo codec { get; }
Property Value
Type | Description |
---|---|
VideoCodecInfo |
height
The height of the received video stream.
Declaration
public int height { get; }
Property Value
Type | Description |
---|---|
int |
targetTexture
The target RenderTexture.
Declaration
public RenderTexture targetTexture { get; set; }
Property Value
Type | Description |
---|---|
RenderTexture |
texture
The texture of the received video stream.
Declaration
public Texture texture { get; }
Property Value
Type | Description |
---|---|
Texture |
width
The width of the received video stream.
Declaration
public int width { get; }
Property Value
Type | Description |
---|---|
int |
Methods
GetAvailableCodecs()
Declaration
public static IEnumerable<VideoCodecInfo> GetAvailableCodecs()
Returns
Type | Description |
---|---|
IEnumerable<VideoCodecInfo> |
SetCodec(VideoCodecInfo)
Sets the codec for the video stream.
Declaration
public void SetCodec(VideoCodecInfo codec)
Parameters
Type | Name | Description |
---|---|---|
VideoCodecInfo | codec | The codec information to set. |
Examples
var codec = VideoStreamReceiver.GetAvailableCodecs().FirstOrDefault(x => x.mimeType.Contains("VP9"));
videoStreamReceiver.SetCodec(codec);
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown if the transceiver is streaming or the track has ended. |