在DirectShow中控制纵横比(全屏模式) [英] Controlling the aspect ratio in DirectShow (full screen mode)

查看:145
本文介绍了在DirectShow中控制纵横比(全屏模式)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过一种简单的方法(IGraphBuilder RenderFile)使用DirectShow,并尝试通过查询补充接口来控制其他所有内容。

I'm using DirectShow with a simple approach (IGraphBuilder RenderFile) and try to control everything else with querying supplemental interfaces.

有问题的选项是宽高比。我以为默认情况下会对其进行维护,但是实际上同一程序在不同的计算机(也许是DirectX的版本)上的行为会有所不同。对于窗口中的视频来说,这不是一个大问题,因为我可以自己维护窗口的纵横比(基于视频大小),但是对于全屏模式,我无法理解如何控制。

The option in question is aspect ratio. I thought that it is maintained by default, but actually the same program behaves differently on different machines (maybe versions of DirectX). This is not a huge problem for a video in a window, because I can maintain the aspect ratio of my window by myself (based on the video size), but for full-screen mode I can not understand how can I control.

我发现至少有两个复杂的选择:用于VMR视频和添加叠加混合器,但是对于IGraphBuilder的RenderFile视频,有没有一种已知的方法?

I found that there are at least two complex options: for VMR video and with adding overlay mixer, but is there a known way for doing this for IGraphBuilder' RenderFile video?

推荐答案

当您执行IGraphBuilder :: RenderFile时,它会在内部向图形添加视频渲染器过滤器。它通常是 VMR-7视频渲染器过滤器

When you do IGraphBuilder::RenderFile, it internally adds a video renderer filter to the graph. It is typically a VMR-7 Video Renderer Filter:


在Windows XP和更高版本中,视频混合渲染器7(VMR-7)是
默认视频渲染器。之所以称为VMR-7,是因为内部
使用DirectDraw 7。

In Windows XP and later, the Video Mixing Renderer 7 (VMR-7) is the default video renderer. It is called the VMR-7 because internally it uses DirectDraw 7.

此时,您可以枚举图形过滤器,找到VMR-7并使用其接口,例如 IVMRAspectRatioControl 指定兴趣模式。

At this point you can enumerate graph's filters, locate VMR-7 and use its interfaces such as IVMRAspectRatioControl to specify mode of interest.

这篇关于在DirectShow中控制纵横比(全屏模式)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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