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

Streaming::AmdtpTransmitStreamProcessor Class Reference

#include <AmdtpTransmitStreamProcessor.h>

Inheritance diagram for Streaming::AmdtpTransmitStreamProcessor:

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

List of all members.

Detailed Description

The Base Class for an AMDTP transmit stream processor.

This class implements a TransmitStreamProcessor that multiplexes Ports into AMDTP streams.

Definition at line 46 of file AmdtpTransmitStreamProcessor.h.

Public Types

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

Public Member Functions

bool addPortManagerUpdateHandler (Util::Functor *functor)
 AmdtpTransmitStreamProcessor (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 ()
enum eChildReturnValue generateEmptyPacketData (unsigned char *data, unsigned int *length)
enum eChildReturnValue generateEmptyPacketHeader (unsigned char *data, unsigned int *length, unsigned char *tag, unsigned char *sy, uint32_t pkt_ctr)
enum eChildReturnValue generatePacketData (unsigned char *data, unsigned int *length)
enum eChildReturnValue generatePacketHeader (unsigned char *data, unsigned int *length, unsigned char *tag, unsigned char *sy, uint32_t pkt_ctr)
enum eChildReturnValue generateSilentPacketData (unsigned char *data, unsigned int *length)
enum eChildReturnValue generateSilentPacketHeader (unsigned char *data, unsigned int *length, unsigned char *tag, unsigned char *sy, uint32_t pkt_ctr)
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
virtual int getMaxCyclesToTransmitEarly ()
int getMaxFrameLatency ()
 get the maximal frame latency
virtual unsigned int getMaxPacketSize ()
virtual int getMinCyclesBeforePresentation ()
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 unsigned int getTransferDelay ()
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 ()
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)
virtual void setMaxCyclesToTransmitEarly (int x)
virtual void setMinCyclesBeforePresentation (int x)
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 setTransferDelay (unsigned int x)
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


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,
 > the state the streamprocessor is in

Protected Member Functions

bool addOption (Option o)
void callUpdateHandlers ()
void clearOptions ()
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)
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
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)
float m_dll_bandwidth_hz
unsigned int m_extra_buffer_frames
uint64_t m_last_timestamp
uint64_t m_last_timestamp_at_period_ticks
unsigned int m_local_node_id
PortVector m_Ports
byte_t * m_scratch_buffer
size_t m_scratch_buffer_size_bytes
float m_ticks_per_frame
Util::FunctorVector m_UpdateHandlers

Private Member Functions

void encodeAudioPortsFloat (quadlet_t *data, unsigned int offset, unsigned int nevents)
 mux all audio ports to events
void encodeAudioPortsInt24 (quadlet_t *data, unsigned int offset, unsigned int nevents)
 mux all audio ports to events
void encodeAudioPortsSilence (quadlet_t *data, unsigned int offset, unsigned int nevents)
 encodes all audio ports in the cache to events (silent data)
void encodeMidiPorts (quadlet_t *data, unsigned int offset, unsigned int nevents)
 encodes all midi ports in the cache to events
void encodeMidiPortsSilence (quadlet_t *data, unsigned int offset, unsigned int nevents)
 encodes all midi ports in the cache to events (silence)
unsigned int fillDataPacketHeader (struct iec61883_packet *packet, unsigned int *length, uint32_t ts)
unsigned int fillNoDataPacketHeader (struct iec61883_packet *packet, unsigned int *length)
unsigned int getFDF ()
unsigned int getSytInterval ()
bool initPortCache ()
int transmitBlock (char *data, unsigned int nevents, unsigned int offset)
void updatePortCache ()

Private Attributes

std::vector< struct
_MBLA_port_cache > 
struct iec61883_cip m_cip_status
unsigned int m_dbc
int m_dimension
int m_fdf
int m_max_cycles_to_transmit_early
std::vector< struct
_MIDI_port_cache > 
int m_min_cycles_before_presentation
int m_nb_audio_ports
int m_nb_midi_ports
unsigned int m_syt_interval
unsigned int m_transmit_transfer_delay


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