decoder/renderer: no longer index automatically as part of the retrieve

functions

Indexing is a lengthy process and had a high chance of getting RenderWorkers
stuck doing it rather than being responsive to cache requests. This commit
introduces a system where workers never index media, but instead signal that
media is not ready to their RenderBackends which ensure that the media gets
indexed and re-queues the affected frames when those indexes are ready.
This commit is contained in:
itsmattkc
2020-02-19 11:44:29 +11:00
parent 5e75e9b3b0
commit 03bdf01357
28 changed files with 461 additions and 197 deletions
+12
View File
@@ -83,6 +83,11 @@ int AudioRenderingParams::samples_to_bytes(const int &samples) const
return samples * channel_count() * bytes_per_sample_per_channel();
}
rational AudioRenderingParams::samples_to_time(const int &samples) const
{
return rational(samples, sample_rate());
}
int AudioRenderingParams::bytes_to_samples(const int &bytes) const
{
Q_ASSERT(is_valid());
@@ -90,6 +95,13 @@ int AudioRenderingParams::bytes_to_samples(const int &bytes) const
return bytes / (channel_count() * bytes_per_sample_per_channel());
}
rational AudioRenderingParams::bytes_to_time(const int &bytes) const
{
Q_ASSERT(is_valid());
return samples_to_time(bytes_to_samples(bytes));
}
int AudioRenderingParams::channel_count() const
{
return av_get_channel_layout_nb_channels(channel_layout());