File tree 4 files changed +8
-10
lines changed
com.unity.renderstreaming
Samples~/Example/Broadcast
4 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,10 @@ private void HandleDataSourceField()
120
120
EditorGUILayout . EndFadeGroup ( ) ;
121
121
122
122
if ( EditorGUILayout . BeginFadeGroup ( m_sourceFade [ ( int ) VideoStreamSource . Texture ] . faded ) )
123
+ {
123
124
EditorGUILayout . PropertyField ( m_texture ) ;
125
+ EditorGUILayout . PropertyField ( m_textureSize ) ;
126
+ }
124
127
EditorGUILayout . EndFadeGroup ( ) ;
125
128
126
129
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)
423
423
/// <param name="size"></param>
424
424
public void SetTextureSize ( Vector2Int size )
425
425
{
426
- if ( m_Source == VideoStreamSource . Texture )
427
- throw new InvalidOperationException ( "Video source is set Texture." ) ;
428
426
m_TextureSize = size ;
429
427
430
428
if ( ! isPlaying )
@@ -581,7 +579,7 @@ public override WaitForCreateTrack CreateTrack()
581
579
582
580
GraphicsFormat format =
583
581
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 )
585
583
{
586
584
instruction . Done ( new VideoStreamTrack ( m_texture ) ) ;
587
585
return instruction ;
Original file line number Diff line number Diff line change @@ -173,11 +173,8 @@ private void ChangeResolution(int index)
173
173
{
174
174
var resolution = resolutionOptions . Values . ElementAt ( index ) ;
175
175
176
- if ( videoStreamSender . source != VideoStreamSource . Texture )
177
- {
178
- videoStreamSender . SetTextureSize ( resolution ) ;
179
- CalculateInputRegion ( ) ;
180
- }
176
+ videoStreamSender . SetTextureSize ( resolution ) ;
177
+ CalculateInputRegion ( ) ;
181
178
}
182
179
183
180
private void Start ( )
Original file line number Diff line number Diff line change @@ -113,8 +113,8 @@ public IEnumerator CreateTrack()
113
113
Assert . That ( sender . sourceTexture , Is . Not . Null ) ;
114
114
Assert . That ( sender . width , Is . EqualTo ( width ) ) ;
115
115
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 ) ;
118
118
op = sender . CreateTrack ( ) ;
119
119
yield return op ;
120
120
track = op . Track ;
You can’t perform that action at this time.
0 commit comments