问题
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
回答1:
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.
来源:https://stackoverflow.com/questions/8187754/delphi-xe2-firemonkey-playing-video-with-libvlc