Skip to content

Commit 2ac2d6e

Browse files
committed
update.
1 parent 22b00ce commit 2ac2d6e

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

sdk/objc/native/src/objc_desktop_capture.mm

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,14 @@
7272

7373
int width = frame->size().width();
7474
int height = frame->size().height();
75-
int real_width = frame->size().width();
75+
int real_width = width;
7676

77-
// A multiple of 32 must be used as the width of the src frame,
78-
// and the right black border needs to be cropped during conversion.
79-
if( (width % 32) !=0 ) {
80-
width = (width / 32 + 1) * 32;
77+
if(type_ == kWindow) {
78+
// A multiple of 32 must be used as the width of the src frame,
79+
// and the right black border needs to be cropped during conversion.
80+
if( (width % 32) !=0 ) {
81+
width = (width / 32 + 1) * 32;
82+
}
8183
}
8284

8385
if (!i420_buffer_ || !i420_buffer_.get() ||

sdk/objc/native/src/objc_desktop_media_list.mm

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
capturer_ = webrtc::DesktopCapturer::CreateWindowCapturer(options_);
4646
}
4747
callback_ = std::make_unique<CallbackProxy>();
48+
type_ = type;
4849
thread_->Start();
4950
capturer_->Start(callback_.get());
5051
}
@@ -163,10 +164,14 @@
163164

164165
int width = frame->size().width();
165166
int height = frame->size().height();
166-
int real_width = frame->size().width();
167+
int real_width = width;
167168

168-
if( (width % 32) !=0 ) {
169-
width = (width / 32 + 1) * 32;
169+
if(type_ == kWindow) {
170+
// A multiple of 32 must be used as the width of the src frame,
171+
// and the right black border needs to be cropped during conversion.
172+
if( (width % 32) !=0 ) {
173+
width = (width / 32 + 1) * 32;
174+
}
170175
}
171176

172177
cinfo.image_width = real_width;

0 commit comments

Comments
 (0)