summarylogtreecommitdiffstats
path: root/0002-dtrecord-fix.patch
blob: 1c2b41b04f047b1292651dbfd3264f314bc2faa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
diff -ura a/dtrecord/Import/SdiFileFmt.cpp b/dtrecord/Import/SdiFileFmt.cpp
--- a/dtrecord/Import/SdiFileFmt.cpp	2025-05-21 15:05:14.000000000 +0200
+++ b/dtrecord/Import/SdiFileFmt.cpp	2025-05-24 11:11:11.803049560 +0200
@@ -8,6 +8,7 @@
 
 #include <algorithm>
 #include <fstream>
+#include <cstring>
 
 using std::min;
 
@@ -236,8 +237,8 @@
     Header.NumFrames = (int)Reader.ReadBits(32);
     Header.CompressionMode = (SdiCompressionMode)Reader.ReadBits(8);
     ReadSdiFormat(Reader, Header.Format);
-    ReadLogicalFrameProperties(Reader, Header.LogicalFrameProperties);
-    ReadPhysicalFrameProperties(Reader, Header.PhysicalFrameProperties);
+    ReadLogicalFrameProperties(Reader, Header.logicalFrameProperties);
+    ReadPhysicalFrameProperties(Reader, Header.physicalFrameProperties);
 }
 
 // .-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- ReadSdiFormat -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
@@ -249,18 +250,18 @@
     int SdiLevel = (int)Reader.ReadBits(2);
     int NumStreams = (int)Reader.ReadBits(2);
     if (SdiLevel == 0)
-        Format.SdiLevel = SdiLevel::NOT_APPLICABLE;
+        Format.sdiLevel = SdiLevel::NOT_APPLICABLE;
     else if (SdiLevel == 1)
-        Format.SdiLevel = SdiLevel::A;
+        Format.sdiLevel = SdiLevel::A;
     else if (SdiLevel == 2) {
         if (NumStreams == 1)
-            Format.SdiLevel = SdiLevel::B_DL;
+            Format.sdiLevel = SdiLevel::B_DL;
         else if (NumStreams == 2)
-            Format.SdiLevel = SdiLevel::B_DS;
+            Format.sdiLevel = SdiLevel::B_DS;
         else // Assume B-DL
-            Format.SdiLevel = SdiLevel::B_DL;
+            Format.sdiLevel = SdiLevel::B_DL;
     } else // Assume Level A
-        Format.SdiLevel = SdiLevel::A;
+        Format.sdiLevel = SdiLevel::A;
     Reader.ReadBits(5); // Reserved
 }
 
@@ -337,8 +338,8 @@
     Writer.WriteBits(Header.NumFrames, 32);
     Writer.WriteBits((uint64_t)Header.CompressionMode, 8);
     NumBits += WriteSdiFormat(Writer, Header.Format);
-    NumBits += WriteLogicalFrameProperties(Writer, Header.LogicalFrameProperties);
-    NumBits += WritePhysicalFrameProperties(Writer, Header.PhysicalFrameProperties);
+    NumBits += WriteLogicalFrameProperties(Writer, Header.logicalFrameProperties);
+    NumBits += WritePhysicalFrameProperties(Writer, Header.physicalFrameProperties);
 
     return NumBits;
 }
@@ -351,7 +352,7 @@
 
     Writer.WriteBits((uint64_t)Format.LineRate, 5);
     Writer.WriteBits((uint64_t)Format.InterleavingType, 2);
-    switch(Format.SdiLevel)
+    switch(Format.sdiLevel)
     {
     case SdiLevel::A:
         Writer.WriteBits(1, 2);
@@ -491,12 +492,12 @@
 
 int GetVidStd(const SdiFileHeader& Header)
 {
-    Fraction PictureRate = Header.LogicalFrameProperties.PictureRate;
-    Fraction AspectRatio = Header.LogicalFrameProperties.AspectRatio;
-    bool IsInterlaced = Header.LogicalFrameProperties.IsInterlaced;
-    int NumFields = Header.PhysicalFrameProperties.NumFields;
-    int PictureWidth = Header.LogicalFrameProperties.PictureWidth;
-    int PictureHeight = Header.LogicalFrameProperties.PictureHeight;
+    Fraction PictureRate = Header.logicalFrameProperties.PictureRate;
+    Fraction AspectRatio = Header.logicalFrameProperties.AspectRatio;
+    bool IsInterlaced = Header.logicalFrameProperties.IsInterlaced;
+    int NumFields = Header.physicalFrameProperties.NumFields;
+    int PictureWidth = Header.logicalFrameProperties.PictureWidth;
+    int PictureHeight = Header.logicalFrameProperties.PictureHeight;
 
     for (const SdiStandard& Standard : Standards)
     {
diff -ura a/dtrecord/Import/SdiFileFmt.h b/dtrecord/Import/SdiFileFmt.h
--- a/dtrecord/Import/SdiFileFmt.h	2025-05-21 15:05:14.000000000 +0200
+++ b/dtrecord/Import/SdiFileFmt.h	2025-05-24 11:05:21.454357646 +0200
@@ -71,7 +71,7 @@
 {
     SdiLineRate LineRate;
     SdiInterleavingType InterleavingType;
-    SdiLevel SdiLevel;
+    SdiLevel sdiLevel;
 };
 
 // .-.-.-.-.-.-.-.-.-.-.-.-.-.- struct LogicalFrameProperties -.-.-.-.-.-.-.-.-.-.-.-.-.-.
@@ -122,8 +122,8 @@
     SdiCompressionMode CompressionMode;
 
     SdiFormat Format;
-    LogicalFrameProperties LogicalFrameProperties;
-    PhysicalFrameProperties PhysicalFrameProperties;
+    LogicalFrameProperties logicalFrameProperties;
+    PhysicalFrameProperties physicalFrameProperties;
 };
 
 void ReadSdiFileHeader(uint8_t* Buf, int BufSize, SdiFileHeader& Header);
diff -ura a/dtrecord/Source/DtRecord.cpp b/dtrecord/Source/DtRecord.cpp
--- a/dtrecord/Source/DtRecord.cpp	2025-05-23 11:53:02.000000000 +0200
+++ b/dtrecord/Source/DtRecord.cpp	2025-05-24 11:07:53.149008614 +0200
@@ -1892,12 +1892,12 @@
             StdInfo.m_VidStd.m_StdCode == DTAPI_VIDSTD_1080P60B ||
             StdInfo.m_VidStd.m_StdCode == DTAPI_VIDSTD_2160P50B ||
             StdInfo.m_VidStd.m_StdCode == DTAPI_VIDSTD_2160P59_94B)
-            Format.SdiLevel = SdiLevel::B_DL;
+            Format.sdiLevel = SdiLevel::B_DL;
         else
-            Format.SdiLevel = SdiLevel::A;
+            Format.sdiLevel = SdiLevel::A;
 
         // Logical frame properties
-        LogicalFrameProperties& LfProps = SdiHeader.LogicalFrameProperties;
+        LogicalFrameProperties& LfProps = SdiHeader.logicalFrameProperties;
         LfProps.PictureRate.Num = (int)StdInfo.m_Fps;
         LfProps.PictureRate.Den = 1;
         if (StdInfo.m_IsFractional)
@@ -1933,7 +1933,7 @@
         LfProps.PictureHeight = StdInfo.m_VidHeight;
 
         // Physical frame properties
-        PhysicalFrameProperties& PfProps = SdiHeader.PhysicalFrameProperties;
+        PhysicalFrameProperties& PfProps = SdiHeader.physicalFrameProperties;
         PfProps.NumFields = StdInfo.m_Field2StartLine > 0 ? 2 : 1;
         PfProps.CrcOmitted = 0; // NOTE(jst): just assume all DTSDI files have CRC
         PfProps.NumLinesFrame = StdInfo.m_NumLines;