History log of /haiku/src/add-ons/media/plugins/raw_decoder/RawDecoderPlugin.cpp
Revision Date Author Comments
# 8f349677 21-Feb-2024 Augustin Cavalier <waddlesplash@gmail.com>

raw_decoder: Pass errors back up the chain.

This way B_LAST_BUFFER_ERROR will actually be reported properly.


# 425ac1b6 20-Jun-2023 Alexander von Gluck IV <kallisti5@unixzen.com>

refactor: Swap %Ld for %lld in all format usages

* %Ld is an undocumented alias for %lld in glibc.
* muslc doesn't implement it for this reason.
* While we will likely never drop %Ld support,
lets clean house and set a better example.

Change-Id: Id46dad3104abae483e80cc5c05d1464d3ecd8030
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6636
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# a4436289 21-Dec-2022 PulkoMandy <pulkomandy@pulkomandy.tk>

media plugins: replace strcpy with strlcpy

Fixes a memory corruption: the ffmpeg plugin has a LOT of file
extensions, which goes way past the 8 allowed characters and even past
the 88 reserved bytes at the end of the structure. As a result, memory
after the structure is overwritten, resulting in heap corruption and
crashes.

This is immediately detected by using the guarded heap.

As a short term measure, use strlcpy to avoid overwriting memory, but
now the ffmpeg plugin will be unable to provide any useful info. It
would make sense to make media_format_info store a pointer to a string
instead (similar to entry_ref), but this requires more changes and will
create some incompatibility with existing apps if they use the field.

Change-Id: I8d2b567a179e9f7816b72f48aedac4e8534bc044


# 98193d26 26-Sep-2021 Franck LeCodeur <cassisian@gmail.com>

raw_decoder: Fix warnings and enable Werror

Done as part of #9460

Warnings related to comparison of integer expressions of different signedness

Change-Id: If5543db951b11aab1858a18a057b7d2e08ee2b42
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4503
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 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


# a57cf128 01-Dec-2018 Barrett17 <b.vitruvio@gmail.com>

Codec Kit: Introduce declarative macro with version and name

* Namespaces protect symbols, I didn't consider that when adding
the BCodecKit namespace, so, the AddOnManager complained that
instantiate_plugin() was missing. A macro is introduced that allow
plugins to specify it's className, version and name, this ease
the declaration of the plugin symbols, otherwise the function
should have been declared inside the BCodecKit namespace which
we would like to avoid.
* The code is also more future proof, since in future the AddOn manager
can begin to check for plugin versions.


# 9a49da9d 25-Nov-2018 Barrett17 <b.vitruvio@gmail.com>

Fix raw_decoder build


# ec45f6ad 25-Nov-2018 Barrett17 <b.vitruvio@gmail.com>

Codec Kit: Move plugins to new class names


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

Finall changed the Seek() method of Decoder plug-ins to
SeekedTo(), since it's only informative to decoders. They
can't modify the seeked frame/time. This also mirrors what
all existing decoders were doing in Seek(). BMediaTrack
is simplified accordingly (resolved two TODOs).


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


# f1ee5448 11-Jan-2009 David McPaul <dlmcpaul@gmail.com>

Implement seeking support

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


# fe057024 13-Oct-2008 David McPaul <dlmcpaul@gmail.com>

Don't change the buffer size assigned by the reader

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


# 34faa5f2 05-Aug-2008 Maurice Kalinowski <mauricek@nowhere.fake>

* In case we do not have any frames to convert we'll need to break,
otherwise we end up in an endless loop. This only happened when
the remaining raw data provided did not contain enough content.
In this particular case there were only 2 bytes remaining though
the decoder needed 4 bytes to handle at least 1 frame. Seems like
the audio file only provided data for one channel in the end, which
did not lead to a B_LAST_BUFFER_ERROR yet as it has been read properly.
* This fixes bug 1708 and most probably 1275 as well (someone check and
close please)

Didn't we just have a discussion about Media handling killing the system
:P

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


# 2b273dbc 05-Aug-2008 Maurice Kalinowski <mauricek@nowhere.fake>

whitespace cleanup

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


# a7871de2 25-Dec-2004 beveloper <beveloper@nowhere.fake>

Flushing local repository changes to server. Mostly new copyright headers.


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


# 6736ae52 23-Oct-2004 beveloper <beveloper@nowhere.fake>

This fixes the bugs that crashed nplay and ColdCut during the Begeistert 13 presentation


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


# 63dd01d5 29-Feb-2004 beveloper <beveloper@nowhere.fake>

added saturation to float conversion


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


# fa8dbc01 01-Feb-2004 shatty <shatty@nowhere.fake>

new MediaFormats. node monitoring codec plugin loading. codec mods to support new codec api to retrieve supported formats.


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


# 6e04e144 30-Jan-2004 beveloper <beveloper@nowhere.fake>

minor api changes


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


# 40d68dd2 24-Jan-2004 beveloper <beveloper@nowhere.fake>

removed codec registration bug, raw formats working again


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


# 16611de7 23-Jan-2004 beveloper <beveloper@nowhere.fake>

spelling fix


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


# a0a20160 23-Jan-2004 Axel Dörfler <axeld@pinc-software.de>

Updated all decoders to the changed codec API (from meta_descriptions to
BMediaFormats based detection).


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


# 54348708 15-Jan-2004 beveloper <beveloper@nowhere.fake>

suggest buffer size of 50 ms


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


