History log of /haiku/headers/private/media/MediaExtractor.h
Revision Date Author Comments
# 6b49a15b 03-Jan-2021 Alexander von Gluck IV <kallisti5@unixzen.com>

media_kit: Dynamic allocation of ChunkCache based on media

* The "default" of 3MiB wasn't enough for modern larger media
formats, resulting in inability to play 4k video no matter
how much horse power you threw at Haiku. (4k is ~8MiB)
* This dynamically calculates the ChunkCache based on the
video framesize * 2.
* 4k video now plays smoothly on my Ryzen 1800x.

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


# 727e49c6 12-Jul-2019 Adrien Destugues <pulkomandy@pulkomandy.tk>

Media Kit: remove MediaExtractor::Source

The idea was that the Media Extractor could wrap the original source
given by BMediaTrack, but all operations on the data go through
MediaExtractor anyway.
We could probably move ownership of the BDataIO completely into
MediaExtractor instead.

Change-Id: I846b34b543fb983e60f6adf86cb17e835303267b
Reviewed-on: https://review.haiku-os.org/c/1587
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>


# 218a8c03 17-May-2019 Augustin Cavalier <waddlesplash@gmail.com>

Revert the Codec Kit.

All of Barrett's individual reverts have been squashed into this
one commit, save a few actual bugfixes.

Change-Id: Ib0a7d0a841d3ac40b1fca7372c58b7f9229bd1f0


# dbad909b 24-Jul-2017 Jérôme Duval <jerome.duval@gmail.com>

BMediaFile: fix MediaExtractor crash.

* stop the extractor processing before deleting the source.
* crash happened in MediaPlayer FilePlaylistItem::_CalculateDuration().
* was a regression introduced in hrev50671.
* fixes #13156.


# 9198105d 04-May-2017 Dario Casalinuovo <b.vitruvio@gmail.com>

MediaWriter/MediaExtractor: Remove BUrl constructors


# 4dd09daf 24-Jun-2016 Dario Casalinuovo <b.vitruvio@gmail.com>

Streaming: Use const reference in place of copying

* Thanks to Markus for reporting.


# 0ba82236 24-Jun-2016 Dario Casalinuovo <b.vitruvio@gmail.com>

Streaming: Remove any pointer BUrl argument

* There's no need to pass BUrl by pointer, this is
potentially dangerous and leaky without any advantage,
copying is definitely safer.


# a2b3f126 25-Mar-2016 Dario Casalinuovo <b.vitruvio@gmail.com>

MediaExtractor: Adapt to new BUrl functionality


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

Implemented an API to get arbitrary meta-data about
BMediaFiles and about BMediaTracks in BMessages. As an
example, one can get chapter meta-data or the language
name of an audio-track.


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


# 0b6ac0b7 12-Jan-2010 Stephan Aßmus <superstippi@gmx.de>

* White space cleanup
* Added myself to copyrights, since I added some stuff to MediaExtractor.


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


# 4d89dfc7 25-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Completely rewrote the ChunkCache - the previous version had some issues with
regards to locking and seeking.
* Furthermore, we now not only cache 4 chunks, but chunk up to a certain
memory size (MediaExtractor uses 1 MB for now).
* Since I still have occasional hickups, it looks like this wasn't the main
cause for our audio problems. Still, this will reduce drive access
considerably during play.


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


# 608d959d 25-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* ChunkCache::fLocker is now aggregated.
* Cleanup.


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


# 8b1e3b1a 07-May-2008 Maurice Kalinowski <mauricek@nowhere.fake>

- Implemented MediaExtractor::Copyright, which just calls the instantiated reader
- Implemented BMediaFile::Copyright, which just calls Copyright() of the extractor. So this is just a simple pass through.
- Style cleanup (mostly whitespaces)

Problem is that our readers currently return the copyright of the source code, not the copyright of the MediaFile itself, like the BeBook documents. Thus, we might need to change all readers to return appropiate data or behave differently for Haiku readers.



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


# d830aa92 20-Mar-2008 Stephan Aßmus <superstippi@gmx.de>

* Added FindKeyFrame() method to MediaExtractor, it is similar to Seek(),
but operates "read-only".
* Added FindKeyFrame() method to ReaderPlugin, see above.
* Reformated ReaderPlugin header. Added const qualifier to Source() method.
* Small cleanups in BMediaTrack::SeekToTime() and SeekToFrame(). Added TODOs
with regards to "seeking" in decoders, wich should IMHO be revised. (Codecs
cannot seek in the stream, they only get fed chunk data. The only thing they
can do is reset themselves in preparation for a discontinuity of the chunk
data...)
* Implemented BMediaTrack::FindKeyframeByXX() methods via the new
MediaExtractor::FindKeyFrame() method.
* Implemented Seek() and FindKeyFrame() methods in the Reader base class,
returning B_NOT_SUPPORTED. I think this makes sense and also I don't have
to adapt all existing Reader plugins for the new FindKeyFrame() call. :-)
* Implemeneted FindKeyFrame() in the avi_reader. The OpenDMLFile class
gets Seek() extended for a "read-only" mode. Currently the implementation
is broken (as before) with regards to keyframes. These were ignored before
and I have not changed them to actually support the seek flags with regards
to keyframes. That's the interesting TODO...
* Some reformatting here and there in avi_reader code, sorry for the mixup.
The only actual change is the support for the read-only flag to Seek().


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


# 0d1adad3 29-Jun-2005 Marcus Overhagen <marcusoverhagen@gmail.com>

Media Codec API just got a visit from the coding style police.
We now use "const" for the chunk buffer pointer returned by GetNextChunk,
because the buffer is not supposed to be modified by the codec.
size_t is used for the size where applicable. This matches BMediaDecoder.



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


