Exemplo n.º 1
0
        public static List <IsochronousTrackInfo> GetTrackCharacteristics(IMediaStream source, TracksIncluded audioVideo, int videoTrackID)
        {
            List <IsochronousTrackInfo> tracksInfo  = new List <IsochronousTrackInfo>(source.MediaTracks.Count);
            IsochronousTrackInfo        baseTrkInfo = null;
            int videoID = 1; // first destination video track ID should be 1

            foreach (IMediaTrack track in source.MediaTracks)
            {
                if (((track.Codec.CodecType == CodecTypes.Audio) && (audioVideo != TracksIncluded.Video)) ||
                    ((track.Codec.CodecType == CodecTypes.Video) && ((videoTrackID == 0) || (track.TrackID == videoTrackID)) &&
                     (audioVideo != TracksIncluded.Audio)))
                {
                    switch (track.Codec.CodecType)
                    {
                    case CodecTypes.Audio:
                        baseTrkInfo = new RawAudioTrackInfo(source);
                        break;

                    case CodecTypes.Augment:
                        baseTrkInfo = null; // FIXME: need IsochronousTrackInfo class for Augment
                        break;

                    case CodecTypes.Meta:
                        baseTrkInfo = null; // FIXME: need IsochronousTrackInfo classe for Meta
                        break;

                    case CodecTypes.Video:
                        int sourceVideoID = (videoTrackID == 0) ? track.TrackID : videoTrackID;
                        baseTrkInfo         = new RawVideoTrackInfo(source, sourceVideoID);
                        baseTrkInfo.TrackID = videoID++;
                        break;

                    default:
                        throw new Exception("Unknown track type in input");
                    }
                    if (baseTrkInfo != null)
                    {
                        tracksInfo.Add(baseTrkInfo);
                    }
                }
            }

            if ((videoID == 1) && (videoTrackID > 0))
            {
                throw new Exception("Track ID specified not found in source stream");
            }

            return(tracksInfo);
        }
Exemplo n.º 2
0
 public RawTrackInfo(GenericAudioTrack audio, GenericVideoTrack video)
 {
     AudioTrackInfo = new RawAudioTrackInfo(audio);
       VideoTrackInfo = new RawVideoTrackInfo(video);
 }
Exemplo n.º 3
0
 public RawTrackInfo()
 {
     AudioTrackInfo = new RawAudioTrackInfo();
       VideoTrackInfo = new RawVideoTrackInfo();
 }
Exemplo n.º 4
0
        public static List<IsochronousTrackInfo> GetTrackCharacteristics(IMediaStream source, TracksIncluded audioVideo, int videoTrackID)
        {
            List<IsochronousTrackInfo> tracksInfo = new List<IsochronousTrackInfo>(source.MediaTracks.Count);
              IsochronousTrackInfo baseTrkInfo = null;
              int videoID = 1; // first destination video track ID should be 1
              foreach (IMediaTrack track in source.MediaTracks)
              {
            if (((track.Codec.CodecType == CodecTypes.Audio) && (audioVideo != TracksIncluded.Video)) ||
              ((track.Codec.CodecType == CodecTypes.Video) && ((videoTrackID == 0) || (track.TrackID == videoTrackID)) &&
              (audioVideo != TracksIncluded.Audio)))
            {
              switch (track.Codec.CodecType)
              {
            case CodecTypes.Audio:
              baseTrkInfo = new RawAudioTrackInfo(source);
              break;
            case CodecTypes.Augment:
              baseTrkInfo = null; // FIXME: need IsochronousTrackInfo class for Augment
              break;
            case CodecTypes.Meta:
              baseTrkInfo = null; // FIXME: need IsochronousTrackInfo classe for Meta
              break;
            case CodecTypes.Video:
              int sourceVideoID = (videoTrackID == 0) ? track.TrackID : videoTrackID;
              baseTrkInfo = new RawVideoTrackInfo(source, sourceVideoID);
              baseTrkInfo.TrackID = videoID++;
              break;
            default:
              throw new Exception("Unknown track type in input");
              }
              if (baseTrkInfo != null)
            tracksInfo.Add(baseTrkInfo);
            }
              }

              if ((videoID == 1) && (videoTrackID > 0))
            throw new Exception("Track ID specified not found in source stream");

              return tracksInfo;
        }
Exemplo n.º 5
0
 public RawTrackInfo(GenericAudioTrack audio, GenericVideoTrack video)
 {
     AudioTrackInfo = new RawAudioTrackInfo(audio);
     VideoTrackInfo = new RawVideoTrackInfo(video);
 }
Exemplo n.º 6
0
 public RawTrackInfo()
 {
     AudioTrackInfo = new RawAudioTrackInfo();
     VideoTrackInfo = new RawVideoTrackInfo();
 }