Class GstBase
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static Caps
typeFindHelper
(Pad src, long size) Tries to find what type of data is flowing from the given sourceGstPad
.static 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.static Caps
typeFindHelperForBufferWithCaps
(@Nullable GstObject obj, Buffer buf, Caps caps, @Nullable Out<TypeFindProbability> prob) Tries to find if type of media contained in the givenGstBuffer
, matchescaps
specified, assumption being that the buffer represents the beginning of the stream or file.static 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.static Caps
typeFindHelperForData
(@Nullable GstObject obj, byte[] 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 Caps
typeFindHelperForDataWithCaps
(@Nullable GstObject obj, byte[] data, Caps caps, @Nullable Out<TypeFindProbability> prob) Tries to find if type of media contained in the givendata
, matches thecaps
specified, assumption being that the data represents the beginning of the stream or file.static Caps
typeFindHelperForDataWithExtension
(@Nullable GstObject obj, byte[] 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 Caps
typeFindHelperForExtension
(@Nullable GstObject obj, String extension) Tries to find the bestGstCaps
associated withextension
.static Caps
typeFindHelperGetRange
(GstObject obj, @Nullable GstObject parent, TypeFindHelperGetRangeFunction func, long size, @Nullable String extension, @Nullable Out<TypeFindProbability> prob) Utility function to do pull-based typefinding.static FlowReturn
typeFindHelperGetRangeFull
(GstObject obj, @Nullable GstObject parent, TypeFindHelperGetRangeFunction func, long size, @Nullable String extension, Out<Caps> caps, @Nullable Out<TypeFindProbability> prob) Utility function to do pull-based typefinding.static List
<TypeFindFactory> typeFindListFactoriesForCaps
(@Nullable GstObject obj, Caps caps) Tries to find the bestGstTypeFindFactory
associated 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 sourceGstPad
size
- The length in bytes- Returns:
- the
GstCaps
corresponding to the data stream. Returnsnull
if noGstCaps
matches the data stream.
-
typeFindHelperForBuffer
public static Caps typeFindHelperForBuffer(@Nullable @Nullable GstObject obj, Buffer buf, @Nullable @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, ornull
if 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
- aGstBuffer
with data to typefindprob
- location to store the probability of the found caps, ornull
- Returns:
- the
GstCaps
corresponding to the data, ornull
if no type could be found. The caller should free the caps returned with gst_caps_unref().
-
typeFindHelperForBufferWithCaps
public static Caps typeFindHelperForBufferWithCaps(@Nullable @Nullable GstObject obj, Buffer buf, Caps caps, @Nullable @Nullable Out<TypeFindProbability> prob) Tries to find if type of media contained in the givenGstBuffer
, matchescaps
specified, 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
null
if the content of thedata
could not be identified.Free-function: gst_caps_unref
- Parameters:
obj
- object doing the typefinding, ornull
(used for logging)buf
- aGstBuffer
with data to typefindcaps
- caps of the mediaprob
- location to store the probability of the found caps, ornull
- Returns:
- the
GstCaps
corresponding to the data, ornull
if no type could be found. The caller should free the caps returned with gst_caps_unref().
-
typeFindHelperForBufferWithExtension
public static Caps typeFindHelperForBufferWithExtension(@Nullable @Nullable GstObject obj, Buffer buf, @Nullable @Nullable String extension, @Nullable @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, ornull
if the content of the buffer could not be identified.When
extension
is 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
- aGstBuffer
with data to typefindextension
- extension of the media, ornull
prob
- location to store the probability of the found caps, ornull
- Returns:
- the
GstCaps
corresponding to the data, ornull
if no type could be found. The caller should free the caps returned with gst_caps_unref().
-
typeFindHelperForData
public static Caps typeFindHelperForData(@Nullable @Nullable GstObject obj, byte[] data, @Nullable @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, ornull
if the content ofdata
could 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
GstCaps
corresponding to the data, ornull
if no type could be found. The caller should free the caps returned with gst_caps_unref().
-
typeFindHelperForDataWithCaps
public static Caps typeFindHelperForDataWithCaps(@Nullable @Nullable GstObject obj, byte[] data, Caps caps, @Nullable @Nullable Out<TypeFindProbability> prob) Tries to find if type of media contained in the givendata
, matches thecaps
specified, 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
null
if the content of thedata
could 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
GstCaps
corresponding to the data, ornull
if no type could be found. The caller should free the caps returned with gst_caps_unref().
-
typeFindHelperForDataWithExtension
public static Caps typeFindHelperForDataWithExtension(@Nullable @Nullable GstObject obj, byte[] data, @Nullable @Nullable String extension, @Nullable @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, ornull
if the content ofdata
could not be identified.When
extension
is 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, ornull
prob
- location to store the probability of the found caps, ornull
- Returns:
- the
GstCaps
corresponding to the data, ornull
if no type could be found. The caller should free the caps returned with gst_caps_unref().
-
typeFindHelperForExtension
Tries to find the bestGstCaps
associated withextension
.All available typefinders will be checked against the extension in order of rank. The caps of the first typefinder that can handle
extension
will be returned.Free-function: gst_caps_unref
- Parameters:
obj
- object doing the typefinding, ornull
(used for logging)extension
- an extension- Returns:
- the
GstCaps
corresponding toextension
, ornull
if no type could be found. The caller should free the caps returned with gst_caps_unref().
-
typeFindHelperGetRange
public static Caps typeFindHelperGetRange(GstObject obj, @Nullable @Nullable GstObject parent, TypeFindHelperGetRangeFunction func, long size, @Nullable @Nullable String extension, @Nullable @Nullable Out<TypeFindProbability> prob) Utility function to do pull-based typefinding. Unlike gst_type_find_helper() however, this function will use the specified functionfunc
to 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
extension
is 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
- AGstObject
that will be passed as first argument tofunc
parent
- the parent ofobj
ornull
func
- A genericGstTypeFindHelperGetRangeFunction
that will be used to access data at random offsets when doing the typefindingsize
- The length in bytesextension
- extension of the media, ornull
prob
- location to store the probability of the found caps, ornull
- Returns:
- the
GstCaps
corresponding to the data stream. Returnsnull
if noGstCaps
matches the data stream.
-
typeFindHelperGetRangeFull
public static FlowReturn typeFindHelperGetRangeFull(GstObject obj, @Nullable @Nullable GstObject parent, TypeFindHelperGetRangeFunction func, long size, @Nullable @Nullable String extension, Out<Caps> caps, @Nullable @Nullable Out<TypeFindProbability> prob) Utility function to do pull-based typefinding. Unlike gst_type_find_helper() however, this function will use the specified functionfunc
to 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
extension
is notnull
, this function will first try the typefind functions for the given extension, which might speed up the typefinding in many cases.- Parameters:
obj
- AGstObject
that will be passed as first argument tofunc
parent
- the parent ofobj
ornull
func
- A genericGstTypeFindHelperGetRangeFunction
that will be used to access data at random offsets when doing the typefindingsize
- The length in bytesextension
- extension of the media, ornull
caps
- returned capsprob
- location to store the probability of the found caps, ornull
- Returns:
- the last
GstFlowReturn
from pulling a buffer orFlowReturn.OK
if typefinding was successful.
-
typeFindListFactoriesForCaps
public static List<TypeFindFactory> typeFindListFactoriesForCaps(@Nullable @Nullable GstObject obj, Caps caps) Tries to find the bestGstTypeFindFactory
associated withcaps
.The typefinder that can handle
caps
will 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
GstTypeFindFactory
corresponding tocaps
, ornull
if no typefinder could be found. Caller should free the returned list with g_list_free() and list elements with gst_object_unref().
-