# 1a1da948 20-Nov-2004 beveloper <beveloper@nowhere.fake>

removed ChunkCache.h from shared private include files


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


# d0da9020 24-Oct-2004 beveloper <beveloper@nowhere.fake>

Added an extra thread for chunk extraction. Using the ChunkCache,
the ReadFrames call no longer needs to wait for the
extractor, but can read it from a cache.


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


# 1e88e662 29-Feb-2004 beveloper <beveloper@nowhere.fake>

updated to match source file


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


# 25305239 06-Dec-2003 beveloper <beveloper@nowhere.fake>

codec output format negotiation has been moved into NegotiateOutputFormat,
Setup is now only called once


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


# 7a115dc7 23-Nov-2003 beveloper <beveloper@nowhere.fake>

integrating codec API, added some MediaExtractor functionality


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


# d8591482 23-Nov-2003 beveloper <beveloper@nowhere.fake>

integration of codec API into BMediaFile and BMediaTrack


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


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

Implemented an API to get arbitrary meta-data about
BMediaFiles and about BMediaTracks in BMessages. As an
example, one can get chapter meta-data or the language
name of an audio-track.


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


# 0b6ac0b7a80b1b129a3918fcb55e6cc5079285a3 12-Jan-2010 Stephan Aßmus <superstippi@gmx.de>

* White space cleanup
* Added myself to copyrights, since I added some stuff to MediaExtractor.


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


# 4d89dfc7120e69ad02437f4e29e21e46adc2ac98 25-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Completely rewrote the ChunkCache - the previous version had some issues with
regards to locking and seeking.
* Furthermore, we now not only cache 4 chunks, but chunk up to a certain
memory size (MediaExtractor uses 1 MB for now).
* Since I still have occasional hickups, it looks like this wasn't the main
cause for our audio problems. Still, this will reduce drive access
considerably during play.


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


# 608d959d73310517f846311cf8493f1206e9ef1c 25-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* ChunkCache::fLocker is now aggregated.
* Cleanup.


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


# 8b1e3b1af881f935640c1f4b78f8a0c158168754 07-May-2008 Maurice Kalinowski <mauricek@nowhere.fake>

- Implemented MediaExtractor::Copyright, which just calls the instantiated reader
- Implemented BMediaFile::Copyright, which just calls Copyright() of the extractor. So this is just a simple pass through.
- Style cleanup (mostly whitespaces)

Problem is that our readers currently return the copyright of the source code, not the copyright of the MediaFile itself, like the BeBook documents. Thus, we might need to change all readers to return appropiate data or behave differently for Haiku readers.



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


# d830aa92ce5e5063357b44483277e931f0276307 20-Mar-2008 Stephan Aßmus <superstippi@gmx.de>

* Added FindKeyFrame() method to MediaExtractor, it is similar to Seek(),
but operates "read-only".
* Added FindKeyFrame() method to ReaderPlugin, see above.
* Reformated ReaderPlugin header. Added const qualifier to Source() method.
* Small cleanups in BMediaTrack::SeekToTime() and SeekToFrame(). Added TODOs
with regards to "seeking" in decoders, wich should IMHO be revised. (Codecs
cannot seek in the stream, they only get fed chunk data. The only thing they
can do is reset themselves in preparation for a discontinuity of the chunk
data...)
* Implemented BMediaTrack::FindKeyframeByXX() methods via the new
MediaExtractor::FindKeyFrame() method.
* Implemented Seek() and FindKeyFrame() methods in the Reader base class,
returning B_NOT_SUPPORTED. I think this makes sense and also I don't have
to adapt all existing Reader plugins for the new FindKeyFrame() call. :-)
* Implemeneted FindKeyFrame() in the avi_reader. The OpenDMLFile class
gets Seek() extended for a "read-only" mode. Currently the implementation
is broken (as before) with regards to keyframes. These were ignored before
and I have not changed them to actually support the seek flags with regards
to keyframes. That's the interesting TODO...
* Some reformatting here and there in avi_reader code, sorry for the mixup.
The only actual change is the support for the read-only flag to Seek().


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


# 0d1adad317d12e39380ee4876ca4b36fd7814901 29-Jun-2005 Marcus Overhagen <marcusoverhagen@gmail.com>

Media Codec API just got a visit from the coding style police.
We now use "const" for the chunk buffer pointer returned by GetNextChunk,
because the buffer is not supposed to be modified by the codec.
size_t is used for the size where applicable. This matches BMediaDecoder.



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


# 1a1da94839b8b9c7150e5a43c4bd1ab4d6278a1b 20-Nov-2004 beveloper <beveloper@nowhere.fake>

removed ChunkCache.h from shared private include files


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


# d0da9020019a4349d0b40c8280997d166a60a0a5 24-Oct-2004 beveloper <beveloper@nowhere.fake>

Added an extra thread for chunk extraction. Using the ChunkCache,
the ReadFrames call no longer needs to wait for the
extractor, but can read it from a cache.


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


# 1e88e6620d91d16ea53f94287aeeb26f33732f90 29-Feb-2004 beveloper <beveloper@nowhere.fake>

updated to match source file


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


# 2530523976c41f4c5219b00cd5a328b84ce6d38d 06-Dec-2003 beveloper <beveloper@nowhere.fake>

codec output format negotiation has been moved into NegotiateOutputFormat,
Setup is now only called once


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


# 7a115dc75d33962f3c66fa5d49c163b82873ccae 23-Nov-2003 beveloper <beveloper@nowhere.fake>

integrating codec API, added some MediaExtractor functionality


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


# d859148201db6e851ba0a8ed96b12af21fbf06c0 23-Nov-2003 beveloper <beveloper@nowhere.fake>

integration of codec API into BMediaFile and BMediaTrack


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