History log of /haiku/src/apps/mediaplayer/Controller.cpp
Revision Date Author Comments
# 779ab335 09-Dec-2020 X512 <danger_mail@list.ru>

use .IsSet() instead if .Get() != NULL

Change-Id: Ia2b7a719fd398e78cc3b11d4f7b02cb81179f65f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3488
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# 3f45e1e6 06-Aug-2018 Adrien Destugues <pulkomandy@pulkomandy.tk>

Do not play/pause files nedlessly.

The Controller would always pause and resume playing, even if it found
out there was no position or volume to restore. Since pausing on http
streams appears to be broken, this is not a good idea. Just check if we
have something to restore, and leave the function if not.

Fixes #14326


# 3248de3d 10-Jul-2018 Julien Lepiller <julien@lepiller.eu>

Mediaplayer: remember position and volume

Change-Id: I43fa7cbcedd39c39e4b136e9e1f9bb34bf3eb570


# 3065fd47 13-Dec-2017 Alexander von Gluck IV <kallisti5@unixzen.com>

MediaPlayer: Relicense to MIT

* The GPL license here was a relic from the past to help
control YellowTab's use of Haiku source code. The intent
at the time was to relicense MIT. Some GPL parts remained.
* This is going to get harder and harder to correct over time.
* This code makes Haiku *not* MIT. Lets correct that.
* I reached out to everyone who made changes to these files and
got personal approvals to relicense MIT.
* If I missed somebody, *and* you feel as though the MIT license
doesn't meet your needs, please contact Haiku, Inc. and we will
work to revert your changes.

Marcus Overhagen EMAIL - MIT OK 11/29/17
Stephan Aßmus EMAIL - MIT OK 11/28/17
Axel Dörfler IRC - MIT OK 11/29/17
Ryan Leavengood KEYBASE - MIT OK 11/28/17
Michael Lotz IRC - MIT OK 11/29/17
Adrien Destugues EMAIL - MIT OK 11/28/17
Joachim Seemer EMAIL - MIT OK 11/28/17
Jonas Sundström EMAIL - MIT OK 11/29/17
François Revol IRC - MIT OK 11/29/17
Jérôme Duval EMAIL - MIT OK 11/29/17
Oliver Tappe EMAIL - MIT OK 11/29/17
Dziadek EMAIL - MIT OK 11/29/17
Philippe Saint-Pierre EMAIL - MIT OK 12/6/17
Philippe Houdoin EMAIL - MIT OK 12/8/17
Dario Casalinuovo IRC - MIT OK 12/13/17


# 70efd0db 29-Jun-2016 Dario Casalinuovo <b.vitruvio@gmail.com>

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.


# beddc8ee 04-Jan-2016 Markus Himmel <markus@himmel-villmar.de>

MediaPlayer: Add missing null check

Signed-off-by: Dario Casalinuovo <b.vitruvio@gmail.com>


# a178983d 09-Sep-2011 Axel Dörfler <axeld@pinc-software.de>

Cleanup while I was searching for a bug that ended up being in the app_server;
the decorators now return non-sense as their frame, thank you Clemens!
* Got rid of Settings::CurrentSettings() - the get/store pair wasn't really
thread-safe anyway, as it always updated all fields, so settings could get
lost easily. The mechanism is still being used in the settings window, though.
* Introduced some getters/setters for the settings that work on the message
directly which simplifies some code.
* Minor style cleanups.
* Automatic whitespace cleanup.


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


# ec646de2 27-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

Coding style fix.


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


# c8ccdf52 27-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

* Added basic support for SRT subtitle files. It only works
if the SRT file is placed alongside the current playlist
item under the same name (sans extension). The name of the
language is taken from the file which needs to be separated
by a dot (should be improved).
* Instead of the black outline, subtitles have a nice drop
shadow now, which is easier on the eyes somehow.


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


# ad471f99 21-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

Typo


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


# f70b711f 18-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

* Flesh out attribute support in PlaylistItem/FilePlaylistItem
some more.
* Finish refactoring and abstracting BMediaFile/BMediaTrack
out of the Controller. There is TrackSupplier now and
MediaFileTrackSupplier. One could now implement another
PlaylistItem class besides FilePlaylistItem, which provides
other implementations for TrackSupplier (i.e. for testing
DVD playback).


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


# 5bacae95 17-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

Make use of the new meta-data API and display the
audio track menu item label as the language of the
track.


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


# b80311be 15-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

Only seek to keyframes when the difference in frames
is more than 5 frames.


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


# 8f0617aa 10-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

Fixed winding for video. We need to distingish between
requested seek-frame and snapped-to-keyframe seek-frame.
Not comletely perfect, since sometimes video snaps back
to the same keyframe two or more times, but winding works
anyway.


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


# 0beac2ff 09-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

PlaybackManager:
* Make sure that the messages which trigger a performance
time update a) don't pever pile up and b) that we don't
still receive an event after reinitialization (would
not have been a problem, at one point I thought it was).
* Don't compile in support for changing the playback speed
for the moment.
* Better support for notifying the reaching of a seek frame,
In _UpdateStates(), the wrong state (most often out of bounds)
was checked to be a seek request state. Check if a seek request
was reached in all other cases where states are removed.

Controller:
* Simple but important simplification of the problem that
seeked frames are reached asynchronously and with a latency:
In TimePosition() simply report the seeked frame, if there
are still pending seek requests. This allows a consistent
view from the outside, i.e. after calling SetTimePosition(),
TimePosition() will not return something different.
* Use a more robust way to track pending seek requests. A
new request may have been issued while not having reached
the previous one yet.
* Implement a notification for reaching the seek frame, but
I didn't need it after all, may come in handy later...

MainWin:
* Change the cursor left/right keys to support winding.
Cursor up/down change the volume, Cmd-up/down skips
to the previous/next playlist item, left/right do the
winding now, as requested in ticket #2495.


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


# 818577b2 06-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

