gpt4 book ai didi

macos - Mac 10.9.1 上的 SGNewChannel 错误 -9405

转载 作者:行者123 更新时间:2023-12-01 08:30:13 25 4
gpt4 key购买 nike

我收到一个错误 –9405,couldntGetRequiredComponent,带有

SGNewChannel(m_Grabber, VideoMediaType, &m_Channel)

在 Mac 系统 10.9.1 上。此代码适用于旧系统。其他人有这个问题吗?

编辑 - 初始化代码:

// standard SG initialization 
err = OpenADefaultComponent(SeqGrabComponentType, 0, &m_Grabber);
err = SGInitialize(m_Grabber);
err = SGSetDataRef(m_Grabber, 0, 0, seqGrabDontMakeMovie);

最佳答案

花了一些时间对 SGNewChannel 在 OS X 10.8 和 10.9 上所做的事情进行逆向工程后,我发现了可能是 10.9 上新行为的原因。

SGNewChannel 函数试图打开一个视频数字化器组件,其中的代码大致相当于这个(减去日志):

ComponentDescription componentDescription = {'vdig', 0, 0, 0, 0};
Component component = FindNextComponent(NULL, &componentDescription);
while (component)
{
Handle componentName = NewHandle(255);
Handle componentInfo = NewHandle(255);
GetComponentInfo(component, NULL, componentName, componentInfo, NULL);
ComponentInstance ci;
OSErr err = OpenAComponent(component, &ci);
printf("*** %5d (%p) %p %s -- %s\n", err, ci, component, P2CStr((StringPtr)*componentName), P2CStr((StringPtr)*componentInfo));
DisposeHandle(componentName);
DisposeHandle(componentInfo);
component = FindNextComponent(component, &componentDescription);
}

如果你在 10.9 上运行它,你会得到这样的结果:

DVFreeThread - CFMachPortCreateWithPort hack = 0x18caf0, fPowerNotifyPort= 0x18ce90
*** -9408 (0x0) 0x10207 DV Video -- This component is the FireWire Video Digitizer
*** 704 (0x0) 0x10216 IIDC FireWire Video -- This is the Apple IIDC FireWire Video Digitizer.
*** 704 (0x0) 0x10323 USB Video Class Video -- This is the Apple USB Video Class Video Digitizer.

OpenAComponent 的三个调用失败(一次错误 -9408,两次错误 704)。

如果你在 10.8 上运行它,你会得到这样的结果:

DVFreeThread - CFMachPortCreateWithPort hack = 0x5751a0, fPowerNotifyPort= 0x576cd0
*** -9408 (0x0) 0x10208 DV Video -- This component is the FireWire Video Digitizer
*** 704 (0x0) 0x10217 IIDC FireWire Video -- This is the Apple IIDC FireWire Video Digitizer.
*** 0 (0x830000) 0x10324 USB Video Class Video -- This is the Apple USB Video Class Video Digitizer.

注意最后一次调用成功了!

Apple USB Video Class Video Digitizer 组件位于 /System/Library/QuickTime/QuickTimeUSBVDCDigitizer.component。所以我通过在 APWVDOUSBVDCDigitizerEntry 上的 lldb 中设置符号断点来查看该组件中 10.8 和 10.9 的不同之处。

事实证明这可能是与沙盒相关的问题。在 10.9 上,对 device-camerasandbox_check 调用在 10.8 上不存在。所以我建议您尝试添加访问相机的权利,看看是否可以解决问题。

关于macos - Mac 10.9.1 上的 SGNewChannel 错误 -9405,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20669326/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com