began audio conform code in ffmpegdecoder

For accuracy, whenever we need to perform an audio resample, we need to do it
in advance. This is in a process called "conforming" and this commit introduces
the framework by which the decoder can automatically conform an audio stream
to arbitrary parameters for accurate rendering.
This commit is contained in:
itsmattkc
2019-11-29 02:10:28 +11:00
parent 755b4233ff
commit 16f4ec8468
8 changed files with 150 additions and 6 deletions
+10 -3
View File
@@ -54,6 +54,8 @@ public:
virtual int64_t GetTimestampFromTime(const rational& time) override;
virtual void Conform(const AudioRenderingParams& params) override;
private:
/**
* @brief Handle an error
@@ -100,11 +102,14 @@ private:
* @brief Returns the filename for the index
*
* Retrieves the absolute filename of the index file for this stream. Decoder must be open for this to work correctly.
*
* @return
*/
QString GetIndexFilename();
/**
* @brief Get the destination filename of an audio stream conformed to a set of parameters
*/
QString GetConformedFilename(const AudioRenderingParams &params);
/**
* @brief Used internally to load a frame index into frame_index_
*
@@ -132,7 +137,9 @@ private:
*/
AVPixelFormat GetCompatiblePixelFormat(const AVPixelFormat& pix_fmt);
SampleFormat GetNativeSampleRate(const AVSampleFormat& smp_fmt);
SampleFormat GetNativeSampleFormat(const AVSampleFormat& smp_fmt);
AVSampleFormat GetFFmpegSampleFormat(const SampleFormat& smp_fmt);
int CalculatePlaneHeight(int frame_height, const AVPixelFormat& format, int plane);