Package flumotion :: Package component :: Module feedcomponent010 :: Class FeedComponent
[hide private]

Class FeedComponent

source code

             object --+        
                      |        
common.common.InitMixin --+    
                          |    
    common.log.Loggable --+    
                          |    
             object --+   |    
                      |   |    
        gobject.GObject --+    
                          |    
    component.BaseComponent --+
                              |
                             FeedComponent
Known Subclasses:

I am a base class for all Flumotion feed components.

Nested Classes [hide private]

Inherited from component.BaseComponent: componentMediumClass

Instance Methods [hide private]
 
init(self)
A subclass should do as little as possible in its init method.
source code
 
do_setup(self)
Sets up component.
source code
gst.Pipeline
create_pipeline(self)
Subclasses have to implement this method.
source code
 
set_pipeline(self, pipeline)
Subclasses can override me.
source code
 
eaterSetInactive(self, feedId)
The eater for the given feedId is no longer active By default, the component will go hungry.
source code
 
eaterSetActive(self, feedId)
The eater for the given feedId is now active and producing data.
source code
 
eaterTimestampDiscont(self, feedId, prevTs, prevDuration, curTs)
Inform of a timestamp discontinuity for the given eater.
source code
 
eaterOffsetDiscont(self, feedId, prevOffsetEnd, curOffset)
Inform of a timestamp discontinuity for the given eater.
source code
 
addEffect(self, effect) source code
 
effectPropertyChanged(self, effectName, propertyName, value)
Notify the manager that an effect property has changed to a new value.
source code
 
parseEaterConfig(self, eater_config) source code
 
parseFeederConfig(self, feeder_config) source code
 
get_eater_names(self)
Return the list of feeder names this component eats from.
source code
 
get_feeder_names(self)
Return the list of feedId's of feeders this component has.
source code
 
get_feed_names(self)
Return the list of feedeNames for feeds this component has.
source code
 
get_pipeline(self) source code
 
_addStateChangeDeferred(self, statechange) source code
 
_getStateChange(self, old, new) source code
 
bus_watch_func(self, bus, message) source code
 
setup_pipeline(self) source code
 
pipeline_stop(self) source code
 
cleanup(self) source code
 
do_stop(self)
BaseComponent vmethod for stopping.
source code
 
set_master_clock(self, ip, port, base_time) source code
 
provide_master_clock(self, port)
Tell the component to provide a master clock on the given port.
source code
twisted.internet.defer.Deferred
link(self)
Make the component eat from the feeds it depends on and start producing feeds itself.
source code
 
_feeder_probe_calllater(self) source code
 
_add_buffer_probe(self, pad, feedId, firstTime=False) source code
 
_buffer_probe_cb(self, pad, buffer, feedId, firstTime=False)
Periodically scheduled buffer probe, that ensures that we're currently actually having dataflow through our eater elements.
source code
 
_checkEater(self, feedId)
Check that buffers are being received by the eater.
source code
 
_reconnectEater(self, feedId) source code
 
get_element(self, element_name)
Get an element out of the pipeline.
source code
 
get_element_property(self, element_name, property)
Gets a property of an element in the GStreamer pipeline.
source code
 
set_element_property(self, element_name, property, value)
Sets a property on an element in the GStreamer pipeline.
source code
 
feedToFD(self, feedName, fd, cleanup, eaterId=None) source code
 
removeClientCallback(self, sink, fd)
Called (as a signal callback) when the FD is no longer in use by multifdsink.
source code
 
eatFromFD(self, feedId, fd)
Tell the component to eat the given feedId from the given fd.
source code
 
unblock_eater(self, feedId)
After this function returns, the stream lock for this eater must have been released.
source code
 
_eater_event_probe_cb(self, pad, event, feedId)
An event probe used to consume unwanted EOS events on eaters.
source code
 
_depay_eater_event_probe_cb(self, pad, event, feedId)
An event probe used to consume unwanted duplicate newsegment events.
source code

Inherited from component.BaseComponent: __init__, addMessage, adminCallRemote, do_check, do_start, emit, fixRenamedProperties, getMood, getName, getWorkerName, setMedium, setMood, setShutdownHook, setWorkerName, setup, start, stop

Inherited from common.log.Loggable: __providedBy__, debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure

Inherited from gobject.GObject: __cmp__, __delattr__, __gdoc__, __gobject_init__, __hash__, __new__, __repr__, __setattr__, chain, connect, connect_after, connect_object, connect_object_after, disconnect, disconnect_by_func, emit_stop_by_name, freeze_notify, get_data, get_properties, get_property, handler_block, handler_block_by_func, handler_disconnect, handler_is_connected, handler_unblock, handler_unblock_by_func, notify, props, set_data, set_properties, set_property, stop_emission, thaw_notify, weak_ref

Inherited from object: __getattribute__, __reduce__, __reduce_ex__, __str__

