Commit 2ac9bede authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by Sebastien Petitdemange

HwBufferMgr: cosmetics: homogenise code format

parent a677a022
......@@ -139,7 +139,7 @@ class LIMACORE_API BufferCbMgr : public HwFrameCallbackGen
virtual void getBufferFrameDim(const FrameDim& single_frame_dim,
int nb_concat_frames,
FrameDim& buffer_frame_dim);
virtual void acqFrameNb2BufferNb(int acq_frame_nb,int& buffer_nb,
virtual void acqFrameNb2BufferNb(int acq_frame_nb, int& buffer_nb,
int& concat_frame_nb);
private:
......
......@@ -240,16 +240,15 @@ void BufferCbMgr::acqFrameNb2BufferNb(int acq_frame_nb, int& buffer_nb,
getNbBuffers(nb_buffers);
getNbConcatFrames(nb_concat_frames);
if((nb_buffers<1) || (nb_concat_frames < 1)){
if ((nb_buffers < 1) || (nb_concat_frames < 1))
THROW_HW_ERROR(InvalidValue) << "Invalid "
<< DEB_VAR2(nb_buffers, nb_concat_frames);
}
<< DEB_VAR2(nb_buffers,
nb_concat_frames);
buffer_nb = (acq_frame_nb / nb_concat_frames) % nb_buffers;
concat_frame_nb = acq_frame_nb % nb_concat_frames;
DEB_PARAM() << DEB_VAR2(buffer_nb, concat_frame_nb);
DEB_RETURN() << DEB_VAR2(buffer_nb, concat_frame_nb);
}
BufferCbMgr::Cap lima::operator |(BufferCbMgr::Cap c1, BufferCbMgr::Cap c2)
......@@ -305,13 +304,12 @@ void StdBufferCbMgr::allocBuffers(int nb_buffers, int nb_concat_frames,
DEB_PARAM() << DEB_VAR3(nb_buffers, nb_concat_frames, frame_dim);
int frame_size = frame_dim.getMemSize();
if (frame_size <= 0) {
if (frame_size <= 0)
THROW_HW_ERROR(InvalidValue) << "Invalid "
<< DEB_VAR1(frame_dim);
} else if (nb_concat_frames < 1) {
else if (nb_concat_frames < 1)
THROW_HW_ERROR(InvalidValue) << "Invalid "
<< DEB_VAR1(nb_concat_frames);
}
int curr_nb_buffers;
getNbBuffers(curr_nb_buffers);
......@@ -372,21 +370,19 @@ bool StdBufferCbMgr::newFrameReady(HwFrameInfoType& frame_info)
acqFrameNb2BufferNb(frame_info.acq_frame_nb, buffer_nb,
concat_frame_nb);
void *ptr = getBufferPtr(buffer_nb, concat_frame_nb);
if (!frame_info.frame_ptr) {
if (!frame_info.frame_ptr)
frame_info.frame_ptr = ptr;
} else if (frame_info.frame_ptr != ptr) {
DEB_ERROR() << "Invalid " << DEB_VAR1(frame_info.frame_ptr);
else if (frame_info.frame_ptr != ptr)
THROW_HW_ERROR(InvalidValue) << "Invalid "
<< DEB_VAR1(frame_info.frame_ptr);
}
const FrameDim& frame_dim = getFrameDim();
if (!frame_info.frame_dim.isValid()) {
if (!frame_info.frame_dim.isValid())
frame_info.frame_dim = frame_dim;
} else if (frame_info.frame_dim != frame_dim) {
else if (frame_info.frame_dim != frame_dim)
THROW_HW_ERROR(InvalidValue) << "Invalid "
<< DEB_VAR1(frame_info.frame_dim);
}
if (frame_info.valid_pixels == 0)
frame_info.valid_pixels = Point(frame_dim.getSize()).getArea();
......@@ -435,8 +431,8 @@ void *StdBufferCbMgr::getBufferPtr(int buffer_nb, int concat_frame_nb)
void* StdBufferCbMgr::getFrameBufferPtr(int frame_nb)
{
int buffer_nb, concat_frame_nb;
acqFrameNb2BufferNb(frame_nb, buffer_nb,concat_frame_nb);
return getBufferPtr(buffer_nb,concat_frame_nb);
acqFrameNb2BufferNb(frame_nb, buffer_nb, concat_frame_nb);
return getBufferPtr(buffer_nb, concat_frame_nb);
}
void StdBufferCbMgr::clearBuffer(int buffer_nb)
......@@ -554,10 +550,10 @@ void BufferCtrlMgr::setNbBuffers(int nb_buffers)
int max_nb_buffers;
getMaxNbBuffers(max_nb_buffers);
if ((nb_buffers > 0) && (nb_buffers > max_nb_buffers)) {
if ((nb_buffers > 0) && (nb_buffers > max_nb_buffers))
THROW_HW_ERROR(InvalidValue) << "Too many buffers:"
<< DEB_VAR1(nb_buffers);
} else if (nb_buffers == 0)
else if (nb_buffers == 0)
nb_buffers = max_nb_buffers;
DEB_TRACE() << DEB_VAR1(nb_buffers);
......@@ -829,7 +825,8 @@ void SoftBufferCtrlObj::Sync::release(void *address)
AutoMutex aLock(m_cond.mutex());
BufferList::iterator it = m_buffer_in_use.find(address);
if (it == m_buffer_in_use.end())
THROW_HW_ERROR(Error) << "Internal error: releasing buffer not in used list";
THROW_HW_ERROR(Error) << "Internal error: "
<< "releasing buffer not in used list";
m_buffer_in_use.erase(it++);
if (it == m_buffer_in_use.end() || *it != address)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment