From 68845c14ebf2c7282800b1abffde38d8e9a57aab Mon Sep 17 00:00:00 2001 From: Ronghua Wu Date: Tue, 21 Jul 2015 09:50:48 -0700 Subject: libmediaplayerservice: propagate caller pid to MediaCodec. Bug: 22630317 Change-Id: I0337d74f4ef04bf96f2de83f33d98d0d7da47c12 --- include/media/stagefright/MediaCodec.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/media/stagefright/MediaCodec.h b/include/media/stagefright/MediaCodec.h index b621b9c..c10963d 100644 --- a/include/media/stagefright/MediaCodec.h +++ b/include/media/stagefright/MediaCodec.h @@ -61,11 +61,15 @@ struct MediaCodec : public AHandler { CB_RESOURCE_RECLAIMED = 5, }; + static const pid_t kNoPid = -1; + static sp CreateByType( - const sp &looper, const char *mime, bool encoder, status_t *err = NULL); + const sp &looper, const char *mime, bool encoder, status_t *err = NULL, + pid_t pid = kNoPid); static sp CreateByComponentName( - const sp &looper, const char *name, status_t *err = NULL); + const sp &looper, const char *name, status_t *err = NULL, + pid_t pid = kNoPid); static sp CreatePersistentInputSurface(); @@ -251,7 +255,7 @@ private: }; struct ResourceManagerServiceProxy : public IBinder::DeathRecipient { - ResourceManagerServiceProxy(); + ResourceManagerServiceProxy(pid_t pid); ~ResourceManagerServiceProxy(); void init(); @@ -271,7 +275,7 @@ private: private: Mutex mLock; sp mService; - int mPid; + pid_t mPid; }; State mState; @@ -333,7 +337,7 @@ private: bool mHaveInputSurface; bool mHavePendingInputBuffers; - MediaCodec(const sp &looper); + MediaCodec(const sp &looper, pid_t pid); static status_t PostAndAwaitResponse( const sp &msg, sp *response); -- cgit v1.1