public class SourceImpl extends Object implements Source, PacketSource
| Constructor and Description |
|---|
SourceImpl(String sourceName,
Format inputFormat,
Tuple._3<Integer,Integer,Codec> inputVideoCodec,
Tuple._3<Integer,Integer,Codec> inputAudioCodec) |
| Modifier and Type | Method and Description |
|---|---|
static JpegDecoder |
createJpegDecoder(int downscale) |
static MPEGDecoder |
createMpegDecoder(int downscale) |
static ProresDecoder |
createProresDecoder(int downscale) |
protected ByteBuffer |
decodeAudio(ByteBuffer audioPkt) |
Picture |
decodeVideo(ByteBuffer data,
Picture target1) |
void |
finish()
Closes the input and flushes all the buffers related to this source.
|
AudioCodecMeta |
getAudioCodecMeta()
Gets the metadata about audio
|
DemuxerTrackMeta |
getAudioMeta() |
Tuple._3<Integer,Integer,Codec> |
getInputAudioCode() |
Tuple._3<Integer,Integer,Codec> |
getIntputVideoCodec() |
AudioFrameWithPacket |
getNextAudioFrame()
Gets the next decoded audio frame from this source
|
VideoFrameWithPacket |
getNextVideoFrame()
Gets the next video frame from this source
|
protected PixelStore.LoanerPicture |
getPixelBuffer(ByteBuffer firstFrame)
Returns a pixel buffer of a suitable size to hold the given video frame.
|
DemuxerTrackMeta |
getTrackVideoMeta() |
VideoCodecMeta |
getVideoCodecMeta()
Gets the metadata about video
|
boolean |
haveAudio() |
void |
init(PixelStore pixelStore)
Starts reading media data from the source.
|
void |
initDemuxer() |
Packet |
inputAudioPacket() |
Packet |
inputVideoPacket() |
boolean |
isAudio() |
boolean |
isVideo() |
void |
seekFrames(int seekFrames)
Skips some number of frames in this source
|
protected int |
seekToKeyFrame(int frame)
Seeks to a previous key frame prior or on the given frame, if the track is
not seekable returns 0.
|
void |
setOption(Options option,
Object value) |
public static MPEGDecoder createMpegDecoder(int downscale)
public static ProresDecoder createProresDecoder(int downscale)
public void initDemuxer()
throws FileNotFoundException,
IOException
FileNotFoundExceptionIOExceptionprotected int seekToKeyFrame(int frame)
throws IOException
frame - A frame to seekIOExceptionpublic Packet inputVideoPacket() throws IOException
inputVideoPacket in interface PacketSourceIOExceptionpublic Packet inputAudioPacket() throws IOException
inputAudioPacket in interface PacketSourceIOExceptionpublic DemuxerTrackMeta getTrackVideoMeta()
public DemuxerTrackMeta getAudioMeta()
public void finish()
Sourcepublic void init(PixelStore pixelStore) throws IOException
Sourceinit in interface SourcepixelStore - The pixel store where the buffers for the returned pictures
will be borrowed from.IOExceptionpublic Picture decodeVideo(ByteBuffer data, Picture target1)
protected ByteBuffer decodeAudio(ByteBuffer audioPkt) throws IOException
IOExceptionpublic void seekFrames(int seekFrames)
throws IOException
SourceseekFrames in interface SourceIOExceptionprotected PixelStore.LoanerPicture getPixelBuffer(ByteBuffer firstFrame)
firstFrame - public VideoCodecMeta getVideoCodecMeta()
SourcegetVideoCodecMeta in interface Sourcepublic VideoFrameWithPacket getNextVideoFrame() throws IOException
SourcegetNextVideoFrame in interface SourceIOExceptionpublic AudioFrameWithPacket getNextAudioFrame() throws IOException
SourcegetNextAudioFrame in interface SourceIOExceptionpublic AudioCodecMeta getAudioCodecMeta()
SourcegetAudioCodecMeta in interface Sourcepublic static JpegDecoder createJpegDecoder(int downscale)
Copyright © 2019. All rights reserved.