将 c 转换为 c#(使用 smem 的 libvlc 方法)
我正在尝试在这里转换 C 代码: http://wiki.videolan.org/Stream_to_memory_(smem)_tutorial 到 C# 的开源项目 (ispy)。
我目前的主要问题是转换方法签名:
void handleStream(void* p_audio_data, uint8_t* p_pcm_buffer, unsigned int Channels, unsigned int rates, unsigned int nb_samples, unsigned int bits_per_sample, unsigned int size, int64_t pts )< /code>
转换为 C# 等效项。有什么想法吗?
I'm trying to convert the C code here:
http://wiki.videolan.org/Stream_to_memory_(smem)_tutorial
to C# for an open source project (ispy).
My main problem at the moment is converting the method signature:
void handleStream(void* p_audio_data, uint8_t* p_pcm_buffer, unsigned int channels, unsigned int rate, unsigned int nb_samples, unsigned int bits_per_sample, unsigned int size, int64_t pts )
into a C# equivalent. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果这是一个回调,我会将其设为 C# 委托:
If that is a callback, I would make it a C# delegate:
在 http://sourceforge.net/projects/libvlcnet/ 处有一个 libvlc 的 .NET 包装器,您或许应该使用它并让它处理 P/Invoke 的详细信息。
There is a .NET wrapper for libvlc at http://sourceforge.net/projects/libvlcnet/, you should probably use that and let it handle the details of P/Invoke.
还有 Vlc.DotNet
该项目有 Vlc.DotNet.Core.Interops 库,为所有版本的 VLC 互操作提供VLC≥1.1
Also there is Vlc.DotNet
The project have Vlc.DotNet.Core.Interops library which provide VLC interops for all versions of VLC >= 1.1