Primer in media kit addons

hello,
I was wondering if anyone knew of a ggod reference doc or addon with source that could help me create a new media decoder. I’ve read through the bebook and need a little more meat on the bone to get started. Any help would be… well… helpful.

thanks

Why don’t you have a look in Haiku’s source code? :wink:

The BeBook doesn’t cover the media decoder API, as it was never public

Because of that, Haiku’s media decoder API is different. Take a look at the source code - theres a number of demuxers and deocders there.

But isn’t haikus media kit api different from the original?

I’m trying to get aac running on Be using the R5 media kit. I downloaded and compiled faad2 as a .a library file and was wanting to make a media kit add-on to wrap it. I looked at the source code to the mp3 decoder from haiku, but a mailing list message made it sound as if the api was different. What would I need to change in order to use the mp3 decoder as a guide?

inseculous wrote:
But isn't haikus media kit api different from the original?

I’m trying to get aac running on Be using the R5 media kit. I downloaded and compiled faad2 as a .a library file and was wanting to make a media kit add-on to wrap it. I looked at the source code to the mp3 decoder from haiku, but a mailing list message made it sound as if the api was different. What would I need to change in order to use the mp3 decoder as a guide?

You can’t. The R5 media kit headers are not publicly available. Hence you’d have to ask Be for them, and thats not really possible now, is it?

Other than that they’re probably around somewhere. Possibly checked in with the source of one of the opensource decoders for BeOS like the ffmpeg ones, the vorbis ones or the MPEG one.

So to create a decoder I need to switch to the haiku media kit? I tried that a few weeks ago. It wouldn’t let me play any videos, and there was some strange behavior with the balancing on my card.

That’s neither here nor there though. What is the BMediaDecoder header file in /boot/develop/headers/be/mediakit for then? I assumed you would make a decendant of this class to create one.

I looked through the cvs’s you mentioned but I didn’t see any Be code. Both (vorbis-tools and ffmpeg) don’t share their source through bebits either. I’ll take a closer look at these two when I get more time.

Thank you for the info. Last thing. In the haiku media kit is the mp3decoder a good “template” to follow?

thanks

inseculous wrote:
So to create a decoder I need to switch to the haiku media kit? I tried that a few weeks ago. It wouldn't let me play any videos, and there was some strange behavior with the balancing on my card.

Odd. Did you follow the instructions on the BeBits WIKI? They’re pretty accurate, and should give you working video for at least a few files

Quote:
That's neither here nor there though. What is the BMediaDecoder header file in /boot/develop/headers/be/mediakit for then? I assumed you would make a decendant of this class to create one.

I believe thats for applications to use to decode video/audio. Its BMediaDecoderAddOn for a decoder, I think

Quote:
I looked through the cvs's you mentioned but I didn't see any Be code. Both (vorbis-tools and ffmpeg) don't share their source through bebits either. I'll take a closer look at these two when I get more time.

Sorry, I thought the Vorbis tools had the headers. Didn’t check.

Quote:
Thank you for the info. Last thing. In the haiku media kit is the mp3decoder a good "template" to follow?

thanks

Yes, although the AC3 one might be closer to AAC. Don’t know.

Maybe take the route some others have taken and make it a plugin for SoundPlay and Cl-amp? At least the API is known for them.

