MythTV  master
videoStreamInfo.h
Go to the documentation of this file.
1 // Program Name: videoStreamInfo.h
3 // Created : May. 30, 2020
4 //
5 // Copyright (c) 2020 Peter Bennett <pbennett@mythtv.org>
6 //
7 // Licensed under the GPL v2 or later, see LICENSE for details
8 //
10 
11 #ifndef VIDEOSTREAMINFO_H_
12 #define VIDEOSTREAMINFO_H_
13 
14 #include <QString>
15 #include <QDateTime>
16 
17 #include "serviceexp.h"
18 #include "datacontracthelper.h"
19 
20 namespace DTC
21 {
22 
24 
25 class SERVICE_PUBLIC VideoStreamInfo : public QObject
26 {
27  Q_OBJECT
28  Q_CLASSINFO( "version" , "1.00" );
29 
30  Q_PROPERTY( QString CodecType READ CodecType WRITE setCodecType )
31  Q_PROPERTY( QString CodecName READ CodecName WRITE setCodecName )
32  Q_PROPERTY( int Width READ Width WRITE setWidth )
33  Q_PROPERTY( int Height READ Height WRITE setHeight )
34  Q_PROPERTY( float AspectRatio READ AspectRatio WRITE setAspectRatio )
35  Q_PROPERTY( QString FieldOrder READ FieldOrder WRITE setFieldOrder )
36  Q_PROPERTY( float FrameRate READ FrameRate WRITE setFrameRate )
37  Q_PROPERTY( float AvgFrameRate READ AvgFrameRate WRITE setAvgFrameRate )
38  Q_PROPERTY( int Channels READ Channels WRITE setChannels )
39  Q_PROPERTY( qlonglong Duration READ Duration WRITE setDuration )
40 
41  PROPERTYIMP_REF( QString , CodecType )
42  PROPERTYIMP_REF( QString , CodecName )
43  PROPERTYIMP ( int , Width )
44  PROPERTYIMP ( int , Height )
45  PROPERTYIMP ( float , AspectRatio )
46  PROPERTYIMP_REF( QString , FieldOrder )
47  PROPERTYIMP ( float , FrameRate )
48  PROPERTYIMP ( float , AvgFrameRate )
49  PROPERTYIMP ( int , Channels )
50  PROPERTYIMP ( qlonglong , Duration )
51 
52  public:
53 
54  static inline void InitializeCustomTypes();
55 
56  Q_INVOKABLE VideoStreamInfo(QObject *parent = nullptr)
57  : QObject ( parent ),
58  m_Width ( 0 ),
59  m_Height ( 0 ),
60  m_AspectRatio ( 0 ),
61  m_FrameRate ( 0 ),
62  m_AvgFrameRate ( 0 ),
63  m_Channels ( 0 ),
64  m_Duration ( 0 )
65  {
66  }
67 
68  void Copy( const VideoStreamInfo *src )
69  {
70  m_CodecType = src->m_CodecType ;
71  m_CodecName = src->m_CodecName ;
72  m_Width = src->m_Width ;
73  m_Height = src->m_Height ;
74  m_AspectRatio = src->m_AspectRatio ;
75  m_FieldOrder = src->m_FieldOrder ;
76  m_FrameRate = src->m_FrameRate ;
77  m_AvgFrameRate = src->m_AvgFrameRate ;
78  m_Channels = src->m_Channels ;
79  m_Duration = src->m_Duration ;
80  }
81 
82  private:
83  Q_DISABLE_COPY(VideoStreamInfo);
84 };
85 
87 {
88  qRegisterMetaType< VideoStreamInfo* >();
89 }
90 
91 } // namespace DTC
92 
93 #endif
DTC::VideoStreamInfo
Definition: videoStreamInfo.h:25
SERVICE_PUBLIC
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
datacontracthelper.h
serviceexp.h
FrameRate
Definition: recorderbase.h:36
DTC::VideoStreamInfo::Copy
void Copy(const VideoStreamInfo *src)
Definition: videoStreamInfo.h:68
PROPERTYIMP
#define PROPERTYIMP(type, name)
Definition: datacontracthelper.h:56
DTC
Definition: datacontracthelper.h:123
DTC::VideoStreamInfo::InitializeCustomTypes
static void InitializeCustomTypes()
Definition: videoStreamInfo.h:86
PROPERTYIMP_REF
#define PROPERTYIMP_REF(type, name)
Definition: datacontracthelper.h:70