Skip to content

Commit

Permalink
Show file tree
Hide file tree
Showing 29 changed files with 98 additions and 182 deletions.
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/dbcheck.cpp
Expand Up @@ -3595,7 +3595,7 @@ nullptr
if (olddecoder == "vaapi2")
newdecoder = "vaapi";

auto UpdateDeinterlacer = [](QString Olddeint, QString &Newdeint, QString Decoder)
auto UpdateDeinterlacer = [](const QString &Olddeint, QString &Newdeint, const QString &Decoder)
{
if (Olddeint.isEmpty())
{
Expand Down Expand Up @@ -3642,7 +3642,7 @@ nullptr
UpdateDeinterlacer(olddeint0, newdeint0, decoder);
UpdateDeinterlacer(olddeint1, newdeint1, decoder);

auto UpdateData = [](uint ProfileID, QString Value, QString Data)
auto UpdateData = [](uint ProfileID, const QString &Value, const QString &Data)
{
MSqlQuery update(MSqlQuery::InitCon());
update.prepare(
Expand Down
4 changes: 0 additions & 4 deletions mythtv/libs/libmythtv/decoders/mythv4l2m2mcontext.cpp
Expand Up @@ -30,10 +30,6 @@ MythV4L2M2MContext::MythV4L2M2MContext(DecoderBase *Parent, MythCodecID CodecID)
{
}

MythV4L2M2MContext::~MythV4L2M2MContext()
{
}

inline uint32_t V4L2CodecType(AVCodecID Id)
{
switch (Id)
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/decoders/mythv4l2m2mcontext.h
Expand Up @@ -8,7 +8,7 @@ class MythV4L2M2MContext : public MythDRMPRIMEContext
{
public:
MythV4L2M2MContext(DecoderBase *Parent, MythCodecID CodecID);
~MythV4L2M2MContext() override;
~MythV4L2M2MContext() = default;
static MythCodecID GetSupportedCodec (AVCodecContext **Context,
AVCodec **Codec,
const QString &Decoder,
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/decoders/mythvdpauhelper.cpp
Expand Up @@ -478,7 +478,7 @@ bool MythVDPAUHelper::IsFeatureAvailable(uint Feature)
QSize MythVDPAUHelper::GetSurfaceParameters(VdpVideoSurface Surface, VdpChromaType &Chroma)
{
if (!Surface)
return QSize();
return {};

uint width = 0;
uint height = 0;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/mpeg/mpegdescriptors.cpp
Expand Up @@ -387,7 +387,7 @@ QString MPEGDescriptor::DescriptorTagString(void) const
if (IsValid()) { DESC_NAME d(_data, DescriptorLength()+2); \
if (d.IsValid()) str = d.toString(); } } while (false)

QString MPEGDescriptor::descrDump(QString name) const
QString MPEGDescriptor::descrDump(const QString &name) const
{
QString str;
str = QString("%1 Descriptor (0x%2) length(%3). Dumping\n")
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/mpeg/mpegdescriptors.h
Expand Up @@ -314,7 +314,7 @@ class MTV_PUBLIC MPEGDescriptor

public:
QString hexdump(void) const;
QString descrDump(QString name) const;
QString descrDump(const QString &name) const;
};

// a_52a.pdf p119, Table A1
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/mythcodecid.cpp
Expand Up @@ -688,7 +688,7 @@ QString get_decoder_name(MythCodecID codec_id)
return "mmal";
if (codec_is_mmal_dec(codec_id))
return "mmal-dec";
else if (codec_is_drmprime(codec_id))
if (codec_is_drmprime(codec_id))
return "drmprime";
return "ffmpeg";
}
8 changes: 3 additions & 5 deletions mythtv/libs/libmythtv/opengl/mythnvdecinterop.cpp
Expand Up @@ -8,19 +8,17 @@

#define CUDA_CHECK(CUDA_FUNCS, CUDA_CALL) \
{ \
CUresult res = CUDA_FUNCS->CUDA_CALL; \
CUresult res = (CUDA_FUNCS)->CUDA_CALL; \
if (res != CUDA_SUCCESS) { \
const char * desc; \
CUDA_FUNCS->cuGetErrorString(res, &desc); \
(CUDA_FUNCS)->cuGetErrorString(res, &desc); \
LOG(VB_GENERAL, LOG_ERR, LOC + QString("CUDA error %1 (%2)").arg(res).arg(desc)); \
} \
}

MythNVDECInterop::MythNVDECInterop(MythRenderOpenGL *Context)
: MythOpenGLInterop(Context, NVDEC),
m_cudaContext(),
m_cudaFuncs(nullptr),
m_referenceFrames()
m_cudaContext()
{
InitialiseCuda();
}
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/opengl/mythnvdecinterop.h
Expand Up @@ -37,7 +37,7 @@ class MythNVDECInterop : public MythOpenGLInterop
void RotateReferenceFrames(CUdeviceptr Buffer);

CUcontext m_cudaContext;
CudaFunctions *m_cudaFuncs;
CudaFunctions *m_cudaFuncs { nullptr };
QVector<CUdeviceptr> m_referenceFrames;
};

Expand Down
9 changes: 2 additions & 7 deletions mythtv/libs/libmythtv/opengl/mythopenglinterop.cpp
Expand Up @@ -199,15 +199,10 @@ vector<MythVideoTexture*> MythOpenGLInterop::Retrieve(MythRenderOpenGL *Context,
}

MythOpenGLInterop::MythOpenGLInterop(MythRenderOpenGL *Context, Type InteropType)
: QObject(),
ReferenceCounter("GLInterop", true),
: ReferenceCounter("GLInterop", true),
m_context(Context),
m_type(InteropType),
m_openglTextures(),
m_openglTextureSize(),
m_discontinuityCounter(0),
m_defaultFree(nullptr),
m_defaultUserOpaque(nullptr)
m_openglTextureSize()
{
if (m_context)
m_context->IncrRef();
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/opengl/mythopenglinterop.h
Expand Up @@ -71,10 +71,10 @@ class MythOpenGLInterop : public QObject, public ReferenceCounter
Type m_type;
QHash<unsigned long long, vector<MythVideoTexture*> > m_openglTextures;
QSize m_openglTextureSize;
long long m_discontinuityCounter;
long long m_discontinuityCounter { 0 };

FreeAVHWDeviceContext m_defaultFree;
void *m_defaultUserOpaque;
FreeAVHWDeviceContext m_defaultFree { nullptr };
void *m_defaultUserOpaque { nullptr };
};

#endif // MYTHOPENGLINTEROP_H
23 changes: 2 additions & 21 deletions mythtv/libs/libmythtv/opengl/mythopenglvideo.cpp
Expand Up @@ -26,35 +26,16 @@ MythOpenGLVideo::MythOpenGLVideo(MythRenderOpenGL *Render, VideoColourSpace *Col
QSize VideoDim, QSize VideoDispDim,
QRect DisplayVisibleRect, QRect DisplayVideoRect, QRect VideoRect,
bool ViewportControl, QString Profile)
: QObject(),
m_valid(false),
m_profile(std::move(Profile)),
m_inputType(FMT_NONE),
m_outputType(FMT_NONE),
: m_profile(std::move(Profile)),
m_render(Render),
m_videoDispDim(VideoDispDim),
m_videoDim(VideoDim),
m_masterViewportSize(DisplayVisibleRect.size()),
m_displayVideoRect(DisplayVideoRect),
m_videoRect(VideoRect),
m_deinterlacer(MythDeintType::DEINT_NONE),
m_deinterlacer2x(false),
m_fallbackDeinterlacer(MythDeintType::DEINT_NONE),
m_videoColourSpace(ColourSpace),
m_viewportControl(ViewportControl),
m_inputTextures(),
m_prevTextures(),
m_nextTextures(),
m_frameBuffer(nullptr),
m_frameBufferTexture(nullptr),
m_inputTextureSize(m_videoDim),
m_features(),
m_extraFeatures(0),
m_resizing(false),
m_textureTarget(QOpenGLTexture::Target2D),
m_discontinuityCounter(0),
m_lastRotation(0),
m_chromaUpsamplingFilter(false)
m_inputTextureSize(m_videoDim)
{
if (!m_render || !m_videoColourSpace)
return;
Expand Down
30 changes: 15 additions & 15 deletions mythtv/libs/libmythtv/opengl/mythopenglvideo.h
Expand Up @@ -67,35 +67,35 @@ class MythOpenGLVideo : public QObject
bool AddDeinterlacer(const VideoFrame *Frame, FrameScanType Scan,
MythDeintType Filter = DEINT_SHADER, bool CreateReferences = true);

bool m_valid;
bool m_valid { false };
QString m_profile;
VideoFrameType m_inputType; ///< Usually YV12 for software, VDPAU etc for hardware
VideoFrameType m_outputType; ///< Set by profile for software or decoder for hardware
MythRenderOpenGL *m_render;
VideoFrameType m_inputType { FMT_NONE }; ///< Usually YV12 for software, VDPAU etc for hardware
VideoFrameType m_outputType { FMT_NONE }; ///< Set by profile for software or decoder for hardware
MythRenderOpenGL *m_render { nullptr };
QSize m_videoDispDim; ///< Useful video frame size e.g. 1920x1080
QSize m_videoDim; ///< Total video frame size e.g. 1920x1088
QSize m_masterViewportSize; ///< Current viewport into which OpenGL is rendered, usually the window size
QRect m_displayVideoRect; ///< Sub-rect of display_visible_rect for video
QRect m_videoRect; ///< Sub-rect of video_disp_dim to display (after zoom adjustments etc)
MythDeintType m_deinterlacer;
bool m_deinterlacer2x;
MythDeintType m_fallbackDeinterlacer; ///< Only used if there are insufficient texture units (for kernel)
MythDeintType m_deinterlacer { MythDeintType::DEINT_NONE };
bool m_deinterlacer2x { false };
MythDeintType m_fallbackDeinterlacer { MythDeintType::DEINT_NONE }; ///< Only used if there are insufficient texture units (for kernel)
VideoColourSpace *m_videoColourSpace;
bool m_viewportControl; ///< Video has control over view port
QOpenGLShaderProgram* m_shaders[ShaderCount] { nullptr };
int m_shaderCost[ShaderCount] { 1 };
vector<MythVideoTexture*> m_inputTextures; ///< Current textures with raw video data
vector<MythVideoTexture*> m_prevTextures; ///< Previous textures with raw video data
vector<MythVideoTexture*> m_nextTextures; ///< Next textures with raw video data
QOpenGLFramebufferObject* m_frameBuffer;
MythVideoTexture* m_frameBufferTexture;
QOpenGLFramebufferObject* m_frameBuffer { nullptr };
MythVideoTexture* m_frameBufferTexture { nullptr };
QSize m_inputTextureSize; ///< Actual size of input texture(s)
QOpenGLFunctions::OpenGLFeatures m_features; ///< Default features available from Qt
int m_extraFeatures; ///< OR'd list of extra, Myth specific features
bool m_resizing;
GLenum m_textureTarget; ///< Some interops require custom texture targets
long long m_discontinuityCounter; ///< Check when to release reference frames after a skip
int m_lastRotation; ///< Track rotation for pause frame
bool m_chromaUpsamplingFilter; /// Attempt to fix Chroma Upsampling Error in shaders
int m_extraFeatures { 0 }; ///< OR'd list of extra, Myth specific features
bool m_resizing { false };
GLenum m_textureTarget { QOpenGLTexture::Target2D }; ///< Some interops require custom texture targets
long long m_discontinuityCounter { 0 }; ///< Check when to release reference frames after a skip
int m_lastRotation { 0 }; ///< Track rotation for pause frame
bool m_chromaUpsamplingFilter { false }; /// Attempt to fix Chroma Upsampling Error in shaders
};
#endif // MYTH_OPENGL_VIDEO_H_
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/opengl/mythvaapiinterop.cpp
Expand Up @@ -58,9 +58,9 @@ MythVAAPIInterop* MythVAAPIInterop::Create(MythRenderOpenGL *Context, Type Inter

if (InteropType == VAAPIEGLDRM)
return new MythVAAPIInteropDRM(Context);
else if (InteropType == VAAPIGLXPIX)
if (InteropType == VAAPIGLXPIX)
return new MythVAAPIInteropGLXPixmap(Context);
else if (InteropType == VAAPIGLXCOPY)
if (InteropType == VAAPIGLXCOPY)
return new MythVAAPIInteropGLXCopy(Context);
return nullptr;
}
Expand Down
16 changes: 2 additions & 14 deletions mythtv/libs/libmythtv/opengl/mythvideooutopengl.cpp
Expand Up @@ -97,19 +97,7 @@ void MythVideoOutputOpenGL::GetRenderOptions(RenderOptions &Options)
}

MythVideoOutputOpenGL::MythVideoOutputOpenGL(QString Profile)
: MythVideoOutput(),
m_render(nullptr),
m_isGLES2(false),
m_openGLVideo(nullptr),
m_openGLVideoPiPActive(nullptr),
m_openGLPainter(nullptr),
m_videoProfile(std::move(Profile)),
m_newCodecId(kCodec_NONE),
m_newVideoDim(),
m_newVideoDispDim(),
m_newAspect(0.0F),
m_buffersCreated(false),
m_openGLPerf(nullptr)
: m_videoProfile(std::move(Profile))
{
// Setup display switching
if (gCoreContext->GetBoolSetting("UseVideoModes", false))
Expand Down Expand Up @@ -271,7 +259,7 @@ bool MythVideoOutputOpenGL::Init(const QSize &VideoDim, const QSize &VideoDispDi

bool MythVideoOutputOpenGL::InputChanged(const QSize &VideoDim, const QSize &VideoDispDim,
float Aspect, MythCodecID CodecId, bool &AspectOnly,
MythMultiLocker*, int ReferenceFrames,
MythMultiLocker* /*Locks*/, int ReferenceFrames,
bool ForceChange)
{
QSize currentvideodim = m_window.GetVideoDim();
Expand Down
18 changes: 9 additions & 9 deletions mythtv/libs/libmythtv/opengl/mythvideooutopengl.h
Expand Up @@ -51,22 +51,22 @@ class MythVideoOutputOpenGL : public MythVideoOutput
bool CreateBuffers(MythCodecID CodecID, QSize Size);
QRect GetDisplayVisibleRect(void);

MythRenderOpenGL *m_render;
bool m_isGLES2;
MythOpenGLVideo *m_openGLVideo;
MythRenderOpenGL *m_render { nullptr };
bool m_isGLES2 { false };
MythOpenGLVideo *m_openGLVideo { nullptr };
QMap<MythPlayer*,MythOpenGLVideo*> m_openGLVideoPiPs;
QMap<MythPlayer*,bool> m_openGLVideoPiPsReady;
MythOpenGLVideo *m_openGLVideoPiPActive;
MythOpenGLPainter *m_openGLPainter;
MythOpenGLVideo *m_openGLVideoPiPActive { nullptr };
MythOpenGLPainter *m_openGLPainter { nullptr };
QString m_videoProfile;
MythCodecID m_newCodecId;
MythCodecID m_newCodecId { kCodec_NONE };
QSize m_newVideoDim;
QSize m_newVideoDispDim;
float m_newAspect;
bool m_buffersCreated;
float m_newAspect { 0.0F };
bool m_buffersCreated { false };

// performance monitoring (-v gpu)
MythOpenGLPerf *m_openGLPerf;
MythOpenGLPerf *m_openGLPerf { nullptr };
};

#endif
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/tv_play.cpp
Expand Up @@ -8754,7 +8754,7 @@ void TV::ChangeTimeStretch(PlayerContext *ctx, int dir, bool allowEdit)
return;
}

ctx->m_tsNormal = kTimeStretchStep * (int)(new_ts_normal / kTimeStretchStep + 0.5F);
ctx->m_tsNormal = kTimeStretchStep * lroundf(new_ts_normal / kTimeStretchStep);

ctx->LockDeletePlayer(__FILE__, __LINE__);
if (ctx->m_player && !ctx->m_player->IsPaused())
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythtv/videodisplayprofile.cpp
Expand Up @@ -53,14 +53,14 @@ uint ProfileItem::GetPriority(void) const
// If string is blank then assumes a match.
// If value is 0 or negative assume a match (i.e. value unknown assumes a match)
// float values must be no more than 3 decimals.
bool ProfileItem::CheckRange(const QString Key, float Value, bool *Ok) const
bool ProfileItem::CheckRange(const QString &Key, float Value, bool *Ok) const
{
return CheckRange(std::move(Key), Value, 0, true, Ok);
return CheckRange(Key, Value, 0, true, Ok);
}

bool ProfileItem::CheckRange(const QString Key, int Value, bool *Ok) const
bool ProfileItem::CheckRange(const QString &Key, int Value, bool *Ok) const
{
return CheckRange(std::move(Key), 0.0, Value, false, Ok);
return CheckRange(Key, 0.0, Value, false, Ok);
}

bool ProfileItem::CheckRange(const QString& Key,
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/videodisplayprofile.h
Expand Up @@ -50,8 +50,8 @@ class MTV_PUBLIC ProfileItem
QMap<QString,QString> GetAll(void) const;

// Other
bool CheckRange(const QString Key, float Value, bool *Ok = nullptr) const;
bool CheckRange(const QString Key, int Value, bool *Ok = nullptr) const;
bool CheckRange(const QString& Key, float Value, bool *Ok = nullptr) const;
bool CheckRange(const QString& Key, int Value, bool *Ok = nullptr) const;
bool CheckRange(const QString& Key, float FValue, int IValue, bool IsFloat, bool *Ok = nullptr) const;
bool IsMatch(const QSize &Size, float Framerate, const QString &CodecName) const;
bool IsValid(QString *Reason = nullptr) const;
Expand Down
3 changes: 1 addition & 2 deletions mythtv/libs/libmythui/opengl/mythopenglperf.cpp
Expand Up @@ -12,8 +12,7 @@
MythOpenGLPerf::MythOpenGLPerf(QString Name,
QVector<QString> Names,
int SampleCount)
: QOpenGLTimeMonitor(),
m_name(std::move(Name)),
: m_name(std::move(Name)),
m_totalSamples(SampleCount),
m_timerNames(std::move(Names))
{
Expand Down
12 changes: 2 additions & 10 deletions mythtv/libs/libmythui/opengl/mythpainteropengl.cpp
Expand Up @@ -13,16 +13,8 @@
using namespace std;

MythOpenGLPainter::MythOpenGLPainter(MythRenderOpenGL *Render, QWidget *Parent)
: MythPainter(),
m_parent(Parent),
m_render(Render),
m_target(nullptr),
m_swapControl(true),
m_imageToTextureMap(),
m_ImageExpireList(),
m_textureDeleteList(),
m_textureDeleteLock(),
m_mappedTextures()
: m_parent(Parent),
m_render(Render)
{
m_mappedTextures.reserve(MAX_BUFFER_POOL);
}
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythui/opengl/mythpainteropengl.h
Expand Up @@ -55,10 +55,10 @@ class MUI_PUBLIC MythOpenGLPainter : public MythPainter
void DeleteFormatImagePriv(MythImage *Image) override;

protected:
QWidget *m_parent;
MythRenderOpenGL *m_render;
QOpenGLFramebufferObject* m_target;
bool m_swapControl;
QWidget *m_parent { nullptr };
MythRenderOpenGL *m_render { nullptr };
QOpenGLFramebufferObject* m_target { nullptr };
bool m_swapControl { true };

QMap<MythImage *, MythGLTexture*> m_imageToTextureMap;
std::list<MythImage *> m_ImageExpireList;
Expand Down

0 comments on commit 6c1b08a

Please sign in to comment.