MythTV master
mythdrmmode.cpp
Go to the documentation of this file.
1// MythTV
3
7DRMMode MythDRMMode::Create(drmModeModeInfoPtr Mode, int Index)
8{
9 if (auto mode = std::shared_ptr<MythDRMMode>(new MythDRMMode(Mode, Index)); mode && mode->m_rate > 1.0)
10 return mode;
11 return nullptr;
12}
13
14MythDRMMode::MythDRMMode(drmModeModeInfoPtr Mode, int Index)
15{
16 if (Mode)
17 {
18 m_index = Index;
19 m_rate = (Mode->clock * 1000.0) / (Mode->htotal * Mode->vtotal);
20 m_width = Mode->hdisplay;
21 m_height = Mode->vdisplay;
22 m_flags = Mode->flags;
23 m_name = Mode->name;
24 if (Mode->flags & DRM_MODE_FLAG_INTERLACE)
25 m_rate *= 2.0;
26 if (Mode->flags & DRM_MODE_FLAG_DBLSCAN)
27 m_rate /= 2.0;
28 }
29}
MythDRMMode(drmModeModeInfoPtr Mode, int Index)
Definition: mythdrmmode.cpp:14
double m_rate
Definition: mythdrmmode.h:16
uint32_t m_flags
Definition: mythdrmmode.h:19
static DRMMode Create(drmModeModeInfoPtr Mode, int Index)
Definition: mythdrmmode.cpp:7
uint16_t m_height
Definition: mythdrmmode.h:18
QString m_name
Definition: mythdrmmode.h:20
uint16_t m_width
Definition: mythdrmmode.h:17
#define DRM_MODE_FLAG_INTERLACE
std::shared_ptr< class MythDRMMode > DRMMode
Definition: mythdrmmode.h:7
Mode
Definition: synaesthesia.h:20