Class TranscodeJobImpl
java.lang.Object
com.biglybt.core.devices.impl.TranscodeJobImpl
- All Implemented Interfaces:
TranscodeJob, DownloadWillBeRemovedListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate intprivate booleanprivate Downloadprivate booleanprivate Stringprivate intprivate DiskManagerFileInfoprivate booleanprivate longprivate intprivate booleanprivate longprivate TranscodeProfileprivate TranscodeQueueImplprivate longprivate intprivate InputStreamprivate AESemaphoreprivate TranscodeTargetprivate TranscodeFileImplprivate static final intprivate intprivate booleanFields inherited from interface TranscodeJob
ST_CANCELLED, ST_COMPLETE, ST_FAILED, ST_PAUSED, ST_QUEUED, ST_REMOVED, ST_RUNNING, ST_STOPPED -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTranscodeJobImpl(TranscodeQueueImpl _queue, TranscodeTarget _target, TranscodeProfile _profile, DiskManagerFileInfo _file, boolean _add_stopped, int _transcode_requirement, boolean _is_stream) protectedTranscodeJobImpl(TranscodeQueueImpl _queue, Map<String, Object> map) -
Method Summary
Modifier and TypeMethodDescriptionvoidanalyseNow(TranscodeAnalysisListener listener) booleancanPause()protected booleanprotected voidcomplete()protected voiddestroy()voiddownloadWillBeRemoved(Download download) protected voidvoidgenerate(IndentWriter writer) protected intprotected DeviceImpllongbooleangetError()getETA()longgetFile()intgetIndex()getName()intbooleanlongintgetState()protected InputStreamgetStream(int wait_for_millis) intprotected voidinit()protected booleanprotected booleanisStream()voidmoveDown()voidmoveUp()voidpause()voidqueue()voidremove()voidprotected voidreset()voidresume()protected voidsetAutoRetry(boolean _auto_retry) voidsetEnableAutoRetry(boolean enabled) voidsetPreferDirectInput(boolean prefer) protected voidsetStream(InputStream _stream) protected voidprotected voidstarts()voidstop()toMap()protected voidupdateProgress(int _done, int _eta) protected voidprotected voidupdateStatus(boolean report_change) protected boolean
-
Field Details
-
TRANSCODE_OK_DL_PERCENT
private static final int TRANSCODE_OK_DL_PERCENT- See Also:
-
queue
-
target
-
profile
-
file
-
transcode_file
-
is_stream
private boolean is_stream -
stream
-
stream_sem
-
transcode_requirement
private int transcode_requirement -
state
private int state -
percent_complete
private int percent_complete -
eta
private int eta -
error
-
started_on
private long started_on -
paused_on
private long paused_on -
process_time
private long process_time -
use_direct_input
private boolean use_direct_input -
prefer_direct_input
private boolean prefer_direct_input -
auto_retry_enabled
private boolean auto_retry_enabled -
auto_retry
private boolean auto_retry -
auto_retry_count
private int auto_retry_count -
download
-
download_ok
private volatile boolean download_ok
-
-
Constructor Details
-
TranscodeJobImpl
protected TranscodeJobImpl(TranscodeQueueImpl _queue, TranscodeTarget _target, TranscodeProfile _profile, DiskManagerFileInfo _file, boolean _add_stopped, int _transcode_requirement, boolean _is_stream) throws TranscodeException - Throws:
TranscodeException
-
TranscodeJobImpl
protected TranscodeJobImpl(TranscodeQueueImpl _queue, Map<String, Object> map) throws IOException, TranscodeException- Throws:
IOExceptionTranscodeException
-
-
Method Details
-
toMap
- Throws:
IOException
-
init
- Throws:
TranscodeException
-
updateStatus
protected void updateStatus() -
updateStatus
protected void updateStatus(boolean report_change) -
getDownloadETA
public long getDownloadETA()- Specified by:
getDownloadETAin interfaceTranscodeJob
-
canUseDirectInput
protected boolean canUseDirectInput() -
useDirectInput
protected boolean useDirectInput() -
setUseDirectInput
protected void setUseDirectInput() -
setPreferDirectInput
public void setPreferDirectInput(boolean prefer) - Specified by:
setPreferDirectInputin interfaceTranscodeJob
-
getPreferDirectInput
public boolean getPreferDirectInput()- Specified by:
getPreferDirectInputin interfaceTranscodeJob
-
setAutoRetry
protected void setAutoRetry(boolean _auto_retry) -
isAutoRetry
protected boolean isAutoRetry() -
getAutoRetryCount
protected int getAutoRetryCount() -
setEnableAutoRetry
public void setEnableAutoRetry(boolean enabled) - Specified by:
setEnableAutoRetryin interfaceTranscodeJob
-
getEnableAutoRetry
public boolean getEnableAutoRetry()- Specified by:
getEnableAutoRetryin interfaceTranscodeJob
-
isStream
protected boolean isStream() -
setStream
-
getStream
- Throws:
IOException
-
downloadWillBeRemoved
- Specified by:
downloadWillBeRemovedin interfaceDownloadWillBeRemovedListener- Throws:
DownloadRemovalVetoException
-
getName
- Specified by:
getNamein interfaceTranscodeJob
-
reset
protected void reset() -
starts
protected void starts() -
failed
-
complete
protected void complete() -
updateProgress
protected void updateProgress(int _done, int _eta) -
getTarget
- Specified by:
getTargetin interfaceTranscodeJob
-
getTranscodeRequirement
public int getTranscodeRequirement()- Specified by:
getTranscodeRequirementin interfaceTranscodeJob
-
analyseNow
- Specified by:
analyseNowin interfaceTranscodeJob- Throws:
TranscodeException
-
getDevice
-
getProfile
- Specified by:
getProfilein interfaceTranscodeJob
-
getFile
- Specified by:
getFilein interfaceTranscodeJob
-
getTranscodeFile
- Specified by:
getTranscodeFilein interfaceTranscodeJob
-
getIndex
public int getIndex()- Specified by:
getIndexin interfaceTranscodeJob
-
getState
public int getState()- Specified by:
getStatein interfaceTranscodeJob
-
getPercentComplete
public int getPercentComplete()- Specified by:
getPercentCompletein interfaceTranscodeJob
-
getETASecs
public long getETASecs()- Specified by:
getETASecsin interfaceTranscodeJob
-
getETA
- Specified by:
getETAin interfaceTranscodeJob
-
getError
- Specified by:
getErrorin interfaceTranscodeJob
-
canPause
public boolean canPause()- Specified by:
canPausein interfaceTranscodeJob
-
pause
public void pause()- Specified by:
pausein interfaceTranscodeJob
-
resume
public void resume()- Specified by:
resumein interfaceTranscodeJob
-
queue
public void queue()- Specified by:
queuein interfaceTranscodeJob
-
stop
public void stop()- Specified by:
stopin interfaceTranscodeJob
-
remove
- Specified by:
removein interfaceTranscodeJob- Throws:
TranscodeActionVetoException
-
removeForce
public void removeForce()- Specified by:
removeForcein interfaceTranscodeJob
-
destroy
protected void destroy() -
moveUp
public void moveUp()- Specified by:
moveUpin interfaceTranscodeJob
-
moveDown
public void moveDown()- Specified by:
moveDownin interfaceTranscodeJob
-
getProcessTime
public long getProcessTime()- Specified by:
getProcessTimein interfaceTranscodeJob
-
generate
-