[haiku-development] Re: BMediaTrack->ReadChunk() query

  • From: Dario Casalinuovo <b.vitruvio@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 11 Oct 2019 18:13:39 +0200

On Fri, Oct 11, 2019 at 3:24 PM Zenja Solaja <solaja@xxxxxxxxx> wrote:

Thanks Dario.  Yes, the fallback path of using ffmpeg for decoding is also
on my mind.  Until I encountered the encoding phase of my project, using
the existing BMediaTrack->ReadFrames() code in the past has proven itself
to be quite decent and robust for my seeking/displaying/editing purposes.
It would be a shame to ditch this working code simply because I dont have
access to a non-colour conversion code path.  It's just a question of
skipping the swscaler code in the Decode() function of the ffmpeg plugin,
something an additional API argument could provide.


This is where I think the code forces B_RGB32:

https://github.com/haiku/haiku/blob/master/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp#L481


You did prompt me into investigating creating a clone ffmpeg media kit
addon, which skips the swscaler code path.  ffmpeg_noswscaler addon
possibly?  That is an option if we cannot extend the media kit API for R1.


There's no need eventually to clone the whole ffmpeg plugin, but just
subclass MediaDecoder (the private one) to decode it the proper way.
However, before that I'm quite sure you can find a way to make it work by
modifying the implementation (look above).

Saluti,
Dario

Other related posts: