如何编写DirectX音频推送源

发布于 2024-12-06 05:14:29 字数 159 浏览 0 评论 0原文

我想创建一个 DirectX“过滤器”来获取单个音频通道。我已经看过 Platform SDK 示例项目,但缺点是它们需要 ATL 库。

有没有一种方法可以创建 DirectX 过滤器而无需借助 ATL 或 MFC?即,仅使用 gcc(例如 MinGW)和其他实际上免费的工具的某种方式?

I want to create a DirectX 'filter' that sources a single channel of audio. I have seen the Platform SDK sample projects, but the downside there is that those require the ATL library.

Is there a way to create DirectX filters without resorting to ATL or MFC? I.e., some way using only gcc (e.g., MinGW) and other actually free tools?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

腻橙味 2024-12-13 05:14:29

如果我理解正确的话,过滤器必须是一个 COM 组件。如果需要的话,您可以从大多数编译器中编写这些代码。

然而,涉及的样板文件将令人难以置信,我有一个 18kloc 代码库,当转换为 COM 组件时,它变成了 25kloc (最终将其转回原样,只是因为 COM 样板文件比小型的实际代码多)插件)。

据我所知,MFC 并不是必需的,也不总是参与编写 COM 组件。

ATL 通过提供模板和函数来在编译时处理大量细节,从而大大简化了这一过程。您也许可以从 GCC 使用它,但我不确定会发生什么;我怀疑它是否会发挥作用,尽管它可能会起作用。

如果没有 ATL,您需要 MIDL 并从那里生成代码。这可以通过免费工具实现,它在 Wine 项目的几个地方完成了;您可以在那里检查代码和工具链。

无论您在哪里执行此操作,如果您坚持使用“实际上免费”的工具(因为它们不是专门设计用于与 COM 一起使用),那么这将是一种痛苦,而且是严重的痛苦。

If I understand right, the filter has to be a COM component. You can, sort of, write those from most compilers, if need be.

However, the boilerplate that would involve would be incredible, I had a 18kloc codebase that turned into 25kloc when turned into COM components (ended up turning it back just because there was more boilerplate COM than actual code for small plugins).

MFC isn't necessary or always involved in writing COM components, that I know of.

ATL helps simplify that greatly, by providing templates and functions to handle a lot of the details at compile-time. You may be able to use it from GCC, but I'm not sure what would happen; I doubt it would work well, though it might work.

Without ATL, you need MIDL and to generate the code from there. That is possible with free tools, it's done in a few places in the Wine project; you may check the code and toolchains there.

No matter where you do it, it'll be a pain, and a serious pain if you insist on using "actually free" tools for it (as they're not particularly designed to work with COM).

幸福还没到 2024-12-13 05:14:29

如果您考虑使用 DirectShow 过滤器,那么最好的起点是 PushSource Windows SDK Sample,它生成视频并使其生成音频。

另请注意,DirectShow 基类是最早的 COM 基类之一,它们不使用 ATL/MFC。基类本身也包含在 Windows SDK 中。

If you had DirectShow filter in mind, the best starting point would be PushSource Windows SDK Sample, which generates video and making it generate audio.

Also note that DirectShow bases classes are one of the earliest COM bases and they do not use ATL/MFC. The base classses themselves are also included with Windows SDK.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文