Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XCode 9: Main Thread Checker: UI API called on a background thread: -[UIView layer] #3592

Open
lrs0304 opened this issue Sep 15, 2017 · 16 comments
Assignees

Comments

@lrs0304
Copy link

lrs0304 commented Sep 15, 2017

XCode9 新增了Main thread checker,可以在secheme里面关闭,提示called on a background thread

环境:XCode 9
代码:k.0.8.3
资源:任意视频链接
日志:

ijkmp_get_meta_l
ijkmp_get_meta_l()=void
ijkmp_set_playback_rate(1.000000)
Playback rate: 1.000000
ijkmp_set_playback_rate()=void
ijkmp_set_playback_volume(1.000000)
ijkmp_set_playback_volume()=void
mediaIsPreparedToPlayDidChange
loadStateDidChange: MPMovieLoadStatePlayable--->Playing: 3
moviePlayBackStateDidChange 1: playing
Reinit context to 1920x1088, pix_fmt: yuv420p
no picture 
no picture 
no picture 
aout_set_volume()
SDL_VoutFFmpeg_CreateOverlay(w=1920, h=1080, fmt=I420(0x30323449, dp=0x600000466540)
Video: first frame decoded
[GLES2] Version = OpenGL ES 2.0 APPLE-15.0.48
[GLES2] Vendor = Apple Inc.
[GLES2] Renderer = Apple Software Renderer
[GLES2] Extensions = GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_vertex_array_object GL_EXT_blend_minmax GL_EXT_color_buffer_half_float GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_draw_instanced GL_EXT_instanced_arrays GL_EXT_map_buffer_range GL_EXT_occlusion_query_boolean GL_EXT_pvrtc_sRGB GL_EXT_read_format_bgra GL_EXT_separate_shader_objects GL_EXT_shader_framebuffer_fetch GL_EXT_shader_texture_lod GL_EXT_shadow_samplers GL_EXT_sRGB GL_EXT_texture_filter_anisotropic GL_EXT_texture_rg GL_EXT_texture_storage GL_APPLE_clip_distance GL_APPLE_color_buffer_packed_float GL_APPLE_copy_texture_levels GL_APPLE_framebuffer_multisample GL_APPLE_rgb_422 GL_APPLE_sync GL_APPLE_texture_format_BGRA8888 GL_APPLE_texture_max_level GL_APPLE_texture_packed_float GL_IMG_read_format GL_IMG_texture_compression_pvrtc 
create render yuv420p
use render yuv420p
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIView layer]
PID: 37473, TID: 206703, Thread name: ff_video_dec, Queue name: com.apple.root.default-qos.overcommit, QoS: 21
Backtrace:
4   KwailyLivePlayer                    0x000000010cf398db -[IJKSDLGLView eaglLayer] + 43
5   KwailyLivePlayer                    0x000000010cf3a8b7 -[IJKSDLGLView displayInternal:] + 151
6   KwailyLivePlayer                    0x000000010cf3a7c4 -[IJKSDLGLView display:] + 340
7   KwailyLivePlayer                    0x000000010cf5824a vout_display_overlay_l + 186
8   KwailyLivePlayer                    0x000000010cf57fc5 vout_display_overlay + 53
9   KwailyLivePlayer                    0x000000010cf0b72b SDL_VoutDisplayYUVOverlay + 59
10  KwailyLivePlayer                    0x000000010cf31069 video_image_display2 + 857
11  KwailyLivePlayer                    0x000000010cf305ff video_display2 + 47
12  KwailyLivePlayer                    0x000000010cf29f2b queue_picture + 1675
13  KwailyLivePlayer                    0x000000010cf2aa82 ffplay_video_thread + 930
14  KwailyLivePlayer                    0x000000010cf2a6d5 ffp_video_thread + 21
15  KwailyLivePlayer                    0x000000010cf0bc34 func_run_sync + 36
16  KwailyLivePlayer                    0x000000010cf1a725 ffpipenode_run_sync + 37
17  KwailyLivePlayer                    0x000000010cf342c9 video_thread + 57
18  KwailyLivePlayer                    0x000000010cf35eba SDL_RunThread + 74
19  libsystem_pthread.dylib             0x000000011660e93b _pthread_body + 180
20  libsystem_pthread.dylib             0x000000011660e887 _pthread_body + 0
21  libsystem_pthread.dylib             0x000000011660e08d thread_start + 13

关闭检查的方法:
2017-09-15 3 56 18

@IvanGrab
Copy link

The same issue:
iOS 11 GM
XCode9 Beta

[reports] Main Thread Checker: UI API called on a background thread: -[UIView layer]
PID: 9067, TID: 3950540, Thread name: ff_vout, Queue name: com.apple.root.default-qos.overcommit, QoS: 21

@YaHoYii
Copy link

YaHoYii commented Sep 20, 2017

我也发现这个问题。。。但是这么解决?
关掉它?!

@bhltyou
Copy link

bhltyou commented Sep 21, 2017

@lrs0304 @IvanGrab @YaHoYii 请问大家怎么解决的

@IvanGrab
Copy link

@bhltyou try run project with library on iOS 11 and XCode9, turn on "All Exception" breakpoint play some live video stream and i think Xcode will catch the row here is an issue.
and bring that method in main thread!

@bhltyou
Copy link

bhltyou commented Sep 21, 2017

@IvanGrab thanks a lot

@QiuDaniel
Copy link

@bhltyou 成功了吗?具体怎么修改的?

@yjjwxy2
Copy link

yjjwxy2 commented Oct 24, 2017

问题解决了吗,只能设置关闭吗,求方法 @lrs0304

@poholo
Copy link

poholo commented Apr 9, 2019

#4681 应该是App启动后第一次会有这个线程问题,之后一切正常,感觉是xcode升级成10之后出现的。

@poholo
Copy link

poholo commented Apr 10, 2019

#4683

@poholo
Copy link

poholo commented Apr 20, 2019

pod 'MCIJKPlayer'

@PengYang1991
Copy link

我也遇见了这个问题暂时先关闭了xcode Main Thread Checker 这个选项,想知道有没有更好的解决方式

@poholo
Copy link

poholo commented Apr 29, 2019

我也遇见了这个问题暂时先关闭了xcode Main Thread Checker 这个选项,想知道有没有更好的解决方式

#4683
pod 'MCIJKPlayer'

@FxDepths
Copy link

FxDepths commented May 9, 2019

我也遇见了这个问题暂时先关闭了xcode Main Thread Checker 这个选项,想知道有没有更好的解决方式

#4683
pod 'MCIJKPlayer'

谢谢 使用MCIJKPlayer替换了ijkplayer,问题解决,暂时没有发现其他问题

@tounaobun
Copy link

prod上表现正常,不卡顿;

@lucking
Copy link

lucking commented Dec 27, 2022

pod 'MCIJKPlayer'

都Xcode14编译报错

@poholo
Copy link

poholo commented Dec 29, 2022

pod 'MCIJKPlayer'

都Xcode14编译报错

请把编译错误贴出来看看

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests