Logo Search packages:      
Sourcecode: libffado version File versions  Download package

Streaming::StreamProcessor Class Reference

#include <StreamProcessor.h>

Inheritance diagram for Streaming::StreamProcessor:

Streaming::PortManager Util::TimestampedBufferClient Streaming::AmdtpReceiveStreamProcessor Streaming::AmdtpTransmitStreamProcessor Streaming::MotuReceiveStreamProcessor Streaming::MotuTransmitStreamProcessor

List of all members.


Detailed Description

Class providing a generic interface for Stream Processors.

A stream processor multiplexes or demultiplexes an ISO stream into a collection of ports. This class should be subclassed, and the relevant functions should be overloaded.

Definition at line 52 of file StreamProcessor.h.


Public Types

enum  eProcessorType { ePT_Receive, ePT_Transmit }
 > the streamprocessor type
typedef std::vector< Option >
::iterator 
iterator

Public Member Functions

bool addPortManagerUpdateHandler (Util::Functor *functor)
iterator begin ()
bool canClientTransferFrames (unsigned int nframes)
 Can this StreamProcessor handle a transfer of nframes frames?
bool canConsume (unsigned int nframes)
bool canConsumePacket ()
bool canConsumePeriod ()
bool canProduce (unsigned int nframes)
bool canProducePacket ()
bool canProducePeriod ()
int countOptions ()
bool dropFrames (unsigned int nframes, int64_t ts)
 drop nframes from the internal buffer as if they were transferred to the client side
virtual void dumpInfo ()
iterator end ()
int getBufferFill ()
void getBufferHeadTimestamp (ffado_timestamp_t *ts, signed int *fc)
void getBufferTailTimestamp (ffado_timestamp_t *ts, signed int *fc)
int getChannel ()
virtual unsigned int getEventSize ()=0
 get the size of one frame in bytes
virtual unsigned int getEventsPerFrame ()=0
 get the number of events contained in one frame
unsigned int getExtraBufferFrames ()
bool getFrames (unsigned int nbframes, int64_t ts)
 transfer the buffer contents to the client
int getMaxFrameLatency ()
 get the maximal frame latency
virtual unsigned int getMaxPacketSize ()=0
virtual unsigned int getNbPacketsIsoXmitBuffer ()
virtual unsigned int getNominalFramesPerPacket ()=0
 get the nominal number of frames in a packet
virtual unsigned int getNominalPacketsNeeded (unsigned int nframes)
 get the nominal number of packets needed for a certain amount of frames
bool getOption (std::string name, uint8_t &v)
bool getOption (std::string name, int8_t &v)
bool getOption (std::string name, uint16_t &v)
bool getOption (std::string name, int16_t &v)
bool getOption (std::string name, uint32_t &v)
bool getOption (std::string name, int32_t &v)
bool getOption (std::string name, uint64_t &v)
bool getOption (std::string name, int64_t &v)
bool getOption (std::string name, float &v)
bool getOption (std::string name, double &v)
bool getOption (std::string name, bool &v)
bool getOption (std::string name, std::string &v)
Option::EType getOptionType (std::string name)
enum raw1394_iso_disposition getPacket (unsigned char *data, unsigned int *length, unsigned char *tag, unsigned char *sy, uint32_t pkt_ctr, unsigned int dropped, unsigned int skipped, unsigned int max_length)
virtual unsigned int getPacketsPerPeriod ()
FFADODevicegetParent ()
PortgetPortAtIdx (unsigned int index)
int getPortCount ()
int getPortCount (enum Port::E_PortType)
const char * getStateString ()
float getTicksPerFrame ()
uint64_t getTimeAtPeriod ()
 return the time of the next period boundary (in internal units)
virtual enum eProcessorType getType ()
 > returns the type of the streamprocessor
const char * getTypeString ()
Util::Functor * getUpdateHandlerForPtr (void *ptr)
bool handleBusReset ()
virtual bool handleBusResetDo ()
void handlerDied ()
bool hasOption (std::string name)
bool inError ()
bool init ()
virtual bool initPorts ()
bool isDryRunning ()
bool isRunning ()
bool isStopped ()
bool isWaitingForStream ()
virtual bool makeNameUnique (Port *port)
bool prepare ()
virtual bool prepareChild ()=0
 prepare the child SP
virtual bool preparePorts ()
virtual void printBufferInfo ()
bool putFrames (unsigned int nbframes, int64_t ts)
 transfer the client contents to the buffer
enum raw1394_iso_disposition putPacket (unsigned char *data, unsigned int length, unsigned char channel, unsigned char tag, unsigned char sy, uint32_t pkt_ctr, unsigned int dropped)
bool putSilenceFrames (unsigned int nbframes, int64_t ts)
 put silence frames into the internal buffer
virtual bool registerPort (Port *port)
bool remPortManagerUpdateHandler (Util::Functor *functor)
virtual bool resetPorts ()
bool scheduleStartDryRunning (int64_t time_to_start_at)
bool scheduleStartRunning (int64_t time_to_start_at)
bool scheduleStopDryRunning (int64_t time_to_stop_at)
bool scheduleStopRunning (int64_t time_to_stop_at)
void setBufferHeadTimestamp (ffado_timestamp_t new_timestamp)
void setBufferTailTimestamp (ffado_timestamp_t new_timestamp)
bool setChannel (int c)
bool setDllBandwidth (float bw)
void setExtraBufferFrames (unsigned int frames)
bool setOption (std::string name, uint8_t v)
bool setOption (std::string name, int8_t v)
bool setOption (std::string name, uint16_t v)
bool setOption (std::string name, int16_t v)
bool setOption (std::string name, uint32_t v)
bool setOption (std::string name, int32_t v)
bool setOption (std::string name, uint64_t v)
bool setOption (std::string name, int64_t v)
bool setOption (std::string name, double v)
bool setOption (std::string name, bool v)
bool setOption (std::string name, std::string v)
void setTicksPerFrame (float tpf)
virtual void setVerboseLevel (int l)
bool shiftStream (int nframes)
 Shifts the stream with the specified number of frames.
