【发布时间】:2016-04-17 12:09:22
【问题描述】:
首先 - 我的母语不是英语,对于可能出现的错误,我们深表歉意。
我需要为 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>
应用程序因this 消息而崩溃
这个崩溃出现在使用 ActivatableClass 构造函数之前,所以断点对我没有帮助。
另外我应该告诉应用程序,我调用 videoeffect 的样本取自 github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CameraVideoStabilization/cpp(抱歉链接不正确,声誉不足) ,我不明白为什么,但我通常无法将这个项目的引用添加到我的组件中,我有this,所以我用这个修改了文本编辑器中的项目文件
<ItemGroup>
<ProjectReference Include="..\OcvComponent\OcvComponent.vcxproj">
<Project>{E84D5530-529F-49B4-811C-3D7FE0902B7E}</Project>
</ProjectReference>
我认为这些东西可以连接起来。
请帮我解决这个问题 使用C++语言,Visual Studio 2015,Win 10
【问题讨论】:
标签: c++ windows-runtime uwp cordova-win10