1上SGNewChannel错误

1上SGNewChannel错误

本文介绍了在Mac 10.9.1上SGNewChannel错误-9405的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到错误–9405,couldntGetRequiredComponent

I am getting an error –9405, couldntGetRequiredComponent, with

SGNewChannel(m_Grabber, VideoMediaType, &m_Channel)

在Mac系统10.9.1上为

.该代码在较旧的系统上有效.还有其他人遇到这个问题吗?

on Mac system 10.9.1. This code works on older systems. Is anyone else having this issue?

编辑-初始化代码:

// 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上新行为的原因.

After spending some time reverse engineering what SGNewChannel does on both OS X 10.8 and 10.9 I have found what might be the cause of the new behavior on 10.9.

SGNewChannel函数尝试使用一些与此大致等效的代码(减去日志)来打开视频数字化仪组件:

The SGNewChannel function tries to open a video digitizer component with some code roughly equivalent to this (minus the logs):

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上运行此命令,则会得到以下结果:

If you run this on 10.9, you will get this result:

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).

The three calls to OpenAComponent fail (once with error -9408 and twice with error 704).

如果在10.8上运行此命令,则会得到以下结果:

If you run this on 10.8, you will get this result:

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.

注意最后一次呼叫成功!

Notice that the last calls succeeds!

Apple USB视频类视频数字化仪组件位于/System/Library/QuickTime/QuickTimeUSBVDCDigitizer.component.因此,我通过在APWVDOUSBVDCDigitizerEntry上的lldb中设置符号断点(该组件的入口点)来查看该组件在10.8和10.9上有什么不同.

The Apple USB Video Class Video Digitizer component is located at /System/Library/QuickTime/QuickTimeUSBVDCDigitizer.component. So I looked at what’s different on 10.8 and 10.9 in this component by setting a symbolic breakpoint in lldb on APWVDOUSBVDCDigitizerEntry which is the entry point of this component.

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

It turns out it may be a sandbox related issue. On 10.9, there is a call to sandbox_check for device-camera that doesn’t exist on 10.8. So I suggest that you try to add an entitlement to access the camera and see if that solves the problem.

这篇关于在Mac 10.9.1上SGNewChannel错误-9405的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 17:19