ios 奇怪的 AQDefaultDevice 日志记录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/40389308/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Strange AQDefaultDevice logging
提问by RajV
I am playing video from a controller like this:
我正在从这样的控制器播放视频:
func playMovie() {
let path = Bundle.main.path(forResource: "xyz", ofType:"mov")
let url = URL(fileURLWithPath: path!)
self.player = AVPlayer(url: url)
let layer: AVPlayerLayer = AVPlayerLayer(player: self.player)
layer.frame = self.view.frame
layer.videoGravity = AVLayerVideoGravityResizeAspectFill
self.view.layer.addSublayer(layer)
self.player.play()
}
Even after the controller is destroyed and no longer in use, I get this log message every second or so:
即使在控制器被销毁且不再使用后,我也会每隔一秒左右收到此日志消息:
AQDefaultDevice (173): skipping input stream 0 0 0x0
I am not asking how to hide these logs. I know how to do that by setting OS_ACTIVITY_MODE
to disable
(See this for how to hide these logs). My concern is that the movie may be still playing somehow even after the controller is destroyed. Is there anything wrong in the way I am playing the movie. Or do I need to perform any additional cleanup?
我不是在问如何隐藏这些日志。我知道如何通过设置做OS_ACTIVITY_MODE
对disable
(见本关于如何隐藏这些日志)。我担心的是,即使在控制器损坏后,电影仍可能以某种方式播放。我播放电影的方式有什么问题吗?或者我需要执行任何额外的清理吗?
采纳答案by zippo
I got this problem when i using AVPlayer Foundation on iOS Simulator (xcode 8.1).However it doesn't log anymore on iOS devices. In my opinion it's a log bug.The player or the layer is destroyed.
我在 iOS 模拟器(xcode 8.1)上使用 AVPlayer Foundation 时遇到了这个问题。但是它不再在 iOS 设备上登录。在我看来,这是一个日志错误。播放器或图层被破坏。
update
更新
i got this for you fix unwanted log messages
我为你修复了不需要的日志消息
回答by Igor
No, you do nothing wrong. This is a bug with logs in Xcode8 + iOS10.
不,你没有做错任何事。这是 Xcode8 + iOS10 中的日志错误。
We can get round it in this way (device and simulator need different values):
我们可以通过这种方式绕过它(设备和模拟器需要不同的值):
Add the Name OS_ACTIVITY_MODE
and the Value ${DEBUG_ACTIVITY_MODE}
and check it (in Product -> Scheme -> Edit Scheme -> Run -> Arguments -> Environment).
添加名称OS_ACTIVITY_MODE
和值${DEBUG_ACTIVITY_MODE}
并检查它(在产品 -> 方案 -> 编辑方案 -> 运行 -> 参数 -> 环境中)。
Add User-Defined Setting DEBUG_ACTIVITY_MODE
, then add Any iOS Simulator SDK
for Debug
and set it's value to disable
(in Project -> Build settings -> + -> User-Defined Setting)
添加 User-Defined Setting DEBUG_ACTIVITY_MODE
,然后添加Any iOS Simulator SDK
forDebug
并将其值设置为disable
(在 Project -> Build settings -> + -> User-Defined Setting 中)
回答by Dave Batton
Not really an answer, but more of a clue that might help somebody debug this...
不是真正的答案,而是更多可能有助于某人调试此问题的线索......
I started getting this warning as soon as I removed the AVFoundation framework from my Xcode 9/iOS 11 project. I am using AVFoundation (specifically AVPlayer and AVPlayerLayer), but it still ran and compiled fine after removing the framework from the target's Linked Frameworks and Libraries editor, and then removing it from the Frameworks folder (I was trying to eliminate a different runtime warning).
从我的 Xcode 9/iOS 11 项目中删除 AVFoundation 框架后,我就开始收到此警告。我正在使用 AVFoundation(特别是 AVPlayer 和 AVPlayerLayer),但在从目标的链接框架和库编辑器中删除框架后,它仍然可以正常运行和编译,然后从框架文件夹中删除它(我试图消除不同的运行时警告) .
Adding it back in via the Linked Frameworks and Libraries editor eliminated the runtime warnings in the console.
通过链接框架和库编辑器重新添加它消除了控制台中的运行时警告。