| 8 | #include "RabbitCommonDir.h" |
| 9 | |
| 10 | CParameterRecord::CParameterRecord(QObject *parent, const QString &szPrefix) |
| 11 | : CParameter(parent, szPrefix) |
| 12 | , m_bEnableVideo(true) |
| 13 | , m_bEnableAudio(true) |
| 14 | #if HAVE_QT6_MULTIMEDIA |
| 15 | , m_FileFormat(QMediaFormat::FileFormat::MPEG4) |
| 16 | , m_VideoCodec(QMediaFormat::VideoCodec::H264) |
| 17 | , m_AudioCodec(QMediaFormat::AudioCodec::AAC) |
| 18 | , m_Quality(QMediaRecorder::NormalQuality) |
| 19 | , m_EncodingMode(QMediaRecorder::ConstantQualityEncoding) |
| 20 | #endif |
| 21 | , m_VideoBitRate(0) |
| 22 | , m_VideoFrameRate(0) |
| 23 | , m_AudioBitRate(0) |
| 24 | , m_AudioSampleRate(-1) |
| 25 | , m_AudioChannelCount(1) |
| 26 | , m_EndAction(ENDACTION::OpenFile) |
| 27 | { |
| 28 | #if HAVE_QT6_MULTIMEDIA |
| 29 | QMediaRecorder recorder; |
| 30 | m_VideoResolution = recorder.videoResolution(); |
| 31 | m_VideoBitRate = recorder.videoBitRate(); |
| 32 | m_AudioBitRate = recorder.audioBitRate(); |
| 33 | m_AudioChannelCount = recorder.audioChannelCount(); |
| 34 | #endif |
| 35 | |
| 36 | m_szVideoPath = QStandardPaths::writableLocation(QStandardPaths::MoviesLocation); |
| 37 | QDir d; |
| 38 | if(m_szVideoPath.isEmpty() || !d.exists(m_szVideoPath)) |
| 39 | m_szVideoPath = RabbitCommon::CDir::Instance()->GetDirUserImage(); |
| 40 | m_szVideoPath += QDir::separator() + QString("RabbitRemoteControl") |
| 41 | + QDir::separator() + QString("Record"); |
| 42 | |
| 43 | if(!d.exists(m_szVideoPath)) |
| 44 | d.mkpath(m_szVideoPath); |
| 45 | |
| 46 | m_szImagePath = QStandardPaths::writableLocation( |
| 47 | QStandardPaths::PicturesLocation); |
| 48 | if(m_szImagePath.isEmpty() || !d.exists(m_szImagePath)) |
| 49 | m_szImagePath = RabbitCommon::CDir::Instance()->GetDirUserImage(); |
| 50 | m_szImagePath += QDir::separator() + QString("RabbitRemoteControl") |
| 51 | + QDir::separator() + QString("ScreenShot"); |
| 52 | if(!d.exists(m_szImagePath)) |
| 53 | d.mkpath(m_szImagePath); |
| 54 | } |
| 55 | |
| 56 | CParameterRecord& CParameterRecord::operator =(const CParameterRecord& in) |
| 57 | { |