Skip to content

Commit

Permalink
fix: screen capture bug for Android/iOS (#1729)
Browse files Browse the repository at this point in the history
* fix: display bug for android.

* fix issue for ios.
  • Loading branch information
cloudwebrtc authored Dec 23, 2024
1 parent 2a130aa commit bb730e4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ public void onStop() {
track_.putBoolean("remote", false);

videoTracks.pushMap(track_);
mediaStream.addTrack(displayTrack);
}

String streamId = mediaStream.getId();
Expand Down
4 changes: 2 additions & 2 deletions common/darwin/Classes/FlutterRTCDesktopCapturer.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ - (void)getDisplayMedia:(NSDictionary*)constraints result:(FlutterResult)result
id screenCapturer;

if (useBroadcastExtension) {
screenCapturer = [[FlutterBroadcastScreenCapturer alloc] initWithDelegate:videoSource];
screenCapturer = [[FlutterBroadcastScreenCapturer alloc] initWithDelegate:videoProcessingAdapter];
} else {
screenCapturer = [[FlutterRPScreenRecorder alloc] initWithDelegate:videoSource];
screenCapturer = [[FlutterRPScreenRecorder alloc] initWithDelegate:videoProcessingAdapter];
}

[screenCapturer startCapture];
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/Broadcast/FlutterSocketConnectionFrameReader.m
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ - (void)didCaptureVideoFrame:(CVPixelBufferRef)pixelBuffer
break;
}

RTCVideoFrame* videoFrame = [[RTCVideoFrame alloc] initWithBuffer:rtcPixelBuffer
RTCVideoFrame* videoFrame = [[RTCVideoFrame alloc] initWithBuffer:[rtcPixelBuffer toI420]
rotation:rotation
timeStampNs:frameTimeStampNs];

Expand Down

0 comments on commit bb730e4

Please sign in to comment.