diff options
author | Bradley Sepos <[email protected]> | 2016-06-27 18:15:57 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2016-06-27 18:15:57 -0400 |
commit | 9905eb75a2372039bff7483521923c1f5d603323 (patch) | |
tree | 1921976ef65583782b462037c9a390db2b53a93b /libhb | |
parent | b4c23bf71aa401b67dd0afbbe18eeb247a285c80 (diff) |
preset: Add CLI Default preset. (#214)
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/preset.c | 30 | ||||
-rw-r--r-- | libhb/preset.h | 3 | ||||
-rw-r--r-- | libhb/preset_builtin.h | 105 |
3 files changed, 133 insertions, 5 deletions
diff --git a/libhb/preset.c b/libhb/preset.c index 1164485ee..d4e8e3214 100644 --- a/libhb/preset.c +++ b/libhb/preset.c @@ -30,6 +30,7 @@ int hb_preset_version_micro; static hb_value_t *hb_preset_template = NULL; static hb_value_t *hb_presets = NULL; static hb_value_t *hb_presets_builtin = NULL; +static hb_value_t *hb_presets_cli_default = NULL; static void preset_clean(hb_value_t *preset, hb_value_t *template); static int preset_import(hb_value_t *preset, int major, int minor, @@ -2906,6 +2907,17 @@ void hb_presets_builtin_init(void) hb_value_free(&dict); } +int hb_presets_cli_default_init(void) +{ + hb_value_t * dict = hb_value_json(hb_builtin_presets_json); + hb_presets_cli_default = hb_value_dup(hb_dict_get(dict, "PresetCLIDefault")); + hb_presets_clean(hb_presets_cli_default); + + int result = hb_presets_add_internal(hb_presets_cli_default); + hb_value_free(&dict); + return result; +} + void hb_presets_current_version(int *major, int* minor, int *micro) { *major = hb_preset_version_major; @@ -3097,7 +3109,7 @@ void hb_presets_builtin_update(void) hb_value_free(&builtin); } -int hb_presets_add(hb_value_t *preset) +int hb_presets_add_internal(hb_value_t *preset) { hb_preset_index_t *path; int added = 0; @@ -3105,10 +3117,6 @@ int hb_presets_add(hb_value_t *preset) if (preset == NULL) return -1; - preset = presets_unpackage(preset); - if (preset == NULL) - return -1; - path = lookup_default_index(preset); if (path != NULL && path->depth != 0) { @@ -3147,6 +3155,18 @@ int hb_presets_add(hb_value_t *preset) return index; } +int hb_presets_add(hb_value_t *preset) +{ + if (preset == NULL) + return -1; + + preset = presets_unpackage(preset); + if (preset == NULL) + return -1; + + return hb_presets_add_internal(preset); +} + int hb_presets_add_json(const char *json) { hb_value_t *preset = hb_value_json(json); diff --git a/libhb/preset.h b/libhb/preset.h index 3f6301abe..25653ff62 100644 --- a/libhb/preset.h +++ b/libhb/preset.h @@ -40,6 +40,9 @@ void hb_presets_free(void); #endif // __LIBHB__ +// Add the default CLI preset(s) to the currently loaded presets +int hb_presets_cli_default_init(void); + // Get the currently supported preset format version void hb_presets_current_version(int *major, int* minor, int *micro); diff --git a/libhb/preset_builtin.h b/libhb/preset_builtin.h index 85e05a776..3a097a227 100644 --- a/libhb/preset_builtin.h +++ b/libhb/preset_builtin.h @@ -6620,6 +6620,111 @@ const char hb_builtin_presets_json[] = " \"Type\": 0\n" " }\n" " ], \n" +" \"PresetCLIDefault\": [\n" +" {\n" +" \"ChildrenArray\": [\n" +" {\n" +" \"AudioCopyMask\": [\n" +" \"copy:aac\"\n" +" ], \n" +" \"AudioEncoderFallback\": \"aac\", \n" +" \"AudioLanguageList\": [], \n" +" \"AudioList\": [\n" +" {\n" +" \"AudioBitrate\": 128, \n" +" \"AudioCompressionLevel\": -1.0, \n" +" \"AudioDitherMethod\": \"auto\", \n" +" \"AudioEncoder\": \"aac\", \n" +" \"AudioMixdown\": \"dpl2\", \n" +" \"AudioNormalizeMixLevel\": false, \n" +" \"AudioSamplerate\": \"auto\", \n" +" \"AudioTrackDRCSlider\": 0.0, \n" +" \"AudioTrackGainSlider\": 0.0, \n" +" \"AudioTrackQuality\": -1.0, \n" +" \"AudioTrackQualityEnable\": false\n" +" }\n" +" ], \n" +" \"AudioSecondaryEncoderMode\": true, \n" +" \"AudioTrackSelectionBehavior\": \"first\", \n" +" \"ChapterMarkers\": true, \n" +" \"ChildrenArray\": [], \n" +" \"Default\": true, \n" +" \"FileFormat\": \"mp4\", \n" +" \"Folder\": false, \n" +" \"FolderOpen\": false, \n" +" \"Mp4HttpOptimize\": false, \n" +" \"Mp4iPodCompatible\": false, \n" +" \"PictureAutoCrop\": true, \n" +" \"PictureBottomCrop\": 0, \n" +" \"PictureCombDetectCustom\": \"\", \n" +" \"PictureCombDetectPreset\": \"off\", \n" +" \"PictureDARWidth\": 0, \n" +" \"PictureDeblock\": 0, \n" +" \"PictureDeblockCustom\": \"qp=0:mode=2\", \n" +" \"PictureDeinterlaceCustom\": \"\", \n" +" \"PictureDeinterlaceFilter\": \"off\", \n" +" \"PictureDeinterlacePreset\": \"default\", \n" +" \"PictureDenoiseCustom\": \"\", \n" +" \"PictureDenoiseFilter\": \"off\", \n" +" \"PictureDenoisePreset\": \"medium\", \n" +" \"PictureDenoiseTune\": \"none\", \n" +" \"PictureDetelecine\": \"off\", \n" +" \"PictureDetelecineCustom\": \"\", \n" +" \"PictureForceHeight\": 0, \n" +" \"PictureForceWidth\": 0, \n" +" \"PictureHeight\": 0, \n" +" \"PictureItuPAR\": false, \n" +" \"PictureKeepRatio\": true, \n" +" \"PictureLeftCrop\": 0, \n" +" \"PictureLooseCrop\": false, \n" +" \"PictureModulus\": 2, \n" +" \"PicturePAR\": \"strict\", \n" +" \"PicturePARHeight\": 720, \n" +" \"PicturePARWidth\": 853, \n" +" \"PictureRightCrop\": 0, \n" +" \"PictureRotate\": \"angle=0:hflip=0\", \n" +" \"PictureTopCrop\": 0, \n" +" \"PictureWidth\": 0, \n" +" \"PresetDescription\": \"\", \n" +" \"PresetName\": \"CLI Default\", \n" +" \"SubtitleAddCC\": false, \n" +" \"SubtitleAddForeignAudioSearch\": false, \n" +" \"SubtitleAddForeignAudioSubtitle\": false, \n" +" \"SubtitleBurnBDSub\": false, \n" +" \"SubtitleBurnBehavior\": \"none\", \n" +" \"SubtitleBurnDVDSub\": false, \n" +" \"SubtitleLanguageList\": [], \n" +" \"SubtitleTrackSelectionBehavior\": \"none\", \n" +" \"Type\": 0, \n" +" \"UsesPictureFilters\": true, \n" +" \"UsesPictureSettings\": 2, \n" +" \"VideoAvgBitrate\": 6000, \n" +" \"VideoColorMatrixCode\": 0, \n" +" \"VideoEncoder\": \"x264\", \n" +" \"VideoFramerate\": \"\", \n" +" \"VideoFramerateMode\": \"vfr\", \n" +" \"VideoGrayScale\": false, \n" +" \"VideoLevel\": \"auto\", \n" +" \"VideoOptionExtra\": \"\", \n" +" \"VideoPreset\": \"medium\", \n" +" \"VideoProfile\": \"auto\", \n" +" \"VideoQSVAsyncDepth\": 4, \n" +" \"VideoQSVDecode\": false, \n" +" \"VideoQualitySlider\": 22.0, \n" +" \"VideoQualityType\": 2, \n" +" \"VideoScaler\": \"swscale\", \n" +" \"VideoTune\": \"\", \n" +" \"VideoTurboTwoPass\": false, \n" +" \"VideoTwoPass\": false, \n" +" \"x264Option\": \"\", \n" +" \"x264UseAdvancedOptions\": false\n" +" }\n" +" ], \n" +" \"Folder\": true, \n" +" \"PresetName\": \"CLI Defaults\", \n" +" \"Type\": 0\n" +" }\n" +" ], \n" " \"PresetTemplate\": {\n" " \"Preset\": {\n" " \"AudioCopyMask\": [\n" |