Setting (thread) priority of DirectShow Graphs/Filters ?



Hi,

I was wondering if it is possible to adjust the thread priority of a
filter graph. For example, using a DirectShow filter graph to transcode
a file will result in 100% CPU usage in which case it would be nice to
run the filter graph (and therefore any threads used by its filters) at
(say) idle priority.

Similarily when using a Filter graph to record from a capture card (or
playback etc) it would be nice to be able to set a high priority so
that a normal priority process using 100% CPU would cause problems.
(Other ways to achieve the above desired effects are of course welcome)

Im hoping to be able to do this from C# btw, as thats the
implementation language of the application which creates and runs these
graphs, but C++ API hints would also be nice.
Please note that im not able to change the source code of the filters
involved in the graph.

In regards to all this, could someone perhaps (just briefly) explain
how many threads are involved in a filter graph? That is, when you
start a filter graph will it sometimes(always?) create a seperate
thread per filter in the graph?

I note that in MS Media Center video playback is not affected by high
CPU usage(though GUI interaction is) so im guessing this is possible
somehow.

.



Relevant Pages