how to develop more codec for android? - Android Software Development

Hi,all!
I am now beginning a multimedia project (audio/video... player) on android platform. But android 2.1's codec support is rather limited (androidappdocs.appspot.com/guide/appendix/media-formats.html). It's required to do some extension development to support more codec, ape, flac,rm, rmvb,for example. I ran around the net for the whole day, but i failed to find any related referrence and source code.
so my question: is there some open project do the same or similar things? i need some open source code to study!
i hope there would be some experienced guys give some tips for development! Thanks in advance!

i found a post (n2.nabble.com/Port-Gstreamer-to-Android-td2410295.html) trying to port gstreamer to android.
but still i don't know how to continue...

I'm thinking it would be better to port mplayer its a bit hevier but in my experience it's more reliable/stable.
look around i think someone got mplayer running and decoding video but was strugling with acctually displaying it. my guess is you would need some sort of java front in to tie it to the android display system unless you could go through opengl or something

Related

Ideas for Google Android Challenge

Hello all,
This post is in regard to the Google Android Challenge put out by Google to create/develop new software for the Google Android shell. If you haven't had a chance to read about it, it's basically a new OS created by Google to run on any type of PDAesque cellular phone. The challenge issued is then to develop new software for this OS (written in Java) so that when it is released it will have software available for it.
My question to all of you is what software would you like to see developed for this new OS? The reason I am asking for ideas is because I am a CS undergraduate student working in a research group to create one of these programs. Ergo, I figured asking you guys what you'd like to see created would be the best way to get ideas that will make sense and benefit the community.
Any ideas you submit here may be used in the creation of new software--if you require idea copyrights that can be worked out.
Thank you all in advance,
Jake
Jake Lake
Undergraduate Student at LCSC Lewiston, ID
Hello Jake,
We'll I'm a Java programmer too, not thinking of entering the challenge though. Had a quick look at the SDK for Android and it does'nt seem like pure java, more like a hybrid of C and Java does'nt it?
Since I have'nt had a thorough look at it, I'd like to ask you a few questions regarding the freedom to program on the platform.
Since it does'nt use the "normal" JVM but googles Davlik where theres no byte code but script code, does it allow better interaction with the hardware, and is it faster? Also can you implement equallizers and other effects in a media based application, which of course was not possible on J2ME. I was thinking on a All-round mediaplayer for Android, something like Rockbox which maybe found at www.rockbox.org which is a linux based program used on iPods etc.. but has been ported to Linux based EZX phones.
Regards,
Akshay

DIVX Player for the G1?

