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(
52
52
ConstraintsMap params = new ConstraintsMap ();
53
53
params .putString ("event" , "didTextureChangeVideoSize" );
54
54
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
+
57
64
eventSink .success (params .toMap ());
58
65
59
66
ConstraintsMap params2 = new ConstraintsMap ();
Original file line number Diff line number Diff line change @@ -564,8 +564,13 @@ private void updateFrameDimensionsAndReportEvents(VideoRenderer.I420Frame frame)
564
564
frameWidth = frame .width ;
565
565
frameHeight = frame .height ;
566
566
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
+ }
569
574
}
570
575
}
571
576
}
You can’t perform that action at this time.
0 commit comments