NuPlayer: Notify if drain message time is unexpectedly long

Bug: 27940058
Change-Id: Id8897c30e21b6b9de545a710e7766ffceb491455
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index eaaef4a..69232b7 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -333,6 +333,10 @@
      */
             ssize_t     getBufferSizeInFrames();
 
+    /* Returns the buffer duration in microseconds at current playback rate.
+     */
+            status_t    getBufferDurationInUs(int64_t *duration);
+
     /* Set the effective size of audio buffer that an application writes to.
      * This is used to determine the amount of available room in the buffer,
      * which determines when a write will block.
diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h
index 54862d1..4977efd 100644
--- a/include/media/MediaPlayerInterface.h
+++ b/include/media/MediaPlayerInterface.h
@@ -104,6 +104,7 @@
         virtual audio_session_t getSessionId() const = 0;
         virtual audio_stream_type_t getAudioStreamType() const = 0;
         virtual uint32_t    getSampleRate() const = 0;
+        virtual int64_t     getBufferDurationInUs() const = 0;
 
         // If no callback is specified, use the "write" API below to submit
         // audio data.