Class GstPbutils
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
GstEncodingTarget
category for recording and capture.static final String
GstEncodingTarget
category for device-specific targets.static final String
GstEncodingTarget
category for file extensions.static final String
GstEncodingTarget
category for online-services.static final String
GstEncodingTarget
category for storage, archiving and editing targets.static final int
The major version of GStreamer's gst-plugins-base libraries at compile time.static final int
The micro version of GStreamer's gst-plugins-base libraries at compile time.static final int
The minor version of GStreamer's gst-plugins-base libraries at compile time.static final int
The nano version of GStreamer's gst-plugins-base libraries at compile time. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
codecUtilsAacCapsSetLevelAndProfile
(Caps caps, byte[] audioConfig) Sets the level and profile oncaps
if it can be determined fromaudioConfig
.static int
codecUtilsAacGetChannels
(byte[] audioConfig) Returns the channels of the given AAC stream.static int
codecUtilsAacGetIndexFromSampleRate
(int rate) Translates the sample rate to the index corresponding to it in AAC spec.static String
codecUtilsAacGetLevel
(byte[] audioConfig) Determines the level of a stream as defined in ISO/IEC 14496-3.static String
codecUtilsAacGetProfile
(byte[] audioConfig) Returns the profile of the given AAC stream as a string.static int
codecUtilsAacGetSampleRate
(byte[] audioConfig) Translates the sample rate index found in AAC headers to the actual sample rate.static int
codecUtilsAacGetSampleRateFromIndex
(int srIdx) Translates the sample rate index found in AAC headers to the actual sample rate.static Caps
codecUtilsCapsFromMimeCodec
(String codecsField) Converts a RFC 6381 compatible codec string toGstCaps
.static String
Convertscaps
to a RFC 6381 compatible codec string if possible.static boolean
codecUtilsH264CapsSetLevelAndProfile
(Caps caps, byte[] sps) Sets the level and profile incaps
if it can be determined fromsps
.static String
codecUtilsH264GetLevel
(byte[] sps) Converts the level indication (level_idc) in the stream's sequence parameter set into a string.static byte
codecUtilsH264GetLevelIdc
(String level) Transform a level string from the caps into the level_idcstatic String
codecUtilsH264GetProfile
(byte[] sps) Converts the profile indication (profile_idc) in the stream's sequence parameter set into a string.static boolean
codecUtilsH264GetProfileFlagsLevel
(byte[] codecData, @Nullable Out<Byte> profile, @Nullable Out<Byte> flags, @Nullable Out<Byte> level) Parses profile, flags, and level from a H264 AVCC extradata/sequence_header.static boolean
codecUtilsH265CapsSetLevelTierAndProfile
(Caps caps, byte[] profileTierLevel) Sets the level, tier and profile incaps
if it can be determined fromprofileTierLevel
.static String
codecUtilsH265GetLevel
(byte[] profileTierLevel) Converts the level indication (general_level_idc) in the stream's profile_tier_level structure into a string.static byte
codecUtilsH265GetLevelIdc
(String level) Transform a level string from the caps into the level_idcstatic String
codecUtilsH265GetProfile
(byte[] profileTierLevel) Converts the profile indication (general_profile_idc) in the stream's profile_level_tier structure into a string.static String
codecUtilsH265GetTier
(byte[] profileTierLevel) Converts the tier indication (general_tier_flag) in the stream's profile_tier_level structure into a string.static boolean
codecUtilsMpeg4videoCapsSetLevelAndProfile
(Caps caps, byte[] visObjSeq) Sets the level and profile incaps
if it can be determined fromvisObjSeq
.static String
codecUtilsMpeg4videoGetLevel
(byte[] visObjSeq) Converts the level indication in the stream's visual object sequence into a string.static String
codecUtilsMpeg4videoGetProfile
(byte[] visObjSeq) Converts the profile indication in the stream's visual object sequence into a string.static Caps
codecUtilsOpusCreateCaps
(int rate, byte channels, byte channelMappingFamily, byte streamCount, byte coupledCount, @org.jetbrains.annotations.Nullable byte[] channelMapping) Creates Opus caps from the given parameters.static Caps
codecUtilsOpusCreateCapsFromHeader
(Buffer header, @Nullable Buffer comments) Creates Opus caps from the given OpusHeadheader
and comment headercomments
.static Buffer
codecUtilsOpusCreateHeader
(int rate, byte channels, byte channelMappingFamily, byte streamCount, byte coupledCount, @org.jetbrains.annotations.Nullable byte[] channelMapping, short preSkip, short outputGain) Creates OpusHead header from the given parameters.static boolean
codecUtilsOpusParseCaps
(Caps caps, @Nullable Out<Integer> rate, @Nullable Out<Byte> channels, @Nullable Out<Byte> channelMappingFamily, @Nullable Out<Byte> streamCount, @Nullable Out<Byte> coupledCount, @org.jetbrains.annotations.Nullable byte[] channelMapping) Parses Opus caps and fills the different fields with defaults if possible.static boolean
codecUtilsOpusParseHeader
(Buffer header, @Nullable Out<Integer> rate, @Nullable Out<Byte> channels, @Nullable Out<Byte> channelMappingFamily, @Nullable Out<Byte> streamCount, @Nullable Out<Byte> coupledCount, @org.jetbrains.annotations.Nullable byte[] channelMapping, @Nullable Out<Short> preSkip, @Nullable Out<Short> outputGain) Parses the OpusHead header.static List
<EncodingTarget> encodingListAllTargets
(@Nullable String categoryname) List all availableGstEncodingTarget
for the specified category, or all categories ifcategoryname
isnull
.Lists allGstEncodingTarget
categories present on disk.static InstallPluginsReturn
installPluginsAsync
(String[] details, @Nullable InstallPluginsContext ctx, InstallPluginsResultFunc func) Requests plugin installation without blocking.static boolean
Checks whether plugin installation (initiated by this application only) is currently in progress.static boolean
Checks whether plugin installation is likely to be supported by the current environment.static InstallPluginsReturn
installPluginsSync
(String[] details, @Nullable InstallPluginsContext ctx) Requests plugin installation and block until the plugins have been installed or installation has failed.static boolean
Checks whethermsg
is a missing plugins message.static void
static String
missingDecoderInstallerDetailNew
(Caps decodeCaps) Returns an opaque string containing all the details about the missing element to be passed to an external installer called via gst_install_plugins_async() or gst_install_plugins_sync().static Message
missingDecoderMessageNew
(Element element, Caps decodeCaps) Creates a missing-plugin message forelement
to notify the application that a decoder element for a particular set of (fixed) caps is missing.static String
missingElementInstallerDetailNew
(String factoryName) Returns an opaque string containing all the details about the missing element to be passed to an external installer called via gst_install_plugins_async() or gst_install_plugins_sync().static Message
missingElementMessageNew
(Element element, String factoryName) Creates a missing-plugin message forelement
to notify the application that a certain required element is missing.static String
missingEncoderInstallerDetailNew
(Caps encodeCaps) Returns an opaque string containing all the details about the missing element to be passed to an external installer called via gst_install_plugins_async() or gst_install_plugins_sync().static Message
missingEncoderMessageNew
(Element element, Caps encodeCaps) Creates a missing-plugin message forelement
to notify the application that an encoder element for a particular set of (fixed) caps is missing.static String
Returns a localised string describing the missing feature, for use in error dialogs and the like.static String
Returns an opaque string containing all the details about the missing element to be passed to an external installer called via gst_install_plugins_async() or gst_install_plugins_sync().static String
missingUriSinkInstallerDetailNew
(String protocol) Returns an opaque string containing all the details about the missing element to be passed to an external installer called via gst_install_plugins_async() or gst_install_plugins_sync().static Message
missingUriSinkMessageNew
(Element element, String protocol) Creates a missing-plugin message forelement
to notify the application that a sink element for a particular URI protocol is missing.static String
missingUriSourceInstallerDetailNew
(String protocol) Returns an opaque string containing all the details about the missing element to be passed to an external installer called via gst_install_plugins_async() or gst_install_plugins_sync().static Message
missingUriSourceMessageNew
(Element element, String protocol) Creates a missing-plugin message forelement
to notify the application that a source element for a particular URI protocol is missing.static boolean
pbUtilsAddCodecDescriptionToTagList
(TagList taglist, @Nullable String codecTag, Caps caps) Adds a codec tag describing the format specified bycaps
totaglist
.static Set
<PbUtilsCapsDescriptionFlags> Returns flags that describe the format of the caps if known.static String
Returns a localised (as far as this is possible) string describing the media format specified incaps
, for use in error dialogs or other messages to be seen by the user.static String
Returns a localised string describing an decoder for the format specified incaps
, for use in error dialogs or other messages to be seen by the user.static String
pbUtilsGetElementDescription
(String factoryName) Returns a localised string describing the given element, for use in error dialogs or other messages to be seen by the user.static String
Returns a localised string describing an encoder for the format specified incaps
, for use in error dialogs or other messages to be seen by the user.static String
Returns a possible file extension for the given caps, if known.static String
pbUtilsGetSinkDescription
(String protocol) Returns a localised string describing a sink element handling the protocol specified inprotocol
, for use in error dialogs or other messages to be seen by the user.static String
pbUtilsGetSourceDescription
(String protocol) Returns a localised string describing a source element handling the protocol specified inprotocol
, for use in error dialogs or other messages to be seen by the user.static void
Initialises the base utils support library.static void
Gets the version number of the GStreamer Plugins Base libraries.static String
This function returns a string that is useful for describing this version of GStreamer's gst-plugins-base libraries to the outside world: user agent strings, logging, about dialogs ...
-
Field Details
-
ENCODING_CATEGORY_CAPTURE
GstEncodingTarget
category for recording and capture. Targets within this category are optimized for low latency encoding.- See Also:
-
ENCODING_CATEGORY_DEVICE
GstEncodingTarget
category for device-specific targets. The name of the target will usually be the constructor and model of the device, and that target will containGstEncodingProfiles
suitable for that device.- See Also:
-
ENCODING_CATEGORY_FILE_EXTENSION
GstEncodingTarget
category for file extensions. The name of the target will be the name of the file extensions possible for a particular target. Those targets are defining like 'default' formats usually used for a particular file extension.- See Also:
-
ENCODING_CATEGORY_ONLINE_SERVICE
GstEncodingTarget
category for online-services. The name of the target will usually be the name of the online service and that target will containGstEncodingProfiles
suitable for that online service.- See Also:
-
ENCODING_CATEGORY_STORAGE_EDITING
GstEncodingTarget
category for storage, archiving and editing targets. Those targets can be lossless and/or provide very fast random access content. The name of the target will usually be the container type or editing target, and that target will containGstEncodingProfiles
suitable for editing or storage.- See Also:
-
PLUGINS_BASE_VERSION_MAJOR
public static final int PLUGINS_BASE_VERSION_MAJORThe major version of GStreamer's gst-plugins-base libraries at compile time.- See Also:
-
PLUGINS_BASE_VERSION_MICRO
public static final int PLUGINS_BASE_VERSION_MICROThe micro version of GStreamer's gst-plugins-base libraries at compile time.- See Also:
-
PLUGINS_BASE_VERSION_MINOR
public static final int PLUGINS_BASE_VERSION_MINORThe minor version of GStreamer's gst-plugins-base libraries at compile time.- See Also:
-
PLUGINS_BASE_VERSION_NANO
public static final int PLUGINS_BASE_VERSION_NANOThe nano version of GStreamer's gst-plugins-base libraries at compile time. Actual releases have 0, GIT versions have 1, prerelease versions have 2-...- See Also:
-
-
Constructor Details
-
GstPbutils
public GstPbutils()
-
-
Method Details
-
javagi$ensureInitialized
public static void javagi$ensureInitialized() -
codecUtilsAacCapsSetLevelAndProfile
Sets the level and profile oncaps
if it can be determined fromaudioConfig
. See gst_codec_utils_aac_get_level() and gst_codec_utils_aac_get_profile() for more details on the parameters.caps
must be audio/mpeg caps with an "mpegversion" field of either 2 or 4. If mpegversion is 4, the "base-profile" field is also set incaps
.- Parameters:
caps
- theGstCaps
to which level and profile fields are to be addedaudioConfig
- a pointer to the AudioSpecificConfig as specified in the Elementary Stream Descriptor (esds) in ISO/IEC 14496-1. (See below for more details)- Returns:
true
if the level and profile could be set,false
otherwise.
-
codecUtilsAacGetChannels
public static int codecUtilsAacGetChannels(byte[] audioConfig) Returns the channels of the given AAC stream.- Parameters:
audioConfig
- a pointer to the AudioSpecificConfig as specified in the Elementary Stream Descriptor (esds) in ISO/IEC 14496-1.- Returns:
- The channels or 0 if the channel could not be determined.
-
codecUtilsAacGetIndexFromSampleRate
public static int codecUtilsAacGetIndexFromSampleRate(int rate) Translates the sample rate to the index corresponding to it in AAC spec.- Parameters:
rate
- Sample rate- Returns:
- The AAC index for this sample rate, -1 if the rate is not a valid AAC sample rate.
-
codecUtilsAacGetLevel
Determines the level of a stream as defined in ISO/IEC 14496-3. For AAC LC streams, the constraints from the AAC audio profile are applied. For AAC Main, LTP, SSR and others, the Main profile is used.The
audioConfig
parameter follows the following format, starting from the most significant bit of the first byte:- Bit 0:4 contains the AudioObjectType (if this is 0x5, then the real AudioObjectType is carried after the rate and channel data)
- Bit 5:8 contains the sample frequency index (if this is 0xf, then the next 24 bits define the actual sample frequency, and subsequent fields are appropriately shifted).
- Bit 9:12 contains the channel configuration
- Parameters:
audioConfig
- a pointer to the AudioSpecificConfig as specified in the Elementary Stream Descriptor (esds) in ISO/IEC 14496-1.- Returns:
- The level as a const string and
null
if the level could not be determined.
-
codecUtilsAacGetProfile
Returns the profile of the given AAC stream as a string. The profile is normally determined using the AudioObjectType field which is in the first 5 bits ofaudioConfig
- Parameters:
audioConfig
- a pointer to the AudioSpecificConfig as specified in the Elementary Stream Descriptor (esds) in ISO/IEC 14496-1.- Returns:
- The profile as a const string and
null
if the profile could not be determined.
-
codecUtilsAacGetSampleRate
public static int codecUtilsAacGetSampleRate(byte[] audioConfig) Translates the sample rate index found in AAC headers to the actual sample rate.- Parameters:
audioConfig
- a pointer to the AudioSpecificConfig as specified in the Elementary Stream Descriptor (esds) in ISO/IEC 14496-1.- Returns:
- The sample rate if sr_idx is valid, 0 otherwise.
-
codecUtilsAacGetSampleRateFromIndex
public static int codecUtilsAacGetSampleRateFromIndex(int srIdx) Translates the sample rate index found in AAC headers to the actual sample rate.- Parameters:
srIdx
- Sample rate index as from the AudioSpecificConfig (MPEG-4 container) or ADTS frame header- Returns:
- The sample rate if
srIdx
is valid, 0 otherwise.
-
codecUtilsCapsFromMimeCodec
Converts a RFC 6381 compatible codec string toGstCaps
. More than one codec string can be present (separated by,
).Registered codecs can be found at http://mp4ra.org/
/codecs
- Parameters:
codecsField
- A mime codec string field- Returns:
- The corresponding
GstCaps
ornull
-
codecUtilsCapsGetMimeCodec
Convertscaps
to a RFC 6381 compatible codec string if possible.Useful for providing the 'codecs' field inside the 'Content-Type' HTTP header for containerized formats, such as mp4 or matroska.
Registered codecs can be found at http://mp4ra.org/
/codecs
- Parameters:
caps
- AGstCaps
to convert to mime codec- Returns:
- a RFC 6381 compatible codec string or
null
-
codecUtilsH264CapsSetLevelAndProfile
Sets the level and profile incaps
if it can be determined fromsps
. See gst_codec_utils_h264_get_level() and gst_codec_utils_h264_get_profile() for more details on the parameters.- Parameters:
caps
- theGstCaps
to which the level and profile are to be addedsps
- Pointer to the sequence parameter set for the stream.- Returns:
true
if the level and profile could be set,false
otherwise.
-
codecUtilsH264GetLevel
Converts the level indication (level_idc) in the stream's sequence parameter set into a string. The SPS is expected to have the same format as for gst_codec_utils_h264_get_profile().- Parameters:
sps
- Pointer to the sequence parameter set for the stream.- Returns:
- The level as a const string, or
null
if there is an error.
-
codecUtilsH264GetLevelIdc
Transform a level string from the caps into the level_idc- Parameters:
level
- A level string from caps- Returns:
- the level_idc or 0 if the level is unknown
-
codecUtilsH264GetProfile
Converts the profile indication (profile_idc) in the stream's sequence parameter set into a string. The SPS is expected to have the following format, as defined in the H.264 specification. The SPS is viewed as a bitstream here, with bit 0 being the most significant bit of the first byte.- Bit 0:7 - Profile indication
- Bit 8 - constraint_set0_flag
- Bit 9 - constraint_set1_flag
- Bit 10 - constraint_set2_flag
- Bit 11 - constraint_set3_flag
- Bit 12 - constraint_set3_flag
- Bit 13:15 - Reserved
- Bit 16:24 - Level indication
- Parameters:
sps
- Pointer to the sequence parameter set for the stream.- Returns:
- The profile as a const string, or
null
if there is an error.
-
codecUtilsH264GetProfileFlagsLevel
public static boolean codecUtilsH264GetProfileFlagsLevel(byte[] codecData, @Nullable @Nullable Out<Byte> profile, @Nullable @Nullable Out<Byte> flags, @Nullable @Nullable Out<Byte> level) Parses profile, flags, and level from a H264 AVCC extradata/sequence_header. These are most commonly retrieved from a video/x-h264 caps with a codec_data buffer.The format of H264 AVCC extradata/sequence_header is documented in the ITU-T H.264 specification section 7.3.2.1.1 as well as in ISO/IEC 14496-15 section 5.3.3.1.2.
- Parameters:
codecData
- H264 AVCC extradataprofile
- return location for h264 profile_idc ornull
flags
- return location for h264 constraint set flags ornull
level
- return location h264 level_idc ornull
- Returns:
true
on success,false
on failure
-
codecUtilsH265CapsSetLevelTierAndProfile
Sets the level, tier and profile incaps
if it can be determined fromprofileTierLevel
. See gst_codec_utils_h265_get_level(), gst_codec_utils_h265_get_tier() and gst_codec_utils_h265_get_profile() for more details on the parameters.- Parameters:
caps
- theGstCaps
to which the level, tier and profile are to be addedprofileTierLevel
- Pointer to the profile_tier_level struct- Returns:
true
if the level, tier, profile could be set,false
otherwise.
-
codecUtilsH265GetLevel
Converts the level indication (general_level_idc) in the stream's profile_tier_level structure into a string. The profiel_tier_level is expected to have the same format as for gst_codec_utils_h264_get_profile().- Parameters:
profileTierLevel
- Pointer to the profile_tier_level for the stream- Returns:
- The level as a const string, or
null
if there is an error.
-
codecUtilsH265GetLevelIdc
Transform a level string from the caps into the level_idc- Parameters:
level
- A level string from caps- Returns:
- the level_idc or 0 if the level is unknown
-
codecUtilsH265GetProfile
Converts the profile indication (general_profile_idc) in the stream's profile_level_tier structure into a string. The profile_tier_level is expected to have the following format, as defined in the H.265 specification. The profile_tier_level is viewed as a bitstream here, with bit 0 being the most significant bit of the first byte.- Bit 0:1 - general_profile_space
- Bit 2 - general_tier_flag
- Bit 3:7 - general_profile_idc
- Bit 8:39 - gernal_profile_compatibility_flags
- Bit 40 - general_progressive_source_flag
- Bit 41 - general_interlaced_source_flag
- Bit 42 - general_non_packed_constraint_flag
- Bit 43 - general_frame_only_constraint_flag
- Bit 44:87 - See below
- Bit 88:95 - general_level_idc
- Parameters:
profileTierLevel
- Pointer to the profile_tier_level structure for the stream.- Returns:
- The profile as a const string, or
null
if there is an error.
-
codecUtilsH265GetTier
Converts the tier indication (general_tier_flag) in the stream's profile_tier_level structure into a string. The profile_tier_level is expected to have the same format as for gst_codec_utils_h264_get_profile().- Parameters:
profileTierLevel
- Pointer to the profile_tier_level for the stream.- Returns:
- The tier as a const string, or
null
if there is an error.
-
codecUtilsMpeg4videoCapsSetLevelAndProfile
Sets the level and profile incaps
if it can be determined fromvisObjSeq
. See gst_codec_utils_mpeg4video_get_level() and gst_codec_utils_mpeg4video_get_profile() for more details on the parameters.- Parameters:
caps
- theGstCaps
to which the level and profile are to be addedvisObjSeq
- Pointer to the visual object sequence for the stream.- Returns:
true
if the level and profile could be set,false
otherwise.
-
codecUtilsMpeg4videoGetLevel
Converts the level indication in the stream's visual object sequence into a string.visObjSeq
is expected to be the data following the visual object sequence start code. Only the first byte (profile_and_level_indication) is used.- Parameters:
visObjSeq
- Pointer to the visual object sequence for the stream.- Returns:
- The level as a const string, or NULL if there is an error.
-
codecUtilsMpeg4videoGetProfile
Converts the profile indication in the stream's visual object sequence into a string.visObjSeq
is expected to be the data following the visual object sequence start code. Only the first byte (profile_and_level_indication) is used.- Parameters:
visObjSeq
- Pointer to the visual object sequence for the stream.- Returns:
- The profile as a const string, or NULL if there is an error.
-
codecUtilsOpusCreateCaps
public static Caps codecUtilsOpusCreateCaps(int rate, byte channels, byte channelMappingFamily, byte streamCount, byte coupledCount, @Nullable @org.jetbrains.annotations.Nullable byte[] channelMapping) Creates Opus caps from the given parameters.- Parameters:
rate
- the sample ratechannels
- the number of channelschannelMappingFamily
- the channel mapping familystreamCount
- the number of independent streamscoupledCount
- the number of stereo streamschannelMapping
- the mapping between the streams- Returns:
- The
GstCaps
, ornull
if the parameters would lead to invalid Opus caps.
-
codecUtilsOpusCreateCapsFromHeader
-
codecUtilsOpusCreateHeader
public static Buffer codecUtilsOpusCreateHeader(int rate, byte channels, byte channelMappingFamily, byte streamCount, byte coupledCount, @Nullable @org.jetbrains.annotations.Nullable byte[] channelMapping, short preSkip, short outputGain) Creates OpusHead header from the given parameters.- Parameters:
rate
- the sample ratechannels
- the number of channelschannelMappingFamily
- the channel mapping familystreamCount
- the number of independent streamscoupledCount
- the number of stereo streamschannelMapping
- the mapping between the streamspreSkip
- Pre-skip in 48kHz samples or 0outputGain
- Output gain or 0- Returns:
- The
GstBuffer
containing the OpusHead.
-
codecUtilsOpusParseCaps
public static boolean codecUtilsOpusParseCaps(Caps caps, @Nullable @Nullable Out<Integer> rate, @Nullable @Nullable Out<Byte> channels, @Nullable @Nullable Out<Byte> channelMappingFamily, @Nullable @Nullable Out<Byte> streamCount, @Nullable @Nullable Out<Byte> coupledCount, @Nullable @org.jetbrains.annotations.Nullable byte[] channelMapping) Parses Opus caps and fills the different fields with defaults if possible.- Parameters:
caps
- theGstCaps
to parse the data fromrate
- the sample ratechannels
- the number of channelschannelMappingFamily
- the channel mapping familystreamCount
- the number of independent streamscoupledCount
- the number of stereo streamschannelMapping
- the mapping between the streams- Returns:
true
if parsing was successful,false
otherwise.
-
codecUtilsOpusParseHeader
public static boolean codecUtilsOpusParseHeader(Buffer header, @Nullable @Nullable Out<Integer> rate, @Nullable @Nullable Out<Byte> channels, @Nullable @Nullable Out<Byte> channelMappingFamily, @Nullable @Nullable Out<Byte> streamCount, @Nullable @Nullable Out<Byte> coupledCount, @Nullable @org.jetbrains.annotations.Nullable byte[] channelMapping, @Nullable @Nullable Out<Short> preSkip, @Nullable @Nullable Out<Short> outputGain) Parses the OpusHead header.- Parameters:
header
- the OpusHeadGstBuffer
rate
- the sample ratechannels
- the number of channelschannelMappingFamily
- the channel mapping familystreamCount
- the number of independent streamscoupledCount
- the number of stereo streamschannelMapping
- the mapping between the streamspreSkip
- Pre-skip in 48kHz samples or 0outputGain
- Output gain or 0- Returns:
true
if parsing was successful,false
otherwise.
-
encodingListAllTargets
List all availableGstEncodingTarget
for the specified category, or all categories ifcategoryname
isnull
.- Parameters:
categoryname
- The category, for ex:GST_ENCODING_CATEGORY_DEVICE
. Can benull
.- Returns:
- The list of
GstEncodingTarget
-
encodingListAvailableCategories
-
installPluginsAsync
public static InstallPluginsReturn installPluginsAsync(String[] details, @Nullable @Nullable InstallPluginsContext ctx, InstallPluginsResultFunc func) Requests plugin installation without blocking. Once the plugins have been installed or installation has failed,func
will be called with the result of the installation and your provideduserData
pointer.This function requires a running GLib/Gtk main loop. If you are not running a GLib/Gtk main loop, make sure to regularly call g_main_context_iteration(NULL,FALSE).
The installer strings that make up
detail
are typically obtained by calling gst_missing_plugin_message_get_installer_detail() on missing-plugin messages that have been caught on a pipeline's bus or created by the application via the provided API, such as gst_missing_element_message_new().It is possible to request the installation of multiple missing plugins in one go (as might be required if there is a demuxer for a certain format installed but no suitable video decoder and no suitable audio decoder).
- Parameters:
details
- NULL-terminated array of installer string details (see below)ctx
- aGstInstallPluginsContext
, or NULLfunc
- the function to call when the installer program returns- Returns:
- result code whether an external installer could be started
-
installPluginsInstallationInProgress
public static boolean installPluginsInstallationInProgress()Checks whether plugin installation (initiated by this application only) is currently in progress.- Returns:
- TRUE if plugin installation is in progress, otherwise FALSE
-
installPluginsSupported
public static boolean installPluginsSupported()Checks whether plugin installation is likely to be supported by the current environment. This currently only checks whether the helper script that is to be provided by the distribution or operating system vendor exists.- Returns:
- TRUE if plugin installation is likely to be supported.
-
installPluginsSync
public static InstallPluginsReturn installPluginsSync(String[] details, @Nullable @Nullable InstallPluginsContext ctx) Requests plugin installation and block until the plugins have been installed or installation has failed.This function should almost never be used, it only exists for cases where a non-GLib main loop is running and the user wants to run it in a separate thread and marshal the result back asynchronously into the main thread using the other non-GLib main loop. You should almost always use gst_install_plugins_async() instead of this function.
- Parameters:
details
- NULL-terminated array of installer string detailsctx
- aGstInstallPluginsContext
, or NULL- Returns:
- the result of the installation.
-
isMissingPluginMessage
Checks whethermsg
is a missing plugins message.- Parameters:
msg
- aGstMessage
- Returns:
true
ifmsg
is a missing-plugins message, otherwisefalse
.
-
missingDecoderInstallerDetailNew
Returns an opaque string containing all the details about the missing element to be passed to an external installer called via gst_install_plugins_async() or gst_install_plugins_sync().This function is mainly for applications that call external plugin installation mechanisms using one of the two above-mentioned functions in the case where the application knows exactly what kind of plugin it is missing.
- Parameters:
decodeCaps
- the (fixed) caps for which a decoder element is needed- Returns:
- a newly-allocated detail string. Free string with g_free() when not needed any longer.
-
missingDecoderMessageNew
Creates a missing-plugin message forelement
to notify the application that a decoder element for a particular set of (fixed) caps is missing. This function is mainly for use in plugins.- Parameters:
element
- theGstElement
posting the messagedecodeCaps
- the (fixed) caps for which a decoder element is needed- Returns:
- a new
GstMessage
-
missingElementInstallerDetailNew
Returns an opaque string containing all the details about the missing element to be passed to an external installer called via gst_install_plugins_async() or gst_install_plugins_sync().This function is mainly for applications that call external plugin installation mechanisms using one of the two above-mentioned functions in the case where the application knows exactly what kind of plugin it is missing.
- Parameters:
factoryName
- the name of the missing element (element factory), e.g. "videoscale" or "cdparanoiasrc"- Returns:
- a newly-allocated detail string. Free string with g_free() when not needed any longer.
-
missingElementMessageNew
Creates a missing-plugin message forelement
to notify the application that a certain required element is missing. This function is mainly for use in plugins.- Parameters:
element
- theGstElement
posting the messagefactoryName
- the name of the missing element (element factory), e.g. "videoscale" or "cdparanoiasrc"- Returns:
- a new
GstMessage
-
missingEncoderInstallerDetailNew
Returns an opaque string containing all the details about the missing element to be passed to an external installer called via gst_install_plugins_async() or gst_install_plugins_sync().This function is mainly for applications that call external plugin installation mechanisms using one of the two above-mentioned functions in the case where the application knows exactly what kind of plugin it is missing.
- Parameters:
encodeCaps
- the (fixed) caps for which an encoder element is needed- Returns:
- a newly-allocated detail string. Free string with g_free() when not needed any longer.
-
missingEncoderMessageNew
Creates a missing-plugin message forelement
to notify the application that an encoder element for a particular set of (fixed) caps is missing. This function is mainly for use in plugins.- Parameters:
element
- theGstElement
posting the messageencodeCaps
- the (fixed) caps for which an encoder element is needed- Returns:
- a new
GstMessage
-
missingPluginMessageGetDescription
Returns a localised string describing the missing feature, for use in error dialogs and the like. Should never return NULL unlessmsg
is not a valid missing-plugin message.This function is mainly for applications that need a human-readable string describing a missing plugin, given a previously collected missing-plugin message
- Parameters:
msg
- a missing-pluginGstMessage
of typeGST_MESSAGE_ELEMENT
- Returns:
- a newly-allocated description string. Free string with g_free() when not needed any longer.
-
missingPluginMessageGetInstallerDetail
Returns an opaque string containing all the details about the missing element to be passed to an external installer called via gst_install_plugins_async() or gst_install_plugins_sync().This function is mainly for applications that call external plugin installation mechanisms using one of the two above-mentioned functions.
- Parameters:
msg
- a missing-pluginGstMessage
of typeGST_MESSAGE_ELEMENT
- Returns:
- a newly-allocated detail string, or NULL on error. Free string with g_free() when not needed any longer.
-
missingUriSinkInstallerDetailNew
Returns an opaque string containing all the details about the missing element to be passed to an external installer called via gst_install_plugins_async() or gst_install_plugins_sync().This function is mainly for applications that call external plugin installation mechanisms using one of the two above-mentioned functions in the case where the application knows exactly what kind of plugin it is missing.
- Parameters:
protocol
- the URI protocol the missing source needs to implement, e.g. "http" or "mms"- Returns:
- a newly-allocated detail string. Free string with g_free() when not needed any longer.
-
missingUriSinkMessageNew
Creates a missing-plugin message forelement
to notify the application that a sink element for a particular URI protocol is missing. This function is mainly for use in plugins.- Parameters:
element
- theGstElement
posting the messageprotocol
- the URI protocol the missing sink needs to implement, e.g. "http" or "smb"- Returns:
- a new
GstMessage
-
missingUriSourceInstallerDetailNew
Returns an opaque string containing all the details about the missing element to be passed to an external installer called via gst_install_plugins_async() or gst_install_plugins_sync().This function is mainly for applications that call external plugin installation mechanisms using one of the two above-mentioned functions in the case where the application knows exactly what kind of plugin it is missing.
- Parameters:
protocol
- the URI protocol the missing source needs to implement, e.g. "http" or "mms"- Returns:
- a newly-allocated detail string. Free string with g_free() when not needed any longer.
-
missingUriSourceMessageNew
Creates a missing-plugin message forelement
to notify the application that a source element for a particular URI protocol is missing. This function is mainly for use in plugins.- Parameters:
element
- theGstElement
posting the messageprotocol
- the URI protocol the missing source needs to implement, e.g. "http" or "mms"- Returns:
- a new
GstMessage
-
pbUtilsAddCodecDescriptionToTagList
public static boolean pbUtilsAddCodecDescriptionToTagList(TagList taglist, @Nullable @Nullable String codecTag, Caps caps) Adds a codec tag describing the format specified bycaps
totaglist
.- Parameters:
taglist
- aGstTagList
codecTag
- a GStreamer codec tag such asGST_TAG_AUDIO_CODEC
,GST_TAG_VIDEO_CODEC
orGST_TAG_CODEC
. If none is specified, the function will attempt to detect the appropriate category.caps
- the (fixed)GstCaps
for which a codec tag should be added.- Returns:
- TRUE if a codec tag was added, FALSE otherwise.
-
pbUtilsGetCapsDescriptionFlags
Returns flags that describe the format of the caps if known. No flags are set for unknown caps.- Parameters:
caps
- the (fixed)GstCaps
for which flags are requested- Returns:
GstPbUtilsCapsDescriptionFlags
that describecaps
, or no flags if the caps are unknown.
-
pbUtilsGetCodecDescription
Returns a localised (as far as this is possible) string describing the media format specified incaps
, for use in error dialogs or other messages to be seen by the user. Should never return NULL unlesscaps
is invalid.Also see the convenience function gst_pb_utils_add_codec_description_to_tag_list().
- Parameters:
caps
- the (fixed)GstCaps
for which an format description is needed- Returns:
- a newly-allocated description string, or NULL on error. Free string with g_free() when not needed any longer.
-
pbUtilsGetDecoderDescription
Returns a localised string describing an decoder for the format specified incaps
, for use in error dialogs or other messages to be seen by the user.This function is mainly for internal use, applications would typically use gst_missing_plugin_message_get_description() to get a description of a missing feature from a missing-plugin message.
- Parameters:
caps
- the (fixed)GstCaps
for which an decoder description is needed- Returns:
- a newly-allocated description string. Free string with g_free() when not needed any longer.
-
pbUtilsGetElementDescription
Returns a localised string describing the given element, for use in error dialogs or other messages to be seen by the user.This function is mainly for internal use, applications would typically use gst_missing_plugin_message_get_description() to get a description of a missing feature from a missing-plugin message.
- Parameters:
factoryName
- the name of the element, e.g. "giosrc"- Returns:
- a newly-allocated description string. Free string with g_free() when not needed any longer.
-
pbUtilsGetEncoderDescription
Returns a localised string describing an encoder for the format specified incaps
, for use in error dialogs or other messages to be seen by the user.This function is mainly for internal use, applications would typically use gst_missing_plugin_message_get_description() to get a description of a missing feature from a missing-plugin message.
- Parameters:
caps
- the (fixed)GstCaps
for which an encoder description is needed- Returns:
- a newly-allocated description string. Free string with g_free() when not needed any longer.
-
pbUtilsGetFileExtensionFromCaps
Returns a possible file extension for the given caps, if known.- Parameters:
caps
- the (fixed)GstCaps
for which a file extension is needed- Returns:
- a newly-allocated file extension string, or NULL on error. Free string with g_free() when not needed any longer.
-
pbUtilsGetSinkDescription
Returns a localised string describing a sink element handling the protocol specified inprotocol
, for use in error dialogs or other messages to be seen by the user.This function is mainly for internal use, applications would typically use gst_missing_plugin_message_get_description() to get a description of a missing feature from a missing-plugin message.
- Parameters:
protocol
- the protocol the sink element needs to handle, e.g. "http"- Returns:
- a newly-allocated description string. Free string with g_free() when not needed any longer.
-
pbUtilsGetSourceDescription
Returns a localised string describing a source element handling the protocol specified inprotocol
, for use in error dialogs or other messages to be seen by the user.This function is mainly for internal use, applications would typically use gst_missing_plugin_message_get_description() to get a description of a missing feature from a missing-plugin message.
- Parameters:
protocol
- the protocol the source element needs to handle, e.g. "http"- Returns:
- a newly-allocated description string. Free string with g_free() when not needed any longer.
-
pbUtilsInit
public static void pbUtilsInit()Initialises the base utils support library. This function is not thread-safe. Applications should call it after calling gst_init(), plugins should call it from their plugin_init function.This function may be called multiple times. It will do nothing if the library has already been initialised.
-
pluginsBaseVersion
public static void pluginsBaseVersion(Out<Integer> major, Out<Integer> minor, Out<Integer> micro, Out<Integer> nano) Gets the version number of the GStreamer Plugins Base libraries.- Parameters:
major
- pointer to a guint to store the major version number, ornull
minor
- pointer to a guint to store the minor version number, ornull
micro
- pointer to a guint to store the micro version number, ornull
nano
- pointer to a guint to store the nano version number, ornull
-
pluginsBaseVersionString
This function returns a string that is useful for describing this version of GStreamer's gst-plugins-base libraries to the outside world: user agent strings, logging, about dialogs ...- Returns:
- a newly allocated string describing this version of gst-plugins-base
-