If you are the source, then why not just extend the CMediaSample class with an own interface?
Or a second approach would be to send the MediaType with each sample and then save the extra bytes in the pbFormat
block.
If you need to send information on a sample basis, these two methods are the best and cleanest way.