Package com.mku.android.salmon.media
Class SalmonMediaDataSource
java.lang.Object
MediaDataSource
com.mku.android.salmon.media.SalmonMediaDataSource
public class SalmonMediaDataSource
extends MediaDataSource
This class provides a parallel processing seekable source for encrypted media content
-
Constructor Summary
ConstructorDescriptionSalmonMediaDataSource
(Activity activity, SalmonFile salmonFile, int buffers, int bufferSize, int threads, int backOffset) Construct a seekable source for the media player from an encrypted file source -
Method Summary
-
Constructor Details
-
SalmonMediaDataSource
public SalmonMediaDataSource(Activity activity, SalmonFile salmonFile, int buffers, int bufferSize, int threads, int backOffset) throws Exception Construct a seekable source for the media player from an encrypted file source- Parameters:
activity
- Activity this data source will be used with. This is usually the activity the MediaPlayer is attached tosalmonFile
- SalmonFile that will be used as a sourcebuffers
- The buffersbufferSize
- Buffer sizethreads
- Threads for parallel processingbackOffset
- The backwards offset to use when reading buffers- Throws:
Exception
- Thrown if error occured
-
-
Method Details
-
readAt
Decrypts and reads the contents of an encrypted file- Parameters:
position
- The source file position the read will start frombuffer
- The buffer that will store the decrypted contentsoffset
- The position on the buffer that the decrypted data will startsize
- The length of the data requested- Throws:
IOException
-
getSize
public long getSize()Get the content size.- Returns:
- The size
-
close
Close the source and all associated resources.- Throws:
IOException
- Thrown if error during IO
-