MediaPlayer2: build static libs for some components

Test: compiles
Bug: 63934228
Change-Id: I1791b40a67c87ea3146825767699e5022444e433
gugelfrei
Wei Jia 7 years ago
parent 205266aacc
commit 4049f13fb3

@ -2,7 +2,9 @@
// libmediadrm
//
cc_library_shared {
// TODO: change it back to cc_library_shared when MediaPlayer2 switches to
// using NdkMediaDrm, instead of MediaDrm.java.
cc_library {
name: "libmediadrm",

@ -146,7 +146,7 @@ filegroup {
],
}
cc_library_shared {
cc_library {
name: "libmedia",
srcs: [
@ -249,7 +249,7 @@ cc_library_shared {
},
}
cc_library_shared {
cc_library {
name: "libmedia_player2_util",
srcs: [
@ -259,6 +259,7 @@ cc_library_shared {
"IMediaExtractorService.cpp",
"IMediaSource.cpp",
"IStreamSource.cpp",
"MediaCodecBuffer.cpp",
"MediaUtils.cpp",
"Metadata.cpp",
"NdkWrapper.cpp",
@ -267,7 +268,6 @@ cc_library_shared {
shared_libs: [
"libbinder",
"libcutils",
"libgui",
"liblog",
"libmediaextractor",
"libmediandk",
@ -287,9 +287,6 @@ cc_library_shared {
],
static_libs: [
"libc_malloc_debug_backtrace", // for memory heap analysis
"libstagefright_nuplayer2",
"libstagefright_rtsp",
"libstagefright_timedtext",
],
@ -316,16 +313,14 @@ cc_library_shared {
},
}
cc_library_shared {
cc_library {
name: "libmedia_player2",
srcs: [
"AudioParameter.cpp",
"JAudioTrack.cpp",
"MediaPlayer2Factory.cpp",
"MediaPlayer2Manager.cpp",
"TestPlayerStub.cpp",
"TypeConverter.cpp",
"mediaplayer2.cpp",
],
@ -366,8 +361,7 @@ cc_library_shared {
],
static_libs: [
"libc_malloc_debug_backtrace", // for memory heap analysis
"libmedia_helper",
"libstagefright_nuplayer2",
"libstagefright_rtsp",
"libstagefright_timedtext",

@ -22,7 +22,6 @@
#include <cutils/properties.h>
#include <media/DataSource.h>
#include <media/MediaPlayer2Engine.h>
#include <media/stagefright/FileSource.h>
#include <media/stagefright/foundation/ADebug.h>
#include <utils/Errors.h>
#include <utils/misc.h>

@ -64,6 +64,7 @@
#include <memunreachable/memunreachable.h>
#include <system/audio.h>
#include <system/window.h>
#include <private/android_filesystem_config.h>
@ -470,8 +471,9 @@ status_t MediaPlayer2Manager::dump(int fd, const Vector<String16>& args)
if (unreachableMemory) {
result.append("\nDumping unreachable memory:\n");
// TODO - should limit be an argument parameter?
std::string s = GetUnreachableMemoryString(true /* contents */, 10000 /* limit */);
result.append(s.c_str(), s.size());
// TODO: enable GetUnreachableMemoryString if it's part of stable API
//std::string s = GetUnreachableMemoryString(true /* contents */, 10000 /* limit */);
//result.append(s.c_str(), s.size());
}
}
write(fd, result.string(), result.size());
@ -738,8 +740,8 @@ status_t MediaPlayer2Manager::Client::setDataSource(
void MediaPlayer2Manager::Client::disconnectNativeWindow_l() {
if (mConnectedWindow != NULL && mConnectedWindow->getANativeWindow() != NULL) {
status_t err = nativeWindowDisconnect(
mConnectedWindow->getANativeWindow(), "disconnectNativeWindow");
status_t err = native_window_api_disconnect(
mConnectedWindow->getANativeWindow(), NATIVE_WINDOW_API_MEDIA);
if (err != OK) {
ALOGW("nativeWindowDisconnect returned an error: %s (%d)",
@ -763,7 +765,8 @@ status_t MediaPlayer2Manager::Client::setVideoSurfaceTexture(
&& mConnectedWindow->getANativeWindow() == nww->getANativeWindow()) {
return OK;
}
status_t err = nativeWindowConnect(nww->getANativeWindow(), "setVideoSurfaceTexture");
status_t err = native_window_api_connect(
nww->getANativeWindow(), NATIVE_WINDOW_API_MEDIA);
if (err != OK) {
ALOGE("setVideoSurfaceTexture failed: %d", err);
@ -792,8 +795,8 @@ status_t MediaPlayer2Manager::Client::setVideoSurfaceTexture(
mLock.unlock();
} else if (nww != NULL) {
mLock.unlock();
status_t err = nativeWindowDisconnect(
nww->getANativeWindow(), "disconnectNativeWindow");
status_t err = native_window_api_disconnect(
nww->getANativeWindow(), NATIVE_WINDOW_API_MEDIA);
if (err != OK) {
ALOGW("nativeWindowDisconnect returned an error: %s (%d)",

@ -33,7 +33,6 @@
#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>

@ -40,6 +40,7 @@
#include <media/stagefright/MediaErrors.h>
#include <media/stagefright/SurfaceUtils.h>
#include <system/window.h>
#include "ATSParser.h"
namespace android {
@ -241,22 +242,25 @@ void NuPlayer2::Decoder::onMessageReceived(const sp<AMessage> &msg) {
//
// at this point MediaPlayer2Manager::client has already connected to the
// surface, which MediaCodec does not expect
err = nativeWindowDisconnect(nww->getANativeWindow(), "kWhatSetVideoSurface(nww)");
err = native_window_api_disconnect(nww->getANativeWindow(),
NATIVE_WINDOW_API_MEDIA);
if (err == OK) {
err = mCodec->setOutputSurface(nww);
ALOGI_IF(err, "codec setOutputSurface returned: %d", err);
if (err == OK) {
// reconnect to the old surface as MPS::Client will expect to
// be able to disconnect from it.
(void)nativeWindowConnect(mNativeWindow->getANativeWindow(),
"kWhatSetVideoSurface(mNativeWindow)");
(void)native_window_api_connect(mNativeWindow->getANativeWindow(),
NATIVE_WINDOW_API_MEDIA);
mNativeWindow = nww;
}
}
if (err != OK) {
// reconnect to the new surface on error as MPS::Client will expect to
// be able to disconnect from it.
(void)nativeWindowConnect(nww->getANativeWindow(), "kWhatSetVideoSurface(err)");
(void)native_window_api_connect(nww->getANativeWindow(),
NATIVE_WINDOW_API_MEDIA);
}
}
@ -326,7 +330,8 @@ void NuPlayer2::Decoder::onConfigure(const sp<AMessage> &format) {
status_t err;
if (mNativeWindow != NULL && mNativeWindow->getANativeWindow() != NULL) {
// disconnect from surface as MediaCodec will reconnect
err = nativeWindowDisconnect(mNativeWindow->getANativeWindow(), "onConfigure");
err = native_window_api_disconnect(mNativeWindow->getANativeWindow(),
NATIVE_WINDOW_API_MEDIA);
// We treat this as a warning, as this is a preparatory step.
// Codec will try to connect to the surface, which is where
// any error signaling will occur.
@ -540,7 +545,8 @@ void NuPlayer2::Decoder::onShutdown(bool notifyComplete) {
if (mNativeWindow != NULL && mNativeWindow->getANativeWindow() != NULL) {
// reconnect to surface as MediaCodec disconnected from it
status_t error = nativeWindowConnect(mNativeWindow->getANativeWindow(), "onShutdown");
status_t error = native_window_api_connect(mNativeWindow->getANativeWindow(),
NATIVE_WINDOW_API_MEDIA);
ALOGW_IF(error != NO_ERROR,
"[%s] failed to connect to native window, error=%d",
mComponentName.c_str(), error);

@ -1,4 +1,4 @@
cc_library_shared {
cc_library {
name: "libmediaextractor",
include_dirs: [

@ -1,4 +1,6 @@
cc_library_shared {
// TODO: change it back to cc_library_shared when there is a way to
// expose media metrics as stable API.
cc_library {
name: "libmediametrics",
srcs: [

@ -128,7 +128,6 @@ cc_library_shared {
"libstagefright_timedtext",
"libvpx",
"libwebm",
"libstagefright_mpeg2support",
"libstagefright_esds",
"libstagefright_id3",
"libFLAC",
@ -173,7 +172,7 @@ cc_library_shared {
},
}
cc_library_shared {
cc_library {
name: "libstagefright_player2",
srcs: [
@ -190,7 +189,6 @@ cc_library_shared {
"NuCachedSource2.cpp",
"RemoteMediaExtractor.cpp",
"RemoteMediaSource.cpp",
"SurfaceUtils.cpp",
"Utils.cpp",
"VideoFrameScheduler.cpp",
"http/MediaHTTP.cpp",
@ -202,7 +200,6 @@ cc_library_shared {
"libdrmframework",
"libgui",
"liblog",
"libmedia_omx",
"libmedia_player2_util",
"libaudioclient",
"libmediaextractor",
@ -213,15 +210,15 @@ cc_library_shared {
"libutils",
"libmedia_helper",
"libstagefright_foundation",
"libdl",
"libziparchive",
],
static_libs: [
"libstagefright_esds",
"libstagefright_id3",
"libstagefright_mpeg2support",
"libstagefright_timedtext",
],
header_libs:[
"media_plugin_headers",
],
export_shared_lib_headers: [

@ -4,7 +4,7 @@ cc_library_headers {
vendor_available: true,
}
cc_library_shared {
cc_library {
name: "libstagefright_foundation",
vendor_available: true,
vndk: {

@ -1,4 +1,4 @@
cc_library_shared {
cc_library {
name: "libstagefright_httplive",
srcs: [

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
cc_library_shared {
cc_library {
name: "libmediautils",
srcs: [

Loading…
Cancel
Save