implemented audio exporting

The encoder was moved to its own thread and will transcode the PCM from the
audio renderer into the chosen codec while the video frames are still
received. The implementation isn't perfect and could use some cleaning up, but
it is functional at the moment.
This commit is contained in:
itsmattkc
2019-12-23 01:45:27 +11:00
parent a8beae64ae
commit 3a7b3ffac6
19 changed files with 377 additions and 159 deletions
+14 -4
View File
@@ -16,10 +16,11 @@ class Exporter : public QObject
Q_OBJECT
public:
Exporter(ViewerOutput* viewer,
const VideoRenderingParams& params,
const VideoRenderingParams& video_params,
const AudioRenderingParams& audio_params,
const QMatrix4x4& transform,
ColorProcessorPtr color_processor,
EncoderPtr encoder,
Encoder* encoder,
QObject* parent = nullptr);
bool GetExportStatus() const;
@@ -49,7 +50,8 @@ protected:
ViewerOutput* viewer_node_;
// Export parameters
VideoRenderingParams params_;
VideoRenderingParams video_params_;
AudioRenderingParams audio_params_;
// Export transform
QMatrix4x4 transform_;
@@ -61,7 +63,7 @@ private:
ColorProcessorPtr color_processor_;
EncoderPtr encoder_;
Encoder* encoder_;
bool export_status_;
@@ -74,6 +76,14 @@ private:
private slots:
void FrameRendered(const rational& time, QVariant value);
void AudioRendered();
void EncoderOpenedSuccessfully();
void EncoderOpenFailed();
void EncoderClosed();
};
#endif // EXPORTER_H