File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
android/src/main/java/com/cloudwebrtc/webrtc Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -52,8 +52,15 @@ public void onFrameResolutionChanged(
5252 ConstraintsMap params = new ConstraintsMap ();
5353 params .putString ("event" , "didTextureChangeVideoSize" );
5454 params .putInt ("id" , id );
55- params .putDouble ("width" , (double ) videoWidth );
56- params .putDouble ("height" , (double ) videoHeight );
55+
56+ if (rotation == 90 || rotation == 270 ){
57+ params .putDouble ("width" , (double ) videoHeight );
58+ params .putDouble ("height" , (double ) videoWidth );
59+ }else {
60+ params .putDouble ("width" , (double ) videoWidth );
61+ params .putDouble ("height" , (double ) videoHeight );
62+ }
63+
5764 eventSink .success (params .toMap ());
5865
5966 ConstraintsMap params2 = new ConstraintsMap ();
Original file line number Diff line number Diff line change @@ -564,8 +564,13 @@ private void updateFrameDimensionsAndReportEvents(VideoRenderer.I420Frame frame)
564564 frameWidth = frame .width ;
565565 frameHeight = frame .height ;
566566 frameRotation = frame .rotationDegree ;
567- texture .setDefaultBufferSize (frameWidth , frameHeight );
568- surfaceChanged (frameWidth , frameHeight );
567+ if (frameRotation == 90 || frameRotation == 270 ) {
568+ texture .setDefaultBufferSize (frameHeight , frameWidth );
569+ surfaceChanged (frameHeight , frameWidth );
570+ }else {
571+ texture .setDefaultBufferSize (frameWidth , frameHeight );
572+ surfaceChanged (frameWidth , frameHeight );
573+ }
569574 }
570575 }
571576 }
You can’t perform that action at this time.
0 commit comments