Class GstPbutils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringGstEncodingTargetcategory for recording and capture.static final StringGstEncodingTargetcategory for device-specific targets.static final StringGstEncodingTargetcategory for file extensions.static final StringGstEncodingTargetcategory for online-services.static final StringGstEncodingTargetcategory for storage, archiving and editing targets.static final intThe major version of GStreamer's gst-plugins-base libraries at compile time.static final intThe micro version of GStreamer's gst-plugins-base libraries at compile time.static final intThe minor version of GStreamer's gst-plugins-base libraries at compile time.static final intThe nano version of GStreamer's gst-plugins-base libraries at compile time. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancodecUtilsAacCapsSetLevelAndProfile(Caps caps, @org.jspecify.annotations.Nullable byte @Nullable [] audioConfig) Sets the level and profile oncapsif 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.static intcodecUtilsAacGetChannels(@org.jspecify.annotations.Nullable byte @Nullable [] audioConfig) Returns the channels of the given AAC stream.static intcodecUtilsAacGetIndexFromSampleRate(int rate) Translates the sample rate to the index corresponding to it in AAC spec.static @Nullable StringcodecUtilsAacGetLevel(@org.jspecify.annotations.Nullable byte @Nullable [] audioConfig) Determines the level of a stream as defined in ISO/IEC 14496-3.static @Nullable StringcodecUtilsAacGetProfile(@org.jspecify.annotations.Nullable byte @Nullable [] audioConfig) Returns the profile of the given AAC stream as a string.static intcodecUtilsAacGetSampleRate(@org.jspecify.annotations.Nullable byte @Nullable [] audioConfig) Translates the sample rate index found in AAC headers to the actual sample rate.static intcodecUtilsAacGetSampleRateFromIndex(int srIdx) Translates the sample rate index found in AAC headers to the actual sample rate.static @Nullable BufferCreates the corresponding AV1 Codec Configuration Recordstatic @Nullable CapsParses the providedav1cand returns the corresponding capsstatic @Nullable StringcodecUtilsAv1GetLevel(byte seqLevelIdx) Transform a seq_level_idx into the level stringstatic byteTransform a level string from the caps into the seq_level_idxstatic @Nullable CapscodecUtilsCapsFromMimeCodec(String codecsField) Converts a RFC 6381 compatible codec string toGstCaps.static @Nullable StringConvertscapsto a RFC 6381 compatible codec string if possible.static booleancodecUtilsH264CapsSetLevelAndProfile(Caps caps, @org.jspecify.annotations.Nullable byte @Nullable [] sps) Sets the level and profile incapsif 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.static @Nullable StringcodecUtilsH264GetLevel(@org.jspecify.annotations.Nullable byte @Nullable [] sps) Converts the level indication (level_idc) in the stream's sequence parameter set into a string.static bytecodecUtilsH264GetLevelIdc(String level) Transform a level string from the caps into the level_idcstatic @Nullable StringcodecUtilsH264GetProfile(@org.jspecify.annotations.Nullable byte @Nullable [] sps) Converts the profile indication (profile_idc) in the stream's sequence parameter set into a string.static booleancodecUtilsH264GetProfileFlagsLevel(@org.jspecify.annotations.Nullable byte @Nullable [] 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 booleancodecUtilsH265CapsSetLevelTierAndProfile(Caps caps, @org.jspecify.annotations.Nullable byte @Nullable [] profileTierLevel) Sets the level, tier and profile incapsif 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.static @Nullable StringcodecUtilsH265GetLevel(@org.jspecify.annotations.Nullable byte @Nullable [] profileTierLevel) Converts the level indication (general_level_idc) in the stream's profile_tier_level structure into a string.static bytecodecUtilsH265GetLevelIdc(String level) Transform a level string from the caps into the level_idcstatic @Nullable StringcodecUtilsH265GetProfile(@org.jspecify.annotations.Nullable byte @Nullable [] profileTierLevel) Converts the profile indication (general_profile_idc) in the stream's profile_level_tier structure into a string.static @Nullable StringcodecUtilsH265GetTier(@org.jspecify.annotations.Nullable byte @Nullable [] profileTierLevel) Converts the tier indication (general_tier_flag) in the stream's profile_tier_level structure into a string.static booleancodecUtilsH266CapsSetLevelTierAndProfile(Caps caps, @org.jspecify.annotations.Nullable byte @Nullable [] decoderConfiguration) Sets the level, tier and profile incapsif it can be determined fromdecoderConfiguration.See gst_codec_utils_h266_get_level(), gst_codec_utils_h266_get_tier() and gst_codec_utils_h266_get_profile() for more details on the parameters.static @Nullable StringcodecUtilsH266GetLevel(@org.jspecify.annotations.Nullable byte @Nullable [] ptlRecord) Converts the level indication (general_level_idc) in the stream's ptl_record structure into a string.static bytecodecUtilsH266GetLevelIdc(String level) Transform a level string from the caps into the level_idcstatic @Nullable StringcodecUtilsH266GetProfile(@org.jspecify.annotations.Nullable byte @Nullable [] ptlRecord) Converts the profile indication (general_profile_idc) in the stream's ptl_record structure into a string.static @Nullable StringcodecUtilsH266GetTier(@org.jspecify.annotations.Nullable byte @Nullable [] ptlRecord) Converts the tier indication (general_tier_flag) in the stream's ptl_record structure into a string.static booleancodecUtilsMpeg4videoCapsSetLevelAndProfile(Caps caps, @org.jspecify.annotations.Nullable byte @Nullable [] visObjSeq) Sets the level and profile incapsif 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.static @Nullable StringcodecUtilsMpeg4videoGetLevel(@org.jspecify.annotations.Nullable byte @Nullable [] visObjSeq) Converts the level indication in the stream's visual object sequence into a string.static @Nullable StringcodecUtilsMpeg4videoGetProfile(@org.jspecify.annotations.Nullable byte @Nullable [] visObjSeq) Converts the profile indication in the stream's visual object sequence into a string.static @Nullable CapscodecUtilsOpusCreateCaps(int rate, byte channels, byte channelMappingFamily, byte streamCount, byte coupledCount, @org.jspecify.annotations.Nullable byte @Nullable [] channelMapping) Creates Opus caps from the given parameters.static @Nullable CapscodecUtilsOpusCreateCapsFromHeader(Buffer header, @Nullable Buffer comments) Creates Opus caps from the given OpusHeadheaderand comment headercomments.static @Nullable BuffercodecUtilsOpusCreateHeader(int rate, byte channels, byte channelMappingFamily, byte streamCount, byte coupledCount, @org.jspecify.annotations.Nullable byte @Nullable [] channelMapping, short preSkip, short outputGain) Creates OpusHead header from the given parameters.static booleancodecUtilsOpusParseCaps(Caps caps, @Nullable Out<Integer> rate, @Nullable Out<Byte> channels, @Nullable Out<Byte> channelMappingFamily, @Nullable Out<Byte> streamCount, @Nullable Out<Byte> coupledCount, @Nullable Out<byte[]> channelMapping) Parses Opus caps and fills the different fields with defaults if possible.static booleancodecUtilsOpusParseHeader(Buffer header, @Nullable Out<Integer> rate, @Nullable Out<Byte> channels, @Nullable Out<Byte> channelMappingFamily, @Nullable Out<Byte> streamCount, @Nullable Out<Byte> coupledCount, @Nullable Out<byte[]> channelMapping, @Nullable Out<Short> preSkip, @Nullable Out<Short> outputGain) Parses the OpusHead header.static List<EncodingTarget> encodingListAllTargets(@Nullable String categoryname) List all availableGstEncodingTargetfor the specified category, or all categories ifcategorynameisnull.Lists allGstEncodingTargetcategories present on disk.static InstallPluginsReturninstallPluginsAsync(@Nullable String @Nullable [] details, @Nullable InstallPluginsContext ctx, @Nullable InstallPluginsResultFunc func) Requests plugin installation without blocking.static booleanChecks whether plugin installation (initiated by this application only) is currently in progress.static booleanChecks whether plugin installation is likely to be supported by the current environment.static InstallPluginsReturninstallPluginsSync(@Nullable String @Nullable [] details, @Nullable InstallPluginsContext ctx) Requests plugin installation and block until the plugins have been installed or installation has failed.static booleanChecks whethermsgis a missing plugins message.static voidstatic StringmissingDecoderInstallerDetailNew(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 MessagemissingDecoderMessageNew(Element element, Caps decodeCaps) Creates a missing-plugin message forelementto notify the application that a decoder element for a particular set of (fixed) caps is missing.static StringmissingElementInstallerDetailNew(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 MessagemissingElementMessageNew(Element element, String factoryName) Creates a missing-plugin message forelementto notify the application that a certain required element is missing.static StringmissingEncoderInstallerDetailNew(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 MessagemissingEncoderMessageNew(Element element, Caps encodeCaps) Creates a missing-plugin message forelementto notify the application that an encoder element for a particular set of (fixed) caps is missing.static StringReturns a localised string describing the missing feature, for use in error dialogs and the like.static @Nullable StringReturns 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 @Nullable StringGet the stream-id of the stream for which an element is missing.static voidmissingPluginMessageSetStreamId(Message msg, String streamId) Set the stream-id of the stream for which an element is missing.static StringmissingUriSinkInstallerDetailNew(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 MessagemissingUriSinkMessageNew(Element element, String protocol) Creates a missing-plugin message forelementto notify the application that a sink element for a particular URI protocol is missing.static StringmissingUriSourceInstallerDetailNew(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 MessagemissingUriSourceMessageNew(Element element, String protocol) Creates a missing-plugin message forelementto notify the application that a source element for a particular URI protocol is missing.static booleanpbUtilsAddCodecDescriptionToTagList(TagList taglist, @Nullable String codecTag, Caps caps) Adds a codec tag describing the format specified bycapstotaglist.static Set<PbUtilsCapsDescriptionFlags> Returns flags that describe the format of the caps if known.static @Nullable StringReturns 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 StringReturns 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 StringpbUtilsGetElementDescription(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 StringReturns 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 @Nullable StringReturns a possible file extension for the given caps, if known.static StringpbUtilsGetSinkDescription(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 StringpbUtilsGetSourceDescription(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 voidInitialises the base utils support library.static voidGets the version number of the GStreamer Plugins Base libraries.static StringThis 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
GstEncodingTargetcategory for recording and capture. Targets within this category are optimized for low latency encoding.- See Also:
-
ENCODING_CATEGORY_DEVICE
GstEncodingTargetcategory for device-specific targets. The name of the target will usually be the constructor and model of the device, and that target will containGstEncodingProfilessuitable for that device.- See Also:
-
ENCODING_CATEGORY_FILE_EXTENSION
GstEncodingTargetcategory 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
GstEncodingTargetcategory for online-services. The name of the target will usually be the name of the online service and that target will containGstEncodingProfilessuitable for that online service.- See Also:
-
ENCODING_CATEGORY_STORAGE_EDITING
GstEncodingTargetcategory 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 containGstEncodingProfilessuitable 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
public static boolean codecUtilsAacCapsSetLevelAndProfile(Caps caps, @org.jspecify.annotations.Nullable byte @Nullable [] audioConfig) Sets the level and profile oncapsif 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.capsmust 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- theGstCapsto 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:
trueif the level and profile could be set,falseotherwise.
-
codecUtilsAacGetChannels
public static int codecUtilsAacGetChannels(@org.jspecify.annotations.Nullable byte @Nullable [] 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.
- Since:
- 1.10
-
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
public static @Nullable String codecUtilsAacGetLevel(@org.jspecify.annotations.Nullable byte @Nullable [] audioConfig) 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
audioConfigparameter 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
nullif the level could not be determined.
-
codecUtilsAacGetProfile
public static @Nullable String codecUtilsAacGetProfile(@org.jspecify.annotations.Nullable byte @Nullable [] audioConfig) 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
nullif the profile could not be determined.
-
codecUtilsAacGetSampleRate
public static int codecUtilsAacGetSampleRate(@org.jspecify.annotations.Nullable byte @Nullable [] 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.
- Since:
- 1.10
-
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
srIdxis valid, 0 otherwise.
-
codecUtilsAv1CreateAv1cFromCaps
-
codecUtilsAv1CreateCapsFromAv1c
-
codecUtilsAv1GetLevel
Transform a seq_level_idx into the level string- Parameters:
seqLevelIdx- A seq_level_idx- Returns:
- the level string or
nullif the seq_level_idx is unknown - Since:
- 1.26
-
codecUtilsAv1GetSeqLevelIdx
Transform a level string from the caps into the seq_level_idx- Parameters:
level- A level string from caps- Returns:
- the seq_level_idx or 31 (max-level) if the level is unknown
- Since:
- 1.26
-
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
GstCapsornull - Since:
- 1.22
-
codecUtilsCapsGetMimeCodec
Convertscapsto 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- AGstCapsto convert to mime codec- Returns:
- a RFC 6381 compatible codec string or
null - Since:
- 1.20
-
codecUtilsH264CapsSetLevelAndProfile
public static boolean codecUtilsH264CapsSetLevelAndProfile(Caps caps, @org.jspecify.annotations.Nullable byte @Nullable [] sps) Sets the level and profile incapsif 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- theGstCapsto which the level and profile are to be addedsps- Pointer to the sequence parameter set for the stream.- Returns:
trueif the level and profile could be set,falseotherwise.
-
codecUtilsH264GetLevel
public static @Nullable String codecUtilsH264GetLevel(@org.jspecify.annotations.Nullable byte @Nullable [] sps) 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
nullif 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
public static @Nullable String codecUtilsH264GetProfile(@org.jspecify.annotations.Nullable byte @Nullable [] sps) 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
nullif there is an error.
-
codecUtilsH264GetProfileFlagsLevel
public static boolean codecUtilsH264GetProfileFlagsLevel(@org.jspecify.annotations.Nullable byte @Nullable [] 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. 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 ornullflags- return location for h264 constraint set flags ornulllevel- return location h264 level_idc ornull- Returns:
trueon success,falseon failure- Since:
- 1.20
-
codecUtilsH265CapsSetLevelTierAndProfile
public static boolean codecUtilsH265CapsSetLevelTierAndProfile(Caps caps, @org.jspecify.annotations.Nullable byte @Nullable [] profileTierLevel) Sets the level, tier and profile incapsif 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- theGstCapsto which the level, tier and profile are to be addedprofileTierLevel- Pointer to the profile_tier_level struct- Returns:
trueif the level, tier, profile could be set,falseotherwise.- Since:
- 1.4
-
codecUtilsH265GetLevel
public static @Nullable String codecUtilsH265GetLevel(@org.jspecify.annotations.Nullable byte @Nullable [] profileTierLevel) 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
nullif there is an error. - Since:
- 1.4
-
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
- Since:
- 1.4
-
codecUtilsH265GetProfile
public static @Nullable String codecUtilsH265GetProfile(@org.jspecify.annotations.Nullable byte @Nullable [] profileTierLevel) 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
nullif there is an error. - Since:
- 1.4
-
codecUtilsH265GetTier
public static @Nullable String codecUtilsH265GetTier(@org.jspecify.annotations.Nullable byte @Nullable [] profileTierLevel) 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
nullif there is an error. - Since:
- 1.4
-
codecUtilsH266CapsSetLevelTierAndProfile
public static boolean codecUtilsH266CapsSetLevelTierAndProfile(Caps caps, @org.jspecify.annotations.Nullable byte @Nullable [] decoderConfiguration) Sets the level, tier and profile incapsif it can be determined fromdecoderConfiguration.See gst_codec_utils_h266_get_level(), gst_codec_utils_h266_get_tier() and gst_codec_utils_h266_get_profile() for more details on the parameters.- Parameters:
caps- theGstCapsto which the level, tier and profile are to be addeddecoderConfiguration- Pointer to the VvcDecoderConfigurationRecord struct as defined in ISO/IEC 14496-15- Returns:
trueif the level, tier, profile could be set,falseotherwise.- Since:
- 1.26
-
codecUtilsH266GetLevel
public static @Nullable String codecUtilsH266GetLevel(@org.jspecify.annotations.Nullable byte @Nullable [] ptlRecord) Converts the level indication (general_level_idc) in the stream's ptl_record structure into a string.- Parameters:
ptlRecord- Pointer to the VvcPTLRecord structure as defined in ISO/IEC 14496-15.- Returns:
- The level as a const string, or
nullif there is an error. - Since:
- 1.26
-
codecUtilsH266GetLevelIdc
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
- Since:
- 1.26
-
codecUtilsH266GetProfile
public static @Nullable String codecUtilsH266GetProfile(@org.jspecify.annotations.Nullable byte @Nullable [] ptlRecord) Converts the profile indication (general_profile_idc) in the stream's ptl_record structure into a string.- Parameters:
ptlRecord- Pointer to the VvcPTLRecord structure as defined in ISO/IEC 14496-15.- Returns:
- The profile as a const string, or
nullif there is an error. - Since:
- 1.26
-
codecUtilsH266GetTier
public static @Nullable String codecUtilsH266GetTier(@org.jspecify.annotations.Nullable byte @Nullable [] ptlRecord) Converts the tier indication (general_tier_flag) in the stream's ptl_record structure into a string.- Parameters:
ptlRecord- Pointer to the VvcPTLRecord structure as defined in ISO/IEC 14496-15.- Returns:
- The tier as a const string, or
nullif there is an error. - Since:
- 1.26
-
codecUtilsMpeg4videoCapsSetLevelAndProfile
public static boolean codecUtilsMpeg4videoCapsSetLevelAndProfile(Caps caps, @org.jspecify.annotations.Nullable byte @Nullable [] visObjSeq) Sets the level and profile incapsif 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- theGstCapsto which the level and profile are to be addedvisObjSeq- Pointer to the visual object sequence for the stream.- Returns:
trueif the level and profile could be set,falseotherwise.
-
codecUtilsMpeg4videoGetLevel
public static @Nullable String codecUtilsMpeg4videoGetLevel(@org.jspecify.annotations.Nullable byte @Nullable [] visObjSeq) Converts the level indication in the stream's visual object sequence into a string.visObjSeqis 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
public static @Nullable String codecUtilsMpeg4videoGetProfile(@org.jspecify.annotations.Nullable byte @Nullable [] visObjSeq) Converts the profile indication in the stream's visual object sequence into a string.visObjSeqis 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 @Nullable Caps codecUtilsOpusCreateCaps(int rate, byte channels, byte channelMappingFamily, byte streamCount, byte coupledCount, @org.jspecify.annotations.Nullable byte @Nullable [] 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, ornullif the parameters would lead to invalid Opus caps. - Since:
- 1.8
-
codecUtilsOpusCreateCapsFromHeader
-
codecUtilsOpusCreateHeader
public static @Nullable Buffer codecUtilsOpusCreateHeader(int rate, byte channels, byte channelMappingFamily, byte streamCount, byte coupledCount, @org.jspecify.annotations.Nullable byte @Nullable [] 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
GstBuffercontaining the OpusHead. - Since:
- 1.8
-
codecUtilsOpusParseCaps
public 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, @Nullable Out<byte[]> channelMapping) Parses Opus caps and fills the different fields with defaults if possible.- Parameters:
caps- theGstCapsto 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:
trueif parsing was successful,falseotherwise.- Since:
- 1.8
-
codecUtilsOpusParseHeader
public 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, @Nullable Out<byte[]> channelMapping, @Nullable Out<Short> preSkip, @Nullable Out<Short> outputGain) Parses the OpusHead header.- Parameters:
header- the OpusHeadGstBufferrate- 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:
trueif parsing was successful,falseotherwise.- Since:
- 1.8
-
encodingListAllTargets
List all availableGstEncodingTargetfor the specified category, or all categories ifcategorynameisnull.- Parameters:
categoryname- The category, for ex:GST_ENCODING_CATEGORY_DEVICE. Can benull.- Returns:
- The list of
GstEncodingTarget
-
encodingListAvailableCategories
-
installPluginsAsync
public static InstallPluginsReturn installPluginsAsync(@Nullable String @Nullable [] details, @Nullable InstallPluginsContext ctx, @Nullable InstallPluginsResultFunc func) Requests plugin installation without blocking. Once the plugins have been installed or installation has failed,funcwill be called with the result of the installation and your provideduserDatapointer.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
detailare 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(@Nullable String @Nullable [] details, @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 whethermsgis a missing plugins message.- Parameters:
msg- aGstMessage- Returns:
trueifmsgis 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 forelementto 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- theGstElementposting 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 forelementto notify the application that a certain required element is missing. This function is mainly for use in plugins.- Parameters:
element- theGstElementposting 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 forelementto 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- theGstElementposting 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 unlessmsgis 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-pluginGstMessageof 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-pluginGstMessageof typeGST_MESSAGE_ELEMENT- Returns:
- a newly-allocated detail string, or NULL on error. Free string with g_free() when not needed any longer.
-
missingPluginMessageGetStreamId
-
missingPluginMessageSetStreamId
-
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 forelementto notify the application that a sink element for a particular URI protocol is missing. This function is mainly for use in plugins.- Parameters:
element- theGstElementposting 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 forelementto notify the application that a source element for a particular URI protocol is missing. This function is mainly for use in plugins.- Parameters:
element- theGstElementposting 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 String codecTag, Caps caps) Adds a codec tag describing the format specified bycapstotaglist.- Parameters:
taglist- aGstTagListcodecTag- a GStreamer codec tag such asGST_TAG_AUDIO_CODEC,GST_TAG_VIDEO_CODECorGST_TAG_CODEC. If none is specified, the function will attempt to detect the appropriate category.caps- the (fixed)GstCapsfor 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)GstCapsfor which flags are requested- Returns:
GstPbUtilsCapsDescriptionFlagsthat describecaps,or no flags if the caps are unknown.- Since:
- 1.20
-
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 unlesscapsis invalid.Also see the convenience function gst_pb_utils_add_codec_description_to_tag_list().
- Parameters:
caps- the (fixed)GstCapsfor 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)GstCapsfor 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)GstCapsfor 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)GstCapsfor 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.
- Since:
- 1.20
-
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, ornullminor- pointer to a guint to store the minor version number, ornullmicro- pointer to a guint to store the micro version number, ornullnano- 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
-