# bb1d6ef2 27-Dec-2003 beveloper <beveloper@nowhere.fake>

raw decoder supports many samples types now, and support for them
has been added to the file readers, you can now play 24 bit integer
or 64 bit floating point files


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


# 2d923d67 07-Dec-2003 beveloper <beveloper@nowhere.fake>

fixed playback of small files by properly returning errors


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


# a3d7908e 07-Dec-2003 beveloper <beveloper@nowhere.fake>

improved wav reader


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


# 4ba72fcd 07-Dec-2003 beveloper <beveloper@nowhere.fake>

fixed some bugs in raw wav reading


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


# da87cefe 28-Nov-2003 beveloper <beveloper@nowhere.fake>

added the new media_meta_description and changed codec API to use it


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


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

another round of codec API changes


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


# ca16f5cb 17-Oct-2003 beveloper <beveloper@nowhere.fake>

start of media kit codec plugin API


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


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

Finall changed the Seek() method of Decoder plug-ins to
SeekedTo(), since it's only informative to decoders. They
can't modify the seeked frame/time. This also mirrors what
all existing decoders were doing in Seek(). BMediaTrack
is simplified accordingly (resolved two TODOs).


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


# f1ee5448a92535bbfbd6f473df8427714bbb2e5d 11-Jan-2009 David McPaul <dlmcpaul@gmail.com>

Implement seeking support

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


# fe0570240ca77b0538554cbd8ec80991bb8356ba 13-Oct-2008 David McPaul <dlmcpaul@gmail.com>

Don't change the buffer size assigned by the reader

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


# 34faa5f214f7db2b4a9dc9b36bcba7c0e789df46 05-Aug-2008 Maurice Kalinowski <mauricek@nowhere.fake>

* In case we do not have any frames to convert we'll need to break,
otherwise we end up in an endless loop. This only happened when
the remaining raw data provided did not contain enough content.
In this particular case there were only 2 bytes remaining though
the decoder needed 4 bytes to handle at least 1 frame. Seems like
the audio file only provided data for one channel in the end, which
did not lead to a B_LAST_BUFFER_ERROR yet as it has been read properly.
* This fixes bug 1708 and most probably 1275 as well (someone check and
close please)

Didn't we just have a discussion about Media handling killing the system
:P

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


# 2b273dbc5dde8be5db7a0ab7d5f8ce6d82e09626 05-Aug-2008 Maurice Kalinowski <mauricek@nowhere.fake>

whitespace cleanup

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


# a7871de2865df2fb1e5b299a91c0711545fa7d48 25-Dec-2004 beveloper <beveloper@nowhere.fake>

Flushing local repository changes to server. Mostly new copyright headers.


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


# 6736ae524a343f42152863f0a64d05874d2f97f4 23-Oct-2004 beveloper <beveloper@nowhere.fake>

This fixes the bugs that crashed nplay and ColdCut during the Begeistert 13 presentation


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


# 63dd01d5f2c2db804ede05fc1fe6600f4f7399c8 29-Feb-2004 beveloper <beveloper@nowhere.fake>

added saturation to float conversion


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


# fa8dbc019dd3bd72a121c30ff5838f71f5185a7b 01-Feb-2004 shatty <shatty@nowhere.fake>

new MediaFormats. node monitoring codec plugin loading. codec mods to support new codec api to retrieve supported formats.


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


# 6e04e144d606e6ecc2f8216f04533683ee78849f 30-Jan-2004 beveloper <beveloper@nowhere.fake>

minor api changes


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


# 40d68dd2197fb860d2f9307f8381a3181c636077 24-Jan-2004 beveloper <beveloper@nowhere.fake>

removed codec registration bug, raw formats working again


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


# 16611de7ce5071ebff85834355afb44ef69b76dd 23-Jan-2004 beveloper <beveloper@nowhere.fake>

spelling fix


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


# a0a20160cd91e5eb9d6f4bd30418d22c3c3aa59d 23-Jan-2004 Axel Dörfler <axeld@pinc-software.de>

Updated all decoders to the changed codec API (from meta_descriptions to
BMediaFormats based detection).


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


# 54348708ae85493f25087ea4ebc95ee53dec8c4a 15-Jan-2004 beveloper <beveloper@nowhere.fake>

suggest buffer size of 50 ms


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


# bb1d6ef24727b9ee47843143658cd807f290e90c 27-Dec-2003 beveloper <beveloper@nowhere.fake>

raw decoder supports many samples types now, and support for them
has been added to the file readers, you can now play 24 bit integer
or 64 bit floating point files


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


# 2d923d67f0efa29141b3d86619741f93b932c151 07-Dec-2003 beveloper <beveloper@nowhere.fake>

fixed playback of small files by properly returning errors


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


# a3d7908e2685e07258d20df35fb72f0fa9f63ced 07-Dec-2003 beveloper <beveloper@nowhere.fake>

improved wav reader


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


# 4ba72fcdb402b8824ce1c64d1583371f50dd50ce 07-Dec-2003 beveloper <beveloper@nowhere.fake>

fixed some bugs in raw wav reading


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


# da87cefeb10b3b0c5214090e6c6dedb02d24a798 28-Nov-2003 beveloper <beveloper@nowhere.fake>

added the new media_meta_description and changed codec API to use it


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


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

another round of codec API changes


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


# ca16f5cb038771bbe355c20cf55fb2f56138a402 17-Oct-2003 beveloper <beveloper@nowhere.fake>

start of media kit codec plugin API


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