History log of /haiku/src/kits/media/BufferConsumer.cpp
Revision Date Author Comments
# 425ac1b6 20-Jun-2023 Alexander von Gluck IV <kallisti5@unixzen.com>

refactor: Swap %Ld for %lld in all format usages

* %Ld is an undocumented alias for %lld in glibc.
* muslc doesn't implement it for this reason.
* While we will likely never drop %Ld support,
lets clean house and set a better example.

Change-Id: Id46dad3104abae483e80cc5c05d1464d3ecd8030
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6636
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# fe08f0b3 14-Aug-2019 Ryan Leavengood <leavengood@gmail.com>

Media Kit: Clear the BufferCache of buffers for disconnected clients

Without this, the BufferCache keeps a reference to these buffers inside the
media_addon_server until the media_addon_server quits, which is pretty much
never.

Should fix #4954 and #14755, and possibly #13614 and #14047, though I think
they may be something else.

Switched from std::map to our HashMap to get something which works in gcc2 and
gcc8.

Change-Id: I26463899724b9d1520d97fec785e435f536eaf3d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1717
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# b84955d4 23-Oct-2018 Barrett17 <b.vitruvio@gmail.com>

media: Remove debug.h, finalize MediaDebug.h

* Funny rust from 0 AD.


# 3ceec1db 12-Jul-2017 Murai Takashi <tmurai01@gmail.com>

BufferConsumer.cpp: Fix ordered comparison between pointer and zero.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

ticket : #13599


# 2ceb090f 19-May-2016 Dario Casalinuovo <b.vitruvio@gmail.com>

media_kit: Follow up fix to use only portable codes

* My previous commit fixed x86_64 but broke all other archs.


# f4ba347b 19-May-2016 Dario Casalinuovo <b.vitruvio@gmail.com>

media_kit: Fix debug printf werrors

* When debugging was enabled in the media_kit those were
causing the build to fail complaining about werrors.


# 0341eac7 14-Apr-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

BufferConsumer: rework SetOutputBuffersFor

* Use MemoryDeleter.
* Avoid use of dynamic allocation.


# 384ae40a 09-Apr-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

Correctly check when the BBuffer failed the registration with the server.

Signed-off-by: Adrien Destugues <pulkomandy@gmail.com>


# cee04e80 08-Feb-2010 Artur Wyszynski <aljen-mlists@o2.pl>

Fixed various errors/warnings reported by cppcheck:
* memory leaks
* resource leaks
* added const's to getters
* removed a few reundant conditions


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35433 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e973f15a 09-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Missing includes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34599 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9dec2310 05-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

Sorry for this large commit in advance; it's not really possible to divide this
into smaller parts:

media_addon_server:
* Removed (broken) use of (broken and inefficient) home-brewn Map, and List
classes. This also fixes a crash on shutdown when used with the malloc_debug
implementation. It's using stl::vector, and stl::map now instead.

_shared_buffer_list:
* Renamed _shared_buffer_list to SharedBufferList, and put it into the BPrivate
namespace. Also, made a class out of it.
* Separated shared buffer list creation from cloning.
* Enlarged maximum number of buffers to something that is not that evil, but
actually uses the space it has (ie. is a useful multiple of
shared_buffer_info that fills a multiple of B_PAGE_SIZE as much as possible).
* No longer drops into the debugger if the
* The list that is currently used is very inefficient for the features it
provides though (no change there).

_buffer_id_cache:
* Renamed to BufferCache, and put it into the private namespace
* It now deletes its buffers on deletion; since the BBufferConsumer will be
gone, too, at this point, there is little chance that there are still buffers
in use.
* Also, it's now using std::map instead of the (see above) Map class.

BBuffer:
* Got rid of the fBufferID member.

Misc.:
* Got rid of the global "team" variable; the media kit is now using the
private app kit's current_team() now.
* Added a lot of missing error checks (mostly memory allocations).
* Renamed fields like "flavorid" to flavor_id, renamed "dfi_*" fields to
something more detailed.
* Moved ServerInterface.h from src/servers/media/ to headers/private/media.
* Notifications.h was not self contained.
* Added missing licenses.
* Lots of cleanups, and coding style fixes.

What this doesn't fix:
* Bug #4954 which started all this (this comes next, though)
* Deinitialization is broken, as the PortPool is uninitialized too early, and
still used afterwards.
* The strange add-on monitoring code in the media_addon_server


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34500 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6e927a5f 30-Oct-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

malloc.h ain't no standard header. Use stdlib.h instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22776 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a6d316d8 01-Oct-2003 beveloper <beveloper@nowhere.fake>

added unused debug output


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4916 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d33e7c44 08-Sep-2003 beveloper <beveloper@nowhere.fake>

added debug output


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4566 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d48f9c63 02-Sep-2003 beveloper <beveloper@nowhere.fake>

reduce debug output at level 2


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4458 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d91580cd 30-Aug-2003 beveloper <beveloper@nowhere.fake>

removed/fixed warnings


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4418 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5ac4fbd7 19-Jun-2003 beveloper <beveloper@nowhere.fake>

clean up of debugging functions
FATAL is now replaced by ERROR and active at DEBUG=1 or above
TRACE is active at 2 or above
PRINT(level, ...) can be used for DEBUG= level or abode
INFO is removed


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3578 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 715be7e1 05-Jun-2003 beveloper <beveloper@nowhere.fake>

added symbols required by BeOS R5 emu10k.media_addon


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3434 a95241bf-73f2-0310-859d-f6bbb57e9c96


# af995aed 03-Jun-2003 beveloper <beveloper@nowhere.fake>

added symbol Connected__15BBufferConsumerRC12media_sourceRC17media_destinationRC12media_formatP11media_input


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3417 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cc2b5950 03-Jun-2003 beveloper <beveloper@nowhere.fake>

fixed format negotiation


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3411 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 255a01c7 14-Apr-2003 beveloper <beveloper@nowhere.fake>

Added a new license to this file, as I'm the author.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3068 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 373a2a57 22-Mar-2003 beveloper <beveloper@nowhere.fake>

Fix crashing bug on BBufferGroup deletion.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2994 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 40f36b03 11-Mar-2003 beveloper <beveloper@nowhere.fake>

some cleanup


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2895 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 353b9f6b 02-Dec-2002 beveloper <beveloper@nowhere.fake>

changed map and list templates to be more useable, however, they will
be rewritten soon. Changed debugging macros and use of them, too.
Also replaced the linked lists in the BufferManager (which were complicated,
but working ok) with template based ones.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2133 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dfb2ad61 03-Nov-2002 beveloper <beveloper@nowhere.fake>

code cleanup


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1833 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 570f7d04 10-Oct-2002 beveloper <beveloper@nowhere.fake>

updated to include the same features/bugs as the screenshot in today's news.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1479 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9e9417d2 05-Oct-2002 beveloper <beveloper@nowhere.fake>

more BMediaRoster functionality


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1381 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3620737c 03-Oct-2002 beveloper <beveloper@nowhere.fake>

added more BMediaRoster functionality


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1359 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 63ffaa3e 02-Oct-2002 beveloper <beveloper@nowhere.fake>

some last minute changes...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1348 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8c6a6096 02-Oct-2002 beveloper <beveloper@nowhere.fake>

rewrote BMediaRoster::Connect() and a few related functions


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1347 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0a483e72 11-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed includes.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@86 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52a38012 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0341eac71b9b939a8053c2fb5925c63814114965 14-Apr-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

BufferConsumer: rework SetOutputBuffersFor

* Use MemoryDeleter.
* Avoid use of dynamic allocation.


# 384ae40aa53b91a9a3e55f8a366139f03dfdc9d2 09-Apr-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

Correctly check when the BBuffer failed the registration with the server.

Signed-off-by: Adrien Destugues <pulkomandy@gmail.com>


# cee04e8074ec61fd8c6dac3539c5b821c3618888 08-Feb-2010 Artur Wyszynski <aljen-mlists@o2.pl>

Fixed various errors/warnings reported by cppcheck:
* memory leaks
* resource leaks
* added const's to getters
* removed a few reundant conditions


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35433 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e973f15a44d7f3b0b453fa7dc5079b29e5f575c0 09-Dec-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Missing includes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34599 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9dec23104287e2fd592cc14148b43fb28a6e1d8e 05-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

Sorry for this large commit in advance; it's not really possible to divide this
into smaller parts:

media_addon_server:
* Removed (broken) use of (broken and inefficient) home-brewn Map, and List
classes. This also fixes a crash on shutdown when used with the malloc_debug
implementation. It's using stl::vector, and stl::map now instead.

_shared_buffer_list:
* Renamed _shared_buffer_list to SharedBufferList, and put it into the BPrivate
namespace. Also, made a class out of it.
* Separated shared buffer list creation from cloning.
* Enlarged maximum number of buffers to something that is not that evil, but
actually uses the space it has (ie. is a useful multiple of
shared_buffer_info that fills a multiple of B_PAGE_SIZE as much as possible).
* No longer drops into the debugger if the
* The list that is currently used is very inefficient for the features it
provides though (no change there).

_buffer_id_cache:
* Renamed to BufferCache, and put it into the private namespace
* It now deletes its buffers on deletion; since the BBufferConsumer will be
gone, too, at this point, there is little chance that there are still buffers
in use.
* Also, it's now using std::map instead of the (see above) Map class.

BBuffer:
* Got rid of the fBufferID member.

