HosrDiretta
Loading...
Searching...
No Matches
DIRETTA::SyncBuffer Class Reference

Builds the send buffer for Sync. More...

#include <SyncBuffer.hpp>

Inheritance diagram for DIRETTA::SyncBuffer:
DIRETTA::Sync DIRETTA::Connection

Public Member Functions

 ~SyncBuffer ()
 Destructor.
 
void setupBuffer (size_t, size_t, bool=false, FormatConfigure=FormatConfigure())
 Set up the buffer for data transmission.
 
StreamwriteStreamStart (bool &)
 
bool checkStreamStart () const
 
void addStream (Stream &)
 
void setStream (Stream &)
 Set the stream for data transmission. push mode.
 
bool connect (bool, int)
 Begin connecting to the sink.
 
void play ()
 start playback
 
void stop ()
 stop playback (pause)
 
void pre_disconnect (bool=false)
 Pre-disconnect the sink.
 
void disconnect (bool=true)
 Disconnect from the sink. Declare the end of buffer writing.
 
void disconnectWait ()
 Wait for disconnection to complete.
 
void close ()
 Close the sync buffer and release resources.
 
void BufferWorker ()
 
size_t getLastBufferCount ()
 
bool buffer_empty ()
 
void seek (int64_t)
 
void seek_front ()
 
 Sync ()
 Constructor self socket.
 
 Sync (ACQUA::EthernetSocket &udp, ACQUA::EthernetSocket *raw)
 constructor with socket
 
- Public Member Functions inherited from DIRETTA::Sync
 Sync ()
 Constructor self socket.
 
 Sync (ACQUA::EthernetSocket &udp, ACQUA::EthernetSocket *raw)
 constructor with socket
 
 ~Sync ()
 Destructor.
 
bool open (THRED_MODE mode, ACQUA::Clock info, uint16_t ifno, const std::string &name, std::uint64_t id, int cpuMain, int cpuOther, int rngOther, MSMODE msMode)
 open
 
void changeWorkMode (THRED_MODE)
 
THRED_MODE currentWorkMode () const
 get current thread mode
 
THRED_MODE currentWorkMode (int &cpuMain, int &cpuOther, int &rngOther) const
 get current thread mode with cpu occupied
 
void setHostInvertPhase (bool)
 set host invert phase (When the data being written is reversed)
 
bool setSink (const ACQUA::IPAddress &, ACQUA::Clock, bool, std::uint32_t)
 setup sink connection
 
bool setSinkConfigure (FormatConfigure)
 set sink playback format
 
void setConfigTransfer (const Profile &)
 set sync profile(Configure the transmission cycle using a Profile. A Profile must be set up beforehand.)
 
ProfileMaker getProfileMaker (ACQUA::Clock)
 get ProfileMaker for creating Profile
 
void configTransferAuto (ACQUA::Clock, ACQUA::Clock, ACQUA::Clock)
 Configure automatic data transfer settings based on the specified cycle time.
 
bool configTransferFix (ACQUA::Clock, int)
 fix-cycle configuration
 
bool configTransferVar (ACQUA::Clock, int)
 variable-cycle configuration
 
void configTransferVarMax (ACQUA::Clock)
 Adjust to use the maximum network packet size configuration.
 
bool configTransferFixAuto (ACQUA::Clock)
 
bool configTransferVarAuto (ACQUA::Clock)
 
bool configTransferRandom (ACQUA::Clock, ACQUA::Clock, int)
 random-cycle configuration
 
ACQUA::Clock getCycleTime () const
 get Generated transmission interval
 
ACQUA::Clock getMinCycleTime () const
 get Minimum transmission interval
 
std::size_t getCycleSize () const
 get Stream data size per transmission
 
std::size_t getCyclePackets () const
 get Stream packet count per transmission
 
Profile::ModeType getMode () const
 get Send Profile Mode
 
bool connectPrepare (bool=true)
 prepare to connect
 
bool connect (int)
 connect to sink
 
bool connectWait ()
 wait for connection completion
 
void disconnect_flgset ()
 Set the flag to start cutting.
 
void disconnect (bool wait=true)
 disconnect from sink
 
bool disconnectWait ()
 wait for disconnection completion
 
void play ()
 start playback
 
void stop ()
 stop playback(pause)
 
bool isPlay () const
 is playing
 
void close ()
 close sync
 
bool is_connect ()
 check connection state
 
bool is_online ()
 check online state
 
bool is_disconnect ()
 check disconnect state
 
bool is_active ()
 check active state
 
ACQUA::Clock getLatency ()
 get sink latency
 
bool checkSinkSupport (FormatConfigure) const
 check sink format support
 
const FormatConfiguregetSinkConfigure () const
 get sink format configuration
 
bool inquirySupportFormat (const ACQUA::IPAddress &)
 Retrieve the supported formats for Sink.
 
bool inquiryParameter (const ACQUA::IPAddress &, std::uint32_t, std::uint32_t)
 Retrieve the TargetProfile for the Sink.
 
std::uint32_t mtuTest (const ACQUA::IPAddress &, std::uint16_t, std::uint32_t)
 MTU test.
 
bool mtuCheck (const ACQUA::IPAddress &, std::uint32_t &)
 MTU check.
 
std::uint32_t getNoneBaseMin () const
 get minimum frame size without base rate
 
std::uint32_t getFrameMax () const
 get maximum frame size without base rate
 
bool syncWorker ()
 sync worker process
 
const InfogetSinkInfo () const
 get sink information
 
- Public Member Functions inherited from DIRETTA::Connection
 Connection ()
 create connection
 
 Connection (ACQUA::EthernetSocket &)
 create connection with socket
 
 ~Connection ()
 destroy connection
 
void setAdditionalAddress (const std::list< ACQUA::IPAddress > &add)
 Configure the address of a Target that cannot respond to multicast.
 

Protected Member Functions

virtual bool getNewStream (diretta_stream &)
 Callback for retrieving the send stream from the send thread (Must be processed by Atomic)
 
virtual bool getNewStreamCmp ()
 
virtual void notifyStreamDone (Stream &, bool)
 Callback for retrieving the playback buffer.
 
virtual bool startBufferWorker ()
 
virtual void statusUpdate ()
 
- Protected Member Functions inherited from DIRETTA::Sync
virtual bool startSyncWorker ()
 
- Protected Member Functions inherited from DIRETTA::Connection
bool open (ACQUA::IPAddress &)
 open socket
 
void close ()
 close socket
 
bool sendAck (const ConnectionBuffer &, const ACQUA::IPAddress &, MessageID, ConnectionBuffer &, ACQUA::Clock=ACQUA::Clock::MilliSeconds(30))
 Send message and wait for response.
 
bool send (const ConnectionBuffer &data)
 Send message.
 
bool receive (ConnectionBuffer &data, ACQUA::IPAddress &add, ACQUA::Clock wtt=ACQUA::Clock())
 Receive message.
 
bool member (const ACQUA::IPAddress &addme)
 Begin receiving multicast data (join members)
 
bool sendMulti (const ConnectionBuffer &msg, MessageID respMsg, std::map< ACQUA::IPAddress, std::unique_ptr< ConnectionBuffer > > &resalt, bool)
 Send message to multiple message and wait for response.
 
std::list< IfInfogetIfList (bool, bool discash=false)
 Get network interfaces.
 
bool getIfMTU (std::uint32_t, std::uint32_t &)
 Get MTU of interface.
 
 operator ACQUA::EthernetSocket * ()
 Get socket object pointer.
 

Additional Inherited Members

- Public Types inherited from DIRETTA::Sync
enum  THRED_MODE {
  CRITICAL =1 , NOSHORTSLEEP =2 , NOSLEEP4CORE =4 , OCCUPIED =16 ,
  FEEDBACKOFFSET =32 , FEEDBACKMASK =0x7*FEEDBACKOFFSET , NOFASTFEEDBACK = 256 , IDLEONE =512 ,
  IDLEALL =1024 , NOSLEEPFORCE =2048 , LIMITRESEND =4096 , NOJUMBOFRAME =8192 ,
  NOFIREWALL =16384 , NORAWSOCKET =32768
}
 Thread mode enumeration bit or. More...
 
enum  MSMODE {
  MSMODE_NONE =0 , MSMODE_MS1 =1 , MSMODE_MS2 =2 , MSMODE_MS3 =4 ,
  MSMODE_AUTO =4+1
}
 Multi-Stream Mode. More...
 
- Static Protected Member Functions inherited from DIRETTA::Connection
static void dumpfile (ACQUA::BufferCS_const, const std::string &=std::string())
 Dump packet data during debugging.
 
- Protected Attributes inherited from DIRETTA::Connection
std::list< IfInfoIfList
 
bool IfListLoop
 
ACQUA::EthernetSocketudpCn
 
const bool udpSelf
 

Detailed Description

Builds the send buffer for Sync.

Member Function Documentation

◆ connect()

bool DIRETTA::SyncBuffer::connect ( bool ,
int  )

Begin connecting to the sink.

Parameters
trueis callbacl mode. false is push mode.
CPUnumber of the main thread (when occupied)
Returns
success or failure

◆ disconnect()

void DIRETTA::SyncBuffer::disconnect ( bool = true)

Disconnect from the sink. Declare the end of buffer writing.

Parameters
trueAutomatically terminates when the buffer is exhausted

◆ getNewStream()

virtual bool DIRETTA::SyncBuffer::getNewStream ( diretta_stream & )
protectedvirtual

Callback for retrieving the send stream from the send thread (Must be processed by Atomic)

Parameters
streamdiretta_stream to be sent.Base class for Stream(diretta_stream = Stream copy to the base struct Stream::diretta_stream). (The pointer must remain valid until it is dereferenced or this function is called again.)
Returns
false indicates termination; the buffer is not processed at that time.

Implements DIRETTA::Sync.

◆ getNewStreamCmp()

virtual bool DIRETTA::SyncBuffer::getNewStreamCmp ( )
protectedvirtual

Reimplemented from DIRETTA::Sync.

◆ notifyStreamDone()

virtual void DIRETTA::SyncBuffer::notifyStreamDone ( Stream & ,
bool  )
protectedvirtual

Callback for retrieving the playback buffer.

Parameters
bufStream buffer.
Endof playback

◆ setupBuffer()

void DIRETTA::SyncBuffer::setupBuffer ( size_t ,
size_t ,
bool = false,
FormatConfigure = FormatConfigure() )

Set up the buffer for data transmission.

Parameters
FSframe count not byte size)
depth(total size = FS*depth)
Donot generate mute when depleted
formatConfigure format

◆ statusUpdate()

virtual void DIRETTA::SyncBuffer::statusUpdate ( )
protectedvirtual

Reimplemented from DIRETTA::Sync.

◆ Sync()

DIRETTA::Sync::Sync ( ACQUA::EthernetSocket & udp,
ACQUA::EthernetSocket * raw )

constructor with socket

Parameters
udpdata socket
rawdata raw socket (if nullptr not use DDS mode 3)

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