Beispiel #1
0
        /// <summary>
        /// <see cref="av_opt_get_dict_val(void*, string, int, AVDictionary**)"/>
        /// </summary>
        public MediaDictionary GetDictionary(string name, OptionSearchFlags searchFlags = OptionSearchFlags.None)
        {
            AVDictionary *dict;

            av_opt_get_dict_val(_obj, name, (int)searchFlags, &dict);
            return(MediaDictionary.FromNative(dict, isOwner: true));
        }
Beispiel #2
0
        /// <summary>
        /// <see cref="av_opt_get_video_rate(void*, string, int, AVRational*)"/>
        /// </summary>
        public MediaRational GetVideoRate(string name, OptionSearchFlags searchFlags = OptionSearchFlags.None)
        {
            AVRational rational;

            av_opt_get_video_rate(_obj, name, (int)searchFlags, &rational).ThrowIfError();
            return(rational);
        }
Beispiel #3
0
        /// <summary>
        /// <see cref="av_opt_get_image_size(void*, string, int, int*, int*)"
        /// </summary>
        public (int width, int height) GetImageSize(string name, OptionSearchFlags searchFlags = OptionSearchFlags.None)
        {
            int width, height;

            av_opt_get_image_size(_obj, name, (int)searchFlags, &width, &height).ThrowIfError();
            return(width, height);
        }
Beispiel #4
0
        /// <summary>
        /// <see cref="av_opt_get_pixel_fmt(void*, string, int, AVPixelFormat*)"/>
        /// </summary>
        public PixelFormat GetPixelFormat(string name, OptionSearchFlags searchFlags = OptionSearchFlags.None)
        {
            AVPixelFormat pixelFormat;

            av_opt_get_pixel_fmt(_obj, name, (int)searchFlags, &pixelFormat);
            return((PixelFormat)pixelFormat);
        }
Beispiel #5
0
        /// <summary>
        /// <see cref="av_opt_get_double(void*, string, int, double*)"/>
        /// </summary>
        public double GetDouble(string name, OptionSearchFlags searchFlags = OptionSearchFlags.None)
        {
            double val;

            av_opt_get_double(_obj, name, (int)searchFlags, &val).ThrowIfError();
            return(val);
        }
Beispiel #6
0
        /// <summary>
        /// <see cref="av_opt_get_int(void*, string, int, long*)"/>
        /// </summary>
        public long GetInt64(string name, OptionSearchFlags searchFlags = OptionSearchFlags.None)
        {
            long val;

            av_opt_get_int(_obj, name, (int)searchFlags, &val).ThrowIfError();
            return(val);
        }
Beispiel #7
0
        /// <summary>
        /// <see cref="av_opt_get(void*, string, int, byte**)"/>
        /// </summary>
        public DisposableNativeString GetData(string name, OptionSearchFlags searchFlags = OptionSearchFlags.None)
        {
            byte *outVal;

            av_opt_get(_obj, name, (int)searchFlags, &outVal).ThrowIfError($"name: {name}");
            return(new DisposableNativeString(outVal));
        }
Beispiel #8
0
        /// <summary>
        /// <see cref="av_opt_get_channel_layout(void*, string, int, long*)"/>
        /// </summary>
        public ChannelLayout GetChannelLayout(string name, OptionSearchFlags searchFlags = OptionSearchFlags.None)
        {
            long channelLayout;

            av_opt_get_channel_layout(_obj, name, (int)searchFlags, &channelLayout);
            return((ChannelLayout)channelLayout);
        }
Beispiel #9
0
 /// <summary>
 /// <see cref="av_opt_set_bin(void*, string, byte*, int, int)"/>
 /// </summary>
 public void Set(string name, DataPointer value, OptionSearchFlags searchFlags = OptionSearchFlags.None) =>
 av_opt_set_bin(_obj, name, (byte *)value.Pointer, value.Length, (int)searchFlags).ThrowIfError();
Beispiel #10
0
 /// <summary>
 /// <see cref="av_opt_set_q(void*, string, AVRational, int)"/>
 /// </summary>
 public void Set(string name, MediaRational value, OptionSearchFlags searchFlags = OptionSearchFlags.None) =>
 av_opt_set_q(_obj, name, value, (int)searchFlags).ThrowIfError();
Beispiel #11
0
 /// <summary>
 /// <see cref="av_opt_set_double(void*, string, double, int)"/>
 /// </summary>
 public void Set(string name, double value, OptionSearchFlags searchFlags = OptionSearchFlags.None) =>
 av_opt_set_double(_obj, name, value, (int)searchFlags).ThrowIfError();
Beispiel #12
0
        /// <summary>
        /// <see cref="av_opt_find2(void*, string, string, int, int, void**)"/>
        /// </summary>
        public (FFmpegOption?option, IntPtr @object) Find2(string name, string unit, FFmpegOptionFlags optionFlags = FFmpegOptionFlags.None, OptionSearchFlags searchFlags = OptionSearchFlags.None)
        {
            void *    obj;
            AVOption *val = av_opt_find2(_obj, name, unit, (int)optionFlags, (int)searchFlags, &obj);

            if (val == null)
            {
                return(null, IntPtr.Zero);
            }
            return(new FFmpegOption(val), (IntPtr)obj);
        }
Beispiel #13
0
        /// <summary>
        /// <see cref="av_opt_find(void*, string, string, int, int)"/>
        /// </summary>
        /// <returns></returns>
        public FFmpegOption?Find(string name, string unit, FFmpegOptionFlags optionFlags = FFmpegOptionFlags.None, OptionSearchFlags searchFlags = OptionSearchFlags.None)
        {
            AVOption *val = av_opt_find(_obj, name, unit, (int)optionFlags, (int)searchFlags);

            if (val == null)
            {
                return(null);
            }
            return(new FFmpegOption(val));
        }
Beispiel #14
0
 /// <summary>
 /// <see cref="av_opt_set_dict_val(void*, string, AVDictionary*, int)"/>
 /// </summary>
 public void Set(string name, MediaDictionary value, OptionSearchFlags searchFlags = OptionSearchFlags.None) =>
 av_opt_set_dict_val(_obj, name, value, (int)searchFlags).ThrowIfError();
Beispiel #15
0
 /// <summary>
 /// <see cref="av_opt_set_image_size(void*, string, int, int, int)"/>
 /// </summary>
 public void Set(string name, int width, int height, OptionSearchFlags searchFlags = OptionSearchFlags.None) =>
 av_opt_set_image_size(_obj, name, width, height, (int)searchFlags).ThrowIfError();
Beispiel #16
0
 /// <summary>
 /// <see cref="av_opt_set_pixel_fmt(void*, string, AVPixelFormat, int)"/>
 /// </summary>
 public void Set(string name, PixelFormat value, OptionSearchFlags searchFlags = OptionSearchFlags.None) =>
 av_opt_set_pixel_fmt(_obj, name, (AVPixelFormat)value, (int)searchFlags).ThrowIfError();
Beispiel #17
0
 /// <summary>
 /// <see cref="av_opt_set_channel_layout(void*, string, long, int)"/>
 /// </summary>
 public void Set(string name, ChannelLayout value, OptionSearchFlags searchFlags = OptionSearchFlags.None) =>
 av_opt_set_channel_layout(_obj, name, (long)value, (int)searchFlags).ThrowIfError();