0

Is there any reason why the size of BufferLen in ISampleGrabberCB.BufferCB with the media subtype not set should vary if called from different programming languages?

I have a C# app and a VB.NET app that both run a graph as quickly as possible with the clock turned off and no media subtype set on the SampleGrabber. The code is identical. In the C# app, the size of BufferLen is different every time a sample passes through the grabber (as you'd expect). In the VB.NET app, BufferLen is a constant fixed value.

When running a 1280 x 720 video through the graph, for example, the size of BufferLen in the VB code is always 1,382,400 (which sort of makes sense as the output pin on the video decoder is showing a 12-bit NV12 format). In the C# code, the size of BufferLen varies wildly between low and high values.

Does anyone know why this happens?

1
  • What are the values in C#? Also inspect the graph, it might so happen that the topology is not identical that you expect it. Mar 22, 2013 at 4:18

2 Answers 2

0

The variable buffer length indicates that you're getting compressed video. I can't explain why that might be though. Is one version running as admin? Or in 64 bits?

0

Problem solved. The graphs are not identical, in fact: in the C# app, the AVI splitter is connected directly to the SampleGrabber; in the VB app, an unexpected video decoder is sitting between the two. It turns out that the VB code is rendering the graph before tearing it down and rebuilding it, which means the media subtype has already been set. Thanks to you both for your help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.