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

filter session object - see GF_FilterSession

Public Member Functions

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

Data Fields

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

Constructor & Destructor Documentation

◆ __init__()

def python.libgpac.libgpac.FilterSession.__init__ (   self,
  flags = 0,
  blacklist = None,
  nb_threads = 0,
  sched_type = 0 
)
Parameters
flagssession flags (int)
blacklistlist of blacklisted filters
nb_threadsnumber of threads to use (int)
sched_typesession scheduler type

Member Function Documentation

◆ delete()

def python.libgpac.libgpac.FilterSession.delete (   self)
Warning
The filter session must be explicitly destroyed if close (gf_sys_close) is called after that
Returns

◆ on_filter_new()

def python.libgpac.libgpac.FilterSession.on_filter_new (   self,
  _filter 
)
Parameters
_filterFilter object being added
Returns

◆ on_filter_del()

def python.libgpac.libgpac.FilterSession.on_filter_del (   self,
  _filter 
)
Parameters
_filterFilter object being removed
Returns

◆ on_gl_activate()

def python.libgpac.libgpac.FilterSession.on_gl_activate (   self,
  do_activate 
)
Parameters
do_activateset to true if openGL context ust be activated for calling thread
Returns

◆ external_opengl_provider()

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

◆ run()

def python.libgpac.libgpac.FilterSession.run (   self)
Returns
+ Here is the call graph for this function:

◆ load_src()

def python.libgpac.libgpac.FilterSession.load_src (   self,
  URL,
  parentURL = None 
)
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()

def python.libgpac.libgpac.FilterSession.load_dst (   self,
  URL,
  parentURL = None 
)
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()

def python.libgpac.libgpac.FilterSession.load (   self,
  fname 
)
Parameters
fnamefilter name and options
Returns
new Filter object
+ Here is the call graph for this function:

◆ post()

def python.libgpac.libgpac.FilterSession.post (   self,
  task 
)
Parameters
tasktask object to post
Returns
+ Here is the call graph for this function:

◆ abort()

def python.libgpac.libgpac.FilterSession.abort (   self,
  flush = 0 
)
Parameters
flushflush pipeline before abort
Returns

◆ get_filter()

def python.libgpac.libgpac.FilterSession.get_filter (   self,
  index 
)
Parameters
indexindex of filter
Returns
Filter object

◆ lock()

def python.libgpac.libgpac.FilterSession.lock (   self,
  lock 
)
Parameters
lockif True, locks otherwise unlocks
Returns

◆ reporting()

def python.libgpac.libgpac.FilterSession.reporting (   self,
  do_report 
)
Parameters
do_reportif True, enables reporting
Returns

◆ print_stats()

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

◆ print_graph()

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

◆ fire_event()

def python.libgpac.libgpac.FilterSession.fire_event (   self,
  evt,
  _filter = None,
  upstream = False 
)
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()

def python.libgpac.libgpac.FilterSession.is_supported_mime (   self,
  mime 
)
Parameters
mimemime type to check
Returns
true or false

◆ is_supported_source()

def python.libgpac.libgpac.FilterSession.is_supported_source (   self,
  url,
  parent = None 
)
Parameters
urlURL to check
parentparent URL for relative URLs
Returns
true or false