找不到 RGBFilters 入口点 DllRegisterServer

RGBFilters entry-point DllRegisterServer was not found

我正在尝试构建一个包含多个摄像头的 DirectShow 应用程序,这些摄像头可以在任意时间连接、断开连接或附加到预览监视器,留下应用程序的中央处理图 运行。架构如下所示:

辅助this post (among other resources), I've gotten GMFBridge工作到源图和处理图在程序启动时构造和连接的地方,三个图理论上是运行。但是,由于none的效果图windows附上了,所以我真的不知道。

一路走来的一件事是 Color Space ConverterSmart Tee 和渲染器之间需要过滤器才能使视频正常工作。因此,我在 Smart Tee 和桥接过滤器之间设置了 Color Space Converter 过滤器,假设它们将强制执行所需的视频格式。

现在我正在尝试构建一个 Monitor Window 图形,它以桥接源过滤器开始,馈入渲染器。第一次尝试拒绝连接引脚,因为他们无法就媒体类型达成一致。 (异常中的错误消息是 "there is no common media type between these pins"。)我在它们之间放了一个 Color Space Converter,这样就可以构建图形,但结果是黑色渲染器 window。我使用 GraphEdit 连接到 运行 图,发现 Color Space Converter 输入的媒体类型是 ARGB32,而它的输出是 RGB565。我怀疑这是黑屏的原因,所以我搜索了一种使输出为 RGB32 以匹配相机格式的方法。我发现无法直接设置 Color Space Converter 的输出格式,您必须将它连接到只接受所需格式的过滤器。在 this post 中,我发现“RGBFilters 示例中的 TransNull32 确实做到了这一点。

当我意识到 TransNull32 滤镜在我的系统中找不到时,我开始寻找 "magical" RGBFilters。在 this post I found a link to a Wikipedia page that has a download link for the most recent version of a Microsoft SDK that includes the RGBFilters source code, Windows Server 2003 R2 Platform SDK.

我从该映像文件刻录了一张光盘,并在我的系统上安装了 SDK。当我转到 RGBFilters 目录时,我发现它有一个 Makefile 但没有 VC++ 或 VisualStudio 文件。我从 Makefile 创建了一个新的 VisualStudio2015 项目,并经历了调试其构建的过程:

我终于构建了 RGBFilters.dll,并尝试了 regsvr32 RGBFilters.dll - 并得到了

我以为我在this Microsoft post中找到了答案,但我得到的是

Sat 04/22/2017  8:48:00.27 Microsoft Windows [Version 6.1.7601]
C:\...\RGBFilters\Debug > C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm RGBFilters.dll /tlb:RGBFilters.tlb
Microsoft .NET Framework Assembly Registration Utility version 4.6.1055.0
for Microsoft .NET Framework version 4.6.1055.0
Copyright (C) Microsoft Corporation.  All rights reserved.

RegAsm : error RA0000 : Failed to load 'C:\Program Files (x86)\Microsoft\wServer 2003 R2 Platform SDK\Samples\Multimedia\DirectShow\Filters\RGBFilters\Debug\RGBFilters.dll' because it is not a valid .NET assembly

Sat 04/22/2017  8:56:02.02 Microsoft Windows [Version 6.1.7601]
C:\...\RGBFilters\Debug >

然后,按照 this post 中的建议,我尝试了 运行 depends.exe,但找不到任何看起来像 DLL 导出列表的内容。我也试过了

Sat 04/22/2017 10:21:25.33 Microsoft Windows [Version 6.1.7601]
C:\...\RGBFilters\Debug > dumpbin /exports RGBFilters.dll
Microsoft (R) COFF/PE Dumper Version 14.00.24215.1
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file RGBFilters.dll

File Type: DLL

  Summary

        1000 .00cfg
        7000 .data
        1000 .gfids
        2000 .idata
       22000 .rdata
        6000 .reloc
        1000 .rsrc
       59000 .text

Sat 04/22/2017 10:21:38.61 Microsoft Windows [Version 6.1.7601]
C:\...\RGBFilters\Debug >

如您所见,此 DLL 中有 no 导出符号 - 这就是为什么所有内容都在其中阻塞的原因。我查看了 VisualStudio 中的所有项目设置,没有发现任何问题,所以我无法解释这个完全虚假的 DLL 是如何构建的。

我是否像我强烈怀疑的那样错过了将 Makefile 转换为 VS 项目的一些关键步骤?

编辑

一个RGBFilters.def文件,在VS项目中被列为源文件之一,包含

;===========================================================================
;  Copyright (c) 1992-2002  Microsoft Corporation.  All Rights Reserved.
;===========================================================================

EXPORTS
            DllMain                 PRIVATE
            DllGetClassObject       PRIVATE
            DllCanUnloadNow         PRIVATE
            DllRegisterServer       PRIVATE
            DllUnregisterServer     PRIVATE

Roman R 所述,需要在 Configuration Properties -> Linker -> Input 页面的 Module Definition File 字段中的项目属性中引用 RGBFilters.def 文件。

一旦我对项目进行了更改并重新构建它,regsvr32 RGBFilters.dll 就按预期工作了。