Lines Matching defs:chunk
20 BLocker("media chunk cache"),
23 rtm_create_pool(&fRealTimePool, maxBytes, "media chunk cache");
77 chunk_buffer* chunk = NULL;
85 chunk = fChunkCache.front();
91 return chunk;
95 /* Moves the specified chunk to the unused list.
96 This means the chunk data can be overwritten again.
99 ChunkCache::RecycleChunk(chunk_buffer* chunk)
103 rtm_free(chunk->buffer);
104 chunk->capacity = 0;
105 chunk->size = 0;
106 chunk->buffer = NULL;
107 fUnusedChunks.push_back(chunk);
116 // retrieve chunk buffer
117 chunk_buffer* chunk = NULL;
120 chunk = (chunk_buffer*)rtm_alloc(fRealTimePool, sizeof(chunk_buffer));
121 if (chunk == NULL) {
122 ERROR("RTM Pool empty allocating chunk buffer structure");
126 chunk->size = 0;
127 chunk->capacity = 0;
128 chunk->buffer = NULL;
131 chunk = fUnusedChunks.front();
137 chunk->status = reader->GetNextChunk(cookie, &buffer, &bufferSize,
138 &chunk->header);
139 if (chunk->status == B_OK) {
140 if (chunk->capacity < bufferSize) {
142 rtm_free(chunk->buffer);
143 chunk->capacity = (bufferSize + 2047) & ~2047;
144 chunk->buffer = rtm_alloc(fRealTimePool, chunk->capacity);
145 if (chunk->buffer == NULL) {
146 rtm_free(chunk);
147 ERROR("RTM Pool empty allocating chunk buffer\n");
152 memcpy(chunk->buffer, buffer, bufferSize);
153 chunk->size = bufferSize;
156 fChunkCache.push(chunk);
157 return chunk->status == B_OK;