bool startDryRunning (int64_t time_to_start_at)
bool startRunning (int64_t time_to_start_at)
bool stopDryRunning (int64_t time_to_stop_at)
bool stopRunning (int64_t time_to_stop_at)
 StreamProcessor (FFADODevice &parent, enum eProcessorType type)
virtual bool unregisterPort (Port *port)
bool xrunOccurred ()

Public Attributes

 DECLARE_DEBUG_MODULE

Protected Types

enum  eChildReturnValue {
  eCRV_OK, eCRV_Invalid, eCRV_Packet, eCRV_EmptyPacket,
  eCRV_XRun, eCRV_Again, eCRV_Defer
}
enum  eProcessorState {
  ePS_Invalid, ePS_Created, ePS_Stopped, ePS_WaitingForStream,
  ePS_DryRunning, ePS_WaitingForStreamEnable, ePS_Running, ePS_WaitingForStreamDisable,
  ePS_Error
}
 > the state the streamprocessor is in

Protected Member Functions

bool addOption (Option o)
void callUpdateHandlers ()
void clearOptions ()
virtual enum eChildReturnValue generateEmptyPacketData (unsigned char *data, unsigned int *length)
virtual enum eChildReturnValue generateEmptyPacketHeader (unsigned char *data, unsigned int *length, unsigned char *tag, unsigned char *sy, uint32_t pkt_ctr)
virtual enum eChildReturnValue generatePacketData (unsigned char *data, unsigned int *length)
virtual enum eChildReturnValue generatePacketHeader (unsigned char *data, unsigned int *length, unsigned char *tag, unsigned char *sy, uint32_t pkt_ctr)
virtual enum eChildReturnValue generateSilentPacketData (unsigned char *data, unsigned int *length)
virtual enum eChildReturnValue generateSilentPacketHeader (unsigned char *data, unsigned int *length, unsigned char *tag, unsigned char *sy, uint32_t pkt_ctr)
Option getOption (std::string name)
enum eProcessorState getState ()
 > get the SP state
bool hasOption (Option o)
virtual enum eChildReturnValue processPacketData (unsigned char *data, unsigned int length)
virtual enum eChildReturnValue processPacketHeader (unsigned char *data, unsigned int length, unsigned char tag, unsigned char sy, uint32_t pkt_ctr)
virtual bool processReadBlock (char *data, unsigned int nevents, unsigned int offset)
virtual bool processWriteBlock (char *data, unsigned int nevents, unsigned int offset)
bool provideSilenceBlock (unsigned int nevents, unsigned int offset)
 write silence events to the stream ringbuffers.
int provideSilenceToPort (Port *p, unsigned int offset, unsigned int nevents)
bool removeOption (std::string name)
bool removeOption (Option o)
bool serializeOptions (std::string basePath, Util::IOSerialize &ser) const
bool setOption (Option o)
void setState (enum eProcessorState)
 > set the SP state to a specific value
virtual bool transmitSilenceBlock (char *data, unsigned int nevents, unsigned int offset)

Static Protected Member Functions

static bool deserializeOptions (std::string basePath, Util::IODeserialize &deser, OptionContainer &container)

Protected Attributes

Ieee1394Service & m_1394service
bool m_correct_last_timestamp
 last timestamp (in ticks)
Util::TimestampedBufferm_data_buffer
float m_dll_bandwidth_hz
unsigned int m_extra_buffer_frames
IsoHandlerManagerm_IsoHandlerManager
uint64_t m_last_timestamp
uint64_t m_last_timestamp_at_period_ticks
unsigned int m_local_node_id
FFADODevicem_Parent
PortVector m_Ports
byte_t * m_scratch_buffer
size_t m_scratch_buffer_size_bytes
StreamProcessorManagerm_StreamProcessorManager
float m_ticks_per_frame
Util::FunctorVector m_UpdateHandlers

Private Member Functions

bool doDryRunning ()
 Enter the ePS_DryRunning state.
bool doRunning ()
 Enter the ePS_Running state.
bool doStop ()
 Enter the ePS_Stopped state.
bool doWaitForRunningStream ()
 Enter the ePS_WaitingForStream state.
bool doWaitForStreamDisable ()
 Enter the ePS_WaitingForStreamDisable state.
bool doWaitForStreamEnable ()
 Enter the ePS_WaitingForStreamEnable state.
const char * ePSToString (enum eProcessorState)
 convert a eProcessorState to a string
const char * ePTToString (enum eProcessorType)
 convert a eProcessorType to a string
bool getFramesDry (unsigned int nbframes, int64_t ts)
bool getFramesWet (unsigned int nbframes, int64_t ts)
bool putFramesDry (unsigned int nbframes, int64_t ts)
bool putFramesWet (unsigned int nbframes, int64_t ts)
bool scheduleStateTransition (enum eProcessorState state, uint64_t time_instant)
bool transferSilence (unsigned int size)
bool updateState ()
 Updates the state machine and calls the necessary transition functions.
bool waitForState (enum eProcessorState state, unsigned int timeout)

Private Attributes

int m_channel
unsigned int m_cycle_to_switch_state
bool m_in_xrun
uint64_t m_last_timestamp2
 last timestamp (in ticks)
enum eProcessorState m_next_state
enum eProcessorType m_processor_type
enum eProcessorState m_state

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index