
I realized I just cannot rely on GetSyncSource to verify that a filter supports IReferenceClock interface.
The following function tells me if a filter supports it or not :
private IReferenceClock IsImplementingIReferenceClock(ICaptureGraphBuilder2 capGraph, IBaseFilter capFilter)
{
int hr;
object o;
Guid GuidInterfaceToFind = typeof(IReferenceClock).GUID;
hr = capGraph.FindInterface(null, null, capFilter, GuidInterfaceToFind, out o);
if (hr != 0)
{
return null;
}
else
{
IReferenceClock returnedIReference = (IReferenceClock)o;
return returnedIReference;
}
}
After the interface is found from the TV Capture Card, I set the source to it using the following code.
IReferenceClock returnedClockReference = IsImplementingIReferenceClock(pBuilder, pAVerMedia7231AnalogCapture);
pVideoRenderer.SetSyncSource(returnedClockReference);
pDefaultDirectSoundDevice.SetSyncSource(returnedClockReference);
Is that ok ? Should I set the sync to more filters or that would be ok ?
I will let you know the result overtime later.
Thanks.