예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AVPacket"/> class.
 /// </summary>
 /// <param name="client">
 /// An implementation of the <see cref="FFmpegClient"/> interface which provides access to the native FFmpeg functions.
 /// </param>
 public AVPacket(FFmpegClient client)
 {
     this.client = client;
     this.handle = client.AllocPacket();
     client.InitPacket(this.handle);
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AVIOContext"/> class.
 /// </summary>
 /// <param name="ffmpeg">
 /// An implementation of the <see cref="FFmpegClient"/> interface which provides access to the native FFmpeg functions.
 /// </param>
 /// <param name="handle">
 /// A <see cref="AVIOContextHandle"/> which points to the native <see cref="NativeAVIOContext"/>
 /// object.
 /// </param>
 public AVIOContext(FFmpegClient ffmpeg, AVIOContextHandle handle)
 {
     this.ffmpeg = ffmpeg;
     this.handle = handle;
     this.buffer = new AVMemoryHandle(this.ffmpeg, this.NativeObject->buffer, ownsHandle: false);
 }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AVFormatContextHandle"/> class.
 /// </summary>
 /// <param name="ffmpeg">
 /// The ffmpeg client.
 /// </param>
 /// <param name="context">
 /// The handle to be wrapped.
 /// </param>
 public unsafe AVFormatContextHandle(FFmpegClient ffmpeg, NativeAVFormatContext *context)
     : base((IntPtr)context, true)
 {
     this.ffmpeg = ffmpeg;
 }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="H264Decoder"/> class.
 /// </summary>
 /// <param name="stream">
 /// The <see cref="Stream"/> from which to consume data.
 /// </param>
 /// <param name="logger">
 /// The logger to use when logging.
 /// </param>
 /// <param name="client">
 /// The ffmpeg client to access the FFmpeg API.
 /// </param>
 public H264Decoder(Stream stream, ILogger <H264Decoder> logger, FFmpegClient client)
 {
     this.client = client;
     this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
     this.stream = stream ?? throw new ArgumentNullException(nameof(stream));
 }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AVFrameHandle"/> class.
 /// </summary>
 /// <param name="ffmpeg">
 /// An implementation of the <see cref="FFmpegClient"/> interface, which allows releasing
 /// the handle.
 /// </param>
 public AVFrameHandle(FFmpegClient ffmpeg)
     : base((IntPtr)ffmpeg.AllocFrame(), true)
 {
     this.ffmpeg = ffmpeg;
 }
예제 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AVFrameHandle"/> class.
 /// </summary>
 /// <param name="ffmpeg">
 /// An implementation of the <see cref="FFmpegClient"/> interface, which allows releasing
 /// the handle.
 /// </param>
 /// <param name="context">
 /// The handle to be wrapped.
 /// </param>
 public AVFrameHandle(FFmpegClient ffmpeg, NativeAVFrame *context)
     : base((IntPtr)context, true)
 {
     this.ffmpeg = ffmpeg;
 }
예제 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AVCodec"/> class.
 /// </summary>
 /// <param name="client">
 /// An implementation of the <see cref="FFmpegClient"/> which provides access to the native FFmpeg functions.
 /// </param>
 /// <param name="context">
 /// The the native codec context.
 /// </param>
 /// <param name="codec">
 /// The netive codec object.
 /// </param>
 /// <remarks>
 /// Use only for testing purposes.
 /// </remarks>
 public AVCodec(FFmpegClient client, NativeAVCodecContext *context, NativeAVCodec *codec)
 {
     this.context = context;
     this.native  = codec;
     this.client  = client;
 }
예제 #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AVFrame"/> class.
 /// </summary>
 /// <param name="client">
 /// An implementation of the <see cref="FFmpegClient"/> interface which provides access to the native FFmpeg functions.
 /// </param>
 public AVFrame(FFmpegClient client)
     : this(client, new AVFrameHandle(client))
 {
 }
예제 #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AVFrame"/> class.
 /// </summary>
 /// <param name="client">
 /// An implementation of the <see cref="FFmpegClient"/> interface which provides access to the native FFmpeg functions.
 /// </param>
 /// <param name="handle">
 /// A <see cref="AVFrameHandle"/> which points to the native <see cref="NativeAVFrame"/>
 /// object.</param>
 public AVFrame(FFmpegClient client, AVFrameHandle handle)
 {
     this.handle = handle;
     this.client = client;
 }