Split datasource out of libstagefright

into libdatasource, which contains:
  DataSourceFactory
  (Clear)FileSource
  (Clear)MediaHTTP
  DataURISource
  HTTPBase
  NuCachedSource2

This is needed to break a circular dependency in an upcoming CL.

Test: build, boot

Change-Id: I34d9937235c78f18f51b18945342a0743e209577
Merged-In: I34d9937235c78f18f51b18945342a0743e209577
gugelfrei
Marco Nelissen 5 years ago
parent 58ae37b5b3
commit fa8be7d237

@ -10,7 +10,7 @@ LOCAL_SRC_FILES:= \
LOCAL_SHARED_LIBRARIES := \
libstagefright libmedia libmedia_omx libutils libbinder \
libstagefright_foundation libjpeg libui libgui libcutils liblog \
libhidlbase \
libhidlbase libdatasource \
android.hardware.media.omx@1.0 \
LOCAL_C_INCLUDES:= \
@ -36,7 +36,7 @@ LOCAL_SRC_FILES:= \
LOCAL_SHARED_LIBRARIES := \
libstagefright libmedia liblog libutils libbinder \
libstagefright_foundation
libstagefright_foundation libdatasource
LOCAL_C_INCLUDES:= \
frameworks/av/camera/include \
@ -111,7 +111,7 @@ LOCAL_SRC_FILES:= \
LOCAL_SHARED_LIBRARIES := \
libstagefright liblog libutils libbinder libui libgui \
libstagefright_foundation libmedia libcutils
libstagefright_foundation libmedia libcutils libdatasource
LOCAL_C_INCLUDES:= \
frameworks/av/media/libstagefright \

@ -17,12 +17,12 @@
#include "SineSource.h"
#include <binder/ProcessState.h>
#include <datasource/FileSource.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/ALooper.h>
#include <media/stagefright/foundation/AMessage.h>
#include <media/stagefright/AudioPlayer.h>
#include <media/stagefright/CameraSource.h>
#include <media/stagefright/FileSource.h>
#include <media/stagefright/MediaBufferGroup.h>
#include <media/stagefright/MediaDefs.h>
#include <media/stagefright/MediaCodecSource.h>

@ -31,6 +31,7 @@
#include <binder/IServiceManager.h>
#include <binder/ProcessState.h>
#include <datasource/DataSourceFactory.h>
#include <media/DataSource.h>
#include <media/MediaSource.h>
#include <media/IMediaHTTPService.h>
@ -39,9 +40,7 @@
#include <media/stagefright/foundation/ALooper.h>
#include <media/stagefright/foundation/AMessage.h>
#include <media/stagefright/foundation/AUtils.h>
#include "include/NuCachedSource2.h"
#include <media/stagefright/AudioPlayer.h>
#include <media/stagefright/DataSourceFactory.h>
#include <media/stagefright/JPEGSource.h>
#include <media/stagefright/InterfaceUtils.h>
#include <media/stagefright/MediaCodec.h>

@ -21,6 +21,7 @@
#include <binder/ProcessState.h>
#include <cutils/properties.h> // for property_get
#include <datasource/DataSourceFactory.h>
#include <media/DataSource.h>
#include <media/IMediaHTTPService.h>
#include <media/IStreamSource.h>
@ -28,7 +29,6 @@
#include <media/MediaSource.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/AMessage.h>
#include <media/stagefright/DataSourceFactory.h>
#include <media/stagefright/InterfaceUtils.h>
#include <media/stagefright/MPEG2TSWriter.h>
#include <media/stagefright/MediaExtractor.h>

