20 #ifndef AUDIOSAMPLES_H_
21 #define AUDIOSAMPLES_H_
23 #include <com/avpkit/ferry/RefPointer.h>
24 #include <com/avpkit/core/AVPKit.h>
25 #include <com/avpkit/core/IAudioSamples.h>
26 #include <com/avpkit/ferry/IBuffer.h>
27 #include <com/avpkit/core/IRational.h>
29 namespace com {
namespace avpkit {
namespace core
42 virtual bool isKey() {
return true; }
60 virtual void setPts(int64_t aValue);
62 virtual int32_t
setSample(int32_t sampleIndex, int32_t channel,
Format format, int32_t sample);
63 virtual int32_t
getSample(int32_t sampleIndex, int32_t channel,
Format format);
65 virtual void setComplete(
bool complete, int32_t numSamples,
66 int32_t sampleRate, int32_t channels,
Format sampleFmt,
69 virtual void setComplete(
bool complete, int32_t numSamples,
70 int32_t sampleRate, int32_t channels,
ChannelLayout channelLayout,
71 Format format, int64_t pts);
83 virtual short *getRawSamples(uint32_t startingSample);
104 void allocInternalSamples();
110 int32_t mRequestedSamples;
virtual int32_t getSampleSize()
virtual int32_t getMaxSamples()
virtual int32_t getSampleRate()
Find the sample rate of the samples in this audio buffer.
virtual int64_t getTimeStamp()
Get the time stamp of this object in getTimeBase() units.
virtual Format getFormat()
Find the Format of the samples in this buffer.
virtual int32_t getSize()
Get the size in bytes of the raw data available for this object.
virtual int32_t getChannels()
Return the number of channels of the samples in this buffer.
virtual IRational * getTimeBase()
Get the time base that time stamps of this object are represented in.
virtual com::avpkit::ferry::IBuffer * getData()
Get any underlying raw data available for this object.
virtual int32_t ensureCapacity(int32_t capacityInBytes)
Called by decoder before decoding to ensure sufficient space.
virtual void setTimeBase(IRational *aBase)
Set the time base that time stamps of this object are represented in.
virtual bool isKey()
Is this object a key object? i.e.
virtual void setComplete(bool complete, int32_t numSamples, int32_t sampleRate, int32_t channels, Format sampleFmt, int64_t pts)
Call this if you modify the samples and are now done.
virtual int64_t getPts()
What is the Presentation Time Stamp of this set of audio samples.
virtual int32_t getMaxBufferSize()
virtual void setPts(int64_t aValue)
Set the Presentation Time Stamp for this set of samples.
virtual int32_t setSample(int32_t sampleIndex, int32_t channel, Format format, int32_t sample)
Sets the sample at the given index and channel to the sample.
virtual void setTimeStamp(int64_t aTimeStamp)
Set the time stamp for this object in getTimeBase() units.
virtual int32_t getSample(int32_t sampleIndex, int32_t channel, Format format)
Get the sample at the given sampleIndex and channel, and return it in the asked for format.
virtual int32_t getNumSamples()
Get the number of samples in this video.
virtual int32_t getSampleBitDepth()
Find out the bit-depth of the samples in this buffer.
virtual void setData(com::avpkit::ferry::IBuffer *buffer)
Sets the underlying buffer used by this object.
virtual bool isComplete()
Returns whether or not we think this buffer has been filled with data.
virtual int64_t getNextPts()
What would be the next Presentation Time Stamp after all the samples in this buffer were played?
A set of raw (decoded) samples, plus a timestamp for when to play those samples relative to other ite...
Format
The format we use to represent audio.
This class wraps represents a Rational number for the AVPKit.
Allows Java code to get data from a native buffers, and optionally modify native memory directly.
WARNING: Do not use logging in this class, and do not set any static file variables to values other t...