diff options
author | ritsuka <[email protected]> | 2015-01-26 08:30:23 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2015-01-26 08:30:23 +0000 |
commit | de6e8f85686ad3f63be7fba7b4bf10aa1912a09a (patch) | |
tree | aa4a061b01b810e38a6d3af245a2380aceb58839 /macosx/HBCore.h | |
parent | 9545f5c9b6c3160b0e6cba9344232cb9e1493aaf (diff) |
MacGui: add a method to return a CGImageRef for a preview in HBCore, and skip the alpha to use less memory. Use a dispatch_source as a timer in HBCore so we will be able to run the update loop on its own thread. Remove the pointer to hb_handle_t, no class outside HBCore uses it.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6816 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBCore.h')
-rw-r--r-- | macosx/HBCore.h | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/macosx/HBCore.h b/macosx/HBCore.h index 6eee94065..03d05ba9e 100644 --- a/macosx/HBCore.h +++ b/macosx/HBCore.h @@ -8,6 +8,8 @@ #include "hb.h" @class HBJob; +@class HBPicture; +@class HBTitle; // These constants specify the current state of HBCore. typedef NS_ENUM(NSUInteger, HBState) { @@ -70,11 +72,6 @@ typedef void (^HBCoreCompletionHandler)(BOOL success); @property (nonatomic, readonly) HBState state; /** - * Pointer to a libhb handle used by this HBCore instance. - */ -@property (nonatomic, readonly) hb_handle_t *hb_handle; - -/** * The name of the core, used for debugging purpose. */ @property (nonatomic, copy) NSString *name; @@ -90,7 +87,7 @@ typedef void (^HBCoreCompletionHandler)(BOOL success); - (BOOL)canScan:(NSURL *)url error:(NSError **)error; /** - * Starts the asynchronous execution of a scan. + * Initiates an asynchronous scan operation and returns immediately. * * @param url the URL of the input file. * @param index the index of the desired title. Use 0 to scan every title. @@ -103,6 +100,7 @@ typedef void (^HBCoreCompletionHandler)(BOOL success); /** * Cancels the scan execution. + * Cancel can be invoked when the scan is running. */ - (void)cancelScan; @@ -112,7 +110,23 @@ typedef void (^HBCoreCompletionHandler)(BOOL success); @property (nonatomic, readonly) NSArray *titles; /** - * Starts an asynchronous encoding session with the passed job. + * This function converts an image created by libhb (specified via index) + * into an CGImage. + * + * @param index the index of the desired image. + * @param title Handle to hb_title_t of desired title + * @param frame a HBPicture instance that describe the image's frame. + * @param deinterlace whether the preview image must be deinterlaced or not. + * + * @return a CGImageRef of the wanted image, NULL if the index is out of bounds. + */ +- (CGImageRef)copyImageAtIndex:(NSUInteger)index + forTitle:(HBTitle *)title + pictureFrame:(HBPicture *)frame + deinterlace:(BOOL)deinterlace; + +/** + * Initiates an asynchronous encode operation and returns immediately. * * @param job the job to encode * @param progressHandler a block called periodically with the progress information. @@ -121,17 +135,20 @@ typedef void (^HBCoreCompletionHandler)(BOOL success); - (void)encodeJob:(HBJob *)job progressHandler:(HBCoreProgressHandler)progressHandler completionHandler:(HBCoreCompletionHandler)completionHandler; /** - * Stops encoding session and releases resources. + * Stops encode operation and releases resources. + * Cancel can be invoked when the encode is running. */ - (void)cancelEncode; /** - * Pauses the encoding session. + * Pauses the encode operation. + * Pause can be invoked when the encode is running. */ - (void)pause; /** * Resumes a paused encoding session. + * Resume can be invoked when the encode is running. */ - (void)resume; |