Package flumotion :: Package component :: Package consumers :: Package disker :: Module disker :: Class Disker
[hide private]

Class Disker

source code

             object --+                
                      |                
common.common.InitMixin --+            
                          |            
extern.log.log.Loggable --+            
                          |            
    component.BaseComponent --+        
                              |        
 feedcomponent010.FeedComponent --+    
                                  |    
 feedcomponent.ParseLaunchComponent --+
                                      |
            extern.log.log.Loggable --+
                                      |
                                     Disker

Nested Classes [hide private]
child class of BaseComponentMedium componentMediumClass
the medium class to use for this component
Instance Methods [hide private]
 
init(self)
A subclass should do as little as possible in its init method.
source code
 
observerAppend(self, observer, num)
Triggered when a uiState observer was added.
source code
 
observerRemove(self, observer, num)
Triggered when a uiState observer has left.
source code
 
check_properties(self, props, addMessage)
BaseComponent convenience vmethod for running checks.
source code
 
get_pipeline_string(self, properties)
Method that must be implemented by subclasses to produce the gstparse string for the component's pipeline.
source code
 
configure_pipeline(self, pipeline, properties)
Method that can be implemented by subclasses if they wish to interact with the pipeline after it has been created and set on the component.
source code
 
_tdt_to_datetime(self, s)
TDT events contains a structure representing the UTC time of the stream with the fields: 'year', 'month', 'day', 'hour', 'minute', 'second'
source code
 
_getStats(self, fd) source code
 
_updateIndex(self, offset, timestamp, isKeyframe, tdt=0) source code
 
_pollDisk(self) source code
 
setTimeRotate(self, time) source code
 
setSizeRotate(self, size) source code
 
_rotateTimeCallLater(self, time) source code
 
_rotateSizeCallLater(self, size) source code
 
getMime(self) source code
 
scheduleRecordings(self, icalFile) source code
 
changeFilename(self, filenameTemplate=None, datetime=None) source code
 
_updateSymlink(self, src, dest) source code
 
stopRecording(self) source code
 
_stopRecordingFull(self, handle, location, lastTstamp, delayedStop) source code
 
_updateHeadersSize(self) source code
 
_notify_caps_cb(self, pad, param) source code
 
_client_added_cb(self, element, arg0) source code
 
_client_removed_cb(self, element, arg0, client_status) source code
 
_handle_event(self, event) source code
 
_handle_buffer(self, buf) source code
 
_src_pad_probe(self, pad, data) source code
 
_client_error_cb(self) source code
 
eventInstanceStarted(self, eventInstance) source code
 
eventInstanceEnded(self, eventInstance) source code
 
_updateNextPoints(self) source code
 
_recordingStarted(self, handle, location) source code
 
_recordingStopped(self, handle, location) source code
 
_onMarkerStop(self) source code
 
_onMarkerStart(self, data) source code
 
do_stop(self)
BaseComponent vmethod for stopping.
source code

Inherited from feedcomponent.ParseLaunchComponent: add_default_eater_feeder, create_pipeline, get_eater_srcpad, get_eater_template, get_feeder_sinkpad, get_feeder_template, get_queue_string, parse_pipeline, parse_tmpl, set_pipeline

Inherited from feedcomponent010.FeedComponent: addEffect, attachPadMonitorToElement, attachPadMonitorToFeeder, bus_message_received_cb, cleanup, connect_feeders, do_pipeline_playing, do_setup, dump_gstreamer_debug_dot_file, eatFromFD, feedToFD, get_element, get_element_property, get_master_clock, get_pipeline, install_eater_continuity_watch, install_eater_event_probes, make_message_for_gstreamer_error, modify_element_property, provide_master_clock, reconnectEater, set_element_property, set_master_clock, setup_completed, stop_pipeline, try_start_pipeline, unblock_eater

Inherited from component.BaseComponent: __init__, __provides__, addMessage, adminCallRemote, checkPropertyType, do_check, fixRenamedProperties, getMood, getName, getWorkerName, modifyProperty, removeMessage, setMedium, setMood, setShutdownHook, setWorkerName, setup, stop, waitForHappy, warnDeprecatedProperties

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

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

