Video.cs 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. namespace OpenVIII.AV
  2. {
  3. using FFmpeg.AutoGen;
  4. public class Video : Ffcc
  5. {
  6. #region Methods
  7. /// <summary>
  8. /// Opens filename and init class.
  9. /// </summary>
  10. public static Video Load(string filename) =>
  11. Load<Video>(filename, AVMediaType.AVMEDIA_TYPE_VIDEO);
  12. /// <summary>
  13. /// Opens filename and init class.
  14. /// </summary>
  15. /// <remarks>
  16. /// Could be better, but there are many hoops to jump through.
  17. /// </remarks>
  18. /// <see cref="https://stackoverflow.com/questions/9604633/reading-a-file-located-in-memory-with-libavformat"/>
  19. /// <seealso cref="http://www.ffmpeg.org/doxygen/trunk/doc_2examples_2avio_reading_8c-example.html"/>
  20. /// <seealso cref="https://stackoverflow.com/questions/24758386/intptr-to-callback-function"/>
  21. public static unsafe Video Load(BufferData bufferData, byte[] headerData, FfccMode ffccMode = FfccMode.ProcessAll) =>
  22. Load<Video>(&bufferData, headerData, -1, ffccMode, AVMediaType.AVMEDIA_TYPE_VIDEO);
  23. public static unsafe Video Load(BufferData* bufferData, byte[] headerData, FfccMode ffccMode = FfccMode.ProcessAll) =>
  24. Load<Video>(bufferData, headerData, -1, ffccMode, AVMediaType.AVMEDIA_TYPE_VIDEO);
  25. #endregion Methods
  26. }
  27. }