com.aelitis.azureus.core.devices.impl
Class TranscodeJobImpl

java.lang.Object
  extended by com.aelitis.azureus.core.devices.impl.TranscodeJobImpl
All Implemented Interfaces:
TranscodeJob, DownloadWillBeRemovedListener

public class TranscodeJobImpl
extends Object
implements TranscodeJob, DownloadWillBeRemovedListener


Field Summary
 
Fields inherited from interface com.aelitis.azureus.core.devices.TranscodeJob
ST_CANCELLED, ST_COMPLETE, ST_FAILED, ST_PAUSED, ST_QUEUED, ST_REMOVED, ST_RUNNING, ST_STOPPED
 
Constructor Summary
protected TranscodeJobImpl(TranscodeQueueImpl _queue, Map<String,Object> map)
           
protected TranscodeJobImpl(TranscodeQueueImpl _queue, TranscodeTarget _target, TranscodeProfile _profile, DiskManagerFileInfo _file, boolean _add_stopped, int _transcode_requirement, boolean _is_stream)
           
 
Method Summary
 void analyseNow(TranscodeAnalysisListener listener)
           
 boolean canPause()
           
protected  boolean canUseDirectInput()
           
protected  void complete()
           
protected  void destroy()
           
 void downloadWillBeRemoved(Download download)
           
protected  void failed(Throwable e)
           
 void generate(IndentWriter writer)
           
protected  int getAutoRetryCount()
           
protected  DeviceImpl getDevice()
           
 long getDownloadETA()
           
 boolean getEnableAutoRetry()
           
 String getError()
           
 String getETA()
           
 long getETASecs()
           
 DiskManagerFileInfo getFile()
           
 int getIndex()
           
 String getName()
           
 int getPercentComplete()
           
 boolean getPreferDirectInput()
           
 long getProcessTime()
           
 TranscodeProfile getProfile()
           
 int getState()
           
protected  InputStream getStream(int wait_for_millis)
           
 TranscodeTarget getTarget()
           
 com.aelitis.azureus.core.devices.impl.TranscodeFileImpl getTranscodeFile()
           
 int getTranscodeRequirement()
           
protected  void init()
           
protected  boolean isAutoRetry()
           
protected  boolean isStream()
           
 void moveDown()
           
 void moveUp()
           
 void pause()
           
 void queue()
           
 void remove()
           
 void removeForce()
           
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 setUseDirectInput()
           
protected  void starts()
           
 void stop()
           
protected  Map<String,Object> toMap()
           
protected  void updateProgress(int _done, int _eta)
           
protected  void updateStatus()
           
protected  void updateStatus(boolean report_change)
           
protected  boolean useDirectInput()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 Detail

toMap

protected Map<String,Object> toMap()
                            throws IOException
Throws:
IOException

init

protected void init()
             throws TranscodeException
Throws:
TranscodeException

updateStatus

protected void updateStatus()

updateStatus

protected void updateStatus(boolean report_change)

getDownloadETA

public long getDownloadETA()
Specified by:
getDownloadETA in interface TranscodeJob

canUseDirectInput

protected boolean canUseDirectInput()

useDirectInput

protected boolean useDirectInput()

setUseDirectInput

protected void setUseDirectInput()

setPreferDirectInput

public void setPreferDirectInput(boolean prefer)
Specified by:
setPreferDirectInput in interface TranscodeJob

getPreferDirectInput

public boolean getPreferDirectInput()
Specified by:
getPreferDirectInput in interface TranscodeJob

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 interface TranscodeJob

getEnableAutoRetry

public boolean getEnableAutoRetry()
Specified by:
getEnableAutoRetry in interface TranscodeJob

isStream

protected boolean isStream()

setStream

protected void setStream(InputStream _stream)

getStream

protected InputStream getStream(int wait_for_millis)
                         throws IOException
Throws:
IOException

downloadWillBeRemoved

public void downloadWillBeRemoved(Download download)
                           throws DownloadRemovalVetoException
Specified by:
downloadWillBeRemoved in interface DownloadWillBeRemovedListener
Throws:
DownloadRemovalVetoException

getName

public String getName()
Specified by:
getName in interface TranscodeJob

reset

protected void reset()

starts

protected void starts()

failed

protected void failed(Throwable e)

complete

protected void complete()

updateProgress

protected void updateProgress(int _done,
                              int _eta)

getTarget

public TranscodeTarget getTarget()
Specified by:
getTarget in interface TranscodeJob

getTranscodeRequirement

public int getTranscodeRequirement()
Specified by:
getTranscodeRequirement in interface TranscodeJob

analyseNow

public void analyseNow(TranscodeAnalysisListener listener)
                throws TranscodeException
Specified by:
analyseNow in interface TranscodeJob
Throws:
TranscodeException

getDevice

protected DeviceImpl getDevice()

getProfile

public TranscodeProfile getProfile()
Specified by:
getProfile in interface TranscodeJob

getFile

public DiskManagerFileInfo getFile()
Specified by:
getFile in interface TranscodeJob

getTranscodeFile

public com.aelitis.azureus.core.devices.impl.TranscodeFileImpl getTranscodeFile()
Specified by:
getTranscodeFile in interface TranscodeJob

getIndex

public int getIndex()
Specified by:
getIndex in interface TranscodeJob

getState

public int getState()
Specified by:
getState in interface TranscodeJob

getPercentComplete

public int getPercentComplete()
Specified by:
getPercentComplete in interface TranscodeJob

getETASecs

public long getETASecs()
Specified by:
getETASecs in interface TranscodeJob

getETA

public String getETA()
Specified by:
getETA in interface TranscodeJob

getError

public String getError()
Specified by:
getError in interface TranscodeJob

canPause

public boolean canPause()
Specified by:
canPause in interface TranscodeJob

pause

public void pause()
Specified by:
pause in interface TranscodeJob

resume

public void resume()
Specified by:
resume in interface TranscodeJob

queue

public void queue()
Specified by:
queue in interface TranscodeJob

stop

public void stop()
Specified by:
stop in interface TranscodeJob

remove

public void remove()
            throws TranscodeActionVetoException
Specified by:
remove in interface TranscodeJob
Throws:
TranscodeActionVetoException

removeForce

public void removeForce()
Specified by:
removeForce in interface TranscodeJob

destroy

protected void destroy()

moveUp

public void moveUp()
Specified by:
moveUp in interface TranscodeJob

moveDown

public void moveDown()
Specified by:
moveDown in interface TranscodeJob

getProcessTime

public long getProcessTime()
Specified by:
getProcessTime in interface TranscodeJob

generate

public void generate(IndentWriter writer)