History log of /haiku/headers/private/media/ServerInterface.h
Revision Date Author Comments
# 9b193544 21-Aug-2016 Adrien Destugues <pulkomandy@pulkomandy.tk>

CID 608995: buffer overflow.

This should not happen, so in case a file has an unexpectedly large
name, drop to debugger.


# 76889670 21-Apr-2016 Dario Casalinuovo <b.vitruvio@gmail.com>

shutdown_media_server: Finalize rework of synchronization

* When the user isn't requesting a custom notification, it will
be a BMediaRoster job to do it.
* Reintroduce BMediaRoster::SyncToServices, this time based on local
message passing rather than a global semaphore.
* SyncToServices is used in launch_media_server to make the process
more launch_daemon safe and faster in the average case.
* It was an error to add notifications in the media_server.
* Fixes #12717.


# 11c7bd86 04-Apr-2016 Dario Casalinuovo <b.vitruvio@gmail.com>

Replace synchronization semaphore with async messages

* Remove SyncToServices, I will probably readd it in future
but this time using a local synchronization service more than
relying on the media_server to release the semaphore.
* Due to some discussions today in mailing list I decided
to step back and retry the initial way to notify media rosters
about media services status. It is woking by using two different
notifications for reconnecting to the media_server and notifying
the local subscribers.
* This speed up the media services restart.
* Sorry for the noise and very thanks for reviewing my code to
everyone.


# 53c3fa51 02-Apr-2016 Dario Casalinuovo <b.vitruvio@gmail.com>

Introduce functionality for syncing with the media services

* The global synchro semaphore is provided with the purpose of
being used to avoid threads lock up when the media_server is in
an undefined state. There's still room for improvements.
* BMediaRoster::SyncToServices lock up on a semaphore until
the multi_audio correctly connected to the mixer.


# 949cf6ac 19-Apr-2015 Murai Takashi <tmurai01@gmail.com>

Fix GCC 5 build.

* Add -fgnu89-inline flag for libroot/posix/glibc
* Change __GNUC__ == 4 to __GNUC__ >= 4

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

Fixes #11990, most of the changes had already been done.


# 32afe10a 23-Jul-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

BMediaRoster: Add B_MEDIA_SERVER_STARTED and B_MEDIA_SERVER_QUIT

* This is done by watching to registrar notifications
and providing a minimal service to contact the
media roster in private API. The roster use this
service to automatically reconnect to the media_server.


# c079d8d6 12-Jul-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

Implement BMediaRoster::GetNodeAttributesFor


# b6f0f884 10-Jul-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

Implement BMediaRoster::GetFileFormatsFor


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

Implement BMediaRoster::SyncToNode


# 7bcdb362 24-May-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

media_server: Improve BTimeSource slave nodes management

The media_server is now able to remember the timesource associated to
a certain registered_node and always remove it when the owner
application crash, Fixes Ticket #11852


# 14896b93 07-Jan-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

Implement BMediaRoster::RollNode().

Fixes #9083.

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


# 2feaa37f 02-Apr-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

Move media plug-in support to application side.

The media server tried to use node monitoring to dynamically add and
remove plug-ins, but it isn't that useful:
* When a plug-in is added, applications would have to query the media
server to get an up to date list of available formats. For example
MediaConvert populates its format menus on startup.
* When removing a plugin, if an app already had it loaded, there is not
much that can be done to keep it working.
* The list of plugins was not sorted by directories (user vs system
add-ons), so the directories were re-scanned to make sure user add-ons
were returned first, rendering the node monitoring less interesting.

Now, the format handling is done by each application. The node
monitoring is removed, instead the apps will scan the plugin directory
when first using the media kit classes. Restarting the application is
needed to update the media formats list.


# ba5e652d 03-Nov-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Set of patches by Pete Goodeve to imrpove the handling of audio latency.
Closes #7285.


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


# 6aee58a4 17-Jan-2010 Jérôme Duval <korli@users.berlios.de>

* Revert the reverse the addons iteration of r35121.
* The media_addon_server before unloading addons need to be sure the nodes are deleted.
For instance, applications could keep references on global nodes, thus preventing deletion.
To release all references, the media_addon server uses a new method BMediaRosterEx::ReleaseNodeAll().
* Quit the MediaRoster looper when quitting media_addon server before unloading addons.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35133 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


# 6cafce94 09-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Moved the port pool into the new request_data.cpp file; it's no longer
accessible from the outside.
* Instead, request_data now retrieves/releases a reply port on its own.
* There were some more places that still used write_port()/read_port() instead
of QueryServer().


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


# e4c87231 09-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Renamed the xfer_* structures to fit the rest, and let them inherit from the
usual structures.
* Also, they now use the QueryServer()/SendToServer() functions instead of
duplicating them.


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