Class Variables [hide private]
  logCategory = 'disker'
Implementors can provide a category to log their messages under.
  checkOffset = True
whether to check continuity of offsets for eaters
  pipe_template = 'multifdsink name=fdsink sync-method=2 mode=1 ...
  file = None
hash(x)
  directory = None
hash(x)
  location = None
hash(x)
  caps = None
hash(x)
  last_tstamp = None
hash(x)
  indexLocation = None
hash(x)
  writeIndex = False
  syncOnTdt = False
  timeOverlap = 0
  reactToMarks = False
  _offset = 0
  _headers_size = 0
  _index = None
hash(x)
  _nextIsKF = False
  _lastTdt = None
hash(x)
  _lastEntry = None
hash(x)
  _clients = {}
  _startFilenameTemplate = None
hash(x)
  _startTime = None
hash(x)
  _rotateTimeDelayedCall = None
hash(x)
  _pollDiskDC = None
hash(x)
  _symlinkToLastRecording = None
hash(x)
  _symlinkToCurrentRecording = None
hash(x)

Inherited from feedcomponent.ParseLaunchComponent: DELIMITER, DEPAY_TMPL, EATER_TMPL, FDSRC_TMPL, FEEDER_TMPL, checkTimestamp

Inherited from feedcomponent010.FeedComponent: FEEDER_STATS_UPDATE_FREQUENCY, dropStreamHeaders, eaters, feeders, swallowNewSegment

Inherited from component.BaseComponent: __implemented__

Instance Variables [hide private]

Inherited from component.BaseComponent: medium, name, uiState

Properties [hide private]

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)

observerAppend(self, observer, num)

source code 

Triggered when a uiState observer was added.

Default implementation is to start the memory and cpu pollers.

Note: Subclasses can override me but should chain me up to start these pollers

Overrides: component.BaseComponent.observerAppend
(inherited documentation)

observerRemove(self, observer, num)

source code 

Triggered when a uiState observer has left.

Default implementation is to stop the memory and cpu pollers when the total number of observers denoted by the 'num' argument becomes zero.

Note: Subclasses can override me but should chain me up to stop these pollers

Overrides: component.BaseComponent.observerRemove
(inherited documentation)

check_properties(self, props, addMessage)

source code 

BaseComponent convenience vmethod for running checks.

A component implementation can override this method to run any checks that it needs to. Typically, a check_properties implementation will call the provided addMessage() callback to note warnings or errors. For errors, addMessage() will set component's mood to sad, which will abort the init process before getting to do_setup().

Parameters:
  • properties - The component's properties
  • addMessage - Thunk to add a message to the component state. Will raise an exception if the message is of level ERROR.
Overrides: component.BaseComponent.check_properties
(inherited documentation)

get_pipeline_string(self, properties)

source code 

Method that must be implemented by subclasses to produce the gstparse string for the component's pipeline. Subclasses should not chain up; this method raises a NotImplemented error.

Returns: a new pipeline string representation.

Overrides: feedcomponent.ParseLaunchComponent.get_pipeline_string
(inherited documentation)

configure_pipeline(self, pipeline, properties)

source code 

Method that can be implemented by subclasses if they wish to interact with the pipeline after it has been created and set on the component.

This could include attaching signals and bus handlers.

Overrides: feedcomponent.ParseLaunchComponent.configure_pipeline
(inherited documentation)

_tdt_to_datetime(self, s)

source code 

TDT events contains a structure representing the UTC time of the stream with the fields: 'year', 'month', 'day', 'hour', 'minute', 'second'

Can raise and Exception if the structure doesn't cotains all the requiered fields. Protect with try-except.

setTimeRotate(self, time)

source code 
Parameters:
  • time - duration of file (in seconds)

setSizeRotate(self, size)

source code 
Parameters:
  • size - size of file (in bytes)

changeFilename(self, filenameTemplate=None, datetime=None)

source code 
Parameters:
  • filenameTemplate - strftime format string to decide filename
  • time - an aware datetime used for the filename and to compare if an existing file needs to be overwritten. defaulting to datetime.now().

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)

Class Variable Details [hide private]

pipe_template

Value:
'multifdsink name=fdsink sync-method=2 mode=1 sync=false'