Are there are any DIVX players for the G1?
I am surprised there isnt any search results for DIVX on this, isnt anyone interested in using the G1 to watch movies?
Ok, I noticed a new software (oops a new APP) called Cinema on the market today and I downloaded it. It is supposed to play h.264 and MP4 files, which I have some regular movies (700MB ones) and it does not play those but I have a few low-res ones (160x120) that it does play but jittery. The screen actually looks beautiful and the sound is not jittery but the screen jerks and pauses and you cant get to crop, zoom, aspect ratio, or any of that good stuff to make it fit nicely on the screen. The file extension HAS to be .mp4 for it to show on the list to open. Not too easy for me where my entire collection has a .avi extension.
It is a good start though and a long way from the two original Video players, PLAYS VIDEO and Video Player that played nothing for me at all, not even SHOWED files with .mp4 extension.
Video Player worked perfectly for me but Cinema doesn't detect the same .mp4... We will see much better things in the coming months. I am sure we can even ask DIVX to think about making a player, that would be cool.
4 Months into Andriod and I am losing hopes that we will ever see any support other than the mp4 format. No Divx or any other formats.... I think Google has made it either impossible or very difficult to do anything other than mp4s.
brooklynite said:
4 Months into Andriod and I am losing hopes that we will ever see any support other than the mp4 format. No Divx or any other formats.... I think Google has made it either impossible or very difficult to do anything other than mp4s.
Click to expand...
Click to collapse
Google keeps as much of the Android source under the BSD license as it can. There's some LGPL stuff in there like parts of Webkit and, of course, the linux kernel but that code has to be kept separate from the BSD licensed code. They do this to entice companies to use it because the BSD license allows any one to use the source code without requiring them to release the source of any changes they made to it. However, if a phone manufacturer has to modify the linux kernel, or any other LGPL code, to get it to work on their hardware then they are required to make the source available for those changes. Most companies would not be happy with having to make their source code available so making the Android platform available under BSD makes it much more attractive.
To that end Android needed to have as much of its core components under the BSD license as it possibly could, and that includes the multimedia subsystem. The multimedia system is called OpenCORE and was contributed by PacketVideo. They and other contributing members of the OHA have all agreed to license their code under BSD meaning that any one can take their work and use it in their own projects without having to contribute any thing back. That's no small thing to ask when those OHA members could have licensed that software for a fee instead of giving it away for free.
The reason we can't play some formats like DivX and WMV is because there is no BSD licensed software available that can be included in the Android core. There's plenty of LGPL projects around but an Android developer recently posted on their android-platform group that dealing with licensing issues for Webkit and bluez was extremely painful so I doubt we'll be seeing any of those making it into the core platform.
Another problem is that Google still has not made a native code SDK available. Everything has to be written using the Java SDK and although they attempt to optimize it as much as possible it's still not a fast as native code. Their security model depends on sandboxing applications using the Dalvik VM and native code applications would break that model. Unfortunately, most video decoders would suffer from poor performance if they had to run through the VM. A native SDK is essential for getting these and other CPU intensive tasks (like emulators! I long for a good SNES emulator on this phone) to run well.
So yes Google has made it hard to play video that's not MP4 but it's not because they're trying to be dicks about it.
numerik said:
Google keeps as much of the Android source under the BSD license as it can. There's some LGPL stuff in there like parts of Webkit and, of course, the linux kernel but that code has to be kept separate from the BSD licensed code. They do this to entice companies to use it because the BSD license allows any one to use the source code without requiring them to release the source of any changes they made to it. However, if a phone manufacturer has to modify the linux kernel, or any other LGPL code, to get it to work on their hardware then they are required to make the source available for those changes. Most companies would not be happy with having to make their source code available so making the Android platform available under BSD makes it much more attractive.
To that end Android needed to have as much of its core components under the BSD license as it possibly could, and that includes the multimedia subsystem. The multimedia system is called OpenCORE and was contributed by PacketVideo. They and other contributing members of the OHA have all agreed to license their code under BSD meaning that any one can take their work and use it in their own projects without having to contribute any thing back. That's no small thing to ask when those OHA members could have licensed that software for a fee instead of giving it away for free.
The reason we can't play some formats like DivX and WMV is because there is no BSD licensed software available that can be included in the Android core. There's plenty of LGPL projects around but an Android developer recently posted on their android-platform group that dealing with licensing issues for Webkit and bluez was extremely painful so I doubt we'll be seeing any of those making it into the core platform.
Another problem is that Google still has not made a native code SDK available. Everything has to be written using the Java SDK and although they attempt to optimize it as much as possible it's still not a fast as native code. Their security model depends on sandboxing applications using the Dalvik VM and native code applications would break that model. Unfortunately, most video decoders would suffer from poor performance if they had to run through the VM. A native SDK is essential for getting these and other CPU intensive tasks (like emulators! I long for a good SNES emulator on this phone) to run well.
So yes Google has made it hard to play video that's not MP4 but it's not because they're trying to be dicks about it.
Click to expand...
Click to collapse
WOW this is probably the best answer I have received on this site since I became a member. I guess I was just naive when I thought Google claiming "open source" means easy programming. What I didnt know is that the Google version of open sourse is nothing like Microsoft Windows which is truly open and free to programmers. I wish Google would just charge $50 for the OS and leave it truly OPEN to write programs, or I guess, apps. This whole applet, app, gadget and supposed simplifying thing on the internet is just making it dumber. It seems like Google "open source" means if you want to write a map program with Google maps, its extremely easy and ready made, if you want to use Yahoo maps, mapquest, Microsoft maps etc, its practically impossible. Sooner or later, people would know and stop using andriod.
brooklynite said:
I guess I was just naive when I thought Google claiming "open source" means easy programming. What I didnt know is that the Google version of open sourse is nothing like Microsoft Windows which is truly open and free to programmers. I wish Google would just charge $50 for the OS and leave it truly OPEN to write programs, or I guess, apps.
Click to expand...
Click to collapse
Once upon a time I decided to replace my faithful Treo 650 with a Sprint Mogul. When I looked at the specs of the Mogul from an HTC press release I saw that it had an ATI GPU for 3d acceleration so I thought it was going to be a decent phone. When I got it and started playing with it I noticed that it had really poor performance when playing video. I've played DivX movies using TCPMP without having to re-encode them to lower bit rates or scaled down and that was on a 312Mhz CPU with 32MB of RAM (only 23 of which was actually available). All of those same files were unwatchable on the Mogul. We know now, of course, that the reason was in HTC's poor driver support. Some were able to hack together some drivers for phones like the Kaiser using files ripped from other devices but the Mogul never did get working drivers. The funny thing is that in one of the threads discussing this someone mentioned that the Android source code repository had a linux kernel driver for the same ATI chip and wondered if it could be used to write a working Windows Mobile driver. Windows Mobile truly open and free? Are you sure about that?
brooklynite said:
This whole applet, app, gadget and supposed simplifying thing on the internet is just making it dumber. It seems like Google "open source" means if you want to write a map program with Google maps, its extremely easy and ready made, if you want to use Yahoo maps, mapquest, Microsoft maps etc, its practically impossible. Sooner or later, people would know and stop using andriod.
Click to expand...
Click to collapse
Writing a map program using Google Maps is easy to do because Google built the API into the SDK. You might just as well complain that Microsoft doesn't make writing a map program in Windows Mobile using Google Maps easy. Nothing stops Microsoft, Yahoo, or Mapquest from writing software for the Android OS or providing an API for their services.
I wouldn't give up on it just yet. Adobe announced that Android will have Flash and there's zero chance of them releasing it under BSD as part of Android OS and unless they've discovered some way to massively speed up the Dalvik VM that means that Google is allowing native code to execute within the Android environment; and plugged in to the browser no less. My guess for the reason we haven't seen Flash yet is that Adobe is waiting on Google to make the necessary changes to the underlying architecture that will allow this to happen. The good news is that if its available to Adobe, then native code execution will be available to all and you'll start seeing more interesting apps.

