Package com.avpkit.core
Interface ISimpleMediaFile
-
- All Known Implementing Classes:
SimpleMediaFile
public interface ISimpleMediaFile
This class contains meta-information about simple media files. A simple media file is defined as a file with at most one video and at most one audio stream, and no other streams. This is useful or objects that want to contain all the interesting data about a media file in one handy dandy object.- Author:
- aclarke
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetAudioBitRate()Get the audio bit rateintgetAudioChannels()Get the number of audio channelsICodec.IDgetAudioCodec()Get the audio codec set on this configuration object.IAudioSamples.FormatgetAudioSampleFormat()Get the audio sample format.intgetAudioSampleRate()Get the audio sample rate.IRationalgetAudioTimeBase()Get the time base used when encoding or decoding audio.IContainerFormatgetContainerFormat()Get the container format, if known, for this container.ITimeValuegetDuration()Get the duration that we'll assume for the stream we're representing.java.lang.StringgetURL()Return the URL for this stream.intgetVideoBitRate()Get the video bit rateICodec.IDgetVideoCodec()Get the video codec that packets are encoded with.IRationalgetVideoFrameRate()Get the Video Frame RateintgetVideoGlobalQuality()Get the VideoGlobalQuality setting.intgetVideoHeight()Get the video height of video frames broadcastedintgetVideoNumPicturesInGroupOfPictures()Get the GOPS.IPixelFormat.TypegetVideoPixelFormat()Return the pixel format to useIRationalgetVideoTimeBase()Get the timebase that packets should be encoded with.intgetVideoWidth()Get the video width of video frames broadcastedbooleanhasAudio()Tells whether or not the output stream should have audiobooleanhasVideo()Tells whether or not the output stream should have videobooleanisAudioBitRateKnown()is the audio bit rate known?booleanisAudioChannelsKnown()are the # of audio channels known?booleanisAudioSampleRateKnown()is the audio sample rate known?booleanisVideoBitRateKnown()is the video bit rate known?booleanisVideoGlobalQualityKnown()is the global quality setting known?booleanisVideoHeightKnown()is the video height known?booleanisVideoNumPicturesInGroupOfPicturesKnown()is the MPEG number of pictures in a group of pictures known?booleanisVideoPixelFormatKnown()is the video pixel format known?booleanisVideoWidthKnown()is the video width known?voidsetAudioBitRate(int bitRate)Set the audio bitratevoidsetAudioBitRateKnown(boolean audioBitRateKnown)set if the audio bit rate is known.voidsetAudioChannels(int numChannels)Set the number of audio channels.voidsetAudioChannelsKnown(boolean audioChannelsKnown)set if the audio channels are knownvoidsetAudioCodec(ICodec.ID audioCodec)Set the audio codec to use.voidsetAudioSampleFormat(IAudioSamples.Format format)Set the audio sample format you want to use in this file.voidsetAudioSampleRate(int sampleRate)Set the audio sample ratevoidsetAudioSampleRateKnown(boolean audioSampleRateKnown)set if the audio sample rate is known.voidsetAudioTimeBase(IRational aTimeBase)Set the time base to use when encoding or decoding audiovoidsetContainerFormat(IContainerFormat format)Sets the container format for this streamvoidsetDuration(ITimeValue duration)Set the duration that we'll assume for the stream we're representing.voidsetHasAudio(boolean hasAudio)Set whether you want the output stream to have audiovoidsetHasVideo(boolean hasVideo)Set whether you want the output stream to have videovoidsetURL(java.lang.String aUrl)Set the URL that this stream contains info for.voidsetVideoBitRate(int bitRate)Set the timebase that we encode video for.voidsetVideoBitRateKnown(boolean videoBitRateKnown)set if the video bit rate is known.voidsetVideoCodec(ICodec.ID videoCodec)Set the video codec that packets are encoded with.voidsetVideoFrameRate(IRational frameRate)Set the Video Frame Rate as a rational.voidsetVideoGlobalQuality(int quality)Set the default quality quality setting for video.voidsetVideoGlobalQualityKnown(boolean videoGlobalQualityKnown)set if the global quality setting is known.voidsetVideoHeight(int height)Set the height of the video frames in broadcasted packetsvoidsetVideoHeightKnown(boolean videoHeightKnown)set if the video height is known.voidsetVideoNumPicturesInGroupOfPictures(int gops)Set the MPEG2 Num Pictures In Group Of Pictures (GOPS) settingsvoidsetVideoNumPicturesInGroupOfPicturesKnown(boolean videoGOPSKnown)set if the MPEG number of pictures in a group of pictures is known?voidsetVideoPixelFormat(IPixelFormat.Type aPixelFormat)Sets the pixel format to usevoidsetVideoPixelFormatKnown(boolean videoPixelFormatKnown)set if the video pixel format is known.voidsetVideoTimeBase(IRational timeBase)Set the TimeBase that video packets are encoded with.voidsetVideoWidth(int width)Set the width of the video frames in broadcasted packetsvoidsetVideoWidthKnown(boolean videoWidthKnown)set if the video width is known.
-
-
-
Method Detail
-
setAudioBitRate
void setAudioBitRate(int bitRate)
Set the audio bitrate- Parameters:
bitRate- bitrate to use
-
getAudioBitRate
int getAudioBitRate()
Get the audio bit rate- Returns:
- bit rate, in Hz.
-
setAudioChannels
void setAudioChannels(int numChannels)
Set the number of audio channels.- Parameters:
numChannels- Number of channels; only 1 or 2 supported
-
getAudioChannels
int getAudioChannels()
Get the number of audio channels- Returns:
- number of audio channels
-
setAudioSampleRate
void setAudioSampleRate(int sampleRate)
Set the audio sample rate- Parameters:
sampleRate- Audio sample rate in Hz (e.g. 22050)
-
getAudioSampleRate
int getAudioSampleRate()
Get the audio sample rate.- Returns:
- sample rate, in Hz.
-
setAudioSampleFormat
void setAudioSampleFormat(IAudioSamples.Format format)
Set the audio sample format you want to use in this file.- Parameters:
format- The sample format to use.
-
getAudioSampleFormat
IAudioSamples.Format getAudioSampleFormat()
Get the audio sample format.- Returns:
- The audio sample format. Defaults to
IAudioSamples.Format.FMT_S16if not specified.
-
setAudioCodec
void setAudioCodec(ICodec.ID audioCodec)
Set the audio codec to use.- Parameters:
audioCodec- The audio codec to use; if null, a user may guess the codec from other information.
-
getAudioCodec
ICodec.ID getAudioCodec()
Get the audio codec set on this configuration object.- Returns:
- The audiocodec. if null, a user may guess the codec from other information.
-
setVideoWidth
void setVideoWidth(int width)
Set the width of the video frames in broadcasted packets- Parameters:
width- width in pixels
-
getVideoWidth
int getVideoWidth()
Get the video width of video frames broadcasted- Returns:
- width in pixels
-
setVideoHeight
void setVideoHeight(int height)
Set the height of the video frames in broadcasted packets- Parameters:
height- height in pixels
-
getVideoHeight
int getVideoHeight()
Get the video height of video frames broadcasted- Returns:
- height in pixels
-
setVideoBitRate
void setVideoBitRate(int bitRate)
Set the timebase that we encode video for.- Parameters:
bitRate- The bitrate to use for encoding video
-
getVideoBitRate
int getVideoBitRate()
Get the video bit rate- Returns:
- video bit rate
-
setVideoTimeBase
void setVideoTimeBase(IRational timeBase)
Set the TimeBase that video packets are encoded with.- Parameters:
timeBase- The timebase to use with this configuration, or null if unknowbn.
-
getVideoTimeBase
IRational getVideoTimeBase()
Get the timebase that packets should be encoded with.- Returns:
- The timebase or null if unknown.
-
setVideoCodec
void setVideoCodec(ICodec.ID videoCodec)
Set the video codec that packets are encoded with.- Parameters:
videoCodec- video codec that packets are encoded with.
-
getVideoCodec
ICodec.ID getVideoCodec()
Get the video codec that packets are encoded with.- Returns:
- the video codec
-
getVideoPixelFormat
IPixelFormat.Type getVideoPixelFormat()
Return the pixel format to use- Returns:
- The pixel format.
-
setVideoPixelFormat
void setVideoPixelFormat(IPixelFormat.Type aPixelFormat)
Sets the pixel format to use- Parameters:
aPixelFormat- Pixel format
-
setVideoNumPicturesInGroupOfPictures
void setVideoNumPicturesInGroupOfPictures(int gops)
Set the MPEG2 Num Pictures In Group Of Pictures (GOPS) settings- Parameters:
gops- Set the GOPS
-
getVideoNumPicturesInGroupOfPictures
int getVideoNumPicturesInGroupOfPictures()
Get the GOPS.- Returns:
- The GOPS
- See Also:
setVideoNumPicturesInGroupOfPictures(int)
-
setVideoFrameRate
void setVideoFrameRate(IRational frameRate)
Set the Video Frame Rate as a rational.- Parameters:
frameRate- The frame rate (e.g. 15/1), or null if unknown.
-
getVideoFrameRate
IRational getVideoFrameRate()
Get the Video Frame Rate- Returns:
- The video frame rate, or null if unknown
- See Also:
setVideoFrameRate(IRational)
-
setVideoGlobalQuality
void setVideoGlobalQuality(int quality)
Set the default quality quality setting for video. 0 is highest quality. > 0 is decreasing quality.- Parameters:
quality- The quality to use.
-
getVideoGlobalQuality
int getVideoGlobalQuality()
Get the VideoGlobalQuality setting.- Returns:
- The global quality for video
- See Also:
setVideoGlobalQuality(int)
-
setHasVideo
void setHasVideo(boolean hasVideo)
Set whether you want the output stream to have video- Parameters:
hasVideo- Whether you want the output stream to have video
-
hasVideo
boolean hasVideo()
Tells whether or not the output stream should have video- Returns:
- Should the output stream have video?
-
setHasAudio
void setHasAudio(boolean hasAudio)
Set whether you want the output stream to have audio- Parameters:
hasAudio- Whether you want the output stream to have audio
-
hasAudio
boolean hasAudio()
Tells whether or not the output stream should have audio- Returns:
- Should the output stream have audio?
-
setContainerFormat
void setContainerFormat(IContainerFormat format)
Sets the container format for this stream- Parameters:
format- The container format
-
getContainerFormat
IContainerFormat getContainerFormat()
Get the container format, if known, for this container.- Returns:
- The container format
-
isAudioBitRateKnown
boolean isAudioBitRateKnown()
is the audio bit rate known?- Returns:
- the audioBitRateKnown
-
setAudioChannelsKnown
void setAudioChannelsKnown(boolean audioChannelsKnown)
set if the audio channels are known- Parameters:
audioChannelsKnown- the audioChannelsKnown to set
-
isAudioChannelsKnown
boolean isAudioChannelsKnown()
are the # of audio channels known?- Returns:
- the audioChannelsKnown
-
setAudioSampleRateKnown
void setAudioSampleRateKnown(boolean audioSampleRateKnown)
set if the audio sample rate is known.- Parameters:
audioSampleRateKnown- the audioSampleRateKnown to set
-
isAudioSampleRateKnown
boolean isAudioSampleRateKnown()
is the audio sample rate known?- Returns:
- the audioSampleRateKnown
-
setVideoHeightKnown
void setVideoHeightKnown(boolean videoHeightKnown)
set if the video height is known.- Parameters:
videoHeightKnown- the videoHeightKnown to set
-
isVideoHeightKnown
boolean isVideoHeightKnown()
is the video height known?- Returns:
- the videoHeightKnown
-
setVideoWidthKnown
void setVideoWidthKnown(boolean videoWidthKnown)
set if the video width is known.- Parameters:
videoWidthKnown- the videoWidthKnown to set
-
isVideoWidthKnown
boolean isVideoWidthKnown()
is the video width known?- Returns:
- the videoWidthKnown
-
setVideoBitRateKnown
void setVideoBitRateKnown(boolean videoBitRateKnown)
set if the video bit rate is known.- Parameters:
videoBitRateKnown- the videoBitRateKnown to set
-
isVideoBitRateKnown
boolean isVideoBitRateKnown()
is the video bit rate known?- Returns:
- the videoBitRateKnown
-
setVideoNumPicturesInGroupOfPicturesKnown
void setVideoNumPicturesInGroupOfPicturesKnown(boolean videoGOPSKnown)
set if the MPEG number of pictures in a group of pictures is known?- Parameters:
videoGOPSKnown- the videoGOPSKnown to set
-
isVideoNumPicturesInGroupOfPicturesKnown
boolean isVideoNumPicturesInGroupOfPicturesKnown()
is the MPEG number of pictures in a group of pictures known?- Returns:
- the videoGOPSKnown
-
setVideoGlobalQualityKnown
void setVideoGlobalQualityKnown(boolean videoGlobalQualityKnown)
set if the global quality setting is known.- Parameters:
videoGlobalQualityKnown- the videoGlobalQualityKnown to set
-
isVideoGlobalQualityKnown
boolean isVideoGlobalQualityKnown()
is the global quality setting known?- Returns:
- the videoGlobalQualityKnown
-
setVideoPixelFormatKnown
void setVideoPixelFormatKnown(boolean videoPixelFormatKnown)
set if the video pixel format is known.- Parameters:
videoPixelFormatKnown- the videoPixelFormatKnown to set
-
isVideoPixelFormatKnown
boolean isVideoPixelFormatKnown()
is the video pixel format known?- Returns:
- the videoPixelFormatKnown
-
setAudioTimeBase
void setAudioTimeBase(IRational aTimeBase)
Set the time base to use when encoding or decoding audio- Parameters:
aTimeBase- The timebase to use, or null if unknown.
-
getAudioTimeBase
IRational getAudioTimeBase()
Get the time base used when encoding or decoding audio.- Returns:
- the timebase, or null if unknown.
-
setDuration
void setDuration(ITimeValue duration)
Set the duration that we'll assume for the stream we're representing.- Parameters:
duration- the duration to assume for this file. null means unknown.
-
getDuration
ITimeValue getDuration()
Get the duration that we'll assume for the stream we're representing.- Returns:
- the duration, or null if unknown.
-
setAudioBitRateKnown
void setAudioBitRateKnown(boolean audioBitRateKnown)
set if the audio bit rate is known.- Parameters:
audioBitRateKnown- the audioBitRateKnown to set
-
setURL
void setURL(java.lang.String aUrl)
Set the URL that this stream contains info for.- Parameters:
aUrl- The url, including protocol string, or null if unknown.
-
getURL
java.lang.String getURL()
Return the URL for this stream.- Returns:
- The URL, or null if unknown.
-
-