From d0da9020019a4349d0b40c8280997d166a60a0a5 Mon Sep 17 00:00:00 2001 From: beveloper Date: Sun, 24 Oct 2004 14:21:34 +0000 Subject: [PATCH] Added an extra thread for chunk extraction. Using the ChunkCache, the ReadFrames call no longer needs to wait for the extractor, but can read it from a cache. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9482 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/media/MediaExtractor.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/headers/private/media/MediaExtractor.h b/headers/private/media/MediaExtractor.h index 6547517da1..19e734372e 100644 --- a/headers/private/media/MediaExtractor.h +++ b/headers/private/media/MediaExtractor.h @@ -3,6 +3,7 @@ #include "ReaderPlugin.h" #include "DecoderPlugin.h" +#include "ChunkCache.h" namespace BPrivate { namespace media { @@ -14,6 +15,7 @@ struct stream_info bool hasCookie; void * infoBuffer; int32 infoBufferSize; + ChunkCache * chunkCache; media_format encodedFormat; }; @@ -42,10 +44,17 @@ public: status_t CreateDecoder(int32 stream, Decoder **decoder, media_codec_info *mci); +private: + static int32 extractor_thread(void *arg); + void ExtractorThread(); private: status_t fErr; - + + sem_id fExtractorWaitSem; + thread_id fExtractorThread; + volatile bool fTerminateExtractor; + BDataIO *fSource; Reader *fReader;