C# Class HandBrake.Interop.HandBrakeInstance

A wrapper for a HandBrake instance.
Inheritance: IHandBrakeInstance, IDisposable
Afficher le fichier Open project: golgol7777/HandBrakeWinSource Class Usage Examples

Méthodes publiques

Méthode Description
CalculateBitrate ( HandBrake.Interop.Model.EncodeJob job, int sizeMB, double overallSelectedLengthSeconds ) : int

Calculates the video bitrate for the given job and target size.

CalculateFileSize ( HandBrake.Interop.Model.EncodeJob job, int videoBitrate ) : double

Gives estimated file size (in MB) of the given job and video bitrate.

Dispose ( ) : void

Frees any resources associated with this object.

DisposeGlobal ( ) : void

Call before app shutdown. Performs global cleanup.

GetPreview ( HandBrake.Interop.Model.EncodeJob job, int previewNumber ) : BitmapImage

Gets an image for the given job and preview

Only incorporates sizing and aspect ratio into preview image.

GetSize ( HandBrake.Interop.Model.EncodeJob job, int &width, int &height, int &parWidth, int &parHeight ) : void

Gets the final size for a given encode job.

Initialize ( int verbosity ) : void

Initializes this instance.

PauseEncode ( ) : void

Pauses the current encode.

ResumeEncode ( ) : void

Resumes a paused encode.

StartEncode ( HandBrake.Interop.Model.EncodeJob jobToStart ) : void

Starts an encode with the given job.

StartEncode ( HandBrake.Interop.Model.EncodeJob job, bool preview, int previewNumber, int previewSeconds, double overallSelectedLengthSeconds ) : void

Starts an encode with the given job.

StartScan ( string path, int previewCount ) : void

Starts scanning the given path.

StartScan ( string path, int previewCount, int titleIndex ) : void

Starts a scan of the given path.

StopEncode ( ) : void

Stops the current encode.

StopScan ( ) : void

Stops an ongoing scan.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Frees any resources associated with this object.

Private Methods

Méthode Description
AddFilter ( List filterList, int filterType, string settings, List allocatedMemory ) : void

Adds a filter to the given filter list.

ApplyJob ( hb_job_s &nativeJob, HandBrake.Interop.Model.EncodeJob job ) : List

Applies the encoding job to the native memory structure and returns a list of memory locations allocated during this.

ApplyJob ( hb_job_s &nativeJob, HandBrake.Interop.Model.EncodeJob job, bool preview, int previewNumber, int previewSeconds, double overallSelectedLengthSeconds ) : List

Applies the encoding job to the native memory structure and returns a list of memory locations allocated during this.

CalculateNonAnamorphicOutput ( HandBrake.Interop.Model.Encoding.EncodingProfile profile, HandBrake.Interop.SourceData.Title title ) : HandBrake.Interop.Model.Size

Calculates the output size for a non-anamorphic job.

ConvertAudioBack ( AudioEncoding encoding, hb_audio_s baseStruct, int outputTrack, List allocatedMemory ) : hb_audio_s

Applies an audio encoding to a native audio encoding base structure.

ConvertTitle ( hb_title_s title ) : HandBrake.Interop.SourceData.Title

Converts a native title to a Title object.

GetNearestValue ( int number, int modulus ) : int

Gets the closest value to the given number divisible by the given modulus.

GetOriginalTitle ( int titleIndex ) : hb_title_s

Gets the native title object from the title index.

GetOutputTracks ( HandBrake.Interop.Model.EncodeJob job, HandBrake.Interop.SourceData.Title title ) : int>>.List

Gets a list of encodings and target track indices (1-based).

GetTitle ( int titleIndex ) : HandBrake.Interop.SourceData.Title

Gets the title, given the 1-based index.

PollEncodeProgress ( ) : void

Checks the status of the ongoing encode.

PollScanProgress ( ) : void

Checks the status of the ongoing scan.

Method Details

CalculateBitrate() public méthode

Calculates the video bitrate for the given job and target size.
public CalculateBitrate ( HandBrake.Interop.Model.EncodeJob job, int sizeMB, double overallSelectedLengthSeconds ) : int
job HandBrake.Interop.Model.EncodeJob The encode job.
sizeMB int The target size in MB.
overallSelectedLengthSeconds double The currently selected encode length. Used in preview /// for calculating bitrate when the target size would be wrong.
Résultat int

CalculateFileSize() public méthode

Gives estimated file size (in MB) of the given job and video bitrate.
public CalculateFileSize ( HandBrake.Interop.Model.EncodeJob job, int videoBitrate ) : double
job HandBrake.Interop.Model.EncodeJob The encode job.
videoBitrate int The video bitrate to be used (kbps).
Résultat double

Dispose() public méthode

Frees any resources associated with this object.
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

Frees any resources associated with this object.
protected Dispose ( bool disposing ) : void
disposing bool True if managed objects as well as unmanaged should be disposed.
Résultat void

DisposeGlobal() public static méthode

Call before app shutdown. Performs global cleanup.
public static DisposeGlobal ( ) : void
Résultat void

GetPreview() public méthode

Gets an image for the given job and preview
Only incorporates sizing and aspect ratio into preview image.
public GetPreview ( HandBrake.Interop.Model.EncodeJob job, int previewNumber ) : BitmapImage
job HandBrake.Interop.Model.EncodeJob The encode job to preview.
previewNumber int The index of the preview to get (0-based).
Résultat System.Windows.Media.Imaging.BitmapImage

GetSize() public méthode

Gets the final size for a given encode job.
public GetSize ( HandBrake.Interop.Model.EncodeJob job, int &width, int &height, int &parWidth, int &parHeight ) : void
job HandBrake.Interop.Model.EncodeJob The encode job to use.
width int The storage width.
height int The storage height.
parWidth int The pixel aspect X number.
parHeight int The pixel aspect Y number.
Résultat void

Initialize() public méthode

Initializes this instance.
public Initialize ( int verbosity ) : void
verbosity int The code for the logging verbosity to use.
Résultat void

PauseEncode() public méthode

Pauses the current encode.
public PauseEncode ( ) : void
Résultat void

ResumeEncode() public méthode

Resumes a paused encode.
public ResumeEncode ( ) : void
Résultat void

StartEncode() public méthode

Starts an encode with the given job.
public StartEncode ( HandBrake.Interop.Model.EncodeJob jobToStart ) : void
jobToStart HandBrake.Interop.Model.EncodeJob The job to start.
Résultat void

StartEncode() public méthode

Starts an encode with the given job.
public StartEncode ( HandBrake.Interop.Model.EncodeJob job, bool preview, int previewNumber, int previewSeconds, double overallSelectedLengthSeconds ) : void
job HandBrake.Interop.Model.EncodeJob The job to start.
preview bool True if this is a preview encode.
previewNumber int The preview number to start the encode at (0-based).
previewSeconds int The number of seconds in the preview.
overallSelectedLengthSeconds double The currently selected encode length. Used in preview /// for calculating bitrate when the target size would be wrong.
Résultat void

StartScan() public méthode

Starts scanning the given path.
public StartScan ( string path, int previewCount ) : void
path string The path to the video to scan.
previewCount int The number of preview images to make.
Résultat void

StartScan() public méthode

Starts a scan of the given path.
public StartScan ( string path, int previewCount, int titleIndex ) : void
path string The path of the video to scan.
previewCount int The number of previews to make on each title.
titleIndex int The title index to scan (1-based, 0 for all titles).
Résultat void

StopEncode() public méthode

Stops the current encode.
public StopEncode ( ) : void
Résultat void

StopScan() public méthode

Stops an ongoing scan.
public StopScan ( ) : void
Résultat void