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

Streaming::AmdtpReceiveStreamProcessor Class Reference

#include <AmdtpReceiveStreamProcessor.h>

Inheritance diagram for Streaming::AmdtpReceiveStreamProcessor:

Streaming::StreamProcessor Streaming::PortManager Util::TimestampedBufferClient

List of all members.


Detailed Description

The Base Class for an AMDTP receive stream processor.

This class implements a ReceiveStreamProcessor that demultiplexes AMDTP streams into Ports.

Definition at line 45 of file AmdtpReceiveStreamProcessor.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)
 AmdtpReceiveStreamProcessor (FFADODevice &parent, int dimension)
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 ()
 get the size of one frame in bytes
virtual unsigned int getEventsPerFrame ()
 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 ()
virtual unsigned int getNbPacketsIsoXmitBuffer ()
virtual unsigned int getNominalFramesPerPacket ()
 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 ()
 prepare the child SP
virtual bool preparePorts ()
virtual void printBufferInfo ()
enum eChildReturnValue processPacketData (unsigned char *data, unsigned int length)
enum eChildReturnValue processPacketHeader (unsigned char *data, unsigned int length, unsigned char tag, unsigned char sy, uint32_t pkt_ctr)
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)
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)
bool processReadBlock (char *data, unsigned int nevents, unsigned int offset)
 write received events to the stream ringbuffers.
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

void decodeAudioPortsFloat (quadlet_t *data, unsigned int offset, unsigned int nevents)
 demux events to all audio ports (float)
void decodeAudioPortsInt24 (quadlet_t *data, unsigned int offset, unsigned int nevents)
 demux events to all audio ports (int24)
void decodeMidiPorts (quadlet_t *data, unsigned int offset, unsigned int nevents)
 decode all midi ports in the cache from events
unsigned int getSytInterval ()
bool initPortCache ()
void updatePortCache ()

Private Attributes

std::vector< struct
_MBLA_port_cache > 
m_audio_ports
int m_dimension
std::vector< struct
_MIDI_port_cache > 
m_midi_ports
unsigned int m_nb_audio_ports
unsigned int m_nb_midi_ports
unsigned int m_syt_interval

Classes

struct  _MBLA_port_cache
struct  _MIDI_port_cache

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

Generated by  Doxygen 1.6.0   Back to index