* Make PlaybackManager::CurrentFrame() return int64, like
what it's internally using. Adapt NotifyCurrentFrameChanged()
implementors.
* Controller::SetTo() does not need to set the current frame,
since either Init() or FormatChanged() will have taken care
of it now.
* Reset the seeking request info in Controller::SetTo().
* Changed the parameter passed to VideoSupplier::FillBuffer()
from media_format to media_raw_video_format, so the
VideoProducer doesn't have to generate a media_format for
each frame...
* ProxyVideoSupplier caches the last produced frame, which
avoids a situation that the VideoProducer asks to generate
the same frame twice sometimes.
* In PlaybackManager::_PushState(), make sure we really
schedule the next current_frame if asked. This avoids
one situation in which the VideoSupplier was asked to generate
the same frame again and fixes playback after pausing (was
showing black video until the next keyframe before.


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


# 80a9df25 01-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

* Show the controls in full-screen mode when the mouse moves.
* Propagate the current audio channel count to the controls.


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


# 21f2531e 30-Aug-2010 Stephan Aßmus <superstippi@gmx.de>

For videos that are longer than 240 frames, we anticipate
that the graphical precision of the seeking slider is not
enough to seek to individual frames on purpose. So we filter
the requested seeking position to keyframes if there is a
video track. The difference in snappiness when seeking is
like night and day.


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


# e663610e 18-Nov-2009 Stephan Aßmus <superstippi@gmx.de>

* Made opening playlist items asynchronous (in the Controller thread).
* Resolved TODO: Use the existing "FileChanged" notification in the main
window to adopt the UI to the currently playing item.
* When opening a file takes some time, the window is now free to start hidden
and setup a message runner to unhide it after 150 msecs.
* When launching MediaPlayer with files, the 150 msecs delay is used to
start the window hidden and pop up right at the correct location for audio.
If opening the first audio file takes less than 150 msecs, the window will
already show as soon as possible.
* While opening a file in the Controller, the window will say so in the
disabled seek slider instead of showing the message "Drop media files here.".


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


# 98df5c0e 19-Nov-2009 Stephan Aßmus <superstippi@gmx.de>

Disabled some debugging left-over from the recent commits.


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


# ab18a502 16-Nov-2009 Stephan Aßmus <superstippi@gmx.de>

* Moved the about alert handling into the application
* Simplified the handling of the first window and removed FirstWindow(),
we can tell by fPlayerCount.
* Both the above would fix a crash when requesting the about alert with the
first window already gone. Respectively another player instance opening
if fFirstWindow was reset to NULL after some recent revision.
* Implemented restoring the current playlist, index and position in the file.
* Devised a more robust way to solve asynchronous seeking. The Controller is
now notified that a seek request has been handled with a dedicated hook.


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


# 2caab6e5 28-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Coding style cleanups, no functional change.


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


# fa1a1c29 20-Oct-2009 Stephan Aßmus <superstippi@gmx.de>

All sorts of refactoring with regards to the audio node and format setup. At
first I tried adding support for changing the format during running the node
connection, but later found out that this is not implemented in the system
mixer (it has this weird setting to allow input format changes, but if you
do this, the media_server will just crash, since the backend does not support
it yet). Also, the Media Kit documentation is extremely lacking in this regard.
I ended up re-establishing the node connection when the audio format is
supposed to change, just like it is already done for video. This means that
audio files now play with their native channel count and frame rate. But it
isn't so well tested yet, if 48 kHz for example introduce some clicks. The
channel count should not be a problem though, I've also tested that with some
movies and it works fine.


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


# 52a90fe6 19-Oct-2009 Stephan Aßmus <superstippi@gmx.de>

Solved a few problems at program exit. The window needs to lock the playback
manager and inform it that the video target, ie the view will be gone. The
Controller needs to use the SetTo() method in order to actually close down
the nodes properly in the destructor. Otherwise asynchronous threads will use
the BMediaFile and tracks after it has been deleted (until the NodeManager
destructor is executed).


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


# 8856fd5f 14-Jul-2009 Jérôme Duval <korli@users.berlios.de>

Have MediaPlayer supports files with unknown duration:
* Controller: accept streams with unknown duration.
* PlaybackManager: trusts the current frame start and end when frameCount not positive. Also don't stop playing when fStopPlayingFrame is zero.
* MediaTrackAudioSupplier: only fills with silent when the frame count is not zero.
* added some traces.


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


# 1dc94c6b 10-Jul-2009 Stephan Aßmus <superstippi@gmx.de>

Fix spelling error in comment. Thanks Joseph!


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


# 3621c97f 10-Jul-2009 Stephan Aßmus <superstippi@gmx.de>

Most of our Readers place 1:1 as pixel aspect ratio for undistorted video,
which doesn't seem to be correct from how I read the BeBook. Ignore it for
now which is pretty unlikely to be a problem.


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


# a920a6e2 09-Jul-2009 Stephan Aßmus <superstippi@gmx.de>

Use media_format pixel_width/height_aspect as it was meant to be used. This
avoids rounding issues (1440x1080 -> 1920x1080 instead of 1921x1080).


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


# 1f3691df 28-Jun-2009 Stephan Aßmus <superstippi@gmx.de>

* In theory, we should support getting the video aspect from the current stream.
* Added "Force Aspect Ratio" to Video menu and context menu.
* Removed some code duplication in handling the video size messages.
* Added track selection sub-menus to the context menu, replacing the IMHO
not so important interface settings items.


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


# 49ac3f1d 23-May-2009 Stephan Aßmus <superstippi@gmx.de>

* Cleanup
* Removed already resolved TODO


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


# c60fcc87 23-May-2009 Stephan Aßmus <superstippi@gmx.de>

* Changed the PlaylistItem interface to be hopefully more flexible. It can
probably still be improved.
* Renamed EntryRefPlaylistItem to just FilePlaylistItem.
* Moved the "move into Trash" and "restore from Trash" implementation into
FilePlaylistItem. Also added what's needed to allow Tracker to restore the
entry itself.
* Refactored everything to make Playlist use PlaylistItems instead of
entry_refs and all that entails...
* The transition to virtualize PlaylistItems is not complete yet in the
Controller, since it still uses BMediaFile there. But it's much easier to
change that now.
* Objects which keep a PlaylistItem around do correct reference counting, but
some commands could be simplified if they were using references as well. It
still should work correctly, though, if I didn't miss anything. It should also
fix theoretical situations of encountering out-of-memory while messing with
the Playlist leading to inconsistent state between Undo/Redo and then leaking
items because of that.
* Added the discussed change that MediaPlayer checks it's own supported types
before rejecting a file by super type. (untested)
* When importing playlist items, the currently playling item is better
maintained during Undo/Redo.
* Some debugging code added in MediaTrackAudioSupplier, no functional changes.
* Fixed a number of coding style issues and automatic whitespace cleanup.



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


# f3f19aa7 29-Apr-2009 Fredrik Modeen <fredrik@modeen.se>

Revert some out commented error tracing code, thanks Jerome for noticed this.
(Got an error when I tried to spell your name correct)

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


# 9327db63 29-Apr-2009 Fredrik Modeen <fredrik@modeen.se>

Adds the option to delete a file from Mediaplayer and move that file to Trash
Works both from main window and PlayList window.
Button that works are B_COMMAND + [delete | d | r] button.
It can be debated what shortcut to use but I needed this function :)
Same goes for the menu i Playlist window. Yell and Ill change :)

