Lines Matching refs:buffer

31 static BLocker sLocker("shared buffer list");
46 area_id area = create_area("shared buffer list", (void**)&list,
72 // ask media_server to get the area_id of the shared buffer list
81 sArea = clone_area("shared buffer list clone", (void**)&sList,
123 // delete the associated buffer
124 delete fInfos[i].buffer;
126 // Decrement buffer count by one, and fill the gap
175 status = CheckID(groupReclaimSem, info.buffer);
180 BBuffer* buffer = new(std::nothrow) BBuffer(info);
181 if (buffer == NULL) {
186 if (buffer->Data() == NULL) {
188 ERROR("BBufferGroup: error while creating buffer\n");
189 delete buffer;
194 status = AddBuffer(groupReclaimSem, buffer);
196 delete buffer;
200 *_buffer = buffer;
207 SharedBufferList::AddBuffer(sem_id groupReclaimSem, BBuffer* buffer)
211 if (buffer == NULL)
218 fInfos[fCount].id = buffer->ID();
219 fInfos[fCount].buffer = buffer;
253 // We always search for a buffer from the group indicated by groupReclaimSem
255 // If "size" != 0, we search for a buffer that is "size" bytes or larger.
256 // If "wantID" != 0, we search for a buffer with this ID.
257 // If "*_buffer" != NULL, we search for a buffer at this address.
259 // If we found a buffer, we also need to mark it in all other groups as
275 // With each itaration we request one more buffer, since we need to skip
303 if ((size != 0 && size <= fInfos[i].buffer->SizeAvailable())
304 || (*_buffer != 0 && fInfos[i].buffer == *_buffer)
306 // we found a buffer
308 *_buffer = fInfos[i].buffer;
310 // if we requested more than one buffer, release the rest
317 // all other buffer groups
319 fInfos[i].buffer->ID());
332 // prepare to request one more buffer next time
336 ERROR("SharedBufferList:: RequestBuffer: no buffer found\n");
342 SharedBufferList::RecycleBuffer(BBuffer* buffer)
346 media_buffer_id id = buffer->ID();
354 // find the buffer id, and reclaim it in all groups it belongs to
359 B_PRId32 " already reclaimed\n", buffer, id);
360 DEBUG_ONLY(debugger("buffer already reclaimed"));
373 " NOT reclaimed\n", buffer, id);
382 SharedBufferList::RemoveBuffer(BBuffer* buffer)
386 media_buffer_id id = buffer->ID();
394 // find the buffer id, and remove it in all groups it belongs to
399 B_PRId32 " not reclaimed\n", buffer, id);
400 DEBUG_ONLY(debugger("buffer not reclaimed"));
403 fInfos[i].buffer = NULL;
414 " not reclaimed\n", buffer, id);
439 buffers[found++] = fInfos[i].buffer;
456 fSemaphore = create_sem(0, "shared buffer list lock");
496 fInfos[i].buffer, id);