Answered by:
About media type of SOurce filter

Question
-
Hi All,
I am adding a source filter using addsourcefilter api wherein i am providing the path of teh file which happens to be an AMR file. How do i get to know what media type the output pin of this source filter is ...
do i have an API or do i have to set it ...
I need the MAJOR type to be AUDIO and minor type to be _AMR
Regards,
Burrrough
Friday, January 19, 2007 11:09 AM
Answers
-
You have two ways to handle this :
1) register a custom file type ( see : http://msdn2.microsoft.com/en-us/library/ms787558.aspx ) so that the file source can determine the correct media type from the extension and/or patterns in the content of the file.
2) an easier way is to explicitely create the file source filter (cocreate), add it to the graph, and use the IFileSource interface::Load method to specify the filename and the media type :
HRESULT Load(
LPCOLESTR pszFileName,
const AM_MEDIA_TYPE *pmt
);The you just do ICaptureGraphBuilder2.renderstream with the filter as a source.
Friday, January 19, 2007 12:31 PM
All replies
-
You have two ways to handle this :
1) register a custom file type ( see : http://msdn2.microsoft.com/en-us/library/ms787558.aspx ) so that the file source can determine the correct media type from the extension and/or patterns in the content of the file.
2) an easier way is to explicitely create the file source filter (cocreate), add it to the graph, and use the IFileSource interface::Load method to specify the filename and the media type :
HRESULT Load(
LPCOLESTR pszFileName,
const AM_MEDIA_TYPE *pmt
);The you just do ICaptureGraphBuilder2.renderstream with the filter as a source.
Friday, January 19, 2007 12:31 PM -
Thanx a lot for that reply..
I understand that the after the load i will be succesfully creating the source filter with Major type as AUDIO and minor type as AMR..
I have my own transform filter written (output of major type AUDIO and minor type PCM) ,so i do a cocreat and add it ot the graph and connnect.(please correct me if i am wrong here)
I was just wondering whats the best option i have to render after the above manual connection fo the filter...
I mean what do i use to render ???
Regards
Friday, January 19, 2007 1:10 PM -
After connecting your source to your transform, the easiest solution is to do
ICaptureGraphBuilder2->RenderStream with your transform as the source, leaving compressor and renderer Null.
You could also add a default audio renderer and connect it manually.
Rgds,
Friday, January 19, 2007 10:06 PM