libgpac
Documentation of the core library of GPAC
_FilterPacket Interface Reference

import"nodejs.idl";

Public Member Functions

void enum_props (function callback_obj)
 
PropertyValue get_prop (DOMString prop_name)
 
void ref ()
 
void unref ()
 
void discard ()
 
_FilterPacket clone (_FilterPacket cached_pck=null)
 
void readonly ()
 
void send ()
 
void copy_props (_FilterPacket ipck)
 
void set_prop (DOMString pcode, PropertyValue prop, unsigned long custom_type=0)
 
void truncate (unsigned long size)
 

Data Fields

attribute unsigned long long dts
 
attribute unsigned long long cts
 
attribute unsigned long sap
 
attribute unsigned long dur
 
attribute unsigned long size
 
attribute ArrayBuffer data
 
attribute boolean start
 
attribute boolean end
 
attribute unsigned long timescale
 
attribute unsigned long interlaced
 
attribute boolean corrupted
 
attribute boolean seek
 
attribute unsigned long long byte_offset
 
attribute long roll
 
attribute unsigned long crypt
 
attribute unsigned long clock
 
attribute unsigned long carousel
 
attribute unsigned long seqnum
 
attribute unsigned long deps
 
attribute readonly boolean frame_ifce
 
attribute readonly boolean blocking_ref
 

Detailed Description

filter packet for custom filters

Unless specified, properties are all read-only for input packets, and read/write for output packets.

Member Function Documentation

◆ enum_props()

void _FilterPacket::enum_props ( function  callback_obj)

enumerate an packet properties

Parameters
callback_objcallback object to use, must have a 'on_prop_enum' method defined taking three parameters, prop_name (string), propval (PropertyValue) and ptype (int, GPAC property data type)

◆ get_prop()

PropertyValue _FilterPacket::get_prop ( DOMString  prop_name)

get a packet property - see gf_filter_pck_get_property and gf_filter_pck_get_property_str

Parameters
prop_namename of property to get
Returns
property value, or None if not found

◆ ref()

void _FilterPacket::ref ( )

increase packet reference count - see gf_filter_pck_ref_ex

◆ unref()

void _FilterPacket::unref ( )

decrease packet reference count - see gf_filter_pck_unref

◆ discard()

void _FilterPacket::discard ( )

discard an output packet instead of sending it - see gf_filter_pck_discard

◆ clone()

_FilterPacket _FilterPacket::clone ( _FilterPacket  cached_pck = null)

creates a new packet cloning a source packet - see gf_filter_pck_dangling_copy. 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()

void _FilterPacket::readonly ( )

mark an output packet as readonly - see gf_filter_pck_set_readonly

◆ send()

void _FilterPacket::send ( )

send the packet - see gf_filter_pck_send

◆ copy_props()

void _FilterPacket::copy_props ( _FilterPacket  ipck)

copy properties of source packet in this packet - see gf_filter_pck_merge_properties

Parameters
ipcksource packet

◆ set_prop()

void _FilterPacket::set_prop ( DOMString  pcode,
PropertyValue  prop,
unsigned long  custom_type = 0 
)

set property in this packet - see gf_filter_pck_set_property and gf_filter_pck_set_property_str

Parameters
pcodename of property
propproperty value to set, or null to remove property
custom_typetype of property if user-defined property. If not set and user-defined, property is a string

◆ truncate()

void _FilterPacket::truncate ( unsigned long  size)

truncates an output packet to the given size - see gf_filter_pck_truncate

Parameters
sizenew size of packet

Field Documentation

◆ dts

attribute unsigned long long _FilterPacket::dts

Decode Timestamp, or null not set - see gf_filter_pck_get_dts and gf_filter_pck_set_dts

◆ cts

attribute unsigned long long _FilterPacket::cts

Compose Timestamp or null if not set - see gf_filter_pck_get_cts and gf_filter_pck_set_cts

◆ sap

attribute unsigned long _FilterPacket::sap

◆ dur

attribute unsigned long _FilterPacket::dur

◆ size

attribute unsigned long _FilterPacket::size

Size of packet data, readonly

◆ data

attribute ArrayBuffer _FilterPacket::data

Packet data - see gf_filter_pck_get_data The property MUST be treated as readonly (shall not be set). For non-refs output packets, content of the array buffer can be modified

Warning
The array buffer is not tracked and is live to avoid doing a memory copy. This means you SHALL NOT access this ArrayBuffer once the packet is discarded (drop without ref, final unref, send)

◆ start

attribute boolean _FilterPacket::start

◆ end

attribute boolean _FilterPacket::end

◆ timescale

attribute unsigned long _FilterPacket::timescale

associated timescale, readonly - see gf_filter_pck_get_timescale

◆ interlaced

attribute unsigned long _FilterPacket::interlaced

◆ corrupted

attribute boolean _FilterPacket::corrupted

◆ seek

attribute boolean _FilterPacket::seek

◆ byte_offset

attribute unsigned long long _FilterPacket::byte_offset

Byte offset or null if not set - see gf_filter_pck_get_byte_offset and gf_filter_pck_set_byte_offset

◆ roll

attribute long _FilterPacket::roll

◆ crypt

attribute unsigned long _FilterPacket::crypt

◆ clock

attribute unsigned long _FilterPacket::clock

◆ carousel

attribute unsigned long _FilterPacket::carousel

◆ seqnum

attribute unsigned long _FilterPacket::seqnum

◆ deps

attribute unsigned long _FilterPacket::deps

◆ frame_ifce

attribute readonly boolean _FilterPacket::frame_ifce

true if packet holds a GF_FrameInterface object and not a data packet - always readonly

◆ blocking_ref

attribute readonly boolean _FilterPacket::blocking_ref

true if packet is a blocking reference - see gf_filter_pck_is_blocking_ref - always readonly