mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-13 01:34:14 +01:00
693acabac4
* Move PosterWithAudio to FFMpegCore
* Reduce windows only tests
* Update Directory.Build.props
* Create .editorconfig
* More cleanup
* Enable implicit usings
* Remove unused method
* Apply dotnet format
* Fix unused variable in AudioGateArgument
* Fix boolean conditions in AudioGateArgument
* Merge boolean conditions into pattern
* Use target-typed new
* Add linting to CI
* Add CUDA to HardwareAccelerationDevice enum
* Increase timeout for Video_Join_Image_Sequence
* Adjust Video_Join_Image_Sequence timeout
* Fix expected seconds in Video_Join_Image_Sequence
* Increase timeout for Video_TranscodeToMemory due to macos agents
Former-commit-id: f9f7161686
27 lines
845 B
C#
27 lines
845 B
C#
using FFMpegCore.Pipes;
|
|
|
|
namespace FFMpegCore.Extend
|
|
{
|
|
public class PcmAudioSampleWrapper : IAudioSample
|
|
{
|
|
//This could actually be short or int, but copies would be inefficient.
|
|
//Handling bytes lets the user decide on the conversion, and abstract the library
|
|
//from handling shorts, unsigned shorts, integers, unsigned integers and floats.
|
|
private readonly byte[] _sample;
|
|
|
|
public PcmAudioSampleWrapper(byte[] sample)
|
|
{
|
|
_sample = sample;
|
|
}
|
|
|
|
public void Serialize(Stream stream)
|
|
{
|
|
stream.Write(_sample, 0, _sample.Length);
|
|
}
|
|
|
|
public async Task SerializeAsync(Stream stream, CancellationToken token)
|
|
{
|
|
await stream.WriteAsync(_sample, 0, _sample.Length, token).ConfigureAwait(false);
|
|
}
|
|
}
|
|
}
|