qmediarecorder.sip 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. // qmediarecorder.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtMultimedia Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  8. //
  9. // This file may be used under the terms of the GNU General Public License
  10. // version 3.0 as published by the Free Software Foundation and appearing in
  11. // the file LICENSE included in the packaging of this file. Please review the
  12. // following information to ensure the GNU General Public License version 3.0
  13. // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. //
  15. // If you do not wish to use this file under the terms of the GPL version 3.0
  16. // then you may purchase a commercial license. For more information contact
  17. // info@riverbankcomputing.com.
  18. //
  19. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. %If (Qt_6_2_0 -)
  22. class QMediaRecorder : public QObject
  23. {
  24. %TypeHeaderCode
  25. #include <qmediarecorder.h>
  26. %End
  27. public:
  28. enum Quality
  29. {
  30. VeryLowQuality,
  31. LowQuality,
  32. NormalQuality,
  33. HighQuality,
  34. VeryHighQuality,
  35. };
  36. enum EncodingMode
  37. {
  38. ConstantQualityEncoding,
  39. ConstantBitRateEncoding,
  40. AverageBitRateEncoding,
  41. TwoPassEncoding,
  42. };
  43. enum RecorderState
  44. {
  45. StoppedState,
  46. RecordingState,
  47. PausedState,
  48. };
  49. enum Error
  50. {
  51. NoError,
  52. ResourceError,
  53. FormatError,
  54. OutOfSpaceError,
  55. LocationNotWritable,
  56. };
  57. QMediaRecorder(QObject *parent /TransferThis/ = 0);
  58. virtual ~QMediaRecorder();
  59. bool isAvailable() const;
  60. QUrl outputLocation() const;
  61. void setOutputLocation(const QUrl &location);
  62. QUrl actualLocation() const;
  63. QMediaRecorder::RecorderState recorderState() const;
  64. QMediaRecorder::Error error() const;
  65. QString errorString() const;
  66. qint64 duration() const;
  67. QMediaFormat mediaFormat() const;
  68. void setMediaFormat(const QMediaFormat &format);
  69. QMediaRecorder::EncodingMode encodingMode() const;
  70. void setEncodingMode(QMediaRecorder::EncodingMode);
  71. QMediaRecorder::Quality quality() const;
  72. void setQuality(QMediaRecorder::Quality quality);
  73. QSize videoResolution() const;
  74. void setVideoResolution(const QSize &);
  75. void setVideoResolution(int width, int height);
  76. qreal videoFrameRate() const;
  77. void setVideoFrameRate(qreal frameRate);
  78. int videoBitRate() const;
  79. void setVideoBitRate(int bitRate);
  80. int audioBitRate() const;
  81. void setAudioBitRate(int bitRate);
  82. int audioChannelCount() const;
  83. void setAudioChannelCount(int channels);
  84. int audioSampleRate() const;
  85. void setAudioSampleRate(int sampleRate);
  86. QMediaMetaData metaData() const;
  87. void setMetaData(const QMediaMetaData &metaData);
  88. QMediaCaptureSession *captureSession() const;
  89. public slots:
  90. void record();
  91. void pause();
  92. void stop();
  93. signals:
  94. void recorderStateChanged(QMediaRecorder::RecorderState state /ScopesStripped=1/);
  95. void durationChanged(qint64 duration);
  96. void actualLocationChanged(const QUrl &location);
  97. void errorOccurred(QMediaRecorder::Error error /ScopesStripped=1/, const QString &errorString);
  98. void errorChanged();
  99. void metaDataChanged();
  100. void mediaFormatChanged();
  101. void encodingModeChanged();
  102. void qualityChanged();
  103. void videoResolutionChanged();
  104. void videoFrameRateChanged();
  105. void videoBitRateChanged();
  106. void audioBitRateChanged();
  107. void audioChannelCountChanged();
  108. void audioSampleRateChanged();
  109. public:
  110. %If (Qt_6_8_0 -)
  111. void setOutputDevice(QIODevice *device);
  112. %End
  113. %If (Qt_6_8_0 -)
  114. QIODevice *outputDevice() const;
  115. %End
  116. %If (Qt_6_8_0 -)
  117. bool autoStop() const;
  118. %End
  119. %If (Qt_6_8_0 -)
  120. void setAutoStop(bool autoStop);
  121. %End
  122. signals:
  123. %If (Qt_6_8_0 -)
  124. void autoStopChanged();
  125. %End
  126. };
  127. %End