/// <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 HBVideoEncoder NativeToVideoEncoder(hb_encoder_s encoder)
 {
     return new HBVideoEncoder
     {
         Id = encoder.codec,
         ShortName = encoder.short_name,
         DisplayName = encoder.name,
         CompatibleContainers = encoder.muxers
     };
 }
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>
        public static HBVideoEncoder NativeToVideoEncoder(hb_encoder_s encoder)
        {
            var result = new HBVideoEncoder
            {
                Id = encoder.encoder,
                ShortName = encoder.short_name,
                DisplayName = encoder.human_readable_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;
            }

            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
                };

            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 #4
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.encoder,
                    ShortName = encoder.short_name,
                    DisplayName = encoder.human_readable_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.encoder);
            result.DefaultQuality = HBFunctions.hb_get_default_audio_quality((uint)encoder.encoder);
            result.CompressionLimits = Encoders.GetAudioCompressionLimits(encoder.encoder);
            result.DefaultCompression = HBFunctions.hb_get_default_audio_compression((uint) encoder.encoder);

            return result;
        }