SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
atvmod.h
Go to the documentation of this file.
1 // Copyright (C) 2017 Edouard Griffiths, F4EXB //
3 // //
4 // This program is free software; you can redistribute it and/or modify //
5 // it under the terms of the GNU General Public License as published by //
6 // the Free Software Foundation as version 3 of the License, or //
7 // (at your option) any later version. //
8 // //
9 // This program is distributed in the hope that it will be useful, //
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12 // GNU General Public License V3 for more details. //
13 // //
14 // You should have received a copy of the GNU General Public License //
15 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
17 
18 #ifndef PLUGINS_CHANNELTX_MODATV_ATVMOD_H_
19 #define PLUGINS_CHANNELTX_MODATV_ATVMOD_H_
20 
21 #include <vector>
22 
23 #include <QObject>
24 #include <QMutex>
25 #include <QNetworkRequest>
26 
27 #include <opencv2/core/core.hpp>
28 #include <opencv2/highgui/highgui.hpp>
29 #include <opencv2/videoio.hpp>
30 
31 #include <stdint.h>
32 
34 #include "channel/channelapi.h"
35 #include "dsp/nco.h"
36 #include "dsp/interpolator.h"
37 #include "util/movingaverage.h"
38 #include "dsp/fftfilt.h"
39 #include "util/message.h"
40 
41 #include "atvmodsettings.h"
42 
43 class QNetworkAccessManager;
44 class QNetworkReply;
45 class DeviceAPI;
47 class UpChannelizer;
48 
49 class ATVMod : public BasebandSampleSource, public ChannelAPI {
50  Q_OBJECT
51 
52 public:
53  class MsgConfigureATVMod : public Message {
55 
56  public:
57  const ATVModSettings& getSettings() const { return m_settings; }
58  bool getForce() const { return m_force; }
59 
60  static MsgConfigureATVMod* create(const ATVModSettings& settings, bool force)
61  {
62  return new MsgConfigureATVMod(settings, force);
63  }
64 
65  private:
67  bool m_force;
68 
69  MsgConfigureATVMod(const ATVModSettings& settings, bool force) :
70  Message(),
71  m_settings(settings),
72  m_force(force)
73  { }
74  };
75 
78 
79  public:
80  int getCenterFrequency() const { return m_centerFrequency; }
81 
82  static MsgConfigureChannelizer* create(int centerFrequency)
83  {
84  return new MsgConfigureChannelizer(centerFrequency);
85  }
86 
87  private:
89 
90  MsgConfigureChannelizer(int centerFrequency) :
91  Message(),
92  m_centerFrequency(centerFrequency)
93  { }
94  };
95 
97  {
99 
100  public:
101  const QString& getFileName() const { return m_fileName; }
102 
103  static MsgConfigureImageFileName* create(const QString& fileName)
104  {
105  return new MsgConfigureImageFileName(fileName);
106  }
107 
108  private:
109  QString m_fileName;
110 
111  MsgConfigureImageFileName(const QString& fileName) :
112  Message(),
113  m_fileName(fileName)
114  { }
115  };
116 
118  {
120 
121  public:
122  const QString& getFileName() const { return m_fileName; }
123 
124  static MsgConfigureVideoFileName* create(const QString& fileName)
125  {
126  return new MsgConfigureVideoFileName(fileName);
127  }
128 
129  private:
130  QString m_fileName;
131 
132  MsgConfigureVideoFileName(const QString& fileName) :
133  Message(),
134  m_fileName(fileName)
135  { }
136  };
137 
139  {
141 
142  public:
143  int getPercentage() const { return m_seekPercentage; }
144 
145  static MsgConfigureVideoFileSourceSeek* create(int seekPercentage)
146  {
147  return new MsgConfigureVideoFileSourceSeek(seekPercentage);
148  }
149 
150  protected:
152 
153  MsgConfigureVideoFileSourceSeek(int seekPercentage) :
154  Message(),
155  m_seekPercentage(seekPercentage)
156  { }
157  };
158 
161 
162  public:
163 
165  {
167  }
168 
169  private:
170 
172  Message()
173  { }
174  };
175 
177  {
179 
180  public:
181  int getFrameCount() const { return m_frameCount; }
182 
184  {
185  return new MsgReportVideoFileSourceStreamTiming(frameCount);
186  }
187 
188  protected:
190 
192  Message(),
193  m_frameCount(frameCount)
194  { }
195  };
196 
199 
200  public:
201  int getFrameRate() const { return m_frameRate; }
202  quint32 getVideoLength() const { return m_videoLength; }
203 
205  quint32 recordLength)
206  {
207  return new MsgReportVideoFileSourceStreamData(frameRate, recordLength);
208  }
209 
210  protected:
213 
215  int videoLength) :
216  Message(),
217  m_frameRate(frameRate),
218  m_videoLength(videoLength)
219  { }
220  };
221 
223  {
225 
226  public:
227  int getIndex() const { return m_index; }
228 
229  static MsgConfigureCameraIndex* create(int index)
230  {
231  return new MsgConfigureCameraIndex(index);
232  }
233 
234  private:
235  int m_index;
236 
238  Message(),
239  m_index(index)
240  { }
241  };
242 
244  {
246 
247  public:
248  int getIndex() const { return m_index; }
249  float getManualFPS() const { return m_manualFPS; }
250  bool getManualFPSEnable() const { return m_manualFPSEnable; }
251 
253  int index,
254  float manualFPS,
255  bool manualFPSEnable)
256  {
257  return new MsgConfigureCameraData(index, manualFPS, manualFPSEnable);
258  }
259 
260  private:
261  int m_index;
262  float m_manualFPS;
264 
265  MsgConfigureCameraData(int index, float manualFPS, bool manualFPSEnable) :
266  Message(),
267  m_index(index),
268  m_manualFPS(manualFPS),
269  m_manualFPSEnable(manualFPSEnable)
270  { }
271  };
272 
273  class MsgReportCameraData : public Message {
275 
276  public:
277  int getdeviceNumber() const { return m_deviceNumber; }
278  float getFPS() const { return m_fps; }
279  float getFPSManual() const { return m_fpsManual; }
280  bool getFPSManualEnable() const { return m_fpsManualEnable; }
281  int getWidth() const { return m_width; }
282  int getHeight() const { return m_height; }
283  int getStatus() const { return m_status; }
284 
286  int deviceNumber,
287  float fps,
288  float fpsManual,
289  bool fpsManualEnable,
290  int width,
291  int height,
292  int status)
293  {
294  return new MsgReportCameraData(
295  deviceNumber,
296  fps,
297  fpsManual,
298  fpsManualEnable,
299  width,
300  height,
301  status);
302  }
303 
304  protected:
306  float m_fps;
307  float m_fpsManual;
309  int m_width;
310  int m_height;
311  int m_status;
312 
314  int deviceNumber,
315  float fps,
316  float fpsManual,
317  bool fpsManualEnable,
318  int width,
319  int height,
320  int status) :
321  Message(),
322  m_deviceNumber(deviceNumber),
323  m_fps(fps),
324  m_fpsManual(fpsManual),
325  m_fpsManualEnable(fpsManualEnable),
326  m_width(width),
327  m_height(height),
328  m_status(status)
329  { }
330  };
331 
333  {
335 
336  public:
337  int getSampleRate() const { return m_sampleRate; }
338  uint32_t gatNbPointsPerLine() const { return m_nbPointsPerLine; }
339 
340  static MsgReportEffectiveSampleRate* create(int sampleRate, uint32_t nbPointsPerLine)
341  {
342  return new MsgReportEffectiveSampleRate(sampleRate, nbPointsPerLine);
343  }
344 
345  protected:
348 
350  int sampleRate,
351  uint32_t nbPointsPerLine) :
352  Message(),
353  m_sampleRate(sampleRate),
354  m_nbPointsPerLine(nbPointsPerLine)
355  { }
356  };
357 
358  ATVMod(DeviceAPI *deviceAPI);
359  ~ATVMod();
360  virtual void destroy() { delete this; }
361 
362  virtual void pull(Sample& sample);
363  virtual void pullAudio(int nbSamples); // this is used for video signal actually
364  virtual void start();
365  virtual void stop();
366  virtual bool handleMessage(const Message& cmd);
367 
368  virtual void getIdentifier(QString& id) { id = objectName(); }
369  virtual void getTitle(QString& title) { title = m_settings.m_title; }
370  virtual qint64 getCenterFrequency() const { return m_settings.m_inputFrequencyOffset; }
371 
372  virtual QByteArray serialize() const;
373  virtual bool deserialize(const QByteArray& data);
374 
375  virtual int getNbSinkStreams() const { return 1; }
376  virtual int getNbSourceStreams() const { return 0; }
377 
378  virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
379  {
380  (void) streamIndex;
381  (void) sinkElseSource;
383  }
384 
385  virtual int webapiSettingsGet(
387  QString& errorMessage);
388 
389  virtual int webapiSettingsPutPatch(
390  bool force,
391  const QStringList& channelSettingsKeys,
393  QString& errorMessage);
394 
395  virtual int webapiReportGet(
397  QString& errorMessage);
398 
399  int getEffectiveSampleRate() const { return m_tvSampleRate; };
400  double getMagSq() const { return m_movingAverage.asDouble(); }
401  void getCameraNumbers(std::vector<int>& numbers);
402 
403  static void getBaseValues(int outputSampleRate, int linesPerSecond, int& sampleRateUnits, uint32_t& nbPointsPerRateUnit);
404  static float getRFBandwidthDivisor(ATVModSettings::ATVModulation modulation);
405 
406  static const QString m_channelIdURI;
407  static const QString m_channelId;
408 
409 signals:
416  void levelChanged(qreal rmsLevel, qreal peakLevel, int numSamples);
417 
418 private slots:
419  void networkManagerFinished(QNetworkReply *reply);
420 
421 private:
422  struct ATVCamera
423  {
424  cv::VideoCapture m_camera;
426  cv::Mat m_videoFrame;
428  float m_videoFPS;
433  float m_videoFx;
434  float m_videoFy;
435  float m_videoFPSq;
439 
441  m_cameraNumber(-1),
442  m_videoFPS(25.0f),
443  m_videoFPSManual(20.0f),
444  m_videoFPSManualEnable(false),
445  m_videoWidth(1),
446  m_videoHeight(1),
447  m_videoFx(1.0f),
448  m_videoFy(1.0f),
449  m_videoFPSq(1.0f),
450  m_videoFPSqManual(1.0f),
451  m_videoFPSCount(0.0f),
452  m_videoPrevFPSCount(0)
453  {}
454  };
455 
459 
463 
466  float m_modPhasor;
480  int m_nbLines;
497  bool m_evenImage;
501  float m_fps;
502 
507 
508  cv::Mat m_imageFromFile;
509  cv::Mat m_imageOriginal;
510  cv::Mat m_image;
511  bool m_imageOK;
512 
513  cv::VideoCapture m_video;
515  cv::Mat m_videoFrame;
516  float m_videoFPS;
519  float m_videoFx;
520  float m_videoFy;
521  float m_videoFPSq;
525  bool m_videoEOF;
526  bool m_videoOK;
527 
528  std::vector<ATVCamera> m_cameras;
530 
531  std::string m_overlayText;
534 
535  // Used for standard SSB
539 
540  // Used for vestigial SSB with asymmetrical filtering (needs double sideband scheme)
544 
545  QNetworkAccessManager *m_networkManager;
546  QNetworkRequest m_networkRequest;
547 
548  static const int m_ssbFftLen;
549  static const float m_blackLevel;
550  static const float m_spanLevel;
551  static const int m_levelNbSamples;
552  static const int m_nbBars;
553  static const int m_cameraFPSTestNbFrames;
554 
555  void applyChannelSettings(int outputSampleRate, int inputFrequencyOffset, bool force = false);
556  void applySettings(const ATVModSettings& settings, bool force = false);
557  void pullFinalize(Complex& ci, Sample& sample);
558  void pullVideo(Real& sample);
559  void calculateLevel(Real& sample);
560  void modulateSample();
561  Complex& modulateSSB(Real& sample);
563  void applyStandard();
564  void openImage(const QString& fileName);
565  void openVideo(const QString& fileName);
566  void resizeImage();
567  void calculateVideoSizes();
568  void resizeVideo();
569  void seekVideoFileStream(int seekPercentage);
570  void scanCameras();
571  void releaseCameras();
572  void calculateCamerasSizes();
573  void resizeCameras();
574  void resizeCamera();
575  void mixImageAndText(cv::Mat& image);
576 
579  void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const ATVModSettings& settings, bool force);
580 
581  inline void pullImageLine(Real& sample, bool noHSync = false)
582  {
583  if (m_horizontalCount < m_pointsPerSync) // sync pulse
584  {
585  sample = noHSync ? m_blackLevel : 0.0f; // ultra-black
586  }
587  else if (m_horizontalCount < m_pointsPerSync + m_pointsPerBP) // back porch
588  {
589  sample = m_blackLevel; // black
590  }
591  else if (m_horizontalCount < m_pointsPerSync + m_pointsPerBP + m_pointsPerImgLine)
592  {
593  int pointIndex = m_horizontalCount - (m_pointsPerSync + m_pointsPerBP);
594  int oddity = m_lineCount < m_nbLines2 + 1 ? 0 : 1;
595  int iLine = oddity == 0 ? m_lineCount : m_lineCount - m_nbLines2 - 1;
596  int iLineImage = iLine - m_nbBlankLines - (oddity == 0 ? m_nbSyncLinesHeadE : m_nbSyncLinesHeadO);
597 
598  switch(m_settings.m_atvModInput)
599  {
601  sample = (((float)pointIndex) / m_pointsPerHBar) * m_hBarIncrement + m_blackLevel;
602  break;
604  sample = (((float)iLine) / m_linesPerVBar) * m_vBarIncrement + m_blackLevel;
605  break;
607  sample = (((iLine / m_linesPerVBar)*5 + (pointIndex / m_pointsPerHBar)) % 2) * m_spanLevel * m_settings.m_uniformLevel + m_blackLevel;
608  break;
610  sample = (pointIndex / (float) m_pointsPerImgLine) * m_spanLevel + m_blackLevel;
611  break;
613  sample = ((iLine -5) / (float) m_nbImageLines2) * m_spanLevel + m_blackLevel;
614  break;
616  if (!m_imageOK || (iLineImage < -oddity) || m_image.empty())
617  {
618  sample = m_spanLevel * m_settings.m_uniformLevel + m_blackLevel;
619  }
620  else
621  {
622  unsigned char pixv;
623 
624  if (m_interleaved) {
625  pixv = m_image.at<unsigned char>(2*iLineImage + oddity, pointIndex); // row (y), col (x)
626  } else {
627  pixv = m_image.at<unsigned char>(iLineImage, pointIndex); // row (y), col (x)
628  }
629 
630  sample = (pixv / 256.0f) * m_spanLevel + m_blackLevel;
631  }
632  break;
634  if (!m_videoOK || (iLineImage < -oddity) || m_videoFrame.empty())
635  {
636  sample = m_spanLevel * m_settings.m_uniformLevel + m_blackLevel;
637  }
638  else
639  {
640  unsigned char pixv;
641 
642  if (m_interleaved) {
643  pixv = m_videoFrame.at<unsigned char>(2*iLineImage + oddity, pointIndex); // row (y), col (x)
644  } else {
645  pixv = m_videoFrame.at<unsigned char>(iLineImage, pointIndex); // row (y), col (x)
646  }
647 
648  sample = (pixv / 256.0f) * m_spanLevel + m_blackLevel;
649  }
650  break;
652  if ((iLineImage < -oddity) || (m_cameraIndex < 0))
653  {
654  sample = m_spanLevel * m_settings.m_uniformLevel + m_blackLevel;
655  }
656  else
657  {
658  ATVCamera& camera = m_cameras[m_cameraIndex];
659 
660  if (camera.m_videoFrame.empty())
661  {
662  sample = m_spanLevel * m_settings.m_uniformLevel + m_blackLevel;
663  }
664  else
665  {
666  unsigned char pixv;
667 
668  if (m_interleaved) {
669  pixv = camera.m_videoFrame.at<unsigned char>(2*iLineImage + oddity, pointIndex); // row (y), col (x)
670  } else {
671  pixv = camera.m_videoFrame.at<unsigned char>(iLineImage, pointIndex); // row (y), col (x)
672  }
673 
674  sample = (pixv / 256.0f) * m_spanLevel + m_blackLevel;
675  }
676  }
677  break;
679  default:
680  sample = m_spanLevel * m_settings.m_uniformLevel + m_blackLevel;
681  }
682  }
683  else // front porch
684  {
685  sample = m_blackLevel; // black
686  }
687  }
688 
689  inline void pullVSyncLineLongPulses(Real& sample)
690  {
691  int halfIndex = m_horizontalCount % (m_nbHorizPoints/2);
692 
693  if (halfIndex < (m_nbHorizPoints/2) - m_pointsPerSync) // ultra-black
694  {
695  sample = 0.0f;
696  }
697  else // black
698  {
699  if (m_singleLongSync && (m_horizontalCount < m_nbHorizPoints/2)) {
700  sample = 0.0f;
701  } else {
702  sample = m_blackLevel;
703  }
704  }
705  }
706 
707  inline void pullVSyncLineEqualizingPulses(Real& sample)
708  {
709  if (m_horizontalCount < m_pointsPerSync)
710  {
711  sample = 0.0f; // ultra-black
712  }
713  else if (m_horizontalCount < (m_nbHorizPoints/2))
714  {
715  sample = m_blackLevel; // black
716  }
717  else if (m_horizontalCount < (m_nbHorizPoints/2) + m_pointsPerFSync)
718  {
719  sample = 0.0f; // ultra-black
720  }
721  else
722  {
723  sample = m_blackLevel; // black
724  }
725  }
726 
728  {
729  if (m_horizontalCount < m_pointsPerSync)
730  {
731  sample = 0.0f; // ultra-black
732  }
733  else if (m_horizontalCount < (m_nbHorizPoints/2))
734  {
735  sample = m_blackLevel; // black
736  }
737  else if (m_horizontalCount < m_nbHorizPoints - m_pointsPerSync)
738  {
739  sample = 0.0f; // ultra-black
740  }
741  else
742  {
743  sample = m_blackLevel; // black
744  }
745  }
746 
748  {
749  if (m_horizontalCount < (m_nbHorizPoints/2) - m_pointsPerSync)
750  {
751  sample = 0.0f; // ultra-black
752  }
753  else if (m_horizontalCount < (m_nbHorizPoints/2))
754  {
755  sample = m_blackLevel; // black
756  }
757  else if (m_horizontalCount < (m_nbHorizPoints/2) + m_pointsPerFSync)
758  {
759  sample = 0.0f; // ultra-black
760  }
761  else
762  {
763  sample = m_blackLevel; // black
764  }
765  }
766 
767  inline void pullVSyncLine(Real& sample)
768  {
769  if (m_lineCount < m_nbLines2 + 1) // even
770  {
771  int fieldLine = m_lineCount;
772 
773  if (fieldLine < m_nbLongSyncLines) // 0,1: Whole line "long" pulses
774  {
775  pullVSyncLineLongPulses(sample);
776  }
777  else if (fieldLine < m_nbLongSyncLines + m_nbHalfLongSync) // long pulse then equalizing pulse
778  {
780  }
781  else if (fieldLine < m_nbLongSyncLines + m_nbHalfLongSync + m_nbWholeEqLines) // Whole line equalizing pulses
782  {
784  }
785  else if (fieldLine > m_nbLines2 - m_nbHalfLongSync) // equalizing pulse then long pulse
786  {
788  }
789  else if (fieldLine > m_nbLines2 - m_nbHalfLongSync - m_nbWholeEqLines) // Whole line equalizing pulses
790  {
792  }
793  else // black images
794  {
795  if (m_horizontalCount < m_pointsPerSync)
796  {
797  sample = 0.0f;
798  }
799  else
800  {
801  sample = m_blankLineLvel;
802  }
803  }
804  }
805  else // odd
806  {
807  int fieldLine = m_lineCount - m_nbLines2 - 1;
808 
809  if (fieldLine < m_nbLongSyncLines) // 0,1: Whole line "long" pulses
810  {
811  pullVSyncLineLongPulses(sample);
812  }
813  else if (fieldLine < m_nbLongSyncLines + m_nbWholeEqLines) // Whole line equalizing pulses
814  {
816  }
817  else if (fieldLine > m_nbLines2 - 1 - m_nbWholeEqLines - m_nbHalfLongSync) // Whole line equalizing pulses
818  {
820  }
821  else // black images
822  {
823  if (m_horizontalCount < m_pointsPerSync)
824  {
825  sample = 0.0f;
826  }
827  else
828  {
829  sample = m_blankLineLvel;
830  }
831  }
832  }
833  }
834 };
835 
836 
837 #endif /* PLUGINS_CHANNELTX_MODATV_ATVMOD_H_ */
uint32_t m_pointsPerFP
number of line points for the front porch
Definition: atvmod.h:475
float m_videoFPSCount
camera FPS fractional counter
Definition: atvmod.h:437
int getEffectiveSampleRate() const
Definition: atvmod.h:399
virtual int webapiSettingsPutPatch(bool force, const QStringList &channelSettingsKeys, SWGSDRangel::SWGChannelSettings &response, QString &errorMessage)
Definition: atvmod.cpp:1286
float m_videoFPSqManual
camera FPS sacaling factor manually set
Definition: atvmod.h:436
static const QString m_channelIdURI
Definition: atvmod.h:406
uint32_t m_pointsPerLine
Number of points per full line.
Definition: atvmod.h:471
static MsgConfigureVideoFileName * create(const QString &fileName)
Definition: atvmod.h:124
virtual void destroy()
Definition: atvmod.h:360
cv::Mat m_videoFrame
displayable camera frame
Definition: atvmod.h:426
float m_videoFPSq
camera FPS sacaling factor
Definition: atvmod.h:435
uint32_t m_pointsPerTU
number of line points per time unit
Definition: atvmod.h:479
DeviceAPI * m_deviceAPI
Definition: atvmod.h:456
std::vector< ATVCamera > m_cameras
vector of available cameras
Definition: atvmod.h:528
virtual void getIdentifier(QString &id)
Definition: atvmod.h:368
bool m_evenImage
in interlaced mode true if this is an even image
Definition: atvmod.h:497
static MsgConfigureCameraIndex * create(int index)
Definition: atvmod.h:229
MsgConfigureVideoFileSourceSeek(int seekPercentage)
Definition: atvmod.h:153
ATVMod(DeviceAPI *deviceAPI)
Definition: atvmod.cpp:61
static MsgReportCameraData * create(int deviceNumber, float fps, float fpsManual, bool fpsManualEnable, int width, int height, int status)
Definition: atvmod.h:285
int m_pointsPerSync
number of line points for the horizontal sync
Definition: atvmod.h:472
int m_nbLines
number of lines per complete frame
Definition: atvmod.h:480
~ATVMod()
Definition: atvmod.cpp:113
int m_DSBFilterBufferIndex
Definition: atvmod.h:543
float m_videoFPS
current video FPS rate
Definition: atvmod.h:516
void resizeCameras()
Definition: atvmod.cpp:913
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
Definition: atvmod.h:378
bool m_videoFPSManualEnable
Enable camera FPS rate manual set value.
Definition: atvmod.h:430
QString m_videoFileName
Definition: atvmod.h:533
void pullFinalize(Complex &ci, Sample &sample)
Definition: atvmod.cpp:180
static MsgReportVideoFileSourceStreamData * create(int frameRate, quint32 recordLength)
Definition: atvmod.h:204
int m_cameraIndex
curent camera index in list of available cameras
Definition: atvmod.h:529
MsgReportCameraData(int deviceNumber, float fps, float fpsManual, bool fpsManualEnable, int width, int height, int status)
Definition: atvmod.h:313
uint32_t m_linesPerVBar
number of lines for a bar of the bar chart
Definition: atvmod.h:478
float m_videoFy
current video vertictal scaling factor
Definition: atvmod.h:520
Complex & modulateVestigialSSB(Real &sample)
Definition: atvmod.cpp:248
static MsgConfigureImageFileName * create(const QString &fileName)
Definition: atvmod.h:103
const ATVModSettings & getSettings() const
Definition: atvmod.h:57
uint32_t gatNbPointsPerLine() const
Definition: atvmod.h:338
virtual int webapiReportGet(SWGSDRangel::SWGChannelReport &response, QString &errorMessage)
Definition: atvmod.cpp:1425
int m_nbWholeEqLines
number of whole equalizing lines
Definition: atvmod.h:490
int m_videoLength
current video length in frames
Definition: atvmod.h:524
float m_hBarIncrement
video level increment at each horizontal bar increment
Definition: atvmod.h:494
int m_videoPrevFPSCount
current video FPS previous integer counter
Definition: atvmod.h:523
static const int m_cameraFPSTestNbFrames
number of frames for camera FPS test
Definition: atvmod.h:553
fftfilt * m_SSBFilter
Definition: atvmod.h:536
static MsgConfigureVideoFileSourceStreamTiming * create()
Definition: atvmod.h:164
static const QString m_channelId
Definition: atvmod.h:407
void resizeVideo()
Definition: atvmod.cpp:891
int m_pointsPerFSync
number of line points for the field first sync
Definition: atvmod.h:476
std::string m_overlayText
Definition: atvmod.h:531
float m_videoFx
camera horizontal scaling factor
Definition: atvmod.h:433
ATVModSettings m_settings
Definition: atvmod.h:66
int m_nbSyncLinesHeadO
number of header sync lines on odd frame
Definition: atvmod.h:486
int getCenterFrequency() const
Definition: atvmod.h:80
static const int m_ssbFftLen
Definition: atvmod.h:548
void modulateSample()
Definition: atvmod.cpp:194
qint64 m_inputFrequencyOffset
offset from baseband center frequency
int m_nbSyncLinesBottom
number of sync lines at bottom
Definition: atvmod.h:487
void openImage(const QString &fileName)
Definition: atvmod.cpp:808
int m_cameraNumber
camera device number
Definition: atvmod.h:427
float m_videoFx
current video horizontal scaling factor
Definition: atvmod.h:519
int m_nbHorizPoints
number of line points per horizontal line
Definition: atvmod.h:484
unsigned int uint32_t
Definition: rtptypes_win.h:46
static const int m_nbBars
number of bars in bar or chessboard patterns
Definition: atvmod.h:552
void pullVSyncLineLongThenEqualizingPulses(Real &sample)
Definition: atvmod.h:747
void applySettings(const ATVModSettings &settings, bool force=false)
Definition: atvmod.cpp:1086
virtual QByteArray serialize() const
Definition: atvmod.cpp:1253
virtual bool handleMessage(const Message &cmd)
Processing of a message. Returns true if message has actually been processed.
Definition: atvmod.cpp:520
float m_modPhasor
For FM modulation.
Definition: atvmod.h:466
QMutex m_settingsMutex
Definition: atvmod.h:498
const QString & getFileName() const
Definition: atvmod.h:122
MsgReportEffectiveSampleRate(int sampleRate, uint32_t nbPointsPerLine)
Definition: atvmod.h:349
float getFPS() const
Definition: atvmod.h:278
void levelChanged(qreal rmsLevel, qreal peakLevel, int numSamples)
QNetworkAccessManager * m_networkManager
Definition: atvmod.h:545
bool getFPSManualEnable() const
Definition: atvmod.h:280
void calculateCamerasSizes()
Definition: atvmod.cpp:898
void openVideo(const QString &fileName)
Definition: atvmod.cpp:831
virtual void pullAudio(int nbSamples)
Definition: atvmod.cpp:133
UpChannelizer * m_channelizer
Definition: atvmod.h:458
MsgConfigureATVMod(const ATVModSettings &settings, bool force)
Definition: atvmod.h:69
int m_videoHeight
camera frame height
Definition: atvmod.h:432
ThreadedBasebandSampleSource * m_threadedChannelizer
Definition: atvmod.h:457
Definition: nco.h:25
virtual void getTitle(QString &title)
Definition: atvmod.h:369
uint32_t m_nbImageLines2
same number as above (non interlaced) or half the number above (interlaced)
Definition: atvmod.h:483
static MsgReportVideoFileSourceStreamTiming * create(int frameCount)
Definition: atvmod.h:183
float m_videoFy
camera vertictal scaling factor
Definition: atvmod.h:434
void pullVSyncLine(Real &sample)
Definition: atvmod.h:767
cv::Mat m_imageOriginal
original not resized image
Definition: atvmod.h:509
#define MESSAGE_CLASS_DECLARATION
Definition: message.h:43
Complex * m_SSBFilterBuffer
Definition: atvmod.h:537
cv::VideoCapture m_video
current video capture
Definition: atvmod.h:513
float m_videoFPS
camera FPS rate
Definition: atvmod.h:428
void pullVSyncLineLongPulses(Real &sample)
Definition: atvmod.h:689
float m_vBarIncrement
video level increment at each vertical bar increment
Definition: atvmod.h:495
QNetworkRequest m_networkRequest
Definition: atvmod.h:546
void resizeImage()
Definition: atvmod.cpp:872
void getCameraNumbers(std::vector< int > &numbers)
Definition: atvmod.cpp:990
int m_videoHeight
current video frame height
Definition: atvmod.h:518
void pullImageLine(Real &sample, bool noHSync=false)
Definition: atvmod.h:581
ATVModSettings m_settings
Definition: atvmod.h:462
uint32_t m_pointsPerHBar
number of line points for a bar of the bar chart
Definition: atvmod.h:477
int m_SSBFilterBufferIndex
Definition: atvmod.h:538
int m_nbHalfLongSync
number of half long sync / equalization lines
Definition: atvmod.h:489
int m_tvSampleRate
sample rate for generating signal
Definition: atvmod.h:470
MsgConfigureImageFileName(const QString &fileName)
Definition: atvmod.h:111
void pullVSyncLineEqualizingThenLongPulses(Real &sample)
Definition: atvmod.h:727
static float getRFBandwidthDivisor(ATVModSettings::ATVModulation modulation)
Definition: atvmod.cpp:659
Real m_interpolatorDistanceRemain
Definition: atvmod.h:469
int m_videoPrevFPSCount
camera FPS previous integer counter
Definition: atvmod.h:438
MovingAverageUtil< double, double, 16 > m_movingAverage
Definition: atvmod.h:503
cv::Mat m_videoFrame
current displayable video frame
Definition: atvmod.h:515
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport &response)
Definition: atvmod.cpp:1496
cv::Mat m_imageFromFile
original image not resized not overlaid by text
Definition: atvmod.h:508
void networkManagerFinished(QNetworkReply *reply)
Definition: atvmod.cpp:1597
static MsgConfigureCameraData * create(int index, float manualFPS, bool manualFPSEnable)
Definition: atvmod.h:252
MsgConfigureChannelizer(int centerFrequency)
Definition: atvmod.h:90
MsgConfigureCameraIndex(int index)
Definition: atvmod.h:237
bool m_imageOK
Definition: atvmod.h:511
cv::Mat m_videoframeOriginal
camera non resized image
Definition: atvmod.h:425
Real m_interpolatorDistance
Definition: atvmod.h:468
NCO m_carrierNco
Definition: atvmod.h:464
virtual void stop()
Definition: atvmod.cpp:516
Real m_peakLevel
Definition: atvmod.h:505
static MsgConfigureATVMod * create(const ATVModSettings &settings, bool force)
Definition: atvmod.h:60
virtual void start()
Definition: atvmod.cpp:509
ATVModInput m_atvModInput
Input source type.
int m_seekPercentage
percentage of seek position from the beginning 0..100
Definition: atvmod.h:151
int getdeviceNumber() const
Definition: atvmod.h:277
virtual int webapiSettingsGet(SWGSDRangel::SWGChannelSettings &response, QString &errorMessage)
Definition: atvmod.cpp:1275
cv::Mat m_videoframeOriginal
current frame from video
Definition: atvmod.h:514
virtual qint64 getCenterFrequency() const
Applies to a default stream.
Definition: atvmod.h:370
int m_pointsPerImgLine
number of line points for the image line
Definition: atvmod.h:474
float m_videoFPSCount
current video FPS fractional counter
Definition: atvmod.h:522
int m_nbBlankLines
number of lines in a frame (full or half) that are blanked (black) at the top of the image ...
Definition: atvmod.h:492
static const int m_levelNbSamples
Definition: atvmod.h:551
cv::VideoCapture m_camera
camera object
Definition: atvmod.h:424
bool m_videoEOF
current video has reached end of file
Definition: atvmod.h:525
QString m_imageFileName
Definition: atvmod.h:532
int m_videoWidth
current video frame width
Definition: atvmod.h:517
Interpolator m_interpolator
Definition: atvmod.h:467
Real m_levelSum
Definition: atvmod.h:506
static MsgConfigureVideoFileSourceSeek * create(int seekPercentage)
Definition: atvmod.h:145
void applyStandard()
Definition: atvmod.cpp:676
void pullVSyncLineEqualizingPulses(Real &sample)
Definition: atvmod.h:707
virtual int getNbSourceStreams() const
Definition: atvmod.h:376
bool m_videoOK
Definition: atvmod.h:526
void scanCameras()
Definition: atvmod.cpp:946
uint32_t m_nbImageLines
number of image lines excluding synchronization lines
Definition: atvmod.h:482
bool m_interleaved
true if image is interlaced (2 half frames per frame)
Definition: atvmod.h:496
void releaseCameras()
Definition: atvmod.cpp:982
Real m_uniformLevel
Percentage between black and white for uniform screen display.
static MsgReportEffectiveSampleRate * create(int sampleRate, uint32_t nbPointsPerLine)
Definition: atvmod.h:340
Definition: atvmod.h:49
int m_horizontalCount
current point index on line
Definition: atvmod.h:499
float m_videoFPSManual
camera FPS rate manually set
Definition: atvmod.h:429
MsgReportVideoFileSourceStreamTiming(int frameCount)
Definition: atvmod.h:191
void webapiReverseSendSettings(QList< QString > &channelSettingsKeys, const ATVModSettings &settings, bool force)
Definition: atvmod.cpp:1502
virtual bool deserialize(const QByteArray &data)
Definition: atvmod.cpp:1258
void calculateVideoSizes()
Definition: atvmod.cpp:880
Complex & modulateSSB(Real &sample)
Definition: atvmod.cpp:229
virtual void pull(Sample &sample)
Definition: atvmod.cpp:138
float m_blankLineLvel
video level of blank lines
Definition: atvmod.h:493
cv::Mat m_image
resized image for transmission at given rate
Definition: atvmod.h:510
int m_videoWidth
camera frame width
Definition: atvmod.h:431
double getMagSq() const
Definition: atvmod.h:400
static void getBaseValues(int outputSampleRate, int linesPerSecond, int &sampleRateUnits, uint32_t &nbPointsPerRateUnit)
Definition: atvmod.cpp:644
MsgReportVideoFileSourceStreamData(int frameRate, int videoLength)
Definition: atvmod.h:214
float getFPSManual() const
Definition: atvmod.h:279
float m_fps
resulting frames per second
Definition: atvmod.h:501
static const float m_spanLevel
Definition: atvmod.h:550
MsgConfigureVideoFileName(const QString &fileName)
Definition: atvmod.h:132
bool m_singleLongSync
single or double long sync per long sync line
Definition: atvmod.h:491
bool getForce() const
Definition: atvmod.h:58
quint32 m_levelCalcCount
Definition: atvmod.h:504
int m_lineCount
current line index in frame
Definition: atvmod.h:500
int m_videoLength
Video length in frames.
Definition: atvmod.h:212
MsgConfigureCameraData(int index, float manualFPS, bool manualFPSEnable)
Definition: atvmod.h:265
int m_pointsPerBP
number of line points for the back porch
Definition: atvmod.h:473
std::complex< Real > Complex
Definition: dsptypes.h:43
bool getManualFPSEnable() const
Definition: atvmod.h:250
static MsgConfigureChannelizer * create(int centerFrequency)
Definition: atvmod.h:82
double asDouble() const
Definition: movingaverage.h:57
int m_outputSampleRate
Definition: atvmod.h:460
int m_nbSyncLinesHeadE
number of header sync lines on even frame
Definition: atvmod.h:485
void applyChannelSettings(int outputSampleRate, int inputFrequencyOffset, bool force=false)
Definition: atvmod.cpp:1033
float Real
Definition: dsptypes.h:42
void seekVideoFileStream(int seekPercentage)
Definition: atvmod.cpp:932
void pullVideo(Real &sample)
Definition: atvmod.cpp:267
void resizeCamera()
Definition: atvmod.cpp:923
void mixImageAndText(cv::Mat &image)
Definition: atvmod.cpp:1016
const QString & getFileName() const
Definition: atvmod.h:101
float getManualFPS() const
Definition: atvmod.h:249
void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings &response, const ATVModSettings &settings)
Definition: atvmod.cpp:1436
fftfilt * m_DSBFilter
Definition: atvmod.h:541
static const float m_blackLevel
Definition: atvmod.h:549
float m_videoFPSq
current video FPS sacaling factor
Definition: atvmod.h:521
int m_inputFrequencyOffset
Definition: atvmod.h:461
int m_nbLines2
same number as above (non interlaced) or half the number above (interlaced)
Definition: atvmod.h:481
Complex * m_DSBFilterBuffer
Definition: atvmod.h:542
int m_nbLongSyncLines
number of whole long sync lines for vertical synchronization
Definition: atvmod.h:488
Complex m_modSample
Definition: atvmod.h:465
virtual int getNbSinkStreams() const
Definition: atvmod.h:375
void calculateLevel(Real &sample)
Definition: atvmod.cpp:490