public const uint HB_ACODEC_FFFLAC24 = 0x00200000;\r
public const uint HB_ACODEC_FDK_AAC = 0x00400000;\r
public const uint HB_ACODEC_FDK_HAAC = 0x00800000;\r
+ public const uint HB_ACODEC_FFEAC3 = 0x01000000;\r
+ public const uint HB_ACODEC_FFTRUEHD = 0x02000000;\r
public const uint HB_ACODEC_FF_MASK = 0x00FF2800;\r
public const uint HB_ACODEC_PASS_FLAG = 0x40000000;\r
- public const uint HB_ACODEC_PASS_MASK = (HB_ACODEC_MP3 | HB_ACODEC_FFAAC | HB_ACODEC_DCA_HD | HB_ACODEC_AC3 | HB_ACODEC_DCA);\r
+ public const uint HB_ACODEC_PASS_MASK = (HB_ACODEC_AC3 | HB_ACODEC_DCA | HB_ACODEC_DCA_HD | HB_ACODEC_FFAAC | HB_ACODEC_FFEAC3 | HB_ACODEC_FFFLAC | HB_ACODEC_MP3 | HB_ACODEC_FFTRUEHD);\r
public const uint HB_ACODEC_AUTO_PASS = (HB_ACODEC_PASS_MASK | HB_ACODEC_PASS_FLAG);\r
public const uint HB_ACODEC_MP3_PASS = (HB_ACODEC_MP3 | HB_ACODEC_PASS_FLAG);\r
public const uint HB_ACODEC_AAC_PASS = (HB_ACODEC_FFAAC | HB_ACODEC_PASS_FLAG);\r
public const uint HB_ACODEC_AC3_PASS = (HB_ACODEC_AC3 | HB_ACODEC_PASS_FLAG);\r
public const uint HB_ACODEC_DCA_PASS = (HB_ACODEC_DCA | HB_ACODEC_PASS_FLAG);\r
public const uint HB_ACODEC_DCA_HD_PASS = (HB_ACODEC_DCA_HD | HB_ACODEC_PASS_FLAG);\r
+ public const uint HB_ACODEC_EAC3_PASS = (HB_ACODEC_PASS_FLAG | HB_ACODEC_FFEAC3);\r
+ public const uint HB_ACODEC_FLAC_PASS = (HB_ACODEC_PASS_FLAG | HB_ACODEC_FFFLAC);\r
public const uint HB_ACODEC_ANY = (HB_ACODEC_MASK | HB_ACODEC_PASS_FLAG);\r
+ public const uint HB_ACODEC_TRUEHD_PASS = (HB_ACODEC_PASS_FLAG | HB_ACODEC_FFTRUEHD);\r
+\r
\r
// Encode state\r
public const int HB_STATE_IDLE = 1;\r
using HandBrake.ApplicationServices.Model;\r
using HandBrake.ApplicationServices.Services.Encode.Model;\r
using HandBrake.ApplicationServices.Services.Encode.Model.Models;\r
+ using HandBrake.ApplicationServices.Utilities;\r
\r
using AudioTrack = HandBrake.ApplicationServices.Services.Encode.Model.Models.AudioTrack;\r
using Subtitle = HandBrake.ApplicationServices.Interop.Json.Encode.Subtitle;\r
{\r
Audio audio = new Audio();\r
\r
- // TODO Handled on the front-end ? Maybe we can offload logic.\r
- //if (!string.IsNullOrEmpty(job.AudioEncoderFallback))\r
- //{\r
- // HBAudioEncoder audioEncoder = HandBrakeEncoderHelpers.GetAudioEncoder(job.AudioEncoderFallback);\r
- // Validate.NotNull(audioEncoder, "Unrecognized fallback audio encoder: " + job.AudioEncoderFallback);\r
- // audio.FallbackEncoder = audioEncoder.Id;\r
- //}\r
-\r
- audio.CopyMask = (int)NativeConstants.HB_ACODEC_ANY;\r
+ int copyMask = 0;\r
+ if (job.AllowedPassthruOptions.AudioAllowAACPass) copyMask = (int)NativeConstants.HB_ACODEC_AAC_PASS;\r
+ if (job.AllowedPassthruOptions.AudioAllowAC3Pass) copyMask |= (int)NativeConstants.HB_ACODEC_AC3_PASS;\r
+ if (job.AllowedPassthruOptions.AudioAllowDTSHDPass) copyMask |= (int)NativeConstants.HB_ACODEC_DCA_HD_PASS;\r
+ if (job.AllowedPassthruOptions.AudioAllowDTSPass) copyMask |= (int)NativeConstants.HB_ACODEC_DCA_PASS;\r
+ if (job.AllowedPassthruOptions.AudioAllowEAC3Pass) copyMask |= (int)NativeConstants.HB_ACODEC_EAC3_PASS;\r
+ if (job.AllowedPassthruOptions.AudioAllowFlacPass) copyMask |= (int)NativeConstants.HB_ACODEC_FLAC_PASS;\r
+ if (job.AllowedPassthruOptions.AudioAllowMP3Pass) copyMask |= (int)NativeConstants.HB_ACODEC_MP3_PASS;\r
+ if (job.AllowedPassthruOptions.AudioAllowTrueHDPass) copyMask |= (int)NativeConstants.HB_ACODEC_TRUEHD_PASS;\r
+\r
+ audio.CopyMask = copyMask; \r
+ HBAudioEncoder audioEncoder = HandBrakeEncoderHelpers.GetAudioEncoder(EnumHelper<AudioEncoder>.GetShortName(job.AllowedPassthruOptions.AudioEncoderFallback));\r
+ audio.FallbackEncoder = audioEncoder.Id;\r
\r
audio.AudioList = new List<AudioList>();\r
foreach (AudioTrack item in job.AudioTracks)\r