diff options
author | Rodeo <[email protected]> | 2014-02-13 15:18:15 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2014-02-13 15:18:15 +0000 |
commit | 1a1b1591ef5acd8495dc8e736a47852e93694020 (patch) | |
tree | 7c9cd72eff31ee912ad12fa8c6f16b7d01e40a7a /libhb/common.c | |
parent | 94d470181e290d89f3be93cd13c28f415dd00ab7 (diff) |
libhb: make encoder options less x264-centric.
profile/level control and, to a lesser extent,
encoder presets and tunes are becoming more common.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6031 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/common.c')
-rw-r--r-- | libhb/common.c | 83 |
1 files changed, 55 insertions, 28 deletions
diff --git a/libhb/common.c b/libhb/common.c index bcbff39aa..6dbdde75c 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -3067,18 +3067,18 @@ static void job_clean( hb_job_t * job ) hb_filter_object_t *filter; hb_attachment_t *attachment; + free(job->encoder_preset); + job->encoder_preset = NULL; + free(job->encoder_tune); + job->encoder_tune = NULL; + free(job->encoder_options); + job->encoder_options = NULL; + free(job->encoder_profile); + job->encoder_profile = NULL; + free(job->encoder_level); + job->encoder_level = NULL; free(job->file); job->file = NULL; - free(job->advanced_opts); - job->advanced_opts = NULL; - free(job->x264_preset); - job->x264_preset = NULL; - free(job->x264_tune); - job->x264_tune = NULL; - free(job->h264_profile); - job->h264_profile = NULL; - free(job->h264_level); - job->h264_level = NULL; // clean up chapter list while( ( chapter = hb_list_item( job->list_chapter, 0 ) ) ) @@ -3184,54 +3184,81 @@ void hb_job_close( hb_job_t ** _j ) } } -void hb_job_set_file( hb_job_t *job, const char *file ) +void hb_job_set_encoder_preset(hb_job_t *job, const char *preset) { - if ( job ) + if (job != NULL) { - hb_update_str( &job->file, file ); + hb_update_str(&job->encoder_preset, preset); } } -void hb_job_set_advanced_opts( hb_job_t *job, const char *advanced_opts ) +void hb_job_set_encoder_tune(hb_job_t *job, const char *tune) { - if ( job ) + if (job != NULL) { - hb_update_str( &job->advanced_opts, advanced_opts ); + hb_update_str(&job->encoder_tune, tune); } } -void hb_job_set_x264_preset( hb_job_t *job, const char *preset ) +void hb_job_set_encoder_options(hb_job_t *job, const char *options) { - if ( job ) + if (job != NULL) { - hb_update_str( &job->x264_preset, preset ); + hb_update_str(&job->encoder_options, options); } } -void hb_job_set_x264_tune( hb_job_t *job, const char *tune ) +void hb_job_set_encoder_profile(hb_job_t *job, const char *profile) { - if ( job ) + if (job != NULL) { - hb_update_str( &job->x264_tune, tune ); + hb_update_str(&job->encoder_profile, profile); } } -void hb_job_set_h264_profile( hb_job_t *job, const char *profile ) +void hb_job_set_encoder_level(hb_job_t *job, const char *level) { - if ( job ) + if (job != NULL) { - hb_update_str( &job->h264_profile, profile ); + hb_update_str(&job->encoder_level, level); } } -void hb_job_set_h264_level( hb_job_t *job, const char *level ) +void hb_job_set_file(hb_job_t *job, const char *file) { - if ( job ) + if (job != NULL) { - hb_update_str( &job->h264_level, level ); + hb_update_str(&job->file, file); } } +#ifdef HB_API_OLD_PRESET_SETTERS +void hb_job_set_x264_preset(hb_job_t *job, const char *preset) +{ + hb_job_set_encoder_preset(job, preset); +} + +void hb_job_set_x264_tune(hb_job_t *job, const char *tune) +{ + hb_job_set_encoder_tune(job, tune); +} + +void hb_job_set_advanced_opts(hb_job_t *job, const char *opts) +{ + hb_job_set_encoder_options(job, opts); +} + +void hb_job_set_h264_profile(hb_job_t *job, const char *profile) +{ + hb_job_set_encoder_profile(job, profile); +} + +void hb_job_set_h264_level(hb_job_t *job, const char *level) +{ + hb_job_set_encoder_level(job, level); +} +#endif + hb_filter_object_t * hb_filter_copy( hb_filter_object_t * filter ) { if( filter == NULL ) |