Loading include/media/stagefright/MediaCodec.h +9 −5 Original line number Diff line number Diff line Loading @@ -61,11 +61,15 @@ struct MediaCodec : public AHandler { CB_RESOURCE_RECLAIMED = 5, }; static const pid_t kNoPid = -1; static sp<MediaCodec> CreateByType( const sp<ALooper> &looper, const char *mime, bool encoder, status_t *err = NULL); const sp<ALooper> &looper, const char *mime, bool encoder, status_t *err = NULL, pid_t pid = kNoPid); static sp<MediaCodec> CreateByComponentName( const sp<ALooper> &looper, const char *name, status_t *err = NULL); const sp<ALooper> &looper, const char *name, status_t *err = NULL, pid_t pid = kNoPid); static sp<PersistentSurface> CreatePersistentInputSurface(); Loading Loading @@ -251,7 +255,7 @@ private: }; struct ResourceManagerServiceProxy : public IBinder::DeathRecipient { ResourceManagerServiceProxy(); ResourceManagerServiceProxy(pid_t pid); ~ResourceManagerServiceProxy(); void init(); Loading @@ -271,7 +275,7 @@ private: private: Mutex mLock; sp<IResourceManagerService> mService; int mPid; pid_t mPid; }; State mState; Loading Loading @@ -333,7 +337,7 @@ private: bool mHaveInputSurface; bool mHavePendingInputBuffers; MediaCodec(const sp<ALooper> &looper); MediaCodec(const sp<ALooper> &looper, pid_t pid); static status_t PostAndAwaitResponse( const sp<AMessage> &msg, sp<AMessage> *response); Loading media/libmediaplayerservice/MediaPlayerFactory.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -135,7 +135,8 @@ player_type MediaPlayerFactory::getPlayerType(const sp<IMediaPlayer>& client, sp<MediaPlayerBase> MediaPlayerFactory::createPlayer( player_type playerType, void* cookie, notify_callback_f notifyFunc) { notify_callback_f notifyFunc, pid_t pid) { sp<MediaPlayerBase> p; IFactory* factory; status_t init_result; Loading @@ -149,7 +150,7 @@ sp<MediaPlayerBase> MediaPlayerFactory::createPlayer( factory = sFactoryMap.valueFor(playerType); CHECK(NULL != factory); p = factory->createPlayer(); p = factory->createPlayer(pid); if (p == NULL) { ALOGE("Failed to create player object of type %d, create failed", Loading Loading @@ -217,7 +218,7 @@ class StagefrightPlayerFactory : return 0.0; } virtual sp<MediaPlayerBase> createPlayer() { virtual sp<MediaPlayerBase> createPlayer(pid_t /* pid */) { ALOGV(" create StagefrightPlayer"); return new StagefrightPlayer(); } Loading Loading @@ -279,9 +280,9 @@ class NuPlayerFactory : public MediaPlayerFactory::IFactory { return 1.0; } virtual sp<MediaPlayerBase> createPlayer() { virtual sp<MediaPlayerBase> createPlayer(pid_t pid) { ALOGV(" create NuPlayer"); return new NuPlayerDriver; return new NuPlayerDriver(pid); } }; Loading @@ -297,7 +298,7 @@ class TestPlayerFactory : public MediaPlayerFactory::IFactory { return 0.0; } virtual sp<MediaPlayerBase> createPlayer() { virtual sp<MediaPlayerBase> createPlayer(pid_t /* pid */) { ALOGV("Create Test Player stub"); return new TestPlayerStub(); } Loading media/libmediaplayerservice/MediaPlayerFactory.h +3 −2 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ class MediaPlayerFactory { const sp<DataSource> &/*source*/, float /*curScore*/) { return 0.0; } virtual sp<MediaPlayerBase> createPlayer() = 0; virtual sp<MediaPlayerBase> createPlayer(pid_t pid) = 0; }; static status_t registerFactory(IFactory* factory, Loading @@ -66,7 +66,8 @@ class MediaPlayerFactory { static sp<MediaPlayerBase> createPlayer(player_type playerType, void* cookie, notify_callback_f notifyFunc); notify_callback_f notifyFunc, pid_t pid); static void registerBuiltinFactories(); Loading media/libmediaplayerservice/MediaPlayerService.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -633,7 +633,7 @@ sp<MediaPlayerBase> MediaPlayerService::Client::createPlayer(player_type playerT p.clear(); } if (p == NULL) { p = MediaPlayerFactory::createPlayer(playerType, this, notify); p = MediaPlayerFactory::createPlayer(playerType, this, notify, mPid); } if (p != NULL) { Loading media/libmediaplayerservice/nuplayer/NuPlayer.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -166,8 +166,9 @@ private: //////////////////////////////////////////////////////////////////////////////// NuPlayer::NuPlayer() NuPlayer::NuPlayer(pid_t pid) : mUIDValid(false), mPID(pid), mSourceFlags(0), mOffloadAudio(false), mAudioDecoderGeneration(0), Loading Loading @@ -1525,7 +1526,7 @@ status_t NuPlayer::instantiateDecoder(bool audio, sp<DecoderBase> *decoder) { format->setInt32("has-video", hasVideo); *decoder = new DecoderPassThrough(notify, mSource, mRenderer); } else { *decoder = new Decoder(notify, mSource, mRenderer); *decoder = new Decoder(notify, mSource, mPID, mRenderer); } } else { sp<AMessage> notify = new AMessage(kWhatVideoNotify, this); Loading @@ -1533,7 +1534,7 @@ status_t NuPlayer::instantiateDecoder(bool audio, sp<DecoderBase> *decoder) { notify->setInt32("generation", mVideoDecoderGeneration); *decoder = new Decoder( notify, mSource, mRenderer, mSurface, mCCDecoder); notify, mSource, mPID, mRenderer, mSurface, mCCDecoder); // enable FRC if high-quality AV sync is requested, even if not // directly queuing to display, as this will even improve textureview Loading Loading
include/media/stagefright/MediaCodec.h +9 −5 Original line number Diff line number Diff line Loading @@ -61,11 +61,15 @@ struct MediaCodec : public AHandler { CB_RESOURCE_RECLAIMED = 5, }; static const pid_t kNoPid = -1; static sp<MediaCodec> CreateByType( const sp<ALooper> &looper, const char *mime, bool encoder, status_t *err = NULL); const sp<ALooper> &looper, const char *mime, bool encoder, status_t *err = NULL, pid_t pid = kNoPid); static sp<MediaCodec> CreateByComponentName( const sp<ALooper> &looper, const char *name, status_t *err = NULL); const sp<ALooper> &looper, const char *name, status_t *err = NULL, pid_t pid = kNoPid); static sp<PersistentSurface> CreatePersistentInputSurface(); Loading Loading @@ -251,7 +255,7 @@ private: }; struct ResourceManagerServiceProxy : public IBinder::DeathRecipient { ResourceManagerServiceProxy(); ResourceManagerServiceProxy(pid_t pid); ~ResourceManagerServiceProxy(); void init(); Loading @@ -271,7 +275,7 @@ private: private: Mutex mLock; sp<IResourceManagerService> mService; int mPid; pid_t mPid; }; State mState; Loading Loading @@ -333,7 +337,7 @@ private: bool mHaveInputSurface; bool mHavePendingInputBuffers; MediaCodec(const sp<ALooper> &looper); MediaCodec(const sp<ALooper> &looper, pid_t pid); static status_t PostAndAwaitResponse( const sp<AMessage> &msg, sp<AMessage> *response); Loading
media/libmediaplayerservice/MediaPlayerFactory.cpp +7 −6 Original line number Diff line number Diff line Loading @@ -135,7 +135,8 @@ player_type MediaPlayerFactory::getPlayerType(const sp<IMediaPlayer>& client, sp<MediaPlayerBase> MediaPlayerFactory::createPlayer( player_type playerType, void* cookie, notify_callback_f notifyFunc) { notify_callback_f notifyFunc, pid_t pid) { sp<MediaPlayerBase> p; IFactory* factory; status_t init_result; Loading @@ -149,7 +150,7 @@ sp<MediaPlayerBase> MediaPlayerFactory::createPlayer( factory = sFactoryMap.valueFor(playerType); CHECK(NULL != factory); p = factory->createPlayer(); p = factory->createPlayer(pid); if (p == NULL) { ALOGE("Failed to create player object of type %d, create failed", Loading Loading @@ -217,7 +218,7 @@ class StagefrightPlayerFactory : return 0.0; } virtual sp<MediaPlayerBase> createPlayer() { virtual sp<MediaPlayerBase> createPlayer(pid_t /* pid */) { ALOGV(" create StagefrightPlayer"); return new StagefrightPlayer(); } Loading Loading @@ -279,9 +280,9 @@ class NuPlayerFactory : public MediaPlayerFactory::IFactory { return 1.0; } virtual sp<MediaPlayerBase> createPlayer() { virtual sp<MediaPlayerBase> createPlayer(pid_t pid) { ALOGV(" create NuPlayer"); return new NuPlayerDriver; return new NuPlayerDriver(pid); } }; Loading @@ -297,7 +298,7 @@ class TestPlayerFactory : public MediaPlayerFactory::IFactory { return 0.0; } virtual sp<MediaPlayerBase> createPlayer() { virtual sp<MediaPlayerBase> createPlayer(pid_t /* pid */) { ALOGV("Create Test Player stub"); return new TestPlayerStub(); } Loading
media/libmediaplayerservice/MediaPlayerFactory.h +3 −2 Original line number Diff line number Diff line Loading @@ -47,7 +47,7 @@ class MediaPlayerFactory { const sp<DataSource> &/*source*/, float /*curScore*/) { return 0.0; } virtual sp<MediaPlayerBase> createPlayer() = 0; virtual sp<MediaPlayerBase> createPlayer(pid_t pid) = 0; }; static status_t registerFactory(IFactory* factory, Loading @@ -66,7 +66,8 @@ class MediaPlayerFactory { static sp<MediaPlayerBase> createPlayer(player_type playerType, void* cookie, notify_callback_f notifyFunc); notify_callback_f notifyFunc, pid_t pid); static void registerBuiltinFactories(); Loading
media/libmediaplayerservice/MediaPlayerService.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -633,7 +633,7 @@ sp<MediaPlayerBase> MediaPlayerService::Client::createPlayer(player_type playerT p.clear(); } if (p == NULL) { p = MediaPlayerFactory::createPlayer(playerType, this, notify); p = MediaPlayerFactory::createPlayer(playerType, this, notify, mPid); } if (p != NULL) { Loading
media/libmediaplayerservice/nuplayer/NuPlayer.cpp +4 −3 Original line number Diff line number Diff line Loading @@ -166,8 +166,9 @@ private: //////////////////////////////////////////////////////////////////////////////// NuPlayer::NuPlayer() NuPlayer::NuPlayer(pid_t pid) : mUIDValid(false), mPID(pid), mSourceFlags(0), mOffloadAudio(false), mAudioDecoderGeneration(0), Loading Loading @@ -1525,7 +1526,7 @@ status_t NuPlayer::instantiateDecoder(bool audio, sp<DecoderBase> *decoder) { format->setInt32("has-video", hasVideo); *decoder = new DecoderPassThrough(notify, mSource, mRenderer); } else { *decoder = new Decoder(notify, mSource, mRenderer); *decoder = new Decoder(notify, mSource, mPID, mRenderer); } } else { sp<AMessage> notify = new AMessage(kWhatVideoNotify, this); Loading @@ -1533,7 +1534,7 @@ status_t NuPlayer::instantiateDecoder(bool audio, sp<DecoderBase> *decoder) { notify->setInt32("generation", mVideoDecoderGeneration); *decoder = new Decoder( notify, mSource, mRenderer, mSurface, mCCDecoder); notify, mSource, mPID, mRenderer, mSurface, mCCDecoder); // enable FRC if high-quality AV sync is requested, even if not // directly queuing to display, as this will even improve textureview Loading