Class GstBase
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic @Nullable CapstypeFindHelper(Pad src, long size) Tries to find what type of data is flowing from the given sourceGstPad.static @Nullable CapstypeFindHelperForBuffer(@Nullable GstObject obj, Buffer buf, @Nullable Out<TypeFindProbability> prob) Tries to find what type of data is contained in the givenGstBuffer, the assumption being that the buffer represents the beginning of the stream or file.static @Nullable CapstypeFindHelperForBufferWithCaps(@Nullable GstObject obj, Buffer buf, Caps caps, @Nullable Out<TypeFindProbability> prob) Tries to find if type of media contained in the givenGstBuffer, matchescapsspecified, assumption being that the buffer represents the beginning of the stream or file.static @Nullable CapstypeFindHelperForBufferWithExtension(@Nullable GstObject obj, Buffer buf, @Nullable String extension, @Nullable Out<TypeFindProbability> prob) Tries to find what type of data is contained in the givenGstBuffer, the assumption being that the buffer represents the beginning of the stream or file.static @Nullable CapstypeFindHelperForData(@Nullable GstObject obj, @org.jspecify.annotations.Nullable byte @Nullable [] data, @Nullable Out<TypeFindProbability> prob) Tries to find what type of data is contained in the givendata,the assumption being that the data represents the beginning of the stream or file.static @Nullable CapstypeFindHelperForDataWithCaps(@Nullable GstObject obj, @org.jspecify.annotations.Nullable byte @Nullable [] data, Caps caps, @Nullable Out<TypeFindProbability> prob) Tries to find if type of media contained in the givendata,matches thecapsspecified, assumption being that the data represents the beginning of the stream or file.static @Nullable CapstypeFindHelperForDataWithExtension(@Nullable GstObject obj, @org.jspecify.annotations.Nullable byte @Nullable [] data, @Nullable String extension, @Nullable Out<TypeFindProbability> prob) Tries to find what type of data is contained in the givendata,the assumption being that the data represents the beginning of the stream or file.static @Nullable CapstypeFindHelperForExtension(@Nullable GstObject obj, String extension) Tries to find the bestGstCapsassociated withextension.static @Nullable CapstypeFindHelperGetRange(GstObject obj, @Nullable GstObject parent, @Nullable TypeFindHelperGetRangeFunction func, long size, @Nullable String extension, @Nullable Out<TypeFindProbability> prob) Utility function to do pull-based typefinding.static FlowReturntypeFindHelperGetRangeFull(GstObject obj, @Nullable GstObject parent, @Nullable TypeFindHelperGetRangeFunction func, long size, @Nullable String extension, Out<Caps> caps, @Nullable Out<TypeFindProbability> prob) Utility function to do pull-based typefinding.static @Nullable List<TypeFindFactory> typeFindListFactoriesForCaps(@Nullable GstObject obj, Caps caps) Tries to find the bestGstTypeFindFactoryassociated withcaps.
-
Field Details
-
BASE_PARSE_FLAG_DRAINING
public static final int BASE_PARSE_FLAG_DRAINING- See Also:
-
BASE_PARSE_FLAG_LOST_SYNC
public static final int BASE_PARSE_FLAG_LOST_SYNC- See Also:
-
BASE_TRANSFORM_SINK_NAME
The name of the templates for the sink pad.- See Also:
-
BASE_TRANSFORM_SRC_NAME
The name of the templates for the source pad.- See Also:
-
-
Constructor Details
-
GstBase
public GstBase()
-
-
Method Details
-
javagi$ensureInitialized
public static void javagi$ensureInitialized() -
typeFindHelper
Tries to find what type of data is flowing from the given sourceGstPad.Free-function: gst_caps_unref
- Parameters:
src- A sourceGstPadsize- The length in bytes- Returns:
- the
GstCapscorresponding to the data stream. Returnsnullif noGstCapsmatches the data stream.
-
typeFindHelperForBuffer
public static @Nullable Caps typeFindHelperForBuffer(@Nullable GstObject obj, Buffer buf, @Nullable Out<TypeFindProbability> prob) Tries to find what type of data is contained in the givenGstBuffer, the assumption being that the buffer represents the beginning of the stream or file.All available typefinders will be called on the data in order of rank. If a typefinding function returns a probability of
TypeFindProbability.MAXIMUM, typefinding is stopped immediately and the found caps will be returned right away. Otherwise, all available typefind functions will the tried, and the caps with the highest probability will be returned, ornullif the content of the buffer could not be identified.Free-function: gst_caps_unref
- Parameters:
obj- object doing the typefinding, ornull(used for logging)buf- aGstBufferwith data to typefindprob- location to store the probability of the found caps, ornull- Returns:
- the
GstCapscorresponding to the data, ornullif no type could be found. The caller should free the caps returned with gst_caps_unref().
-
typeFindHelperForBufferWithCaps
public static @Nullable Caps typeFindHelperForBufferWithCaps(@Nullable GstObject obj, Buffer buf, Caps caps, @Nullable Out<TypeFindProbability> prob) Tries to find if type of media contained in the givenGstBuffer, matchescapsspecified, assumption being that the buffer represents the beginning of the stream or file.Tries to find what type of data is contained in the given
data,the assumption being that the data represents the beginning of the stream or file.Only the typefinder matching the given caps will be called, if found. The caps with the highest probability will be returned, or
nullif the content of thedatacould not be identified.Free-function: gst_caps_unref
- Parameters:
obj- object doing the typefinding, ornull(used for logging)buf- aGstBufferwith data to typefindcaps- caps of the mediaprob- location to store the probability of the found caps, ornull- Returns:
- the
GstCapscorresponding to the data, ornullif no type could be found. The caller should free the caps returned with gst_caps_unref(). - Since:
- 1.22
-
typeFindHelperForBufferWithExtension
public static @Nullable Caps typeFindHelperForBufferWithExtension(@Nullable GstObject obj, Buffer buf, @Nullable String extension, @Nullable Out<TypeFindProbability> prob) Tries to find what type of data is contained in the givenGstBuffer, the assumption being that the buffer represents the beginning of the stream or file.All available typefinders will be called on the data in order of rank. If a typefinding function returns a probability of
TypeFindProbability.MAXIMUM, typefinding is stopped immediately and the found caps will be returned right away. Otherwise, all available typefind functions will the tried, and the caps with the highest probability will be returned, ornullif the content of the buffer could not be identified.When
extensionis notnull, this function will first try the typefind functions for the given extension, which might speed up the typefinding in many cases.Free-function: gst_caps_unref
- Parameters:
obj- object doing the typefinding, ornull(used for logging)buf- aGstBufferwith data to typefindextension- extension of the media, ornullprob- location to store the probability of the found caps, ornull- Returns:
- the
GstCapscorresponding to the data, ornullif no type could be found. The caller should free the caps returned with gst_caps_unref(). - Since:
- 1.16
-
typeFindHelperForData
public static @Nullable Caps typeFindHelperForData(@Nullable GstObject obj, @org.jspecify.annotations.Nullable byte @Nullable [] data, @Nullable Out<TypeFindProbability> prob) Tries to find what type of data is contained in the givendata,the assumption being that the data represents the beginning of the stream or file.All available typefinders will be called on the data in order of rank. If a typefinding function returns a probability of
TypeFindProbability.MAXIMUM, typefinding is stopped immediately and the found caps will be returned right away. Otherwise, all available typefind functions will the tried, and the caps with the highest probability will be returned, ornullif the content ofdatacould not be identified.Free-function: gst_caps_unref
- Parameters:
obj- object doing the typefinding, ornull(used for logging)data-- a pointer with data to typefind
prob- location to store the probability of the found caps, ornull- Returns:
- the
GstCapscorresponding to the data, ornullif no type could be found. The caller should free the caps returned with gst_caps_unref().
-
typeFindHelperForDataWithCaps
public static @Nullable Caps typeFindHelperForDataWithCaps(@Nullable GstObject obj, @org.jspecify.annotations.Nullable byte @Nullable [] data, Caps caps, @Nullable Out<TypeFindProbability> prob) Tries to find if type of media contained in the givendata,matches thecapsspecified, assumption being that the data represents the beginning of the stream or file.Only the typefinder matching the given caps will be called, if found. The caps with the highest probability will be returned, or
nullif the content of thedatacould not be identified.Free-function: gst_caps_unref
- Parameters:
obj- object doing the typefinding, ornull(used for logging)data- a pointer with data to typefindcaps- caps of the mediaprob- location to store the probability of the found caps, ornull- Returns:
- the
GstCapscorresponding to the data, ornullif no type could be found. The caller should free the caps returned with gst_caps_unref(). - Since:
- 1.22
-
typeFindHelperForDataWithExtension
public static @Nullable Caps typeFindHelperForDataWithExtension(@Nullable GstObject obj, @org.jspecify.annotations.Nullable byte @Nullable [] data, @Nullable String extension, @Nullable Out<TypeFindProbability> prob) Tries to find what type of data is contained in the givendata,the assumption being that the data represents the beginning of the stream or file.All available typefinders will be called on the data in order of rank. If a typefinding function returns a probability of
TypeFindProbability.MAXIMUM, typefinding is stopped immediately and the found caps will be returned right away. Otherwise, all available typefind functions will the tried, and the caps with the highest probability will be returned, ornullif the content ofdatacould not be identified.When
extensionis notnull, this function will first try the typefind functions for the given extension, which might speed up the typefinding in many cases.Free-function: gst_caps_unref
- Parameters:
obj- object doing the typefinding, ornull(used for logging)data-- a pointer with data to typefind
extension- extension of the media, ornullprob- location to store the probability of the found caps, ornull- Returns:
- the
GstCapscorresponding to the data, ornullif no type could be found. The caller should free the caps returned with gst_caps_unref(). - Since:
- 1.16
-
typeFindHelperForExtension
Tries to find the bestGstCapsassociated withextension.All available typefinders will be checked against the extension in order of rank. The caps of the first typefinder that can handle
extensionwill be returned.Free-function: gst_caps_unref
- Parameters:
obj- object doing the typefinding, ornull(used for logging)extension- an extension- Returns:
- the
GstCapscorresponding toextension,ornullif no type could be found. The caller should free the caps returned with gst_caps_unref().
-
typeFindHelperGetRange
public static @Nullable Caps typeFindHelperGetRange(GstObject obj, @Nullable GstObject parent, @Nullable TypeFindHelperGetRangeFunction func, long size, @Nullable String extension, @Nullable Out<TypeFindProbability> prob) Utility function to do pull-based typefinding. Unlike gst_type_find_helper() however, this function will use the specified functionfuncto obtain the data needed by the typefind functions, rather than operating on a given source pad. This is useful mostly for elements like tag demuxers which strip off data at the beginning and/or end of a file and want to typefind the stripped data stream before adding their own source pad (the specified callback can then call the upstream peer pad with offsets adjusted for the tag size, for example).When
extensionis notnull, this function will first try the typefind functions for the given extension, which might speed up the typefinding in many cases.Free-function: gst_caps_unref
- Parameters:
obj- AGstObjectthat will be passed as first argument tofuncparent- the parent ofobjornullfunc- A genericGstTypeFindHelperGetRangeFunctionthat will be used to access data at random offsets when doing the typefindingsize- The length in bytesextension- extension of the media, ornullprob- location to store the probability of the found caps, ornull- Returns:
- the
GstCapscorresponding to the data stream. Returnsnullif noGstCapsmatches the data stream.
-
typeFindHelperGetRangeFull
public static FlowReturn typeFindHelperGetRangeFull(GstObject obj, @Nullable GstObject parent, @Nullable TypeFindHelperGetRangeFunction func, long size, @Nullable String extension, Out<Caps> caps, @Nullable Out<TypeFindProbability> prob) Utility function to do pull-based typefinding. Unlike gst_type_find_helper() however, this function will use the specified functionfuncto obtain the data needed by the typefind functions, rather than operating on a given source pad. This is useful mostly for elements like tag demuxers which strip off data at the beginning and/or end of a file and want to typefind the stripped data stream before adding their own source pad (the specified callback can then call the upstream peer pad with offsets adjusted for the tag size, for example).When
extensionis notnull, this function will first try the typefind functions for the given extension, which might speed up the typefinding in many cases.- Parameters:
obj- AGstObjectthat will be passed as first argument tofuncparent- the parent ofobjornullfunc- A genericGstTypeFindHelperGetRangeFunctionthat will be used to access data at random offsets when doing the typefindingsize- The length in bytesextension- extension of the media, ornullcaps- returned capsprob- location to store the probability of the found caps, ornull- Returns:
- the last
GstFlowReturnfrom pulling a buffer orFlowReturn.OKif typefinding was successful. - Since:
- 1.14.3
-
typeFindListFactoriesForCaps
public static @Nullable List<TypeFindFactory> typeFindListFactoriesForCaps(@Nullable GstObject obj, Caps caps) Tries to find the bestGstTypeFindFactoryassociated withcaps.The typefinder that can handle
capswill be returned.Free-function: g_list_free
- Parameters:
obj- object doing the typefinding, ornull(used for logging)caps- caps of the media- Returns:
- the list of
GstTypeFindFactorycorresponding tocaps,ornullif no typefinder could be found. Caller should free the returned list with g_list_free() and list elements with gst_object_unref(). - Since:
- 1.22
-