Beispiel #1
0
        /// <summary>
        /// Converts a native HB encoder structure to an Encoder model.
        /// </summary>
        /// <param name="encoder">The structure to convert.</param>
        /// <returns>The converted model.</returns>
        public static HBAudioEncoder NativeToAudioEncoder(hb_encoder_s encoder)
        {
            var result = new HBAudioEncoder
            {
                Id                   = encoder.codec,
                ShortName            = encoder.short_name,
                DisplayName          = encoder.name,
                CompatibleContainers = Container.None
            };

            if ((encoder.muxers & NativeConstants.HB_MUX_MKV) > 0)
            {
                result.CompatibleContainers = result.CompatibleContainers | Container.Mkv;
            }

            if ((encoder.muxers & NativeConstants.HB_MUX_MP4) > 0)
            {
                result.CompatibleContainers = result.CompatibleContainers | Container.Mp4;
            }

            result.QualityLimits      = Encoders.GetAudioQualityLimits(encoder.codec);
            result.DefaultQuality     = HBFunctions.hb_audio_quality_get_default((uint)encoder.codec);
            result.CompressionLimits  = Encoders.GetAudioCompressionLimits(encoder.codec);
            result.DefaultCompression = HBFunctions.hb_audio_compression_get_default((uint)encoder.codec);

            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// Converts a native HB encoder structure to an Encoder model.
        /// </summary>
        /// <param name="encoder">
        /// The structure to convert.
        /// </param>
        /// <returns>
        /// The converted model.
        /// </returns>
        internal static HBAudioEncoder NativeToAudioEncoder(hb_encoder_s encoder)
        {
            var result = new HBAudioEncoder(
                encoder.muxers,
                HandBrakeEncoderHelpers.GetAudioCompressionLimits(encoder.codec),
                HBFunctions.hb_audio_compression_get_default((uint)encoder.codec),
                HBFunctions.hb_audio_quality_get_default((uint)encoder.codec),
                encoder.name,
                encoder.codec,
                HandBrakeEncoderHelpers.GetAudioQualityLimits(encoder.codec),
                encoder.short_name);

            return(result);
        }
Beispiel #3
0
        /// <summary>
        /// Converts a native HB encoder structure to an Encoder model.
        /// </summary>
        /// <param name="encoder">The structure to convert.</param>
        /// <returns>The converted model.</returns>
        public static HBAudioEncoder NativeToAudioEncoder(hb_encoder_s encoder)
        {
            var result = new HBAudioEncoder
            {
                Id                   = encoder.codec,
                ShortName            = encoder.short_name,
                DisplayName          = encoder.name,
                CompatibleContainers = encoder.muxers,
                QualityLimits        = Encoders.GetAudioQualityLimits(encoder.codec),
                DefaultQuality       = HBFunctions.hb_audio_quality_get_default((uint)encoder.codec),
                CompressionLimits    = Encoders.GetAudioCompressionLimits(encoder.codec),
                DefaultCompression   =
                    HBFunctions.hb_audio_compression_get_default((uint)encoder.codec)
            };

            return(result);
        }
Beispiel #4
0
 /// <summary>
 /// The get default quality.
 /// </summary>
 /// <param name="encoder">
 /// The encoder.
 /// </param>
 /// <returns>
 /// The <see cref="double"/>.
 /// </returns>
 public static double GetDefaultQuality(HBAudioEncoder encoder)
 {
     return(HBFunctions.hb_audio_quality_get_default((uint)encoder.Id));
 }
Beispiel #5
0
 public float hb_audio_quality_get_default(uint codec)
 {
     return(HBFunctions.hb_audio_quality_get_default(codec));
 }