|
1.0: Final Release | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
FormatControl
controls the format used for storing media.
Formats are specified when media is captured from a Player
or if the format is changed
when media is processed by a MediaProcessor
.
FormatControl
is a super interface for ContainerFormatControl
,
ImageFormatControl
, AudioFormatControl
and VideoFormatControls
.
FormatControl
specifies the methods to set and get various parameters to specify the
media format.
The purpose of the the different format Controls is as follows:
FormatControl
- an abstract super interface of all format controls to specify the methods
to manage parameters and settings affecting formats.
ContainerFormatControl
- specifies the file format of the audio-video container format.
For example, 3GPP video is a container format that can contain audio and video in various formats.
VideoFormatControl
- specifies the video format. For example, if the container
format is 3GPP video, VideoFormatControl
specifies if the video is in MPEG4 video or H.263
format.
AudioFormatControl
- specifies the audio format. AudioFormatControl
also specifies the container formats for audio only file formats.
ImageFormatControl
- specifies the image format. ImageFormatControl
also specifies the container formats for imaging. For example, PNG is a container image format which
is managed by ImageFormatControl
, not by ContainerFormatControl
.
setFormat
method which takes one of the formats returned
by the getSupportedFormats
as a parameter. Formats are represented as MIME types.
MIME type alone does not provide enough information to specify the format exactly. Once the format
has been set by setFormat()
FormatControl.PARAM_VERSION_TYPE
parameter can be used to set the format exactly to the one
that is wanted.
PARAM_VERSION_TYPE
definitions are not part of this specification. Instead, a list of definitions
can be downloaded from Forum Nokia. The list will be constantly updated and new types
will be added as needed.
getSupportedIntParameters
and supported String
parameters by getSupportedStrParameters
, respectively. The range of integer values
to be set by setParameter(String parameter, int value)
can be queried by
getSupportedIntParameterRange
. Different values for String
parameters
to be set by setParameter(String parameter, String value)
can be queried by getSupportedStrParameterValues
.
setMetadata
.
getMetadataSupportMode
tells what kind of metadata can be set to the media and
getSupportedMetadataKeys
returns a list of the metadata keys or, in case
any metadata keys can be used, a list of the most common ones.
Occasionally, when the MediaProcessor
is used it is possible that the metadata is at
the end of the processed stream and it is not known before the processing is started. This could
result into contradiction between the metadata set by the application and the metadata already
in the media. setMetadataOverride()
can be used to tell if the new metadata should
override the existing metadata or vice versa.
Field Summary | |
static int |
METADATA_NOT_SUPPORTED
Setting metadata is not supported. |
static int |
METADATA_SUPPORTED_FIXED_KEYS
Setting metadata is supported and the set of metadata keys is limited. |
static int |
METADATA_SUPPORTED_FREE_KEYS
Setting metadata is supported and any Strings can be used as metadata keys. |
static java.lang.String |
PARAM_BITRATE
The output bit rate integer parameter. |
static java.lang.String |
PARAM_BITRATE_TYPE
The bit rate type String parameter tells if the bit rate is constant or variable. |
static java.lang.String |
PARAM_FRAMERATE
The output frame rate integer parameter. |
static java.lang.String |
PARAM_QUALITY
The quality parameter for example for JPEG. |
static java.lang.String |
PARAM_SAMPLERATE
The output sample rate integer parameter. |
static java.lang.String |
PARAM_VERSION_TYPE
The format version type String parameter to specify what is the the type of the format. |
Method Summary | |
int |
getEstimatedBitRate()
Gets the estimated bit rate of the media. |
java.lang.String |
getFormat()
Get the format. |
int |
getIntParameterValue(java.lang.String parameter)
Gets the current value of an integer parameter. |
boolean |
getMetadataOverride()
Returns the metadata override mode. |
int |
getMetadataSupportMode()
Returns the metadata support mode. |
java.lang.String |
getStrParameterValue(java.lang.String parameter)
Gets the current value of a String parameter. |
java.lang.String[] |
getSupportedFormats()
Gets supported formats. |
int[] |
getSupportedIntParameterRange(java.lang.String parameter)
Gets range for the given int-valued parameter. |
java.lang.String[] |
getSupportedIntParameters()
Gets the supported parameters for the current format. |
java.lang.String[] |
getSupportedMetadataKeys()
Returns a list of supported metadata keys. |
java.lang.String[] |
getSupportedStrParameters()
Gets the supported parameters for the current format. |
java.lang.String[] |
getSupportedStrParameterValues(java.lang.String parameter)
Gets available values for the given String-valued parameter. |
void |
setFormat(java.lang.String format)
Sets the format. |
void |
setMetadata(java.lang.String key,
java.lang.String value)
Sets metadata for the media |
void |
setMetadataOverride(boolean override)
Sets the metadata override mode. |
int |
setParameter(java.lang.String parameter,
int value)
Sets int-valued parameter's value. |
void |
setParameter(java.lang.String parameter,
java.lang.String value)
Sets String-valued parameter's value. |
Field Detail |
public static final int METADATA_NOT_SUPPORTED
public static final int METADATA_SUPPORTED_FIXED_KEYS
public static final int METADATA_SUPPORTED_FREE_KEYS
public static final java.lang.String PARAM_BITRATE
public static final java.lang.String PARAM_BITRATE_TYPE
"constant"
and "variable"
.
public static final java.lang.String PARAM_SAMPLERATE
public static final java.lang.String PARAM_FRAMERATE
public static final java.lang.String PARAM_QUALITY
public static final java.lang.String PARAM_VERSION_TYPE
Method Detail |
public java.lang.String[] getSupportedFormats()
public java.lang.String[] getSupportedStrParameters()
public java.lang.String[] getSupportedIntParameters()
public java.lang.String[] getSupportedStrParameterValues(java.lang.String parameter)
parameter
- the parameter whose valid values are queried
java.lang.IllegalArgumentException
- if the parameter
is not supported or if it is nullpublic int[] getSupportedIntParameterRange(java.lang.String parameter)
parameter
- the parameter whose range is queried
java.lang.IllegalArgumentException
- if the parameter
is not supported or if it is nullpublic void setFormat(java.lang.String format)
format
- the new format
java.lang.IllegalArgumentException
- if the format
is not supported or if it is nullpublic java.lang.String getFormat()
public int setParameter(java.lang.String parameter, int value)
parameter
- the parameter to be setvalue
- the new value to be set
java.lang.IllegalArgumentException
- if the parameter
is not supported or
the value
for the supported parameter
is not supported
or if the parameter
is nullpublic void setParameter(java.lang.String parameter, java.lang.String value)
parameter
- the parameter to be setvalue
- the new value to be set
java.lang.IllegalArgumentException
- if the parameter
is not supported or
the value
for the supported parameter
is not supported
or if the parameter
or value
is nullpublic java.lang.String getStrParameterValue(java.lang.String parameter)
parameter
- the parameter whose value is queried
java.lang.IllegalArgumentException
- if the parameter
is not supported or if it is nullpublic int getIntParameterValue(java.lang.String parameter)
parameter
- the parameter whose value is queried
java.lang.IllegalArgumentException
- if the parameter
is not supported or if it is nullpublic int getEstimatedBitRate() throws javax.microedition.media.MediaException
javax.microedition.media.MediaException
- if size estimation is not supported or if the media type is unstreamablepublic void setMetadata(java.lang.String key, java.lang.String value) throws javax.microedition.media.MediaException
key
- metadata keyvalue
- metadata value
javax.microedition.media.MediaException
- if setting of the metadata is not supported
java.lang.IllegalArgumentException
- if the key
or value
contains unsupported values
or if either is nullpublic java.lang.String[] getSupportedMetadataKeys()
getSupportedMetadataKeys
returns a list of the most common metadata keys
public int getMetadataSupportMode()
public void setMetadataOverride(boolean override)
By default, the metadata override mode is true
.
override
- true
to make application set metadata to be written on top
of the existing metadata, false
to preserve the existing metadatapublic boolean getMetadataOverride()
true
if the metadata set by the application overrides the existing
metadata, false
if the existing metadata is preserved
|
1.0: Final Release | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |