media: Set B_CLONEABLE_AREA where applicable.

Cloning cloned buffers seems especially strange, but
apparently it is actually done. The buffer management
code really needs to be cleaned up...
This commit is contained in:
Augustin Cavalier 2019-08-10 17:55:27 -04:00
parent 23121bac3b
commit 964cab4615
5 changed files with 6 additions and 5 deletions

View File

@ -69,7 +69,7 @@ BBufferGroup::BBufferGroup(size_t size, int32 count, uint32 placement,
void* startAddress; void* startAddress;
area_id bufferArea = create_area("some buffers area", &startAddress, area_id bufferArea = create_area("some buffers area", &startAddress,
placement, areaSize, lock, B_READ_AREA | B_WRITE_AREA); placement, areaSize, lock, B_READ_AREA | B_WRITE_AREA | B_CLONEABLE_AREA);
if (bufferArea < 0) { if (bufferArea < 0) {
ERROR("BBufferGroup: failed to allocate %ld bytes area\n", areaSize); ERROR("BBufferGroup: failed to allocate %ld bytes area\n", areaSize);
fInitError = (status_t)bufferArea; fInitError = (status_t)bufferArea;

View File

@ -2420,7 +2420,7 @@ BMediaRoster::GetParameterWebFor(const media_node& node, BParameterWeb** _web)
area_id area; area_id area;
void *data; void *data;
area = create_area("parameter web data", &data, B_ANY_ADDRESS, size, area = create_area("parameter web data", &data, B_ANY_ADDRESS, size,
B_NO_LOCK, B_READ_AREA | B_WRITE_AREA); B_NO_LOCK, B_READ_AREA | B_WRITE_AREA | B_CLONEABLE_AREA);
if (area < B_OK) { if (area < B_OK) {
ERROR("BMediaRoster::GetParameterWebFor couldn't create area of " ERROR("BMediaRoster::GetParameterWebFor couldn't create area of "
"size %" B_PRId32 "\n", size); "size %" B_PRId32 "\n", size);

View File

@ -44,7 +44,8 @@ SharedBufferList::Create(SharedBufferList** _list)
SharedBufferList* list; SharedBufferList* list;
area_id area = create_area("shared buffer list", (void**)&list, area_id area = create_area("shared buffer list", (void**)&list,
B_ANY_ADDRESS, size, B_LAZY_LOCK, B_READ_AREA | B_WRITE_AREA); B_ANY_ADDRESS, size, B_LAZY_LOCK,
B_READ_AREA | B_WRITE_AREA | B_CLONEABLE_AREA);
if (area < 0) if (area < 0)
return area; return area;

View File

@ -495,7 +495,7 @@ BTimeSource::FinishCreate()
(const_cast<BPrivate::media::TimeSourceTransmit**>(&fBuf)); (const_cast<BPrivate::media::TimeSourceTransmit**>(&fBuf));
fArea = create_area(name, buf, B_ANY_ADDRESS, TS_AREA_SIZE, fArea = create_area(name, buf, B_ANY_ADDRESS, TS_AREA_SIZE,
B_FULL_LOCK, B_READ_AREA | B_WRITE_AREA); B_FULL_LOCK, B_READ_AREA | B_WRITE_AREA | B_CLONEABLE_AREA);
if (fArea <= 0) { if (fArea <= 0) {
ERROR("BTimeSource::BTimeSource couldn't create area, node %" B_PRId32 ERROR("BTimeSource::BTimeSource couldn't create area, node %" B_PRId32

View File

@ -208,7 +208,7 @@ BufferManager::_CloneArea(area_id area)
void* address; void* address;
area_id clonedArea = clone_area("media_server cloned buffer", &address, area_id clonedArea = clone_area("media_server cloned buffer", &address,
B_ANY_ADDRESS, B_READ_AREA | B_WRITE_AREA, area); B_ANY_ADDRESS, B_READ_AREA | B_WRITE_AREA | B_CLONEABLE_AREA, area);
TRACE("BufferManager::_CloneArea() cloned area %" B_PRId32 ", clone id %" TRACE("BufferManager::_CloneArea() cloned area %" B_PRId32 ", clone id %"
B_PRId32 "\n", area, clonedArea); B_PRId32 "\n", area, clonedArea);