# 5f207b83 09-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Moved all server interface definitions from DataExchange.h to
ServerInterface.h.


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


# 1fcbc547 09-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* More cleanup.


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


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

* Cleaned up the node manager, got rid of its use of Map, and List.
* Fixed at least two reference counting problems, but nodes from killed teams
still remain alive (will look into this at a later point).
* GetLiveNodes() is now using transfer_area() as well.
* Made all sizes in the SendTo*() and Query*() functions size_t.
* Replaced reinterpret_casts with static_casts when casting void pointers.
* Ordered the request/reply structures by target.
* Tried to consolidate the use of add_on vs. addon.
* More cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34591 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


# 32afe10ab298b543622ea2089f5fa404c83788ae 23-Jul-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

BMediaRoster: Add B_MEDIA_SERVER_STARTED and B_MEDIA_SERVER_QUIT

* This is done by watching to registrar notifications
and providing a minimal service to contact the
media roster in private API. The roster use this
service to automatically reconnect to the media_server.


# c079d8d6d9048763ce2daab04f7d9474711775c8 12-Jul-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

Implement BMediaRoster::GetNodeAttributesFor


# b6f0f884326256fa8a22d61eaff9691f7014b367 10-Jul-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

Implement BMediaRoster::GetFileFormatsFor


# 75486484201a2b4ebbffc34d868679d270b0f170 09-Apr-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

Implement BMediaRoster::SyncToNode


# 7bcdb3624951ebf640098d2a860cef7d9557e1df 24-May-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

media_server: Improve BTimeSource slave nodes management

The media_server is now able to remember the timesource associated to
a certain registered_node and always remove it when the owner
application crash, Fixes Ticket #11852


# 14896b937ac8d8934f52425da50a8dbbee884599 07-Jan-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

Implement BMediaRoster::RollNode().

Fixes #9083.

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


# 2feaa37f244d707251f7fe1184ce4f7d30251e2d 02-Apr-2014 Adrien Destugues <pulkomandy@pulkomandy.tk>

Move media plug-in support to application side.

The media server tried to use node monitoring to dynamically add and
remove plug-ins, but it isn't that useful:
* When a plug-in is added, applications would have to query the media
server to get an up to date list of available formats. For example
MediaConvert populates its format menus on startup.
* When removing a plugin, if an app already had it loaded, there is not
much that can be done to keep it working.
* The list of plugins was not sorted by directories (user vs system
add-ons), so the directories were re-scanned to make sure user add-ons
were returned first, rendering the node monitoring less interesting.

Now, the format handling is done by each application. The node
monitoring is removed, instead the apps will scan the plugin directory
when first using the media kit classes. Restarting the application is
needed to update the media formats list.


# ba5e652d79a41a15230b0940003e7dc352b41974 03-Nov-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Set of patches by Pete Goodeve to imrpove the handling of audio latency.
Closes #7285.


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


# 6aee58a4cb26a848cad1f4343af8597baa144df0 17-Jan-2010 Jérôme Duval <korli@users.berlios.de>

* Revert the reverse the addons iteration of r35121.
* The media_addon_server before unloading addons need to be sure the nodes are deleted.
For instance, applications could keep references on global nodes, thus preventing deletion.
To release all references, the media_addon server uses a new method BMediaRosterEx::ReleaseNodeAll().
* Quit the MediaRoster looper when quitting media_addon server before unloading addons.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35133 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


# 6cafce94b533adc869d1958cdc4cb6db178f65c6 09-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Moved the port pool into the new request_data.cpp file; it's no longer
accessible from the outside.
* Instead, request_data now retrieves/releases a reply port on its own.
* There were some more places that still used write_port()/read_port() instead
of QueryServer().


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


# e4c87231a37d9ec8cb923c61af6995b0622218dc 09-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Renamed the xfer_* structures to fit the rest, and let them inherit from the
usual structures.
* Also, they now use the QueryServer()/SendToServer() functions instead of
duplicating them.


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


# 5f207b83ae4e28125151469d431dfd768406dfa6 09-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Moved all server interface definitions from DataExchange.h to
ServerInterface.h.


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


# 1fcbc5470bd4b35b8cfd68402e8dd61139d61bc1 09-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* More cleanup.


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


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

* Cleaned up the node manager, got rid of its use of Map, and List.
* Fixed at least two reference counting problems, but nodes from killed teams
still remain alive (will look into this at a later point).
* GetLiveNodes() is now using transfer_area() as well.
* Made all sizes in the SendTo*() and Query*() functions size_t.
* Replaced reinterpret_casts with static_casts when casting void pointers.
* Ordered the request/reply structures by target.
* Tried to consolidate the use of add_on vs. addon.
* More cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34591 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