自定义DirectShow视频渲染器过滤器 - 动态分辨率更改 [英] Custom DirectShow Video Renderer Filter - Dynamic Resolution Change

查看:694
本文介绍了自定义DirectShow视频渲染器过滤器 - 动态分辨率更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自定义DirectShow视频渲染器过滤器,它具有一些超过的微软视频渲染器过滤器 。我知道我可以用 Transform Filter 来做同样的事情,但是我选择了这种方式。我也相信,我将面对与 Transform Filter 相同的问题,我将在下面介绍。



当我使用 Microsoft的Video Renderer Filter ,它可以在流启动/更改时自动调整窗口大小和缓冲区大小。我的过滤器是能够做到这一点,但除了,我无法接收事件流开始后。我相信我可以查询,但我不知道如何。



当前事件管道如下所示。

  On Pin Connect 
--------------
CreateInstance
Video Renderer类构造函数
CheckMediaType
SetMediaType
- >宽度:100,高度:100
CheckMediaType
CheckMediaType
CheckMediaType
SetMediaType
- >宽度:100,高度:100

在玩
-------
StartStreaming
DoRenderSample
...
。 ..
...
DoRenderSample

停止
-------
Video Renderer类析构函数

由我的源过滤器设置的默认窗口大小为100x100。我能够得到这个引脚连接两次。但在 StartStreaming 之后,我无法得到 CheckMediaType SetMediaType Microsoft的Video Renderer 能够自动调整大小 StartStreaming

问题:


    li>在流式传输开始之后,我应该如何触发 CheckMediaType / SetMediaType 调用?其实 SetMediaType 对我来说是重要的。或者是有另一种方式来查询当前的流解析?
  1. 我是否需要检查 DoRenderSample


解决方案> CheckMediaType and SetMediaType 并不完全是事件,它们不是自己来的,所以你不能触发它们。你要改变决议吗?你自己像VMR一样延伸步伐吗?或接受来自上游过滤器的分辨率更改?



本MSDN部分涵盖了详细信息:动态格式更改


I have a Custom DirectShow Video Renderer Filter which has some extended features over Microsoft's Video Renderer Filter like overlay images. I know I could do the same with a Transform Filter but I've chosen that way. I also believe, I would face the same problem with a Transform Filter which I'll describe below.

When I use Microsoft's Video Renderer Filter, it is capable of resizing the window and buffer sizes automatically when stream starts/changes. My filter is capable of doing the same but except, I'm unable to receive events after stream starts. I believe I can query somehow but I don't know how.

Current event pipeline is like below.

On Pin Connect
--------------
CreateInstance  
Video Renderer Class Constructor
CheckMediaType  
SetMediaType    
-> Width: 100, Height: 100  
CheckMediaType  
CheckMediaType  
CheckMediaType  
SetMediaType
-> Width: 100, Height: 100  

On Play
-------
StartStreaming
DoRenderSample
...
...
...
DoRenderSample

On Stop
-------
Video Renderer Class Destructor

Default windows size set by my source filter is 100x100. I'm able to get this on pin connect twice. But after StartStreaming, I'm unable to get CheckMediaType and SetMediaType events again. I could try to trigger them from source filter (it's my code as well) but since Microsoft's Video Renderer is capable of automatically resizing on StartStreaming, I wanted to have the same feature.

Questions:

  1. How should I trigger CheckMediaType / SetMediaType calls after streaming starts? Actually SetMediaType is the important one for me. Or is there another way to query current stream resolution?
  2. Do I need to check for possible video size changes continuously in DoRenderSample?

解决方案

CheckMediaType and SetMediaType are not exactly "events", they don't come up on their own, so you cannot trigger them. Are you going to change resolutions? On your own to extend stride like VMR does? Or accept resolution changes from upstream filter?

This MSDN section covers details: Dynamic Format Changes.

这篇关于自定义DirectShow视频渲染器过滤器 - 动态分辨率更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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