What not works are undo and total undo in main window and total undo in Playlist
(total undo = undo files from trash as well as normal undo)

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


# 7060b0a2 12-Oct-2008 Stephan Aßmus <superstippi@gmx.de>

Fix playback of playlists when "auto play files" is off. The playback stopped
after every new file of a playlist.


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


# 82368346 21-Sep-2008 Jérôme Duval <korli@users.berlios.de>

fActiveVolume should always be set, and only switch volumes if needed


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


# 4ddc254c 26-Aug-2008 Stephan Aßmus <superstippi@gmx.de>

* Implemented decreasing the volume of inactive player windows according to
the global settings. This is only done though if there are multiple players
open at the time. (It doesn't consider their "playing" state, though.)
* The SettingsWindow is now maintained by the MainApp, and there is only a
single instance, those settings are application wide. Also used the
"application floating" window look&feel.
* Small code cleanups.


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


# 9a5f768b 26-Aug-2008 Stephan Aßmus <superstippi@gmx.de>

* Implemented the "Auto start playback", "Close when done playing movie" and
"Close when done playing sound" settings.
* Removed unused member variables from Controller
* Changed Playlist::SetCurrentRef() to indicate success and prevent the
current index from getting out of range.


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


# 21cc1202 25-Aug-2008 Rene Gollent <anevilyak@gmail.com>

Fix this bug in the correct spot by forbidding the controller from trying to toggle the playback state if it hasn't been initialized with a file. Thanks for the tip, Stephan!



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


# df5d28d4 24-Aug-2008 Rene Gollent <anevilyak@gmail.com>

Style cleanup.
When asked to toggle playback, PlaybackManager never checked if it had a previous playback state to copy from. This caused a crash if playback was toggled via the keyboard when no file was loaded. Fixes ticket #2664 .


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


# 725b2409 23-Aug-2008 Stephan Aßmus <superstippi@gmx.de>

* Fix display update when toggling the scaling mode when the video is paused
without disturbing the same thing during normal playback.


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


# 613ecaf5 22-Aug-2008 Stephan Aßmus <superstippi@gmx.de>

* Added the implementation behind the "Use overlays if available" and "Scale
videos smoothly in non-overlay mode" options.
* Disabled the other controls in the SettingsWindow which are not yet
implemented.
* Enable and disable Revert button according to settings state.


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


# 84b6bd9a 14-Aug-2008 David McPaul <dlmcpaul@gmail.com>

Correct display of Duration

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


# eb91d005 14-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

* Whether an audio and/or video node is used is now more explicit. The audio
node can now also be turned off for videos that don't have audio.
* The PlaybackManager currently has the "no audio" support added in a not
quite so nice way, will have to think about something, this is just quick
and dirty to get it going. There is just two places where the audio time
needs to be ignored, because it remains at zero.

-> Especially when using OSS, the seeking latency will be much reduced when
playing videos that have no sound.

* The Controller now maintains the frame it wanted to seek to and does not
forward "position changed" to other listeners as long as the seek frame
has not been reached. This fixes the slider jumping back to the old position
for a bit until jumping back to the seek frame. It also fixes another
problem when switching to the next file. Because the total duration is
already adopted while the old clip is still playing within the seek latency,
the current position jumped to the new relative position, while it is
still refering to the position within the old clip. So both seeking and
switching clips looks much smoother now.


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


# e6ac2ec4 05-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

* The window would not reset the audio/video track to 0 on a new file if
the Controller would keep the last audio/video track index across files
(which would be nice for certain situations).
* Better error message for unsupported files, especially for the
B_MEDIA_NO_HANDLER error.
* In the Controller, try to obtain the track duration and ignore tracks that
return a bogus duration. I have some MP3 files on ZETA that are obviously
not handled correctly by the ZETA mp3 decoder. Previously, the player would
just sit there and appeared to have some other internal error.


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


# 585d5a26 26-Jun-2008 Stephan Aßmus <superstippi@gmx.de>

Removed a no longer used method.


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


# 50450a00 21-Jun-2008 Stephan Aßmus <superstippi@gmx.de>

Implemented an AudioReader subclass "AudioVolumeConverter" which applies
a volume to the audio data. It ramps between a previous and the current volume
if necessary to smooth out the changes. The volume slider functionality is
thereby restored.


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


# 64c4d8f6 02-Jun-2008 Stephan Aßmus <superstippi@gmx.de>

I tracked down a problem with a specific clip I have here.
In the end, the problem was that no codec was installed
for it, but I fixed a bunch of issues on the way to find
out. Now the controller will not rely on the number
of audio and video tracks, but on the fact that it could
instantiate suppliers at all. Made the MediaTrackVideoSupplier
return an init error. Should be replicated for the
MediaTrackAudioSupplier.


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


# 4fd26cd5 31-May-2008 Stephan Aßmus <superstippi@gmx.de>

Reuse existing nodes if the media formats do not change. This fixes the
regression that audio playback of multiple files was not "seamless" anymore.
Even video playback should be seamless, the remaining small glitch could be
a problem with buffer timeout if the switch takes too long.


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


# d7f2503a 31-May-2008 Stephan Aßmus <superstippi@gmx.de>

* Support codecs that don't support B_YCbCrXXX color spaces.
* Leave the codec a chance to advertise the best output color space,
try B_YCbCr422 as the most widely supported format in case the codec
does not advertise.
* Support two more overlay colorspace modes in the video consumer.


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


# 0fc56ed5 30-May-2008 Stephan Aßmus <superstippi@gmx.de>

* Moved a bunch of non-primary interface classes into a new subfolder
"interface"

* Complete reimplementation of the playback engine using Media Nodes:
- Seeking video files does not appear to lockup the playback anymore, but
works on a frame accurate level even for keyframe based streams. There is
currently a problem with certain container formats, the audio track reports
a "Device Seek Error" in certain conditions. In that case audio goes silent,
and can be restarted by going back to the beginnings of the stream.
- Video overlays are now supported.
- It would be possible to connect the output of the MediaPlayer to other
applications or dormant media nodes.

* Known regressions:
- The volume slider has currently no effect anymore.
- Switching the audio track during playback has a known race condition and
can crash the player.
- The new engine is not as "light weight" as the old one. I tagged the
previous implementation in tags/components/mediaplayer-engine-v1. It does
not seem to have any noticable effect though.



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


# a29a9e05 27-Jan-2008 Stephan Aßmus <superstippi@gmx.de>

I think this change fixed some trouble I had with MediaPlayer on a system
with an unsupported sound card or the like, the fSoundOutput initialization
is checked in more places.


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


# a637e3c5 22-Oct-2007 Stephan Aßmus <superstippi@gmx.de>

patch by Fredrik Modéen:
* add filtering of files by mimetype when adding them to the playlist
* some changes by myself (added Axel's suggestion to guess the mimetype
in order to support other filesystems than BFS)
Fredrik -> please have a look at our coding guidelines, also you have weird
whitespaces in your patches... :-)


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


