Example #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>
        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);
        }
        /// <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        = HandBrakeEncoderHelpers.GetAudioQualityLimits(encoder.codec),
                DefaultQuality       = HBFunctions.hb_audio_quality_get_default((uint)encoder.codec),
                CompressionLimits    = HandBrakeEncoderHelpers.GetAudioCompressionLimits(encoder.codec),
                DefaultCompression   =
                    HBFunctions.hb_audio_compression_get_default((uint)encoder.codec)
            };

            return(result);
        }