Remove unused includes and forward declarations in libmediaextractor/include
Test: make checkbuild
Bug: 67908556
Change-Id: If840305af5c043bb8014590eb208cf11c99e61ee
diff --git a/media/extractors/mp4/MPEG4Extractor.h b/media/extractors/mp4/MPEG4Extractor.h
index 8bfecaa..35c5321 100644
--- a/media/extractors/mp4/MPEG4Extractor.h
+++ b/media/extractors/mp4/MPEG4Extractor.h
@@ -22,6 +22,7 @@
#include <media/DataSource.h>
#include <media/MediaExtractor.h>
+#include <media/stagefright/foundation/AString.h>
#include <utils/List.h>
#include <utils/Vector.h>
#include <utils/String8.h>
diff --git a/media/libheif/HeifDecoderImpl.cpp b/media/libheif/HeifDecoderImpl.cpp
index a63a2df..2dfbdca 100644
--- a/media/libheif/HeifDecoderImpl.cpp
+++ b/media/libheif/HeifDecoderImpl.cpp
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <binder/IMemory.h>
+#include <binder/MemoryDealer.h>
#include <drm/drm_framework_common.h>
#include <media/IDataSource.h>
#include <media/mediametadataretriever.h>
diff --git a/media/libmedia/nuplayer2/GenericSource.cpp b/media/libmedia/nuplayer2/GenericSource.cpp
index 6d5b14d..094af7e 100644
--- a/media/libmedia/nuplayer2/GenericSource.cpp
+++ b/media/libmedia/nuplayer2/GenericSource.cpp
@@ -26,6 +26,7 @@
#include <media/DataSource.h>
#include <media/MediaBufferHolder.h>
#include <media/IMediaExtractorService.h>
+#include <media/IMediaSource.h>
#include <media/MediaHTTPService.h>
#include <media/MediaExtractor.h>
#include <media/MediaSource.h>
diff --git a/media/libmedia/nuplayer2/GenericSource.h b/media/libmedia/nuplayer2/GenericSource.h
index 0666d27..5a71edb 100644
--- a/media/libmedia/nuplayer2/GenericSource.h
+++ b/media/libmedia/nuplayer2/GenericSource.h
@@ -33,6 +33,7 @@
struct ARTSPController;
class DataSource;
class IDataSource;
+class IMediaSource;
struct MediaHTTPService;
struct MediaSource;
class MediaBuffer;
diff --git a/media/libmediaextractor/include/media/DataSource.h b/media/libmediaextractor/include/media/DataSource.h
index 44f94a0..9925a21 100644
--- a/media/libmediaextractor/include/media/DataSource.h
+++ b/media/libmediaextractor/include/media/DataSource.h
@@ -19,23 +19,15 @@
#define DATA_SOURCE_H_
#include <sys/types.h>
-#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/MediaErrors.h>
#include <utils/Errors.h>
-#include <utils/KeyedVector.h>
-#include <utils/List.h>
#include <utils/RefBase.h>
#include <utils/threads.h>
#include <drm/DrmManagerClient.h>
namespace android {
-struct AMessage;
-struct AString;
-class IDataSource;
-struct IMediaHTTPService;
class String8;
-struct HTTPBase;
class DataSource : public RefBase {
public:
diff --git a/media/libmediaextractor/include/media/MediaExtractor.h b/media/libmediaextractor/include/media/MediaExtractor.h
index f197b5e..276cbed 100644
--- a/media/libmediaextractor/include/media/MediaExtractor.h
+++ b/media/libmediaextractor/include/media/MediaExtractor.h
@@ -27,10 +27,7 @@
namespace android {
class DataSource;
-class IMediaSource;
-class MediaExtractorFactory;
class MetaData;
-class Parcel;
class String8;
struct AMessage;
struct MediaSource;
diff --git a/media/libmediaextractor/include/media/MediaSource.h b/media/libmediaextractor/include/media/MediaSource.h
index 25d691d..3df9a0d 100644
--- a/media/libmediaextractor/include/media/MediaSource.h
+++ b/media/libmediaextractor/include/media/MediaSource.h
@@ -20,17 +20,13 @@
#include <sys/types.h>
-#include <binder/IMemory.h>
-#include <binder/MemoryDealer.h>
#include <media/stagefright/MediaErrors.h>
#include <media/stagefright/MetaData.h>
#include <utils/RefBase.h>
-#include <utils/Vector.h>
namespace android {
class MediaBuffer;
-class IMediaSource;
struct MediaSource : public virtual RefBase {
MediaSource();
diff --git a/media/libmediaextractor/include/media/stagefright/MediaBuffer.h b/media/libmediaextractor/include/media/stagefright/MediaBuffer.h
index d7e5112..a8f8375 100644
--- a/media/libmediaextractor/include/media/stagefright/MediaBuffer.h
+++ b/media/libmediaextractor/include/media/stagefright/MediaBuffer.h
@@ -30,7 +30,6 @@
namespace android {
struct ABuffer;
-class GraphicBuffer;
class MediaBuffer;
class MediaBufferObserver;
class MetaData;
diff --git a/media/libmediaplayerservice/nuplayer/GenericSource.h b/media/libmediaplayerservice/nuplayer/GenericSource.h
index 856f03b..2406665 100644
--- a/media/libmediaplayerservice/nuplayer/GenericSource.h
+++ b/media/libmediaplayerservice/nuplayer/GenericSource.h
@@ -35,6 +35,7 @@
class IDataSource;
struct IMediaHTTPService;
struct MediaSource;
+class IMediaSource;
class MediaBuffer;
struct MediaClock;
struct NuCachedSource2;
diff --git a/media/libstagefright/include/FrameDecoder.h b/media/libstagefright/include/FrameDecoder.h
index d7c074c..6f07838 100644
--- a/media/libstagefright/include/FrameDecoder.h
+++ b/media/libstagefright/include/FrameDecoder.h
@@ -27,6 +27,7 @@
struct AMessage;
class MediaCodecBuffer;
+class IMediaSource;
class VideoFrame;
struct FrameDecoder {
diff --git a/media/libstagefright/include/HTTPBase.h b/media/libstagefright/include/HTTPBase.h
index 26d7e8a..a924197 100644
--- a/media/libstagefright/include/HTTPBase.h
+++ b/media/libstagefright/include/HTTPBase.h
@@ -21,6 +21,7 @@
#include <media/DataSource.h>
#include <media/stagefright/foundation/ABase.h>
#include <media/stagefright/MediaErrors.h>
+#include <utils/List.h>
#include <utils/threads.h>
namespace android {
diff --git a/media/libstagefright/include/media/stagefright/CallbackMediaSource.h b/media/libstagefright/include/media/stagefright/CallbackMediaSource.h
index 3459de1..944d951 100644
--- a/media/libstagefright/include/media/stagefright/CallbackMediaSource.h
+++ b/media/libstagefright/include/media/stagefright/CallbackMediaSource.h
@@ -22,6 +22,8 @@
namespace android {
+class IMediaSource;
+
// A stagefright MediaSource that wraps a binder IMediaSource.
class CallbackMediaSource : public MediaSource {
public:
diff --git a/media/libstagefright/include/media/stagefright/InterfaceUtils.h b/media/libstagefright/include/media/stagefright/InterfaceUtils.h
index 224c1f1..d449aec 100644
--- a/media/libstagefright/include/media/stagefright/InterfaceUtils.h
+++ b/media/libstagefright/include/media/stagefright/InterfaceUtils.h
@@ -17,13 +17,17 @@
#ifndef INTERFACE_UTILS_H_
#define INTERFACE_UTILS_H_
-#include <media/MediaExtractor.h>
-#include <media/MediaSource.h>
-#include <media/IMediaExtractor.h>
-#include <media/IMediaSource.h>
+#include <utils/RefBase.h>
namespace android {
+class DataSource;
+class MediaExtractor;
+struct MediaSource;
+class IDataSource;
+class IMediaExtractor;
+class IMediaSource;
+
// Creates a DataSource which wraps the given IDataSource object.
sp<DataSource> CreateDataSourceFromIDataSource(const sp<IDataSource> &source);
diff --git a/media/libstagefright/include/media/stagefright/MediaExtractorFactory.h b/media/libstagefright/include/media/stagefright/MediaExtractorFactory.h
index e5c67e1..4610359 100644
--- a/media/libstagefright/include/media/stagefright/MediaExtractorFactory.h
+++ b/media/libstagefright/include/media/stagefright/MediaExtractorFactory.h
@@ -22,6 +22,7 @@
#include <media/IMediaExtractor.h>
#include <media/MediaExtractor.h>
+#include <utils/List.h>
namespace android {
diff --git a/media/libstagefright/include/media/stagefright/RemoteMediaExtractor.h b/media/libstagefright/include/media/stagefright/RemoteMediaExtractor.h
index 2bd71ee..bdbad7a 100644
--- a/media/libstagefright/include/media/stagefright/RemoteMediaExtractor.h
+++ b/media/libstagefright/include/media/stagefright/RemoteMediaExtractor.h
@@ -19,6 +19,7 @@
#include <media/IMediaExtractor.h>
#include <media/MediaExtractor.h>
+#include <media/stagefright/foundation/ABase.h>
namespace android {
diff --git a/media/libstagefright/mpeg2ts/ATSParser.cpp b/media/libstagefright/mpeg2ts/ATSParser.cpp
index 464ee90..cb75185 100644
--- a/media/libstagefright/mpeg2ts/ATSParser.cpp
+++ b/media/libstagefright/mpeg2ts/ATSParser.cpp
@@ -23,6 +23,8 @@
#include "ESQueue.h"
#include <android/hardware/cas/native/1.0/IDescrambler.h>
+#include <binder/IMemory.h>
+#include <binder/MemoryDealer.h>
#include <cutils/native_handle.h>
#include <media/stagefright/foundation/ABitReader.h>
#include <media/stagefright/foundation/ABuffer.h>