Class Variables [hide private]
  FDSRC_TMPL = 'fdsrc name=%(name)s'
  DEPAY_TMPL = 'gdpdepay name=%(name)s-depay'
  FEEDER_TMPL = 'gdppay ! multifdsink sync=false name=%(name)s b...
  BUFFER_PROBE_ADD_FREQUENCY = 5
  BUFFER_CHECK_FREQUENCY = 12.5
  BUFFER_TIME_THRESHOLD = 12.5
  logCategory = 'feedcomponent'
Implementors can provide a category to log their messages under.
  _reconnectInterval = 3
  checkTimestamp = False
whether to check continuity of timestamps for eaters
  checkOffset = False
whether to check continuity of offsets for eaters
  __gtype__ = <GType flumotion+component+feedcomponent010+FeedCo...

Inherited from common.log.Loggable: __implemented__, __provides__

Instance Variables [hide private]

Inherited from component.BaseComponent: medium, name

Properties [hide private]

Inherited from gobject.GObject: __grefcount__

Inherited from object: __class__

Method Details [hide private]

init(self)

source code 

A subclass should do as little as possible in its init method. In particular, it should not try to access resources.

Failures during init are marshalled back to the manager through the worker's remote_create method, since there is no component state proxied to the manager yet at the time of init.

Overrides: component.BaseComponent.init
(inherited documentation)

do_setup(self)

source code 

Sets up component.

Returns:
twisted.internet.defer.Deferred
Overrides: component.BaseComponent.do_setup

set_pipeline(self, pipeline)

source code 

Subclasses can override me. They should chain up first.

eaterSetActive(self, feedId)

source code 

The eater for the given feedId is now active and producing data. By default, the component will go happy if all eaters are active.

effectPropertyChanged(self, effectName, propertyName, value)

source code 

Notify the manager that an effect property has changed to a new value.

Admin clients will receive it as a propertyChanged message for effectName:propertyName.

get_eater_names(self)

source code 

Return the list of feeder names this component eats from.

Returns:
a list of "componentName:feedName" strings

get_feeder_names(self)

source code 

Return the list of feedId's of feeders this component has.

Returns:
a list of "componentName:feedName" strings

get_feed_names(self)

source code 

Return the list of feedeNames for feeds this component has.

Returns:
a list of "feedName" strings

do_stop(self)

source code 

BaseComponent vmethod for stopping. The component should do any cleanup it needs, but must not set the component's mood to sleeping.

Returns:
twisted.internet.defer.Deferred
Overrides: component.BaseComponent.do_stop
(inherited documentation)

provide_master_clock(self, port)

source code 

Tell the component to provide a master clock on the given port.

Returns:
(ip, port, base_time) triple.

_buffer_probe_cb(self, pad, buffer, feedId, firstTime=False)

source code 

Periodically scheduled buffer probe, that ensures that we're currently
actually having dataflow through our eater elements.

Called from GStreamer threads.

@param pad       The gst.Pad srcpad for one eater in this component.
@param buffer    A gst.Buffer that has arrived on this pad
@param feedId    The feedId for the feed we're eating on this pad
@param firstTime Boolean, true if this is the first time this buffer 
                 probe has been added for this eater.

_checkEater(self, feedId)

source code 

Check that buffers are being received by the eater. If no buffer was received for more than BUFFER_TIME_THRESHOLD on a connected feed, I call eaterSetInactive. Likewise, if a buffer was received on an inactive feed, I call eaterSetActive.

I am used both as a callLater and as a direct method.

get_element(self, element_name)

source code 

Get an element out of the pipeline.

If it is possible that the component has not yet been set up, the caller needs to check if self.pipeline is actually set.

feedToFD(self, feedName, fd, cleanup, eaterId=None)

source code 
Parameters:
  • feedName (str) - name of the feed to feed to the given fd.
  • fd (int) - the file descriptor to feed to
  • cleanup (callable) - the function to call when the FD is no longer feeding

removeClientCallback(self, sink, fd)

source code 

Called (as a signal callback) when the FD is no longer in use by multifdsink. This will call the registered callable on the fd.

Called from GStreamer threads.

eatFromFD(self, feedId, fd)

source code 

Tell the component to eat the given feedId from the given fd. The component takes over the ownership of the fd, closing it when no longer eating.

Parameters:
  • feedId (str) - feed id (componentName:feedName) to eat from through the given fd
  • fd (int) - the file descriptor to eat from

unblock_eater(self, feedId)

source code 

After this function returns, the stream lock for this eater must have been released. If your component needs to do something here, override this method.

_eater_event_probe_cb(self, pad, event, feedId)

source code 

An event probe used to consume unwanted EOS events on eaters.

Called from GStreamer threads.

_depay_eater_event_probe_cb(self, pad, event, feedId)

source code 

An event probe used to consume unwanted duplicate newsegment events.

Called from GStreamer threads.


Class Variable Details [hide private]

FEEDER_TMPL

Value:
'gdppay ! multifdsink sync=false name=%(name)s buffers-max=500 buffers\
-soft-max=450 recover-policy=1'

__gtype__

Value:
<GType flumotion+component+feedcomponent010+FeedComponent (150184872)>