actually I don't think you can build the android tree under cygwin (it
mentioned that somewhere in the documentation), so I didn't bother
trying.
I didn't just clone the platform/frameworks/base.git tree, I used
repo to get the entire android tree, and I built that using make.
(I followed the instructions on source.android.com/download)
NOTE - so you have to use Linux to build the source - I use VMWare
with Ubuntu 9.10. You must have lots of HDD space free before you run
make (>>10GB I recommend). I also had a few problems like the wrong
packages installed or not available (e.g. you need JDK1.5 NOT 1.6 to
build android). But I fixed things by using google to find out how to
do it (I am not a Linux person).
After it finished building, all the .so libraries are available buried
in the 'out' directory.
I then copied the libmedia.so into
\android-ndk-1.6_r1\build\prebuilt\windows\arm-eabi-4.2.1\arm-eabi\lib
on my Windows box where I am doing the NDK development (using cygwin
to build the JNI part, as per the NDK documentation).
Btw I just guessed to put the library file here (it worked when I did
it). I'm not sure if this is correct.
I added LOCAL_LDLIBS := -lmedia
to the hello-jni sample and wrote some code to make calls to a media
player object (note you need to use extern "C" calling convention
if you are in a cpp file). You will also need to add local include
paths (using LOCAL_C_INCLUDES ) so you can access the media header
files.
Using LOCAL_STATIC_LIBRARIES didn't work because it seems that it
expects the make system to be able to build the required .so files,
but in my case I have already built the libraries previously.
The problem I have is that I wanted to be able to access OpenCore
functionality from native code.
So I copied libopencore_player.so as per above. But when I add -
lopencore_player to the LOCAL_LDLIBS line in my makefile, and
built it and run it, my application crashes on the call to
System.loadLibrary with my JNI library (i.e. System.loadLibrary("hello-
jni"); )
It's strange that I can load my version of libmedia.so, but it crashes
when I load my build of libopencore_player.so.
I'm not sure if it's possible there is some sort of 'clash' or
something happening.
If anyone who has already done this and/or knows what the problem
might be, please let me know :)
Best regards
Eugene
> > >> >> (including themediaplayer source code you are interested in).
>
> > >> >> If you want to get the pre-compiled binaries for those libraries (and avoid
> > >> >> compiling/linking them yourself) I'm not so sure on the procedure but you
> > >> >> could probably rip the libraries from one of the ADP builds:
>
> > >> >>http://developer.htc.com/adp.html
>
> > >> >> On Monday 14 Dec 2009 18:45:25 purvi wrote:
>
> > >> >> > Hi,
>
> > >> >> > I am getting the below error when I clone themedia/libmedia tree
> > >> >> > Error: "fatal: The remote end hung up unexpectedly"
>
> > >> >> > By looking at the .cpp code I was not able to make out how can I have
> > >> >> > the access to the decode function. That is the reason I want to get
> > >> >> > hold of the native libraries of libmedia or libmedia.so so that I can
> > >> >> > use it along with my native code.
>
> > >> >> > Yes I have gone through the documentation for git as well as repo.
> > >> >> > I am new to the android native development so I am sorry for my
> > >> >> > ignorance but can anyone please tell me if there is any other way to
> > >> >> > get the android native libraried except by using git/repo?
>
> > >> >> > Thanks.
> > >> >> > Regards,
> > >> >> > Purvi
>
> > >> >> > On Dec 14, 12:19 pm, Sean Hodges <seanhodge...@googlemail.com> wrote:
> > >> >> > > On Mon, Dec 14, 2009 at 2:44 PM, purvi <purvi.n...@gmail.com> wrote:
> > >> >> > > > Hi,
>
> > >> >> > > > I want to access native code of android for MediaPlayer where I can
> > >> >> > > > access to the decode funtion of MediaPlayer and MediaPlayerService.
> > >> >> > > > How can I achieve this?
> > >> >> > > > I tried to clone themediatree for it using git. But I wasnot able to
> > >> >> > > > clone it.
> > >> >> > > > Can anyone please help to access the native code / libraries of
> > >> >> > > > android?
>
> > >> >> > > What is the problem you're having? It's a little difficult to help
> > >> >> > > when the description is "I can't do it". Have you read the
> > >> >> > > instructions on how to use repo to check out the code
> > >> >> > > (http://source.android.com/download/using-repo)?Areyougettinga
> > >> >> > > specific error message?
>
> > >> >> > > If you only want to view the code, you could just use gitweb, I guess
> > >> >> > > the decode function you are looking for is at the bottom of
> > >> >> > > mediaplayer.cpp:
>
> > >> >> > >http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...
>
> > >> >> > --
>
> > >> >> > You received this message because you are subscribed to the Google Groups
> > >> >> > "android-ndk" group. To post to this group, send email to
> > >> >> > andro...@googlegroups.com. To unsubscribe from this group, send email
> > >> >> > to android-ndk...@googlegroups.com. For more options, visit this
> > >> >> > group athttp://groups.google.com/group/android-ndk?hl=en.-Hidequotedtext -
I was intending on building the necessary components of OpenCore and
the media library from source code into my own library to call from my
native code, so that I was relying on those rather than the libraries
within android itself.
Would this not offer some level of stability or 'independence' from
whatever ABI changes are made in the NDK?
Please feel free to set me straight here ;) but I was imagining that
building the opencore_player + necessary dependencies as a static
library, and among several others, linking them all into my own native
library, would give some access to audio/video functionality whilst we
wait for the NDK to be updated to allow easier access to this
functionality.
The reasoning being that we need to demo some audio/video processing
on android now, but once a properly accessible API is available, we
can switch to that.
Kind regards
Eugene
On Jan 12, 11:41 pm, David Turner <di...@android.com> wrote:
> Hello Eugune,
>
> No, it's not very surprising that you're experimenting a clash. What you're
> doing
> is not a good idea since things like libmedia.so or libopencore_player.so
> are
> not part of the stable ABI exposed by the NDK.
>
> And I guarantee you that the media framework is under *very* heavy
> modifications in Android, you should not try to meddle with its non-public
> parts, or else your code will break in the future after the next OTA, or
> something like that.
>
> > > >http://seanhodges.co.uk/~sean/libmedia.zip<http://seanhodges.co.uk/%7Esean/libmedia.zip>
> >http://source.android.com/download/using-repo)?Areyougettinga<http://source.android.com/download/using-repo%29?Areyougettinga>
> > > > >> >> > > specific error message?
>
> > > > >> >> > > If you only want to view the code, you could just use gitweb,
> > I guess
> > > > >> >> > > the decode function you are looking for is at the bottom of
> > > > >> >> > > mediaplayer.cpp:
>
> >http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...
>
> > > > >> >> > --
>
> > > > >> >> > You received this message because you are subscribed to the
> > Google Groups
> > > > >> >> > "android-ndk" group. To post to this group, send email to
> > > > >> >> > andro...@googlegroups.com. To unsubscribe from this group,
> > send email
> > > > >> >> > to
>
> ...
>
> read more »