Away from Vancouver


I have been away from home, Vancouver, since January 2012, very busy at work. My blog has been on hold, saddly.

Our baby girl is coming; she is late; she is supposed to arrive to the world yesterday. Our family is growing, with a big boy, now a baby girl as well!

Find out which allocators the DirectShow filters are using?


In my DVR media player projects, I made two filters: one source filter(push) to read data from DVR, and one decoder (transform) filter to decode the video. Most allocator work is taken care of by DirectShow base classes. I dig deeper into the allocators when I was doing renderless mode.
The question is: How many allocators are in the graph and where are they from?
There are two, one from decoder’s input pin, and one from VMR’s input pin.
Here are my findings by stepping into the base class code.
First allocator (used by source filter):

CBaseOutputPin::DecideAllocator(IMemInputPin *pPin, __deref_out IMemAllocator **ppAlloc)
//*ppAlloc is the allocator the source filter's output pin will be using.
//*ppAlloc is from decoder's input pin. 
//It's created (by CreateMemoryAllocator, instead of re-used) beause decoding isn't inplace
//instead of using allocator from next input pin, this pin can override InitAllocator to use it's own.
//*ppAlloc is apporved by DecideBufferSize()

Second allocator (used by decoder filter):

CBaseOutputPin::DecideAllocator(IMemInputPin *pPin, __deref_out IMemAllocator **ppAlloc)
//*ppAlloc is the allocator the decoder filter's output pin will be using.
//*ppAlloc is from VMR's input pin.
//*ppAlloc is apporved by DecideBufferSize()

Summary: for a non-inplace transform filter, in most circumstances, it’s input pin provides allocator for it’s upstream output pin, and it’s outpin uses the allocator from it’s downstream’s input pin.

A trip to the states


We went to Microsoft yesterday for an interview of SDE4. My fields include C++, Win32, 3D, UI and compiling technologies and the interivewers are very knowledgable in these fields. They even pinpointed a grammer glitch when my compiler interprets the scripts. It went pretty well as most questions were limited to what I did before. You never know; it’s often feel-great interviews bring no offer.

My favorites



My star