File tree Expand file tree Collapse file tree 4 files changed +8
-10
lines changed
com.unity.renderstreaming
Samples~/Example/Broadcast Expand file tree Collapse file tree 4 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,10 @@ private void HandleDataSourceField()
120120 EditorGUILayout . EndFadeGroup ( ) ;
121121
122122 if ( EditorGUILayout . BeginFadeGroup ( m_sourceFade [ ( int ) VideoStreamSource . Texture ] . faded ) )
123+ {
123124 EditorGUILayout . PropertyField ( m_texture ) ;
125+ EditorGUILayout . PropertyField ( m_textureSize ) ;
126+ }
124127 EditorGUILayout . EndFadeGroup ( ) ;
125128
126129 if ( EditorGUILayout . BeginFadeGroup ( m_sourceFade [ ( int ) VideoStreamSource . WebCamera ] . faded ) )
Original file line number Diff line number Diff line change @@ -423,8 +423,6 @@ public void SetScaleResolutionDown(float scaleFactor)
423423 /// <param name="size"></param>
424424 public void SetTextureSize ( Vector2Int size )
425425 {
426- if ( m_Source == VideoStreamSource . Texture )
427- throw new InvalidOperationException ( "Video source is set Texture." ) ;
428426 m_TextureSize = size ;
429427
430428 if ( ! isPlaying )
@@ -581,7 +579,7 @@ public override WaitForCreateTrack CreateTrack()
581579
582580 GraphicsFormat format =
583581 WebRTC . WebRTC . GetSupportedGraphicsFormat ( SystemInfo . graphicsDeviceType ) ;
584- if ( m_texture . graphicsFormat == format )
582+ if ( m_texture . graphicsFormat == format && m_texture . width == width && m_texture . height == height )
585583 {
586584 instruction . Done ( new VideoStreamTrack ( m_texture ) ) ;
587585 return instruction ;
Original file line number Diff line number Diff line change @@ -173,11 +173,8 @@ private void ChangeResolution(int index)
173173 {
174174 var resolution = resolutionOptions . Values . ElementAt ( index ) ;
175175
176- if ( videoStreamSender . source != VideoStreamSource . Texture )
177- {
178- videoStreamSender . SetTextureSize ( resolution ) ;
179- CalculateInputRegion ( ) ;
180- }
176+ videoStreamSender . SetTextureSize ( resolution ) ;
177+ CalculateInputRegion ( ) ;
181178 }
182179
183180 private void Start ( )
Original file line number Diff line number Diff line change @@ -113,8 +113,8 @@ public IEnumerator CreateTrack()
113113 Assert . That ( sender . sourceTexture , Is . Not . Null ) ;
114114 Assert . That ( sender . width , Is . EqualTo ( width ) ) ;
115115 Assert . That ( sender . height , Is . EqualTo ( height ) ) ;
116- Assert . That ( ( ) => sender . width = 1280 , Throws . Exception . TypeOf < InvalidOperationException > ( ) ) ;
117- Assert . That ( ( ) => sender . height = 720 , Throws . Exception . TypeOf < InvalidOperationException > ( ) ) ;
116+ Assert . That ( ( ) => sender . width = 1280 , Throws . Nothing ) ;
117+ Assert . That ( ( ) => sender . height = 720 , Throws . Nothing ) ;
118118 op = sender . CreateTrack ( ) ;
119119 yield return op ;
120120 track = op . Track ;
You can’t perform that action at this time.
0 commit comments