FFMpegAttachedPic.cs 615 B

12345678910111213
  1. using Bmp.Core.FFMpeg.CsCorePorts.FFMpegWrap.Interops;
  2. namespace Bmp.Core.FFMpeg.CsCoreExt;
  3. public unsafe class FFMpegAttachedPic
  4. {
  5. private readonly AVStream* _avStream;
  6. public ReadOnlySpan<byte> Data => new(_avStream->attached_pic.data, _avStream->attached_pic.size);
  7. public IReadOnlyDictionary<string, string> Meta => _avStream->metadata == null ? Array.Empty<KeyValuePair<string, string>>().ToDictionary() : _avStream->metadata->Elements.Select(p => new KeyValuePair<string, string>(p.Key, p.Value)).ToDictionary();
  8. internal FFMpegAttachedPic(AVStream* avStream) => _avStream = avStream;
  9. }