diff options
| author | Andreas Huber <andih@google.com> | 2012-10-03 10:16:58 -0700 | 
|---|---|---|
| committer | Andreas Huber <andih@google.com> | 2012-10-03 10:16:58 -0700 | 
| commit | 575a5361fc970476cd7979638ee3ac00cc6e5024 (patch) | |
| tree | 4dfdda910405a6d40d50c52119c86d0853fd3587 /include | |
| parent | 8d16bbc5a354d302abfd912b8d88d9c7feb3948f (diff) | |
| download | frameworks_av-575a5361fc970476cd7979638ee3ac00cc6e5024.zip frameworks_av-575a5361fc970476cd7979638ee3ac00cc6e5024.tar.gz frameworks_av-575a5361fc970476cd7979638ee3ac00cc6e5024.tar.bz2  | |
Better power savings with wifi display code.
No more polling the encoder for work to do, the encoder instead notifies
if there's activity.
Change-Id: Ia707211b4f5c5a6e6b70d750233d204a2d6bb778
related-to-bug: 7248248
Diffstat (limited to 'include')
| -rw-r--r-- | include/media/stagefright/MediaCodec.h | 42 | 
1 files changed, 26 insertions, 16 deletions
diff --git a/include/media/stagefright/MediaCodec.h b/include/media/stagefright/MediaCodec.h index 8c612d4..cacfa54 100644 --- a/include/media/stagefright/MediaCodec.h +++ b/include/media/stagefright/MediaCodec.h @@ -108,6 +108,11 @@ struct MediaCodec : public AHandler {      status_t requestIDRFrame(); +    // Notification will be posted once there "is something to do", i.e. +    // an input/output buffer has become available, a format change is +    // pending, an error is pending. +    void requestActivityNotification(const sp<AMessage> ¬ify); +  protected:      virtual ~MediaCodec();      virtual void onMessageReceived(const sp<AMessage> &msg); @@ -132,22 +137,23 @@ private:      };      enum { -        kWhatInit                       = 'init', -        kWhatConfigure                  = 'conf', -        kWhatStart                      = 'strt', -        kWhatStop                       = 'stop', -        kWhatRelease                    = 'rele', -        kWhatDequeueInputBuffer         = 'deqI', -        kWhatQueueInputBuffer           = 'queI', -        kWhatDequeueOutputBuffer        = 'deqO', -        kWhatReleaseOutputBuffer        = 'relO', -        kWhatGetBuffers                 = 'getB', -        kWhatFlush                      = 'flus', -        kWhatGetOutputFormat            = 'getO', -        kWhatDequeueInputTimedOut       = 'dITO', -        kWhatDequeueOutputTimedOut      = 'dOTO', -        kWhatCodecNotify                = 'codc', -        kWhatRequestIDRFrame            = 'ridr', +        kWhatInit                           = 'init', +        kWhatConfigure                      = 'conf', +        kWhatStart                          = 'strt', +        kWhatStop                           = 'stop', +        kWhatRelease                        = 'rele', +        kWhatDequeueInputBuffer             = 'deqI', +        kWhatQueueInputBuffer               = 'queI', +        kWhatDequeueOutputBuffer            = 'deqO', +        kWhatReleaseOutputBuffer            = 'relO', +        kWhatGetBuffers                     = 'getB', +        kWhatFlush                          = 'flus', +        kWhatGetOutputFormat                = 'getO', +        kWhatDequeueInputTimedOut           = 'dITO', +        kWhatDequeueOutputTimedOut          = 'dOTO', +        kWhatCodecNotify                    = 'codc', +        kWhatRequestIDRFrame                = 'ridr', +        kWhatRequestActivityNotification    = 'racN',      };      enum { @@ -191,6 +197,8 @@ private:      List<sp<ABuffer> > mCSD; +    sp<AMessage> mActivityNotify; +      MediaCodec(const sp<ALooper> &looper);      static status_t PostAndAwaitResponse( @@ -216,6 +224,8 @@ private:      status_t setNativeWindow(              const sp<SurfaceTextureClient> &surfaceTextureClient); +    void postActivityNotificationIfPossible(); +      DISALLOW_EVIL_CONSTRUCTORS(MediaCodec);  };  | 
