libgpac
Documentation of the core library of GPAC
FilterPacket Interface Reference

import"jsf.idl";

Public Member Functions

void set_readonly ()
 
Object enum_properties (unsigned long index)
 
FilterProperty get_prop (DOMString name, optional boolean is_user=false)
 
FilterPacket ref (optional boolean props_only=false)
 
void unref ()
 
void send ()
 
void discard ()
 
void set_prop (DOMString name, optional boolean is_user=false)
 
ArrayBuffer append (DOMString str)
 
ArrayBuffer append (unsigned long size)
 
ArrayBuffer append (ArrayBuffer ab)
 
void truncate (unsigned long size)
 
void copy_props (FilterPacket from)
 
void clone (optional FilterPacket cached_pck=null)
 

Data Fields

attribute boolean start
 
attribute boolean end
 
attribute signed long long dts
 
attribute signed long long cts
 
attribute unsigned long dur
 
attribute unsigned long sap
 
attribute unsigned long timescale
 
attribute boolean interlaced
 
attribute boolean corrupted
 
attribute boolean seek
 
attribute signed long long byte_offset
 
attribute unsigned long roll
 
attribute unsigned long crypt
 
attribute unsigned long clock_type
 
attribute unsigned long carousel
 
attribute unsigned long seqnum
 
attribute boolean blocking_ref
 
attribute unsigned long is_leading
 
attribute unsigned long depends_on
 
attribute unsigned long depended_on
 
attribute unsigned long redundant
 
readonly attribute unsigned long size
 
readonly attribute ArrayBuffer data
 
readonly attribute boolean frame_ifce
 

Detailed Description

FilterPacket provides binding for GF_FilterPacket

Packet data is made accessible through an ArrayBuffer object. This object is destroyed when truncating or expanding the data, you must get it again using pck.data.

Member Function Documentation

◆ set_readonly()

void FilterPacket::set_readonly ( )

sets packet readonly - see gf_filter_pck_set_readonly

◆ enum_properties()

Object FilterPacket::enum_properties ( unsigned long  index)

enumerates properties of the packet

Parameters
indexthe 0-based index of the property.
Returns
null if no more properties to enumerate; otherwise an object:
{
DOMString name;
unsigned long type;
}

◆ get_prop()

FilterProperty FilterPacket::get_prop ( DOMString  name,
optional boolean  is_user = false 
)

gets a property by name/id - see gf_filter_pid_get_property and gf_filter_pid_get_property_str

Parameters
namethe ID or name of the builtin property
is_userif set, indicates the queried property is a user-defined property rather than a built-in property
Returns
property if found, null otherwise

◆ ref()

FilterPacket FilterPacket::ref ( optional boolean  props_only = false)

references a filter packet reference for later usage after drop from pid buffer - see gf_filter_pck_ref and gf_filter_pck_ref_props

Parameters
props_onlyif set, only packet properties are references, packet data is not
Returns
the new packet reference

◆ unref()

void FilterPacket::unref ( )

dereferences a filter packet reference - see gf_filter_pck_unref. Throws exception if object is not a packet reference. The object is no longer a valid packet after this.

◆ send()

void FilterPacket::send ( )

sends packet - gf_filter_pck_send

◆ discard()

void FilterPacket::discard ( )

discard packet - gf_filter_pck_discard

◆ set_prop()

void FilterPacket::set_prop ( DOMString  name,
optional boolean  is_user = false 
)

sets a property on packet - see gf_filter_pck_set_property

Parameters
namethe ID or name of the builtin property
is_userif set, indicates the queried property is a user-defined property rather than a built-in property

◆ append() [1/3]

ArrayBuffer FilterPacket::append ( DOMString  str)

appends data to packet - see gf_filter_pck_expand. New data can be accessed by through the data field.

Warning
any previous access to the packet data will be in detached state (no more data in the array buffer) after the call.
Parameters
strthe string to append
Returns
an arraybuffer containing the corresponding appended packet data. Full packet data is available through FilterPacket.data

◆ append() [2/3]

ArrayBuffer FilterPacket::append ( unsigned long  size)

appends data to packet - see gf_filter_pck_expand. New data can be accessed by through the data field.

Warning
any previous access to the packet data will be in detached state (no more data in the array buffer) after the call.
Parameters
sizethe number of bytes to append
Returns
an arraybuffer containing the corresponding appended packet data. Full packet data is available through FilterPacket.data

◆ append() [3/3]

ArrayBuffer FilterPacket::append ( ArrayBuffer  ab)

appends data to packet - see gf_filter_pck_expand. New data can be accessed by through the data field.

Warning
any previous access to the packet data will be in detached state (no more data in the array buffer) after the call.
Parameters
abthe array buffer to append
Returns
an arraybuffer containing the corresponding appended packet data. Full packet data is available through FilterPacket.data

◆ truncate()

void FilterPacket::truncate ( unsigned long  size)

truncates the packet to the indicated size - gf_filter_pck_truncate

Warning
any previous access to the packet data will be in detached state (no more data in the array buffer) after the call.
Parameters
sizenew packet size

◆ copy_props()

void FilterPacket::copy_props ( FilterPacket  from)

copy properties of source packet

Parameters
fromthe source packet to copy properties from

◆ clone()

void FilterPacket::clone ( optional FilterPacket  cached_pck = null)

creates a new packet cloning a source packet - see gf_filter_pck_dangling_copy.

The resulting packet is in 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)

Field Documentation

◆ start

attribute boolean FilterPacket::start

start flag

◆ end

attribute boolean FilterPacket::end

end flag

◆ dts

attribute signed long long FilterPacket::dts

DTS

◆ cts

attribute signed long long FilterPacket::cts

CTS

◆ dur

attribute unsigned long FilterPacket::dur

duration

◆ sap

attribute unsigned long FilterPacket::sap

SAP type GF_FilterSAPType

◆ timescale

attribute unsigned long FilterPacket::timescale

timescale

◆ interlaced

attribute boolean FilterPacket::interlaced

interlaced flag

◆ corrupted

attribute boolean FilterPacket::corrupted

corrupted flag

◆ seek

attribute boolean FilterPacket::seek

seek flag

◆ byte_offset

attribute signed long long FilterPacket::byte_offset

byte offset in source

◆ roll

attribute unsigned long FilterPacket::roll

roll distance

◆ crypt

attribute unsigned long FilterPacket::crypt

crypt flag

◆ clock_type

attribute unsigned long FilterPacket::clock_type

clock type

◆ carousel

attribute unsigned long FilterPacket::carousel

carousel version number

◆ seqnum

attribute unsigned long FilterPacket::seqnum

sequence number

◆ blocking_ref

attribute boolean FilterPacket::blocking_ref

set if the packet is a blocking reference to a packet reference

◆ is_leading

attribute unsigned long FilterPacket::is_leading

◆ depends_on

attribute unsigned long FilterPacket::depends_on

◆ depended_on

attribute unsigned long FilterPacket::depended_on

◆ redundant

attribute unsigned long FilterPacket::redundant

◆ size

readonly attribute unsigned long FilterPacket::size

size in bytes of the packet

◆ data

readonly attribute ArrayBuffer FilterPacket::data

data of the packet if any

Warning
This arraybuffer will be detached whenever the packet data is modified for a destination packet

◆ frame_ifce

readonly attribute boolean FilterPacket::frame_ifce

set to true if data of the packet is available through a GF_FilterFrameInterface object

FilterProperty
Object FilterProperty
Definition: jsf.idl:990