summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
Diffstat (limited to 'libhb')
-rw-r--r--libhb/common.c40
-rw-r--r--libhb/common.h4
-rw-r--r--libhb/hb.c9
-rw-r--r--libhb/hb.h1
-rw-r--r--libhb/hb_dict.h4
5 files changed, 58 insertions, 0 deletions
diff --git a/libhb/common.c b/libhb/common.c
index a76ce9017..5cf4fc1f5 100644
--- a/libhb/common.c
+++ b/libhb/common.c
@@ -1776,6 +1776,14 @@ static void job_clean( hb_job_t * job )
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->x264_profile);
+ job->x264_profile = NULL;
+ free(job->h264_level);
+ job->h264_level = NULL;
// clean up chapter list
while( ( chapter = hb_list_item( job->list_chapter, 0 ) ) )
@@ -1897,6 +1905,38 @@ void hb_job_set_advanced_opts( hb_job_t *job, const char *advanced_opts )
}
}
+void hb_job_set_x264_preset( hb_job_t *job, const char *preset )
+{
+ if ( job )
+ {
+ hb_update_str( &job->x264_preset, preset );
+ }
+}
+
+void hb_job_set_x264_tune( hb_job_t *job, const char *tune )
+{
+ if ( job )
+ {
+ hb_update_str( &job->x264_tune, tune );
+ }
+}
+
+void hb_job_set_x264_profile( hb_job_t *job, const char *profile )
+{
+ if ( job )
+ {
+ hb_update_str( &job->x264_profile, profile );
+ }
+}
+
+void hb_job_set_x264_level( hb_job_t *job, const char *level )
+{
+ if ( job )
+ {
+ hb_update_str( &job->h264_level, level );
+ }
+}
+
hb_filter_object_t * hb_filter_copy( hb_filter_object_t * filter )
{
if( filter == NULL )
diff --git a/libhb/common.h b/libhb/common.h
index 796c3df38..b929852d0 100644
--- a/libhb/common.h
+++ b/libhb/common.h
@@ -120,6 +120,10 @@ void hb_limit_rational64( int64_t *x, int64_t *y, int64_t num, int64_t den, int6
void hb_fix_aspect( hb_job_t * job, int keep );
void hb_job_set_advanced_opts( hb_job_t *job, const char *advanced_opts );
+void hb_job_set_x264_preset( hb_job_t *job, const char *preset );
+void hb_job_set_x264_tune( hb_job_t *job, const char *tune );
+void hb_job_set_x264_profile( hb_job_t *job, const char *profile );
+void hb_job_set_x264_level( hb_job_t *job, const char *level );
void hb_job_set_file( hb_job_t *job, const char *file );
hb_audio_t *hb_audio_copy(const hb_audio_t *src);
diff --git a/libhb/hb.c b/libhb/hb.c
index 8a1ec3b1e..5a71ee7f2 100644
--- a/libhb/hb.c
+++ b/libhb/hb.c
@@ -1468,6 +1468,15 @@ void hb_add( hb_handle_t * h, hb_job_t * job )
job_copy->file = strdup( job->file );
if ( job->advanced_opts )
job_copy->advanced_opts = strdup( job->advanced_opts );
+ if ( job->x264_preset )
+ job_copy->x264_preset = strdup( job->x264_preset );
+ if ( job->x264_tune )
+ job_copy->x264_tune = strdup( job->x264_tune );
+ if ( job->x264_profile )
+ job_copy->x264_profile = strdup( job->x264_profile );
+ if ( job->h264_level )
+ job_copy->h264_level = strdup( job->h264_level );
+
job_copy->h = h;
job_copy->pause = h->pause_lock;
diff --git a/libhb/hb.h b/libhb/hb.h
index 4294d61c8..1cf1c2382 100644
--- a/libhb/hb.h
+++ b/libhb/hb.h
@@ -16,6 +16,7 @@ extern "C" {
#include "project.h"
#include "common.h"
+#include "hb_dict.h"
/* hb_init()
Initializes a libhb session (launches his own thread, detects CPUs,
diff --git a/libhb/hb_dict.h b/libhb/hb_dict.h
index d90e75aea..30155f1ba 100644
--- a/libhb/hb_dict.h
+++ b/libhb/hb_dict.h
@@ -6,6 +6,8 @@
It may be used under the terms of the GNU General Public License v2.
For full terms see the file COPYING file or visit http://www.gnu.org/licenses/gpl-2.0.html
*/
+#if !defined(HB_DICT_H)
+#define HB_DICT_H
typedef struct hb_dict_entry_s hb_dict_entry_t;
typedef struct hb_dict_s hb_dict_t;
@@ -48,3 +50,5 @@ struct hb_dict_s
int count;
hb_dict_entry_t * objects;
};
+
+#endif // !defined(HB_DICT_H)