profile.VideoEncodeRateType = work.VideoEncodeRateType;\r
profile.VideoEncoder = Converters.GetVideoEncoder(work.VideoEncoder);\r
\r
- profile.H264Level = work.H264Level;\r
- profile.X264Profile = work.H264Profile.ToString().ToLower().Replace(" ", string.Empty); // TODO change these away from strings.\r
- profile.X264Preset = work.X264Preset.ToString().ToLower().Replace(" ", string.Empty);\r
- profile.X264Tunes = new List<string>();\r
-\r
- if (work.X264Tune != x264Tune.None)\r
+ if (work.VideoEncoder == VideoEncoder.X264)\r
{\r
- profile.X264Tunes.Add(work.X264Tune.ToString().ToLower().Replace(" ", string.Empty));\r
- }\r
+ profile.VideoPreset = work.X264Preset.ToString().ToLower().Replace(" ", string.Empty);\r
+ profile.VideoTunes = new List<string>();\r
+\r
+ if (work.X264Tune != x264Tune.None)\r
+ {\r
+ profile.VideoTunes.Add(work.X264Tune.ToString().ToLower().Replace(" ", string.Empty));\r
+ }\r
\r
- if (work.FastDecode)\r
+ if (work.FastDecode)\r
+ {\r
+ profile.VideoTunes.Add("fastdecode");\r
+ }\r
+ }\r
+ else if (work.VideoEncoder == VideoEncoder.X265)\r
{\r
- profile.X264Tunes.Add("fastdecode");\r
+ profile.VideoPreset = work.X265Preset.ToString().ToLower().Replace(" ", string.Empty);\r
+ profile.VideoProfile = work.H265Profile.ToString().ToLower().Replace(" ", string.Empty);\r
+ profile.VideoTunes = new List<string>();\r
}\r
\r
- profile.X265Preset = work.X265Preset.ToString().ToLower().Replace(" ", string.Empty);\r
- profile.X265Profile = work.H265Profile.ToString().ToLower().Replace(" ", string.Empty);\r
- profile.X265Tunes = new List<string>();\r
+ profile.VideoLevel = work.H264Level;\r
+ profile.VideoProfile = work.H264Profile.ToString().ToLower().Replace(" ", string.Empty); // TODO change these away from strings.\r
\r
// Chapter Markers\r
profile.IncludeChapterMarkers = work.IncludeChapterMarkers;\r
job.UseDefaultChapterNames = work.IncludeChapterMarkers;\r
\r
// Advanced Settings\r
- profile.X264Options = work.AdvancedEncoderOptions;\r
+ profile.VideoOptions = work.AdvancedEncoderOptions;\r
\r
// Subtitles\r
job.Subtitles = new Subtitles { SourceSubtitles = new List<SourceSubtitle>(), SrtSubtitles = new List<SrtSubtitle>() };\r
/// <returns>The converted structure.</returns>\r
public static Language NativeToLanguage(iso639_lang_t language)\r
{\r
- string englishName = InteropUtilities.ReadUtf8Ptr(language.eng_name);\r
- string nativeName = InteropUtilities.ReadUtf8Ptr(language.native_name);\r
+ string englishName = InteropUtilities.ToStringFromUtf8Ptr(language.eng_name);\r
+ string nativeName = InteropUtilities.ToStringFromUtf8Ptr(language.native_name);\r
return new Language\r
{\r
Code = language.iso639_2,\r
{\r
this.previewCount = previewCount;\r
\r
- IntPtr pathPtr = InteropUtilities.CreateUtf8Ptr(path);\r
+ IntPtr pathPtr = InteropUtilities.ToUtf8PtrFromString(path);\r
HBFunctions.hb_scan(this.hbHandle, pathPtr, titleIndex, previewCount, 1, (ulong)(minDuration.TotalSeconds * 90000));\r
Marshal.FreeHGlobal(pathPtr);\r
\r
public BitmapImage GetPreview(EncodeJob job, int previewNumber)\r
{\r
IntPtr nativeJobPtr = HBFunctions.hb_job_init_by_index(this.hbHandle, this.GetTitleIndex(job.Title));\r
- var nativeJob = InteropUtilities.ReadStructure<hb_job_s>(nativeJobPtr);\r
+ var nativeJob = InteropUtilities.ToStructureFromPtr<hb_job_s>(nativeJobPtr);\r
\r
List<IntPtr> allocatedMemory = this.ApplyJob(ref nativeJob, job);\r
\r
this.currentJob = job;\r
\r
IntPtr nativeJobPtr = HBFunctions.hb_job_init_by_index(this.hbHandle, this.GetTitleIndex(job.Title));\r
- var nativeJob = InteropUtilities.ReadStructure<hb_job_s>(nativeJobPtr);\r
+ var nativeJob = InteropUtilities.ToStructureFromPtr<hb_job_s>(nativeJobPtr);\r
\r
this.encodeAllocatedMemory = this.ApplyJob(ref nativeJob, job, preview, previewNumber, previewSeconds, overallSelectedLengthSeconds);\r
\r
}\r
}\r
\r
- string x264Options = profile.X264Options ?? string.Empty;\r
- IntPtr originalX264Options = Marshal.StringToHGlobalAnsi(x264Options);\r
- this.encodeAllocatedMemory.Add(originalX264Options);\r
+ string videoOptions = profile.VideoOptions ?? string.Empty;\r
+ IntPtr originalVideoOptions = Marshal.StringToHGlobalAnsi(videoOptions);\r
+ this.encodeAllocatedMemory.Add(originalVideoOptions);\r
\r
- if (!string.IsNullOrEmpty(profile.X264Profile))\r
+ if (!string.IsNullOrEmpty(profile.VideoProfile))\r
{\r
- nativeJob.encoder_profile = Marshal.StringToHGlobalAnsi(profile.X264Profile);\r
+ nativeJob.encoder_profile = Marshal.StringToHGlobalAnsi(profile.VideoProfile);\r
this.encodeAllocatedMemory.Add(nativeJob.encoder_profile);\r
}\r
\r
- if (!string.IsNullOrEmpty(profile.X264Preset))\r
+ if (!string.IsNullOrEmpty(profile.VideoPreset))\r
{\r
- nativeJob.encoder_preset = Marshal.StringToHGlobalAnsi(profile.X264Preset);\r
+ nativeJob.encoder_preset = Marshal.StringToHGlobalAnsi(profile.VideoPreset);\r
this.encodeAllocatedMemory.Add(nativeJob.encoder_preset);\r
}\r
\r
- if (profile.X264Tunes != null && profile.X264Tunes.Count > 0)\r
+ if (profile.VideoTunes != null && profile.VideoTunes.Count > 0)\r
{\r
- nativeJob.encoder_tune = Marshal.StringToHGlobalAnsi(string.Join(",", profile.X264Tunes));\r
+ nativeJob.encoder_tune = Marshal.StringToHGlobalAnsi(string.Join(",", profile.VideoTunes));\r
this.encodeAllocatedMemory.Add(nativeJob.encoder_tune);\r
}\r
\r
- if (!string.IsNullOrEmpty(job.EncodingProfile.H264Level))\r
+ if (!string.IsNullOrEmpty(job.EncodingProfile.VideoLevel))\r
{\r
- nativeJob.encoder_level = Marshal.StringToHGlobalAnsi(job.EncodingProfile.H264Level);\r
+ nativeJob.encoder_level = Marshal.StringToHGlobalAnsi(job.EncodingProfile.VideoLevel);\r
this.encodeAllocatedMemory.Add(nativeJob.encoder_level);\r
}\r
\r
{\r
// First pass. Apply turbo options if needed.\r
nativeJob.pass = 1;\r
- string firstPassAdvancedOptions = x264Options;\r
+ string firstPassAdvancedOptions = videoOptions;\r
if (job.EncodingProfile.TurboFirstPass)\r
{\r
if (firstPassAdvancedOptions == string.Empty)\r
\r
// Second pass. Apply normal options.\r
nativeJob.pass = 2;\r
- nativeJob.encoder_options = originalX264Options;\r
+ nativeJob.encoder_options = originalVideoOptions;\r
\r
HBFunctions.hb_add(this.hbHandle, ref nativeJob);\r
}\r
{\r
// One pass job.\r
nativeJob.pass = 0;\r
- nativeJob.encoder_options = originalX264Options;\r
+ nativeJob.encoder_options = originalVideoOptions;\r
\r
HBFunctions.hb_add(this.hbHandle, ref nativeJob);\r
}\r
}\r
\r
IntPtr nativeJobPtr = HBFunctions.hb_job_init_by_index(this.hbHandle, this.GetTitleIndex(title));\r
- var nativeJob = InteropUtilities.ReadStructure<hb_job_s>(nativeJobPtr);\r
+ var nativeJob = InteropUtilities.ToStructureFromPtr<hb_job_s>(nativeJobPtr);\r
\r
List<IntPtr> allocatedMemory = this.ApplyJob(ref nativeJob, job);\r
InteropUtilities.FreeMemory(allocatedMemory);\r
this.titles = new List<Title>();\r
\r
IntPtr titleSetPtr = HBFunctions.hb_get_title_set(this.hbHandle);\r
- hb_title_set_s titleSet = InteropUtilities.ReadStructure<hb_title_set_s>(titleSetPtr);\r
- this.originalTitles = titleSet.list_title.ToList<hb_title_s>();\r
+ hb_title_set_s titleSet = InteropUtilities.ToStructureFromPtr<hb_title_set_s>(titleSetPtr);\r
+ this.originalTitles = titleSet.list_title.ToListFromHandBrakeList<hb_title_s>();\r
\r
foreach (hb_title_s title in this.originalTitles)\r
{\r
\r
if (string.IsNullOrWhiteSpace(job.CustomChapterNames[i]))\r
{\r
- chapterNamePtr = InteropUtilities.CreateUtf8Ptr("Chapter " + (i + 1));\r
+ chapterNamePtr = InteropUtilities.ToUtf8PtrFromString("Chapter " + (i + 1));\r
}\r
else\r
{\r
- chapterNamePtr = InteropUtilities.CreateUtf8Ptr(job.CustomChapterNames[i]);\r
+ chapterNamePtr = InteropUtilities.ToUtf8PtrFromString(job.CustomChapterNames[i]);\r
}\r
\r
HBFunctions.hb_chapter_set_title__ptr(nativeChapters[i], chapterNamePtr);\r
\r
// areBframes\r
// color_matrix\r
- List<hb_audio_s> titleAudio = originalTitle.list_audio.ToList<hb_audio_s>();\r
+ List<hb_audio_s> titleAudio = originalTitle.list_audio.ToListFromHandBrakeList<hb_audio_s>();\r
\r
var audioList = new List<hb_audio_s>();\r
int numTracks = 0;\r
audioList.Add(this.ConvertAudioBack(outputTrack.Item1, titleAudio[outputTrack.Item2 - 1], numTracks++, allocatedMemory));\r
}\r
\r
- NativeList nativeAudioList = InteropUtilities.ConvertListBack<hb_audio_s>(audioList);\r
+ NativeList nativeAudioList = InteropUtilities.ToHandBrakeListFromList<hb_audio_s>(audioList);\r
nativeJob.list_audio = nativeAudioList.Ptr;\r
allocatedMemory.AddRange(nativeAudioList.AllocatedMemory);\r
\r
{\r
if (job.Subtitles.SourceSubtitles != null && job.Subtitles.SourceSubtitles.Count > 0)\r
{\r
- List<hb_subtitle_s> titleSubtitles = originalTitle.list_subtitle.ToList<hb_subtitle_s>();\r
+ List<hb_subtitle_s> titleSubtitles = originalTitle.list_subtitle.ToListFromHandBrakeList<hb_subtitle_s>();\r
\r
foreach (SourceSubtitle sourceSubtitle in job.Subtitles.SourceSubtitles)\r
{\r
}\r
else\r
{\r
- IntPtr outputPathPtr = InteropUtilities.CreateUtf8Ptr(job.OutputPath);\r
+ IntPtr outputPathPtr = InteropUtilities.ToUtf8PtrFromString(job.OutputPath);\r
allocatedMemory.Add(outputPathPtr);\r
nativeJob.file = outputPathPtr;\r
}\r
private void AddFilter(List<hb_filter_object_s> filterList, int filterType, string settings, List<IntPtr> allocatedMemory)\r
{\r
IntPtr settingsNativeString = Marshal.StringToHGlobalAnsi(settings);\r
- hb_filter_object_s filter = InteropUtilities.ReadStructure<hb_filter_object_s>(HBFunctions.hb_filter_init(filterType));\r
+ hb_filter_object_s filter = InteropUtilities.ToStructureFromPtr<hb_filter_object_s>(HBFunctions.hb_filter_init(filterType));\r
filter.settings = settingsNativeString;\r
\r
allocatedMemory.Add(settingsNativeString);\r
filterPtrList.Add(filterPtr);\r
}\r
\r
- NativeList filterListNative = InteropUtilities.CreateIntPtrList(filterPtrList);\r
+ NativeList filterListNative = InteropUtilities.ToHandBrakeListFromPtrList(filterPtrList);\r
allocatedMemory.AddRange(filterListNative.AllocatedMemory);\r
\r
return filterListNative;\r
}\r
\r
int currentSubtitleTrack = 1;\r
- List<hb_subtitle_s> subtitleList = title.list_subtitle.ToList<hb_subtitle_s>();\r
+ List<hb_subtitle_s> subtitleList = title.list_subtitle.ToListFromHandBrakeList<hb_subtitle_s>();\r
foreach (hb_subtitle_s subtitle in subtitleList)\r
{\r
var newSubtitle = new Subtitle\r
}\r
\r
int currentAudioTrack = 1;\r
- List<hb_audio_s> audioList = title.list_audio.ToList<hb_audio_s>();\r
+ List<hb_audio_s> audioList = title.list_audio.ToListFromHandBrakeList<hb_audio_s>();\r
foreach (hb_audio_s audio in audioList)\r
{\r
var newAudio = new AudioTrack\r
currentAudioTrack++;\r
}\r
\r
- List<hb_chapter_s> chapterList = title.list_chapter.ToList<hb_chapter_s>();\r
+ List<hb_chapter_s> chapterList = title.list_chapter.ToListFromHandBrakeList<hb_chapter_s>();\r
foreach (hb_chapter_s chapter in chapterList)\r
{\r
var newChapter = new Chapter\r
[DllImport("hb.dll", EntryPoint = "hb_container_get_next", CallingConvention = CallingConvention.Cdecl)]\r
public static extern IntPtr hb_container_get_next(IntPtr last);\r
\r
+ [DllImport("hb.dll", EntryPoint = "hb_video_encoder_get_presets", CallingConvention = CallingConvention.Cdecl)]\r
+ public static extern IntPtr hb_video_encoder_get_presets(int encoder);\r
+\r
+ [DllImport("hb.dll", EntryPoint = "hb_video_encoder_get_tunes", CallingConvention = CallingConvention.Cdecl)]\r
+ public static extern IntPtr hb_video_encoder_get_tunes(int encoder);\r
+\r
+ [DllImport("hb.dll", EntryPoint = "hb_video_encoder_get_profiles", CallingConvention = CallingConvention.Cdecl)]\r
+ public static extern IntPtr hb_video_encoder_get_profiles(int encoder);\r
+\r
+ [DllImport("hb.dll", EntryPoint = "hb_video_encoder_get_levels", CallingConvention = CallingConvention.Cdecl)]\r
+ public static extern IntPtr hb_video_encoder_get_levels(int encoder);\r
+\r
+\r
[DllImport("hb.dll", EntryPoint = "lang_get_next", CallingConvention = CallingConvention.Cdecl)]\r
public static extern IntPtr lang_get_next(IntPtr last);\r
\r
/// <typeparam name="T">The type to convert the structure to.</typeparam>\r
/// <param name="structPtr">The pointer to the native structure.</param>\r
/// <returns>The converted structure.</returns>\r
- public static T ReadStructure<T>(IntPtr structPtr)\r
+ public static T ToStructureFromPtr<T>(IntPtr structPtr)\r
{\r
return (T)Marshal.PtrToStructure(structPtr, typeof(T));\r
}\r
/// </summary>\r
/// <param name="stringPtr">The pointer to the string.</param>\r
/// <returns>The resulting string.</returns>\r
- public static string ReadUtf8Ptr(IntPtr stringPtr)\r
+ public static string ToStringFromUtf8Ptr(IntPtr stringPtr)\r
{\r
var data = new List<byte>();\r
var ptr = stringPtr;\r
/// <returns>\r
/// The <see cref="IntPtr"/>.\r
/// </returns>\r
- public static IntPtr CreateUtf8Ptr(string str)\r
+ public static IntPtr ToUtf8PtrFromString(string str)\r
{\r
byte[] bytes = Encoding.UTF8.GetBytes(str);\r
IntPtr stringPtr = Marshal.AllocHGlobal(bytes.Length + 1);\r
/// <typeparam name="T">The type of structure in the list.</typeparam>\r
/// <param name="listPtr">The pointer to the native list.</param>\r
/// <returns>The converted managed list.</returns>\r
- public static List<T> ToList<T>(this IntPtr listPtr)\r
+ public static List<T> ToListFromHandBrakeList<T>(this IntPtr listPtr)\r
{\r
List<T> returnList = new List<T>();\r
NativeList nativeList = new NativeList(listPtr);\r
for (int i = 0; i < nativeList.Count; i++)\r
{\r
IntPtr itemPtr = nativeList[i];\r
- returnList.Add(ReadStructure<T>(itemPtr));\r
+ returnList.Add(ToStructureFromPtr<T>(itemPtr));\r
}\r
\r
return returnList;\r
/// <param name="arrayPtr">The pointer to the array.</param>\r
/// <param name="count">The number of items in the array.</param>\r
/// <returns>The converted collection.</returns>\r
- public static IEnumerable<T> ConvertArray<T>(IntPtr arrayPtr, int count)\r
+ public static List<T> ToListFromNativeArray<T>(IntPtr arrayPtr, int count)\r
{\r
IntPtr currentItem = arrayPtr;\r
\r
var result = new List<T>();\r
for (int i = 0; i < count; i++)\r
{\r
- T nativeEncoder = ReadStructure<T>(currentItem);\r
+ T nativeEncoder = ToStructureFromPtr<T>(currentItem);\r
result.Add(nativeEncoder);\r
\r
currentItem = IntPtr.Add(currentItem, Marshal.SizeOf(typeof(T)));\r
return result;\r
}\r
\r
+ /// <summary>\r
+ /// Takes an array pointer and converts it into a list of strings.\r
+ /// </summary>\r
+ /// <param name="arrayPtr">A pointer to a raw list of strings.</param>\r
+ /// <returns>The list of strings.</returns>\r
+ public static List<string> ToStringListFromArrayPtr(IntPtr arrayPtr)\r
+ {\r
+ if (arrayPtr == IntPtr.Zero)\r
+ {\r
+ return null;\r
+ }\r
+\r
+ return ToPtrListFromPtr(arrayPtr).Select(ptr => Marshal.PtrToStringAnsi(ptr)).ToList();\r
+ }\r
+\r
+ /// <summary>\r
+ /// Finds all the pointers starting at the given location and puts them in a list. Stops when it finds zero for a pointer.\r
+ /// </summary>\r
+ /// <param name="arrayPtr">The address of the list of pointers.</param>\r
+ /// <returns>The list of pointers.</returns>\r
+ public static List<IntPtr> ToPtrListFromPtr(IntPtr arrayPtr)\r
+ {\r
+ var result = new List<IntPtr>();\r
+ int ptrSize = Marshal.SizeOf(typeof(IntPtr));\r
+ IntPtr currentPtr = Marshal.ReadIntPtr(arrayPtr);\r
+ for (int i = 0; currentPtr != IntPtr.Zero; i++)\r
+ {\r
+ result.Add(currentPtr);\r
+ currentPtr = Marshal.ReadIntPtr(arrayPtr, (i + 1) * ptrSize);\r
+ }\r
+\r
+ return result;\r
+ }\r
+\r
/// <summary>\r
/// Creates a native HandBrake list from the given managed list of pointers.\r
/// </summary>\r
/// <param name="list">The managed list to convert.</param>\r
/// <returns>The converted native list.</returns>\r
- public static NativeList CreateIntPtrList(List<IntPtr> list)\r
+ public static NativeList ToHandBrakeListFromPtrList(List<IntPtr> list)\r
{\r
NativeList returnList = NativeList.CreateList();\r
\r
/// <typeparam name="T">The type of structures in the list.</typeparam>\r
/// <param name="list">The managed list to convert.</param>\r
/// <returns>The converted native list.</returns>\r
- public static NativeList ConvertListBack<T>(List<T> list)\r
+ public static NativeList ToHandBrakeListFromList<T>(List<T> list)\r
{\r
NativeList returnList = NativeList.CreateList();\r
foreach (T item in list)\r
/// <param name="iterator">The iterator to use to build the list.</param>\r
/// <param name="converter">The converter to convert from the struct to the object.</param>\r
/// <returns>The list of objects.</returns>\r
- public static List<T2> GetListFromIterator<T1, T2>(Func<IntPtr, IntPtr> iterator, Func<T1, T2> converter)\r
+ public static List<T2> ToListFromIterator<T1, T2>(Func<IntPtr, IntPtr> iterator, Func<T1, T2> converter)\r
{\r
- return ReadStructureListFromIterator<T1>(iterator).Select(converter).ToList();\r
+ return ToListFromIterator<T1>(iterator).Select(converter).ToList();\r
} \r
\r
/// <summary>\r
/// <typeparam name="T">The type of the struct.</typeparam>\r
/// <param name="iterator">The iterator to use to build the list.</param>\r
/// <returns>The list of structs.</returns>\r
- public static List<T> ReadStructureListFromIterator<T>(Func<IntPtr, IntPtr> iterator)\r
+ public static List<T> ToListFromIterator<T>(Func<IntPtr, IntPtr> iterator)\r
{\r
var structureList = new List<T>();\r
IntPtr current = IntPtr.Zero;\r
current = iterator(current);\r
while (current != IntPtr.Zero)\r
{\r
- T encoder = ReadStructure<T>(current);\r
+ T encoder = ToStructureFromPtr<T>(current);\r
structureList.Add(encoder);\r
\r
current = iterator(current);\r
{\r
return allLanguages\r
?? (allLanguages =\r
- InteropUtilities.GetListFromIterator<iso639_lang_t, Language>(HBFunctions.lang_get_next, Converters.Converters.NativeToLanguage));\r
+ InteropUtilities.ToListFromIterator<iso639_lang_t, Language>(HBFunctions.lang_get_next, Converters.Converters.NativeToLanguage));\r
}\r
}\r
\r
/// <returns>Object that describes the language.</returns>\r
public static Language Get(string code)\r
{\r
- iso639_lang_t language = InteropUtilities.ReadStructure<iso639_lang_t>(HBFunctions.lang_for_code2(code));\r
+ iso639_lang_t language = InteropUtilities.ToStructureFromPtr<iso639_lang_t>(HBFunctions.lang_for_code2(code));\r
return Converters.Converters.NativeToLanguage(language);\r
}\r
}\r
{\r
if (audioEncoders == null)\r
{\r
- audioEncoders = InteropUtilities.GetListFromIterator<hb_encoder_s, HBAudioEncoder>(HBFunctions.hb_audio_encoder_get_next, Converters.NativeToAudioEncoder);\r
+ audioEncoders = InteropUtilities.ToListFromIterator<hb_encoder_s, HBAudioEncoder>(HBFunctions.hb_audio_encoder_get_next, Converters.NativeToAudioEncoder);\r
}\r
\r
return audioEncoders;\r
{\r
if (videoEncoders == null)\r
{\r
- videoEncoders = InteropUtilities.GetListFromIterator<hb_encoder_s, HBVideoEncoder>(HBFunctions.hb_video_encoder_get_next, Converters.NativeToVideoEncoder);\r
+ videoEncoders = InteropUtilities.ToListFromIterator<hb_encoder_s, HBVideoEncoder>(HBFunctions.hb_video_encoder_get_next, Converters.NativeToVideoEncoder);\r
}\r
\r
return videoEncoders;\r
{\r
if (videoFramerates == null)\r
{\r
- videoFramerates = InteropUtilities.GetListFromIterator<hb_rate_s, HBRate>(HBFunctions.hb_video_framerate_get_next, Converters.NativeToRate);\r
+ videoFramerates = InteropUtilities.ToListFromIterator<hb_rate_s, HBRate>(HBFunctions.hb_video_framerate_get_next, Converters.NativeToRate);\r
}\r
\r
return videoFramerates;\r
{\r
if (mixdowns == null)\r
{\r
- mixdowns = InteropUtilities.GetListFromIterator<hb_mixdown_s, HBMixdown>(HBFunctions.hb_mixdown_get_next, Converters.NativeToMixdown);\r
+ mixdowns = InteropUtilities.ToListFromIterator<hb_mixdown_s, HBMixdown>(HBFunctions.hb_mixdown_get_next, Converters.NativeToMixdown);\r
}\r
\r
return mixdowns;\r
{\r
if (audioBitrates == null)\r
{\r
- audioBitrates = InteropUtilities.GetListFromIterator<hb_rate_s, int>(HBFunctions.hb_audio_bitrate_get_next, b => b.rate);\r
+ audioBitrates = InteropUtilities.ToListFromIterator<hb_rate_s, int>(HBFunctions.hb_audio_bitrate_get_next, b => b.rate);\r
}\r
\r
return audioBitrates;\r
{\r
if (audioSampleRates == null)\r
{\r
- audioSampleRates = InteropUtilities.GetListFromIterator<hb_rate_s, HBRate>(HBFunctions.hb_audio_samplerate_get_next, Converters.NativeToRate);\r
+ audioSampleRates = InteropUtilities.ToListFromIterator<hb_rate_s, HBRate>(HBFunctions.hb_audio_samplerate_get_next, Converters.NativeToRate);\r
}\r
\r
return audioSampleRates;\r
{\r
if (containers == null)\r
{\r
- containers = InteropUtilities.GetListFromIterator<hb_container_s, HBContainer>(HBFunctions.hb_container_get_next, Converters.NativeToContainer);\r
+ containers = InteropUtilities.ToListFromIterator<hb_container_s, HBContainer>(HBFunctions.hb_container_get_next, Converters.NativeToContainer);\r
}\r
\r
return containers;\r
public string VideoEncoder { get; set; }\r
\r
/// <summary>\r
- /// Gets or sets the x 264 options.\r
+ /// Gets or sets the video encoder options.\r
/// </summary>\r
- public string X264Options { get; set; }\r
+ public string VideoOptions { get; set; }\r
\r
/// <summary>\r
- /// Gets or sets the x 264 profile.\r
+ /// Gets or sets the video encoder profile name.\r
/// </summary>\r
- public string X264Profile { get; set; }\r
+ public string VideoProfile { get; set; }\r
\r
/// <summary>\r
- /// Gets or sets the x 264 preset.\r
+ /// Gets or sets the video encoder preset name.\r
/// </summary>\r
- public string X264Preset { get; set; }\r
+ public string VideoPreset { get; set; }\r
\r
/// <summary>\r
- /// Gets or sets the x 264 tunes.\r
+ /// Gets or sets the video encoder tunes.\r
/// </summary>\r
- public List<string> X264Tunes { get; set; }\r
+ public List<string> VideoTunes { get; set; }\r
\r
- /// <summary>\r
- /// Gets or sets the x 265 profile.\r
- /// </summary>\r
- public string X265Profile { get; set; }\r
-\r
- /// <summary>\r
- /// Gets or sets the x 265 preset.\r
- /// </summary>\r
- public string X265Preset { get; set; }\r
+ /// <summary>\r
+ /// Gets or sets the video encoder level.\r
+ /// </summary>\r
+ public string VideoLevel { get; set; }\r
\r
/// <summary>\r
- /// Gets or sets the x 265 tunes.\r
- /// </summary>\r
- public List<string> X265Tunes { get; set; }\r
-\r
- /// <summary>\r
- /// Gets or sets the x 265 level.\r
- /// </summary>\r
- public List<string> X265Level { get; set; }\r
-\r
- /// <summary>\r
- /// Gets or sets the qsv preset.\r
- /// </summary>\r
- public string QsvPreset { get; set; }\r
-\r
- /// <summary>\r
- /// Gets or sets a value indicating whether qsv decode.\r
+ /// Gets or sets a value indicating whether to use QSV decoding.\r
/// </summary>\r
public bool QsvDecode { get; set; }\r
\r
- /// <summary>\r
- /// Gets or sets the h 264 level.\r
- /// </summary>\r
- public string H264Level { get; set; }\r
-\r
/// <summary>\r
/// Gets or sets the video encode rate type.\r
/// </summary>\r
Grayscale = this.Grayscale,\r
\r
VideoEncoder = this.VideoEncoder,\r
- X264Options = this.X264Options,\r
- X264Profile = this.X264Profile,\r
- X264Preset = this.X264Preset,\r
- X264Tunes = this.X264Tunes,\r
- QsvPreset = this.QsvPreset,\r
- QsvDecode = this.QsvDecode,\r
- H264Level = this.H264Level,\r
+ VideoOptions = this.VideoOptions,\r
+ VideoProfile = this.VideoProfile,\r
+ VideoPreset = this.VideoPreset,\r
+ VideoTunes = this.VideoTunes,\r
+ VideoLevel = this.VideoLevel,\r
+ QsvDecode = this.QsvDecode,\r
VideoEncodeRateType = this.VideoEncodeRateType,\r
Quality = this.Quality,\r
TargetSize = this.TargetSize,\r
\r
namespace HandBrake.Interop.Model.Encoding\r
{\r
- /// <summary>\r
+ using System.Collections.Generic;\r
+\r
+ using HandBrake.Interop.HbLib;\r
+ using HandBrake.Interop.Helpers;\r
+\r
+ /// <summary>\r
/// The hb video encoder.\r
/// </summary>\r
public class HBVideoEncoder\r
{\r
- #region Public Properties\r
-\r
/// <summary>\r
/// Gets or sets the compatible containers.\r
/// </summary>\r
/// </summary>\r
public string ShortName { get; set; }\r
\r
- #endregion\r
+ /// <summary>\r
+ /// Gets the list of presets this encoder supports. (null if the encoder doesn't support presets)\r
+ /// </summary>\r
+ public List<string> Presets\r
+ {\r
+ get\r
+ {\r
+ return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_presets(this.Id));\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets the list of tunes this encoder supports. (null if the encoder doesn't support tunes)\r
+ /// </summary>\r
+ public List<string> Tunes\r
+ {\r
+ get\r
+ {\r
+ return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_tunes(this.Id));\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets the list of profiles this encoder supports. (null if the encoder doesn't support profiles)\r
+ /// </summary>\r
+ public List<string> Profiles\r
+ {\r
+ get\r
+ {\r
+ return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_profiles(this.Id));\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets the list of levels this encoder supports. (null if the encoder doesn't support levels)\r
+ /// </summary>\r
+ public List<string> Levels\r
+ {\r
+ get\r
+ {\r
+ return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_levels(this.Id));\r
+ }\r
+ } \r
}\r
}
\ No newline at end of file