首先 - 我的母语不是英语,对可能的错误深表歉意。
我需要为 MediaCapture 使用我自己的视频效果,为 WS 8.1 和 WP 8.1 制作这个,然后我开始将它移植到 Win 10,此时开始出现问题。我的视频效果作为运行时组件(dll)制作,在这个模块中我有 ActivatableClass 并且它正在工作!对于 win 8.1,我修改了清单并为我的组件添加了引用,我使用了这个参数的 AddEffectAsync 方法
m_mediaCaptureMgr->AddEffectAsync(Windows::Media::Capture::MediaStreamType::VideoPreview,"OcvComponent.SmileDetector",nullptr)
在 Win 10 中,我在类似的代码中崩溃了
_mediaCapture->AddVideoEffectAsync(ref new Effects::VideoEffectDefinition("OcvComponent.SmileDetector"), Capture::MediaStreamType::VideoPreview)
我已经尝试过这样的旧的,很好的工作方法,结果也是崩溃
_mediaCapture->AddEffectAsync(Capture::MediaStreamType::VideoPreview,"OcvComponent.SmileDetector", nullptr)
两种情况下的清单我都用这个修改
<Extensions>
<Extension Category="windows.activatableClass.inProcessServer">
<InProcessServer>
<Path>OcvComponent.dll</Path>
<ActivatableClass ActivatableClassId="OcvComponent.SmileDetector" ThreadingModel="both" />
</InProcessServer>
</Extension>
应用程序因此消息而崩溃
这个崩溃出现在使用 ActivatableClass 构造函数之前,所以断点对我没有帮助。
此外,我应该告诉应用程序,我将视频效果称为从 github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CameraVideoStabilization/cpp 获取的样本(对不起,链接不正确,声誉不足),我不明白为什么,但我通常无法将此项目的引用添加到我的组件中,我有这个,所以我用这个在文本编辑器中修改项目文件
<ItemGroup>
<ProjectReference Include="..\OcvComponent\OcvComponent.vcxproj">
<Project>{E84D5530-529F-49B4-811C-3D7FE0902B7E}</Project>
</ProjectReference>
我认为这件事可以联系起来。
请帮助我使用 C++ 语言、Visual Studio 2015、Win 10 解决这个问题