public class SinkImpl extends Object implements Sink, PacketSink
Constructor and Description |
---|
SinkImpl(String destName,
Format outputFormat,
Codec outputVideoCodec,
Codec outputAudioCodec) |
Modifier and Type | Method and Description |
---|---|
static SinkImpl |
createWithStream(SeekableByteChannel destStream,
Format outputFormat,
Codec outputVideoCodec,
Codec outputAudioCodec) |
protected ByteBuffer |
encodeAudio(AudioBuffer audioBuffer) |
protected VideoEncoder.EncodedFrame |
encodeVideo(Picture frame,
ByteBuffer _out) |
void |
finish()
Finilizes encoding process, flushes the buffers and closes off the
output file (or any other resources for that matter).
|
ColorSpace |
getInputColor()
Gets the color space that the sink expects
|
void |
init()
Initializes output to this sink.
|
void |
initMuxer() |
boolean |
isAudio() |
boolean |
isVideo() |
void |
outputAudioFrame(AudioFrameWithPacket audioFrame)
Outputs an audio frame to the sink
|
void |
outputAudioPacket(Packet audioPkt,
AudioCodecMeta audioCodecMeta) |
void |
outputVideoFrame(VideoFrameWithPacket videoFrame)
Outputs video frame to the sink
|
void |
outputVideoPacket(Packet packet,
VideoCodecMeta codecMeta) |
void |
setInterlaced(Boolean interlaced) |
void |
setOption(Options option,
Object value) |
void |
setProfile(String profile) |
public void outputVideoPacket(Packet packet, VideoCodecMeta codecMeta) throws IOException
outputVideoPacket
in interface PacketSink
IOException
public void outputAudioPacket(Packet audioPkt, AudioCodecMeta audioCodecMeta) throws IOException
outputAudioPacket
in interface PacketSink
IOException
public void initMuxer() throws IOException
IOException
public void finish() throws IOException
Sink
finish
in interface Sink
IOException
public static SinkImpl createWithStream(SeekableByteChannel destStream, Format outputFormat, Codec outputVideoCodec, Codec outputAudioCodec)
public void init() throws IOException
Sink
init
in interface Sink
IOException
protected VideoEncoder.EncodedFrame encodeVideo(Picture frame, ByteBuffer _out)
protected ByteBuffer encodeAudio(AudioBuffer audioBuffer)
public void setProfile(String profile)
public void setInterlaced(Boolean interlaced)
public void outputVideoFrame(VideoFrameWithPacket videoFrame) throws IOException
Sink
outputVideoFrame
in interface Sink
IOException
public void outputAudioFrame(AudioFrameWithPacket audioFrame) throws IOException
Sink
outputAudioFrame
in interface Sink
IOException
public ColorSpace getInputColor()
Sink
getInputColor
in interface Sink
Copyright © 2019. All rights reserved.