[vlc-devel] re : VLC DirectX programing

MaFai zh-ma at hkbn.com.hk
Thu Jun 12 06:04:20 CEST 2003


Hello, gbazin,

With the --no-directx-hw-yuv,the video output will be cut a half of fraction.But the code really work.It can get the DC.
With the --directx-use-sysmem,vlc can not find this option,and I have review the vlc help,no this option too.May be the spell wrong.
I also try --directx-use-system.Invariblely,it fail.

Source Code

    if( !p_vout->p_sys->b_using_overlay )
    {
			..............
			.........
			...
			HDC       hScrDC,DC;
            HBITMAP    hBitmap;
			//HDC DC;
			int xScrn,yScrn;
			HRESULT dxresultcut;

			dxresultcut = IDirectDrawSurface2_GetDC(p_pic->p_sys->p_surface,&DC);

			if(dxresultcut != DD_OK)
			{
			    msg_Err(p_vout,"Can not get DC");
				//msg_Err(p_vout,dxresultcut);
			}
			else
				msg_Err(p_vout,"Get DC now");

			xScrn = GetDeviceCaps(DC, HORZRES);
			yScrn = GetDeviceCaps(DC, VERTRES);
			msg_Err(p_vout,"%i %i",xScrn,yScrn);
			//Cut
            hScrDC = CreateDC("DISPLAY", NULL, NULL, NULL);
			hBitmap = CreateCompatibleBitmap(hScrDC, xScrn, yScrn);
			BitBlt(hScrDC, 0, 0, xScrn, yScrn,DC,xScrn, yScrn, SRCCOPY);
            DeleteDC(hScrDC);
			if(OpenClipboard(p_vout->p_sys->hwnd))
            {
                       EmptyClipboard();
                       SetClipboardData(CF_BITMAP,hBitmap);
                       CloseClipboard();
            }
			//End cut
			IDirectDrawSurface2_ReleaseDC(p_pic->p_sys->p_surface,&DC);

xScrn always be 1024 and xYcrn always 768,why not equals to the video dialog's width and height?
When the vlc run by  vlc --no-directx-hw-yuv,it will cut the image into the clipboard,but the image 
never contain a picture,it's fullfilled by black color.May you check it? And idea would be appreciated.




======= At 2003-05-19, 15:25:00 you wrote: =======

>Have you tried running vlc with the --no-directx-hw-yuv --directx-use-sysmem options ?
>
>--
>Gildas
>-- 
>This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
>To unsubscribe, please read http://developers.videolan.org/lists.html
>If you are in trouble, please contact <postmaster at videolan.org>
>
>.

= = = = = = = = = = = = = = = = = = = =
			

Best regards.				 
MaFai
zh-ma at hkbn.com.hk
2003-06-12

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fox.gif
Type: image/gif
Size: 9519 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20030612/aa275b81/attachment.gif>


More information about the vlc-devel mailing list