diff options
Diffstat (limited to 'media/libmedia/IMediaPlayer.cpp')
-rw-r--r-- | media/libmedia/IMediaPlayer.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/media/libmedia/IMediaPlayer.cpp b/media/libmedia/IMediaPlayer.cpp index 0bb237d..cb07766 100644 --- a/media/libmedia/IMediaPlayer.cpp +++ b/media/libmedia/IMediaPlayer.cpp @@ -55,6 +55,7 @@ enum { SET_PARAMETER, GET_PARAMETER, SET_RETRANSMIT_ENDPOINT, + GET_RETRANSMIT_ENDPOINT, SET_NEXT_PLAYER, }; @@ -292,7 +293,8 @@ public: return remote()->transact(GET_PARAMETER, data, reply); } - status_t setRetransmitEndpoint(const struct sockaddr_in* endpoint) { + status_t setRetransmitEndpoint(const struct sockaddr_in* endpoint) + { Parcel data, reply; status_t err; @@ -319,6 +321,23 @@ public: remote()->transact(SET_NEXT_PLAYER, data, &reply); return reply.readInt32(); } + + status_t getRetransmitEndpoint(struct sockaddr_in* endpoint) + { + Parcel data, reply; + status_t err; + + data.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor()); + err = remote()->transact(GET_RETRANSMIT_ENDPOINT, data, &reply); + + if ((OK != err) || (OK != (err = reply.readInt32()))) { + return err; + } + + data.read(endpoint, sizeof(*endpoint)); + + return err; + } }; IMPLEMENT_META_INTERFACE(MediaPlayer, "android.media.IMediaPlayer"); @@ -498,11 +517,24 @@ status_t BnMediaPlayer::onTransact( } else { reply->writeInt32(setRetransmitEndpoint(NULL)); } + + return NO_ERROR; + } break; + case GET_RETRANSMIT_ENDPOINT: { + CHECK_INTERFACE(IMediaPlayer, data, reply); + + struct sockaddr_in endpoint; + status_t res = getRetransmitEndpoint(&endpoint); + + reply->writeInt32(res); + reply->write(&endpoint, sizeof(endpoint)); + return NO_ERROR; } break; case SET_NEXT_PLAYER: { CHECK_INTERFACE(IMediaPlayer, data, reply); reply->writeInt32(setNextPlayer(interface_cast<IMediaPlayer>(data.readStrongBinder()))); + return NO_ERROR; } break; default: |