@ -17,6 +17,7 @@ cc_binary {
"libbase",
"libbinder",
"libcutils",
"libdatasource",
"libgui",
"liblog",
"libstagefright",

@ -30,6 +30,7 @@
#include <binder/IServiceManager.h>
#include <binder/ProcessState.h>
#include <datasource/DataSourceFactory.h>
#include <media/DataSource.h>
#include <mediadrm/ICrypto.h>
#include <media/IMediaHTTPService.h>
@ -38,7 +39,6 @@
#include <media/stagefright/foundation/ALooper.h>
#include <media/stagefright/foundation/AMessage.h>
#include <media/stagefright/foundation/AUtils.h>
#include <media/stagefright/DataSourceFactory.h>
#include <media/stagefright/MediaDefs.h>
#include <media/stagefright/MediaErrors.h>
#include <media/stagefright/MediaExtractorFactory.h>

@ -0,0 +1,66 @@
cc_library {
name: "libdatasource",
srcs: [
"ClearFileSource.cpp",
"ClearMediaHTTP.cpp",
"DataSourceFactory.cpp",
"DataURISource.cpp",
"FileSource.cpp",
"HTTPBase.cpp",
"MediaHTTP.cpp",
"NuCachedSource2.cpp",
],
aidl: {
local_include_dirs: ["aidl"],
export_aidl_headers: true,
},
header_libs: [
"libstagefright_headers",
"media_ndk_headers",
"libmedia_headers",
],
export_header_lib_headers: [
"libstagefright_headers",
"media_ndk_headers",
],
shared_libs: [
"liblog",
"libcutils",
"libdrmframework",
"libutils",
"libstagefright_foundation",
"libdl",
],
static_libs: [
"libc_malloc_debug_backtrace", // for memory heap analysis
"libmedia_midiiowrapper",
],
local_include_dirs: [
"include",
],
export_include_dirs: [
"include",
],
cflags: [
"-Werror",
"-Wno-error=deprecated-declarations",
"-Wall",
],
sanitize: {
misc_undefined: [
"unsigned-integer-overflow",
"signed-integer-overflow",
],
cfi: true,
},
}

@ -18,9 +18,9 @@
#define LOG_TAG "ClearFileSource"
#include <utils/Log.h>
#include <datasource/ClearFileSource.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/ClearFileSource.h>
#include <media/stagefright/Utils.h>
#include <media/stagefright/FoundationUtils.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/types.h>

@ -18,11 +18,11 @@
#define LOG_TAG "ClearMediaHTTP"
#include <utils/Log.h>
#include <media/stagefright/ClearMediaHTTP.h>
#include <datasource/ClearMediaHTTP.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/ALooper.h>
#include <media/stagefright/Utils.h>
#include <media/stagefright/FoundationUtils.h>
#include <media/MediaHTTPConnection.h>

@ -16,15 +16,15 @@
//#define LOG_NDEBUG 0
#define LOG_TAG "DataSource"
#include "include/HTTPBase.h"
#include "include/NuCachedSource2.h"
#include <datasource/DataSourceFactory.h>
#include <datasource/DataURISource.h>
#include <datasource/HTTPBase.h>
#include <datasource/FileSource.h>
#include <datasource/MediaHTTP.h>
#include <datasource/NuCachedSource2.h>
#include <media/MediaHTTPConnection.h>
#include <media/MediaHTTPService.h>
#include <media/stagefright/DataSourceFactory.h>
#include <media/stagefright/DataURISource.h>
#include <media/stagefright/FileSource.h>
#include <media/stagefright/MediaHTTP.h>
#include <utils/String8.h>
namespace android {

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <media/stagefright/DataURISource.h>
#include <datasource/DataURISource.h>
#include <media/stagefright/foundation/ABuffer.h>
#include <media/stagefright/foundation/AString.h>

@ -18,9 +18,8 @@
#define LOG_TAG "FileSource"
#include <utils/Log.h>
#include <datasource/FileSource.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/FileSource.h>
#include <media/stagefright/Utils.h>
#include <private/android_filesystem_config.h>
namespace android {

@ -18,7 +18,7 @@
#define LOG_TAG "HTTPBase"
#include <utils/Log.h>
#include "include/HTTPBase.h"
#include <datasource/HTTPBase.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/ALooper.h>

@ -18,12 +18,12 @@
#define LOG_TAG "MediaHTTP"
#include <utils/Log.h>
#include <media/stagefright/MediaHTTP.h>
#include <datasource/MediaHTTP.h>
#include <binder/IServiceManager.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/ALooper.h>
#include <media/stagefright/Utils.h>
#include <media/stagefright/FoundationUtils.h>
#include <media/MediaHTTPConnection.h>

@ -20,8 +20,8 @@
#define LOG_TAG "NuCachedSource2"
#include <utils/Log.h>
#include "include/NuCachedSource2.h"
#include "include/HTTPBase.h"
#include <datasource/NuCachedSource2.h>
#include <datasource/HTTPBase.h>
#include <cutils/properties.h>
#include <media/stagefright/foundation/ADebug.h>

@ -20,7 +20,7 @@
#include <media/stagefright/foundation/AString.h>
#include "include/HTTPBase.h"
#include "HTTPBase.h"
namespace android {

@ -18,7 +18,9 @@
#define DATA_SOURCE_FACTORY_H_
#include <media/DataSource.h>
#include <sys/types.h>
#include <utils/KeyedVector.h>
#include <utils/RefBase.h>
namespace android {

@ -20,7 +20,7 @@
#include <stdio.h>
#include <media/stagefright/ClearFileSource.h>
#include <datasource/ClearFileSource.h>
#include <media/stagefright/MediaErrors.h>
#include <utils/threads.h>
#include <drm/DrmManagerClient.h>

@ -18,8 +18,8 @@
#define MEDIA_HTTP_H_
#include <datasource/ClearMediaHTTP.h>
#include <media/stagefright/foundation/AString.h>
#include <media/stagefright/ClearMediaHTTP.h>
namespace android {

@ -21,6 +21,7 @@ cc_library_shared {
"libcodec2_client",
"libcrypto",
"libcutils",
"libdatasource",
"libdl",
"libgui",
"libhidlbase",

@ -20,9 +20,9 @@
#include <utils/Log.h>
#include <cutils/properties.h>
#include <datasource/FileSource.h>
#include <media/DataSource.h>
#include <media/IMediaPlayer.h>
#include <media/stagefright/FileSource.h>
#include <media/stagefright/foundation/ADebug.h>
#include <utils/Errors.h>
#include <utils/misc.h>

@ -48,6 +48,7 @@
#include <utils/Vector.h>
#include <codec2/hidl/client.h>
#include <datasource/HTTPBase.h>
#include <media/IMediaHTTPService.h>
#include <media/IRemoteDisplay.h>
#include <media/IRemoteDisplayClient.h>
@ -61,6 +62,7 @@
#include <media/stagefright/MediaCodecList.h>
#include <media/stagefright/MediaErrors.h>
#include <media/stagefright/Utils.h>
#include <media/stagefright/FoundationUtils.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/ALooperRoster.h>
#include <media/stagefright/SurfaceUtils.h>
@ -80,7 +82,6 @@
#include "TestPlayerStub.h"
#include "nuplayer/NuPlayerDriver.h"
#include "HTTPBase.h"
static const int kDumpLockRetries = 50;
static const int kDumpLockSleepUs = 20000;

@ -37,6 +37,7 @@
#include <media/MediaPlayerInterface.h>
#include <media/stagefright/InterfaceUtils.h>
#include <media/stagefright/Utils.h>
#include <media/stagefright/FoundationUtils.h>
#include <private/media/VideoFrame.h>
#include "MetadataRetrieverClient.h"
#include "StagefrightMetadataRetriever.h"

@ -46,6 +46,7 @@ cc_library_static {
shared_libs: [
"libbinder",
"libdatasource",
"libui",
"libgui",
"libmedia",

@ -23,6 +23,10 @@
#include "AnotherPacketSource.h"
#include <binder/IServiceManager.h>
#include <cutils/properties.h>
#include <datasource/DataSourceFactory.h>
#include <datasource/FileSource.h>
#include <datasource/HTTPBase.h>
#include <datasource/NuCachedSource2.h>
#include <media/DataSource.h>
#include <media/MediaBufferHolder.h>
#include <media/MediaSource.h>
@ -31,8 +35,6 @@
#include <media/stagefright/foundation/ABuffer.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/AMessage.h>
#include <media/stagefright/DataSourceFactory.h>
#include <media/stagefright/FileSource.h>
#include <media/stagefright/InterfaceUtils.h>
#include <media/stagefright/MediaBuffer.h>
#include <media/stagefright/MediaClock.h>
@ -41,8 +43,6 @@
#include <media/stagefright/MediaExtractorFactory.h>
#include <media/stagefright/MetaData.h>
#include <media/stagefright/Utils.h>
#include "../../libstagefright/include/NuCachedSource2.h"
#include "../../libstagefright/include/HTTPBase.h"
namespace android {

@ -33,6 +33,7 @@
#include <media/stagefright/MediaClock.h>
#include <media/stagefright/MetaData.h>
#include <media/stagefright/Utils.h>
#include <media/stagefright/FoundationUtils.h>
#include <media/IMediaAnalyticsService.h>

@ -19,8 +19,10 @@ cc_library_static {
],
cfi: true,
},
shared_libs: ["libmedia"],
shared_libs: [
"libstagefright_foundation",
"libutils"
],
}
cc_library_static {
@ -133,12 +135,7 @@ cc_library {
"CameraSource.cpp",
"CameraSourceTimeLapse.cpp",
"DataConverter.cpp",
"DataSourceFactory.cpp",
"DataURISource.cpp",
"ClearFileSource.cpp",
"FileSource.cpp",
"FrameDecoder.cpp",
"HTTPBase.cpp",
"HevcUtils.cpp",
"InterfaceUtils.cpp",
"JPEGSource.cpp",
@ -155,10 +152,7 @@ cc_library {
"MediaSource.cpp",
"MediaSync.cpp",
"MediaTrack.cpp",
"http/ClearMediaHTTP.cpp",
"http/MediaHTTP.cpp",
"MediaMuxer.cpp",
"NuCachedSource2.cpp",
"NuMediaExtractor.cpp",
"OggWriter.cpp",
"OMXClient.cpp",
@ -171,8 +165,8 @@ cc_library {
"StagefrightMetadataRetriever.cpp",
"StagefrightPluginLoader.cpp",
"SurfaceUtils.cpp",
"Utils.cpp",
"ThrottledSource.cpp",
"Utils.cpp",
"VideoFrameSchedulerBase.cpp",
"VideoFrameScheduler.cpp",
],
@ -183,9 +177,9 @@ cc_library {
"libbinder",
"libcamera_client",
"libcutils",
"libdatasource",
"libdl",
"libdl_android",
"libdrmframework",
"libgui",
"liblog",
"libmedia",
@ -210,6 +204,7 @@ cc_library {
],
static_libs: [
"libstagefright_esds",
"libstagefright_color_conversion",
"libyuv_static",
"libstagefright_mediafilter",
@ -217,7 +212,6 @@ cc_library {
"libstagefright_timedtext",
"libogg",
"libwebm",
"libstagefright_esds",
"libstagefright_id3",
"libFLAC",
],
@ -264,4 +258,3 @@ cc_library {
],
},
}

@ -22,13 +22,13 @@
#include "include/ESDS.h"
#include <datasource/DataSourceFactory.h>
#include <datasource/FileSource.h>
#include <media/DataSource.h>
#include <media/MediaSource.h>
#include <media/stagefright/foundation/ABuffer.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/AMessage.h>
#include <media/stagefright/DataSourceFactory.h>
#include <media/stagefright/FileSource.h>
#include <media/stagefright/MediaBuffer.h>
#include <media/stagefright/MediaDefs.h>
#include <media/stagefright/MediaErrors.h>
@ -36,6 +36,7 @@
#include <media/stagefright/MediaExtractorFactory.h>
#include <media/stagefright/MetaData.h>
#include <media/stagefright/Utils.h>
#include <media/stagefright/FoundationUtils.h>
namespace android {

@ -25,11 +25,11 @@
#include "include/FrameDecoder.h"
#include "include/StagefrightMetadataRetriever.h"
#include <datasource/DataSourceFactory.h>
#include <datasource/FileSource.h>
#include <media/IMediaHTTPService.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/AMessage.h>
#include <media/stagefright/DataSourceFactory.h>
#include <media/stagefright/FileSource.h>
#include <media/stagefright/MediaCodecList.h>
#include <media/stagefright/MediaDefs.h>
#include <media/stagefright/MediaErrors.h>

@ -1895,22 +1895,6 @@ void convertMessageToMetaData(const sp<AMessage> &msg, sp<MetaData> &meta) {
#endif
}
AString MakeUserAgent() {
AString ua;
ua.append("stagefright/1.2 (Linux;Android ");
#if (PROPERTY_VALUE_MAX < 8)
#error "PROPERTY_VALUE_MAX must be at least 8"
#endif
char value[PROPERTY_VALUE_MAX];
property_get("ro.build.version.release", value, "Unknown");
ua.append(value);
ua.append(")");
return ua;
}
status_t sendMetaDataToHal(sp<MediaPlayerBase::AudioSink>& sink,
const sp<MetaData>& meta)
{
@ -2099,39 +2083,6 @@ bool canOffloadStream(const sp<MetaData>& meta, bool hasVideo,
return AudioSystem::isOffloadSupported(info);
}
AString uriDebugString(const AString &uri, bool incognito) {
if (incognito) {
return AString("<URI suppressed>");
}
if (property_get_bool("media.stagefright.log-uri", false)) {
return uri;
}
// find scheme
AString scheme;
const char *chars = uri.c_str();
for (size_t i = 0; i < uri.size(); i++) {
const char c = chars[i];
if (!isascii(c)) {
break;
} else if (isalpha(c)) {
continue;
} else if (i == 0) {
// first character must be a letter
break;
} else if (isdigit(c) || c == '+' || c == '.' || c =='-') {
continue;
} else if (c != ':') {
break;
}
scheme = AString(uri, 0, i);
scheme.append("://<suppressed>");
return scheme;
}
return AString("<no-scheme URI suppressed>");
}
HLSTime::HLSTime(const sp<AMessage>& meta) :
mSeq(-1),
mTimeUs(-1LL),
@ -2230,36 +2181,4 @@ void readFromAMessage(const sp<AMessage> &msg, BufferingSettings *buffering /* n
}
}
AString nameForFd(int fd) {
const size_t SIZE = 256;
char buffer[SIZE];
AString result;
snprintf(buffer, SIZE, "/proc/%d/fd/%d", getpid(), fd);
struct stat s;
if (lstat(buffer, &s) == 0) {
if ((s.st_mode & S_IFMT) == S_IFLNK) {
char linkto[256];
int len = readlink(buffer, linkto, sizeof(linkto));
if(len > 0) {
if(len > 255) {
linkto[252] = '.';
linkto[253] = '.';
linkto[254] = '.';
linkto[255] = 0;
} else {
linkto[len] = 0;
}
result.append(linkto);
}
} else {
result.append("unexpected type for ");
result.append(buffer);
}
} else {
result.append("couldn't open ");
result.append(buffer);
}
return result;
}
} // namespace android

@ -65,6 +65,7 @@ cc_defaults {
"AudioPresentationInfo.cpp",
"ByteUtils.cpp",
"ColorUtils.cpp",
"FoundationUtils.cpp",
"MediaBuffer.cpp",
"MediaBufferBase.cpp",
"MediaBufferGroup.cpp",

@ -0,0 +1,112 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//#define LOG_NDEBUG 0
#define LOG_TAG "FoundationUtils"
#include <utils/Log.h>
#include <ctype.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <cutils/properties.h>
#include <media/stagefright/foundation/AString.h>
namespace android {
AString uriDebugString(const AString &uri, bool incognito) {
if (incognito) {
return AString("<URI suppressed>");
}
if (property_get_bool("media.stagefright.log-uri", false)) {
return uri;
}
// find scheme
AString scheme;
const char *chars = uri.c_str();
for (size_t i = 0; i < uri.size(); i++) {
const char c = chars[i];
if (!isascii(c)) {
break;
} else if (isalpha(c)) {
continue;
} else if (i == 0) {
// first character must be a letter
break;
} else if (isdigit(c) || c == '+' || c == '.' || c =='-') {
continue;
} else if (c != ':') {
break;
}
scheme = AString(uri, 0, i);
scheme.append("://<suppressed>");
return scheme;
}
return AString("<no-scheme URI suppressed>");
}
AString MakeUserAgent() {
AString ua;
ua.append("stagefright/1.2 (Linux;Android ");
#if (PROPERTY_VALUE_MAX < 8)
#error "PROPERTY_VALUE_MAX must be at least 8"
#endif
char value[PROPERTY_VALUE_MAX];
property_get("ro.build.version.release", value, "Unknown");
ua.append(value);
ua.append(")");
return ua;
}
AString nameForFd(int fd) {
const size_t SIZE = 256;
char buffer[SIZE];
AString result;
snprintf(buffer, SIZE, "/proc/%d/fd/%d", getpid(), fd);
struct stat s;
if (lstat(buffer, &s) == 0) {
if ((s.st_mode & S_IFMT) == S_IFLNK) {
char linkto[256];
int len = readlink(buffer, linkto, sizeof(linkto));
if(len > 0) {
if(len > 255) {
linkto[252] = '.';
linkto[253] = '.';
linkto[254] = '.';
linkto[255] = 0;
} else {
linkto[len] = 0;
}
result.append(linkto);
}
} else {
result.append("unexpected type for ");
result.append(buffer);
}
} else {
result.append("couldn't open ");
result.append(buffer);
}
return result;
}
} // namespace android

@ -31,6 +31,7 @@ cc_library {
"liblog",
"libcrypto",
"libcutils",
"libdatasource",
"libmedia",
"libmediandk",
"libstagefright",

@ -21,13 +21,13 @@
#include "HTTPDownloader.h"
#include "M3UParser.h"
#include <datasource/ClearMediaHTTP.h>
#include <datasource/ClearFileSource.h>
#include <media/DataSource.h>
#include <media/MediaHTTPConnection.h>
#include <media/MediaHTTPService.h>
#include <media/stagefright/foundation/ABuffer.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/ClearMediaHTTP.h>
#include <media/stagefright/ClearFileSource.h>
#include <openssl/aes.h>
#include <openssl/md5.h>
#include <utils/Mutex.h>

@ -34,6 +34,7 @@
#include <media/stagefright/MediaDefs.h>
#include <media/stagefright/MetaData.h>
#include <media/stagefright/Utils.h>
#include <media/stagefright/FoundationUtils.h>
#include <utils/Mutex.h>

@ -27,6 +27,7 @@
#include <media/stagefright/MediaDefs.h>
#include <media/stagefright/MediaErrors.h>
#include <media/stagefright/Utils.h>
#include <media/stagefright/FoundationUtils.h>
#include <media/mediaplayer.h>
namespace android {

@ -28,17 +28,18 @@
#include "mpeg2ts/AnotherPacketSource.h"
#include "mpeg2ts/HlsSampleDecryptor.h"
#include <datasource/DataURISource.h>
#include <media/stagefright/foundation/ABitReader.h>
#include <media/stagefright/foundation/ABuffer.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/ByteUtils.h>
#include <media/stagefright/foundation/MediaKeys.h>
#include <media/stagefright/foundation/avc_utils.h>
#include <media/stagefright/DataURISource.h>
#include <media/stagefright/MediaDefs.h>
#include <media/stagefright/MetaData.h>
#include <media/stagefright/MetaDataUtils.h>
#include <media/stagefright/Utils.h>
#include <media/stagefright/FoundationUtils.h>
#include <ctype.h>
#include <inttypes.h>

@ -33,6 +33,7 @@ cc_test {
],
shared_libs: [
"libdatasource",
"libstagefright",
"libutils",
"liblog",

@ -22,7 +22,7 @@
#include <dirent.h>
#include <binder/ProcessState.h>
#include <media/stagefright/FileSource.h>
#include <datasource/FileSource.h>
#include <media/stagefright/foundation/ADebug.h>
#define MAXPATHLEN 256

@ -0,0 +1,32 @@
/*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef FOUNDATION_UTILS_H_
#define FOUNDATION_UTILS_H_
#include <media/stagefright/foundation/AString.h>
namespace android {
AString MakeUserAgent();
AString uriDebugString(const AString &uri, bool incognito = false);
AString nameForFd(int fd);
} // namespace android
#endif // FOUNDATION_UTILS_H_

@ -41,8 +41,6 @@ void convertMessageToMetaData(
// TODO: combine this with avc_utils::getNextNALUnit
const uint8_t *findNextNalStartCode(const uint8_t *data, size_t length);
AString MakeUserAgent();
// Convert a MIME type to a AudioSystem::audio_format
status_t mapMimeToAudioFormat(audio_format_t& format, const char* mime);
@ -60,8 +58,6 @@ status_t getAudioOffloadInfo(const sp<MetaData>& meta, bool hasVideo,
bool canOffloadStream(const sp<MetaData>& meta, bool hasVideo,
bool isStreaming, audio_stream_type_t streamType);
AString uriDebugString(const AString &uri, bool incognito = false);
struct HLSTime {
int32_t mSeq;
int64_t mTimeUs;
@ -85,7 +81,6 @@ void readFromAMessage(
void writeToAMessage(const sp<AMessage> &msg, const BufferingSettings &buffering);
void readFromAMessage(const sp<AMessage> &msg, BufferingSettings *buffering /* nonnull */);
AString nameForFd(int fd);
} // namespace android
#endif // UTILS_H_

@ -7,6 +7,7 @@ cc_test {
shared_libs: [
"libstagefright",
"libbinder",
"libdatasource",
"libmedia",
"libmedia_omx",
"libutils",

@ -27,13 +27,13 @@
#include <binder/ProcessState.h>
#include <binder/IServiceManager.h>
#include <cutils/properties.h>
#include <datasource/DataSourceFactory.h>
#include <media/DataSource.h>
#include <media/IMediaHTTPService.h>
#include <media/MediaSource.h>
#include <media/OMXBuffer.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/ALooper.h>
#include <media/stagefright/DataSourceFactory.h>
#include <media/stagefright/InterfaceUtils.h>
#include <media/stagefright/MediaBuffer.h>
#include <media/stagefright/MediaDefs.h>

@ -21,12 +21,14 @@
#include "ARTSPConnection.h"
#include "NetworkUtils.h"
#include <datasource/HTTPBase.h>
#include <media/stagefright/foundation/ABuffer.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/AMessage.h>
#include <media/stagefright/foundation/base64.h>
#include <media/stagefright/MediaErrors.h>
#include <media/stagefright/Utils.h>
#include <media/stagefright/FoundationUtils.h>
#include <arpa/inet.h>
#include <fcntl.h>
@ -34,7 +36,6 @@
#include <openssl/md5.h>
#include <sys/socket.h>
#include "include/HTTPBase.h"
namespace android {

@ -21,6 +21,7 @@ cc_defaults {
shared_libs: [
"libcrypto",
"libdatasource",
"libmedia",
],

@ -36,18 +36,19 @@
#include <ctype.h>
#include <cutils/properties.h>
#include <datasource/HTTPBase.h>
#include <media/stagefright/foundation/ABuffer.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/ALooper.h>
#include <media/stagefright/foundation/AMessage.h>
#include <media/stagefright/MediaErrors.h>
#include <media/stagefright/Utils.h>
#include <media/stagefright/FoundationUtils.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netdb.h>
#include "HTTPBase.h"
#if LOG_NDEBUG
#define UNUSED_UNLESS_VERBOSE(x) (void)(x)

@ -22,12 +22,13 @@
#include "ASessionDescription.h"
#include <datasource/ClearMediaHTTP.h>
#include <media/MediaHTTPConnection.h>
#include <media/MediaHTTPService.h>
#include <media/stagefright/ClearMediaHTTP.h>
#include <media/stagefright/foundation/ABuffer.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/Utils.h>
#include <media/stagefright/FoundationUtils.h>
#define DEFAULT_SDP_SIZE 100000

@ -27,6 +27,7 @@ cc_library_static {
include_dirs: ["frameworks/av/include"],
shared_libs: [
"libdatasource",
"libstagefright_foundation",
"libutils",
"liblog",

@ -20,8 +20,8 @@
#include "WebmFrame.h"
#include "LinkedBlockingQueue.h"
#include <datasource/FileSource.h>
#include <media/MediaSource.h>
#include <media/stagefright/FileSource.h>
#include <utils/List.h>
#include <utils/Errors.h>

@ -79,6 +79,7 @@ cc_library_shared {
"libandroid_runtime_lazy",
"libbase",
"libbinder",
"libdatasource",
"libmedia",
"libmediadrm",
"libmedia_omx",

@ -26,16 +26,16 @@
#include <android_runtime/AndroidRuntime.h>
#include <android_util_Binder.h>
#include <cutils/properties.h>
#include <utils/Log.h>
#include <utils/StrongPointer.h>
#include <datasource/DataSourceFactory.h>
#include <datasource/HTTPBase.h>
#include <datasource/NuCachedSource2.h>
#include <media/IMediaHTTPService.h>
#include <media/NdkMediaError.h>
#include <media/NdkMediaDataSource.h>
#include <media/stagefright/DataSourceFactory.h>
#include <media/stagefright/InterfaceUtils.h>
#include <utils/Log.h>
#include <utils/StrongPointer.h>
#include "../../libstagefright/include/HTTPBase.h"
#include "../../libstagefright/include/NuCachedSource2.h"
#include "NdkMediaDataSourceCallbacksPriv.h"

@ -8,6 +8,7 @@ cc_library_shared {
srcs: ["MediaExtractorService.cpp"],
shared_libs: [
"libdatasource",
"libmedia",
"libstagefright",
"libbinder",

@ -20,8 +20,8 @@
#include <utils/Vector.h>
#include <datasource/DataSourceFactory.h>
#include <media/DataSource.h>
#include <media/stagefright/DataSourceFactory.h>
#include <media/stagefright/InterfaceUtils.h>
#include <media/stagefright/MediaExtractorFactory.h>
#include <media/stagefright/RemoteDataSource.h>

Loading…
Cancel
Save