Filter data exchange.
More...
|
GF_Err | gf_filter_pck_ref (GF_FilterPacket **pck) |
|
GF_FilterPacket * | gf_filter_pck_ref_ex (GF_FilterPacket *pck) |
|
void | gf_filter_pck_unref (GF_FilterPacket *pck) |
|
GF_Err | gf_filter_pck_ref_props (GF_FilterPacket **pck) |
|
GF_FilterPacket * | gf_filter_pck_new_alloc (GF_FilterPid *PID, u32 data_size, u8 **data) |
|
GF_FilterPacket * | gf_filter_pck_new_shared (GF_FilterPid *PID, const u8 *data, u32 data_size, gf_fsess_packet_destructor destruct) |
|
GF_FilterPacket * | gf_filter_pck_new_ref (GF_FilterPid *PID, u32 data_offset, u32 data_size, GF_FilterPacket *source_packet) |
|
GF_FilterPacket * | gf_filter_pck_new_ref_destructor (GF_FilterPid *PID, u32 data_offset, u32 data_size, GF_FilterPacket *source_packet, gf_fsess_packet_destructor destruct) |
|
GF_FilterPacket * | gf_filter_pck_new_alloc_destructor (GF_FilterPid *PID, u32 data_size, u8 **data, gf_fsess_packet_destructor destruct) |
|
GF_FilterPacket * | gf_filter_pck_new_clone (GF_FilterPid *PID, GF_FilterPacket *pck_source, u8 **data) |
|
GF_FilterPacket * | gf_filter_pck_new_copy (GF_FilterPid *PID, GF_FilterPacket *pck_source, u8 **data) |
|
GF_FilterPacket * | gf_filter_pck_dangling_copy (GF_FilterPacket *pck_source, GF_FilterPacket *cached_pck) |
|
GF_FilterPacket * | gf_filter_pck_dangling_clone (GF_FilterPacket *pck_source, GF_FilterPacket *cached_pck) |
|
GF_Err | gf_filter_pck_set_readonly (GF_FilterPacket *pck) |
|
void | gf_filter_pck_check_realloc (GF_FilterPacket *pck, u8 *data, u32 size) |
|
GF_Err | gf_filter_pck_send (GF_FilterPacket *pck) |
|
void | gf_filter_pck_discard (GF_FilterPacket *pck) |
|
GF_Err | gf_filter_pck_forward (GF_FilterPacket *reference, GF_FilterPid *PID) |
|
const u8 * | gf_filter_pck_get_data (GF_FilterPacket *pck, u32 *size) |
|
GF_Err | gf_filter_pck_set_property (GF_FilterPacket *pck, u32 prop_4cc, const GF_PropertyValue *value) |
|
GF_Err | gf_filter_pck_set_property_str (GF_FilterPacket *pck, const char *name, const GF_PropertyValue *value) |
|
GF_Err | gf_filter_pck_set_property_dyn (GF_FilterPacket *pck, char *name, const GF_PropertyValue *value) |
|
Bool | gf_filter_pck_has_properties (GF_FilterPacket *pck) |
|
GF_Err | gf_filter_pck_merge_properties (GF_FilterPacket *pck_src, GF_FilterPacket *pck_dst) |
|
GF_Err | gf_filter_pck_merge_properties_filter (GF_FilterPacket *pck_src, GF_FilterPacket *pck_dst, gf_filter_prop_filter filter_prop, void *cbk) |
|
const GF_PropertyValue * | gf_filter_pck_get_property (GF_FilterPacket *pck, u32 prop_4cc) |
|
const GF_PropertyValue * | gf_filter_pck_get_property_str (GF_FilterPacket *pck, const char *prop_name) |
|
const GF_PropertyValue * | gf_filter_pck_enum_properties (GF_FilterPacket *pck, u32 *idx, u32 *prop_4cc, const char **prop_name) |
|
GF_Err | gf_filter_pck_set_framing (GF_FilterPacket *pck, Bool is_start, Bool is_end) |
|
GF_Err | gf_filter_pck_get_framing (GF_FilterPacket *pck, Bool *is_start, Bool *is_end) |
|
GF_Err | gf_filter_pck_set_dts (GF_FilterPacket *pck, u64 dts) |
|
u64 | gf_filter_pck_get_dts (GF_FilterPacket *pck) |
|
GF_Err | gf_filter_pck_set_cts (GF_FilterPacket *pck, u64 cts) |
|
u64 | gf_filter_pck_get_cts (GF_FilterPacket *pck) |
|
u32 | gf_filter_pck_get_timescale (GF_FilterPacket *pck) |
|
GF_Err | gf_filter_pck_set_duration (GF_FilterPacket *pck, u32 duration) |
|
u32 | gf_filter_pck_get_duration (GF_FilterPacket *pck) |
|
GF_Err | gf_filter_pck_expand (GF_FilterPacket *pck, u32 nb_bytes_to_add, u8 **data_start, u8 **new_range_start, u32 *new_size) |
|
GF_Err | gf_filter_pck_truncate (GF_FilterPacket *pck, u32 size) |
|
GF_Err | gf_filter_pck_set_sap (GF_FilterPacket *pck, GF_FilterSAPType sap_type) |
|
GF_FilterSAPType | gf_filter_pck_get_sap (GF_FilterPacket *pck) |
|
GF_Err | gf_filter_pck_set_interlaced (GF_FilterPacket *pck, u32 is_interlaced) |
|
u32 | gf_filter_pck_get_interlaced (GF_FilterPacket *pck) |
|
GF_Err | gf_filter_pck_set_corrupted (GF_FilterPacket *pck, Bool is_corrupted) |
|
Bool | gf_filter_pck_get_corrupted (GF_FilterPacket *pck) |
|
GF_Err | gf_filter_pck_set_seek_flag (GF_FilterPacket *pck, Bool is_seek) |
|
Bool | gf_filter_pck_get_seek_flag (GF_FilterPacket *pck) |
|
GF_Err | gf_filter_pck_set_byte_offset (GF_FilterPacket *pck, u64 byte_offset) |
|
u64 | gf_filter_pck_get_byte_offset (GF_FilterPacket *pck) |
|
GF_Err | gf_filter_pck_set_roll_info (GF_FilterPacket *pck, s16 roll_count) |
|
s16 | gf_filter_pck_get_roll_info (GF_FilterPacket *pck) |
|
GF_Err | gf_filter_pck_set_crypt_flags (GF_FilterPacket *pck, u8 crypt_flag) |
|
u8 | gf_filter_pck_get_crypt_flags (GF_FilterPacket *pck) |
|
GF_Err | gf_filter_pck_set_clock_type (GF_FilterPacket *pck, GF_FilterClockType ctype) |
|
GF_FilterClockType | gf_filter_pid_get_clock_info (GF_FilterPid *PID, u64 *clock_val, u32 *timescale) |
|
GF_FilterClockType | gf_filter_pck_get_clock_type (GF_FilterPacket *pck) |
|
GF_Err | gf_filter_pck_set_carousel_version (GF_FilterPacket *pck, u8 version_number) |
|
u8 | gf_filter_pck_get_carousel_version (GF_FilterPacket *pck) |
|
GF_Err | gf_filter_pck_set_dependency_flags (GF_FilterPacket *pck, u8 dep_flags) |
|
u8 | gf_filter_pck_get_dependency_flags (GF_FilterPacket *pck) |
|
GF_Err | gf_filter_pck_set_seq_num (GF_FilterPacket *pck, u32 seq_num) |
|
u32 | gf_filter_pck_get_seq_num (GF_FilterPacket *pck) |
|
GF_FilterPacket * | gf_filter_pck_new_frame_interface (GF_FilterPid *PID, GF_FilterFrameInterface *frame_ifce, gf_fsess_packet_destructor destruct) |
|
GF_FilterFrameInterface * | gf_filter_pck_get_frame_interface (GF_FilterPacket *pck) |
|
Bool | gf_filter_pck_is_blocking_ref (GF_FilterPacket *pck) |
|
Packets consist in block of data or reference to such blocks, passed from the source to the sink only. Internally, a packet created by a filter (output packet) is different from an input packet to a filter (gf_filter_pid_get_packet) but the API has been designed to hide this, so that most packet functions can be called regardless of the input/output nature of the PID.
Packets have native attributes (timing, sap state, ...) but may also have any number of properties associated to them.
The generic design of the architecture is that each filter is free to decide how it handle PIDs and their packets. This implies that the filter session has no clue how an output packet relates to an input packet. Developpers must therefore manually copy packet properties that seem relevant, or more practically copy all properties from input packet to output packet and reassign output packet properties changed by the filter.
In order to handle reordering of packets, it is possible to keep references to either packets (may block the filter chain), or packet properties.
Packets shall always be dispatched in their processing order (decode order). If reordering upon reception is needed, or AU interleaving is used, a filter SHALL do the reordering. However, packets do not have to be sent in their creation order: a created packet is not assigned to PID buffers until it is sent.
◆ GF_FILTER_PCK_CRYPT
#define GF_FILTER_PCK_CRYPT 1 |
◆ GF_Matrix_unexposed
Redefinition of GF_Matrix but without the maths.h include which breaks VideoToolBox on OSX/iOS
◆ GF_FilterSAPType
SAP types as defined in annex I of ISOBMFF
Enumerator |
---|
GF_FILTER_SAP_NONE | no SAP
|
GF_FILTER_SAP_1 | closed gop no leading
|
GF_FILTER_SAP_2 | closed gop leading
|
GF_FILTER_SAP_3 | open gop
|
GF_FILTER_SAP_4 | roll period (GDR or audio roll) - roll distance must be indicated in packet
|
GF_FILTER_SAP_4_PROL | Audio preroll period - roll distance must be indicated in packet
|
◆ GF_FilterClockType
Packet clock reference types - used for MPEG-2 TS
Enumerator |
---|
GF_FILTER_CLOCK_NONE | packet is not a clock reference
|
GF_FILTER_CLOCK_PCR | packet is a PCR clock reference, expressed in PID timescale
|
GF_FILTER_CLOCK_PCR_DISC | packet is a PCR clock discontinuity, expressed in PID timescale
|
◆ anonymous enum
frame interface flags
Enumerator |
---|
GF_FRAME_IFCE_BLOCKING | When set , indicates that the emitting filter will block until this frame is released. Consumers of such a packet shall drop the packet as soon as possible, since it blocks the emiting filter.
|
GF_FRAME_IFCE_MAIN_GLFB | When set , indicates that the associated framebuffer is the main GL framebuffer.
|
◆ gf_filter_pck_ref()
Keeps a reference to the given input packet. The packet shall be released at some point using gf_filter_pck_unref
Filters keeping reference to packets should check if the packet is a blocking reference using gf_filter_pck_is_blocking_ref. If this is the case, the input chain will likely be blocked until the packet reference is released.
- Parameters
-
pck | the target input packet |
- Returns
- error if any
◆ gf_filter_pck_ref_ex()
Same as gf_filter_pck_ref but doesn't use pointer to packet
- Parameters
-
pck | the target input packet |
- Returns
- the new reference to the packet
◆ gf_filter_pck_unref()
Remove a reference to the given input packet. The packet might be destroyed after that call.
- Parameters
-
pck | the target input packet |
◆ gf_filter_pck_ref_props()
Creates a reference to the packet properties, but not to the data. This is mostly useful for encoders/decoders/filters with delay, where the input packet needs to be released before getting the corresponding output (frame reordering & co). This allows merging back packet properties after some delay without blocking the filter chain.
- Parameters
-
pck | the target input packet |
- Returns
- error if any
◆ gf_filter_pck_new_alloc()
Allocates a new packet on the output PID with associated allocated data. The packet has by default no DTS, no CTS, no duration framing set to full frame (start=end=1) and all other flags set to 0 (including SAP type).
- Parameters
-
PID | the target output PID |
data_size | the desired size of the packet - can be changed later |
data | set to the writable buffer of the created packet |
- Returns
- new packet or NULL if allocation error or not an output PID
◆ gf_filter_pck_new_shared()
Allocates a new packet on the output PID referencing internal data. The packet has by default no DTS, no CTS, no duration framing set to full frame (start=end=1) and all other flags set to 0 (including SAP type).
- Parameters
-
PID | the target output PID |
data | the data block to dispatch |
data_size | the size of the data block to dispatch |
destruct | the callback function used to destroy the packet when no longer used - may be NULL |
- Returns
- new packet or NULL if allocation error or not an output PID
◆ gf_filter_pck_new_ref()
Allocates a new packet on the output PID referencing data of some input packet. The packet has by default no DTS, no CTS, no duration framing set to full frame (start=end=1) and all other flags set to 0 (including SAP type).
- Parameters
-
PID | the target output PID |
data_offset | offset in the source data block |
data_size | the size of the data block to dispatch - if 0, the entire data of the source packet beginning at offset is used |
source_packet | the source packet this data belongs to (at least from the filter point of view). |
- Returns
- new packet or NULL if allocation error or not an output PID
◆ gf_filter_pck_new_ref_destructor()
Same as gf_filter_pck_new_ref with packet destructor callbacl
- Parameters
-
PID | the target output PID |
data_offset | offset in the source data block |
data_size | the size of the data block to dispatch - if 0, the entire data of the source packet beginning at offset is used |
source_packet | the source packet this data belongs to (at least from the filter point of view). |
destruct | the callback function used to destroy the packet when no longer used - may be NULL |
- Returns
- new packet or NULL if allocation error or not an output PID
◆ gf_filter_pck_new_alloc_destructor()
Allocates a new packet on the output PID with associated allocated data. The packet has by default no DTS, no CTS, no duration framing set to full frame (start=end=1) and all other flags set to 0 (including SAP type).
- Parameters
-
PID | the target output PID |
data_size | the desired size of the packet - can be changed later |
data | set to the writable buffer of the created packet |
destruct | the callback function used to destroy the packet when no longer used - may be NULL |
- Returns
- new packet or NULL if allocation error or not an output PID
◆ gf_filter_pck_new_clone()
Clones a new packet from a source packet and copy all source properties to output. If the source packet uses a frame interface object or has no associated data, returns a copy of the packet. If the source packet is referenced more than once (ie more than just the caller), a new packet on the output PID is allocated with source data copied. Otherwise, the source data is assigned to the output packet. This is typically called by filter wishing to perform in-place processing of input data.
- Parameters
-
PID | the target output PID |
pck_source | the desired source packet to clone |
data | set to the writable buffer of the created packet |
- Returns
- new packet or NULL if allocation error or not an output PID
◆ gf_filter_pck_new_copy()
Copies a new packet from a source packet and copy all source properties to output.
- Parameters
-
PID | the target output PID |
pck_source | the desired source packet to clone |
data | set to the writable buffer of the created packet |
- Returns
- new packet or NULL if allocation error or not an output PID
◆ gf_filter_pck_dangling_copy()
Creates a read-only detached copy of a packet from a source packet and copy all source properties to output.
If the source packet uses a frame interface object or has no associated data, returns a copy of the packet. If the source packet is referenced more than once (ie more than just the caller), a new packet on the output PID is allocated with source data copied. Otherwise, the source data is assigned to the output packet.
This is typically called by filters requiring read access to data for packets using frame interfaces.
- Parameters
-
pck_source | the target source packet |
cached_pck | if not NULL, will try to reuse this packet if possible (if not possible, this packet will be destroyed) |
- Returns
- new packet or NULL if allocation error or not an output PID
◆ gf_filter_pck_dangling_clone()
Creates a detached clone of a packet from a source packet and copy all source properties to output.
If the source packet uses a frame interface object or has no associated data, returns a copy of the packet. Otherwise, the source data is copied in the output packet.
This is typically called by filters reaggregating packets on their own.
- Parameters
-
pck_source | the target source packet |
cached_pck | if not NULL, will try to reuse this packet if possible (if not possible, this packet will be destroyed) |
- Returns
- new packet or NULL if allocation error or not an output PID
◆ gf_filter_pck_set_readonly()
Marks memory of a shared packet as non-writable. By default gf_filter_pck_new_shared and gf_filter_pck_new_ref allow write access to internal memory in case the packet can be cloned (single reference used). If your filter relies on the content of the shared memory for its internal state, packet must be marked as read-only to avoid later state corruption. Note that packets created with gf_filter_pck_new_frame_interface are always treated as read-only packets
- Parameters
-
pck | the target output packet to send |
- Returns
- error if any
◆ gf_filter_pck_check_realloc()
Checks if packet data has been reallocated
There are cases where memory allocated by gf_filter_pck_new_ref allow needs to be reallocated without using gf_filter_pck_expand . This function allows checking if the data has changed, and if so reassign the new block to the packet. If the data pointer was not changed, the packet data size is updated to the new size (acts as gf_filter_pck_truncate). The data shall have been reallocated with gf_realloc.
- Parameters
-
pck | the target packet to send |
data | the reallocated data pointer |
size | the reallocated data size |
◆ gf_filter_pck_send()
Sends the packet on its output PID. Packets SHALL be sent in processing order (eg, decoding order for video). However, packets don't have to be sent in their allocation order. Packet shall not be modified after this call, as it may be discarded during the call.
- Parameters
-
pck | the target output packet to send |
- Returns
- error if any
◆ gf_filter_pck_discard()
Destructs a packet allocated but that cannot be sent. Shall not be used on packet references.
- Parameters
-
pck | the target output packet to send |
◆ gf_filter_pck_forward()
◆ gf_filter_pck_get_data()
Gets data associated with the packet.
- Parameters
-
pck | the target packet |
size | set to the packet data size |
- Returns
- packet data if any, NULL if empty or if the packet uses a frame interface object. See gf_filter_pck_get_frame_interface
◆ gf_filter_pck_set_property()
Sets a built-in property of a packet
- Parameters
-
pck | the target packet |
prop_4cc | the code of the built-in property to set |
value | the property value to set |
- Returns
- error code if any
◆ gf_filter_pck_set_property_str()
GF_Err gf_filter_pck_set_property_str |
( |
GF_FilterPacket * |
pck, |
|
|
const char * |
name, |
|
|
const GF_PropertyValue * |
value |
|
) |
| |
Sets a property of a packet
- Parameters
-
pck | the target packet |
name | the name of the property to set |
value | the property value to set |
- Returns
- error code if any
◆ gf_filter_pck_set_property_dyn()
GF_Err gf_filter_pck_set_property_dyn |
( |
GF_FilterPacket * |
pck, |
|
|
char * |
name, |
|
|
const GF_PropertyValue * |
value |
|
) |
| |
Sets a property of a packet
- Parameters
-
pck | the target packet |
name | the code of the property to set. The name will be copied to the property, and memory destruction performed by the filter session |
value | the property value to set |
- Returns
- error code if any
◆ gf_filter_pck_has_properties()
Checks if a packet has properties other than packet built-in ones
This is typically needed to decide whether a packet with no data should be forwarded or not
- Parameters
-
- Returns
- GF_TRUE if packet has properties, GF_FALSE otherwise
◆ gf_filter_pck_merge_properties()
Merge properties of source packet into destination packet but does NOT reset destination packet properties
- Parameters
-
pck_src | source packet |
pck_dst | destination packet |
- Returns
- error code if any
◆ gf_filter_pck_merge_properties_filter()
Same as gf_filter_pck_merge_properties but uses a filter callback to select properties to merge
- Parameters
-
pck_src | source packet |
pck_dst | destination packet |
filter_prop | callback filtering function |
cbk | callback data passed to the callback function |
- Returns
- error code if any
◆ gf_filter_pck_get_property()
const GF_PropertyValue* gf_filter_pck_get_property |
( |
GF_FilterPacket * |
pck, |
|
|
u32 |
prop_4cc |
|
) |
| |
Gets built-in property of packet.
- Parameters
-
pck | target packet |
prop_4cc | the code of the built-in property |
- Returns
- the property if found, NULL otherwise
◆ gf_filter_pck_get_property_str()
const GF_PropertyValue* gf_filter_pck_get_property_str |
( |
GF_FilterPacket * |
pck, |
|
|
const char * |
prop_name |
|
) |
| |
Gets property of packet.
- Parameters
-
pck | target packet |
prop_name | the name of the property |
- Returns
- the property if found, NULL otherwise
◆ gf_filter_pck_enum_properties()
const GF_PropertyValue* gf_filter_pck_enum_properties |
( |
GF_FilterPacket * |
pck, |
|
|
u32 * |
idx, |
|
|
u32 * |
prop_4cc, |
|
|
const char ** |
prop_name |
|
) |
| |
Enumerates properties on packets.
- Parameters
-
pck | target packet |
idx | input/output index of the current property. 0 means first. Incremented by 1 upon success |
prop_4cc | set to the code of the built-in property |
prop_name | set to the name of the property |
- Returns
- the property if found, NULL otherwise
◆ gf_filter_pck_set_framing()
Sets packet framing info. A full frame is a complete entity for the stream type, ie an access unit for media streams and a complete file for file streams
- Parameters
-
pck | target packet |
is_start | packet is start of the frame |
is_end | packet is end of the frame |
- Returns
- error code if any
◆ gf_filter_pck_get_framing()
Gets packet framing info. A full frame is a complete entity for the stream type, ie an access unit for media streams and a complete file for file streams
- Parameters
-
pck | target packet |
is_start | set to GF_TRUE if packet is start of the frame, to GF_FALSE otherwise |
is_end | set to GF_TRUE if packet is end of the frame, to GF_FALSE otherwise |
- Returns
- error code if any
◆ gf_filter_pck_set_dts()
Sets Decoding Timestamp (DTS) of the packet. Do not set if unknown - automatic packet duration is based on DTS diff if DTS is present, otherwise in CTS diff.
- Parameters
-
pck | target packet |
dts | decoding timestamp of packet, in PID timescale units |
- Returns
- error code if any
◆ gf_filter_pck_get_dts()
Gets Decoding Timestamp (DTS) of the packet.
- Parameters
-
- Returns
- dts decoding timestamp of packet, in PID timescale units
◆ gf_filter_pck_set_cts()
Sets Composition Timestamp (CTS) of the packet. Do not set if unknown - automatic packet duration is based on DTS diff if DTS is present, otherwise in CTS diff.
- Parameters
-
pck | target packet |
cts | composition timestamp of packet, in PID timescale units |
- Returns
- error code if any
◆ gf_filter_pck_get_cts()
Gets Composition Timestamp (CTS) of the packet.
- Parameters
-
- Returns
- cts composition timestamp of packet, in PID timescale units
◆ gf_filter_pck_get_timescale()
Returns packet timescale (same as PID timescale)
- Parameters
-
- Returns
- packet timescale
◆ gf_filter_pck_set_duration()
Sets packet duration
- Parameters
-
pck | target packet |
duration | duration of packet, in PID timescale units |
- Returns
- error code if any
◆ gf_filter_pck_get_duration()
Gets packet duration
- Parameters
-
- Returns
- duration duration of packet, in PID timescale units
◆ gf_filter_pck_expand()
reallocates packet not yet sent. Returns data start and new range of data. This will reset byte offset information to not available.
- Parameters
-
pck | target packet |
nb_bytes_to_add | bytes to add to packet |
data_start | realloc pointer of packet data start - may be NULL if new_range_start is set |
new_range_start | pointer to new (apppended space) data - may be NULL if data_start is set |
new_size | full size of allocated block. - may be be NULL |
- Returns
- error code if any
◆ gf_filter_pck_truncate()
Truncates packet not yet sent to given size
- Parameters
-
pck | target packet |
size | new size to truncate to |
- Returns
- error code if any
◆ gf_filter_pck_set_sap()
Sets packet SAP type
- Parameters
-
pck | target packet |
sap_type | SAP type of the packet |
- Returns
- error code if any
◆ gf_filter_pck_get_sap()
Sets packet SAP type
- Parameters
-
- Returns
- sap_type SAP type of the packet
◆ gf_filter_pck_set_interlaced()
Sets packet video interlacing flag
- Parameters
-
pck | target packet |
is_interlaced | set to 0: not interlaced 1: top field first or contains only top field if packet not full frame 2: bottom field first or contains only bottom field. |
- Returns
- error code if any
◆ gf_filter_pck_get_interlaced()
◆ gf_filter_pck_set_corrupted()
Sets packet corrupted data flag
- Parameters
-
pck | target packet |
is_corrupted | indicates if data in packet is corrupted |
- Returns
- error code if any
◆ gf_filter_pck_get_corrupted()
Gets packet corrupted data flag
- Parameters
-
- Returns
- GF_TRUE if data in packet is corrupted
◆ gf_filter_pck_set_seek_flag()
Sets seek flag of packet. For PIDs of stream type FILE with GF_PROP_PID_DISABLE_PROGRESSIVE set, the seek flag set to GF_TRUE indicates that the packet is a PATCH packet, replacing bytes located at gf_filter_pck_get_byte_offset in file if the interlaced flag of the packet is not set, or inserting bytes located at gf_filter_pck_get_byte_offset in file if the interlaced flag of the packet is set. If the corrupted flag is set, this indicates the data will be replaced later on. A seek packet is not meant to be displayed but is needed for decoding.
- Note
- If a packet is partially skipped but completely decoded, it shall not be marked as seek but have the property "SkipBegin" set.
-
Raw audio packets MUST be split at the proper boundary
- Parameters
-
pck | target packet |
is_seek | indicates packet is seek frame |
- Returns
- error code if any
◆ gf_filter_pck_get_seek_flag()
Gets packet seek data flag
- Parameters
-
- Returns
- GF_TRUE if packet is a seek packet
◆ gf_filter_pck_set_byte_offset()
Sets packet byte offset in source. byte offset should only be set if the data in the packet is exactly the same as the one at the given byte offset
- Parameters
-
pck | target packet |
byte_offset | indicates the byte offset in the source. By default packets are created with no byte offset |
- Returns
- error code if any
◆ gf_filter_pck_get_byte_offset()
Sets packet byte offset in source
- Parameters
-
- Returns
- byte offset in the source
◆ gf_filter_pck_set_roll_info()
Sets packet roll info (number of packets to rewind/forward and decode to get a clean access point).
- Parameters
-
pck | target packet |
roll_count | indicates the roll distance of this packet - only used for SAP 4 for now |
- Returns
- error code if any
◆ gf_filter_pck_get_roll_info()
Gets packet roll info.
- Parameters
-
- Returns
- roll distance of this packet
-
error code if any
◆ gf_filter_pck_set_crypt_flags()
Sets packet crypt flags
- Parameters
-
pck | target packet |
crypt_flag | packet crypt flag |
- Returns
- error code if any
◆ gf_filter_pck_get_crypt_flags()
Gets packet crypt flags
- Parameters
-
- Returns
- packet crypt flag
◆ gf_filter_pck_set_clock_type()
Sets packet clock type
- Parameters
-
pck | target packet |
ctype | packet clock flag |
- Returns
- error code if any
◆ gf_filter_pid_get_clock_info()
Gets last clock type and clock value on PID. Always returns 0 if the source filter manages clock references internally cd gf_filter_pid_set_clock_mode.
- Parameters
-
PID | target PID to query for clock |
clock_val | last clock reference found |
timescale | last clock reference timescale |
- Returns
- ctype packet clock flag
◆ gf_filter_pck_get_clock_type()
Gets clock type of packet. Always returns 0 if the source filter does NOT manages clock references internally cd gf_filter_pid_set_clock_mode.
- Parameters
-
- Returns
- ctype packet clock flag
◆ gf_filter_pck_set_carousel_version()
Sets packet carousel info
- Parameters
-
pck | target packet |
version_number | carousel version number associated with this data chunk |
- Returns
- error code if any
◆ gf_filter_pck_get_carousel_version()
Gets packet carousel info
- Parameters
-
- Returns
- version_number carousel version number associated with this data chunk
◆ gf_filter_pck_set_dependency_flags()
Sets packet sample dependency flags.
Sample dependency flags have the same semantics as ISOBMFF:
bit(2)is_leading bit(2)sample_depends_on (2)sample_is_depended_on (2)sample_has_redundancy
is_leading takes one of the following four values:
0: the leading nature of this sample is unknown;
1: this sample is a leading sample that has a dependency before the referenced I-picture (and is therefore not decodable);
2: this sample is not a leading sample;
3: this sample is a leading sample that has no dependency before the referenced I-picture (and is therefore decodable);
sample_depends_on takes one of the following four values:
0: the dependency of this sample is unknown;
1: this sample does depend on others (not an I picture);
2: this sample does not depend on others (I picture);
3: reserved
sample_is_depended_on takes one of the following four values:
0: the dependency of other samples on this sample is unknown;
1: other samples may depend on this one (not disposable);
2: no other sample depends on this one (disposable);
3: reserved
sample_has_redundancy takes one of the following four values:
0: it is unknown whether there is redundant coding in this sample;
1: there is redundant coding in this sample;
2: there is no redundant coding in this sample;
3: reserved
- Parameters
-
pck | target packet |
dep_flags | sample dependency flags |
- Returns
- error code if any
◆ gf_filter_pck_get_dependency_flags()
◆ gf_filter_pck_set_seq_num()
Sets packet sequence number. Shall only be used when a filter handles a PLAY request based on packet sequence number
- Parameters
-
pck | target packet |
seq_num | sequence number of packet |
- Returns
- error code if any
◆ gf_filter_pck_get_seq_num()
Gets packet sequence number info
- Parameters
-
- Returns
- sequence number associated with this packet
◆ gf_filter_pck_new_frame_interface()
Allocates a new packet holding a reference to a frame interface object. The packet has by default no DTS, no CTS, no duration framing set to full frame (start=end=1) and all other flags set to 0 (including SAP type).
- Parameters
-
PID | the target output PID |
frame_ifce | the associated frame interface object |
destruct | the destructor to be called upon packet release |
- Returns
- new packet
◆ gf_filter_pck_get_frame_interface()
Gets a frame interface associated with a packet if any.
Consumers will typically first check if the packet has associated data using gf_filter_pck_get_data.
- Parameters
-
- Returns
- the associated frame interface object if any, or NULL otherwise
◆ gf_filter_pck_is_blocking_ref()
Checks if the packet is a blocking reference, i.e. a parent filter in the chain is waiting for its destruction to emit a new packet. This is typically used by sink filters to decide if they can hold references to input packets without blocking the chain.
- Parameters
-
- Returns
- GF_TRUE if the packet is blocking or is a reference to a blocking packet, GF_FALSE otherwise