MythTV  master
mythvideogpu.cpp
Go to the documentation of this file.
1 // MythTV
2 #include "mythcorecontext.h"
3 #include "mythvideobounds.h"
4 #include "mythvideogpu.h"
5 
6 #define LOC QString("VideoGPU: ")
7 
9  MythVideoBounds* Bounds, QString Profile)
10  : m_render(Render),
11  m_profile(std::move(Profile)),
12  m_videoDispDim(Bounds->GetVideoDispDim()),
13  m_videoDim(Bounds->GetVideoDim()),
14  m_masterViewportSize(Bounds->GetDisplayVisibleRect().size()),
15  m_displayVideoRect(Bounds->GetDisplayVideoRect()),
16  m_videoRect(Bounds->GetVideoRect()),
17  m_videoColourSpace(ColourSpace),
18  m_inputTextureSize(Bounds->GetVideoDim())
19 {
20  if (m_render)
21  m_render->IncrRef();
22 
24  {
27  }
28 
29  m_stereoMode = gCoreContext->GetBoolSetting("DiscardStereo3D", true) ?
31  LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Discard stereoscopic fields: %1")
32  .arg(m_stereoMode == kStereoscopicModeIgnore3D ? "No" : "Yes"));
33 
38 }
39 
41 {
42  if (m_render)
43  m_render->DecrRef();
46 }
47 
50 void MythVideoGPU::UpdateColourSpace(bool PrimariesChanged)
51 {
52  ColourSpaceUpdate(PrimariesChanged);
53 }
54 
56 {
57  return m_valid;
58 }
59 
60 void MythVideoGPU::SetProfile(const QString& Profile)
61 {
62  m_profile = Profile;
63 }
64 
65 QString MythVideoGPU::GetProfile() const
66 {
67  return m_profile;
68 }
69 
71 {
72  m_masterViewportSize = Size;
73 }
74 
76 {
77  return m_videoDim;
78 }
79 
81 {
84  m_inputTextureSize = QSize();
86  // textures are created with Linear filtering - which matches no resize
87  m_resizing = None;
88 }
89 
90 QString MythVideoGPU::VideoResizeToString(VideoResizing Resize)
91 {
92  QStringList reasons;
93  if ((Resize & Deinterlacer) == Deinterlacer) reasons << "Deinterlacer";
94  if ((Resize & Sampling) == Sampling) reasons << "Sampling";
95  if ((Resize & Performance) == Performance) reasons << "Performance";
96  if ((Resize & Framebuffer) == Framebuffer) reasons << "Framebuffer";
97  return reasons.join(",");
98 }
99 
100 void MythVideoGPU::SetVideoDimensions(QSize VideoDim, QSize VideoDispDim)
101 {
102  m_videoDim = VideoDim;
103  m_videoDispDim = VideoDispDim;
104 }
105 
106 void MythVideoGPU::SetVideoRects(QRect DisplayVideoRect, QRect VideoRect)
107 {
108  m_displayVideoRect = DisplayVideoRect;
109  m_videoRect = VideoRect;
110 }
111 
112 void MythVideoGPU::SetViewportRect(QRect DisplayVisibleRect)
113 {
114  SetMasterViewport(DisplayVisibleRect.size());
115 }
MythVideoGPU::m_inputTextureSize
QSize m_inputTextureSize
Definition: mythvideogpu.h:75
MythVideoGPU::Sampling
@ Sampling
Definition: mythvideogpu.h:24
ReferenceCounter::DecrRef
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
Definition: referencecounter.cpp:125
MythVideoGPU::~MythVideoGPU
~MythVideoGPU() override
Definition: mythvideogpu.cpp:40
MythVideoGPU::m_resizing
VideoResizing m_resizing
Definition: mythvideogpu.h:76
MythVideoGPU::IsValid
bool IsValid() const
Definition: mythvideogpu.cpp:55
DEINT_NONE
@ DEINT_NONE
Definition: mythframe.h:64
MythVideoGPU::m_videoColourSpace
MythVideoColourSpace * m_videoColourSpace
Definition: mythvideogpu.h:74
arg
arg(title).arg(filename).arg(doDelete))
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
MythVideoBounds::VideoRectsChanged
void VideoRectsChanged(const QRect &DisplayVideoRect, const QRect &VideoRect)
MythVideoGPU::m_videoDim
QSize m_videoDim
Definition: mythvideogpu.h:70
MythVideoGPU::MythVideoGPU
MythVideoGPU(MythRender *Render, MythVideoColourSpace *ColourSpace, MythVideoBounds *Bounds, QString Profile)
Definition: mythvideogpu.cpp:8
FMT_NONE
@ FMT_NONE
Definition: mythframe.h:17
MythVideoGPU::ColourSpaceUpdate
virtual void ColourSpaceUpdate(bool PrimariesChanged)=0
MythVideoGPU::m_profile
QString m_profile
Definition: mythvideogpu.h:66
MythVideoBounds::SourceChanged
void SourceChanged(QSize VideoDim, QSize VideoDispDim, float Aspect)
Update for new source video dimensions and aspect ratio.
Definition: mythvideobounds.cpp:524
MythVideoGPU::m_videoDispDim
QSize m_videoDispDim
Definition: mythvideogpu.h:69
MythVideoGPU::SetVideoRects
void SetVideoRects(QRect DisplayVideoRect, QRect VideoRect)
Definition: mythvideogpu.cpp:106
kStereoscopicModeIgnore3D
@ kStereoscopicModeIgnore3D
Definition: videoouttypes.h:137
MythVideoGPU::SetViewportRect
void SetViewportRect(QRect DisplayVisibleRect)
Definition: mythvideogpu.cpp:112
MythVideoGPU::SetMasterViewport
void SetMasterViewport(QSize Size)
Definition: mythvideogpu.cpp:70
MythVideoGPU::VideoResizeToString
static QString VideoResizeToString(VideoResizing Resize)
Definition: mythvideogpu.cpp:90
MythVideoGPU::m_deinterlacer
MythDeintType m_deinterlacer
Definition: mythvideogpu.h:78
MythVideoGPU::m_outputType
VideoFrameType m_outputType
Definition: mythvideogpu.h:68
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
MythVideoGPU::m_videoRect
QRect m_videoRect
Definition: mythvideogpu.h:73
MythVideoBounds::VideoSizeChanged
void VideoSizeChanged(const QSize &VideoDim, const QSize &VideoDispDim)
MythVideoGPU::Deinterlacer
@ Deinterlacer
Definition: mythvideogpu.h:23
MythVideoGPU::OutputChanged
void OutputChanged(QSize VideoDim, QSize VideoDispDim, float)
mythvideogpu.h
LOC
#define LOC
Definition: mythvideogpu.cpp:6
MythVideoGPU::m_stereoMode
StereoscopicMode m_stereoMode
Definition: mythvideogpu.h:83
MythVideoBounds
Definition: mythvideobounds.h:24
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:927
MythVideoGPU::m_displayVideoRect
QRect m_displayVideoRect
Definition: mythvideogpu.h:72
MythVideoGPU::m_render
MythRender * m_render
Definition: mythvideogpu.h:64
MythVideoGPU::GetProfile
virtual QString GetProfile() const
Definition: mythvideogpu.cpp:65
mythcorecontext.h
MythVideoColourSpace::Updated
void Updated(bool PrimariesChanged)
MythRender
Definition: mythrender_base.h:24
MythVideoGPU::SetProfile
void SetProfile(const QString &Profile)
Definition: mythvideogpu.cpp:60
MythVideoGPU::m_valid
bool m_valid
Definition: mythvideogpu.h:80
MythVideoGPU::ResetFrameFormat
virtual void ResetFrameFormat()
Definition: mythvideogpu.cpp:80
MythVideoGPU::UpdateColourSpace
void UpdateColourSpace(bool PrimariesChanged)
Definition: mythvideogpu.cpp:50
MythVideoBounds::WindowRectChanged
void WindowRectChanged(const QRect &WindowRect)
MythVideoGPU::None
@ None
Definition: mythvideogpu.h:22
MythVideoGPU::SetVideoDimensions
void SetVideoDimensions(QSize VideoDim, QSize VideoDispDim)
Definition: mythvideogpu.cpp:100
MythVideoGPU::m_masterViewportSize
QSize m_masterViewportSize
Definition: mythvideogpu.h:71
ReferenceCounter::IncrRef
virtual int IncrRef(void)
Increments reference count.
Definition: referencecounter.cpp:101
mythvideobounds.h
kStereoscopicModeSideBySideDiscard
@ kStereoscopicModeSideBySideDiscard
Definition: videoouttypes.h:138
MythVideoColourSpace
MythVideoColourSpace contains a QMatrix4x4 that can convert YCbCr data to RGB.
Definition: mythvideocolourspace.h:21
MythVideoGPU::m_inputType
VideoFrameType m_inputType
Definition: mythvideogpu.h:67
MythVideoGPU::Performance
@ Performance
Definition: mythvideogpu.h:25
MythVideoGPU::GetVideoDim
QSize GetVideoDim() const
Definition: mythvideogpu.cpp:75
MythVideoGPU::Framebuffer
@ Framebuffer
Definition: mythvideogpu.h:26