|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
24 #define DBG_TIME_PERIOD_PRINTS 10 //10 sec
53 if(
nullptr == delegate)
91 static bool isFirst =
true;
93 double start_timeCopy;
95 static double last_call;
96 static double sumOf_timeBetweenCalls=0;
98 static double sumOf_timeOnMutex = 0;
99 static double sumOf_timeOfCopyPerPahse[5] ={0};
100 static uint32_t count=0;
101 static uint32_t countPerPhase[5]={0};
102 #define MAX_COUNT 100
107 last_call = start_time;
112 sumOf_timeBetweenCalls+=(start_time -last_call);
113 last_call = start_time;
124 cursor = (
char*)(img.getRawImage());
125 remaining = img.getRawImageSize();
130 remaining = blobHeader.
blobLen;
138 decoder->
mutex.lock();
145 decoder->
mutex.unlock();
148 sumOf_timeOnMutex +=(end_time - start_time);
153 "STREAM On %d times: timeOnMutex is long %.6f sec",
154 MAX_COUNT, (sumOf_timeOnMutex/MAX_COUNT) );
155 for(
int x=0; x<5; x++)
158 "STREAM: phase:%d, count=%u, time=%.6f sec",
161 ((countPerPhase[x]==0) ? 0: sumOf_timeOfCopyPerPahse[x]/countPerPhase[x]) );
162 countPerPhase[x] = 0;
163 sumOf_timeOfCopyPerPahse[x] = 0;
169 sumOf_timeOnMutex = 0;
170 sumOf_timeBetweenCalls = 0;
182 decoder->
mutex.unlock();
191 cursor = (
char*)(&imgHeader);
192 remaining =
sizeof(imgHeader);
197 size_t allow = remaining;
207 memcpy(b.
get(),cursor,allow);
213 sumOf_timeOfCopyPerPahse[phase] +=(end_time - start_timeCopy);
214 countPerPhase[phase]++;
235 delegate->getOutputStream().write(b);
Simple specification of the minimum functions needed from output streams.
double now()
Return the current time in seconds, relative to an arbitrary starting point.
InputStream & getInputStream() override
Get an InputStream to read from.
H264Stream(h264Decoder_cfgParamters &config)
A stream abstraction for datagram communication.
A simple abstraction for a block of bytes.
void write(const yarp::os::Bytes &b) override
Write a block of bytes to the stream.
OutputStream & getOutputStream() override
Get an OutputStream to write to.
An interface to the operating system, including Port based communication.
#define yCDebug(component,...)
bool setReadEnvelopeCallback(InputStream::readEnvelopeCallbackType callback, void *data) override
bool waitWithTimeout(double timeoutInSeconds)
Try to decrement the counter, even if we must wait - but don't wait forever.
#define yCTrace(component,...)
bool setStream(yarp::os::impl::DgramTwoWayStream *stream)
const yarp::os::LogComponent & H264CARRIER()
bool newFrameIsAvailable()
yarp::sig::ImageOf< yarp::sig::PixelRgb > & getLastFrame()
yarp::os::Semaphore semaphore