mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	citra, citra_qt: Add video dumping config read/write
The default values are VP9/libvorbis just like before. The default configuration is provided for VP9
This commit is contained in:
		
							parent
							
								
									016f8be0b8
								
							
						
					
					
						commit
						834da14329
					
				
					 4 changed files with 127 additions and 0 deletions
				
			
		|  | @ -93,6 +93,7 @@ void Config::ReadValues() { | |||
|     ReadMiscellaneousValues(); | ||||
|     ReadDebuggingValues(); | ||||
|     ReadWebServiceValues(); | ||||
|     ReadVideoDumpingValues(); | ||||
|     ReadUIValues(); | ||||
|     ReadUtilityValues(); | ||||
| } | ||||
|  | @ -485,6 +486,49 @@ void Config::ReadSystemValues() { | |||
|     qt_config->endGroup(); | ||||
| } | ||||
| 
 | ||||
| // Options for variable bit rate live streaming taken from here:
 | ||||
| // https://developers.google.com/media/vp9/live-encoding
 | ||||
| const QString DEFAULT_VIDEO_ENCODER_OPTIONS = | ||||
|     QStringLiteral("quality:realtime,speed:6,tile-columns:4,frame-parallel:1,threads:8,row-mt:1"); | ||||
| const QString DEFAULT_AUDIO_ENCODER_OPTIONS = QString{}; | ||||
| 
 | ||||
| void Config::ReadVideoDumpingValues() { | ||||
|     qt_config->beginGroup(QStringLiteral("VideoDumping")); | ||||
| 
 | ||||
|     Settings::values.output_format = | ||||
|         ReadSetting(QStringLiteral("output_format"), QStringLiteral("webm")) | ||||
|             .toString() | ||||
|             .toStdString(); | ||||
|     Settings::values.format_options = | ||||
|         ReadSetting(QStringLiteral("format_options")).toString().toStdString(); | ||||
| 
 | ||||
|     Settings::values.video_encoder = | ||||
|         ReadSetting(QStringLiteral("video_encoder"), QStringLiteral("libvpx-vp9")) | ||||
|             .toString() | ||||
|             .toStdString(); | ||||
| 
 | ||||
|     Settings::values.video_encoder_options = | ||||
|         ReadSetting(QStringLiteral("video_encoder_options"), DEFAULT_VIDEO_ENCODER_OPTIONS) | ||||
|             .toString() | ||||
|             .toStdString(); | ||||
| 
 | ||||
|     Settings::values.video_bitrate = | ||||
|         ReadSetting(QStringLiteral("video_bitrate"), 2500000).toULongLong(); | ||||
| 
 | ||||
|     Settings::values.audio_encoder = | ||||
|         ReadSetting(QStringLiteral("audio_encoder"), QStringLiteral("libvorbis")) | ||||
|             .toString() | ||||
|             .toStdString(); | ||||
|     Settings::values.audio_encoder_options = | ||||
|         ReadSetting(QStringLiteral("audio_encoder_options"), DEFAULT_AUDIO_ENCODER_OPTIONS) | ||||
|             .toString() | ||||
|             .toStdString(); | ||||
|     Settings::values.audio_bitrate = | ||||
|         ReadSetting(QStringLiteral("audio_bitrate"), 64000).toULongLong(); | ||||
| 
 | ||||
|     qt_config->endGroup(); | ||||
| } | ||||
| 
 | ||||
| void Config::ReadUIValues() { | ||||
|     qt_config->beginGroup(QStringLiteral("UI")); | ||||
| 
 | ||||
|  | @ -617,6 +661,7 @@ void Config::SaveValues() { | |||
|     SaveMiscellaneousValues(); | ||||
|     SaveDebuggingValues(); | ||||
|     SaveWebServiceValues(); | ||||
|     SaveVideoDumpingValues(); | ||||
|     SaveUIValues(); | ||||
|     SaveUtilityValues(); | ||||
| } | ||||
|  | @ -915,6 +960,33 @@ void Config::SaveSystemValues() { | |||
|     qt_config->endGroup(); | ||||
| } | ||||
| 
 | ||||
| void Config::SaveVideoDumpingValues() { | ||||
|     qt_config->beginGroup(QStringLiteral("VideoDumping")); | ||||
| 
 | ||||
|     WriteSetting(QStringLiteral("output_format"), | ||||
|                  QString::fromStdString(Settings::values.output_format), QStringLiteral("webm")); | ||||
|     WriteSetting(QStringLiteral("format_options"), | ||||
|                  QString::fromStdString(Settings::values.format_options)); | ||||
|     WriteSetting(QStringLiteral("video_encoder"), | ||||
|                  QString::fromStdString(Settings::values.video_encoder), | ||||
|                  QStringLiteral("libvpx-vp9")); | ||||
|     WriteSetting(QStringLiteral("video_encoder_options"), | ||||
|                  QString::fromStdString(Settings::values.video_encoder_options), | ||||
|                  DEFAULT_VIDEO_ENCODER_OPTIONS); | ||||
|     WriteSetting(QStringLiteral("video_bitrate"), | ||||
|                  static_cast<unsigned long long>(Settings::values.video_bitrate), 2500000); | ||||
|     WriteSetting(QStringLiteral("audio_encoder"), | ||||
|                  QString::fromStdString(Settings::values.audio_encoder), | ||||
|                  QStringLiteral("libvorbis")); | ||||
|     WriteSetting(QStringLiteral("audio_encoder_options"), | ||||
|                  QString::fromStdString(Settings::values.audio_encoder_options), | ||||
|                  DEFAULT_AUDIO_ENCODER_OPTIONS); | ||||
|     WriteSetting(QStringLiteral("audio_bitrate"), | ||||
|                  static_cast<unsigned long long>(Settings::values.audio_bitrate), 64000); | ||||
| 
 | ||||
|     qt_config->endGroup(); | ||||
| } | ||||
| 
 | ||||
| void Config::SaveUIValues() { | ||||
|     qt_config->beginGroup(QStringLiteral("UI")); | ||||
| 
 | ||||
|  |  | |||
|  | @ -44,6 +44,7 @@ private: | |||
|     void ReadUpdaterValues(); | ||||
|     void ReadUtilityValues(); | ||||
|     void ReadWebServiceValues(); | ||||
|     void ReadVideoDumpingValues(); | ||||
| 
 | ||||
|     void SaveValues(); | ||||
|     void SaveAudioValues(); | ||||
|  | @ -65,6 +66,7 @@ private: | |||
|     void SaveUpdaterValues(); | ||||
|     void SaveUtilityValues(); | ||||
|     void SaveWebServiceValues(); | ||||
|     void SaveVideoDumpingValues(); | ||||
| 
 | ||||
|     QVariant ReadSetting(const QString& name) const; | ||||
|     QVariant ReadSetting(const QString& name, const QVariant& default_value) const; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue