public void setTracks(List <MediaTrackFormat> sourceTracks) { tracks = new List <TargetTrack>(sourceTracks.Count); foreach (MediaTrackFormat sourceTrackFormat in sourceTracks) { TargetTrack targetTrack; if (sourceTrackFormat is VideoTrackFormat videoTrackFormat) { VideoTrackFormat trackFormat = new VideoTrackFormat((VideoTrackFormat)sourceTrackFormat); trackFormat.width = DEFAULT_VIDEO_WIDTH; trackFormat.height = DEFAULT_VIDEO_HEIGHT; trackFormat.bitrate = DEFAULT_VIDEO_BITRATE; trackFormat.keyFrameInterval = DEFAULT_KEY_FRAME_INTERVAL; targetTrack = new TargetVideoTrack(sourceTrackFormat.index, true, false, trackFormat); } else if (sourceTrackFormat is AudioTrackFormat) { AudioTrackFormat trackFormat = new AudioTrackFormat((AudioTrackFormat)sourceTrackFormat); trackFormat.bitrate = DEFAULT_AUDIO_BITRATE; targetTrack = new TargetAudioTrack(sourceTrackFormat.index, true, false, trackFormat); } else { targetTrack = new TargetTrack(sourceTrackFormat.index, true, false, new MediaTrackFormat(sourceTrackFormat)); } tracks.Add(targetTrack); } NotifyChange(); }
public AudioTrackFormat(AudioTrackFormat audioTrackFormat) : base(audioTrackFormat) { this.channelCount = audioTrackFormat.channelCount; this.samplingRate = audioTrackFormat.samplingRate; this.bitrate = audioTrackFormat.bitrate; this.duration = audioTrackFormat.duration; }
public TargetAudioTrack(int sourceTrackIndex, bool shouldInclude, bool shouldTranscode, AudioTrackFormat format) : base(sourceTrackIndex, shouldInclude, shouldTranscode, format) { }