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); }
public RawTrackInfo(GenericAudioTrack audio, GenericVideoTrack video) { AudioTrackInfo = new RawAudioTrackInfo(audio); VideoTrackInfo = new RawVideoTrackInfo(video); }
public RawTrackInfo() { AudioTrackInfo = new RawAudioTrackInfo(); VideoTrackInfo = new RawVideoTrackInfo(); }
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; }