directshow - How can a filter implementing IStream know when it won't receive any further IStream commands -


i've written filter implements istream (the com interface not c++ standard library class). that's working problem i'm not sure when (if ever) can sure no further istream commands sent stream behind istream can closed.

the simplest place close stream in stop() on filter early.

according msdn docs, filter graph manager call stop() on filters in graph in upstream order filter stopped before upstream mux filter typically use istream end of streaming fixup (e.g. gdcl mp4 mux filter). i've verified in debugger stop() on filter called , exits before stop() called on upstream filters (which potentially result in further istream calls filter).

the system microsoft file writer filter seems able work out. during streaming sink file written file writer can't renamed or moved you'd expect file can moved once streaming has stopped. how microsoft file writer detecting it's safe close file? getting sort of callback once filters in graph have stopped or listening end of graph state change stopped plugin distributor? close file when istream interface released , reference count falls zero?


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -