Commit Graph

84 Commits

Author SHA1 Message Date
Axel Dörfler 15c81466c4 * Reverted part of r34474 that broke binary compatibility.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36212 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-13 13:01:56 +00:00
Axel Dörfler b289aaf66b * A BBuffer does not know where it came from, so
BBufferConsumer::BufferReceived() cannot know whom to send the "buffer is
  late" notification (unless we only have a single input). To solve this, the
  media_header now contains extra fields that can be used to create a
  media_source object.
* Unfortunately, BBufferProducer::SendBuffer() cannot know the output either in
  case there is more than one. Hence, I deprecated the existing SendBuffer()
  call and moved it into "private" - IOW old sources using it won't compile
  anymore under Haiku.
* I introduced a new SendBuffer() variant that also gets the media_source as
  argument.
* Updated all sources (that are part of the image) to use the new variant.
* Removed some purposely commented out code in the audio mixer.
* Implemented late buffer notification, as well as late buffer handling in the
  audio mixer; this is a bit of work in progress, so the debug output is left
  in there.
* Some cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36184 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-12 13:15:46 +00:00
Axel Dörfler 7c86c0a813 * Corrected comment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36171 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-04-11 20:45:23 +00:00
Stephan Aßmus 3a57be2aea * Indentation and naming cleanup in the header
* Small coding style cleanups in the .cpp
 * When reading raw chunks, keep fCurrentFrame updated anyway
 * When decoding frames and chunks, don't change the meaning of fCurrentTime,
   it's supposed to be the start time of the next chunk/frame, same as
   CurrentFrame(), not the time of the frame/chunk we just decoded/read.
   BMediaTrack::CurrentFrame() is actually documented like this in the BeBook,
   but CurrentTime() is not. However, when seeking to a specific time, it is
   understood that this is the time of the next frame/chunk. If we decode/read
   it and set fCurrentTime to the start_time as specified in the media_header,
   it would actually not change for the first frame/chunk after seeking.
   To be able to know the duration of chunks, fWriterFormat had to be changed
   to just fFormat and is now used for decoding as well.
* Simplified handling of media_header in some methods, saves one assignment.

These changes are not so well tested, yet.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-01-07 00:55:55 +00:00
Axel Dörfler 7e5d04c543 Beware! The following commit will crash your system when open "Sounds"; I'll
look into this now.
* Renamed the MMediaFilesManager to MediaFilesManager.
* Got rid of its Map usage, we're using std::map now instead.
* The media_server is using an unsafe method to transfer areas from the server
  to the client. I've changed this for the BMediaFiles API to use Haiku's new
  transfer_area() function. However, this seems to cause the above mentioned
  problems.
* Improved naming and data exchange structures used for the BMediaFiles API.
* Fixed BMediaFiles leaking its lists.
* Cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34554 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-08 14:22:56 +00:00
Axel Dörfler 9dec231042 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
2009-12-05 11:11:28 +00:00
Axel Dörfler 4ed344af25 * Moved _SoundPlayNode into the BPrivate namespace and dismissed the '_' prefix.
* Further cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34482 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-03 22:16:54 +00:00
Axel Dörfler 812fde99a1 * When you even already have the typedefs, why wouldn't you want to use them?
* Some cleanup, no functional change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34474 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-03 19:48:11 +00:00
Axel Dörfler ccedee2295 * Replaced rtm_* placeholders with a real implementation based on the boot
loader's heap. Unlike the BeBook documents, we always lock their memory,
  though.
* Added Haiku extension rtm_available() that returns how much space is left in
  a pool.
* I've disabled the undocumented functions for now - please open a bug report
  if you encounter them used in applications.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34419 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-12-01 17:21:46 +00:00
Stephan Aßmus cb5961b774 * Rewrote last of the MediaKit headers.
* Removed private types from MediaEncoder.h (These have Haiku counterparts,
  I expect MediaEncoder is not yet implemented...)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32787 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-28 15:06:12 +00:00
Stephan Aßmus 224f4fcd63 Rewrote header, updated source.
+alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32786 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-28 14:50:09 +00:00
Stephan Aßmus cb3f273dd2 Rewrote more headers, style updates in some
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32785 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-28 14:39:55 +00:00
Stephan Aßmus 17a5db77c0 * Rewrote header, adjusted source.
+alphabranch


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32783 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-28 14:01:15 +00:00
Stephan Aßmus 6abeda1091 * Rewrote header
* Some coding style fixes.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32782 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-28 13:18:17 +00:00
Stephan Aßmus 05d5d7ad58 Rewrote header.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32780 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-28 12:58:59 +00:00
Stephan Aßmus d4d27fac86 * Rewrote MediaDefs.h and MediaEncoder.h
* Moved MediaKit errors into Errors.h


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32779 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-28 12:42:36 +00:00
Stephan Aßmus d95656d79e Rewrote headers.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32753 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-27 13:49:18 +00:00
Stephan Aßmus 2089178aac Rewrote header.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32751 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-27 13:13:54 +00:00
Axel Dörfler f808efaf83 * Rewrote TimeSource.h.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32696 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-26 11:13:14 +00:00
Axel Dörfler 7c26f9d16d * Rewrote Buffer.h, and BufferConsumer.h, that's enough for a day :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32583 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-21 20:21:45 +00:00
Axel Dörfler a21284874f * Rewrote BBufferGroup header.
* Cleaned up the source file, no functional change (intended).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32139 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-05 16:08:47 +00:00
Stephan Aßmus 048d05a613 Small cleanups.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32123 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-08-05 10:11:06 +00:00
Stephan Aßmus fa770e4c84 * Writer::WriteChunk() takes media_encode_info* instead of flags.
* Improved Encoder API towards what we need for the get_next_encoder() variants
  and the BMediaTrack API.
* Implemented the rest of MediaWriter. Still undecided what to make of
  AddTrackInfo(). BMediaEncoder has that as well, which hints that this is
  something the Encoder needs to support. But it could also be that this is
  only possible to support in Writer.
* Wired a lot of previously unimplemented methods in BMediaFile and BMediaTrack
  needed for write support. If I have not overlooked anything, only the
  parameter stuff is still unimplemented now.

This is all untested, since the FFMpeg Encoder and Writer are still only stubs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32013 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-31 10:46:58 +00:00
Stephan Aßmus 377e95304a * This header couldn't actually be used from C code, since C doesn't support
overloading functions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32000 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-30 22:10:11 +00:00
Stephan Aßmus b8316d9f93 Cleanup and preparations for BPrivate::media::MediaWriter, which will soon
exist.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31983 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-30 17:47:54 +00:00
Stephan Aßmus ee9408a18d Re-wrote MediaFormats.h header.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31978 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-07-30 16:34:06 +00:00
Axel Dörfler eab2783a36 * Fixed license header to look like our others.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30990 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-07 21:18:32 +00:00
Stephan Aßmus b7cf537e50 Added BMediaFile::_UnInit() and implemented the two SetTo() methods.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30987 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-07 19:43:26 +00:00
Stephan Aßmus b5ec3e5669 * Coding style clean-up.
* Use std::nothrow and check allocations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30986 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-06-07 19:35:14 +00:00
Axel Dörfler 2ff47e1785 * Fixed bug I introduced when deleting parameters (no more crashing).
* Removed the BParameterWeb::{Start|Stop}Watching() methods again, as the same
  thing can be achieved using the BMediaRoster already (even though it doesn't
  seem to work yet).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30058 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-09 09:39:58 +00:00
Axel Dörfler db15cbbee1 * Added Dano-compatible BParameterWeb::StartWatching()/StopWatching() method
stubs.
* However, without a working Dano at hand, I can't really implement something
  compatible, so I'll postpone this to some later point.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30030 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-08 14:21:29 +00:00
Axel Dörfler eced4ba5a3 * Rewrote ParameterWeb.h.
* Adapted and cleaned up ParameterWeb.cpp.
* Fixed some copy&paste bugs in the BTextParameter.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30029 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-04-08 14:13:33 +00:00
Michael Lotz 9b9aa75aac * Implement basic support for the BSound parts of BSoundPlayer. Only one sound
at a time is supported and volume as well as start time are not taken into
  account. For reasons I don't feel like investigating right now all the
  BMediaTrack calls in the BTrackReader end up as pure virtual function calls
  though, so it's unusable for now.
* Fix leaking the temporary buffer in BSound.
* Whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29374 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-03-01 23:22:30 +00:00
Michael Lotz 1b921108a7 Rewrote Sound.h and implemented most of BSound. Completely untested yet as the
BSoundPlayer functionality is yet missing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29372 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-03-01 20:56:19 +00:00
François Revol 3a7f25d039 Add identifier for 64 bit float raw audio format, really just to show we can support it without hacking the API :)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26450 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-07-16 19:06:39 +00:00
Stephan Aßmus 9def3bf783 * Rewrote MediaRoster.h
* Removed appearantly unused satic variables. Hope this does not break
  binary compatibility, going to test.
* There are three more private methods, which could probably be removed
  as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24558 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-03-24 15:42:58 +00:00
Jérôme Duval f2e230ca88 fix a bit of gcc4 build
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22578 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-15 22:35:52 +00:00
Axel Dörfler f6e4cbb952 * Rewrote BeBuild.h which had "a few" consequences (got rid of all those class
definitions).
* Minor cleanup here and there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22577 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-10-15 20:13:55 +00:00
Marcus Overhagen 1d18292953 Moved creating and destroying of Reader and Decoder plugins into the PluginManager class.
Removed deferred initialization from BMediaDecoder. 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21296 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-06-02 20:00:48 +00:00
François Revol 0ba2462a6d Added a stub BTextParameter as in Dano, I'd need that for ESDSink at least.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20146 a95241bf-73f2-0310-859d-f6bbb57e9c96
2007-02-16 23:40:49 +00:00
Axel Dörfler 9d00b1d56d * The "no theme available" string is now resized as needed.
* Rewrote header, cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19170 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-11-02 12:54:33 +00:00
Marcus Overhagen 0a00d23f2e Reworked media_format meta data handling.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17458 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-05-14 22:51:14 +00:00
Marcus Overhagen 65b73ae4f2 Added a Disconnect() method with simpler parameter list.
Added more error checking to Connect() and Input/Output publishing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16625 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-03-07 12:52:19 +00:00
Ingo Weinhold 2fee50849c GCC 4 fix.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15490 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-11 13:53:26 +00:00
Ingo Weinhold 758b1d0e05 Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
  declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
  explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
  something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
  'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
  is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
  Otherwise the an inner class with that name is considered as friend.
  gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-12 23:27:14 +00:00
Marcus Overhagen 23f34657e1 This fix should prevent TimeSource control thread from using random semaphores,
by no longer using an uninitialized Blocker object.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13465 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-05 21:35:38 +00:00
beveloper df42a7b539 Massive BSoundPlayer rewrite. Format negotiation and node registering/unregistering fixed.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9470 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-24 00:16:27 +00:00
beveloper d6105cedfa Some BSoundPlayer style changes and bugfixes
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9461 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-23 17:05:56 +00:00
beveloper e4d07a3e71 Added some new functions which seem to be required for Xentronics SampleStudio Pro.
Added missing license to implementation files.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8590 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-08-16 12:44:00 +00:00
beveloper 7562d5508a Two additional functions to support gain selection for media files (sound events).
Allows better compatibility with Zeta's preference application.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8571 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-08-15 11:54:17 +00:00