void SetupAssetReaderWriterForAudio(AVAssetTrack audioTrack) { if (audioTrack == null) { return; } // Decompress to Linear PCM with the asset reader // To read the media data from a specific asset track in the format in which it was stored, pass null to the settings parameter. AVAssetReaderOutput output = AVAssetReaderTrackOutput.Create(audioTrack, (AudioSettings)null); if (assetReader.CanAddOutput(output)) { assetReader.AddOutput(output); } AVAssetWriterInput input = AVAssetWriterInput.Create(audioTrack.MediaType, (AudioSettings)null); if (assetWriter.CanAddInput(input)) { assetWriter.AddInput(input); } // Create and save an instance of ReadWriteSampleBufferChannel, // which will coordinate the work of reading and writing sample buffers audioSampleBufferChannel = new AudioChannel(output, input); }
public ReadWriteSampleBufferChannel (AVAssetReaderOutput readerOutput, AVAssetWriterInput writerInput) { if (readerOutput == null) throw new ArgumentNullException ("readerOutput"); if (writerInput == null) throw new ArgumentNullException ("writerInput"); this.readerOutput = readerOutput; this.writerInput = writerInput; serializationQueue = new DispatchQueue ("ReadWriteSampleBufferChannel queue"); }
public VideoChannel (AVAssetReaderOutput readerOutput, AVAssetWriterInput writerInput, IVideoTransformer transformer) : base(readerOutput, writerInput) { if (transformer == null) throw new ArgumentNullException ("transformer"); this.transformer = transformer; var adaptorAttrs = new CVPixelBufferAttributes { PixelFormatType = CVPixelFormatType.CV32BGRA }; adaptor = new AVAssetWriterInputPixelBufferAdaptor (WriterInput, adaptorAttrs); }
public ReadWriteSampleBufferChannel(AVAssetReaderOutput readerOutput, AVAssetWriterInput writerInput) { if (readerOutput == null) { throw new ArgumentNullException("readerOutput"); } if (writerInput == null) { throw new ArgumentNullException("writerInput"); } this.readerOutput = readerOutput; this.writerInput = writerInput; serializationQueue = new DispatchQueue("ReadWriteSampleBufferChannel queue"); }
public VideoChannel(AVAssetReaderOutput readerOutput, AVAssetWriterInput writerInput, IVideoTransformer transformer) : base(readerOutput, writerInput) { if (transformer == null) { throw new ArgumentNullException("transformer"); } this.transformer = transformer; var adaptorAttrs = new CVPixelBufferAttributes { PixelFormatType = CVPixelFormatType.CV32BGRA }; adaptor = new AVAssetWriterInputPixelBufferAdaptor(WriterInput, adaptorAttrs); }
public ReadWriteSampleBufferChannel (AVAssetReaderOutput localAssetReaderOutput, AVAssetWriterInput localAssetWriterInput, bool useAdaptor) { _assetReaderOutput = localAssetReaderOutput; _assetWriterInput = localAssetWriterInput; _useAdaptor = useAdaptor; if (_useAdaptor) { var adaptorAttrs = new CVPixelBufferAttributes { PixelFormatType = CVPixelFormatType.CV32BGRA }; _adaptor = AVAssetWriterInputPixelBufferAdaptor.FromInput (localAssetWriterInput, adaptorAttrs.Dictionary); } _serializationQueue = new DispatchQueue ("ReadWriteSampleBufferChannel queue"); }
public ReadWriteSampleBufferChannel(AVAssetReaderOutput localAssetReaderOutput, AVAssetWriterInput localAssetWriterInput, bool useAdaptor) { _assetReaderOutput = localAssetReaderOutput; _assetWriterInput = localAssetWriterInput; _useAdaptor = useAdaptor; if (_useAdaptor) { var adaptorAttrs = new CVPixelBufferAttributes { PixelFormatType = CVPixelFormatType.CV32BGRA }; _adaptor = AVAssetWriterInputPixelBufferAdaptor.FromInput(localAssetWriterInput, adaptorAttrs.Dictionary); } _serializationQueue = new DispatchQueue("ReadWriteSampleBufferChannel queue"); }
private void SetupAssetReaderWriterForAudio(AVAssetTrack audioTrack) { if (audioTrack == null) { return; } // Decompress to Linear PCM with the asset reader AVAssetReaderOutput output = AVAssetReaderTrackOutput.Create(audioTrack, (AudioSettings)null); _assetReader.AddOutput(output); AVAssetWriterInput input = AVAssetWriterInput.Create(audioTrack.MediaType, (AudioSettings)null); _assetWriter.AddInput(input); // Create and save an instance of AAPLRWSampleBufferChannel, // which will coordinate the work of reading and writing sample buffers _audioSampleBufferChannel = new ReadWriteSampleBufferChannel(output, input, false); }
public AudioChannel (AVAssetReaderOutput readerOutput, AVAssetWriterInput writerInput) : base(readerOutput, writerInput) { }
public AudioChannel(AVAssetReaderOutput readerOutput, AVAssetWriterInput writerInput) : base(readerOutput, writerInput) { }