diff --git a/src/videodevice.h b/src/videodevice.h index a391423acd0e2709a1113c7624246c9d5d7bb981..4a6bc60b2524532fcc2b84150ba14b299fc5eb69 100644 --- a/src/videodevice.h +++ b/src/videodevice.h @@ -31,28 +31,21 @@ typedef QString VideoChannel; typedef QString VideoRate; ///@struct Resolution Equivalent of "640x480" -struct LIB_EXPORT Resolution { +class LIB_EXPORT Resolution : public QSize { +public: //Constructor - explicit Resolution(uint _width, uint _height):width(_width),height(_height){} + explicit Resolution(uint _width, uint _height):QSize(_width,_height){} Resolution(QString size) { if (size.split("x").size() == 2) { - width=size.split("x")[0].toInt(); - height=size.split("x")[1].toInt(); + setWidth(size.split("x")[0].toInt()); + setHeight(size.split("x")[1].toInt()); } } - Resolution(const Resolution& res):width(res.width),height(res.height){} - Resolution(const QSize& size):width(size.width()),height(size.height()){} + Resolution(const Resolution& res):QSize(res.width(),res.height()){} + Resolution(const QSize& size):QSize(size){} //Getter - const QString toString() const { return QString::number(width)+"x"+QString::number(height);} + const QString toString() const { return QString::number(width())+"x"+QString::number(height());} - //Attributes - uint width; - uint height; - - //Operator - bool operator==(const Resolution& other) { - return (other.width == width && other.height == height); - } }; ///VideoDevice: V4L devices used to record video for video call diff --git a/src/videorenderer.cpp b/src/videorenderer.cpp index 78947b8061a0120322b0c35b82eb3ccb69626759..97e532d2a5397b388849260f47b972a3971ffdce 100644 --- a/src/videorenderer.cpp +++ b/src/videorenderer.cpp @@ -46,9 +46,9 @@ VideoRenderer::VideoRenderer(QString shmPath, Resolution res): QObject(0), m_pShmArea((SHMHeader*)MAP_FAILED), m_ShmAreaLen(0), m_BufferGen(0), m_isRendering(false),m_pTimer(nullptr),m_Res(res) { - m_ShmPath = shmPath ; - m_Width = res.width ; - m_Height = res.height ; + m_ShmPath = shmPath ; + m_Width = res.width() ; + m_Height = res.height() ; } ///Destructor