-
public interface DataSinkA DataSink is an abstract representation of an encoded data collector. Currently the only implementation is DefaultDataSink which collects data into a java.io.File using android.media.MediaMuxer. However there might be other implementations in the future, for example to stream data to a server.
-
-
Method Summary
Modifier and Type Method Description abstract voidsetOrientation(int orientation)Called before starting to set the orientation metadata. abstract voidsetLocation(double latitude, double longitude)Called before starting to set the location metadata. abstract voidsetTrackStatus(@NonNull() TrackType type, @NonNull() TrackStatus status)Called before starting to set the status for the giventrack. abstract voidsetTrackFormat(@NonNull() TrackType type, @NonNull() MediaFormat format)Called by the transcoding pipeline when we have an output format. abstract voidwriteTrack(@NonNull() TrackType type, @NonNull() ByteBuffer byteBuffer, @NonNull() MediaCodec.BufferInfo bufferInfo)Called by the transcoding pipeline to write data into this sink. abstract voidstop()Called when transcoders have stopped writing. abstract voidrelease()Called to release resources.Any exception should probably be caught here. -
-
Method Detail
-
setOrientation
abstract void setOrientation(int orientation)
Called before starting to set the orientation metadata.
- Parameters:
orientation- 0, 90, 180 or 270
-
setLocation
abstract void setLocation(double latitude, double longitude)
Called before starting to set the location metadata.
- Parameters:
latitude- latitudelongitude- longitude
-
setTrackStatus
abstract void setTrackStatus(@NonNull() TrackType type, @NonNull() TrackStatus status)
Called before starting to set the status for the giventrack. The sink object can check if the track is transcodingusing isTranscoding.
- Parameters:
type- track typestatus- status
-
setTrackFormat
abstract void setTrackFormat(@NonNull() TrackType type, @NonNull() MediaFormat format)
Called by the transcoding pipeline when we have an output format.This is not the output format chosen by the library user but rather theoutput format determined by MediaCodec, which contains more information,and should be inspected to know what kind of data we're collecting.
- Parameters:
type- the track typeformat- the track format
-
writeTrack
abstract void writeTrack(@NonNull() TrackType type, @NonNull() ByteBuffer byteBuffer, @NonNull() MediaCodec.BufferInfo bufferInfo)
Called by the transcoding pipeline to write data into this sink.
- Parameters:
type- the track typebyteBuffer- the databufferInfo- the metadata
-
stop
abstract void stop()
Called when transcoders have stopped writing.
-
release
abstract void release()
Called to release resources.Any exception should probably be caught here.
-
-
-
-