XP上DirectShow视频上的分层窗口 [英] Layered window over DirectShow video with XP

查看:72
本文介绍了XP上DirectShow视频上的分层窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我开发了一个应用程序,该应用程序应该使用DirectShow在专用窗口中播放视频,而分层窗口允许使用GDI +在视频上显示png位图.
所有这些在Windows 7上都可以正常运行,但是在XP下,我会看到分层位图的闪烁,视频也变得断断续续.

我正在考虑4个可能的问题:
-CPU,对于Windows 7机器是i7 1,7Ghz,而对于XP机器是2Ghz双核.
-Areo可以在Windows 7中顺利管理分层窗口的东西
-需要某些特定硬件功能的图形设备(两台机器都使用嵌入式芯片组)
-我的代码中的某些内容与XP完全不兼容,但由于某些原因可以与7兼容.

请注意,主视频窗口的创建如下:

m_hWnd = CreateWindowEx(0,"VIDEO_WND",Vidéo",WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,
NULL,NULL,m_hInst,this);


以这种方式创建分层窗口时:
(m_hWnd是主视频窗口)

RECT rPos;
GetWindowRect(m_hWnd,& rPos);
int nLX = rPos.right-rPos.left;
int nLY = rPos.bottom-rPos.top;
m_hwndLayer = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT,"LAYER","LayerHabillage",WS_OVERLAPPED | WS_VISIBLE,rPos.left,rPos.top,nLX,nLY,m_hWnd,0,m_hInst,0); <

任何想法将不胜感激.
在此先谢谢您.

Hi all,
I developped an application that is supposed to play a video in a dedicated window by using DirectShow, while a layered window allows for displaying of a png bitmap over the video, using GDI+.
All this works fine and smoothly with windows 7, but under XP I get flickering of the layered bitmap and video is choppy.

I am considering 4 possible issues :
- The CPU, which is an i7 1,7Ghz for the Windows 7 machine but a 2Ghz Dual Core for the XP machine
- Areo stuff that would manage layered windows smootly in Windows 7
- The graphic device that would need some specific hardware capabilities (both machines are using the embedded chipset)
- Something in my code that is not fully compliant with XP but would work with 7 for some reason.

Note that the main video window is created as following :

m_hWnd = CreateWindowEx(0, "VIDEO_WND", "Vidéo", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, m_hInst, this);


while the layered window is created this way :
(m_hWnd is the main video window)

RECT rPos;
GetWindowRect(m_hWnd,&rPos);
int nLX = rPos.right-rPos.left;
int nLY = rPos.bottom-rPos.top;
m_hwndLayer = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT, "LAYER", "LayerHabillage", WS_OVERLAPPED | WS_VISIBLE, rPos.left, rPos.top, nLX, nLY, m_hWnd, 0, m_hInst, 0);


Any idea would be very appreciated.
Thanks in advance.

推荐答案

您可以使用DirectShow视频混合渲染器(VMR9)进行覆盖.
You could use DirectShow Video Mixing Renderer (VMR9) for overlay.


感谢您的建议.
实际上,这是我首先尝试的解决方案(它确实有效),但是由于我还处理静止图像,并且由于VMR9带来了静止图像的其他问题,所以我不想管理这两种情况,也不想拥有一个独特的解决方案. br/> 最后,也许我将不得不同时管理两者.

实际上,有人已经成功在带有XP的DShow视频上用分层窗口覆盖了位图吗?
Thanks for the advice.
Actually, that was the solution I tried first (and it actually works), but as I also deal with still images, and as VMR9 brings other issues with still images, I did not want to manage both cases and have a unique solution.
At the end, maybe I''ll have to manage both.

In fact, did someone already succeed in overlaying a bitmap with layered windows over DShow video with XP ?


这篇关于XP上DirectShow视频上的分层窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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