# 540fe7ae 17-Oct-2007 Stephan Aßmus <superstippi@gmx.de>

patch by Fredrik Modéen with changes by myself
* toggle the "marked" state of the settings menu items correctly
* implement muting/unmuting the volume
* implement volume up/down triggered by keyboard events
* forward the skip next/previous events to the controller
(various kinds of keyboard navigation or mouse wheel)
* establish the notification link for volume and muted changes


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


# be5f5c2d 23-Jun-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

ck a dull boy All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull
boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a
dull boy. All work and no play makes Jack a


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


# 84371c14 17-Jun-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

revert the part of the previous checkin that completely broke video seeking (however, the current state is hardly working at all)


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


# 56853d6f 17-Jun-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Use separate waiting semaphores for audio and video, later to be used for seeking


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


# 2a72b9fe 05-Jun-2007 Stephan Aßmus <superstippi@gmx.de>

* re-enabled the InfoWin


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


# 09464bc9 03-Jun-2007 Stephan Aßmus <superstippi@gmx.de>

* extraced PlaylistListView into it's own files
* lots of changes, besically these make the Playlist window usable
- drag sorting works (hold shift to copy instead of move items)
- removing items with the delete key works
- dragging files/folders from Tracker works (hold shift to insert
them in the existing playlist, othewise the new files replace
the playlist)
* some refactoring and bug fixes in previously unused functionality
* Playlist can now be locked (needed to be), and is in ControllerView,
MainWin and PlaylistListView


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


# 8c113568 30-May-2007 Stephan Aßmus <superstippi@gmx.de>

* fixed GCC 4 build, thanks Fredrik Ekdahl


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


# 5fa5e5fe 29-May-2007 Stephan Aßmus <superstippi@gmx.de>

* added notification support to Playlist and Controller
* added AbstractLOAdapter by Ingo Weinhold which makes
notifications asynchronous
* removed "Player" interface/concept, replaced it by
the notification mechanism (window loads new file
when "current" ref index changes in Playlist)
* removed some cross classes dependencies
* the wind buttons are not displayed anymore for now
* lots of changes to the Controller
- the decoder/player threads are kept running for the
entire lifetime of the Controller object (in essence, makes
it possible to playback seamless)
- abstracted BMediaTrack usage into "Video-" and "AudioSupplier"
objects (the BMediaTrack pointers are only still there, because
I have not gotten around to fix the messy/hacky InfoWindow)
- reaching the end of the stream will trigger a notification,
so that the next file from the playlist is played
- fSoundOutput is managed by the Controller
- tried to make seeking seem more controlled (slider doesn't
jump back to previous position)
- playback position is correctly updated in GUI
- volume is maintained independend of SoundOutput so
that it can be transfered from one to the next output
- performance time is maintained correctly (?) even if
no audio stream is present
* work in progress Playlist window (drag sorting does not work yet!)
* rearranged menus a bit
* rearranged overlay code in the VideoView, but it cannot work
like it is currently designed, since the buffers need to be
switched all at once, which the video decoding thread
is not doing yet
* dragging files into the main window with shift held down
appends to the existing playlist
* dropping folders adds files recursively
* pressing space toggles playback (instead of changing some
settings of the GUI)
* fixed some more minor issues or unimplemented stuff in the UI


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


# 7933c6db 10-Sep-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

cleanup


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


# 95688150 12-Jul-2006 Jérôme Duval <korli@users.berlios.de>

fix some warnings


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


# bb15b076 22-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

increased thread priorities


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


# 453f642e 22-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

Rewrote audio decoding to provide timing information
that is used to sync with video.
Separated audio decoding and playing into two threads,
the same applies to video decoding and playback.
This was inspired from code written by Stephan.
Added video decoding and display, added play/pause/stop.


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


# d38c8112 16-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

cache the track duration


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


# 0f0bbc97 08-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

implemented seeking and position update


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


# 131d97be 08-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

Connected volume control GUI with Controller class, and made slider non-linear.
This should be reviewed, and a better algorith should be selected.


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


# 2fd148f9 07-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

dont crash when opening another file


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


# 3e070a9e 07-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

added a crude hack to play sound


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


# 0e49470a 07-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

added starting/stopping of playback threads


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


# 0aaf5eb1 07-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

added a sound output class to push data to the mixer, also started audio and video play threads


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


# bcc46b4b 06-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

implemented opening media files for real


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


# aadc5f57 24-Apr-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

added playlist support


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


# e1d8d7d6 23-Apr-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

implemented some file handling related functionality


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


# 04a91b97 05-Apr-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

Imported source code from DVB TV application


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


# a178983df66aad5957fbc82fb596c74fa4d02e45 09-Sep-2011 Axel Dörfler <axeld@pinc-software.de>

Cleanup while I was searching for a bug that ended up being in the app_server;
the decorators now return non-sense as their frame, thank you Clemens!
* Got rid of Settings::CurrentSettings() - the get/store pair wasn't really
thread-safe anyway, as it always updated all fields, so settings could get
lost easily. The mechanism is still being used in the settings window, though.
* Introduced some getters/setters for the settings that work on the message
directly which simplifies some code.
* Minor style cleanups.
* Automatic whitespace cleanup.


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


# ec646de243390733372cf0b933b883accf6a77fe 27-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

Coding style fix.


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


# c8ccdf52032feea5e7853631dee57cf7f6302c5d 27-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

* Added basic support for SRT subtitle files. It only works
if the SRT file is placed alongside the current playlist
item under the same name (sans extension). The name of the
language is taken from the file which needs to be separated
by a dot (should be improved).
* Instead of the black outline, subtitles have a nice drop
shadow now, which is easier on the eyes somehow.


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


# ad471f99699effb4fe03abc9cabafba2a177add3 21-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

Typo


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


# f70b711fe02a4aae30692678c1c7c143050bc849 18-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

* Flesh out attribute support in PlaylistItem/FilePlaylistItem
some more.
* Finish refactoring and abstracting BMediaFile/BMediaTrack
out of the Controller. There is TrackSupplier now and
MediaFileTrackSupplier. One could now implement another
PlaylistItem class besides FilePlaylistItem, which provides
other implementations for TrackSupplier (i.e. for testing
DVD playback).


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


# 5bacae95fe04b9d957fad95ce76b1e3f8a63409e 17-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

Make use of the new meta-data API and display the
audio track menu item label as the language of the
track.


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


# b80311be9720a8ad3d4ad261ddabd13cfd105521 15-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

Only seek to keyframes when the difference in frames
is more than 5 frames.


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


# 8f0617aa0d39878dfbf872416eaab95cdcfa1742 10-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

Fixed winding for video. We need to distingish between
requested seek-frame and snapped-to-keyframe seek-frame.
Not comletely perfect, since sometimes video snaps back
to the same keyframe two or more times, but winding works
anyway.


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


# 0beac2ff048390fecd8a08a99e7dd2cd8a9724b4 09-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

PlaybackManager:
* Make sure that the messages which trigger a performance
time update a) don't pever pile up and b) that we don't
still receive an event after reinitialization (would
not have been a problem, at one point I thought it was).
* Don't compile in support for changing the playback speed
for the moment.
* Better support for notifying the reaching of a seek frame,
In _UpdateStates(), the wrong state (most often out of bounds)
was checked to be a seek request state. Check if a seek request
was reached in all other cases where states are removed.

Controller:
* Simple but important simplification of the problem that
seeked frames are reached asynchronously and with a latency:
In TimePosition() simply report the seeked frame, if there
are still pending seek requests. This allows a consistent
view from the outside, i.e. after calling SetTimePosition(),
TimePosition() will not return something different.
* Use a more robust way to track pending seek requests. A
new request may have been issued while not having reached
the previous one yet.
* Implement a notification for reaching the seek frame, but
I didn't need it after all, may come in handy later...

MainWin:
* Change the cursor left/right keys to support winding.
Cursor up/down change the volume, Cmd-up/down skips
to the previous/next playlist item, left/right do the
winding now, as requested in ticket #2495.


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


# 818577b203870d5b3625514a99c35726f42cbde3 06-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

* Make PlaybackManager::CurrentFrame() return int64, like
what it's internally using. Adapt NotifyCurrentFrameChanged()
implementors.
* Controller::SetTo() does not need to set the current frame,
since either Init() or FormatChanged() will have taken care
of it now.
* Reset the seeking request info in Controller::SetTo().
* Changed the parameter passed to VideoSupplier::FillBuffer()
from media_format to media_raw_video_format, so the
VideoProducer doesn't have to generate a media_format for
each frame...
* ProxyVideoSupplier caches the last produced frame, which
avoids a situation that the VideoProducer asks to generate
the same frame twice sometimes.
* In PlaybackManager::_PushState(), make sure we really
schedule the next current_frame if asked. This avoids
one situation in which the VideoSupplier was asked to generate
the same frame again and fixes playback after pausing (was
showing black video until the next keyframe before.


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


# 80a9df25028391f54d026007bf633fe99e7529e1 01-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

* Show the controls in full-screen mode when the mouse moves.
* Propagate the current audio channel count to the controls.


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


# 21f2531ebc68797926d38ab2e6dfb32b7be7b71e 30-Aug-2010 Stephan Aßmus <superstippi@gmx.de>

For videos that are longer than 240 frames, we anticipate
that the graphical precision of the seeking slider is not
enough to seek to individual frames on purpose. So we filter
the requested seeking position to keyframes if there is a
video track. The difference in snappiness when seeking is
like night and day.


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


# e663610e84ed96e246aa7bb6d416bd51c1166447 18-Nov-2009 Stephan Aßmus <superstippi@gmx.de>

* Made opening playlist items asynchronous (in the Controller thread).
* Resolved TODO: Use the existing "FileChanged" notification in the main
window to adopt the UI to the currently playing item.
* When opening a file takes some time, the window is now free to start hidden
and setup a message runner to unhide it after 150 msecs.
* When launching MediaPlayer with files, the 150 msecs delay is used to
start the window hidden and pop up right at the correct location for audio.
If opening the first audio file takes less than 150 msecs, the window will
already show as soon as possible.
* While opening a file in the Controller, the window will say so in the
disabled seek slider instead of showing the message "Drop media files here.".


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


# 98df5c0e73e79acf330282c3ffd68fa6b19482c9 19-Nov-2009 Stephan Aßmus <superstippi@gmx.de>

Disabled some debugging left-over from the recent commits.


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


# ab18a502299fa5a8d32768b07814836ef365380b 16-Nov-2009 Stephan Aßmus <superstippi@gmx.de>

* Moved the about alert handling into the application
* Simplified the handling of the first window and removed FirstWindow(),
we can tell by fPlayerCount.
* Both the above would fix a crash when requesting the about alert with the
first window already gone. Respectively another player instance opening
if fFirstWindow was reset to NULL after some recent revision.
* Implemented restoring the current playlist, index and position in the file.
* Devised a more robust way to solve asynchronous seeking. The Controller is
now notified that a seek request has been handled with a dedicated hook.


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


# 2caab6e574d52306baf93db9b830dadefbb08836 28-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Coding style cleanups, no functional change.


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


# fa1a1c2980105e6293ad7cce436360ffa5e9033a 20-Oct-2009 Stephan Aßmus <superstippi@gmx.de>

All sorts of refactoring with regards to the audio node and format setup. At
first I tried adding support for changing the format during running the node
connection, but later found out that this is not implemented in the system
mixer (it has this weird setting to allow input format changes, but if you
do this, the media_server will just crash, since the backend does not support
it yet). Also, the Media Kit documentation is extremely lacking in this regard.
I ended up re-establishing the node connection when the audio format is
supposed to change, just like it is already done for video. This means that
audio files now play with their native channel count and frame rate. But it
isn't so well tested yet, if 48 kHz for example introduce some clicks. The
channel count should not be a problem though, I've also tested that with some
movies and it works fine.


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


# 52a90fe6bef19f3af7fd089d1d819e4fa2fa1260 19-Oct-2009 Stephan Aßmus <superstippi@gmx.de>

Solved a few problems at program exit. The window needs to lock the playback
manager and inform it that the video target, ie the view will be gone. The
Controller needs to use the SetTo() method in order to actually close down
the nodes properly in the destructor. Otherwise asynchronous threads will use
the BMediaFile and tracks after it has been deleted (until the NodeManager
destructor is executed).


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


# 8856fd5fcfde9a92c1fbd17d8b753b1bc6022089 14-Jul-2009 Jérôme Duval <korli@users.berlios.de>

Have MediaPlayer supports files with unknown duration:
* Controller: accept streams with unknown duration.
* PlaybackManager: trusts the current frame start and end when frameCount not positive. Also don't stop playing when fStopPlayingFrame is zero.
* MediaTrackAudioSupplier: only fills with silent when the frame count is not zero.
* added some traces.


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


# 1dc94c6b69f578cf26dbe9af3305b1b58b57f23a 10-Jul-2009 Stephan Aßmus <superstippi@gmx.de>

Fix spelling error in comment. Thanks Joseph!


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


# 3621c97fdf9df8fca03eaedf1efcb1606baa9719 10-Jul-2009 Stephan Aßmus <superstippi@gmx.de>

Most of our Readers place 1:1 as pixel aspect ratio for undistorted video,
which doesn't seem to be correct from how I read the BeBook. Ignore it for
now which is pretty unlikely to be a problem.


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


# a920a6e2a0be1fa0d4f199c03188bb37956e28b2 09-Jul-2009 Stephan Aßmus <superstippi@gmx.de>

Use media_format pixel_width/height_aspect as it was meant to be used. This
avoids rounding issues (1440x1080 -> 1920x1080 instead of 1921x1080).


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


# 1f3691df0fa0861206a72c7b3b9967cea8097692 28-Jun-2009 Stephan Aßmus <superstippi@gmx.de>

* In theory, we should support getting the video aspect from the current stream.
* Added "Force Aspect Ratio" to Video menu and context menu.
* Removed some code duplication in handling the video size messages.
* Added track selection sub-menus to the context menu, replacing the IMHO
not so important interface settings items.


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


# 49ac3f1dbe4b028631301295ba4cae9475e4cc00 23-May-2009 Stephan Aßmus <superstippi@gmx.de>

* Cleanup
* Removed already resolved TODO


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


# c60fcc87e04b0af21ed9f01581b23d1f714a366f 23-May-2009 Stephan Aßmus <superstippi@gmx.de>

* Changed the PlaylistItem interface to be hopefully more flexible. It can
probably still be improved.
* Renamed EntryRefPlaylistItem to just FilePlaylistItem.
* Moved the "move into Trash" and "restore from Trash" implementation into
FilePlaylistItem. Also added what's needed to allow Tracker to restore the
entry itself.
* Refactored everything to make Playlist use PlaylistItems instead of
entry_refs and all that entails...
* The transition to virtualize PlaylistItems is not complete yet in the
Controller, since it still uses BMediaFile there. But it's much easier to
change that now.
* Objects which keep a PlaylistItem around do correct reference counting, but
some commands could be simplified if they were using references as well. It
still should work correctly, though, if I didn't miss anything. It should also
fix theoretical situations of encountering out-of-memory while messing with
the Playlist leading to inconsistent state between Undo/Redo and then leaking
items because of that.
* Added the discussed change that MediaPlayer checks it's own supported types
before rejecting a file by super type. (untested)
* When importing playlist items, the currently playling item is better
maintained during Undo/Redo.
* Some debugging code added in MediaTrackAudioSupplier, no functional changes.
* Fixed a number of coding style issues and automatic whitespace cleanup.



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


# f3f19aa7d711e192225d02ceabf4acf6c1c0783a 29-Apr-2009 Fredrik Modeen <fredrik@modeen.se>

Revert some out commented error tracing code, thanks Jerome for noticed this.
(Got an error when I tried to spell your name correct)

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


# 9327db63a4836bcc1bd1bad60c5d1c79aa54212d 29-Apr-2009 Fredrik Modeen <fredrik@modeen.se>

Adds the option to delete a file from Mediaplayer and move that file to Trash
Works both from main window and PlayList window.
Button that works are B_COMMAND + [delete | d | r] button.
It can be debated what shortcut to use but I needed this function :)
Same goes for the menu i Playlist window. Yell and Ill change :)

What not works are undo and total undo in main window and total undo in Playlist
(total undo = undo files from trash as well as normal undo)

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


# 7060b0a22017f17b586476e54c7b6235367f7a25 12-Oct-2008 Stephan Aßmus <superstippi@gmx.de>

Fix playback of playlists when "auto play files" is off. The playback stopped
after every new file of a playlist.


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


# 82368346f80b5878f94790974f2f76c4b71ca023 21-Sep-2008 Jérôme Duval <korli@users.berlios.de>

fActiveVolume should always be set, and only switch volumes if needed


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


# 4ddc254c08b7f88229ba3741946b0925f3c8f805 26-Aug-2008 Stephan Aßmus <superstippi@gmx.de>

