libgpac
Documentation of the core library of GPAC
Loading...
Searching...
No Matches
python.libgpac.libgpac.FilterSession Class Reference

filter session object - see fs_grp More...

Public Member Functions

 __init__ (self, flags=0, blacklist=None, nb_threads=0, sched_type=0)
 constructor for filter session - see gf_fs_new
 delete (self)
 delete an existing filter session - see gf_fs_del
 on_filter_new (self, _filter)
 called whenever a new filter is added, typically used by classes deriving from FilterSession
 on_filter_del (self, _filter)
 called whenever a filter is destroyed, typically used by classes deriving from FilterSession
 on_gl_activate (self, do_activate)
 called whenever a GL context must be activated, typically used by classes deriving from FilterSession
 external_opengl_provider (self)
 call this function to prevent openGL context creation in libgpac, delegating GL context management to the calling app
 run (self)
 run the session - see gf_fs_run
 load_src (self, URL, parentURL=None)
 load source filter - see gf_fs_load_source
 load_dst (self, URL, parentURL=None)
 load destination filter - see gf_fs_load_destination
 load (self, fname)
 load a filter - see gf_fs_load_filter
 post (self, task)
 post a user task to the filter sesison - see gf_fs_post_user_task
 abort (self, flush=0)
 abort the session - see gf_fs_abort
 get_filter (self, index)
 get a filter by index - see gf_fs_get_filter
 lock (self, lock)
 lock the session - see gf_fs_lock_filters
 reporting (self, do_report)
 enable status reporting by filters - see gf_fs_enable_reporting
 print_stats (self)
 print statistics on stderr - see gf_fs_print_stats
 print_graph (self)
 print graph on stderr - see gf_fs_print_connections
 fire_event (self, evt, _filter=None, upstream=False)
 fire an event on the given filter if any, or on any filter accepting user events
 is_supported_mime (self, mime)
 checks if a given mime is supported - see gf_fs_is_supported_mime
 is_supported_source (self, url, parent=None)
 checks if a given source URL is supported - see gf_fs_is_supported_source

Data Fields

int last_task = 0
 set to true if this is the last task running, readonly - see gf_fs_is_last_task
int nb_filters = 0
 number of filters in session, readonly - see gf_fs_get_filters_count
int http_bitrate = 0
 current HTTP cumulated download rate, readonly - see gf_fs_get_http_rate
int http_max_bitrate = 0
 HTTP max download rate - see gf_fs_get_http_max_rate and gf_fs_set_http_max_rate.

Protected Attributes

 _sess

Detailed Description

filter session object - see fs_grp

Constructor & Destructor Documentation

◆ __init__()

python.libgpac.libgpac.FilterSession.__init__ ( self,
flags = 0,
blacklist = None,
nb_threads = 0,
sched_type = 0 )

constructor for filter session - see gf_fs_new

Parameters
flagssession flags (int)
blacklistlist of blacklisted filters
nb_threadsnumber of threads to use (int)
sched_typesession scheduler type

Member Function Documentation

◆ delete()

python.libgpac.libgpac.FilterSession.delete ( self)

delete an existing filter session - see gf_fs_del

Warning
The filter session must be explicitly destroyed if close (gf_sys_close) is called after that
Returns

◆ on_filter_new()

python.libgpac.libgpac.FilterSession.on_filter_new ( self,
_filter )

called whenever a new filter is added, typically used by classes deriving from FilterSession

Parameters
_filterFilter object being added
Returns

◆ on_filter_del()

python.libgpac.libgpac.FilterSession.on_filter_del ( self,
_filter )

called whenever a filter is destroyed, typically used by classes deriving from FilterSession

Parameters
_filterFilter object being removed
Returns

◆ on_gl_activate()

python.libgpac.libgpac.FilterSession.on_gl_activate ( self,
do_activate )

called whenever a GL context must be activated, typically used by classes deriving from FilterSession

Parameters
do_activateset to true if openGL context ust be activated for calling thread
Returns

◆ external_opengl_provider()

python.libgpac.libgpac.FilterSession.external_opengl_provider ( self)

