* Completely rewrote the ChunkCache - the previous version had some issues with

regards to locking and seeking.
* Furthermore, we now not only cache 4 chunks, but chunk up to a certain
  memory size (MediaExtractor uses 1 MB for now).
* Since I still have occasional hickups, it looks like this wasn't the main
  cause for our audio problems. Still, this will reduce drive access
  considerably during play.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34243 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-11-25 14:24:52 +00:00
parent f03034d7c9
commit 4d89dfc712
4 changed files with 254 additions and 186 deletions
+8 -1
View File
@@ -1,6 +1,8 @@
/*
* Copyright 2004-2007, Marcus Overhagen. All rights reserved.
* Copyright 2008, Maurice Kalinowski. All rights reserved.
* Copyright 2009, Axel Dörfler, [email protected].
*
* Distributed under the terms of the MIT License.
*/
#ifndef _MEDIA_EXTRACTOR_H
@@ -14,7 +16,10 @@
namespace BPrivate {
namespace media {
class ChunkCache;
struct chunk_buffer;
struct stream_info {
status_t status;
@@ -23,9 +28,11 @@ struct stream_info {
const void* infoBuffer;
size_t infoBufferSize;
ChunkCache* chunkCache;
chunk_buffer* lastChunk;
media_format encodedFormat;
};
class MediaExtractor {
public:
MediaExtractor(BDataIO* source, int32 flags);
@@ -58,6 +65,7 @@ public:
media_codec_info* codecInfo);
private:
void _RecycleLastChunk(stream_info& info);
static int32 _ExtractorEntry(void* arg);
void _ExtractorThread();
@@ -66,7 +74,6 @@ private:
sem_id fExtractorWaitSem;
thread_id fExtractorThread;
volatile bool fTerminateExtractor;
BDataIO* fSource;
Reader* fReader;