* Implemented decreasing the volume of inactive player windows according to
the global settings. This is only done though if there are multiple players
open at the time. (It doesn't consider their "playing" state, though.)
* The SettingsWindow is now maintained by the MainApp, and there is only a
single instance, those settings are application wide. Also used the
"application floating" window look&feel.
* Small code cleanups.


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


# 9a5f768b197711cd146280af23da99172053c2dc 26-Aug-2008 Stephan Aßmus <superstippi@gmx.de>

* Implemented the "Auto start playback", "Close when done playing movie" and
"Close when done playing sound" settings.
* Removed unused member variables from Controller
* Changed Playlist::SetCurrentRef() to indicate success and prevent the
current index from getting out of range.


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


# 21cc1202f33e850c23bb58e4222ab5836044407a 25-Aug-2008 Rene Gollent <anevilyak@gmail.com>

Fix this bug in the correct spot by forbidding the controller from trying to toggle the playback state if it hasn't been initialized with a file. Thanks for the tip, Stephan!



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


# df5d28d4d914e3d0c7fb67b21900047749d53314 24-Aug-2008 Rene Gollent <anevilyak@gmail.com>

Style cleanup.
When asked to toggle playback, PlaybackManager never checked if it had a previous playback state to copy from. This caused a crash if playback was toggled via the keyboard when no file was loaded. Fixes ticket #2664 .


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


# 725b24098dbc007f20561409748efef86173b15c 23-Aug-2008 Stephan Aßmus <superstippi@gmx.de>

* Fix display update when toggling the scaling mode when the video is paused
without disturbing the same thing during normal playback.


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


# 613ecaf5f9eb4aaf399917fb239979e5256fb274 22-Aug-2008 Stephan Aßmus <superstippi@gmx.de>

* Added the implementation behind the "Use overlays if available" and "Scale
videos smoothly in non-overlay mode" options.
* Disabled the other controls in the SettingsWindow which are not yet
implemented.
* Enable and disable Revert button according to settings state.


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


# 84b6bd9a95710ecff1d658e16078b6c3e57f7782 14-Aug-2008 David McPaul <dlmcpaul@gmail.com>

Correct display of Duration

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


# eb91d0058dead0e6f8dc79cc531907fb31012b6b 14-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

* Whether an audio and/or video node is used is now more explicit. The audio
node can now also be turned off for videos that don't have audio.
* The PlaybackManager currently has the "no audio" support added in a not
quite so nice way, will have to think about something, this is just quick
and dirty to get it going. There is just two places where the audio time
needs to be ignored, because it remains at zero.

-> Especially when using OSS, the seeking latency will be much reduced when
playing videos that have no sound.

* The Controller now maintains the frame it wanted to seek to and does not
forward "position changed" to other listeners as long as the seek frame
has not been reached. This fixes the slider jumping back to the old position
for a bit until jumping back to the seek frame. It also fixes another
problem when switching to the next file. Because the total duration is
already adopted while the old clip is still playing within the seek latency,
the current position jumped to the new relative position, while it is
still refering to the position within the old clip. So both seeking and
switching clips looks much smoother now.


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


# e6ac2ec43e8d5c0215f33734b2bfbb1e69c138c8 05-Jul-2008 Stephan Aßmus <superstippi@gmx.de>

* The window would not reset the audio/video track to 0 on a new file if
the Controller would keep the last audio/video track index across files
(which would be nice for certain situations).
* Better error message for unsupported files, especially for the
B_MEDIA_NO_HANDLER error.
* In the Controller, try to obtain the track duration and ignore tracks that
return a bogus duration. I have some MP3 files on ZETA that are obviously
not handled correctly by the ZETA mp3 decoder. Previously, the player would
just sit there and appeared to have some other internal error.


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


# 585d5a26d395df802b7b451bd2376e4c5f2f4182 26-Jun-2008 Stephan Aßmus <superstippi@gmx.de>

Removed a no longer used method.


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


# 50450a005341abdb44662e9c7368227f75ea3914 21-Jun-2008 Stephan Aßmus <superstippi@gmx.de>

Implemented an AudioReader subclass "AudioVolumeConverter" which applies
a volume to the audio data. It ramps between a previous and the current volume
if necessary to smooth out the changes. The volume slider functionality is
thereby restored.


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


# 64c4d8f6065829193ec0f52d35d2a317cbfae267 02-Jun-2008 Stephan Aßmus <superstippi@gmx.de>

I tracked down a problem with a specific clip I have here.
In the end, the problem was that no codec was installed
for it, but I fixed a bunch of issues on the way to find
out. Now the controller will not rely on the number
of audio and video tracks, but on the fact that it could
instantiate suppliers at all. Made the MediaTrackVideoSupplier
return an init error. Should be replicated for the
MediaTrackAudioSupplier.


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


# 4fd26cd542fbc74c81a5f8196c4f188f92a585a2 31-May-2008 Stephan Aßmus <superstippi@gmx.de>

Reuse existing nodes if the media formats do not change. This fixes the
regression that audio playback of multiple files was not "seamless" anymore.
Even video playback should be seamless, the remaining small glitch could be
a problem with buffer timeout if the switch takes too long.


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


# d7f2503a082c6e32142bca8f396eee002b2ec851 31-May-2008 Stephan Aßmus <superstippi@gmx.de>

* Support codecs that don't support B_YCbCrXXX color spaces.
* Leave the codec a chance to advertise the best output color space,
try B_YCbCr422 as the most widely supported format in case the codec
does not advertise.
* Support two more overlay colorspace modes in the video consumer.


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


# 0fc56ed57bdd5d2d44f33edd17d94210704613bd 30-May-2008 Stephan Aßmus <superstippi@gmx.de>

* Moved a bunch of non-primary interface classes into a new subfolder
"interface"

* Complete reimplementation of the playback engine using Media Nodes:
- Seeking video files does not appear to lockup the playback anymore, but
works on a frame accurate level even for keyframe based streams. There is
currently a problem with certain container formats, the audio track reports
a "Device Seek Error" in certain conditions. In that case audio goes silent,
and can be restarted by going back to the beginnings of the stream.
- Video overlays are now supported.
- It would be possible to connect the output of the MediaPlayer to other
applications or dormant media nodes.

* Known regressions:
- The volume slider has currently no effect anymore.
- Switching the audio track during playback has a known race condition and
can crash the player.
- The new engine is not as "light weight" as the old one. I tagged the
previous implementation in tags/components/mediaplayer-engine-v1. It does
not seem to have any noticable effect though.



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


# a29a9e05fb4bb14d9cfcc4e15e8773055e0164a6 27-Jan-2008 Stephan Aßmus <superstippi@gmx.de>

I think this change fixed some trouble I had with MediaPlayer on a system
with an unsupported sound card or the like, the fSoundOutput initialization
is checked in more places.


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


# a637e3c53c976ebe3d2c7d1fe8792a1eaf1aae3e 22-Oct-2007 Stephan Aßmus <superstippi@gmx.de>

patch by Fredrik Modéen:
* add filtering of files by mimetype when adding them to the playlist
* some changes by myself (added Axel's suggestion to guess the mimetype
in order to support other filesystems than BFS)
Fredrik -> please have a look at our coding guidelines, also you have weird
whitespaces in your patches... :-)


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