The only person I know who knows the R5 API is David McPaul (guy who made the 3ivX decoder). He’s on the media kit mailing list (www.freelists.org/archives/openbeosmediakit i think - but he probably won’t be able to give it to you.

Simon

tb100 wrote:
Maybe take the route some others have taken and make it a plugin for SoundPlay and Cl-amp? At least the API is known for them.

The only person I know who knows the R5 API is David McPaul (guy who made the 3ivX decoder). He’s on the media kit mailing list (openbeosmediakit Mailing List Archive i think - but he probably won’t be able to give it to you.

Simon

Francois Revol, David Burnett and Carlos Hasan also definately have the media kit headers. The API is useless without them even if someone knows it.

tb100,
The idea of writting a plugin for one of those players defeats the purpose of the media kit. I like to think of myself as a purest, though that doesn’t always work. :smiley: I’ve always felt these programs that do an end-run around the beos addon system were somehow cheating. This is a personal view and not an inditement . :wink: I feel Be did a good job with the module addon system throughout the system and it seems wrong to reinvent the wheel.

I know the developers do a lot of good work and they have helped keep beos afloat, but it’s becoming more and more an excuse to “port it” or just use so and so (vlc), instead of investing time into the base. I don’t want to get on an rant, so I’ll leave it there.

MYOB,
Thanks for the info, but I feel that developing it for the new kit would be a better use of time.

I agree completely that wrinting an add on for the media kit is the best idea, so every media player will suppport the format. However, given that Be didn’t give out the API or the headers and that it will hard to get hold of them, I suggested writing plugins for the 2 most popular sound players as a way to at least get the format supported.

Obviously for Haiku the decoder can be incorporated directly into the media kit.

Simon

tb100 wrote:
Obviously for Haiku the decoder can be incorporated directly into the media kit.

Well thats what he said he’d do

AC3 uses its own container, right? You’ll need to write a demuxer for it as well… No headers for R5 for it either.

well I don’t want to drop this back to square one, but I’m gonna anyway :wink:

Has anyone concidered asking Palm for the headers? I mean if it’s done nicely and correctly they just might let us have them. They are only headers, we would still need to write the code.
Plus, now that we are a legit nonprofit they might look at it with a little more interest. Who knows they could donate the source as a tax write off (he says in his dreams :lol: )

Like I said in my last post I’ll try to do one for the new kit, but I’ve had troubles with it (the kit that is) and don’t know if my frustrations will allow anything usable to surface :? Plus by the time I finish it someone else will more then likely have one *10 better then what I get, it always happens :lol:

that being said is there going to be a problem if I base the addon off the faad library?

inseculous wrote:
well I don't want to drop this back to square one, but I'm gonna anyway :wink:

Has anyone concidered asking Palm for the headers? I mean if it’s done nicely and correctly they just might let us have them. They are only headers, we would still need to write the code.
Plus, now that we are a legit nonprofit they might look at it with a little more interest. Who knows they could donate the source as a tax write off (he says in his dreams :lol: )

Like I said in my last post I’ll try to do one for the new kit, but I’ve had troubles with it (the kit that is) and don’t know if my frustrations will allow anything usable to surface :? Plus by the time I finish it someone else will more then likely have one *10 better then what I get, it always happens :lol:

that being said is there going to be a problem if I base the addon off the faad library?

No, theres already GPL addons in the tree

As goes asking Palm for the headers - do not bother. The only, and I mean ONLY R5 codec that cannot be recreated much, much better is Indeo 5. The Haiku decoder API is much better thought out, and within 6 months to a year “everyone” (who matters) will be using the Haiku media kit anyway. The headers will let you create an R5 only decoder (Haiku can’t use R5 decoders). You’d need to rewrite it anyway

Also, what problems do you have with the media kit. In the abscene of Marcus, Andrew and DMCPaul, I’ve probably used it the most and might be able to help

I’m sure some of these problems are known but you asked :wink:

I’m glad you asked. I was going to post something about it. First the bebits wiki says to --enable-gpl-addons but in the configure script it’s --include-gpl-addons. You also don’t mention where this should be used I kept trying to put it on jam.

My problems. Full disclosure: I’m using an duel Athlon MP with a Matrox G400 and Soundblaster Audigy 1 with 5.1 speaker system.

I have one avi (divx according to mediaplayer fileinfo) that plays fine, except it doesn’t loop it freezes if it reaches the end.

My other videos are mpg’s which it tries to open as audio. And freezes or slows down any other media playing.

This is the weird stuff
When using the media pref app (last tested with haiku’s):
First time I open it the right channel of main output is turned all the way down.
If I turn on “display balance controls…” They are pined to the right side. Draging them to the left raises the volumn, then draging does nothing.
In the output mapping tab if I uncheck left in the Left section sound comes out of my center channel at a very low volumn. The sound from the center channel responds to the right slider under the Right section. I get no sound from my right speaker ever. As I said before the “right” or should I say center sound is significantly lower compaired to the left…
At its max it is like the left at its lowest. And these are stereo mp3’s

Again I know some of these issues are likely known but you asked. I’ll get the formats of those movies and post a followup.

AVI one I don’t know about…

MPEG issue is well known

What driver are you using for the Audigy? Is it Jeromes?

I’m not sure if its Jeromes or not. It was the one built in the Haiku tree.

Has there been any news on the MediaPlayer replacement?

Hrm. You ARE use the replacement multi_audio addon, right?

Marcus is working on the replacement player ATM.