Delphi XE2:firemonkey使用libvlc播放视频吗? [英] Delphi XE2: firemonkey playing video with libvlc?

查看:143
本文介绍了Delphi XE2:firemonkey使用libvlc播放视频吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仍在尝试使用带libvlc的DirectX API在firemonkey上播放视频!我已经以不同的方式播放视频,但是我想在DirectX曲面上播放视频。



请先查看此链接: http://forum.videolan.org/viewtopic.php?f=32&t=82618



有人写了一个关于如何在DirectX上使用libvlc的delphi代码,该代码运行良好,但是此代码是纯Directx代码。我想将此代码集成到firemonkey!我该如何使用firemonkey库来做到这一点(我也知道Windows的firemonkey也使用DirectX库,但是firemonkey库(接口,类,对象)的命名和使用方式与DirectX完全不同!



我现在所在的位置:



我几乎使用 Winapi.Direct3D9,Winapi.D3DX9,FMX.Context.DX9库将此纯Directx代码集成到firemonkey中。 p>

我可以在firemonkey上下文中访问IDirect3DDevice9对象!

  var 
设备:IDirect3DDevice9;
开始
设备:= TCustomDirectXContext(TCustomForm3D(ParentForm).Context).Device;
Device.CreateTexture(video_width,video_height,1,D3DUSAGE_DYNAMIC,D3DFMT_A8R8G8B8,D3DPOOL_FA vlcVideoTexture,nil);
Device.CreateTexture(video_width,video_height,1,0,D3DFMT_A8R8G8B8,D3DPOOL_SYSTEMMEM,vlcMemoryTexture,nil);
end;

此处完全可以在firemonkey中工作,但是您会看到此代码类型的结果对象是IDirect3DTexture9,该对象包含视频的帧缓冲区,我只需要将该对象呈现给firemonkey形式的控件即可。



如何在Firemonkey画布上绘制此缓冲区?



我正在等待好的delphi开发人员解决方案。



谢谢

解决方案

我不认为可以用LibVlc尝试Direct3D,因为libvlc请求向任何窗口播放视频的句柄,因为它们具有有效的句柄,所以可以任何形式播放。


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

解决方案

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.

这篇关于Delphi XE2:firemonkey使用libvlc播放视频吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