home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Full mkv support & better avi support code ( multi strea
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="chanblard" data-source="post: 18283" data-attributes="member: 13350"><p>WARNING : </p><p></p><p>I saw that in your cvs directory :</p><p>[code]</p><p> bool AnalyseStreams()</p><p> {</p><p> sStreams_Sub_No_Subtitle.Id=0;</p><p> sStreams_Sub_No_Subtitle.Filter="";</p><p> cStreams_Audio=0;</p><p> cStreams_Video=0;</p><p> cStreams_Sub=0;</p><p> sStreams_Audio=new FilterStreamInfos[MAX_AUDIOSTREAMS];</p><p> sStreams_Video=new FilterStreamInfos[MAX_VIDEOSTREAMS];</p><p> sStreams_Sub=new FilterStreamInfos[MAX_SUBSTREAMS]; </p><p></p><p> IBaseFilter foundfilter=DirectShowUtil.GetFilterByName(graphBuilder,"Ogg Splitter");</p><p> string filter="Ogg Splitter";</p><p> if (foundfilter==null)</p><p> {</p><p> uint fetched=0;</p><p> IEnumFilters enumFilters;</p><p> graphBuilder.EnumFilters(out enumFilters);</p><p> if (enumFilters!=null)</p><p> {</p><p> enumFilters.Reset();</p><p> while (enumFilters.Next(1,out foundfilter,out fetched)==0)</p><p> {</p><p> if (foundfilter!=null && fetched==1)</p><p> {</p><p> IAMStreamSelect pStrm = foundfilter as IAMStreamSelect;</p><p> if (pStrm!=null)</p><p> {</p><p> break;</p><p> }</p><p> Marshal.ReleaseComObject(foundfilter);</p><p> }</p><p> }</p><p> Marshal.ReleaseComObject(enumFilters);</p><p> }</p><p> }</p><p>[/code]</p><p></p><p>this code don't work because IAMStreamSelect pStrm = foundfilter as IAMStreamSelect; will return a good pStrm for DirectVobSub filter. The problem is that DirectVobSub don't allow to choose audio streams or subtitles streams , so your code see the DirectVobSub first and stop searching , you must use :</p><p></p><p>[code]</p><p> public bool AnalyseStreams()</p><p> {</p><p> //INITIALIZE</p><p> sStreams_Sub_No_Subtitle.Id=0;</p><p> sStreams_Sub_No_Subtitle.Filter="";</p><p> cStreams_Audio=0;</p><p> cStreams_Video=0;</p><p> cStreams_Sub=0;</p><p> sStreams_Audio=new FilterStreamInfos[MAX_AUDIOSTREAMS];</p><p> sStreams_Video=new FilterStreamInfos[MAX_VIDEOSTREAMS];</p><p> sStreams_Sub=new FilterStreamInfos[MAX_SUBSTREAMS]; </p><p></p><p> //RETRIEVING THE CURRENT SPLITTER</p><p> string filter="Ogg Splitter";</p><p> IBaseFilter foundfilter=DirectShowUtil.GetFilterByName(filter);</p><p> if (foundfilter==null && DirectShowUtil.GetFilterByName("Splitter")==null){</p><p> filter=(m_strCurrentFile.Length>=64)?m_strCurrentFile.Substring(0,64):m_strCurrentFile; </p><p> foundfilter=DirectShowUtil.GetFilterByName(filter);</p><p> }</p><p></p><p> try{</p><p> if (foundfilter!=null)</p><p> {</p><p> int cStreams=0;</p><p> IAMStreamSelect pStrm = foundfilter as IAMStreamSelect;</p><p> if (pStrm!=null)</p><p> {</p><p> pStrm.Count(out cStreams);</p><p> //GET STREAMS</p><p> for (int istream=0;istream<cStreams;istream++)</p><p> {</p><p> AMMediaType sType;AMStreamSelectInfoFlags sFlag;</p><p> int sPDWGroup,sPLCid;string sName;</p><p> object pppunk,ppobject;</p><p> //STREAM INFO</p><p> pStrm.Info(istream,out sType,out sFlag,out sPLCid,</p><p> out sPDWGroup,out sName,out pppunk,out ppobject);</p><p></p><p> //VIDEO</p><p> if (sPDWGroup==0 && cStreams_Video<MAX_VIDEOSTREAMS)</p><p> {</p><p> sStreams_Video[cStreams_Video].Name=sName;</p><p> sStreams_Video[cStreams_Video].Id=istream;</p><p> sStreams_Video[cStreams_Video].Filter=filter;</p><p> sStreams_Video[cStreams_Video].Current=false;</p><p> if (cStreams_Video==0)</p><p> {</p><p> sStreams_Video[cStreams_Video].Current=true;</p><p> pStrm.Enable(istream,0);</p><p> pStrm.Enable(istream,AMStreamSelectEnableFlags.Enable);</p><p> }</p><p> cStreams_Video++;</p><p> }</p><p> else</p><p> //AUDIO</p><p> if (sPDWGroup==1 && cStreams_Audio<MAX_AUDIOSTREAMS)</p><p> {</p><p> sStreams_Audio[cStreams_Audio].Name=sName;</p><p> sStreams_Audio[cStreams_Audio].Id=istream;</p><p> sStreams_Audio[cStreams_Audio].Filter=filter;</p><p> sStreams_Audio[cStreams_Audio].Current=false;</p><p> if (cStreams_Audio==0)</p><p> {</p><p> sStreams_Audio[cStreams_Audio].Current=true;</p><p> pStrm.Enable(istream,0);</p><p> pStrm.Enable(istream,AMStreamSelectEnableFlags.Enable);</p><p> }</p><p> cStreams_Audio++;</p><p> }</p><p> else</p><p> //SUBTITLE</p><p> if (sPDWGroup==2 && cStreams_Sub<MAX_SUBSTREAMS && sName.LastIndexOf("off")==-1 && sName.LastIndexOf("No ")==-1&& sName.LastIndexOf("Miscellaneous ")==-1)</p><p> {</p><p> sStreams_Sub[cStreams_Sub].Name=sName;</p><p> sStreams_Sub[cStreams_Sub].Id=istream;</p><p> sStreams_Sub[cStreams_Sub].Filter=filter;</p><p> sStreams_Sub[cStreams_Sub].Current=false;</p><p> if (cStreams_Sub==0)</p><p> {</p><p> sStreams_Sub[cStreams_Sub].Current=true;</p><p> pStrm.Enable(istream,0);</p><p> pStrm.Enable(istream,AMStreamSelectEnableFlags.Enable);</p><p> }</p><p> cStreams_Sub++;</p><p> }</p><p> else </p><p> //NO SUBTITILE TAG</p><p> if (sPDWGroup==2 && cStreams_Sub<MAX_SUBSTREAMS && (sName.LastIndexOf("off")!=-1 || sName.LastIndexOf("No ")!=-1))</p><p> {</p><p> sStreams_Sub_No_Subtitle.Id=istream;</p><p> sStreams_Sub_No_Subtitle.Current=false;</p><p> sStreams_Sub_No_Subtitle.Filter=filter;</p><p> sStreams_Sub_No_Subtitle.Name=sName;</p><p> }</p><p> }</p><p> }</p><p> Marshal.ReleaseComObject(foundfilter); </p><p> } </p><p> }</p><p> catch</p><p> {</p><p> }</p><p> if (foundfilter!=null)</p><p> Marshal.ReleaseComObject(foundfilter);</p><p></p><p> return true;</p><p> }</p><p>[/code]</p><p></p><p></p><p></p><p>My msn messenger mail is : <a href="mailto:blanchardseb@hotmail.com">blanchardseb@hotmail.com</a></p></blockquote><p></p>
[QUOTE="chanblard, post: 18283, member: 13350"] WARNING : I saw that in your cvs directory : [code] bool AnalyseStreams() { sStreams_Sub_No_Subtitle.Id=0; sStreams_Sub_No_Subtitle.Filter=""; cStreams_Audio=0; cStreams_Video=0; cStreams_Sub=0; sStreams_Audio=new FilterStreamInfos[MAX_AUDIOSTREAMS]; sStreams_Video=new FilterStreamInfos[MAX_VIDEOSTREAMS]; sStreams_Sub=new FilterStreamInfos[MAX_SUBSTREAMS]; IBaseFilter foundfilter=DirectShowUtil.GetFilterByName(graphBuilder,"Ogg Splitter"); string filter="Ogg Splitter"; if (foundfilter==null) { uint fetched=0; IEnumFilters enumFilters; graphBuilder.EnumFilters(out enumFilters); if (enumFilters!=null) { enumFilters.Reset(); while (enumFilters.Next(1,out foundfilter,out fetched)==0) { if (foundfilter!=null && fetched==1) { IAMStreamSelect pStrm = foundfilter as IAMStreamSelect; if (pStrm!=null) { break; } Marshal.ReleaseComObject(foundfilter); } } Marshal.ReleaseComObject(enumFilters); } } [/code] this code don't work because IAMStreamSelect pStrm = foundfilter as IAMStreamSelect; will return a good pStrm for DirectVobSub filter. The problem is that DirectVobSub don't allow to choose audio streams or subtitles streams , so your code see the DirectVobSub first and stop searching , you must use : [code] public bool AnalyseStreams() { //INITIALIZE sStreams_Sub_No_Subtitle.Id=0; sStreams_Sub_No_Subtitle.Filter=""; cStreams_Audio=0; cStreams_Video=0; cStreams_Sub=0; sStreams_Audio=new FilterStreamInfos[MAX_AUDIOSTREAMS]; sStreams_Video=new FilterStreamInfos[MAX_VIDEOSTREAMS]; sStreams_Sub=new FilterStreamInfos[MAX_SUBSTREAMS]; //RETRIEVING THE CURRENT SPLITTER string filter="Ogg Splitter"; IBaseFilter foundfilter=DirectShowUtil.GetFilterByName(filter); if (foundfilter==null && DirectShowUtil.GetFilterByName("Splitter")==null){ filter=(m_strCurrentFile.Length>=64)?m_strCurrentFile.Substring(0,64):m_strCurrentFile; foundfilter=DirectShowUtil.GetFilterByName(filter); } try{ if (foundfilter!=null) { int cStreams=0; IAMStreamSelect pStrm = foundfilter as IAMStreamSelect; if (pStrm!=null) { pStrm.Count(out cStreams); //GET STREAMS for (int istream=0;istream<cStreams;istream++) { AMMediaType sType;AMStreamSelectInfoFlags sFlag; int sPDWGroup,sPLCid;string sName; object pppunk,ppobject; //STREAM INFO pStrm.Info(istream,out sType,out sFlag,out sPLCid, out sPDWGroup,out sName,out pppunk,out ppobject); //VIDEO if (sPDWGroup==0 && cStreams_Video<MAX_VIDEOSTREAMS) { sStreams_Video[cStreams_Video].Name=sName; sStreams_Video[cStreams_Video].Id=istream; sStreams_Video[cStreams_Video].Filter=filter; sStreams_Video[cStreams_Video].Current=false; if (cStreams_Video==0) { sStreams_Video[cStreams_Video].Current=true; pStrm.Enable(istream,0); pStrm.Enable(istream,AMStreamSelectEnableFlags.Enable); } cStreams_Video++; } else //AUDIO if (sPDWGroup==1 && cStreams_Audio<MAX_AUDIOSTREAMS) { sStreams_Audio[cStreams_Audio].Name=sName; sStreams_Audio[cStreams_Audio].Id=istream; sStreams_Audio[cStreams_Audio].Filter=filter; sStreams_Audio[cStreams_Audio].Current=false; if (cStreams_Audio==0) { sStreams_Audio[cStreams_Audio].Current=true; pStrm.Enable(istream,0); pStrm.Enable(istream,AMStreamSelectEnableFlags.Enable); } cStreams_Audio++; } else //SUBTITLE if (sPDWGroup==2 && cStreams_Sub<MAX_SUBSTREAMS && sName.LastIndexOf("off")==-1 && sName.LastIndexOf("No ")==-1&& sName.LastIndexOf("Miscellaneous ")==-1) { sStreams_Sub[cStreams_Sub].Name=sName; sStreams_Sub[cStreams_Sub].Id=istream; sStreams_Sub[cStreams_Sub].Filter=filter; sStreams_Sub[cStreams_Sub].Current=false; if (cStreams_Sub==0) { sStreams_Sub[cStreams_Sub].Current=true; pStrm.Enable(istream,0); pStrm.Enable(istream,AMStreamSelectEnableFlags.Enable); } cStreams_Sub++; } else //NO SUBTITILE TAG if (sPDWGroup==2 && cStreams_Sub<MAX_SUBSTREAMS && (sName.LastIndexOf("off")!=-1 || sName.LastIndexOf("No ")!=-1)) { sStreams_Sub_No_Subtitle.Id=istream; sStreams_Sub_No_Subtitle.Current=false; sStreams_Sub_No_Subtitle.Filter=filter; sStreams_Sub_No_Subtitle.Name=sName; } } } Marshal.ReleaseComObject(foundfilter); } } catch { } if (foundfilter!=null) Marshal.ReleaseComObject(foundfilter); return true; } [/code] My msn messenger mail is : [email]blanchardseb@hotmail.com[/email] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Full mkv support & better avi support code ( multi strea
Contact us
RSS
Top
Bottom