Loading media/libmediaplayer2/MediaPlayer2Manager.cpp +8 −6 Original line number Diff line number Diff line Loading @@ -580,7 +580,7 @@ void MediaPlayer2Manager::Client::AudioDeviceUpdatedNotifier::onAudioDeviceUpdat audio_port_handle_t deviceId) { sp<MediaPlayer2Interface> listener = mListener.promote(); if (listener != NULL) { listener->sendEvent(MEDIA2_AUDIO_ROUTING_CHANGED, audioIo, deviceId); listener->sendEvent(0, MEDIA2_AUDIO_ROUTING_CHANGED, audioIo, deviceId); } else { ALOGW("listener for process %d death is gone", MEDIA2_AUDIO_ROUTING_CHANGED); } Loading Loading @@ -1031,7 +1031,8 @@ status_t MediaPlayer2Manager::Client::getParameter(int key, Parcel *reply) { } void MediaPlayer2Manager::Client::notify( const wp<MediaPlayer2Engine> &listener, int msg, int ext1, int ext2, const Parcel *obj) const wp<MediaPlayer2Engine> &listener, int64_t srcId, int msg, int ext1, int ext2, const Parcel *obj) { sp<MediaPlayer2Engine> spListener = listener.promote(); if (spListener == NULL) { Loading Loading @@ -1063,9 +1064,9 @@ void MediaPlayer2Manager::Client::notify( } if (nc != NULL) { if (errStartNext == NO_ERROR) { nc->notify(MEDIA2_INFO, MEDIA2_INFO_STARTED_AS_NEXT, 0, obj); nc->notify(srcId, MEDIA2_INFO, MEDIA2_INFO_STARTED_AS_NEXT, 0, obj); } else { nc->notify(MEDIA2_ERROR, MEDIA2_ERROR_UNKNOWN , 0, obj); nc->notify(srcId, MEDIA2_ERROR, MEDIA2_ERROR_UNKNOWN , 0, obj); ALOGE("gapless:start playback for next track failed, err(%d)", errStartNext); } } Loading @@ -1085,8 +1086,9 @@ void MediaPlayer2Manager::Client::notify( } if (c != NULL) { ALOGV("[%d] notify (%p, %d, %d, %d)", client->mConnId, spListener.get(), msg, ext1, ext2); c->notify(msg, ext1, ext2, obj); ALOGV("[%d] notify (%p, %lld, %d, %d, %d)", client->mConnId, spListener.get(), (long long)srcId, msg, ext1, ext2); c->notify(srcId, msg, ext1, ext2, obj); } } Loading media/libmediaplayer2/MediaPlayer2Manager.h +2 −2 Original line number Diff line number Diff line Loading @@ -276,8 +276,8 @@ private: virtual status_t setDataSource(const sp<DataSourceDesc> &dsd); static void notify(const wp<MediaPlayer2Engine> &listener, int msg, int ext1, int ext2, const Parcel *obj); static void notify(const wp<MediaPlayer2Engine> &listener, int64_t srcId, int msg, int ext1, int ext2, const Parcel *obj); pid_t pid() const { return mPid; } virtual status_t dump(int fd, const Vector<String16>& args); Loading media/libmediaplayer2/include/mediaplayer2/MediaPlayer2EngineClient.h +1 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ namespace android { class MediaPlayer2EngineClient: public RefBase { public: virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; virtual void notify(int64_t srcId, int msg, int ext1, int ext2, const Parcel *obj) = 0; }; }; // namespace android Loading media/libmediaplayer2/include/mediaplayer2/MediaPlayer2Interface.h +3 −3 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ class MediaPlayer2Interface : public AHandler public: // callback mechanism for passing messages to MediaPlayer2 object typedef void (*NotifyCallback)(const wp<MediaPlayer2Engine> &listener, int msg, int ext1, int ext2, const Parcel *obj); int64_t srcId, int msg, int ext1, int ext2, const Parcel *obj); // AudioSink: abstraction layer for audio output class AudioSink : public RefBase { Loading Loading @@ -240,7 +240,7 @@ public: mClient = client; mNotify = notifyFunc; } void sendEvent(int msg, int ext1=0, int ext2=0, void sendEvent(int64_t srcId, int msg, int ext1=0, int ext2=0, const Parcel *obj=NULL) { NotifyCallback notifyCB; wp<MediaPlayer2Engine> client; Loading @@ -250,7 +250,7 @@ public: client = mClient; } if (notifyCB) notifyCB(client, msg, ext1, ext2, obj); if (notifyCB) notifyCB(client, srcId, msg, ext1, ext2, obj); } virtual status_t dump(int /* fd */, const Vector<String16>& /* args */) const { Loading media/libmediaplayer2/include/mediaplayer2/mediaplayer2.h +6 −3 Original line number Diff line number Diff line Loading @@ -194,7 +194,7 @@ enum media_player2_invoke_ids { class MediaPlayer2Listener: virtual public RefBase { public: virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; virtual void notify(int64_t srcId, int msg, int ext1, int ext2, const Parcel *obj) = 0; }; class MediaPlayer2 : public MediaPlayer2EngineClient Loading @@ -204,6 +204,7 @@ public: ~MediaPlayer2(); void disconnect(); status_t getSrcId(int64_t *srcId); status_t setDataSource(const sp<DataSourceDesc> &dsd); status_t setVideoSurfaceTexture(const sp<ANativeWindowWrapper>& nww); status_t setListener(const sp<MediaPlayer2Listener>& listener); Loading Loading @@ -235,7 +236,8 @@ public: status_t setLooping(int loop); bool isLooping(); status_t setVolume(float leftVolume, float rightVolume); void notify(int msg, int ext1, int ext2, const Parcel *obj = NULL); void notify(int64_t srcId, int msg, int ext1, int ext2, const Parcel *obj = NULL); status_t invoke(const Parcel& request, Parcel *reply); status_t setMetadataFilter(const Parcel& filter); status_t getMetadata(bool update_only, bool apply_filter, Parcel *metadata); Loading @@ -260,11 +262,12 @@ private: status_t seekTo_l(int msec, MediaPlayer2SeekMode mode); status_t prepareAsync_l(); status_t getDuration_l(int *msec); status_t attachNewPlayer(const sp<MediaPlayer2Engine>& player); status_t attachNewPlayer(const sp<MediaPlayer2Engine>& player, long srcId); status_t reset_l(); status_t checkStateForKeySet_l(int key); sp<MediaPlayer2Engine> mPlayer; int64_t mSrcId; thread_id_t mLockThreadId; Mutex mLock; Mutex mNotifyLock; Loading Loading
media/libmediaplayer2/MediaPlayer2Manager.cpp +8 −6 Original line number Diff line number Diff line Loading @@ -580,7 +580,7 @@ void MediaPlayer2Manager::Client::AudioDeviceUpdatedNotifier::onAudioDeviceUpdat audio_port_handle_t deviceId) { sp<MediaPlayer2Interface> listener = mListener.promote(); if (listener != NULL) { listener->sendEvent(MEDIA2_AUDIO_ROUTING_CHANGED, audioIo, deviceId); listener->sendEvent(0, MEDIA2_AUDIO_ROUTING_CHANGED, audioIo, deviceId); } else { ALOGW("listener for process %d death is gone", MEDIA2_AUDIO_ROUTING_CHANGED); } Loading Loading @@ -1031,7 +1031,8 @@ status_t MediaPlayer2Manager::Client::getParameter(int key, Parcel *reply) { } void MediaPlayer2Manager::Client::notify( const wp<MediaPlayer2Engine> &listener, int msg, int ext1, int ext2, const Parcel *obj) const wp<MediaPlayer2Engine> &listener, int64_t srcId, int msg, int ext1, int ext2, const Parcel *obj) { sp<MediaPlayer2Engine> spListener = listener.promote(); if (spListener == NULL) { Loading Loading @@ -1063,9 +1064,9 @@ void MediaPlayer2Manager::Client::notify( } if (nc != NULL) { if (errStartNext == NO_ERROR) { nc->notify(MEDIA2_INFO, MEDIA2_INFO_STARTED_AS_NEXT, 0, obj); nc->notify(srcId, MEDIA2_INFO, MEDIA2_INFO_STARTED_AS_NEXT, 0, obj); } else { nc->notify(MEDIA2_ERROR, MEDIA2_ERROR_UNKNOWN , 0, obj); nc->notify(srcId, MEDIA2_ERROR, MEDIA2_ERROR_UNKNOWN , 0, obj); ALOGE("gapless:start playback for next track failed, err(%d)", errStartNext); } } Loading @@ -1085,8 +1086,9 @@ void MediaPlayer2Manager::Client::notify( } if (c != NULL) { ALOGV("[%d] notify (%p, %d, %d, %d)", client->mConnId, spListener.get(), msg, ext1, ext2); c->notify(msg, ext1, ext2, obj); ALOGV("[%d] notify (%p, %lld, %d, %d, %d)", client->mConnId, spListener.get(), (long long)srcId, msg, ext1, ext2); c->notify(srcId, msg, ext1, ext2, obj); } } Loading
media/libmediaplayer2/MediaPlayer2Manager.h +2 −2 Original line number Diff line number Diff line Loading @@ -276,8 +276,8 @@ private: virtual status_t setDataSource(const sp<DataSourceDesc> &dsd); static void notify(const wp<MediaPlayer2Engine> &listener, int msg, int ext1, int ext2, const Parcel *obj); static void notify(const wp<MediaPlayer2Engine> &listener, int64_t srcId, int msg, int ext1, int ext2, const Parcel *obj); pid_t pid() const { return mPid; } virtual status_t dump(int fd, const Vector<String16>& args); Loading
media/libmediaplayer2/include/mediaplayer2/MediaPlayer2EngineClient.h +1 −1 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ namespace android { class MediaPlayer2EngineClient: public RefBase { public: virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; virtual void notify(int64_t srcId, int msg, int ext1, int ext2, const Parcel *obj) = 0; }; }; // namespace android Loading
media/libmediaplayer2/include/mediaplayer2/MediaPlayer2Interface.h +3 −3 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ class MediaPlayer2Interface : public AHandler public: // callback mechanism for passing messages to MediaPlayer2 object typedef void (*NotifyCallback)(const wp<MediaPlayer2Engine> &listener, int msg, int ext1, int ext2, const Parcel *obj); int64_t srcId, int msg, int ext1, int ext2, const Parcel *obj); // AudioSink: abstraction layer for audio output class AudioSink : public RefBase { Loading Loading @@ -240,7 +240,7 @@ public: mClient = client; mNotify = notifyFunc; } void sendEvent(int msg, int ext1=0, int ext2=0, void sendEvent(int64_t srcId, int msg, int ext1=0, int ext2=0, const Parcel *obj=NULL) { NotifyCallback notifyCB; wp<MediaPlayer2Engine> client; Loading @@ -250,7 +250,7 @@ public: client = mClient; } if (notifyCB) notifyCB(client, msg, ext1, ext2, obj); if (notifyCB) notifyCB(client, srcId, msg, ext1, ext2, obj); } virtual status_t dump(int /* fd */, const Vector<String16>& /* args */) const { Loading
media/libmediaplayer2/include/mediaplayer2/mediaplayer2.h +6 −3 Original line number Diff line number Diff line Loading @@ -194,7 +194,7 @@ enum media_player2_invoke_ids { class MediaPlayer2Listener: virtual public RefBase { public: virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; virtual void notify(int64_t srcId, int msg, int ext1, int ext2, const Parcel *obj) = 0; }; class MediaPlayer2 : public MediaPlayer2EngineClient Loading @@ -204,6 +204,7 @@ public: ~MediaPlayer2(); void disconnect(); status_t getSrcId(int64_t *srcId); status_t setDataSource(const sp<DataSourceDesc> &dsd); status_t setVideoSurfaceTexture(const sp<ANativeWindowWrapper>& nww); status_t setListener(const sp<MediaPlayer2Listener>& listener); Loading Loading @@ -235,7 +236,8 @@ public: status_t setLooping(int loop); bool isLooping(); status_t setVolume(float leftVolume, float rightVolume); void notify(int msg, int ext1, int ext2, const Parcel *obj = NULL); void notify(int64_t srcId, int msg, int ext1, int ext2, const Parcel *obj = NULL); status_t invoke(const Parcel& request, Parcel *reply); status_t setMetadataFilter(const Parcel& filter); status_t getMetadata(bool update_only, bool apply_filter, Parcel *metadata); Loading @@ -260,11 +262,12 @@ private: status_t seekTo_l(int msec, MediaPlayer2SeekMode mode); status_t prepareAsync_l(); status_t getDuration_l(int *msec); status_t attachNewPlayer(const sp<MediaPlayer2Engine>& player); status_t attachNewPlayer(const sp<MediaPlayer2Engine>& player, long srcId); status_t reset_l(); status_t checkStateForKeySet_l(int key); sp<MediaPlayer2Engine> mPlayer; int64_t mSrcId; thread_id_t mLockThreadId; Mutex mLock; Mutex mNotifyLock; Loading