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
FileNotFoundException
IOException
protected int seekToKeyFrame(int frame) throws IOException
frame
- A frame to seekIOException
public Packet inputVideoPacket() throws IOException
inputVideoPacket
in interface PacketSource
IOException
public Packet inputAudioPacket() throws IOException
inputAudioPacket
in interface PacketSource
IOException
public DemuxerTrackMeta getTrackVideoMeta()
public DemuxerTrackMeta getAudioMeta()
public void finish()
Source
public void init(PixelStore pixelStore) throws IOException
Source
init
in interface Source
pixelStore
- The pixel store where the buffers for the returned pictures
will be borrowed from.IOException
public Picture decodeVideo(ByteBuffer data, Picture target1)
protected ByteBuffer decodeAudio(ByteBuffer audioPkt) throws IOException
IOException
public void seekFrames(int seekFrames) throws IOException
Source
seekFrames
in interface Source
IOException
protected PixelStore.LoanerPicture getPixelBuffer(ByteBuffer firstFrame)
firstFrame
- public VideoCodecMeta getVideoCodecMeta()
Source
getVideoCodecMeta
in interface Source
public VideoFrameWithPacket getNextVideoFrame() throws IOException
Source
getNextVideoFrame
in interface Source
IOException
public AudioFrameWithPacket getNextAudioFrame() throws IOException
Source
getNextAudioFrame
in interface Source
IOException
public AudioCodecMeta getAudioCodecMeta()
Source
getAudioCodecMeta
in interface Source
public static JpegDecoder createJpegDecoder(int downscale)
Copyright © 2019. All rights reserved.