/// <summary> /// Video Sender /// </summary> /// <param name="label"></param> /// <param name="source"></param> /// <param name="needFlip"></param> internal VideoStreamTrack(string label, VideoTrackSource source, bool needFlip) : base(WebRTC.Context.CreateVideoTrack(label, source.self)) { if (!s_tracks.TryAdd(self, new WeakReference <VideoStreamTrack>(this))) { throw new InvalidOperationException(); } m_needFlip = needFlip; m_source = source; }
internal VideoStreamTrack(Texture texture, RenderTexture dest, string label, VideoTrackSource source, bool needFlip) : base(WebRTC.Context.CreateVideoTrack(label, source.self)) { var error = WebRTC.ValidateTextureSize(texture.width, texture.height, Application.platform); if (error.errorType != RTCErrorType.None) { throw new ArgumentException(error.message); } WebRTC.ValidateGraphicsFormat(texture.graphicsFormat); if (!s_tracks.TryAdd(self, new WeakReference <VideoStreamTrack>(this))) { throw new InvalidOperationException(); } m_source = source; m_source.sourceTexture_ = texture; m_source.destTexture_ = dest; m_source.needFlip_ = needFlip; }
internal VideoStreamTrack(string label, VideoTrackSource source) : this(WebRTC.Context.CreateVideoTrack(label, source.self)) { _source = source; }