Commit Graph
100 Commits
Author SHA1 Message Date
Dario Casalinuovo a8e8f7ba43 Revert "MultiAudioNode: Fix and polish output locking issues"
This reverts commit 19da5e15c3.
2017-01-20 22:23:55 +01:00
Dario Casalinuovo 19da5e15c3 MultiAudioNode: Fix and polish output locking issues
* For people involved please review, too much confusion seems
to have been done in past.
* The fBufferFreeSem is removed as it didn't make sense. It was
used to detected when the output thread should be stopped, a
boolean flag is used instead.
* Avoid to allocate a BAutolocker at begin of the _OutputThread,
plain Lock/Unlock is used instead.
* The fBufferLock is now locked when a buffer is handled.
2017-01-20 20:52:35 +01:00
Dario Casalinuovo 0563e540b0 MediaClient: Remove operator overloding from private class 2017-01-20 20:52:35 +01:00
Dario Casalinuovo 991d9dbf6d MediaConnection: Implement auto release 2017-01-18 20:19:02 +01:00
Dario Casalinuovo 0844ddf4d9 MediaClient: Polish destructors
* Make Release() the only public way to destroy a connection.
2017-01-18 20:19:02 +01:00
Dario Casalinuovo d64dd7beea MediaClient: Fix style for private methods and other cleanup
* Cleaned up some unneeded callbacks.
2017-01-18 20:19:02 +01:00
Dario Casalinuovo f7d2fd0ba6 MediaPlugins: Make some plugins to use experimental headers. 2017-01-17 00:44:20 +01:00
Dario Casalinuovo 7561d9ac5d Populate media/experimental with future media_kit classes
* Node implementations headers are move into src/kits/media.
2017-01-16 23:04:14 +01:00
Dario Casalinuovo 41acdd1d90 media_kit: Move some files and headers under docs/develop/media 2017-01-16 22:53:44 +01:00
Dario Casalinuovo fdfd8a502e General MediaClient cleanup
* Avoid setting fRunning in different places.
* Fix SimpleMediaOutput kind mismatch.
* Other minor fixes.
2017-01-15 19:28:14 +01:00
Dario Casalinuovo 550e05af20 MediaClient: Start/Stop force argument doesn't make sense 2017-01-15 19:28:14 +01:00
Dario Casalinuovo 728c730c45 MediaClientNode: Fix little night's mixup 2017-01-15 19:28:14 +01:00
Dario Casalinuovo 2c9fa0f278 MediaClientNode: Schedule outgoing connections on start
* Add preliminary binding support.
2017-01-15 14:45:24 +01:00
Dario Casalinuovo e6004b7729 MediaClient: Move WIP min/max functions into BMediaConnection 2017-01-10 22:54:53 +01:00
Dario Casalinuovo e7aa210bca MediaClient: IsRunning() status is set at handle time 2017-01-10 22:44:16 +01:00
Dario Casalinuovo 3dbb4ff62d Fix SoundRecorder build 2017-01-10 22:36:20 +01:00
Dario Casalinuovo 3ef4b20086 Make BMediaRecorder public
* Fills a functionality lack of the classic media_kit.
2017-01-10 21:34:20 +01:00
Dario Casalinuovo 51844723d3 MediaConnection: Remove redundant IsInput/IsOutput 2016-12-18 15:15:30 +01:00
Dario Casalinuovo 75b90c42e5 MediaConnection: Fix buffer size and duration redudancy
* There's no need to supply ways to mismatch the buffer duration
and size. Anything should reflect the media_format, this is at least
fixed on API level.
2016-12-17 19:10:50 +01:00
Dario Casalinuovo 2fdc256d60 BMediaOutput: API cleanup 2016-12-17 19:10:50 +01:00
Dario Casalinuovo 63cb26c536 MediaClient: Hide timesource related API
* There's no point actually in providing BTimeSource dependant
functionality. If and when there will be need for something like
that, possibly never, an higher level solution will be integrated.
2016-12-17 19:10:50 +01:00
Dario Casalinuovo a9a63d1ba5 MediaClient: First valid ID for connections is 1 2016-12-17 19:10:50 +01:00
Dario Casalinuovo ab96594f4c MediaEncoder: Fixes CID 1347183: Control flow issues (NO_EFFECT)
* An unsigned value was checked for negative values.
2016-12-13 00:22:06 +01:00
Dario Casalinuovo 83cd87d033 SimpleMediaClient: Use virtual inheritance to reduce duplication 2016-12-11 19:16:19 +01:00
Dario Casalinuovo d1742cc336 MediaInput/Output: Inherit base virtually 2016-12-11 19:16:18 +01:00
Dario Casalinuovo b8d4709eb9 MediaEventLooper: Remove soft real time lateness bounding
* The media_kit isn't an hard real time beast. Bounding lateness
looked like the perfect way to enable reasonable soft real time
performance and thus limiting port writes and reads between producers
and consumers. It seems to don't work very well so I just remove it.
* The result of the recent code simplification makes it equal to my
first version, before any discussion on it happened.
* Thanks to AlienSoldier for testing such issues.
* Fixes #13069.
2016-12-08 17:13:49 +01:00
Dario Casalinuovo f1f0956504 MediaClient: Just some interface review 2016-12-06 21:16:36 +01:00
Dario Casalinuovo c1137899c5 MediaClient: Update comments to last changes
* The interface is being refined and various comments were inconsistent
at this point.
* AddInput/AddOutput is private now.
2016-12-06 16:47:16 +01:00
Dario Casalinuovo ecb395852e Introduce BSimpleMediaClient
* The idea is to move the callback based mechanism into a derived
class. The objects can be composed to create working systems.
* The BMediaClient class supply RegisterInput/RegisterOutput
and BeginInput/BeginOutput is moved to BSimpleMediaClient.
* Various minor fixes.
2016-11-29 01:22:35 +01:00
Dario Casalinuovo 209b520fa0 MediaClient: Add some padding and reserved functions 2016-11-26 17:30:49 +01:00
Dario Casalinuovo 05e29ea1ad MediaConnection: Remove Reset() 2016-11-26 17:24:10 +01:00
Dario Casalinuovo 9ee6577e2d MediaClient: Distribute callbacks across derived classes 2016-11-26 17:13:02 +01:00
Dario Casalinuovo 9e9655ed55 MediaClient: Use CurrentTime for both offline and performance time 2016-11-25 17:38:44 +01:00
Dario Casalinuovo 6d0255216e MediaClient: Introduce BMediaInput and BMediaOutput 2016-11-25 17:38:44 +01:00
Dario Casalinuovo eebedf8f1a MediaClient: Use unique id for both inputs and outputs 2016-11-25 17:38:44 +01:00
Dario Casalinuovo 8a8384b47f media_client test: Include debug header 2016-11-25 00:07:20 +01:00
Dario Casalinuovo 30f9eb3f90 MediaClient: Use kind/kinds pair for media_connection_kind
* Use const reference for media_connection::kind.
2016-11-25 00:05:06 +01:00
Dario Casalinuovo 902701e6bf MediaClient: Use higher level structs for the remaining methods 2016-11-24 21:37:14 +01:00
Dario Casalinuovo ace98a8db2 media_client test: Add delayed mode when debugging 2016-11-24 18:21:51 +01:00
Dario Casalinuovo d3523cb2ce MediaClient: Fix connection and tests
* Remove some bran related to the Faber audio engine heritage,
this fixes connections and all tests.
2016-11-24 18:21:51 +01:00
Dario Casalinuovo 3c1e013390 MediaClient: Fix build 2016-11-24 01:22:27 +01:00
Dario Casalinuovo a546d1f8f6 MediaClient: Rename FindConnection into FindInput/FindOutput
* The first used for destinations and the second for sources.
2016-11-24 00:54:24 +01:00
Dario Casalinuovo 300e9786ef MediaClientNode: Fix PrepareToConnect with unknown media_type. 2016-11-24 00:46:13 +01:00
Dario Casalinuovo 8e980a4066 media_client test: Set an actual format for connections 2016-11-24 00:27:58 +01:00
Dario Casalinuovo f506f3056f MediaClient: Improve internals and API
* Capabilities() become Kind()
* Use media_client and media_connection to better model
the different situations of the API. Reduce code duplication
and move media_kit structs/methods into private.
* Various API and beauty improvements.
* Introduce id management for media_connections.
* Fix different issues preventing to correctly begin a connection.
2016-11-24 00:27:58 +01:00
Dario Casalinuovo 23d5326e2b MediaClient: Introduce media_client and media_connection
* Those structs are provided as replacement for the classic
media_kit ones. They provide better encapsulation of the data
and the resulting code is heavily simplified. It's planned to
introduce BMediaRoster functions to provide conversion from
media_node and media_input/media_output to media_client
and media_connection.
2016-11-24 00:27:58 +01:00
Dario Casalinuovo 2082b5d25f MediaClient: Use media_client_kind for client capabilities 2016-11-18 17:56:51 +01:00
Dario Casalinuovo 5ec9bd1eff MediaClient: general cleanup 2016-11-18 17:46:19 +01:00
Dario Casalinuovo ed0a5452c2 media_client_test: Add more complex tests 2016-11-17 18:47:38 +01:00
Dario Casalinuovo 413b622176 rtsp_streamer: Update to last api version 2016-11-17 17:47:45 +01:00
Dario Casalinuovo 63b4dd8cef Add simple BMediaClient test 2016-11-17 02:44:42 +01:00
Dario Casalinuovo 0253ecbd9e MediaClient: Remove BeginConnection for external connections
* While it looked like a good formalism, there's no need to add
unneeded complex steps to the user of the API.
2016-11-17 02:43:40 +01:00
Dario Casalinuovo 34619a6fd7 Revert "MediaRoster: Don't allow rosters without a BApplication"
This reverts commit f3c2f6665f.
2016-11-17 01:38:23 +01:00
Dario Casalinuovo 2740a716ea Style fixes 2016-11-14 19:21:58 +01:00
Dario Casalinuovo f3c2f6665f MediaRoster: Don't allow rosters without a BApplication
* The BeBook states that any media_kit app should have BApplication
behind. Beware the app don't need to be running, but the object
should be present. This is because we use BApplication as a safe
exit point to free the memory allocated.
* While I was a bit reclutant in doing that, after a developer
discussion we agreed this would be the cleaner way to solve this
problem without eluding it.
2016-11-14 19:21:58 +01:00
Dario Casalinuovo ad7255c892 MediaRoster: Use messaging instead to call Quit on exit
* As far as the bebook states loopers shouldn't be quit from
other threads, using a B_QUIT_REQUESTED message should be more
safe.
2016-11-14 19:21:58 +01:00
Dario Casalinuovo 521f41dd5a Fix typo and build 2016-11-11 15:50:32 +01:00
Dario Casalinuovo 9b410c41e8 Initial merge of the BMediaClient branch
* The BMediaClient is an higher level API to the media_kit. It
corresponds to what the layout API was for the interface_kit.
The main idea is to allow the developer concentrate only on
higher level details and avoiding handle with the tricky parts
of the media_kit. At the same time the general purpose node that
is implemented inside would allow implementing the best techniques
around thus at the same time reducing code duplication and increasing
efficiency.
* BMediaClient is WIP, this is the initial merge of the branch.
The initial development stone was set long time ago and walked
through various design/implementation phases.
2016-11-11 13:47:56 +01:00
Dario Casalinuovo ce8fd10683 MediaPlayer: Emulate duration attribute for BUrl playlists
* Make the Playlist window working again by caching
the duration value.
2016-11-02 19:42:34 +01:00
Dario Casalinuovo 8023d6bafd PluginManager: Move reference counting in the MediaPlugin
* Ideally we should support this feature by default to allow
future improvements to the plugins management.
* Fixes the major memory corruption that lead to various
crashes on exit in MediaPlayer.
2016-10-31 23:39:32 +01:00
Dario Casalinuovo 42a3f9477d PluginManger: Remove BReferenceable and add locking 2016-10-31 23:39:32 +01:00
Dario Casalinuovo e42135e574 http_streamer: improve IsRunning() safeness 2016-10-23 03:30:27 +02:00
Dario Casalinuovo 3588e74aef BMediaEventLooper: Return to simple lateness computation
* Remove enqueue_time again.
* Lateness seems generally useless. No way to get something useful
experimentally. The commit noise however was useful, the port wait is
behaving more in accordance with the lateness calculus.
* Fixes #12817 and possibly #12594.
2016-10-20 03:11:01 +02:00
Dario Casalinuovo 0c98ab27d3 BMediaFile: Add BUrl SetTo
* Also fix the server version of BUrl constructor
to use a const reference.
2016-10-20 02:26:25 +02:00
Dario Casalinuovo 1c5cb31fef BAdapterIO: Implement SeekModes 2016-10-20 02:26:25 +02:00
Dario Casalinuovo 1df36f2cee UserBuildConfig.ReadMe: Update non working sample
* With AddSourceDirectoryToHaikuImage spaces should be used as entry delimiter.
2016-10-10 19:52:06 +02:00
Dario Casalinuovo ac8ca41623 Fix StreamerPlugin reference counting
* BReferenceable deleted itself when the latest
reference was released causing a double free.
* The code now avoid to call the function when
we are about to delete the object.
2016-09-07 20:42:43 +02:00
Dario Casalinuovo 3ff901ac71 http_streamer: Fix different issues
* Cleanup object management.
* Remove Close() and use the destructor in place.
* Release listener sem on exit.
* Return when there's a request mismatch.
* Add some debugging.
* MediaPlayer crashes are fixed as result of the patchset.
2016-09-07 18:30:34 +02:00
Dario Casalinuovo e3f2079964 AdapterIO: Remove unuseful Close() 2016-09-07 18:21:13 +02:00
Dario Casalinuovo 79bd3b4837 StreamerPlugin: Add reference count
* Keep the Streamer around until everyone released it.
2016-09-07 18:19:10 +02:00
Dario Casalinuovo 95a5e62515 MediaFile: Correctly delete the source on exit
* The delete flag of BUrl constructors was reset by _Init,
this lead to a zombie thread on the background under certain
conditions.
2016-09-07 18:02:34 +02:00
Dario Casalinuovo 4e793ddd87 http_streamer: Don't always use listener's IsRunning
* We are not really handling http requests only.
* Also move BHttpResult retrieve after casting BUrlRequest.
2016-07-21 20:25:01 +02:00
Dario Casalinuovo b4515980f3 http_streamer: Handle http status codes
* Avoid to stop the next request after redirection.
* Fixes #12854.
2016-07-21 20:08:01 +02:00
Dario Casalinuovo 8199f204da MediaPlayer: Add _CalculateDuration and archivable protocol 2016-07-11 01:28:03 +02:00
Dario Casalinuovo be2c072556 http_streamer: Enforce safeness in constructor/thread
* Wait for the thread to exit.
* Update size from the data thread.
2016-07-10 19:12:06 +02:00
Dario Casalinuovo 0162e27293 AdapterIO: Create seek sem only when requested 2016-07-10 19:11:41 +02:00
Dario Casalinuovo eed8ce57b8 http_streamer: Implement IsRunning, more reliability
* The init sem is released also when the request is completed
to be sure the backend doesn't lock on us.
* Implement IsRunning relying on BUrlRequest::IsRunning.
2016-07-09 16:23:02 +02:00
Dario Casalinuovo 0474db50d0 AdapterIO: Add IsRunning method
* The backend need to know if we can really get data.
* Adapt WaitForData to be more reliable using this method.
2016-07-09 16:18:09 +02:00
Dario Casalinuovo 5c05bb48f4 AdapterIO: Remove default arguments in ctor 2016-07-09 02:14:37 +02:00
Dario Casalinuovo 6db16da47a playfile: Make it to accept URLs along with files
* Users can now use it to play web radios.
* Also useful to show easy is to adapt old code.
2016-07-08 23:02:56 +02:00
Dario Casalinuovo afe64ad26e MediaPlayer: Fix x86_64 build 2016-07-08 15:06:15 +02:00
Dario Casalinuovo a784c3ad73 MediaPlayer: Handle B_ENTER in network window 2016-07-08 13:50:47 +02:00
Dario Casalinuovo 778b5d524b MediaPlayer: Fetch the clipboard for an url
* This avoid the user to paste in the BTextControl.
* Done also when the window is activated.
2016-07-08 13:49:54 +02:00
Dario Casalinuovo 7a137e0f0c Remove live555_x86 source package 2016-07-07 23:36:35 +02:00
Dario Casalinuovo 2c19bcfa1c MediaPlayer: Sanitize supplier/mediaFile management
* Fix a leak.
2016-07-07 23:36:35 +02:00
Dario Casalinuovo 7e77623bef MediaPlayer: Remove unneeded MediaRoster locking.
* No idea why it was added in the first place, just
keep in mind BMediaRoster does things using ports and
there's no need of locking it.
* Style fixes along the way.
2016-07-07 23:36:35 +02:00
Dario Casalinuovo b4e751b890 http_streamer: Mutable flag is chosen at runtime
* BeOS Radio now works.
2016-07-03 15:29:56 +02:00
Dario Casalinuovo 9f2deec26f AdapterIO: Seeking and flags access improvements
* Backend seeking is done only if explictly requested in
BAdapterIO Seek.
2016-07-03 15:28:06 +02:00
Dario Casalinuovo d3630cbaec http_streamer: Refine init, set static timeout
* When in Open() the plugin wait for the first buffer
or return an error if timeout expires.
* Make size retrieve more reliable.
2016-07-02 21:19:27 +02:00
Dario Casalinuovo 3ad928de3f BAdapterIO: Refine size inheritance
* Wait evaluation is done considering both position
and buffer size.
* Set back position to 0 after seeking.
* Simplify EvaluatePosition to take advantage of inheritance.
* Use back position to determine the current size of the buffer.
* Add more debug tracing.
* Other minor fixes.
2016-07-02 21:19:27 +02:00
Dario Casalinuovo dc0aa64fb0 MediaPlayer: Make window modal and center on screen 2016-07-02 21:19:27 +02:00
Dario Casalinuovo 8331697602 MediaPlayer: Remove forgot printfs 2016-06-30 17:00:35 +02:00
Dario Casalinuovo 1acb1f504d Style fixes 2016-06-30 16:54:40 +02:00
Dario Casalinuovo 93a1f9d274 http_streamer: Sync with BAdapterIO changes 2016-06-30 16:54:40 +02:00
Dario Casalinuovo 345dba5416 AdapterIO: Further development of the interface
* Implement Open/Close mechanism.
* Implement SetBuffer.
* Implement timeout handling.
* Improve Seek mechanism, this is now working by locking the
thread until the backend call SeekCompleted.
2016-06-30 16:54:40 +02:00
Dario Casalinuovo 92cb0c5d18 MediaPlayer: Add GUI to open network streams 2016-06-30 16:54:40 +02:00
Dario Casalinuovo 70efd0db0a MediaPlayer: Avoid to recreate the supplier more than needed
* MediaPlayer attempted to recreate each time the media supplier(s),
and implictly it recreated also the BMediaFile. This works fine with
local data that can be accessed fastly, but makes lots of troubles
with network streams such as BMediaIO. The result of this was that
the Streamer plugin has been recreated each time having memory and
network wasted other than performances.
* I tried to keep intact the previous logic, and it looks OK for me,
this has been done by moving out of the Controller the ownership of
the TrackSupplier and adding a little utility class that do the
releasing job previously done by the ObjectDeleter.
* Reviews are appreciated.
2016-06-30 16:54:40 +02:00
Dario Casalinuovo 241a32926b http_streamer: Handle Run() failed 2016-06-25 13:46:56 +02:00
Dario Casalinuovo 4dd09daff7 Streaming: Use const reference in place of copying
* Thanks to Markus for reporting.
2016-06-25 01:13:10 +02:00
Dario Casalinuovo 7f28cdba0c http_streamer: Check request after creation
* Thanks to DeadYak for the help.
2016-06-24 23:02:35 +02:00