libgpac
Documentation of the core library of GPAC
python.libgpac.libgpac.FilterPacket Class Reference

filter packet object

Public Member Functions

def enum_props (self, callback_obj)
 enumerate an packet properties More...
 
def get_prop (self, prop_name)
 get a packet property - see gf_filter_pck_get_property and gf_filter_pck_get_property_str More...
 
def ref (self)
 increase packet reference count - see gf_filter_pck_ref_ex More...
 
def unref (self)
 decrease packet reference count - see gf_filter_pck_unref More...
 
def discard (self)
 discard an output packet instead of sending it - see gf_filter_pck_discard More...
 
def clone (self, cached_pck=None)
 creates a new packet cloning a source packet - see gf_filter_pck_dangling_copy. More...
 
def readonly (self)
 mark an output packet as readonly - see gf_filter_pck_set_readonly More...
 
def send (self)
 send the packet - see gf_filter_pck_send More...
 
def copy_props (self, ipck)
 copy properties of source packet in this packet - see gf_filter_pck_merge_properties More...
 
def set_prop (self, pcode, prop, custom_type=0)
 set property in this packet - see gf_filter_pck_set_property and gf_filter_pck_set_property_str More...
 
def truncate (self, size)
 truncates an output packet to the given size - see gf_filter_pck_truncate More...
 

Static Public Attributes

 dts
 Decode Timestamp - see gf_filter_pck_get_dts and gf_filter_pck_set_dts.
 
 cts
 Compose Timestamp - see gf_filter_pck_get_cts and gf_filter_pck_set_cts.
 
 sap
 SAP type - see gf_filter_pck_get_sap and gf_filter_pck_set_sap.
 
 dur
 Duration - see gf_filter_pck_get_duration and gf_filter_pck_set_duration.
 
 size
 Size of packet data, readonly.
 
 data
 Packet data - see gf_filter_pck_get_data If NumPy is available, the data is returned as a np Array, otherwise it is a POINTER(c_ubyte) object The property is readonly (cannot be set) but content can be modified for non-refs output packets.
 
 start
 frame start - see gf_filter_pck_get_framing and gf_filter_pck_set_framing
 
 end
 frame end - see gf_filter_pck_get_framing and gf_filter_pck_set_framing
 
 timescale
 associated timescale, readonly - see gf_filter_pck_get_timescale
 
 interlaced
 Interlaced flags - see gf_filter_pck_get_interlaced and gf_filter_pck_set_interlaced.
 
 corrupted
 Corrupted flag - see gf_filter_pck_get_corrupted and gf_filter_pck_set_corrupted.
 
 seek
 Seek flag - see gf_filter_pck_get_seek_flag and gf_filter_pck_set_seek_flag.
 
 byte_offset
 Byte offset - see gf_filter_pck_get_byte_offset and gf_filter_pck_set_byte_offset.
 
 roll
 Roll info - see gf_filter_pck_get_roll_info and gf_filter_pck_set_roll_info.
 
 crypt
 Encryption flags - see gf_filter_pck_get_crypt_flags and gf_filter_pck_set_crypt_flags.
 
 clock
 Clock reference flag - see gf_filter_pck_get_clock_type and gf_filter_pck_set_clock_type.
 
 carousel
 Carousel version - see gf_filter_pck_get_carousel_version and gf_filter_pck_set_carousel_version.
 
 seqnum
 Sequence number - see gf_filter_pck_get_seq_num and gf_filter_pck_set_seq_num.
 
 deps
 Dependency flags - see gf_filter_pck_get_dependency_flags and gf_filter_pck_set_dependency_flags.
 
 frame_ifce
 true if packet holds a GF_FrameInterface object and not a data packet, readonly
 
 has_properties
 Custom properties present, readonly - see gf_filter_pck_has_properties.
 
 blocking_ref
 true if packet is a blocking reference, readonly - see gf_filter_pck_is_blocking_ref
 

Member Function Documentation

◆ enum_props()

def python.libgpac.libgpac.FilterPacket.enum_props (   self,
  callback_obj 
)
Parameters
callback_objcallback object to use, must have a 'on_prop_enum' method defined taking two parameters, prop_name(string) and propval
Returns

◆ get_prop()

def python.libgpac.libgpac.FilterPacket.get_prop (   self,
  prop_name 
)
Parameters
prop_namename of property to get
Returns
property value, or None if not found

◆ ref()

def python.libgpac.libgpac.FilterPacket.ref (   self)
Returns

◆ unref()

def python.libgpac.libgpac.FilterPacket.unref (   self)
Returns

◆ discard()

def python.libgpac.libgpac.FilterPacket.discard (   self)
Returns

◆ clone()

def python.libgpac.libgpac.FilterPacket.clone (   self,
  cached_pck = None 
)

The resulting packet is read/write mode and may have its own memory allocated. This is typically used by sink filters wishing to access underling GPU data of a packet using frame interface. the resulting packet can be explicitly discarded using discard, otherwise will be garrbage collected.

Parameters
cached_pckif set, will be reuse for creation of new packet. This can greatly reduce memory allocations
Returns
the new FilterPacket or None if failure or None if failure ( if grabbing the frame into a local copy failed)

◆ readonly()

def python.libgpac.libgpac.FilterPacket.readonly (   self)
Returns

◆ send()

def python.libgpac.libgpac.FilterPacket.send (   self)
Returns

◆ copy_props()

def python.libgpac.libgpac.FilterPacket.copy_props (   self,
  ipck 
)
Parameters
ipcksource packet
Returns
+ Here is the call graph for this function:

◆ set_prop()

def python.libgpac.libgpac.FilterPacket.set_prop (   self,
  pcode,
  prop,
  custom_type = 0 
)
Parameters
pcodename of property
propproperty value
custom_typetype of property if user-defined property. If not set and user-defined, property is a string
Returns

◆ truncate()

def python.libgpac.libgpac.FilterPacket.truncate (   self,
  size 
)
Parameters
sizenew size of packet
Returns