Skip to content

Commit

Permalink
Query the EVR Presenter for ISubRenderConsumer
Browse files Browse the repository at this point in the history
  • Loading branch information
babgvant authored and Cyberbeing committed Oct 1, 2014
1 parent 87448d2 commit 04d5513
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/filters/transform/vsfilter/VSFilter.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(SolutionDir)lib;$(OutDir)..</AdditionalLibraryDirectories>
<AdditionalDependencies Condition="'$(Configuration)'=='Debug'">strmbaseD.lib;dsutilD.lib;subtitlesD.lib;subpicD.lib;basevideofilterD.lib;libssfD.lib;log4cplus_staticDU.lib;KasumiD.lib;systemD.lib;unrarD.lib</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)'=='Debug' And '$(VisualStudioVersion)'&gt;'11.0'">strmbaseD.lib;dsutilD.lib;subtitlesD.lib;subpicD.lib;basevideofilterD.lib;libssfD.lib;log4cplus_staticDU.lib;KasumiD.lib;systemD.lib;unrarD.lib;dwmapi.lib</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)'=='Release'">delayimp.lib;strmbaseR.lib;dsutilR.lib;subtitlesR.lib;subpicR.lib;basevideofilterR.lib;libssfR.lib;log4cplus_staticRU.lib;KasumiR.lib;systemR.lib;unrarR.lib;winmm.lib</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)'=='Release' And '$(VisualStudioVersion)'&gt;'11.0'">delayimp.lib;strmbaseR.lib;dsutilR.lib;subtitlesR.lib;subpicR.lib;basevideofilterR.lib;libssfR.lib;log4cplus_staticRU.lib;KasumiR.lib;systemR.lib;unrarR.lib;winmm.lib;dwmapi.lib</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)'=='Debug'">strmbaseD.lib;dsutilD.lib;subtitlesD.lib;subpicD.lib;basevideofilterD.lib;libssfD.lib;log4cplus_staticDU.lib;KasumiD.lib;systemD.lib;unrarD.lib;Mfuuid.lib</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)'=='Debug' And '$(VisualStudioVersion)'&gt;'11.0'">strmbaseD.lib;dsutilD.lib;subtitlesD.lib;subpicD.lib;basevideofilterD.lib;libssfD.lib;log4cplus_staticDU.lib;KasumiD.lib;systemD.lib;unrarD.lib;dwmapi.lib;Mfuuid.lib</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)'=='Release'">delayimp.lib;strmbaseR.lib;dsutilR.lib;subtitlesR.lib;subpicR.lib;basevideofilterR.lib;libssfR.lib;log4cplus_staticRU.lib;KasumiR.lib;systemR.lib;unrarR.lib;winmm.lib;Mfuuid.lib</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)'=='Release' And '$(VisualStudioVersion)'&gt;'11.0'">delayimp.lib;strmbaseR.lib;dsutilR.lib;subtitlesR.lib;subpicR.lib;basevideofilterR.lib;libssfR.lib;log4cplus_staticRU.lib;KasumiR.lib;systemR.lib;unrarR.lib;winmm.lib;dwmapi.lib;Mfuuid.lib</AdditionalDependencies>
<RegisterOutput>false</RegisterOutput>
</Link>
<ResourceCompile>
Expand Down
24 changes: 24 additions & 0 deletions src/filters/transform/vsfilter/xy_sub_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include "xy_logger.h"

#include "moreuuids.h"
#include <Mfidl.h>
#include <evr.h>

#if ENABLE_XY_LOG_RENDERER_REQUEST
# define TRACE_RENDERER_REQUEST(msg) XY_LOG_TRACE(msg)
Expand Down Expand Up @@ -2384,6 +2386,26 @@ HRESULT XySubFilter::FindAndConnectConsumer(IFilterGraph* pGraph)
if(pBF != (IBaseFilter*)this)
{
CComQIPtr<ISubRenderConsumer> new_consumer(pBF);
CLSID filterID;
hr = pBF->GetClassID(&filterID);

if(!new_consumer && filterID == CLSID_EnhancedVideoRenderer)
{
//EVR wouldn't implement ISubRenderConsumer itself, but a custom presenter might.
CComQIPtr<IMFGetService> evrservices(pBF);
if(evrservices)
{
ISubRenderConsumer * tmpCI = NULL;
HRESULT hrevr = evrservices->GetService(MR_VIDEO_RENDER_SERVICE, __uuidof(ISubRenderConsumer), (LPVOID*)&tmpCI);
if(tmpCI)
{
CComQIPtr<ISubRenderConsumer> tmpconsumer(tmpCI);
new_consumer = tmpconsumer;
SAFE_RELEASE(tmpCI);
}
}
}

if (new_consumer)
{
ULONG new_meric = 0;
Expand All @@ -2405,6 +2427,8 @@ HRESULT XySubFilter::FindAndConnectConsumer(IFilterGraph* pGraph)
consumer = new_consumer;
}
}
m_consumer = consumer;
hr = UpdateParamFromConsumer(true);
}
}
}
Expand Down

0 comments on commit 04d5513

Please sign in to comment.