Esempio n. 1
0
 protected override bool EnumerateStreams(bool forceRefresh)
 {
   //FIXME: TSReader only offers Audio in IAMStreamSelect, it would be cleaner to expose subs as well.
   bool refreshed = base.EnumerateStreams(forceRefresh);
   if (refreshed)
   {
     // If base class has refreshed the stream infos, then update the subtitle streams.
     ISubtitleStream subtitleStream = _sourceFilter as ISubtitleStream;
     int count = 0;
     if (subtitleStream != null)
     {
       _streamInfoSubtitles = new StreamInfoHandler();
       subtitleStream.GetSubtitleStreamCount(ref count);
       if (count > 0)
       {
         StreamInfo subStream = new StreamInfo(null, NO_STREAM_INDEX, NO_SUBTITLES, 0);
         _streamInfoSubtitles.AddUnique(subStream);
       }
       for (int i = 0; i < count; ++i)
       {
         //FIXME: language should be passed back also as LCID
         SubtitleLanguage language = new SubtitleLanguage();
         int type = 0;
         subtitleStream.GetSubtitleStreamLanguage(i, ref language);
         subtitleStream.GetSubtitleStreamType(i, ref type);
         int lcid = LookupLcidFromName(language.lang);
         string name = type == 0
                         ? String.Format("{0} (DVB)", language.lang)
                         : String.Format("{0} (Teletext)", language.lang);
         StreamInfo subStream = new StreamInfo(null, i, name, lcid);
         _streamInfoSubtitles.AddUnique(subStream);
       }
     }
   }
   return refreshed;
 }
Esempio n. 2
0
 protected override bool EnumerateStreams(bool forceRefresh)
 {
   //FIXME: TSReader only offers Audio in IAMStreamSelect, it would be cleaner to expose subs as well.
   bool refreshed = base.EnumerateStreams(forceRefresh);
   if (refreshed)
   {
     // If base class has refreshed the stream infos, then update the subtitle streams.
     ISubtitleStream subtitleStream = _sourceFilter as ISubtitleStream;
     int count = 0;
     if (subtitleStream != null)
     {
       _streamInfoSubtitles = new StreamInfoHandler();
       subtitleStream.GetSubtitleStreamCount(ref count);
       if (count > 0)
       {
         StreamInfo subStream = new StreamInfo(null, NO_STREAM_INDEX, NO_SUBTITLES, 0);
         _streamInfoSubtitles.AddUnique(subStream);
       }
       for (int i = 0; i < count; ++i)
       {
         //FIXME: language should be passed back also as LCID
         SubtitleLanguage language = new SubtitleLanguage();
         subtitleStream.GetSubtitleStreamLanguage(i, ref language);
         int lcid = LookupLcidFromName(language.lang);
         // Note: the "type" is no longer considered in MP1 code as well, so I guess DVBSub3 only supports Bitmap subs at all.
         string name = language.lang;
         StreamInfo subStream = new StreamInfo(null, i, name, lcid);
         _streamInfoSubtitles.AddUnique(subStream);
       }
     }
   }
   return refreshed;
 }