IOL0ol1 / EmguFFmpeg

A FFmpeg.AutoGen Warpper Library.
MIT License
72 stars 15 forks source link

Missing elements in new Nuget Package v1.1.3 #27

Open ChristopheI opened 1 year ago

ChristopheI commented 1 year ago

Hi,

I migrate from the master branch to the dev branch. The objective was to use the new Nuget package directly in my project.

Unfortunately there are some missing elements in FFmpeg4Sharp 1.1.3:

  1. Filter class There is no filter class yet in 1.1.3. But you have them in the current branch with nearly same features than in master branch (Inputs and Outputs are no more directly available but it's not a problem)

  2. RegisterBinaries There is no more RegisterBinaries method in FFmpegUtil

        /// <summary>
        /// Set ffmpeg root path, return <see cref="ffmpeg.av_version_info"/>
        /// </summary>
        /// <param name="path"></param>
        public static string RegisterBinaries(string path = "")
        {
            ffmpeg.RootPath = path;
            return ffmpeg.av_version_info();
        }
  1. BufferSrcFlags There is no more BufferSrcFlags enum
    [Flags]
    public enum BufferSrcFlags : int
    {
        /// <summary>
        /// takes ownership of the reference passed to it.
        /// </summary>
        None = 0,

        /// <summary>
        /// AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT, Do not check for format changes.
        /// </summary>
        NoCheckFormat = 1,

        /// <summary>
        /// AV_BUFFERSRC_FLAG_PUSH, Immediately push the frame to the output.
        /// </summary>
        Push = 4,

        /// <summary>
        /// AV_BUFFERSRC_FLAG_KEEP_REF, Keep a reference to the frame.
        /// If the frame if reference-counted, create a new reference; otherwise
        /// copy the frame data.
        /// </summary>
        KeepRef = 8,
    }

Also I notice that CreateMediaFilterGraph method is currently commented. I didn't test it yet but it should be great to have it.

A great thanks again for this great package ! 👍

ChristopheI commented 1 year ago

it will be also great to have this extension public

    public static class TExtension
    {

        public static T ThrowIfError<T>(this T error) where T : struct, IComparable, IFormattable, IConvertible, IComparable<T>, IEquatable<T>
        {
            if (error is int _int)
                return _int < 0 ? throw new FFmpegException(_int) : error;
            else if (error is long _long)
                return _long < 0 ? throw new FFmpegException((int)_long) : error;
            else
                return error.CompareTo(default) < 0 ? throw new FFmpegException(error.ToInt32(NumberFormatInfo.InvariantInfo)) : error;
        }
    }