Delphi XE2:firemonkey 使用 libvlc 播放视频?
我仍在尝试使用 directx api 和 libvlc 在 firemonkey 上播放视频!我已经使用不同的方式播放视频,但我想在 directx 表面上播放视频。
请先查看此链接:http://forum.videolan.org/viewtopic .php?f=32&t=82618
有人写了一段有关如何在 directx 上使用 libvlc 的 delphi 代码,该代码运行良好,但该代码是纯 directx 代码。我想将此代码集成到 firemonkey 中!我怎样才能用firemonkey库做到这一点(我知道Windows firemonkey也使用directx库,但是firemonkey库(接口,类,对象)的命名和使用与directx如此不同!
我现在在哪里:
我几乎将这个纯directx代码集成到firemonkey中与“Winapi.Direct3D9、Winapi.D3DX9、FMX.Context.DX9”库一起使用,
我可以访问 firemonkey Context 中的 IDirect3DDevice9 对象
var
Device: IDirect3DDevice9;
begin
Device := TCustomDirectXContext(TCustomForm3D(ParentForm).Context).Device;
Device.CreateTexture(video_width, video_height, 1, D3DUSAGE_DYNAMIC, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, vlcVideoTexture, nil);
Device.CreateTexture(video_width, video_height, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, vlcMemoryTexture, nil);
end;
! href="http://forum.videolan.org/viewtopic.php?f=32&t=82618" rel="nofollow">此处 完全在 firemonkey 中工作,但您将看到此代码的结果对象类型是 IDirect3DTexture9 ,这个对象包含视频的帧缓冲区,我只需要以 firemonkey 形式将该对象渲染到某个控件上。
我
正在等待好的 delphi 开发人员解决方案
。
I am still trying to play video on firemonkey using directx api with libvlc! I have played video using by different way already but I want to play video on directx surface.
please looked this link first : http://forum.videolan.org/viewtopic.php?f=32&t=82618
someone write a delphi code about how to use libvlc on directx and that code working well, but this code is pure directx code. I want to integrate this code to firemonkey! How can I do it with firemonkey library(I know for windows firemonkey using directx library too but firemonkey libraries (interfaces, classes, objects) naming and using so different then directx!
Where I am now:
I almost integrate this pure directx code to firemonkey using with "Winapi.Direct3D9, Winapi.D3DX9, FMX.Context.DX9" libraries
I can access to IDirect3DDevice9 object in firemonkey Context!
var
Device: IDirect3DDevice9;
begin
Device := TCustomDirectXContext(TCustomForm3D(ParentForm).Context).Device;
Device.CreateTexture(video_width, video_height, 1, D3DUSAGE_DYNAMIC, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, vlcVideoTexture, nil);
Device.CreateTexture(video_width, video_height, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, vlcMemoryTexture, nil);
end;
That code in here working completely in firemonkey but you will see the result object of this code type is IDirect3DTexture9 , this object contains frame buffer of video, i just need to render this object to on some control in firemonkey form.
How can I draw this buffer to firemonkey canvas?
I am waiting good delphi developers solutions.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不认为尝试使用 LibVlc 进行 direct3D 是可能的,因为 libvlc 向任何窗口请求句柄来播放视频,在任何形式上播放都可以,因为它们具有有效的句柄。
I do not think trying direct3D with LibVlc is possible since libvlc request handle to any window to play video, playing on any form is ok since they have valid handle.