Package com.biglybt.core.devices.impl
Class TranscodeJobImpl
java.lang.Object
com.biglybt.core.devices.impl.TranscodeJobImpl
- All Implemented Interfaces:
TranscodeJob
,DownloadWillBeRemovedListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
private int
private boolean
private Download
private boolean
private String
private int
private DiskManagerFileInfo
private boolean
private long
private int
private boolean
private long
private TranscodeProfile
private TranscodeQueueImpl
private long
private int
private InputStream
private AESemaphore
private TranscodeTarget
private TranscodeFileImpl
private static final int
private int
private boolean
Fields inherited from interface com.biglybt.core.devices.TranscodeJob
ST_CANCELLED, ST_COMPLETE, ST_FAILED, ST_PAUSED, ST_QUEUED, ST_REMOVED, ST_RUNNING, ST_STOPPED
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
TranscodeJobImpl
(TranscodeQueueImpl _queue, TranscodeTarget _target, TranscodeProfile _profile, DiskManagerFileInfo _file, boolean _add_stopped, int _transcode_requirement, boolean _is_stream) protected
TranscodeJobImpl
(TranscodeQueueImpl _queue, Map<String, Object> map) -
Method Summary
Modifier and TypeMethodDescriptionvoid
analyseNow
(TranscodeAnalysisListener listener) boolean
canPause()
protected boolean
protected void
complete()
protected void
destroy()
void
downloadWillBeRemoved
(Download download) protected void
void
generate
(IndentWriter writer) protected int
protected DeviceImpl
long
boolean
getError()
getETA()
long
getFile()
int
getIndex()
getName()
int
boolean
long
int
getState()
protected InputStream
getStream
(int wait_for_millis) int
protected void
init()
protected boolean
protected boolean
isStream()
void
moveDown()
void
moveUp()
void
pause()
void
queue()
void
remove()
void
protected void
reset()
void
resume()
protected void
setAutoRetry
(boolean _auto_retry) void
setEnableAutoRetry
(boolean enabled) void
setPreferDirectInput
(boolean prefer) protected void
setStream
(InputStream _stream) protected void
protected void
starts()
void
stop()
toMap()
protected void
updateProgress
(int _done, int _eta) protected void
protected void
updateStatus
(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:
IOException
TranscodeException
-
-
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:
getDownloadETA
in interfaceTranscodeJob
-
canUseDirectInput
protected boolean canUseDirectInput() -
useDirectInput
protected boolean useDirectInput() -
setUseDirectInput
protected void setUseDirectInput() -
setPreferDirectInput
public void setPreferDirectInput(boolean prefer) - Specified by:
setPreferDirectInput
in interfaceTranscodeJob
-
getPreferDirectInput
public boolean getPreferDirectInput()- Specified by:
getPreferDirectInput
in interfaceTranscodeJob
-
setAutoRetry
protected void setAutoRetry(boolean _auto_retry) -
isAutoRetry
protected boolean isAutoRetry() -
getAutoRetryCount
protected int getAutoRetryCount() -
setEnableAutoRetry
public void setEnableAutoRetry(boolean enabled) - Specified by:
setEnableAutoRetry
in interfaceTranscodeJob
-
getEnableAutoRetry
public boolean getEnableAutoRetry()- Specified by:
getEnableAutoRetry
in interfaceTranscodeJob
-
isStream
protected boolean isStream() -
setStream
-
getStream
- Throws:
IOException
-
downloadWillBeRemoved
- Specified by:
downloadWillBeRemoved
in interfaceDownloadWillBeRemovedListener
- Throws:
DownloadRemovalVetoException
-
getName
- Specified by:
getName
in 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:
getTarget
in interfaceTranscodeJob
-
getTranscodeRequirement
public int getTranscodeRequirement()- Specified by:
getTranscodeRequirement
in interfaceTranscodeJob
-
analyseNow
- Specified by:
analyseNow
in interfaceTranscodeJob
- Throws:
TranscodeException
-
getDevice
-
getProfile
- Specified by:
getProfile
in interfaceTranscodeJob
-
getFile
- Specified by:
getFile
in interfaceTranscodeJob
-
getTranscodeFile
- Specified by:
getTranscodeFile
in interfaceTranscodeJob
-
getIndex
public int getIndex()- Specified by:
getIndex
in interfaceTranscodeJob
-
getState
public int getState()- Specified by:
getState
in interfaceTranscodeJob
-
getPercentComplete
public int getPercentComplete()- Specified by:
getPercentComplete
in interfaceTranscodeJob
-
getETASecs
public long getETASecs()- Specified by:
getETASecs
in interfaceTranscodeJob
-
getETA
- Specified by:
getETA
in interfaceTranscodeJob
-
getError
- Specified by:
getError
in interfaceTranscodeJob
-
canPause
public boolean canPause()- Specified by:
canPause
in interfaceTranscodeJob
-
pause
public void pause()- Specified by:
pause
in interfaceTranscodeJob
-
resume
public void resume()- Specified by:
resume
in interfaceTranscodeJob
-
queue
public void queue()- Specified by:
queue
in interfaceTranscodeJob
-
stop
public void stop()- Specified by:
stop
in interfaceTranscodeJob
-
remove
- Specified by:
remove
in interfaceTranscodeJob
- Throws:
TranscodeActionVetoException
-
removeForce
public void removeForce()- Specified by:
removeForce
in interfaceTranscodeJob
-
destroy
protected void destroy() -
moveUp
public void moveUp()- Specified by:
moveUp
in interfaceTranscodeJob
-
moveDown
public void moveDown()- Specified by:
moveDown
in interfaceTranscodeJob
-
getProcessTime
public long getProcessTime()- Specified by:
getProcessTime
in interfaceTranscodeJob
-
generate
-