Porting a game from PC to ppc

Hi, I never did that, but I was playing to Anthelion 2 on my PPC and I thank that it could be great to port Homeworld 1 or Cataclysm to the PPC, and I would like to know how to do that, I think that I could "recompiler" it, but I don't know how, and I would like to know if a tutorial has been created somewhere on the net?...
I'm not sure if it would be even technically possible. Well, the newest pdas _might_ be powerful enough to run something like HW1 but i'm not sure if it's such a good idea. Did you try to run homeworld in 640x480 resolution? Most of the time you'll see ships as groups of two to eight pixels. Now imagine it all squished on a phone three-inch screen: try ordering your corvettes to smash that annoying bomber on a screen that small I think that a bit better idea would be porting really old games, that were designed to run in VGA or even lower resolutions (SubCulture, Command&Conquer, I-War, Dark Forces are some of the titles i'd pay for ).
Anyway, back to porting subject.
First of all you would need the source code of the program you want to port - in case of homewrld1 it's not a problem.
Secondly, you would have to make sure that all libraries (graphic, sound, input, etc) used by a game have windows mobile/windowsCE versions. Again, homeworld1 seems lucky since it has been ported to SDL - a multiplatform opensource graphic/sound/input library.
But that's where good news end. Porting a game is not just a matter of grabbing the PC version source and recompiling it. If it was as easy, we would have hundreds of PC games already ported You need considerable programming skills to actually create a port because usualy not all libraries used by a game a compatible with WindowsCE. An example - the opensource version of homeworld uses OpenGL for graphic rendering. The pocket version would have to use OpenGL's "little brother" - OpenGLES. As far as i know, they're not 100% identical, so to put it simply, you would have to make the game talk in OGLES language, instead of standard OGL. And doing changes in graphic rendering routines usually breaks something else, so you'd have to go and fix it.
I'm not trying to discourage you here but i'd suggest learning to program for WindowsCE (or at least for PC) _before_ attempting to port anything - doing it the other way around will be just a waste of time and a source of frustration.
There are some development resources that can help start the adventure with programming here on xda. You could also search for some general C/C++ tutorials targeting PC's. If you consider getting into programming, i suggest checking out SDL - Many games use it, and thanks to this library you can skip the OS-specific part of coding and get right to the fun stuff - a program that actually does/displays anything For an even easier start, you might want to check out QuickCG - a SDL wrapper simplifying the coding even further.
Oki, thanks for your answer, I've a friend who is learning to program in C++, so, I'll ask him if he can help me to do that, it would be great to have this game on a PPC (perhaps the Diamond, because it has D3D and OpenGL Drivers, or of the iPhone, but I guess that the programming language is not the same as the PPC...
[EDIT] STARCRAFT would be great to, and easier to port on PPC, because of his age and that he uses 2d Graphisms...
You should look into the stratagus engine.
antrak said:
You should look into the stratagus engine.
Click to expand...
Click to collapse
Nice Engine, but it's not Starcraft, but I can't find the Source Code on the net, they could give the source code with the game when you buy it
Psycho said:
Hey, it's Calvin, I found him
Click to expand...
Click to collapse
Stargus a starcraft's clone, I'm trying to download it, but I don't know if it works for PPC...
You might want to check this thread:
http://forum.xda-developers.com/showthread.php?t=497086&highlight=starcraft

Jython in Android?

Hey Folks,
I was wondering if anyone knew if it was possible to use Jython instead of plane Java for android development? I don't know much about Java development but I'm with Python. I was figuring that this might ease me into it better. Any thoughts?
Thanks,
-=GB=-
Have you had a look at the Android scripting environment?
http://code.google.com/p/android-scripting/
http://google-opensource.blogspot.com/2009/06/introducing-android-scripting.html
http://code.google.com/p/android-scripting/wiki/PythonAndroidAPI
Regards,
Akshay
Thanks aksd,
I don't know how I didn't find that before. Perhaps I should have just searched for Python and Android as opposed to just Jython and androind.
Anyway, this is very cool for prototyping and simple scripting. However, the main thing I was hoping for was writing apps in Python (via Jython) that could then be distributed on the Marketplace. It's kind of to bad. It doesn't look like anyone is really trying to port Jython to Android because ASE is sort of Google's official response to the whole thing. On the whole, a really great thing for people who just want to script Android but not really for App development.
In all of this searching I did find some interesting information about how to link in C libs so you could code some of the hardcore speed sucking elements in C (like a game engine) and then make calls into it via Java. I didn't know that was even possible so... Pretty cool stuff.
Hey ngrava,
I'm not much into scripts, so dont really follow whats happening with scripting and Android.
If you wanted a bit of a performance gain you can use the NDK and call the JNI to execute native libraries or code. been there for awhile but few use them. Java is just so much easier than C .
Theres a lot of interesting stuff going on on the Android platform, Mono being ported to Android, Scala being ported to Android, I'm actually currently working on profiling the performance of scala code on android.
Regards,
Akshay
On the Google DevFest on Argentina, Google´s ingeneers afirmed that they are working to make more languages availeable on Gingerbread, they specifically mentioned Ruby. We just have to wait to see if this is true and if we are going to be able to ship apps of other languages to the market, and I´m not sure if they will be backwards compatible with earlier versions of android as well.
PD: Oops, sorry for reviving this old post, I just realised i clicked last page instead of next

Porting MAME to Android

I'm not a programmer, I just want to compile MAME for the Android. But, of course compiling code within the Android platform is not possible (as one would do it in Ubuntu or Debian), so I need the Android SDK and enough knowledge of java to call the native code, which needs to be packaged by the NDK, launched from within Cygwin.
Seems there will also be some video issues, beyond my comprehension. MAME developer R. Belmont posted this on porting MAME to Android:
The OpenGL support won't help you with GLES, that'll need to be an entirely separate code path
Click to expand...
Click to collapse
Whatever that means, it sounds like a lot of work. Looking around for similar projects for examples on how to call native code like the source for MAME , I found the java activity source code for aDosBox. It's also an emulator, but also has video requirements and uses native source as it's base. I'm still decrypting what it does, but for a developer (perhaps you!) looking to port MAME, it might be a good place to start.
What would be cool, is a couple templates I could just plug the needed particulars into. One for the Android.mk file that adds any required libraries needed for video stuff when I use ndk-build, and one for the java activity that simply calls the native code.
The MAME source code also has an SDL backend in the included build system. The build system 'detects' what platform it's on and builds accordingly. Can SDL be used in the Android SDK?

Categories

Resources