AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
timecode.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 //---------------------------------------------------------------------------------------------------------------------
9 // Includes
10 //---------------------------------------------------------------------------------------------------------------------
11 #include "ajabase/common/common.h"
13 
14 #include <iomanip>
15 #include <sstream>
16 #include <string>
17 #include <vector>
18 using namespace std;
19 
20 #if defined(AJA_MAC) || defined(AJA_LINUX) || defined(AJA_BAREMETAL)
21 #include <stdlib.h>
22 #include <string.h>
23 #include <wctype.h>
24 #endif
25 
26 //---------------------------------------------------------------------------------------------------------------------
27 // Defines and structures
28 //---------------------------------------------------------------------------------------------------------------------
29 
30 //---------------------------------------------------------------------------------------------------------------------
31 // Utility Functions
32 //---------------------------------------------------------------------------------------------------------------------
33 
34 //---------------------------------------------------------------------------------------------------------------------
35 // Public Functions and Class Methods
36 //---------------------------------------------------------------------------------------------------------------------
37 
38 //---------------------------------------------------------------------------------------------------------------------
39 // Name: AJATimeCode
40 // Notes: http://www.andrewduncan.ws/Timecodes/Timecodes.html
41 // http://en.wikipedia.org/wiki/SMPTE_time_code
42 // Drop frame is lifted from http://www.davidheidelberger.com/blog/?p=29
43 //---------------------------------------------------------------------------------------------------------------------
45  m_frame(0),
46  m_stdTimecodeForHfr(true)
47 {
48 }
49 
50 AJATimeCode::AJATimeCode(uint32_t frame) :
51  m_stdTimecodeForHfr(true)
52 {
53  Set(frame);
54 }
55 
56 AJATimeCode::AJATimeCode(const std::string &str, const AJATimeBase& timeBase, bool bDropFrame, bool bStdTc)
57  : m_stdTimecodeForHfr(bStdTc)
58 {
59  Set(str.c_str(), timeBase, bDropFrame);
60 }
61 
62 AJATimeCode::AJATimeCode(const std::string &str, const AJATimeBase& timeBase)
63  : m_stdTimecodeForHfr(true)
64 {
65  Set(str.c_str(), timeBase);
66 }
67 
69 {
70  m_frame = other.m_frame;
72 }
73 
74 //---------------------------------------------------------------------------------------------------------------------
75 // Name: ~AJATimeCode
76 //---------------------------------------------------------------------------------------------------------------------
78 {
79 } //end ~AJATimeCode
80 
81 bool AJATimeCode::QueryIsDropFrame(const string &str)
82 {
83  bool bHasSemicolon = false;
84  if (str.find(";", 0) != string::npos)
85  bHasSemicolon = true;
86  return bHasSemicolon;
87 }
88 
90 {
91  return (int)::strlen("00:00:00:00") + 1;
92 }
93 
94 uint32_t AJATimeCode::QueryFrame(void) const
95 {
96  return m_frame;
97 }
98 
99 inline uint32_t AJATimeCodeRound(double f)
100 {
101  return (uint32_t)(f + .5);
102 }
103 
104 inline int64_t AJATimeCodeAbs(int64_t x)
105 {
106  return (((x)>=0)?(x):-(x));
107 }
108 
109 void AJATimeCode::QueryHmsf(uint32_t &h, uint32_t &m, uint32_t &s, uint32_t &f, const AJATimeBase& timeBase, bool bDropFrame) const
110 {
111  // This code was pulled from the NTV2RP188 class and appears to work correctly.
112  int64_t frame, frameRate,frameDuration;
113  timeBase.GetFrameRate(frameRate,frameDuration);
114  AJA_FrameRate ajaFrameRate = timeBase.GetAJAFrameRate();
115 
116  frame = m_frame;
117  if (ajaFrameRate >= AJA_FrameRate_4795 && m_stdTimecodeForHfr == true)
118  {
119  frame /= 2;
120  frameRate /= 2;
121  }
122 
123  if ((frameRate == 0) || (frameDuration == 0))
124  {
125  h = m = s = f = 0;
126  }
127  else if (frameRate < frameDuration)
128  {
129  h = m = s = f = 0;
130  }
131  else
132  {
133  // this is just good for 29.97, 59.94, 23.976
134  double dFrameRate = double(frameRate) / double(frameDuration);
135 
136  // non-dropframe
137  uint32_t framesPerSec = AJATimeCodeRound(dFrameRate);
138  uint32_t framesPerMin = framesPerSec * 60; // 60 seconds/minute
139  uint32_t framesPerHr = framesPerMin * 60; // 60 minutes/hr.
140  uint32_t framesPerDay = framesPerHr * 24; // 24 hours/day
141 
142  if (! bDropFrame)
143  {
144  // make sure we don't have more than 24 hours worth of frames
145  frame = frame % framesPerDay;
146 
147  // how many hours?
148  h = uint32_t(frame / framesPerHr);
149  frame = frame % framesPerHr;
150 
151  // how many minutes?
152  m = uint32_t(frame / framesPerMin);
153  frame = frame % framesPerMin;
154 
155  // how many seconds?
156  s = uint32_t(frame / framesPerSec);
157 
158  // what's left is the frame count
159  f = uint32_t(frame % framesPerSec);
160  }
161  else
162  {
163  // dropframe
164  uint32_t droppedFrames = AJATimeCodeRound(dFrameRate * .066666); // number of frames dropped in a "drop second"
165  uint32_t dropFramesPerSec = framesPerSec - droppedFrames;
166  uint32_t dropframesPerMin = (59 * framesPerSec) + dropFramesPerSec; // every minute we get 1 drop and 59 regular seconds
167  uint32_t dropframesPerTenMin = (9 * dropframesPerMin) + framesPerMin; // every ten minutes we get 1 regular and 9 drop minutes
168  uint32_t dropframesPerHr = dropframesPerTenMin * 6; // 60 minutes/hr.
169  uint32_t dropframesPerDay = dropframesPerHr * 24; // 24 hours/day
170 
171  // make sure we don't have more than 24 hours worth of frames
172  frame = frame % dropframesPerDay;
173 
174  // how many hours?
175  h = uint32_t(frame / dropframesPerHr);
176  frame = frame % dropframesPerHr;
177 
178  // how many tens of minutes?
179  m = uint32_t(10 * (frame / dropframesPerTenMin));
180  frame = frame % dropframesPerTenMin;
181 
182  // how many units of minutes?
183  if (frame >= framesPerMin)
184  {
185  m += 1; // got at least one minute (the first one is a non-drop minute)
186  frame = frame - framesPerMin;
187 
188  // any remaining minutes are drop-minutes
189  m += uint32_t(frame / dropframesPerMin);
190  frame = frame % dropframesPerMin;
191  }
192 
193  // how many seconds? depends on whether this was a regular or a drop minute...
194  s = 0;
195  if (m % 10 == 0)
196  {
197  // regular minute: all seconds are full length
198  s = uint32_t(frame / framesPerSec);
199  frame = frame % framesPerSec;
200  }
201  else
202  {
203  // drop minute: the first second is a drop second
204  if (frame >= dropFramesPerSec)
205  {
206  s += 1; // got at least one (the first one is a drop second)
207  frame = frame - dropFramesPerSec;
208 
209  // any remaining seconds are full-length
210  s += uint32_t(frame / framesPerSec);
211  frame = frame % framesPerSec;
212  }
213  }
214 
215  // what's left is the frame count
216  f = uint32_t(frame);
217 
218  // if we happened to land on a drop-second, add 2 frames (the 28 frames are numbered 2 - 29, not 0 - 27)
219  if ( (s == 0) && (m % 10 != 0))
220  f += droppedFrames;
221  }
222  }
223 }
224 
225 void AJATimeCode::QueryString(std::string &str, const AJATimeBase& timeBase, bool bDropFrame)
226 {
227  uint32_t h = 0,m = 0,s = 0,f = 0;
228  QueryHmsf(h,m,s,f,timeBase,bDropFrame);
229 
230  std::ostringstream oss;
231  if (bDropFrame)
232  {
233  oss << setfill('0') << setw(2) << h << ":"
234  << setfill('0') << setw(2) << m << ":"
235  << setfill('0') << setw(2) << s << ";"
236  << setfill('0') << setw(2) << f;
237  }
238  else
239  {
240  oss << setfill('0') << setw(2) << h << ":"
241  << setfill('0') << setw(2) << m << ":"
242  << setfill('0') << setw(2) << s << ":"
243  << setfill('0') << setw(2) << f;
244  }
245  str.assign(oss.str());
246 }
247 
248 void AJATimeCode::QueryString(char *pString, const AJATimeBase& timeBase, bool bDropFrame)
249 {
250  string s;
251  QueryString(s, timeBase, bDropFrame);
252  strncpy(pString, s.c_str(), s.length());
253  pString[11] = '\0';
254 }
255 
257 {
258  return 4;
259 }
260 
261 void AJATimeCode::QuerySMPTEString(char *pBufr,const AJATimeBase& timeBase,bool bDrop)
262 {
263  uint32_t h=0, m=0, s=0, f=0;
264  QueryHmsf(h,m,s,f,timeBase,bDrop);
265 
266  pBufr[0] = ((f/10) << 4) + (f % 10);
267  pBufr[1] = ((s/10) << 4) + (s % 10);
268  pBufr[2] = ((m/10) << 4) + (m % 10);
269  pBufr[3] = ((h/10) << 4) + (h % 10);
270  if (bDrop)
271  pBufr[0] = pBufr[0] | 0x40;
272 }
273 
274 //---------------------------------------------------------------------------------------------------------------------
275 // Name: Set
276 // Notes: If we need to either clamp or roll over the frame number, the uint32_t version of Set() is a good place
277 // to do it.
278 //---------------------------------------------------------------------------------------------------------------------
279 void AJATimeCode::Set(uint32_t frame)
280 {
281  m_frame = frame;
282 }
283 
284 void AJATimeCode::SetHmsf(uint32_t h, uint32_t m, uint32_t s, uint32_t f, const AJATimeBase& timeBase, bool bDropFrame)
285 {
286  int64_t frameRate, frameRate2, frameDuration;
287  timeBase.GetFrameRate(frameRate, frameDuration);
288  AJA_FrameRate ajaFrameRate = timeBase.GetAJAFrameRate();
289 
290  frameRate2 = frameRate;
291  if (ajaFrameRate >= AJA_FrameRate_4795 && m_stdTimecodeForHfr == true)
292  {
293  frameRate2 /=2;
294  }
295 
296  uint32_t frame;
297  if ((frameRate == 0) || (frameDuration == 0))
298  {
299  frame = 0;
300  }
301  else if (bDropFrame)
302  {
303  // this is just good for 29.97, 59.94, 23.976
304  double dFrameRate = double(frameRate2) / double(frameDuration);
305  uint32_t dropFrames = AJATimeCodeRound(dFrameRate*.066666); //Number of drop frames is 6% of framerate rounded to nearest integer
306  uint32_t tb = AJATimeCodeRound(dFrameRate); //We don't need the exact framerate anymore, we just need it rounded to nearest integer
307 
308  uint32_t hourFrames = tb*60*60; //Number of frames per hour (non-drop)
309  uint32_t minuteFrames = tb*60; //Number of frames per minute (non-drop)
310  uint32_t totalMinutes = (60*h) + m; //Total number of minutes
311 
312  // if TC does not exist then we need to round up to the next valid frame
313  if ( (s == 0) && ((m % 10) > 0) && ((f & ~1) == 0))
314  f = 2;
315 
316  frame = ((hourFrames * h) + (minuteFrames * m) + (tb * s) + f) - (dropFrames * (totalMinutes - (totalMinutes / 10)));
317  }
318  else
319  {
320  double dFrameRate = double(frameRate2) / double(frameDuration);
321  uint32_t tb = AJATimeCodeRound(dFrameRate); //We don't need the exact framerate anymore, we just need it rounded to nearest integer
322 
323  uint32_t hourFrames = tb*60*60; //Number of frames per hour (non-drop)
324  uint32_t minuteFrames = tb*60; //Number of frames per minute (non-drop)
325  //uint32_t totalMinutes = (60*h) + m; //Total number of minutes
326  frame = ((hourFrames * h) + (minuteFrames * m) + (tb * s) + f);
327  }
328 
329  if (ajaFrameRate >= AJA_FrameRate_4795 && m_stdTimecodeForHfr == true)
330  {
331  frame *=2;
332  }
333 
334  Set(frame);
335 } //end SetHmsf
336 
337 void AJATimeCode::Set(const std::string &str, const AJATimeBase& timeBase, bool bDropFrame)
338 {
339  const int valCount = 4;
340  uint32_t val[valCount];
341  ::memset(val,0,sizeof(val));
342 
343  // work from bottom up so that partial time code
344  // (ie. something like 10:02 rather than 00:00:10:02)
345  // is handled
346  size_t len = str.length();
347  int valOffset = 0;
348  int valMult = 1;
349  for (size_t i = 0; i < len; i++)
350  {
351  char theChar = str[len - i - 1];
352  if (::isdigit(theChar))
353  {
354  val[valOffset] = val[valOffset] + ((theChar - '0') * valMult);
355  valMult *= 10;
356  }
357  else
358  {
359  valOffset++;
360  valMult = 1;
361  }
362 
363  if (valOffset >= 4)
364  break;
365  }
366 
367  SetHmsf(val[3], val[2], val[1], val[0], timeBase, bDropFrame);
368 }
369 
370 void AJATimeCode::Set(const std::string &str, const AJATimeBase& timeBase)
371 {
372  bool bDropFrame = false;
373  std::string::const_iterator it = str.begin();
374  while(it != str.end())
375  {
376  if ((*it == ';') || (*it == '.'))
377  {
378  bDropFrame = true;
379  break;
380  }
381  ++it;
382  }
383  Set(str, timeBase, bDropFrame);
384 }
385 
386 void AJATimeCode::SetWithCleanup(const std::string &str, const AJATimeBase& timeBase, bool bDrop)
387 {
388  if (str.empty())
389  return;
390 
391  bool bHasMark = false;
392  if ( (str.find(";", 0) != string::npos) || (str.find(":", 0) != string::npos) )
393  {
394  bHasMark = true;
395  }
396 
397  if (bHasMark)
398  {
399  std::string tmp(str);
400  aja::strip(tmp);
401 
402  if (tmp.length() > 11)
403  tmp.resize(11);
404 
405  Set(tmp, timeBase);
406  }
407  else
408  {
409  std::string tmp;
410  if (bDrop)
411  tmp = "00:00:00;00";
412  else
413  tmp = "00:00:00:00";
414 
415  size_t len = str.length();
416  int tgtOffset = 10;
417  for (size_t i = 0; i < len; i++)
418  {
419  size_t srcOffset = len - i - 1;
420  if ((str[srcOffset] >= '0') && (str[srcOffset] <= '9'))
421  {
422  tmp[tgtOffset] = str[srcOffset];
423  tgtOffset--;
424  if ((tgtOffset == 8) || (tgtOffset == 5) || (tgtOffset == 2))
425  tgtOffset--;
426 
427  if (tgtOffset < 0)
428  break;
429  }
430  }
431  Set(tmp, timeBase);
432  }
433 }
434 
435 void AJATimeCode::SetSMPTEString(const char *pBufr, const AJATimeBase& timeBase)
436 {
437  bool bDrop = false;
438  if (pBufr[0] & 0x40)
439  bDrop = true;
440 
441  uint32_t f = (((pBufr[0] & 0x30) >> 4) * 10) + (pBufr[0] & 0x0f);
442  uint32_t s = (((pBufr[1] & 0x70) >> 4) * 10) + (pBufr[1] & 0x0f);
443  uint32_t m = (((pBufr[2] & 0x70) >> 4) * 10) + (pBufr[2] & 0x0f);
444  uint32_t h = (((pBufr[3] & 0x30) >> 4) * 10) + (pBufr[3] & 0x0f);
445 
446  SetHmsf(h,m,s,f,timeBase,bDrop);
447 }
448 
449 bool AJATimeCode::QueryIsRP188DropFrame (const uint32_t inDBB, const uint32_t inLo, const uint32_t inHi) // STATIC
450 {
451  AJA_UNUSED(inDBB);
452  AJA_UNUSED(inHi);
453  return (inLo >> 10) & 0x01;
454 }
455 
456 
457 void AJATimeCode::SetRP188 (const uint32_t inDBB, const uint32_t inLo, const uint32_t inHi, const AJATimeBase & inTimeBase)
458 {
459  AJATimeBase tb25(25000,1000);
460  AJATimeBase tb50(50000,1000);
461  AJATimeBase tb60(60000,1000);
462  AJATimeBase tb5994(60000,1001);
463 
464  // HRS
465  const uint32_t h0 (((inHi >> 16) & 0xF) );
466  const uint32_t h1 (((inHi >> 24) & 0x3) * 10);
467  // MINS
468  const uint32_t m0 (((inHi ) & 0xF) );
469  const uint32_t m1 (((inHi >> 8) & 0x7) * 10);
470  // SECS
471  const uint32_t s0 (((inLo >> 16) & 0xF) );
472  const uint32_t s1 (((inLo >> 24) & 0x7) * 10);
473  // FRAMES
474  uint32_t f0(0);
475  uint32_t f1(0);
476 
477  if (!m_stdTimecodeForHfr && (inTimeBase.IsCloseTo(tb50) || inTimeBase.IsCloseTo(tb60) || inTimeBase.IsCloseTo(tb5994)))
478  {
479  // for frame rates > 39 fps, we need an extra bit for the frame "10s". By convention,
480  // we use the field ID bit to be the LS bit of the three bit number.
481  bool fieldID;
482 
483  // Note: FID is in different words for PAL & NTSC!
484  if(inTimeBase.IsCloseTo(tb25) || inTimeBase.IsCloseTo(tb50))
485  fieldID = ((inHi & (1u<<27)) != 0);
486  else
487  fieldID = ((inLo & (1u<<27)) != 0);
488 
489  // Double the regular frame count and add fieldID...
490  const uint32_t numFrames = (((((inLo >> 8) & 0x3) * 10) + (inLo & 0xF)) * 2) + uint32_t(fieldID);
491  f0 = numFrames % 10;
492  f1 = (numFrames / 10) * 10;
493  }
494  else
495  {
496  f0 = ((inLo ) & 0xF);
497  f1 = ((inLo >> 8) & 0x3) * 10;
498  }
499 
500  SetHmsf (h0+h1, m0+m1, s0+s1, f0+f1, inTimeBase, AJATimeCode::QueryIsRP188DropFrame(inDBB, inLo, inHi));
501 }
502 
503 
504 void AJATimeCode::QueryRP188(uint32_t *pDbb, uint32_t *pLow, uint32_t *pHigh, const AJATimeBase& timeBase, bool bDrop)
505 {
506  uint32_t dbb(0), low(0), high(0);
507  QueryRP188(dbb, low, high, timeBase, bDrop);
508  if (*pDbb) *pDbb = dbb;
509  if (*pLow) *pLow = low;
510  if (*pHigh) *pHigh = high;
511 }
512 
513 void AJATimeCode::QueryRP188(uint32_t & outDBB, uint32_t & outLo, uint32_t & outHi, const AJATimeBase & timeBase, const bool bDrop)
514 {
515  AJA_UNUSED(timeBase);
516  AJA_UNUSED(bDrop);
517 
518  uint32_t dbb = 0;
519  uint32_t low = 0;
520  uint32_t high = 0;
521  // UNIMPLEMENTED -- FINISH
522  outDBB = dbb;
523  outLo = low;
524  outHi = high;
525 }
526 
527 
528 //---------------------------------------------------------------------------------------------------------------------
529 // Name: = operator
530 //---------------------------------------------------------------------------------------------------------------------
532 {
533  if (this != &val)
534  {
535  m_frame = val.m_frame;
537  }
538  return *this;
539 } //end '='
540 
541 //---------------------------------------------------------------------------------------------------------------------
542 // Name: == operator
543 //---------------------------------------------------------------------------------------------------------------------
544 bool AJATimeCode::operator==(const AJATimeCode &val) const
545 {
546  bool bIsSame = false;
547  if (m_frame == val.m_frame)
548  {
549  bIsSame = true;
550  }
551  return bIsSame;
552 }
553 
554 //---------------------------------------------------------------------------------------------------------------------
555 // Name: < operator
556 //---------------------------------------------------------------------------------------------------------------------
557 bool AJATimeCode::operator<(const AJATimeCode &val) const
558 {
559  bool bIsLess = (m_frame < val.m_frame);
560  return bIsLess;
561 }
562 
563 bool AJATimeCode::operator<(const int32_t val) const
564 {
565  bool bIsLess = (m_frame < (uint32_t)val);
566  return bIsLess;
567 }
568 
569 
570 //---------------------------------------------------------------------------------------------------------------------
571 // Name: > operator
572 //---------------------------------------------------------------------------------------------------------------------
573 bool AJATimeCode::operator>(const AJATimeCode &val) const
574 {
575  bool bIsGreater = (m_frame > val.m_frame);
576  return bIsGreater;
577 }
578 
579 bool AJATimeCode::operator>(const int32_t val) const
580 {
581  bool bIsGreater = (m_frame > (uint32_t)val);
582  return bIsGreater;
583 }
584 
585 
586 //---------------------------------------------------------------------------------------------------------------------
587 // Name: != operator
588 //---------------------------------------------------------------------------------------------------------------------
589 bool AJATimeCode::operator!=(const AJATimeCode &val) const
590 {
591  return !(*this == val);
592 }
593 
594 //---------------------------------------------------------------------------------------------------------------------
595 // Name: += operator
596 //---------------------------------------------------------------------------------------------------------------------
598 {
599  m_frame += val.m_frame;
600  return *this;
601 }
602 
604 {
605  m_frame += val;
606  return *this;
607 }
608 
609 //---------------------------------------------------------------------------------------------------------------------
610 // Name: -= operator
611 //---------------------------------------------------------------------------------------------------------------------
613 {
614  if(val.m_frame > m_frame)
615  m_frame = 0;
616  else
617  m_frame -= val.m_frame;
618 
619  return *this;
620 }
621 
623 {
624  if((uint32_t)val > m_frame)
625  m_frame = 0;
626  else
627  m_frame -= val;
628 
629  return *this;
630 }
631 
632 //---------------------------------------------------------------------------------------------------------------------
633 // Name: + operator
634 //---------------------------------------------------------------------------------------------------------------------
636 {
637  return AJATimeCode(*this) += val;
638 }
639 
640 const AJATimeCode AJATimeCode::operator+(const int32_t val) const
641 {
642  return AJATimeCode(*this) += val;
643 }
644 
645 //---------------------------------------------------------------------------------------------------------------------
646 // Name: - operator
647 //---------------------------------------------------------------------------------------------------------------------
649 {
650  return AJATimeCode(*this) -= val;
651 }
652 
653 const AJATimeCode AJATimeCode::operator-(const int32_t val) const
654 {
655  return AJATimeCode(*this) -= val;
656 }
AJATimeCode::QueryString
void QueryString(std::string &str, const AJATimeBase &timeBase, bool bDropFrame)
Definition: timecode.cpp:225
AJATimeCode::~AJATimeCode
virtual ~AJATimeCode()
Definition: timecode.cpp:77
aja::strip
std::string & strip(std::string &str, const std::string &ws)
Definition: common.cpp:461
AJATimeBase::IsCloseTo
bool IsCloseTo(const AJATimeBase &timeBase) const
Definition: timebase.cpp:318
AJATimeCodeRound
uint32_t AJATimeCodeRound(double f)
Definition: timecode.cpp:99
AJATimeCode::QueryIsRP188DropFrame
static bool QueryIsRP188DropFrame(const uint32_t inDBB, const uint32_t inLo, const uint32_t inHi)
Definition: timecode.cpp:449
AJATimeBase::GetFrameRate
void GetFrameRate(int64_t &frameTimeScale, int64_t &frameDuration) const
Definition: timebase.cpp:133
AJATimeCode::operator<
bool operator<(const AJATimeCode &val) const
Definition: timecode.cpp:557
AJATimeCode::SetWithCleanup
void SetWithCleanup(const std::string &str, const AJATimeBase &timeBase, bool bDrop)
Definition: timecode.cpp:386
AJATimeCode::operator+=
AJATimeCode & operator+=(const AJATimeCode &val)
Definition: timecode.cpp:597
AJATimeCode::Set
void Set(uint32_t frame)
Definition: timecode.cpp:279
AJATimeCode::operator==
bool operator==(const AJATimeCode &val) const
Definition: timecode.cpp:544
AJATimeCode::QueryStringSize
static int QueryStringSize(void)
Definition: timecode.cpp:89
timecode.h
Declares the AJATimeCode class.
AJA_UNUSED
#define AJA_UNUSED(_x_)
Definition: types.h:424
AJA_FrameRate
AJA_FrameRate
Definition: videotypes.h:210
AJATimeCode::m_stdTimecodeForHfr
bool m_stdTimecodeForHfr
Definition: timecode.h:214
AJATimeCode::operator-=
AJATimeCode & operator-=(const AJATimeCode &val)
Definition: timecode.cpp:612
AJA_FrameRate_4795
@ AJA_FrameRate_4795
Definition: videotypes.h:224
AJATimeCode::operator-
const AJATimeCode operator-(const AJATimeCode &val) const
Definition: timecode.cpp:648
AJATimeBase
Definition: timebase.h:18
AJATimeCode::operator!=
bool operator!=(const AJATimeCode &val) const
Definition: timecode.cpp:589
AJATimeBase::GetAJAFrameRate
AJA_FrameRate GetAJAFrameRate(void) const
Definition: timebase.cpp:427
AJATimeCode::SetRP188
void SetRP188(const uint32_t inDBB, const uint32_t inLo, const uint32_t inHi, const AJATimeBase &inTimeBase)
Definition: timecode.cpp:457
AJATimeCode::AJATimeCode
AJATimeCode()
Definition: timecode.cpp:44
AJATimeCode::SetHmsf
void SetHmsf(uint32_t h, uint32_t m, uint32_t s, uint32_t f, const AJATimeBase &timeBase, bool bDropFrame)
Definition: timecode.cpp:284
AJATimeCode::QuerySMPTEString
void QuerySMPTEString(char *pString, const AJATimeBase &timeBase, bool bDropFrame)
Definition: timecode.cpp:261
AJATimeCode::SetSMPTEString
void SetSMPTEString(const char *pBufr, const AJATimeBase &timeBase)
Definition: timecode.cpp:435
AJATimeCode::m_frame
uint32_t m_frame
Definition: timecode.h:213
AJATimeCode::QueryHmsf
void QueryHmsf(uint32_t &h, uint32_t &m, uint32_t &s, uint32_t &f, const AJATimeBase &timeBase, bool bDropFrame) const
Definition: timecode.cpp:109
AJATimeCode::operator=
AJATimeCode & operator=(const AJATimeCode &val)
Definition: timecode.cpp:531
common.h
Private include file for all ajabase sources.
AJATimeCode::QuerySMPTEStringSize
static int QuerySMPTEStringSize(void)
Definition: timecode.cpp:256
std
Definition: json.hpp:5362
AJATimeCode::QueryFrame
uint32_t QueryFrame(void) const
Definition: timecode.cpp:94
AJATimeCode::operator>
bool operator>(const AJATimeCode &val) const
Definition: timecode.cpp:573
AJATimeCode::QueryRP188
void QueryRP188(uint32_t *pDbb, uint32_t *pLow, uint32_t *pHigh, const AJATimeBase &timeBase, bool bDrop)
Definition: timecode.cpp:504
true
#define true
Definition: ntv2devicefeatures.h:26
AJATimeCode::operator+
const AJATimeCode operator+(const AJATimeCode &val) const
Definition: timecode.cpp:635
AJATimeCodeAbs
int64_t AJATimeCodeAbs(int64_t x)
Definition: timecode.cpp:104
AJATimeCode
Utility class for timecodes.
Definition: timecode.h:17
AJATimeCode::QueryIsDropFrame
static bool QueryIsDropFrame(const std::string &str)
Definition: timecode.cpp:81