libgpac
Documentation of the core library of GPAC
|
Filter data exchange. More...
Data Structures | |
struct | GF_FilterFrameInterface |
Macros | |
#define | GF_FILTER_PCK_CRYPT 1 |
Typedefs | |
typedef struct __matrix | GF_Matrix_unexposed |
Enumerations | |
enum | GF_FilterSAPType { GF_FILTER_SAP_NONE = 0 , GF_FILTER_SAP_1 , GF_FILTER_SAP_2 , GF_FILTER_SAP_3 , GF_FILTER_SAP_4 , GF_FILTER_SAP_4_PROL } |
enum | GF_FilterClockType { GF_FILTER_CLOCK_NONE =0 , GF_FILTER_CLOCK_PCR , GF_FILTER_CLOCK_PCR_DISC } |
enum | { GF_FRAME_IFCE_BLOCKING = 1 , GF_FRAME_IFCE_MAIN_GLFB = 1<<1 } |
Functions | |
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.
#define GF_FILTER_PCK_CRYPT 1 |
Crypt flags for packet
typedef struct __matrix GF_Matrix_unexposed |
enum GF_FilterSAPType |
SAP types as defined in annex I of ISOBMFF
enum GF_FilterClockType |
anonymous enum |
frame interface flags
GF_Err gf_filter_pck_ref | ( | GF_FilterPacket ** | pck | ) |
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.
pck | the target input packet |
GF_FilterPacket* gf_filter_pck_ref_ex | ( | GF_FilterPacket * | pck | ) |
Same as gf_filter_pck_ref but doesn't use pointer to packet
pck | the target input packet |
void gf_filter_pck_unref | ( | GF_FilterPacket * | pck | ) |
Remove a reference to the given input packet. The packet might be destroyed after that call.
pck | the target input packet |
GF_Err gf_filter_pck_ref_props | ( | GF_FilterPacket ** | pck | ) |
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.
pck | the target input packet |
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).
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 |
GF_FilterPacket* gf_filter_pck_new_shared | ( | GF_FilterPid * | PID, |
const u8 * | data, | ||
u32 | data_size, | ||
gf_fsess_packet_destructor | destruct | ||
) |
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).
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 |
GF_FilterPacket* gf_filter_pck_new_ref | ( | GF_FilterPid * | PID, |
u32 | data_offset, | ||
u32 | data_size, | ||
GF_FilterPacket * | source_packet | ||
) |
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).
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). |
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 | ||
) |
Same as gf_filter_pck_new_ref with packet destructor callbacl
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 |
GF_FilterPacket* gf_filter_pck_new_alloc_destructor | ( | GF_FilterPid * | PID, |
u32 | data_size, | ||
u8 ** | data, | ||
gf_fsess_packet_destructor | destruct | ||
) |
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).
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 |
GF_FilterPacket* gf_filter_pck_new_clone | ( | GF_FilterPid * | PID, |
GF_FilterPacket * | pck_source, | ||
u8 ** | data | ||
) |
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.
PID | the target output PID |
pck_source | the desired source packet to clone |
data | set to the writable buffer of the created packet |
GF_FilterPacket* gf_filter_pck_new_copy | ( | GF_FilterPid * | PID, |
GF_FilterPacket * | pck_source, | ||
u8 ** | data | ||
) |
Copies a new packet from a source packet and copy all source properties to output.
PID | the target output PID |
pck_source | the desired source packet to clone |
data | set to the writable buffer of the created packet |
GF_FilterPacket* gf_filter_pck_dangling_copy | ( | GF_FilterPacket * | pck_source, |
GF_FilterPacket * | cached_pck | ||
) |
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.
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) |
GF_FilterPacket* gf_filter_pck_dangling_clone | ( | GF_FilterPacket * | pck_source, |
GF_FilterPacket * | cached_pck | ||
) |
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.
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) |
GF_Err gf_filter_pck_set_readonly | ( | GF_FilterPacket * | pck | ) |
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
pck | the target output packet to send |
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.
pck | the target packet to send |
data | the reallocated data pointer |
size | the reallocated data size |
GF_Err gf_filter_pck_send | ( | GF_FilterPacket * | pck | ) |
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.
pck | the target output packet to send |
void gf_filter_pck_discard | ( | GF_FilterPacket * | pck | ) |
Destructs a packet allocated but that cannot be sent. Shall not be used on packet references.
pck | the target output packet to send |
GF_Err gf_filter_pck_forward | ( | GF_FilterPacket * | reference, |
GF_FilterPid * | PID | ||
) |
Destructs a packet allocated but that cannot be sent. Shall not be used on packet references. This is a shortcut to gf_filter_pck_new_ref + gf_filter_pck_merge_properties + gf_filter_pck_send
reference | the input packet to forward |
PID | the output PID to forward to |
Gets data associated with the packet.
pck | the target packet |
size | set to the packet data size |
GF_Err gf_filter_pck_set_property | ( | GF_FilterPacket * | pck, |
u32 | prop_4cc, | ||
const GF_PropertyValue * | value | ||
) |
Sets a built-in property of a packet
pck | the target packet |
prop_4cc | the code of the built-in property to set |
value | the property value to set |
GF_Err gf_filter_pck_set_property_str | ( | GF_FilterPacket * | pck, |
const char * | name, | ||
const GF_PropertyValue * | value | ||
) |
Sets a property of a packet
pck | the target packet |
name | the name of the property to set |
value | the property value to set |
GF_Err gf_filter_pck_set_property_dyn | ( | GF_FilterPacket * | pck, |
char * | name, | ||
const GF_PropertyValue * | value | ||
) |
Sets a property of a packet
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 |
Bool gf_filter_pck_has_properties | ( | GF_FilterPacket * | pck | ) |
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
pck | the target packet |
GF_Err gf_filter_pck_merge_properties | ( | GF_FilterPacket * | pck_src, |
GF_FilterPacket * | pck_dst | ||
) |
Merge properties of source packet into destination packet but does NOT reset destination packet properties
pck_src | source packet |
pck_dst | destination packet |
GF_Err gf_filter_pck_merge_properties_filter | ( | GF_FilterPacket * | pck_src, |
GF_FilterPacket * | pck_dst, | ||
gf_filter_prop_filter | filter_prop, | ||
void * | cbk | ||
) |
Same as gf_filter_pck_merge_properties but uses a filter callback to select properties to merge
pck_src | source packet |
pck_dst | destination packet |
filter_prop | callback filtering function |
cbk | callback data passed to the callback function |
const GF_PropertyValue* gf_filter_pck_get_property | ( | GF_FilterPacket * | pck, |
u32 | prop_4cc | ||
) |
Gets built-in property of packet.
pck | target packet |
prop_4cc | the code of the built-in property |
const GF_PropertyValue* gf_filter_pck_get_property_str | ( | GF_FilterPacket * | pck, |
const char * | prop_name | ||
) |
Gets property of packet.
pck | target packet |
prop_name | the name of the property |
const GF_PropertyValue* gf_filter_pck_enum_properties | ( | GF_FilterPacket * | pck, |
u32 * | idx, | ||
u32 * | prop_4cc, | ||
const char ** | prop_name | ||
) |
Enumerates properties on packets.
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 |
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
pck | target packet |
is_start | packet is start of the frame |
is_end | packet is end of the frame |
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
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 |
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.
pck | target packet |
dts | decoding timestamp of packet, in PID timescale units |
u64 gf_filter_pck_get_dts | ( | GF_FilterPacket * | pck | ) |
Gets Decoding Timestamp (DTS) of the packet.
pck | target packet |
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.
pck | target packet |
cts | composition timestamp of packet, in PID timescale units |
u64 gf_filter_pck_get_cts | ( | GF_FilterPacket * | pck | ) |
Gets Composition Timestamp (CTS) of the packet.
pck | target packet |
u32 gf_filter_pck_get_timescale | ( | GF_FilterPacket * | pck | ) |
Returns packet timescale (same as PID timescale)
pck | target packet |
Sets packet duration
pck | target packet |
duration | duration of packet, in PID timescale units |
u32 gf_filter_pck_get_duration | ( | GF_FilterPacket * | pck | ) |
Gets packet duration
pck | target packet |
GF_Err gf_filter_pck_expand | ( | GF_FilterPacket * | pck, |
u32 | nb_bytes_to_add, | ||
u8 ** | data_start, | ||
u8 ** | new_range_start, | ||
u32 * | new_size | ||
) |
reallocates packet not yet sent. Returns data start and new range of data. This will reset byte offset information to not available.
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 |
Truncates packet not yet sent to given size
pck | target packet |
size | new size to truncate to |
GF_Err gf_filter_pck_set_sap | ( | GF_FilterPacket * | pck, |
GF_FilterSAPType | sap_type | ||
) |
Sets packet SAP type
pck | target packet |
sap_type | SAP type of the packet |
GF_FilterSAPType gf_filter_pck_get_sap | ( | GF_FilterPacket * | pck | ) |
Sets packet SAP type
pck | target packet |
Sets packet video interlacing flag
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. |
u32 gf_filter_pck_get_interlaced | ( | GF_FilterPacket * | pck | ) |
Gets packet video interlacing flag
pck | target packet |
Sets packet corrupted data flag
pck | target packet |
is_corrupted | indicates if data in packet is corrupted |
Bool gf_filter_pck_get_corrupted | ( | GF_FilterPacket * | pck | ) |
Gets packet corrupted data flag
pck | target packet |
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.
pck | target packet |
is_seek | indicates packet is seek frame |
Bool gf_filter_pck_get_seek_flag | ( | GF_FilterPacket * | pck | ) |
Gets packet seek data flag
pck | target packet |
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
pck | target packet |
byte_offset | indicates the byte offset in the source. By default packets are created with no byte offset |
u64 gf_filter_pck_get_byte_offset | ( | GF_FilterPacket * | pck | ) |
Sets packet byte offset in source
pck | target packet |
Sets packet roll info (number of packets to rewind/forward and decode to get a clean access point).
pck | target packet |
roll_count | indicates the roll distance of this packet - only used for SAP 4 for now |
s16 gf_filter_pck_get_roll_info | ( | GF_FilterPacket * | pck | ) |
Gets packet roll info.
pck | target packet |
Sets packet crypt flags
pck | target packet |
crypt_flag | packet crypt flag |
u8 gf_filter_pck_get_crypt_flags | ( | GF_FilterPacket * | pck | ) |
Gets packet crypt flags
pck | target packet |
GF_Err gf_filter_pck_set_clock_type | ( | GF_FilterPacket * | pck, |
GF_FilterClockType | ctype | ||
) |
Sets packet clock type
pck | target packet |
ctype | packet clock flag |
GF_FilterClockType gf_filter_pid_get_clock_info | ( | GF_FilterPid * | PID, |
u64 * | clock_val, | ||
u32 * | timescale | ||
) |
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.
PID | target PID to query for clock |
clock_val | last clock reference found |
timescale | last clock reference timescale |
GF_FilterClockType gf_filter_pck_get_clock_type | ( | GF_FilterPacket * | pck | ) |
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.
pck | target packet |
Sets packet carousel info
pck | target packet |
version_number | carousel version number associated with this data chunk |
u8 gf_filter_pck_get_carousel_version | ( | GF_FilterPacket * | pck | ) |
Gets packet carousel info
pck | target packet |
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
pck | target packet |
dep_flags | sample dependency flags |
u8 gf_filter_pck_get_dependency_flags | ( | GF_FilterPacket * | pck | ) |
Gets packet sample dependency flags.
pck | target packet |
Sets packet sequence number. Shall only be used when a filter handles a PLAY request based on packet sequence number
pck | target packet |
seq_num | sequence number of packet |
u32 gf_filter_pck_get_seq_num | ( | GF_FilterPacket * | pck | ) |
Gets packet sequence number info
pck | target packet |
GF_FilterPacket* gf_filter_pck_new_frame_interface | ( | GF_FilterPid * | PID, |
GF_FilterFrameInterface * | frame_ifce, | ||
gf_fsess_packet_destructor | destruct | ||
) |
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).
PID | the target output PID |
frame_ifce | the associated frame interface object |
destruct | the destructor to be called upon packet release |
GF_FilterFrameInterface* gf_filter_pck_get_frame_interface | ( | GF_FilterPacket * | pck | ) |
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.
pck | the target packet |
Bool gf_filter_pck_is_blocking_ref | ( | GF_FilterPacket * | pck | ) |
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.
pck | the target packet |