Misc.:
* Got rid of the global "team" variable; the media kit is now using the
private app kit's current_team() now.
* Added a lot of missing error checks (mostly memory allocations).
* Renamed fields like "flavorid" to flavor_id, renamed "dfi_*" fields to
something more detailed.
* Moved ServerInterface.h from src/servers/media/ to headers/private/media.
* Notifications.h was not self contained.
* Added missing licenses.
* Lots of cleanups, and coding style fixes.

What this doesn't fix:
* Bug #4954 which started all this (this comes next, though)
* Deinitialization is broken, as the PortPool is uninitialized too early, and
still used afterwards.
* The strange add-on monitoring code in the media_addon_server


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34500 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6e927a5fc080cb934e7584454f472cacf4c3e361 30-Oct-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

malloc.h ain't no standard header. Use stdlib.h instead.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22776 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a6d316d89d8e5bc962cc70113e008f6363bad235 01-Oct-2003 beveloper <beveloper@nowhere.fake>

added unused debug output


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4916 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d33e7c4428a3f2a748bf753012dfc7fee68e0058 08-Sep-2003 beveloper <beveloper@nowhere.fake>

added debug output


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4566 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d48f9c63eb8195df933bbf137315d76c1038a66c 02-Sep-2003 beveloper <beveloper@nowhere.fake>

reduce debug output at level 2


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4458 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d91580cd9a9f39e74f086d5ca31d997a56c111a9 30-Aug-2003 beveloper <beveloper@nowhere.fake>

removed/fixed warnings


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4418 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5ac4fbd70dc5b5387cc80965de796deb820d4f05 19-Jun-2003 beveloper <beveloper@nowhere.fake>

clean up of debugging functions
FATAL is now replaced by ERROR and active at DEBUG=1 or above
TRACE is active at 2 or above
PRINT(level, ...) can be used for DEBUG= level or abode
INFO is removed


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3578 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 715be7e1d41ef60811e6f2e33203722b97924c4f 05-Jun-2003 beveloper <beveloper@nowhere.fake>

added symbols required by BeOS R5 emu10k.media_addon


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3434 a95241bf-73f2-0310-859d-f6bbb57e9c96


# af995aeda64cf0b40ed6d6ebc9ceeb5a5684b623 03-Jun-2003 beveloper <beveloper@nowhere.fake>

added symbol Connected__15BBufferConsumerRC12media_sourceRC17media_destinationRC12media_formatP11media_input


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3417 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cc2b59509b71dc802dd5fb047e7aa50158f8d6d2 03-Jun-2003 beveloper <beveloper@nowhere.fake>

fixed format negotiation


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3411 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 255a01c76a3ddc38d2c6cae806c4148b9bf022d4 14-Apr-2003 beveloper <beveloper@nowhere.fake>

Added a new license to this file, as I'm the author.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3068 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 373a2a570c12a33f045d41f15b1ead5b2eec3927 22-Mar-2003 beveloper <beveloper@nowhere.fake>

Fix crashing bug on BBufferGroup deletion.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2994 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 40f36b03c6d6e5b56766794344d3bf87fbb440ab 11-Mar-2003 beveloper <beveloper@nowhere.fake>

some cleanup


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2895 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 353b9f6bcedb3fa9950f3f65c960e1deb700f84a 02-Dec-2002 beveloper <beveloper@nowhere.fake>

changed map and list templates to be more useable, however, they will
be rewritten soon. Changed debugging macros and use of them, too.
Also replaced the linked lists in the BufferManager (which were complicated,
but working ok) with template based ones.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2133 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dfb2ad6148f303a0ee57faecc282953d11156067 03-Nov-2002 beveloper <beveloper@nowhere.fake>

code cleanup


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1833 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 570f7d0456164c9d2f22525c7eca167021e93770 10-Oct-2002 beveloper <beveloper@nowhere.fake>

updated to include the same features/bugs as the screenshot in today's news.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1479 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9e9417d20596827f8c375ffd90b7a01cae1c0c4c 05-Oct-2002 beveloper <beveloper@nowhere.fake>

more BMediaRoster functionality


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1381 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3620737cb79cb28d11eba8a7396a4d0f00fc512d 03-Oct-2002 beveloper <beveloper@nowhere.fake>

added more BMediaRoster functionality


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1359 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 63ffaa3ea493c670632a32e3660d21af66d408e2 02-Oct-2002 beveloper <beveloper@nowhere.fake>

some last minute changes...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1348 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8c6a6096e726d70741695920db0818695bcda98f 02-Oct-2002 beveloper <beveloper@nowhere.fake>

rewrote BMediaRoster::Connect() and a few related functions


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1347 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 0a483e722194fedf4b5a891c7902c73a4e4dd213 11-Jul-2002 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed includes.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@86 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 52a380120846174213ccce9c4aab0dda17c72083 08-Jul-2002 ejakowatz <ejakowatz@nowhere.fake>

It is accomplished ...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96