# 540fe7aef9f5fea126dbfb0be82b534744eea29c 17-Oct-2007 Stephan Aßmus <superstippi@gmx.de>

patch by Fredrik Modéen with changes by myself
* toggle the "marked" state of the settings menu items correctly
* implement muting/unmuting the volume
* implement volume up/down triggered by keyboard events
* forward the skip next/previous events to the controller
(various kinds of keyboard navigation or mouse wheel)
* establish the notification link for volume and muted changes


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


# be5f5c2d14ffa6836f8e7ee3c26b17a4ffa254c4 23-Jun-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

ck a dull boy All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull
boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a
dull boy. All work and no play makes Jack a


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


# 84371c144642c40c91d15f245b3e4d24db70e49b 17-Jun-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

revert the part of the previous checkin that completely broke video seeking (however, the current state is hardly working at all)


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


# 56853d6ff1450026338a591b30a85f1c9805520a 17-Jun-2007 Marcus Overhagen <marcusoverhagen@gmail.com>

Use separate waiting semaphores for audio and video, later to be used for seeking


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


# 2a72b9fead28a8cb1cad04c7a8bb023adb41bea0 05-Jun-2007 Stephan Aßmus <superstippi@gmx.de>

* re-enabled the InfoWin


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


# 09464bc90b61f0c038cd92e3894921c64caedf9a 03-Jun-2007 Stephan Aßmus <superstippi@gmx.de>

* extraced PlaylistListView into it's own files
* lots of changes, besically these make the Playlist window usable
- drag sorting works (hold shift to copy instead of move items)
- removing items with the delete key works
- dragging files/folders from Tracker works (hold shift to insert
them in the existing playlist, othewise the new files replace
the playlist)
* some refactoring and bug fixes in previously unused functionality
* Playlist can now be locked (needed to be), and is in ControllerView,
MainWin and PlaylistListView


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


# 8c113568ce9f64e6c4cdf31bc1ba4e55f1ab221d 30-May-2007 Stephan Aßmus <superstippi@gmx.de>

* fixed GCC 4 build, thanks Fredrik Ekdahl


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


# 5fa5e5fea7e2752ce0f9eb514b82f7c34ea308e6 29-May-2007 Stephan Aßmus <superstippi@gmx.de>

* added notification support to Playlist and Controller
* added AbstractLOAdapter by Ingo Weinhold which makes
notifications asynchronous
* removed "Player" interface/concept, replaced it by
the notification mechanism (window loads new file
when "current" ref index changes in Playlist)
* removed some cross classes dependencies
* the wind buttons are not displayed anymore for now
* lots of changes to the Controller
- the decoder/player threads are kept running for the
entire lifetime of the Controller object (in essence, makes
it possible to playback seamless)
- abstracted BMediaTrack usage into "Video-" and "AudioSupplier"
objects (the BMediaTrack pointers are only still there, because
I have not gotten around to fix the messy/hacky InfoWindow)
- reaching the end of the stream will trigger a notification,
so that the next file from the playlist is played
- fSoundOutput is managed by the Controller
- tried to make seeking seem more controlled (slider doesn't
jump back to previous position)
- playback position is correctly updated in GUI
- volume is maintained independend of SoundOutput so
that it can be transfered from one to the next output
- performance time is maintained correctly (?) even if
no audio stream is present
* work in progress Playlist window (drag sorting does not work yet!)
* rearranged menus a bit
* rearranged overlay code in the VideoView, but it cannot work
like it is currently designed, since the buffers need to be
switched all at once, which the video decoding thread
is not doing yet
* dragging files into the main window with shift held down
appends to the existing playlist
* dropping folders adds files recursively
* pressing space toggles playback (instead of changing some
settings of the GUI)
* fixed some more minor issues or unimplemented stuff in the UI


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


# 7933c6db2c782224720061b57d198a44b6db5e09 10-Sep-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

cleanup


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


# 956881506ff1c9f6d253d78334181ca159ed9d73 12-Jul-2006 Jérôme Duval <korli@users.berlios.de>

fix some warnings


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


# bb15b0769badd34cfe844cf9d80b27dc4fe15d82 22-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

increased thread priorities


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


# 453f642e2e5277aa60c17863fc25f38e23309aa8 22-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

Rewrote audio decoding to provide timing information
that is used to sync with video.
Separated audio decoding and playing into two threads,
the same applies to video decoding and playback.
This was inspired from code written by Stephan.
Added video decoding and display, added play/pause/stop.


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


# d38c8112a7fa3440f32d689cfc65c573ad399bb8 16-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

cache the track duration


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


# 0f0bbc97511c62bb5537fa10a2815b7f1a4dd566 08-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

implemented seeking and position update


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


# 131d97be807a1a3bd43c15d67ac6cef11f0b6398 08-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

Connected volume control GUI with Controller class, and made slider non-linear.
This should be reviewed, and a better algorith should be selected.


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


# 2fd148f926bb722b3ccb13db39b31d1f85c360ac 07-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

dont crash when opening another file


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


# 3e070a9ee4f34e23cb07c19fef5458382bf7fcfc 07-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

added a crude hack to play sound


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


# 0e49470a24d0136e80b367891f0485c80d76bb7e 07-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

added starting/stopping of playback threads


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


# 0aaf5eb1ae99f9b0b78aa678191fde335f1fbc4e 07-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

added a sound output class to push data to the mixer, also started audio and video play threads


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


# bcc46b4b9297b1a774f5b1333bbe9932d6df852b 06-May-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

implemented opening media files for real


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


# aadc5f572d7fa4e6d96e090ccb8087ddba45c27a 24-Apr-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

added playlist support


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


# e1d8d7d6b48c655bab349c1fde5200fed917289e 23-Apr-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

implemented some file handling related functionality


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


# 04a91b97bde1b41f4100b923a1699ddeac36635b 05-Apr-2006 Marcus Overhagen <marcusoverhagen@gmail.com>

Imported source code from DVB TV application


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