call this function to prevent openGL context creation in libgpac, delegating GL context management to the calling app

Returns

◆ run()

python.libgpac.libgpac.FilterSession.run ( self)

run the session - see gf_fs_run

Returns
Here is the call graph for this function:

◆ load_src()

python.libgpac.libgpac.FilterSession.load_src ( self,
URL,
parentURL = None )

load source filter - see gf_fs_load_source

Parameters
URLsource URL to load
parentURLURL of parent resource for relative path resolution
Returns
new Filter object
Here is the call graph for this function:

◆ load_dst()

python.libgpac.libgpac.FilterSession.load_dst ( self,
URL,
parentURL = None )

load destination filter - see gf_fs_load_destination

Parameters
URLsource URL to load
parentURLURL of parent resource for relative path resolution
Returns
new Filter object
Here is the call graph for this function:

◆ load()

python.libgpac.libgpac.FilterSession.load ( self,
fname )

load a filter - see gf_fs_load_filter

Parameters
fnamefilter name and options
Returns
new Filter object
Here is the call graph for this function:

◆ post()

python.libgpac.libgpac.FilterSession.post ( self,
task )

post a user task to the filter sesison - see gf_fs_post_user_task

Parameters
tasktask object to post
Returns
Here is the call graph for this function:

◆ abort()

python.libgpac.libgpac.FilterSession.abort ( self,
flush = 0 )

abort the session - see gf_fs_abort

Parameters
flushflush pipeline before abort
Returns

◆ get_filter()

python.libgpac.libgpac.FilterSession.get_filter ( self,
index )

get a filter by index - see gf_fs_get_filter

Parameters
indexindex of filter
Returns
Filter object

◆ lock()

python.libgpac.libgpac.FilterSession.lock ( self,
lock )

lock the session - see gf_fs_lock_filters

Parameters
lockif True, locks otherwise unlocks
Returns

◆ reporting()

python.libgpac.libgpac.FilterSession.reporting ( self,
do_report )

enable status reporting by filters - see gf_fs_enable_reporting

Parameters
do_reportif True, enables reporting
Returns

◆ print_stats()

python.libgpac.libgpac.FilterSession.print_stats ( self)

print statistics on stderr - see gf_fs_print_stats

Returns

◆ print_graph()

python.libgpac.libgpac.FilterSession.print_graph ( self)

print graph on stderr - see gf_fs_print_connections

Returns

◆ fire_event()

python.libgpac.libgpac.FilterSession.fire_event ( self,
evt,
_filter = None,
upstream = False )

fire an event on the given filter if any, or on any filter accepting user events

Parameters
evtFilterEvent to fire
_filterFilter to use as target
upstreamif true, walks the chain towards the sink, otehrwise towards the source
Returns

◆ is_supported_mime()

python.libgpac.libgpac.FilterSession.is_supported_mime ( self,
mime )

checks if a given mime is supported - see gf_fs_is_supported_mime

Parameters
mimemime type to check
Returns
true or false

◆ is_supported_source()

python.libgpac.libgpac.FilterSession.is_supported_source ( self,
url,
parent = None )

checks if a given source URL is supported - see gf_fs_is_supported_source

Parameters
urlURL to check
parentparent URL for relative URLs
Returns
true or false

Field Documentation

◆ last_task

int python.libgpac.libgpac.FilterSession.last_task = 0

set to true if this is the last task running, readonly - see gf_fs_is_last_task

◆ nb_filters

int python.libgpac.libgpac.FilterSession.nb_filters = 0

number of filters in session, readonly - see gf_fs_get_filters_count

◆ http_bitrate

int python.libgpac.libgpac.FilterSession.http_bitrate = 0

current HTTP cumulated download rate, readonly - see gf_fs_get_http_rate

◆ http_max_bitrate

int python.libgpac.libgpac.FilterSession.http_max_bitrate = 0

HTTP max download rate - see gf_fs_get_http_max_rate and gf_fs_set_http_max_rate.

◆ _sess

python.libgpac.libgpac.FilterSession._sess
protected