summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-01-12 17:15:19 +0000
committerjstebbins <[email protected]>2015-01-12 17:15:19 +0000
commit84d152fecb516134d1d89d4689761430d6aa0a0d (patch)
tree325ba895366390a0ce2b2ca4ae5079e7a2fb9b50 /macosx
parent2d6aa981b2da6536051b4d350d3b491bd970a957 (diff)
Simplify frontend useage of hb_add()
Modify hb_add() to automatically add all necessary passes, so hb_add() only needs to be called once per job. It now automatically adds subtitle scan and 2-pass encoding passes. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6738 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r--macosx/HBCore.m49
-rw-r--r--macosx/HBJob.m1
-rw-r--r--macosx/HBPreviewGenerator.m38
3 files changed, 2 insertions, 86 deletions
diff --git a/macosx/HBCore.m b/macosx/HBCore.m
index a7156ab22..a1b9c995c 100644
--- a/macosx/HBCore.m
+++ b/macosx/HBCore.m
@@ -238,54 +238,7 @@ NSString *HBCoreMuxingNotification = @"HBCoreMuxingNotification";
[HBUtilities writeToActivityLog: "processNewQueueEncode number of passes expected is: %d", (job.video.twoPass + 1)];
hb_job_set_file(hb_job, job.destURL.path.fileSystemRepresentation);
- // If scanning we need to do some extra setup of the job.
- if (hb_job->indepth_scan == 1)
- {
- char *encoder_preset_tmp = hb_job->encoder_preset != NULL ? strdup(hb_job->encoder_preset) : NULL;
- char *encoder_tune_tmp = hb_job->encoder_tune != NULL ? strdup(hb_job->encoder_tune) : NULL;
- char *encoder_options_tmp = hb_job->encoder_options != NULL ? strdup(hb_job->encoder_options) : NULL;
- char *encoder_profile_tmp = hb_job->encoder_profile != NULL ? strdup(hb_job->encoder_profile) : NULL;
- char *encoder_level_tmp = hb_job->encoder_level != NULL ? strdup(hb_job->encoder_level) : NULL;
- /*
- * When subtitle scan is enabled do a fast pre-scan job
- * which will determine which subtitles to enable, if any.
- */
- hb_job_set_encoder_preset (hb_job, NULL);
- hb_job_set_encoder_tune (hb_job, NULL);
- hb_job_set_encoder_options(hb_job, NULL);
- hb_job_set_encoder_profile(hb_job, NULL);
- hb_job_set_encoder_level (hb_job, NULL);
- hb_job->pass = -1;
- hb_add(self.hb_handle, hb_job);
- /*
- * reset the advanced settings
- */
- hb_job_set_encoder_preset (hb_job, encoder_preset_tmp);
- hb_job_set_encoder_tune (hb_job, encoder_tune_tmp);
- hb_job_set_encoder_options(hb_job, encoder_options_tmp);
- hb_job_set_encoder_profile(hb_job, encoder_profile_tmp);
- hb_job_set_encoder_level (hb_job, encoder_level_tmp);
- free(encoder_preset_tmp);
- free(encoder_tune_tmp);
- free(encoder_options_tmp);
- free(encoder_profile_tmp);
- free(encoder_level_tmp);
- }
-
- if (job.video.twoPass)
- {
- hb_job->indepth_scan = 0;
- hb_job->pass = 1;
- hb_add(self.hb_handle, hb_job);
- hb_job->pass = 2;
- hb_add(self.hb_handle, hb_job);
- }
- else
- {
- hb_job->indepth_scan = 0;
- hb_job->pass = 0;
- hb_add(self.hb_handle, hb_job);
- }
+ hb_add(self.hb_handle, hb_job);
// Free the job
hb_job_close(&hb_job);
diff --git a/macosx/HBJob.m b/macosx/HBJob.m
index 62280becc..6bb19b2c0 100644
--- a/macosx/HBJob.m
+++ b/macosx/HBJob.m
@@ -233,6 +233,7 @@ NSString *keyContainerTag = @"keyContainerTag";
job->ipod_atom = self.mp4iPodCompatible;
}
+ job->twopass = self.video.twoPass;
if (job->vcodec == HB_VCODEC_X264 || job->vcodec == HB_VCODEC_X265)
{
// set fastfirstpass if 2-pass and Turbo are enabled
diff --git a/macosx/HBPreviewGenerator.m b/macosx/HBPreviewGenerator.m
index 70eec3d74..f60305622 100644
--- a/macosx/HBPreviewGenerator.m
+++ b/macosx/HBPreviewGenerator.m
@@ -242,46 +242,8 @@ typedef enum EncodeState : NSUInteger {
self.core = [[[HBCore alloc] initWithLoggingLevel:loggingLevel] autorelease];
self.core.name = @"PreviewCore";
- /*
- * If scanning we need to do some extra setup of the job.
- */
- if (job->indepth_scan == 1)
- {
- char *encoder_preset_tmp = job->encoder_preset != NULL ? strdup(job->encoder_preset) : NULL;
- char *encoder_tune_tmp = job->encoder_tune != NULL ? strdup(job->encoder_tune) : NULL;
- char *encoder_options_tmp = job->encoder_options != NULL ? strdup(job->encoder_options) : NULL;
- char *encoder_profile_tmp = job->encoder_profile != NULL ? strdup(job->encoder_profile) : NULL;
- char *encoder_level_tmp = job->encoder_level != NULL ? strdup(job->encoder_level) : NULL;
- /*
- * When subtitle scan is enabled do a fast pre-scan job
- * which will determine which subtitles to enable, if any.
- */
- hb_job_set_encoder_preset (job, NULL);
- hb_job_set_encoder_tune (job, NULL);
- hb_job_set_encoder_options(job, NULL);
- hb_job_set_encoder_profile(job, NULL);
- hb_job_set_encoder_level (job, NULL);
- job->pass = -1;
- hb_add(self.core.hb_handle, job);
- /*
- * reset the advanced settings
- */
- hb_job_set_encoder_preset (job, encoder_preset_tmp);
- hb_job_set_encoder_tune (job, encoder_tune_tmp);
- hb_job_set_encoder_options(job, encoder_options_tmp);
- hb_job_set_encoder_profile(job, encoder_profile_tmp);
- hb_job_set_encoder_level (job, encoder_level_tmp);
- free(encoder_preset_tmp);
- free(encoder_tune_tmp);
- free(encoder_options_tmp);
- free(encoder_profile_tmp);
- free(encoder_level_tmp);
- }
/* Go ahead and perform the actual encoding preview scan */
- job->indepth_scan = 0;
- job->pass = 0;
-
hb_add(self.core.hb_handle, job);
/* we need to clean up the various lists after the job(s) have been set */