mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-08-12 18:38:42 +00:00
调整类名称
This commit is contained in:
parent
aca8d23f3e
commit
28259c30fc
3 changed files with 21 additions and 21 deletions
|
@ -1,18 +1,18 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
#include "convert.h"
|
#include "avframeconvert.h"
|
||||||
|
|
||||||
Convert::Convert()
|
AVFrameConvert::AVFrameConvert()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Convert::~Convert()
|
AVFrameConvert::~AVFrameConvert()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Convert::setSrcFrameInfo(quint32 srcWidth, quint32 srcHeight, AVPixelFormat srcFormat)
|
void AVFrameConvert::setSrcFrameInfo(quint32 srcWidth, quint32 srcHeight, AVPixelFormat srcFormat)
|
||||||
{
|
{
|
||||||
m_srcWidth = srcWidth;
|
m_srcWidth = srcWidth;
|
||||||
m_srcHeight = srcHeight;
|
m_srcHeight = srcHeight;
|
||||||
|
@ -20,28 +20,28 @@ void Convert::setSrcFrameInfo(quint32 srcWidth, quint32 srcHeight, AVPixelFormat
|
||||||
qDebug() << "Convert::src frame info " << srcWidth << "x" << srcHeight;
|
qDebug() << "Convert::src frame info " << srcWidth << "x" << srcHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Convert::getSrcFrameInfo(quint32& srcWidth, quint32& srcHeight, AVPixelFormat& srcFormat)
|
void AVFrameConvert::getSrcFrameInfo(quint32& srcWidth, quint32& srcHeight, AVPixelFormat& srcFormat)
|
||||||
{
|
{
|
||||||
srcWidth = m_srcWidth;
|
srcWidth = m_srcWidth;
|
||||||
srcHeight = m_srcHeight;
|
srcHeight = m_srcHeight;
|
||||||
srcFormat = m_srcFormat;
|
srcFormat = m_srcFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Convert::setDstFrameInfo(quint32 dstWidth, quint32 dstHeight, AVPixelFormat dstFormat)
|
void AVFrameConvert::setDstFrameInfo(quint32 dstWidth, quint32 dstHeight, AVPixelFormat dstFormat)
|
||||||
{
|
{
|
||||||
m_dstWidth = dstWidth;
|
m_dstWidth = dstWidth;
|
||||||
m_dstHeight = dstHeight;
|
m_dstHeight = dstHeight;
|
||||||
m_dstFormat = dstFormat;
|
m_dstFormat = dstFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Convert::getDstFrameInfo(quint32& dstWidth, quint32& dstHeight, AVPixelFormat& dstFormat)
|
void AVFrameConvert::getDstFrameInfo(quint32& dstWidth, quint32& dstHeight, AVPixelFormat& dstFormat)
|
||||||
{
|
{
|
||||||
dstWidth = m_dstWidth;
|
dstWidth = m_dstWidth;
|
||||||
dstHeight = m_dstHeight;
|
dstHeight = m_dstHeight;
|
||||||
dstFormat = m_dstFormat;
|
dstFormat = m_dstFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Convert::init()
|
bool AVFrameConvert::init()
|
||||||
{
|
{
|
||||||
if (m_convertCtx) {
|
if (m_convertCtx) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -54,12 +54,12 @@ bool Convert::init()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Convert::isInit()
|
bool AVFrameConvert::isInit()
|
||||||
{
|
{
|
||||||
return m_convertCtx ? true : false;
|
return m_convertCtx ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Convert::deInit()
|
void AVFrameConvert::deInit()
|
||||||
{
|
{
|
||||||
if (m_convertCtx) {
|
if (m_convertCtx) {
|
||||||
sws_freeContext(m_convertCtx);
|
sws_freeContext(m_convertCtx);
|
||||||
|
@ -67,7 +67,7 @@ void Convert::deInit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Convert::convert(AVFrame* srcFrame, AVFrame* dstFrame)
|
bool AVFrameConvert::convert(AVFrame* srcFrame, AVFrame* dstFrame)
|
||||||
{
|
{
|
||||||
if(!m_convertCtx || !srcFrame || !dstFrame) {
|
if(!m_convertCtx || !srcFrame || !dstFrame) {
|
||||||
return false;
|
return false;
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef CONVERT_H
|
#ifndef AVFRAMECONVERT_H
|
||||||
#define CONVERT_H
|
#define AVFRAMECONVERT_H
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
|
@ -9,11 +9,11 @@ extern "C"
|
||||||
#include "libavutil/frame.h"
|
#include "libavutil/frame.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
class Convert
|
class AVFrameConvert
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Convert();
|
AVFrameConvert();
|
||||||
virtual ~Convert();
|
virtual ~AVFrameConvert();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void setSrcFrameInfo(quint32 srcWidth, quint32 srcHeight, AVPixelFormat srcFormat);
|
void setSrcFrameInfo(quint32 srcWidth, quint32 srcHeight, AVPixelFormat srcFormat);
|
||||||
|
@ -37,4 +37,4 @@ private:
|
||||||
struct SwsContext *m_convertCtx = Q_NULLPTR;
|
struct SwsContext *m_convertCtx = Q_NULLPTR;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CONVERT_H
|
#endif // AVFRAMECONVERT_H
|
|
@ -1,12 +1,12 @@
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
$$PWD/convert.h \
|
|
||||||
$$PWD/decoder.h \
|
$$PWD/decoder.h \
|
||||||
$$PWD/frames.h \
|
$$PWD/frames.h \
|
||||||
$$PWD/fpscounter.h
|
$$PWD/fpscounter.h \
|
||||||
|
$$PWD/avframeconvert.h
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
$$PWD/convert.cpp \
|
|
||||||
$$PWD/decoder.cpp \
|
$$PWD/decoder.cpp \
|
||||||
$$PWD/frames.cpp \
|
$$PWD/frames.cpp \
|
||||||
$$PWD/fpscounter.cpp
|
$$PWD/fpscounter.cpp \
|
||||||
|
$$PWD/avframeconvert.cpp
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue