Remove libmedia and libstagefright dependency from extractors

- MediaSource, DataSource and MediaExtractor are moved to
  libmediaextractor so that they can be used by extractor
  implementations without depending on libmedia and libstagefright.
- XXXFactory classes has been added in order not to expose CreateXXX
  methods in libmediaextractor.
- avc_utils is moved to libstagefright_foundation since most of
  extractor implementations are relying on that.

Test: build + post submit media CTS tests
Bug: 65851881
Change-Id: I7d5cf18dd25abc10478ac3f6e7d1828ad023e3fb
diff --git a/media/extractors/mp3/Android.bp b/media/extractors/mp3/Android.bp
index 4618a0d..6912ef1 100644
--- a/media/extractors/mp3/Android.bp
+++ b/media/extractors/mp3/Android.bp
@@ -12,8 +12,7 @@
 
     shared_libs: [
         "liblog",
-        "libmedia",
-        "libstagefright",
+        "libmediaextractor",
         "libstagefright_foundation",
         "libutils",
     ],
diff --git a/media/extractors/mp3/MP3Extractor.cpp b/media/extractors/mp3/MP3Extractor.cpp
index 10ebda8..2731f0f 100644
--- a/media/extractors/mp3/MP3Extractor.cpp
+++ b/media/extractors/mp3/MP3Extractor.cpp
@@ -20,20 +20,20 @@
 
 #include "MP3Extractor.h"
 
-#include "avc_utils.h"
 #include "ID3.h"
 #include "VBRISeeker.h"
 #include "XINGSeeker.h"
 
+#include <media/DataSource.h>
+#include <media/MediaSource.h>
 #include <media/stagefright/foundation/ADebug.h>
 #include <media/stagefright/foundation/AMessage.h>
+#include <media/stagefright/foundation/avc_utils.h>
 #include <media/stagefright/foundation/ByteUtils.h>
-#include <media/stagefright/DataSource.h>
 #include <media/stagefright/MediaBuffer.h>
 #include <media/stagefright/MediaBufferGroup.h>
 #include <media/stagefright/MediaDefs.h>
 #include <media/stagefright/MediaErrors.h>
-#include <media/stagefright/MediaSource.h>
 #include <media/stagefright/MetaData.h>
 #include <utils/String8.h>
 
diff --git a/media/extractors/mp3/MP3Extractor.h b/media/extractors/mp3/MP3Extractor.h
index 2b16c24..f0ab6b0 100644
--- a/media/extractors/mp3/MP3Extractor.h
+++ b/media/extractors/mp3/MP3Extractor.h
@@ -19,7 +19,7 @@
 #define MP3_EXTRACTOR_H_
 
 #include <utils/Errors.h>
-#include <media/stagefright/MediaExtractor.h>
+#include <media/MediaExtractor.h>
 
 namespace android {
 
diff --git a/media/extractors/mp3/VBRISeeker.cpp b/media/extractors/mp3/VBRISeeker.cpp
index 42cebfe..e7db6fd 100644
--- a/media/extractors/mp3/VBRISeeker.cpp
+++ b/media/extractors/mp3/VBRISeeker.cpp
@@ -23,11 +23,11 @@
 
 #include "VBRISeeker.h"
 
-#include "avc_utils.h"
+#include <media/stagefright/foundation/avc_utils.h>
 
 #include <media/stagefright/foundation/ADebug.h>
 #include <media/stagefright/foundation/ByteUtils.h>
-#include <media/stagefright/DataSource.h>
+#include <media/DataSource.h>
 
 namespace android {
 
diff --git a/media/extractors/mp3/XINGSeeker.cpp b/media/extractors/mp3/XINGSeeker.cpp
index 2be62bf..fa59701 100644
--- a/media/extractors/mp3/XINGSeeker.cpp
+++ b/media/extractors/mp3/XINGSeeker.cpp
@@ -18,10 +18,10 @@
 #include <utils/Log.h>
 
 #include "XINGSeeker.h"
-#include "avc_utils.h"
+#include <media/stagefright/foundation/avc_utils.h>
 
 #include <media/stagefright/foundation/ByteUtils.h>
-#include <media/stagefright/DataSource.h>
+#include <media/DataSource.h>
 
 namespace android {