Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- GstBase.type_find_helper(src, size)[source]¶
- Parameters:
- Returns:
the
Gst.Caps
corresponding to the data stream. ReturnsNone
if noGst.Caps
matches the data stream.- Return type:
Tries to find what type of data is flowing from the given source
Gst.Pad
.Free-function: gst_caps_unref
- GstBase.type_find_helper_for_buffer(obj, buf)[source]¶
- Parameters:
obj (
Gst.Object
orNone
) – object doing the typefinding, orNone
(used for logging)buf (
Gst.Buffer
) – aGst.Buffer
with data to typefind
- Returns:
the
Gst.Caps
corresponding to the data, orNone
if no type could be found. The caller should free the caps returned with gst_caps_unref().- prob:
location to store the probability of the found caps, or
None
- Return type:
(
Gst.Caps
orNone
, prob:Gst.TypeFindProbability
)
Tries to find what type of data is contained in the given
Gst.Buffer
, 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
Gst.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, orNone
if the content of the buffer could not be identified.Free-function: gst_caps_unref
- GstBase.type_find_helper_for_buffer_with_caps(obj, buf, caps)[source]¶
- Parameters:
obj (
Gst.Object
orNone
) – object doing the typefinding, orNone
(used for logging)buf (
Gst.Buffer
) – aGst.Buffer
with data to typefindcaps (
Gst.Caps
) – caps of the media
- Returns:
the
Gst.Caps
corresponding to the data, orNone
if no type could be found. The caller should free the caps returned with gst_caps_unref().- prob:
location to store the probability of the found caps, or
None
- Return type:
(
Gst.Caps
orNone
, prob:Gst.TypeFindProbability
)
Tries to find if type of media contained in the given
Gst.Buffer
, matches caps 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
None
if the content of the data could not be identified.Free-function: gst_caps_unref
New in version 1.22.
- GstBase.type_find_helper_for_buffer_with_extension(obj, buf, extension)[source]¶
- Parameters:
obj (
Gst.Object
orNone
) – object doing the typefinding, orNone
(used for logging)buf (
Gst.Buffer
) – aGst.Buffer
with data to typefind
- Returns:
the
Gst.Caps
corresponding to the data, orNone
if no type could be found. The caller should free the caps returned with gst_caps_unref().- prob:
location to store the probability of the found caps, or
None
- Return type:
(
Gst.Caps
orNone
, prob:Gst.TypeFindProbability
)
Tries to find what type of data is contained in the given
Gst.Buffer
, 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
Gst.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, orNone
if the content of the buffer could not be identified.When extension is not
None
, 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
New in version 1.16.
- GstBase.type_find_helper_for_data(obj, data)[source]¶
- Parameters:
obj (
Gst.Object
orNone
) – object doing the typefinding, orNone
(used for logging)data (
bytes
) –a pointer with data to typefind
- Returns:
the
Gst.Caps
corresponding to the data, orNone
if no type could be found. The caller should free the caps returned with gst_caps_unref().- prob:
location to store the probability of the found caps, or
None
- Return type:
(
Gst.Caps
orNone
, prob:Gst.TypeFindProbability
)
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.
All available typefinders will be called on the data in order of rank. If a typefinding function returns a probability of
Gst.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, orNone
if the content of data could not be identified.Free-function: gst_caps_unref
- GstBase.type_find_helper_for_data_with_caps(obj, data, caps)[source]¶
- Parameters:
obj (
Gst.Object
orNone
) – object doing the typefinding, orNone
(used for logging)data (
bytes
) – a pointer with data to typefindcaps (
Gst.Caps
) – caps of the media
- Returns:
the
Gst.Caps
corresponding to the data, orNone
if no type could be found. The caller should free the caps returned with gst_caps_unref().- prob:
location to store the probability of the found caps, or
None
- Return type:
(
Gst.Caps
orNone
, prob:Gst.TypeFindProbability
)
Tries to find if type of media contained in the given data, matches the caps 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
None
if the content of the data could not be identified.Free-function: gst_caps_unref
New in version 1.22.
- GstBase.type_find_helper_for_data_with_extension(obj, data, extension)[source]¶
- Parameters:
- Returns:
the
Gst.Caps
corresponding to the data, orNone
if no type could be found. The caller should free the caps returned with gst_caps_unref().- prob:
location to store the probability of the found caps, or
None
- Return type:
(
Gst.Caps
orNone
, prob:Gst.TypeFindProbability
)
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.
All available typefinders will be called on the data in order of rank. If a typefinding function returns a probability of
Gst.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, orNone
if the content of data could not be identified.When extension is not
None
, 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
New in version 1.16.
- GstBase.type_find_helper_for_extension(obj, extension)[source]¶
- Parameters:
obj (
Gst.Object
orNone
) – object doing the typefinding, orNone
(used for logging)extension (
str
) – an extension
- Returns:
the
Gst.Caps
corresponding to extension, orNone
if no type could be found. The caller should free the caps returned with gst_caps_unref().- Return type:
Tries to find the best
Gst.Caps
associated with extension.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
- GstBase.type_find_helper_get_range(obj, parent, func, size, extension)[source]¶
- Parameters:
obj (
Gst.Object
) – AGst.Object
that will be passed as first argument to funcparent (
Gst.Object
orNone
) – the parent of obj orNone
func (
GstBase.TypeFindHelperGetRangeFunction
) – A genericGstBase.TypeFindHelperGetRangeFunction
that will be used to access data at random offsets when doing the typefindingsize (
int
) – The length in bytes
- Returns:
the
Gst.Caps
corresponding to the data stream. ReturnsNone
if noGst.Caps
matches the data stream.- prob:
location to store the probability of the found caps, or
None
- Return type:
(
Gst.Caps
orNone
, prob:Gst.TypeFindProbability
)
Utility function to do pull-based typefinding. Unlike
GstBase.type_find_helper
() however, this function will use the specified function func 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 not
None
, 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
- GstBase.type_find_helper_get_range_full(obj, parent, func, size, extension)[source]¶
- Parameters:
obj (
Gst.Object
) – AGst.Object
that will be passed as first argument to funcparent (
Gst.Object
orNone
) – the parent of obj orNone
func (
GstBase.TypeFindHelperGetRangeFunction
) – A genericGstBase.TypeFindHelperGetRangeFunction
that will be used to access data at random offsets when doing the typefindingsize (
int
) – The length in bytes
- Returns:
the last
Gst.FlowReturn
from pulling a buffer orGst.FlowReturn.OK
if typefinding was successful.- caps:
returned caps
- prob:
location to store the probability of the found caps, or
None
- Return type:
(
Gst.FlowReturn
, caps:Gst.Caps
, prob:Gst.TypeFindProbability
)
Utility function to do pull-based typefinding. Unlike
GstBase.type_find_helper
() however, this function will use the specified function func 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 not
None
, this function will first try the typefind functions for the given extension, which might speed up the typefinding in many cases.New in version 1.14.3.
- GstBase.type_find_list_factories_for_caps(obj, caps)[source]¶
- Parameters:
obj (
Gst.Object
orNone
) – object doing the typefinding, orNone
(used for logging)caps (
Gst.Caps
) – caps of the media
- Returns:
the list of
Gst.TypeFindFactory
corresponding to caps, orNone
if no typefinder could be found. Caller should free the returned list with g_list_free() and list elements withGst.Object.unref
().- Return type:
[
Gst.TypeFindFactory
] orNone
Tries to find the best
Gst.TypeFindFactory
associated with caps.The typefinder that can handle caps will be returned.
Free-function: g_list_free
New in version 1.22.