Abstract away access to audio streams HAL in AudioFlinger

In this CL all direct access to audio_stream_t, audio_stream_out_t, and
audio_stream_in_t their functions is encapsulated within the new
hierarchy of Stream[In|Out]HalLocal classes.  AudioFlinger uses
interface classes Stream[In|Out]HalInterface to access these functions.

Note that NBAIO still receives raw HAL stream handles and needs to be
converted separately.

Bug: 30222631
Test: manual with Loopback app

Change-Id: I6388cfa2006791c9c0aa7bb186719209726a2d48
diff --git a/services/audioflinger/AudioStreamOut.h b/services/audioflinger/AudioStreamOut.h
index d132f6f..b16b1af 100644
--- a/services/audioflinger/AudioStreamOut.h
+++ b/services/audioflinger/AudioStreamOut.h
@@ -27,6 +27,7 @@
 
 class AudioHwDevice;
 class DeviceHalInterface;
+class StreamOutHalInterface;
 
 /**
  * Managed access to a HAL output stream.
@@ -37,7 +38,7 @@
 // For emphasis, we could also make all pointers to them be "const *",
 // but that would clutter the code unnecessarily.
     AudioHwDevice * const audioHwDev;
-    audio_stream_out_t *stream;
+    sp<StreamOutHalInterface> stream;
     const audio_output_flags_t flags;
 
     sp<DeviceHalInterface> hwDev() const;
@@ -50,7 +51,7 @@
             struct audio_config *config,
             const char *address);
 
-    virtual ~AudioStreamOut() { }
+    virtual ~AudioStreamOut();
 
     // Get the bottom 32-bits of the 64-bit render position.
     status_t getRenderPosition(uint32_t *frames);