Discussion:
using MediaPlayer.cpp files directly from native C/C++ code
(too old to reply)
b***@gmail.com
2018-09-26 05:31:31 UTC
Permalink
Hi All,,

I am writing a C++ app which will call directly mediaplayer.cpp class
functions.
Code Snippet:

mMediaPlayer = new MediaPlayer();
mMediaPlayer->setListener(listener);
mMediaPlayer->setDataSource(NULL, path,NULL);
mMediaPlayer->prepare();
mMediaPlayer->start();

When I execute this, I see that its blocked in prepare().
I could see notify() has been triggerred from MediaPlayerService.cpp but
it din't reach my native app.

From native app, i dint configure any Binder parameters because
MediaPlayer.cpp takes care of all these.
I have set my listener inheriting the MediaPlayerListener.

Any idea why Binder IPC replies are not hit at mediaplayer.
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/203d6770-ae7b-4561-805b-ddd2cfbbc69e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Glenn Kasten
2018-09-26 13:56:33 UTC
Permalink
I think these are not NDK APIs, and so cannot be accessed by apps.

On Wednesday, September 26, 2018 at 12:02:03 AM UTC-7,
Post by b***@gmail.com
Hi All,,
I am writing a C++ app which will call directly mediaplayer.cpp class
functions.
mMediaPlayer = new MediaPlayer();
mMediaPlayer->setListener(listener);
mMediaPlayer->setDataSource(NULL, path,NULL);
mMediaPlayer->prepare();
mMediaPlayer->start();
When I execute this, I see that its blocked in prepare().
I could see notify() has been triggerred from MediaPlayerService.cpp but
it din't reach my native app.
From native app, i dint configure any Binder parameters because
MediaPlayer.cpp takes care of all these.
I have set my listener inheriting the MediaPlayerListener.
Any idea why Binder IPC replies are not hit at mediaplayer.
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/ae4d98f5-d163-4e4e-99f4-65f08e9ad81f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...