Reputation: 12018
I am experimenting with Windows Media Foundation.
I have created one example application as described in below link:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms703190(v=vs.85).aspx
In the above example I have added two video streams using MFCreateAggregateSource
In the EVR renderer I am able to hear audio of both the videos but I am able to see only one video which is first loaded.
I am trying to position the videos separately using below code, so that both the video are see in the window:
if (status == MF_TOPOSTATUS_READY)
{
HRESULT hr1 = MFGetService(m_pSession, MR_VIDEO_MIXER_SERVICE,IID_PPV_ARGS(&m_pVideoMixerControl));
MFVideoNormalizedRect objRect1;
objRect1.left = 0;
objRect1.top = 0;
objRect1.right = 100;
objRect1.bottom = 100;
m_pVideoMixerControl->SetStreamOutputRect(0, &objRect1);
MFVideoNormalizedRect objRect2;
objRect2.left = 105;
objRect2.top = 0;
objRect2.right = 200;
objRect2.bottom = 200;
m_pVideoMixerControl->SetStreamOutputRect(1, &objRect2);
hr = StartPlayback();
}
But I don't see any effect of this code on the video or either I am not able to position two video streams in the one player separately.
What am I doing wrong, Or how exactly it is done in Windows Media Foundation.
Upvotes: 0
Views: 266
Reputation: 1515
Values of MFVideoNormalizedRect are in the range 0.0 to 1.0 : MFVideoNormalizedRect
Example :
objRect1.left = 0.0; // must be in the range 0.0 to 1.0
objRect1.top = 0.0; // must be in the range 0.0 to 1.0
objRect1.right = 0.5; // must be in the range 0.0 to 1.0
objRect1.bottom = 0.5; // must be in the range 0.0 to 1.0
Upvotes: 1