That is correct. We will probably add a callback mechanism for the
MediaRecorder in the next release.

It's easier to conceptualize if you think in terms of the binder as a
remote function call into another process. If you want to establish a
callback mechanism, you need to pass an object interface (in OOP
terms) to the server so that it can callback on the client. The only
difference is that client->server calls are almost always synchronous,
i.e. the client thread blocks until the server responds. For server-
>client callbacks, they are asynchronous - the server posts a binder
message but does not block.

On Feb 18, 12:03 pm, hanchao3c <[email protected]> wrote:
> In my view.
> The function of the "Client" is similar to the callback.
> Because  using the binder as IPC , simple callback  can't be used , we
> must use a client for callback.
>
> On Feb 19, 1:56 am, rktb <[email protected]> wrote:
>
> > Hi,
>
> > What is the difference between the create methods of player and
> > recorder?
>
> > virtual sp<IMediaRecorder>  createMediaRecorder(pid_t pid) = 0;
> > and
> > virtual sp<IMediaPlayer>    create(pid_t pid, const
> > sp<IMediaPlayerClient>& client, const char* url) = 0;
>
> > Both return an instance of the interface requested. But, the create of
> > MediaPlayerService takes in the reference of the client as well. Is
> > this for the notifications back from the mediaplayerservice to the
> > client? Or, for something else?
>
> > -Ravi
>
> > On Feb 16, 12:26 pm, Dave Sparks <[email protected]> wrote:
>
> > > We needed a static object to allocate new clients. It happened to be
> > > convenient. It may get renamed in the future.
>
> > > On Feb 16, 9:27 am, hanchao3c <[email protected]> wrote:
>
> > > > In this code:
> > > > base/include/media/IMediaPlayerService.h
>
> > > > class IMediaPlayerService: public IInterface
> > > > {
> > > > public:
> > > >     DECLARE_META_INTERFACE(MediaPlayerService);
>
> > > >     virtual sp<IMediaRecorder>  createMediaRecorder(pid_t pid) = 0;
> > > >     virtual sp<IMediaMetadataRetriever> createMetadataRetriever(pid_t
> > > > pid) = 0;
>
> > > >     virtual sp<IMediaPlayer>    create(pid_t pid, const
> > > > sp<IMediaPlayerClient>& client, const char* url) = 0;
> > > >     virtual sp<IMediaPlayer>    create(pid_t pid, const
> > > > sp<IMediaPlayerClient>& client, int fd, int64_t offset, int64_t
> > > > length) = 0;
> > > >     virtual sp<IMemory>         decode(const char* url, uint32_t
> > > > *pSampleRate, int* pNumChannels, int* pFormat) = 0;
> > > >     virtual sp<IMemory>         decode(int fd, int64_t offset, int64_t
> > > > length, uint32_t *pSampleRate, int* pNumChannels, int* pFormat) = 0;};
>
> > > > ================================================================================
>
> > > > 1. It seems there should a IMediaRedorderService , but there isn't!
> > > > 2. If use it like this , why still call it "IMediaPlayerService"
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to