diff options
190 files changed, 487 insertions, 313 deletions
diff --git a/camera/Camera.cpp b/camera/Camera.cpp index 85f44f0..3a9fb4c 100644 --- a/camera/Camera.cpp +++ b/camera/Camera.cpp @@ -55,7 +55,7 @@ sp<Camera> Camera::create(const sp<ICamera>& camera) if (camera->connect(c) == NO_ERROR) { c->mStatus = NO_ERROR; c->mCamera = camera; - camera->asBinder()->linkToDeath(c); + IInterface::asBinder(camera)->linkToDeath(c); return c; } return 0; @@ -93,7 +93,7 @@ status_t Camera::connectLegacy(int cameraId, int halVersion, clientUid, /*out*/c->mCamera); } if (status == OK && c->mCamera != 0) { - c->mCamera->asBinder()->linkToDeath(c); + IInterface::asBinder(c->mCamera)->linkToDeath(c); c->mStatus = NO_ERROR; camera = c; } else { diff --git a/camera/CameraBase.cpp b/camera/CameraBase.cpp index 04694cd..65a1a47 100644 --- a/camera/CameraBase.cpp +++ b/camera/CameraBase.cpp @@ -107,7 +107,7 @@ sp<TCam> CameraBase<TCam, TCamTraits>::connect(int cameraId, /*out*/ c->mCamera); } if (status == OK && c->mCamera != 0) { - c->mCamera->asBinder()->linkToDeath(c); + IInterface::asBinder(c->mCamera)->linkToDeath(c); c->mStatus = NO_ERROR; } else { ALOGW("An error occurred while connecting to camera: %d", cameraId); @@ -122,7 +122,7 @@ void CameraBase<TCam, TCamTraits>::disconnect() ALOGV("%s: disconnect", __FUNCTION__); if (mCamera != 0) { mCamera->disconnect(); - mCamera->asBinder()->unlinkToDeath(this); + IInterface::asBinder(mCamera)->unlinkToDeath(this); mCamera = 0; } ALOGV("%s: disconnect (done)", __FUNCTION__); diff --git a/camera/ICamera.cpp b/camera/ICamera.cpp index 8c6e1f7..9943be6 100644 --- a/camera/ICamera.cpp +++ b/camera/ICamera.cpp @@ -75,7 +75,7 @@ public: ALOGV("setPreviewTarget"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); - sp<IBinder> b(bufferProducer->asBinder()); + sp<IBinder> b(IInterface::asBinder(bufferProducer)); data.writeStrongBinder(b); remote()->transact(SET_PREVIEW_TARGET, data, &reply); return reply.readInt32(); @@ -98,7 +98,7 @@ public: ALOGV("setPreviewCallbackTarget"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); - sp<IBinder> b(callbackProducer->asBinder()); + sp<IBinder> b(IInterface::asBinder(callbackProducer)); data.writeStrongBinder(b); remote()->transact(SET_PREVIEW_CALLBACK_TARGET, data, &reply); return reply.readInt32(); @@ -147,7 +147,7 @@ public: ALOGV("releaseRecordingFrame"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); - data.writeStrongBinder(mem->asBinder()); + data.writeStrongBinder(IInterface::asBinder(mem)); remote()->transact(RELEASE_RECORDING_FRAME, data, &reply); } @@ -250,7 +250,7 @@ public: { Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); - data.writeStrongBinder(cameraClient->asBinder()); + data.writeStrongBinder(IInterface::asBinder(cameraClient)); remote()->transact(CONNECT, data, &reply); return reply.readInt32(); } diff --git a/camera/ICameraClient.cpp b/camera/ICameraClient.cpp index 205c8ba..179a341 100644 --- a/camera/ICameraClient.cpp +++ b/camera/ICameraClient.cpp @@ -58,7 +58,7 @@ public: Parcel data, reply; data.writeInterfaceToken(ICameraClient::getInterfaceDescriptor()); data.writeInt32(msgType); - data.writeStrongBinder(imageData->asBinder()); + data.writeStrongBinder(IInterface::asBinder(imageData)); if (metadata) { data.writeInt32(metadata->number_of_faces); data.write(metadata->faces, sizeof(camera_face_t) * metadata->number_of_faces); @@ -74,7 +74,7 @@ public: data.writeInterfaceToken(ICameraClient::getInterfaceDescriptor()); data.writeInt64(timestamp); data.writeInt32(msgType); - data.writeStrongBinder(imageData->asBinder()); + data.writeStrongBinder(IInterface::asBinder(imageData)); remote()->transact(DATA_CALLBACK_TIMESTAMP, data, &reply, IBinder::FLAG_ONEWAY); } }; diff --git a/camera/ICameraRecordingProxy.cpp b/camera/ICameraRecordingProxy.cpp index 7223b6d..3dc0ffb 100644 --- a/camera/ICameraRecordingProxy.cpp +++ b/camera/ICameraRecordingProxy.cpp @@ -45,7 +45,7 @@ public: ALOGV("startRecording"); Parcel data, reply; data.writeInterfaceToken(ICameraRecordingProxy::getInterfaceDescriptor()); - data.writeStrongBinder(listener->asBinder()); + data.writeStrongBinder(IInterface::asBinder(listener)); remote()->transact(START_RECORDING, data, &reply); return reply.readInt32(); } @@ -63,7 +63,7 @@ public: ALOGV("releaseRecordingFrame"); Parcel data, reply; data.writeInterfaceToken(ICameraRecordingProxy::getInterfaceDescriptor()); - data.writeStrongBinder(mem->asBinder()); + data.writeStrongBinder(IInterface::asBinder(mem)); remote()->transact(RELEASE_RECORDING_FRAME, data, &reply); } }; diff --git a/camera/ICameraRecordingProxyListener.cpp b/camera/ICameraRecordingProxyListener.cpp index cb17f19..cf848fc 100644 --- a/camera/ICameraRecordingProxyListener.cpp +++ b/camera/ICameraRecordingProxyListener.cpp @@ -42,7 +42,7 @@ public: data.writeInterfaceToken(ICameraRecordingProxyListener::getInterfaceDescriptor()); data.writeInt64(timestamp); data.writeInt32(msgType); - data.writeStrongBinder(imageData->asBinder()); + data.writeStrongBinder(IInterface::asBinder(imageData)); remote()->transact(DATA_CALLBACK_TIMESTAMP, data, &reply, IBinder::FLAG_ONEWAY); } }; diff --git a/camera/ICameraService.cpp b/camera/ICameraService.cpp index 5485205..fc3e437 100644 --- a/camera/ICameraService.cpp +++ b/camera/ICameraService.cpp @@ -172,7 +172,7 @@ public: { Parcel data, reply; data.writeInterfaceToken(ICameraService::getInterfaceDescriptor()); - data.writeStrongBinder(cameraClient->asBinder()); + data.writeStrongBinder(IInterface::asBinder(cameraClient)); data.writeInt32(cameraId); data.writeString16(clientPackageName); data.writeInt32(clientUid); @@ -194,7 +194,7 @@ public: { Parcel data, reply; data.writeInterfaceToken(ICameraService::getInterfaceDescriptor()); - data.writeStrongBinder(cameraClient->asBinder()); + data.writeStrongBinder(IInterface::asBinder(cameraClient)); data.writeInt32(cameraId); data.writeInt32(halVersion); data.writeString16(clientPackageName); @@ -217,7 +217,7 @@ public: { Parcel data, reply; data.writeInterfaceToken(ICameraService::getInterfaceDescriptor()); - data.writeStrongBinder(cameraCb->asBinder()); + data.writeStrongBinder(IInterface::asBinder(cameraCb)); data.writeInt32(cameraId); data.writeString16(clientPackageName); data.writeInt32(clientUid); @@ -242,7 +242,7 @@ public: { Parcel data, reply; data.writeInterfaceToken(ICameraService::getInterfaceDescriptor()); - data.writeStrongBinder(cameraCb->asBinder()); + data.writeStrongBinder(IInterface::asBinder(cameraCb)); data.writeInt32(cameraId); data.writeString16(clientPackageName); data.writeInt32(clientUid); @@ -260,7 +260,7 @@ public: { Parcel data, reply; data.writeInterfaceToken(ICameraService::getInterfaceDescriptor()); - data.writeStrongBinder(listener->asBinder()); + data.writeStrongBinder(IInterface::asBinder(listener)); remote()->transact(BnCameraService::ADD_LISTENER, data, &reply); if (readExceptionCode(reply)) return -EPROTO; @@ -271,7 +271,7 @@ public: { Parcel data, reply; data.writeInterfaceToken(ICameraService::getInterfaceDescriptor()); - data.writeStrongBinder(listener->asBinder()); + data.writeStrongBinder(IInterface::asBinder(listener)); remote()->transact(BnCameraService::REMOVE_LISTENER, data, &reply); if (readExceptionCode(reply)) return -EPROTO; @@ -384,7 +384,7 @@ status_t BnCameraService::onTransact( reply->writeInt32(status); if (camera != NULL) { reply->writeInt32(1); - reply->writeStrongBinder(camera->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(camera)); } else { reply->writeInt32(0); } @@ -404,7 +404,7 @@ status_t BnCameraService::onTransact( reply->writeInt32(status); if (camera != NULL) { reply->writeInt32(1); - reply->writeStrongBinder(camera->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(camera)); } else { reply->writeInt32(0); } @@ -424,7 +424,7 @@ status_t BnCameraService::onTransact( reply->writeInt32(status); if (camera != NULL) { reply->writeInt32(1); - reply->writeStrongBinder(camera->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(camera)); } else { reply->writeInt32(0); } @@ -484,7 +484,7 @@ status_t BnCameraService::onTransact( reply->writeInt32(status); if (camera != NULL) { reply->writeInt32(1); - reply->writeStrongBinder(camera->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(camera)); } else { reply->writeInt32(0); } diff --git a/camera/IProCameraUser.cpp b/camera/IProCameraUser.cpp index 8f22124..9bd7597 100644 --- a/camera/IProCameraUser.cpp +++ b/camera/IProCameraUser.cpp @@ -65,7 +65,7 @@ public: { Parcel data, reply; data.writeInterfaceToken(IProCameraUser::getInterfaceDescriptor()); - data.writeStrongBinder(cameraClient->asBinder()); + data.writeStrongBinder(IInterface::asBinder(cameraClient)); remote()->transact(CONNECT, data, &reply); return reply.readInt32(); } @@ -150,7 +150,7 @@ public: data.writeInt32(height); data.writeInt32(format); - sp<IBinder> b(bufferProducer->asBinder()); + sp<IBinder> b(IInterface::asBinder(bufferProducer)); data.writeStrongBinder(b); remote()->transact(CREATE_STREAM, data, &reply); diff --git a/camera/camera2/CaptureRequest.cpp b/camera/camera2/CaptureRequest.cpp index 57e5319..d5e1c5b 100644 --- a/camera/camera2/CaptureRequest.cpp +++ b/camera/camera2/CaptureRequest.cpp @@ -106,7 +106,7 @@ status_t CaptureRequest::writeToParcel(Parcel* parcel) const { sp<IBinder> binder; if (surface != 0) { - binder = surface->getIGraphicBufferProducer()->asBinder(); + binder = IInterface::asBinder(surface->getIGraphicBufferProducer()); } // not sure if readParcelableArray does this, hard to tell from source diff --git a/camera/camera2/ICameraDeviceUser.cpp b/camera/camera2/ICameraDeviceUser.cpp index ff4a0c2..35345d2 100644 --- a/camera/camera2/ICameraDeviceUser.cpp +++ b/camera/camera2/ICameraDeviceUser.cpp @@ -219,7 +219,7 @@ public: data.writeInt32(1); // marker that bufferProducer is not null data.writeString16(String16("unknown_name")); // name of surface - sp<IBinder> b(bufferProducer->asBinder()); + sp<IBinder> b(IInterface::asBinder(bufferProducer)); data.writeStrongBinder(b); remote()->transact(CREATE_STREAM, data, &reply); diff --git a/camera/tests/Android.mk b/camera/tests/Android.mk index 61385e5..2db4c14 100644 --- a/camera/tests/Android.mk +++ b/camera/tests/Android.mk @@ -14,16 +14,15 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) +LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk LOCAL_SRC_FILES:= \ - main.cpp \ ProCameraTests.cpp \ VendorTagDescriptorTests.cpp LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ - libstlport \ libcamera_metadata \ libcamera_client \ libgui \ @@ -32,14 +31,7 @@ LOCAL_SHARED_LIBRARIES := \ libdl \ libbinder -LOCAL_STATIC_LIBRARIES := \ - libgtest - LOCAL_C_INCLUDES += \ - bionic \ - bionic/libstdc++/include \ - external/gtest/include \ - external/stlport/stlport \ system/media/camera/include \ system/media/private/camera/include \ system/media/camera/tests \ diff --git a/camera/tests/main.cpp b/camera/tests/main.cpp deleted file mode 100644 index 8c8c515..0000000 --- a/camera/tests/main.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -#include <gtest/gtest.h> - - -int main(int argc, char **argv) { - - ::testing::InitGoogleTest(&argc, argv); - - int ret = RUN_ALL_TESTS(); - - return ret; -} diff --git a/cmds/stagefright/SineSource.h b/cmds/stagefright/SineSource.h index 76ab669..d772e0d 100644 --- a/cmds/stagefright/SineSource.h +++ b/cmds/stagefright/SineSource.h @@ -6,7 +6,7 @@ namespace android { -struct MediaBufferGroup; +class MediaBufferGroup; struct SineSource : public MediaSource { SineSource(int32_t sampleRate, int32_t numChannels); diff --git a/drm/common/IDrmManagerService.cpp b/drm/common/IDrmManagerService.cpp index db41e0b..3f62ed7 100644 --- a/drm/common/IDrmManagerService.cpp +++ b/drm/common/IDrmManagerService.cpp @@ -148,7 +148,7 @@ status_t BpDrmManagerService::setDrmServiceListener( data.writeInterfaceToken(IDrmManagerService::getInterfaceDescriptor()); data.writeInt32(uniqueId); - data.writeStrongBinder(drmServiceListener->asBinder()); + data.writeStrongBinder(IInterface::asBinder(drmServiceListener)); remote()->transact(SET_DRM_SERVICE_LISTENER, data, &reply); return reply.readInt32(); } diff --git a/drm/drmserver/Android.mk b/drm/drmserver/Android.mk index aa0ab9b..48ea385 100644 --- a/drm/drmserver/Android.mk +++ b/drm/drmserver/Android.mk @@ -26,7 +26,8 @@ LOCAL_SHARED_LIBRARIES := \ libutils \ liblog \ libbinder \ - libdl + libdl \ + libselinux LOCAL_STATIC_LIBRARIES := libdrmframeworkcommon diff --git a/drm/drmserver/DrmManagerService.cpp b/drm/drmserver/DrmManagerService.cpp index 63341e0..857d73e 100644 --- a/drm/drmserver/DrmManagerService.cpp +++ b/drm/drmserver/DrmManagerService.cpp @@ -29,20 +29,68 @@ #include "DrmManagerService.h" #include "DrmManager.h" +#include <selinux/android.h> + using namespace android; +static int selinux_enabled; +static char *drmserver_context; static Vector<uid_t> trustedUids; -static bool isProtectedCallAllowed() { +const char *const DrmManagerService::drm_perm_labels[] = { + "consumeRights", + "setPlaybackStatus", + "openDecryptSession", + "closeDecryptSession", + "initializeDecryptUnit", + "decrypt", + "finalizeDecryptUnit", + "pread" +}; + +const char *DrmManagerService::get_perm_label(drm_perm_t perm) { + unsigned int index = perm; + + if (index < 0 || + index >= (sizeof(drm_perm_labels) / sizeof(drm_perm_labels[0]))) { + ALOGE("SELinux: Failed to retrieve permission label(perm=%d).\n", perm); + abort(); + } + return drm_perm_labels[index]; +} + +bool DrmManagerService::selinuxIsProtectedCallAllowed(pid_t spid, drm_perm_t perm) { + if (selinux_enabled <= 0) { + return true; + } + + char *sctx; + const char *selinux_class = "drmservice"; + const char *str_perm = get_perm_label(perm); + + if (getpidcon(spid, &sctx) != 0) { + ALOGE("SELinux: getpidcon(pid=%d) failed.\n", spid); + return false; + } + + bool allowed = (selinux_check_access(sctx, drmserver_context, selinux_class, + str_perm, NULL) == 0); + freecon(sctx); + + return allowed; +} + +bool DrmManagerService::isProtectedCallAllowed(drm_perm_t perm) { // TODO // Following implementation is just for reference. // Each OEM manufacturer should implement/replace with their own solutions. IPCThreadState* ipcState = IPCThreadState::self(); uid_t uid = ipcState->getCallingUid(); + pid_t spid = ipcState->getCallingPid(); for (unsigned int i = 0; i < trustedUids.size(); ++i) { if (trustedUids[i] == uid) { - return true; + return selinuxIsProtectedCallAllowed(spid, perm); } } return false; @@ -60,6 +108,16 @@ void DrmManagerService::instantiate() { // Add trusted uids here trustedUids.push(AID_MEDIA); } + + selinux_enabled = is_selinux_enabled(); + if (selinux_enabled > 0 && getcon(&drmserver_context) != 0) { + ALOGE("SELinux: DrmManagerService failed to get context for DrmManagerService. Aborting.\n"); + abort(); + } + + union selinux_callback cb; + cb.func_log = selinux_log_callback; + selinux_set_callback(SELINUX_CB_LOG, cb); } DrmManagerService::DrmManagerService() : @@ -151,7 +209,7 @@ int DrmManagerService::checkRightsStatus( status_t DrmManagerService::consumeRights( int uniqueId, DecryptHandle* decryptHandle, int action, bool reserve) { ALOGV("Entering consumeRights"); - if (!isProtectedCallAllowed()) { + if (!isProtectedCallAllowed(CONSUME_RIGHTS)) { return DRM_ERROR_NO_PERMISSION; } return mDrmManager->consumeRights(uniqueId, decryptHandle, action, reserve); @@ -160,7 +218,7 @@ status_t DrmManagerService::consumeRights( status_t DrmManagerService::setPlaybackStatus( int uniqueId, DecryptHandle* decryptHandle, int playbackStatus, int64_t position) { ALOGV("Entering setPlaybackStatus"); - if (!isProtectedCallAllowed()) { + if (!isProtectedCallAllowed(SET_PLAYBACK_STATUS)) { return DRM_ERROR_NO_PERMISSION; } return mDrmManager->setPlaybackStatus(uniqueId, decryptHandle, playbackStatus, position); @@ -208,7 +266,7 @@ status_t DrmManagerService::getAllSupportInfo( DecryptHandle* DrmManagerService::openDecryptSession( int uniqueId, int fd, off64_t offset, off64_t length, const char* mime) { ALOGV("Entering DrmManagerService::openDecryptSession"); - if (isProtectedCallAllowed()) { + if (isProtectedCallAllowed(OPEN_DECRYPT_SESSION)) { return mDrmManager->openDecryptSession(uniqueId, fd, offset, length, mime); } @@ -218,7 +276,7 @@ DecryptHandle* DrmManagerService::openDecryptSession( DecryptHandle* DrmManagerService::openDecryptSession( int uniqueId, const char* uri, const char* mime) { ALOGV("Entering DrmManagerService::openDecryptSession with uri"); - if (isProtectedCallAllowed()) { + if (isProtectedCallAllowed(OPEN_DECRYPT_SESSION)) { return mDrmManager->openDecryptSession(uniqueId, uri, mime); } @@ -228,7 +286,7 @@ DecryptHandle* DrmManagerService::openDecryptSession( DecryptHandle* DrmManagerService::openDecryptSession( int uniqueId, const DrmBuffer& buf, const String8& mimeType) { ALOGV("Entering DrmManagerService::openDecryptSession for streaming"); - if (isProtectedCallAllowed()) { + if (isProtectedCallAllowed(OPEN_DECRYPT_SESSION)) { return mDrmManager->openDecryptSession(uniqueId, buf, mimeType); } @@ -237,7 +295,7 @@ DecryptHandle* DrmManagerService::openDecryptSession( status_t DrmManagerService::closeDecryptSession(int uniqueId, DecryptHandle* decryptHandle) { ALOGV("Entering closeDecryptSession"); - if (!isProtectedCallAllowed()) { + if (!isProtectedCallAllowed(CLOSE_DECRYPT_SESSION)) { return DRM_ERROR_NO_PERMISSION; } return mDrmManager->closeDecryptSession(uniqueId, decryptHandle); @@ -246,7 +304,7 @@ status_t DrmManagerService::closeDecryptSession(int uniqueId, DecryptHandle* dec status_t DrmManagerService::initializeDecryptUnit(int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId, const DrmBuffer* headerInfo) { ALOGV("Entering initializeDecryptUnit"); - if (!isProtectedCallAllowed()) { + if (!isProtectedCallAllowed(INITIALIZE_DECRYPT_UNIT)) { return DRM_ERROR_NO_PERMISSION; } return mDrmManager->initializeDecryptUnit(uniqueId,decryptHandle, decryptUnitId, headerInfo); @@ -256,7 +314,7 @@ status_t DrmManagerService::decrypt( int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId, const DrmBuffer* encBuffer, DrmBuffer** decBuffer, DrmBuffer* IV) { ALOGV("Entering decrypt"); - if (!isProtectedCallAllowed()) { + if (!isProtectedCallAllowed(DECRYPT)) { return DRM_ERROR_NO_PERMISSION; } return mDrmManager->decrypt(uniqueId, decryptHandle, decryptUnitId, encBuffer, decBuffer, IV); @@ -265,7 +323,7 @@ status_t DrmManagerService::decrypt( status_t DrmManagerService::finalizeDecryptUnit( int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId) { ALOGV("Entering finalizeDecryptUnit"); - if (!isProtectedCallAllowed()) { + if (!isProtectedCallAllowed(FINALIZE_DECRYPT_UNIT)) { return DRM_ERROR_NO_PERMISSION; } return mDrmManager->finalizeDecryptUnit(uniqueId, decryptHandle, decryptUnitId); @@ -274,7 +332,7 @@ status_t DrmManagerService::finalizeDecryptUnit( ssize_t DrmManagerService::pread(int uniqueId, DecryptHandle* decryptHandle, void* buffer, ssize_t numBytes, off64_t offset) { ALOGV("Entering pread"); - if (!isProtectedCallAllowed()) { + if (!isProtectedCallAllowed(PREAD)) { return DRM_ERROR_NO_PERMISSION; } return mDrmManager->pread(uniqueId, decryptHandle, buffer, numBytes, offset); diff --git a/drm/libdrmframework/DrmManagerClientImpl.cpp b/drm/libdrmframework/DrmManagerClientImpl.cpp index 2d2c90e..9457bb6 100644 --- a/drm/libdrmframework/DrmManagerClientImpl.cpp +++ b/drm/libdrmframework/DrmManagerClientImpl.cpp @@ -346,7 +346,7 @@ status_t DrmManagerClientImpl::notify(const DrmInfoEvent& event) { DrmManagerClientImpl::DeathNotifier::~DeathNotifier() { Mutex::Autolock lock(sMutex); if (NULL != sDrmManagerService.get()) { - sDrmManagerService->asBinder()->unlinkToDeath(this); + IInterface::asBinder(sDrmManagerService)->unlinkToDeath(this); } } diff --git a/drm/libdrmframework/include/DrmManagerService.h b/drm/libdrmframework/include/DrmManagerService.h index 8bc59b4..45cee2e 100644 --- a/drm/libdrmframework/include/DrmManagerService.h +++ b/drm/libdrmframework/include/DrmManagerService.h @@ -42,9 +42,28 @@ public: static void instantiate(); private: + enum drm_perm_t { + CONSUME_RIGHTS = 0, + SET_PLAYBACK_STATUS = 1, + OPEN_DECRYPT_SESSION = 2, + CLOSE_DECRYPT_SESSION = 3, + INITIALIZE_DECRYPT_UNIT = 4, + DECRYPT = 5, + FINALIZE_DECRYPT_UNIT = 6, + PREAD = 7, + }; + + static const char *const drm_perm_labels[]; + DrmManagerService(); virtual ~DrmManagerService(); + static const char *get_perm_label(drm_perm_t perm); + + static bool selinuxIsProtectedCallAllowed(pid_t spid, drm_perm_t perm); + + static bool isProtectedCallAllowed(drm_perm_t perm); + public: int addUniqueId(bool isNative); diff --git a/drm/libdrmframework/include/PlugInManager.h b/drm/libdrmframework/include/PlugInManager.h index c1d019a..466844d 100644 --- a/drm/libdrmframework/include/PlugInManager.h +++ b/drm/libdrmframework/include/PlugInManager.h @@ -234,14 +234,6 @@ private: } /** - * True if the input entry is "." or ".." - */ - bool isDotOrDDot(const struct dirent* pEntry) const { - String8 sName(pEntry->d_name); - return "." == sName || ".." == sName; - } - - /** * True if input entry is directory */ bool isDirectory(const struct dirent* pEntry) const { diff --git a/drm/mediadrm/plugins/clearkey/Android.mk b/drm/mediadrm/plugins/clearkey/Android.mk index 22a85b4..b713a7f 100644 --- a/drm/mediadrm/plugins/clearkey/Android.mk +++ b/drm/mediadrm/plugins/clearkey/Android.mk @@ -31,7 +31,6 @@ LOCAL_SRC_FILES := \ Utils.cpp \ LOCAL_C_INCLUDES := \ - bionic \ external/jsmn \ external/openssl/include \ frameworks/av/drm/mediadrm/plugins/clearkey \ diff --git a/drm/mediadrm/plugins/clearkey/tests/Android.mk b/drm/mediadrm/plugins/clearkey/tests/Android.mk index ac5bb21..80f94e0 100644 --- a/drm/mediadrm/plugins/clearkey/tests/Android.mk +++ b/drm/mediadrm/plugins/clearkey/tests/Android.mk @@ -28,25 +28,17 @@ LOCAL_SRC_FILES := \ JsonWebKeyUnittest.cpp \ LOCAL_C_INCLUDES := \ - bionic \ - external/gtest/include \ external/jsmn \ external/openssl/include \ - external/stlport/stlport \ frameworks/av/drm/mediadrm/plugins/clearkey \ frameworks/av/include \ frameworks/native/include \ -LOCAL_STATIC_LIBRARIES := \ - libgtest \ - libgtest_main \ - LOCAL_SHARED_LIBRARIES := \ libcrypto \ libdrmclearkeyplugin \ liblog \ libstagefright_foundation \ - libstlport \ libutils \ include $(BUILD_NATIVE_TEST) diff --git a/include/media/stagefright/AACWriter.h b/include/media/stagefright/AACWriter.h index df1b053..d22707a 100644 --- a/include/media/stagefright/AACWriter.h +++ b/include/media/stagefright/AACWriter.h @@ -17,6 +17,7 @@ #ifndef AAC_WRITER_H_ #define AAC_WRITER_H_ +#include "foundation/ABase.h" #include <media/stagefright/MediaWriter.h> #include <utils/threads.h> diff --git a/include/media/stagefright/ClockEstimator.h b/include/media/stagefright/ClockEstimator.h index 2fd6e75..1455b7f 100644 --- a/include/media/stagefright/ClockEstimator.h +++ b/include/media/stagefright/ClockEstimator.h @@ -19,7 +19,7 @@ #define CLOCK_ESTIMATOR_H_ - +#include "foundation/ABase.h" #include <utils/RefBase.h> #include <utils/Vector.h> diff --git a/include/media/stagefright/MediaMuxer.h b/include/media/stagefright/MediaMuxer.h index bbe4303..9da98d9 100644 --- a/include/media/stagefright/MediaMuxer.h +++ b/include/media/stagefright/MediaMuxer.h @@ -22,6 +22,8 @@ #include <utils/Vector.h> #include <utils/threads.h> +#include "foundation/ABase.h" + namespace android { struct ABuffer; diff --git a/include/media/stagefright/SurfaceMediaSource.h b/include/media/stagefright/SurfaceMediaSource.h index d15a226..2177c00 100644 --- a/include/media/stagefright/SurfaceMediaSource.h +++ b/include/media/stagefright/SurfaceMediaSource.h @@ -25,6 +25,8 @@ #include <media/stagefright/MediaSource.h> #include <media/stagefright/MediaBuffer.h> +#include "foundation/ABase.h" + namespace android { // ---------------------------------------------------------------------------- @@ -233,7 +235,7 @@ private: Condition mMediaBuffersAvailableCondition; // Avoid copying and equating and default constructor - DISALLOW_IMPLICIT_CONSTRUCTORS(SurfaceMediaSource); + DISALLOW_EVIL_CONSTRUCTORS(SurfaceMediaSource); }; // ---------------------------------------------------------------------------- diff --git a/include/media/stagefright/foundation/AString.h b/include/media/stagefright/foundation/AString.h index 7c98699..c3a68e1 100644 --- a/include/media/stagefright/foundation/AString.h +++ b/include/media/stagefright/foundation/AString.h @@ -23,7 +23,7 @@ namespace android { -struct String8; +class String8; struct Parcel; struct AString { diff --git a/media/common_time/ICommonClock.cpp b/media/common_time/ICommonClock.cpp index 25ae69e..19b7d6e 100644 --- a/media/common_time/ICommonClock.cpp +++ b/media/common_time/ICommonClock.cpp @@ -206,7 +206,7 @@ class BpCommonClock : public BpInterface<ICommonClock> const sp<ICommonClockListener>& listener) { Parcel data, reply; data.writeInterfaceToken(ICommonClock::getInterfaceDescriptor()); - data.writeStrongBinder(listener->asBinder()); + data.writeStrongBinder(IInterface::asBinder(listener)); status_t status = remote()->transact(REGISTER_LISTENER, data, &reply); @@ -221,7 +221,7 @@ class BpCommonClock : public BpInterface<ICommonClock> const sp<ICommonClockListener>& listener) { Parcel data, reply; data.writeInterfaceToken(ICommonClock::getInterfaceDescriptor()); - data.writeStrongBinder(listener->asBinder()); + data.writeStrongBinder(IInterface::asBinder(listener)); status_t status = remote()->transact(UNREGISTER_LISTENER, data, &reply); if (status == OK) { diff --git a/media/libeffects/loudness/Android.mk b/media/libeffects/loudness/Android.mk index edf964e..55d0611 100644 --- a/media/libeffects/loudness/Android.mk +++ b/media/libeffects/loudness/Android.mk @@ -12,16 +12,11 @@ LOCAL_CFLAGS+= -O2 -fvisibility=hidden LOCAL_SHARED_LIBRARIES := \ libcutils \ liblog \ - libstlport LOCAL_MODULE_RELATIVE_PATH := soundfx LOCAL_MODULE:= libldnhncr LOCAL_C_INCLUDES := \ $(call include-path-for, audio-effects) \ - bionic \ - bionic/libstdc++/include \ - external/stlport/stlport - include $(BUILD_SHARED_LIBRARY) diff --git a/media/libeffects/proxy/Android.mk b/media/libeffects/proxy/Android.mk index b438796..2ba452e 100644 --- a/media/libeffects/proxy/Android.mk +++ b/media/libeffects/proxy/Android.mk @@ -28,7 +28,6 @@ LOCAL_SHARED_LIBRARIES := liblog libcutils libutils libdl libeffects LOCAL_C_INCLUDES := \ system/media/audio_effects/include \ - bionic/libc/include \ frameworks/av/media/libeffects/factory include $(BUILD_SHARED_LIBRARY) diff --git a/media/libmedia/Android.mk b/media/libmedia/Android.mk index e012116..50d9a0f 100644 --- a/media/libmedia/Android.mk +++ b/media/libmedia/Android.mk @@ -74,6 +74,8 @@ LOCAL_WHOLE_STATIC_LIBRARIES := libmedia_helper LOCAL_MODULE:= libmedia +LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk + LOCAL_C_INCLUDES := \ $(TOP)/frameworks/native/include/media/openmax \ $(TOP)/frameworks/av/include/media/ \ @@ -87,8 +89,6 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) -# for <cutils/atomic-inline.h> -LOCAL_CFLAGS += -DANDROID_SMP=$(if $(findstring true,$(TARGET_CPU_SMP)),1,0) LOCAL_SRC_FILES += SingleStateQueue.cpp LOCAL_CFLAGS += -DSINGLE_STATE_QUEUE_INSTANTIATIONS='"SingleStateQueueInstantiations.cpp"' diff --git a/media/libmedia/AudioEffect.cpp b/media/libmedia/AudioEffect.cpp index 0d5d7e4..af103c1 100644 --- a/media/libmedia/AudioEffect.cpp +++ b/media/libmedia/AudioEffect.cpp @@ -150,7 +150,7 @@ status_t AudioEffect::set(const effect_uuid_t *type, int bufOffset = ((sizeof(effect_param_cblk_t) - 1) / sizeof(int) + 1) * sizeof(int); mCblk->buffer = (uint8_t *)mCblk + bufOffset; - iEffect->asBinder()->linkToDeath(mIEffectClient); + IInterface::asBinder(iEffect)->linkToDeath(mIEffectClient); mClientPid = IPCThreadState::self()->getCallingPid(); ALOGV("set() %p OK effect: %s id: %d status %d enabled %d pid %d", this, mDescriptor.name, mId, mStatus, mEnabled, mClientPid); @@ -173,7 +173,7 @@ AudioEffect::~AudioEffect() } if (mIEffect != NULL) { mIEffect->disconnect(); - mIEffect->asBinder()->unlinkToDeath(mIEffectClient); + IInterface::asBinder(mIEffect)->unlinkToDeath(mIEffectClient); } IPCThreadState::self()->flushCommands(); } diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp index 9e7ba88..9d92cfe 100644 --- a/media/libmedia/AudioRecord.cpp +++ b/media/libmedia/AudioRecord.cpp @@ -105,7 +105,7 @@ AudioRecord::~AudioRecord() mAudioRecordThread->requestExitAndWait(); mAudioRecordThread.clear(); } - mAudioRecord->asBinder()->unlinkToDeath(mDeathNotifier, this); + IInterface::asBinder(mAudioRecord)->unlinkToDeath(mDeathNotifier, this); mAudioRecord.clear(); mCblkMemory.clear(); mBufferMemory.clear(); @@ -516,7 +516,7 @@ status_t AudioRecord::openRecord_l(size_t epoch) // invariant that mAudioRecord != 0 is true only after set() returns successfully if (mAudioRecord != 0) { - mAudioRecord->asBinder()->unlinkToDeath(mDeathNotifier, this); + IInterface::asBinder(mAudioRecord)->unlinkToDeath(mDeathNotifier, this); mDeathNotifier.clear(); } mAudioRecord = record; @@ -566,7 +566,7 @@ status_t AudioRecord::openRecord_l(size_t epoch) mProxy->setMinimum(mNotificationFramesAct); mDeathNotifier = new DeathNotifier(this); - mAudioRecord->asBinder()->linkToDeath(mDeathNotifier, this); + IInterface::asBinder(mAudioRecord)->linkToDeath(mDeathNotifier, this); return NO_ERROR; } diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 2f57b9d..b45a420 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -193,7 +193,7 @@ AudioTrack::~AudioTrack() mAudioTrackThread->requestExitAndWait(); mAudioTrackThread.clear(); } - mAudioTrack->asBinder()->unlinkToDeath(mDeathNotifier, this); + IInterface::asBinder(mAudioTrack)->unlinkToDeath(mDeathNotifier, this); mAudioTrack.clear(); mCblkMemory.clear(); mSharedBuffer.clear(); @@ -1123,7 +1123,7 @@ status_t AudioTrack::createTrack_l() } // invariant that mAudioTrack != 0 is true only after set() returns successfully if (mAudioTrack != 0) { - mAudioTrack->asBinder()->unlinkToDeath(mDeathNotifier, this); + IInterface::asBinder(mAudioTrack)->unlinkToDeath(mDeathNotifier, this); mDeathNotifier.clear(); } mAudioTrack = track; @@ -1226,7 +1226,7 @@ status_t AudioTrack::createTrack_l() mProxy->setMinimum(mNotificationFramesAct); mDeathNotifier = new DeathNotifier(this); - mAudioTrack->asBinder()->linkToDeath(mDeathNotifier, this); + IInterface::asBinder(mAudioTrack)->linkToDeath(mDeathNotifier, this); return NO_ERROR; } diff --git a/media/libmedia/IAudioFlinger.cpp b/media/libmedia/IAudioFlinger.cpp index 346a192..8e3b633 100644 --- a/media/libmedia/IAudioFlinger.cpp +++ b/media/libmedia/IAudioFlinger.cpp @@ -119,7 +119,7 @@ public: // haveSharedBuffer if (sharedBuffer != 0) { data.writeInt32(true); - data.writeStrongBinder(sharedBuffer->asBinder()); + data.writeStrongBinder(IInterface::asBinder(sharedBuffer)); } else { data.writeInt32(false); } @@ -419,7 +419,7 @@ public: { Parcel data, reply; data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor()); - data.writeStrongBinder(client->asBinder()); + data.writeStrongBinder(IInterface::asBinder(client)); remote()->transact(REGISTER_CLIENT, data, &reply); } @@ -716,7 +716,7 @@ public: data.writeInterfaceToken(IAudioFlinger::getInterfaceDescriptor()); data.write(pDesc, sizeof(effect_descriptor_t)); - data.writeStrongBinder(client->asBinder()); + data.writeStrongBinder(IInterface::asBinder(client)); data.writeInt32(priority); data.writeInt32((int32_t) output); data.writeInt32(sessionId); @@ -939,7 +939,7 @@ status_t BnAudioFlinger::onTransact( reply->writeInt32(flags); reply->writeInt32(sessionId); reply->writeInt32(status); - reply->writeStrongBinder(track->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(track)); return NO_ERROR; } break; case OPEN_RECORD: { @@ -966,9 +966,9 @@ status_t BnAudioFlinger::onTransact( reply->writeInt32(sessionId); reply->writeInt64(notificationFrames); reply->writeInt32(status); - reply->writeStrongBinder(record->asBinder()); - reply->writeStrongBinder(cblk->asBinder()); - reply->writeStrongBinder(buffers->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(record)); + reply->writeStrongBinder(IInterface::asBinder(cblk)); + reply->writeStrongBinder(IInterface::asBinder(buffers)); return NO_ERROR; } break; case SAMPLE_RATE: { @@ -1254,7 +1254,7 @@ status_t BnAudioFlinger::onTransact( reply->writeInt32(status); reply->writeInt32(id); reply->writeInt32(enabled); - reply->writeStrongBinder(effect->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(effect)); reply->write(&desc, sizeof(effect_descriptor_t)); return NO_ERROR; } break; diff --git a/media/libmedia/IAudioPolicyService.cpp b/media/libmedia/IAudioPolicyService.cpp index 89178f1..9349662 100644 --- a/media/libmedia/IAudioPolicyService.cpp +++ b/media/libmedia/IAudioPolicyService.cpp @@ -572,7 +572,7 @@ public: { Parcel data, reply; data.writeInterfaceToken(IAudioPolicyService::getInterfaceDescriptor()); - data.writeStrongBinder(client->asBinder()); + data.writeStrongBinder(IInterface::asBinder(client)); remote()->transact(REGISTER_CLIENT, data, &reply); } diff --git a/media/libmedia/IAudioTrack.cpp b/media/libmedia/IAudioTrack.cpp index 265bb1b..df209fd 100644 --- a/media/libmedia/IAudioTrack.cpp +++ b/media/libmedia/IAudioTrack.cpp @@ -137,7 +137,7 @@ public: int64_t pts) { Parcel data, reply; data.writeInterfaceToken(IAudioTrack::getInterfaceDescriptor()); - data.writeStrongBinder(buffer->asBinder()); + data.writeStrongBinder(IInterface::asBinder(buffer)); data.writeInt64(pts); status_t status = remote()->transact(QUEUE_TIMED_BUFFER, data, &reply); @@ -207,7 +207,7 @@ status_t BnAudioTrack::onTransact( switch (code) { case GET_CBLK: { CHECK_INTERFACE(IAudioTrack, data, reply); - reply->writeStrongBinder(getCblk()->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(getCblk())); return NO_ERROR; } break; case START: { @@ -241,7 +241,7 @@ status_t BnAudioTrack::onTransact( status_t status = allocateTimedBuffer(data.readInt64(), &buffer); reply->writeInt32(status); if (status == NO_ERROR) { - reply->writeStrongBinder(buffer->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(buffer)); } return NO_ERROR; } break; diff --git a/media/libmedia/IDrm.cpp b/media/libmedia/IDrm.cpp index 7e74de9..b08fa82 100644 --- a/media/libmedia/IDrm.cpp +++ b/media/libmedia/IDrm.cpp @@ -450,7 +450,7 @@ struct BpDrm : public BpInterface<IDrm> { virtual status_t setListener(const sp<IDrmClient>& listener) { Parcel data, reply; data.writeInterfaceToken(IDrm::getInterfaceDescriptor()); - data.writeStrongBinder(listener->asBinder()); + data.writeStrongBinder(IInterface::asBinder(listener)); remote()->transact(SET_LISTENER, data, &reply); return reply.readInt32(); } diff --git a/media/libmedia/IEffect.cpp b/media/libmedia/IEffect.cpp index b94012a..c2fff78 100644 --- a/media/libmedia/IEffect.cpp +++ b/media/libmedia/IEffect.cpp @@ -190,7 +190,7 @@ status_t BnEffect::onTransact( case GET_CBLK: { CHECK_INTERFACE(IEffect, data, reply); - reply->writeStrongBinder(getCblk()->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(getCblk())); return NO_ERROR; } break; diff --git a/media/libmedia/IHDCP.cpp b/media/libmedia/IHDCP.cpp index 1cf987a..9122f75 100644 --- a/media/libmedia/IHDCP.cpp +++ b/media/libmedia/IHDCP.cpp @@ -65,7 +65,7 @@ struct BpHDCP : public BpInterface<IHDCP> { virtual status_t setObserver(const sp<IHDCPObserver> &observer) { Parcel data, reply; data.writeInterfaceToken(IHDCP::getInterfaceDescriptor()); - data.writeStrongBinder(observer->asBinder()); + data.writeStrongBinder(IInterface::asBinder(observer)); remote()->transact(HDCP_SET_OBSERVER, data, &reply); return reply.readInt32(); } diff --git a/media/libmedia/IMediaDeathNotifier.cpp b/media/libmedia/IMediaDeathNotifier.cpp index 10b4934..38e9ca0 100644 --- a/media/libmedia/IMediaDeathNotifier.cpp +++ b/media/libmedia/IMediaDeathNotifier.cpp @@ -104,7 +104,7 @@ IMediaDeathNotifier::DeathNotifier::~DeathNotifier() Mutex::Autolock _l(sServiceLock); sObitRecipients.clear(); if (sMediaPlayerService != 0) { - sMediaPlayerService->asBinder()->unlinkToDeath(this); + IInterface::asBinder(sMediaPlayerService)->unlinkToDeath(this); } } diff --git a/media/libmedia/IMediaLogService.cpp b/media/libmedia/IMediaLogService.cpp index 8a66c7c..a4af7b7 100644 --- a/media/libmedia/IMediaLogService.cpp +++ b/media/libmedia/IMediaLogService.cpp @@ -42,7 +42,7 @@ public: virtual void registerWriter(const sp<IMemory>& shared, size_t size, const char *name) { Parcel data, reply; data.writeInterfaceToken(IMediaLogService::getInterfaceDescriptor()); - data.writeStrongBinder(shared->asBinder()); + data.writeStrongBinder(IInterface::asBinder(shared)); data.writeInt64((int64_t) size); data.writeCString(name); status_t status = remote()->transact(REGISTER_WRITER, data, &reply); @@ -52,7 +52,7 @@ public: virtual void unregisterWriter(const sp<IMemory>& shared) { Parcel data, reply; data.writeInterfaceToken(IMediaLogService::getInterfaceDescriptor()); - data.writeStrongBinder(shared->asBinder()); + data.writeStrongBinder(IInterface::asBinder(shared)); status_t status = remote()->transact(UNREGISTER_WRITER, data, &reply); // FIXME ignores status } diff --git a/media/libmedia/IMediaMetadataRetriever.cpp b/media/libmedia/IMediaMetadataRetriever.cpp index 38f717c..aa2665a 100644 --- a/media/libmedia/IMediaMetadataRetriever.cpp +++ b/media/libmedia/IMediaMetadataRetriever.cpp @@ -95,7 +95,7 @@ public: data.writeInterfaceToken(IMediaMetadataRetriever::getInterfaceDescriptor()); data.writeInt32(httpService != NULL); if (httpService != NULL) { - data.writeStrongBinder(httpService->asBinder()); + data.writeStrongBinder(IInterface::asBinder(httpService)); } data.writeCString(srcUrl); @@ -246,7 +246,7 @@ status_t BnMediaMetadataRetriever::onTransact( sp<IMemory> bitmap = getFrameAtTime(timeUs, option); if (bitmap != 0) { // Don't send NULL across the binder interface reply->writeInt32(NO_ERROR); - reply->writeStrongBinder(bitmap->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(bitmap)); } else { reply->writeInt32(UNKNOWN_ERROR); } @@ -263,7 +263,7 @@ status_t BnMediaMetadataRetriever::onTransact( sp<IMemory> albumArt = extractAlbumArt(); if (albumArt != 0) { // Don't send NULL across the binder interface reply->writeInt32(NO_ERROR); - reply->writeStrongBinder(albumArt->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(albumArt)); } else { reply->writeInt32(UNKNOWN_ERROR); } diff --git a/media/libmedia/IMediaPlayer.cpp b/media/libmedia/IMediaPlayer.cpp index d778d05..7f3e5cc 100644 --- a/media/libmedia/IMediaPlayer.cpp +++ b/media/libmedia/IMediaPlayer.cpp @@ -85,7 +85,7 @@ public: data.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor()); data.writeInt32(httpService != NULL); if (httpService != NULL) { - data.writeStrongBinder(httpService->asBinder()); + data.writeStrongBinder(IInterface::asBinder(httpService)); } data.writeCString(url); if (headers == NULL) { @@ -115,7 +115,7 @@ public: status_t setDataSource(const sp<IStreamSource> &source) { Parcel data, reply; data.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor()); - data.writeStrongBinder(source->asBinder()); + data.writeStrongBinder(IInterface::asBinder(source)); remote()->transact(SET_DATA_SOURCE_STREAM, data, &reply); return reply.readInt32(); } @@ -125,7 +125,7 @@ public: { Parcel data, reply; data.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor()); - sp<IBinder> b(bufferProducer->asBinder()); + sp<IBinder> b(IInterface::asBinder(bufferProducer)); data.writeStrongBinder(b); remote()->transact(SET_VIDEO_SURFACETEXTURE, data, &reply); return reply.readInt32(); @@ -323,7 +323,7 @@ public: status_t setNextPlayer(const sp<IMediaPlayer>& player) { Parcel data, reply; data.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor()); - sp<IBinder> b(player->asBinder()); + sp<IBinder> b(IInterface::asBinder(player)); data.writeStrongBinder(b); remote()->transact(SET_NEXT_PLAYER, data, &reply); return reply.readInt32(); diff --git a/media/libmedia/IMediaPlayerService.cpp b/media/libmedia/IMediaPlayerService.cpp index 2e02d17..a7568b9 100644 --- a/media/libmedia/IMediaPlayerService.cpp +++ b/media/libmedia/IMediaPlayerService.cpp @@ -73,7 +73,7 @@ public: const sp<IMediaPlayerClient>& client, int audioSessionId) { Parcel data, reply; data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor()); - data.writeStrongBinder(client->asBinder()); + data.writeStrongBinder(IInterface::asBinder(client)); data.writeInt32(audioSessionId); remote()->transact(CREATE, data, &reply); @@ -101,10 +101,10 @@ public: data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor()); data.writeInt32(httpService != NULL); if (httpService != NULL) { - data.writeStrongBinder(httpService->asBinder()); + data.writeStrongBinder(IInterface::asBinder(httpService)); } data.writeCString(url); - data.writeStrongBinder(heap->asBinder()); + data.writeStrongBinder(IInterface::asBinder(heap)); status_t status = remote()->transact(DECODE_URL, data, &reply); if (status == NO_ERROR) { status = (status_t)reply.readInt32(); @@ -127,7 +127,7 @@ public: data.writeFileDescriptor(fd); data.writeInt64(offset); data.writeInt64(length); - data.writeStrongBinder(heap->asBinder()); + data.writeStrongBinder(IInterface::asBinder(heap)); status_t status = remote()->transact(DECODE_FD, data, &reply); if (status == NO_ERROR) { status = (status_t)reply.readInt32(); @@ -188,7 +188,7 @@ public: { Parcel data, reply; data.writeInterfaceToken(IMediaPlayerService::getInterfaceDescriptor()); - data.writeStrongBinder(client->asBinder()); + data.writeStrongBinder(IInterface::asBinder(client)); data.writeString8(iface); remote()->transact(LISTEN_FOR_REMOTE_DISPLAY, data, &reply); return interface_cast<IRemoteDisplay>(reply.readStrongBinder()); @@ -216,7 +216,7 @@ status_t BnMediaPlayerService::onTransact( interface_cast<IMediaPlayerClient>(data.readStrongBinder()); int audioSessionId = data.readInt32(); sp<IMediaPlayer> player = create(client, audioSessionId); - reply->writeStrongBinder(player->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(player)); return NO_ERROR; } break; case DECODE_URL: { @@ -273,38 +273,38 @@ status_t BnMediaPlayerService::onTransact( case CREATE_MEDIA_RECORDER: { CHECK_INTERFACE(IMediaPlayerService, data, reply); sp<IMediaRecorder> recorder = createMediaRecorder(); - reply->writeStrongBinder(recorder->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(recorder)); return NO_ERROR; } break; case CREATE_METADATA_RETRIEVER: { CHECK_INTERFACE(IMediaPlayerService, data, reply); sp<IMediaMetadataRetriever> retriever = createMetadataRetriever(); - reply->writeStrongBinder(retriever->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(retriever)); return NO_ERROR; } break; case GET_OMX: { CHECK_INTERFACE(IMediaPlayerService, data, reply); sp<IOMX> omx = getOMX(); - reply->writeStrongBinder(omx->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(omx)); return NO_ERROR; } break; case MAKE_CRYPTO: { CHECK_INTERFACE(IMediaPlayerService, data, reply); sp<ICrypto> crypto = makeCrypto(); - reply->writeStrongBinder(crypto->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(crypto)); return NO_ERROR; } break; case MAKE_DRM: { CHECK_INTERFACE(IMediaPlayerService, data, reply); sp<IDrm> drm = makeDrm(); - reply->writeStrongBinder(drm->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(drm)); return NO_ERROR; } break; case MAKE_HDCP: { CHECK_INTERFACE(IMediaPlayerService, data, reply); bool createEncryptionModule = data.readInt32(); sp<IHDCP> hdcp = makeHDCP(createEncryptionModule); - reply->writeStrongBinder(hdcp->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(hdcp)); return NO_ERROR; } break; case ADD_BATTERY_DATA: { @@ -324,13 +324,13 @@ status_t BnMediaPlayerService::onTransact( interface_cast<IRemoteDisplayClient>(data.readStrongBinder())); String8 iface(data.readString8()); sp<IRemoteDisplay> display(listenForRemoteDisplay(client, iface)); - reply->writeStrongBinder(display->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(display)); return NO_ERROR; } break; case GET_CODEC_LIST: { CHECK_INTERFACE(IMediaPlayerService, data, reply); sp<IMediaCodecList> mcl = getCodecList(); - reply->writeStrongBinder(mcl->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(mcl)); return NO_ERROR; } break; default: diff --git a/media/libmedia/IMediaRecorder.cpp b/media/libmedia/IMediaRecorder.cpp index 95af006..a733b68 100644 --- a/media/libmedia/IMediaRecorder.cpp +++ b/media/libmedia/IMediaRecorder.cpp @@ -70,8 +70,8 @@ public: ALOGV("setCamera(%p,%p)", camera.get(), proxy.get()); Parcel data, reply; data.writeInterfaceToken(IMediaRecorder::getInterfaceDescriptor()); - data.writeStrongBinder(camera->asBinder()); - data.writeStrongBinder(proxy->asBinder()); + data.writeStrongBinder(IInterface::asBinder(camera)); + data.writeStrongBinder(IInterface::asBinder(proxy)); remote()->transact(SET_CAMERA, data, &reply); return reply.readInt32(); } @@ -94,7 +94,7 @@ public: ALOGV("setPreviewSurface(%p)", surface.get()); Parcel data, reply; data.writeInterfaceToken(IMediaRecorder::getInterfaceDescriptor()); - data.writeStrongBinder(surface->asBinder()); + data.writeStrongBinder(IInterface::asBinder(surface)); remote()->transact(SET_PREVIEW_SURFACE, data, &reply); return reply.readInt32(); } @@ -215,7 +215,7 @@ public: ALOGV("setListener(%p)", listener.get()); Parcel data, reply; data.writeInterfaceToken(IMediaRecorder::getInterfaceDescriptor()); - data.writeStrongBinder(listener->asBinder()); + data.writeStrongBinder(IInterface::asBinder(listener)); remote()->transact(SET_LISTENER, data, &reply); return reply.readInt32(); } @@ -468,7 +468,7 @@ status_t BnMediaRecorder::onTransact( int returnedNull= (surfaceMediaSource == NULL) ? 1 : 0 ; reply->writeInt32(returnedNull); if (!returnedNull) { - reply->writeStrongBinder(surfaceMediaSource->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(surfaceMediaSource)); } return NO_ERROR; } break; diff --git a/media/libmedia/IOMX.cpp b/media/libmedia/IOMX.cpp index c583d32..e208df9 100644 --- a/media/libmedia/IOMX.cpp +++ b/media/libmedia/IOMX.cpp @@ -100,7 +100,7 @@ public: Parcel data, reply; data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); data.writeCString(name); - data.writeStrongBinder(observer->asBinder()); + data.writeStrongBinder(IInterface::asBinder(observer)); remote()->transact(ALLOCATE_NODE, data, &reply); status_t err = reply.readInt32(); @@ -248,7 +248,7 @@ public: data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); data.writeInt32((int32_t)node); data.writeInt32(port_index); - data.writeStrongBinder(params->asBinder()); + data.writeStrongBinder(IInterface::asBinder(params)); remote()->transact(USE_BUFFER, data, &reply); status_t err = reply.readInt32(); @@ -418,7 +418,7 @@ public: data.writeInterfaceToken(IOMX::getInterfaceDescriptor()); data.writeInt32((int32_t)node); data.writeInt32(port_index); - data.writeStrongBinder(params->asBinder()); + data.writeStrongBinder(IInterface::asBinder(params)); remote()->transact(ALLOC_BUFFER_WITH_BACKUP, data, &reply); status_t err = reply.readInt32(); @@ -775,7 +775,7 @@ status_t BnOMX::onTransact( reply->writeInt32(err); if (err == OK) { - reply->writeStrongBinder(bufferProducer->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(bufferProducer)); } return NO_ERROR; diff --git a/media/libmedia/IRemoteDisplayClient.cpp b/media/libmedia/IRemoteDisplayClient.cpp index 7190879..9d63bc9 100644 --- a/media/libmedia/IRemoteDisplayClient.cpp +++ b/media/libmedia/IRemoteDisplayClient.cpp @@ -42,7 +42,7 @@ public: { Parcel data, reply; data.writeInterfaceToken(IRemoteDisplayClient::getInterfaceDescriptor()); - data.writeStrongBinder(bufferProducer->asBinder()); + data.writeStrongBinder(IInterface::asBinder(bufferProducer)); data.writeInt32(width); data.writeInt32(height); data.writeInt32(flags); diff --git a/media/libmedia/IStreamSource.cpp b/media/libmedia/IStreamSource.cpp index fe2cc61..d480aef 100644 --- a/media/libmedia/IStreamSource.cpp +++ b/media/libmedia/IStreamSource.cpp @@ -55,7 +55,7 @@ struct BpStreamSource : public BpInterface<IStreamSource> { virtual void setListener(const sp<IStreamListener> &listener) { Parcel data, reply; data.writeInterfaceToken(IStreamSource::getInterfaceDescriptor()); - data.writeStrongBinder(listener->asBinder()); + data.writeStrongBinder(IInterface::asBinder(listener)); remote()->transact(SET_LISTENER, data, &reply); } @@ -64,7 +64,7 @@ struct BpStreamSource : public BpInterface<IStreamSource> { data.writeInterfaceToken(IStreamSource::getInterfaceDescriptor()); data.writeInt64(static_cast<int64_t>(buffers.size())); for (size_t i = 0; i < buffers.size(); ++i) { - data.writeStrongBinder(buffers.itemAt(i)->asBinder()); + data.writeStrongBinder(IInterface::asBinder(buffers.itemAt(i))); } remote()->transact(SET_BUFFERS, data, &reply); } diff --git a/media/libmedia/SingleStateQueue.cpp b/media/libmedia/SingleStateQueue.cpp index 3503baa..c241184 100644 --- a/media/libmedia/SingleStateQueue.cpp +++ b/media/libmedia/SingleStateQueue.cpp @@ -16,7 +16,6 @@ #include <new> #include <cutils/atomic.h> -#include <cutils/atomic-inline.h> // for android_memory_barrier() #include <media/SingleStateQueue.h> namespace android { diff --git a/media/libmedia/mediametadataretriever.cpp b/media/libmedia/mediametadataretriever.cpp index 39a239d..8e8a1ed 100644 --- a/media/libmedia/mediametadataretriever.cpp +++ b/media/libmedia/mediametadataretriever.cpp @@ -172,7 +172,7 @@ MediaMetadataRetriever::DeathNotifier::~DeathNotifier() { Mutex::Autolock lock(sServiceLock); if (sService != 0) { - sService->asBinder()->unlinkToDeath(this); + IInterface::asBinder(sService)->unlinkToDeath(this); } } diff --git a/media/libmediaplayerservice/Drm.cpp b/media/libmediaplayerservice/Drm.cpp index 2a8b2c6..0e59e4b 100644 --- a/media/libmediaplayerservice/Drm.cpp +++ b/media/libmediaplayerservice/Drm.cpp @@ -84,10 +84,10 @@ status_t Drm::setListener(const sp<IDrmClient>& listener) { Mutex::Autolock lock(mEventLock); if (mListener != NULL){ - mListener->asBinder()->unlinkToDeath(this); + IInterface::asBinder(mListener)->unlinkToDeath(this); } if (listener != NULL) { - listener->asBinder()->linkToDeath(this); + IInterface::asBinder(listener)->linkToDeath(this); } mListener = listener; return NO_ERROR; diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp index c120898..cd5478a 100644 --- a/media/libmediaplayerservice/MediaPlayerService.cpp +++ b/media/libmediaplayerservice/MediaPlayerService.cpp @@ -817,8 +817,7 @@ status_t MediaPlayerService::Client::setVideoSurfaceTexture( sp<MediaPlayerBase> p = getPlayer(); if (p == 0) return UNKNOWN_ERROR; - sp<IBinder> binder(bufferProducer == NULL ? NULL : - bufferProducer->asBinder()); + sp<IBinder> binder(IInterface::asBinder(bufferProducer)); if (mConnectedWindowBinder == binder) { return OK; } diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.h b/media/libmediaplayerservice/nuplayer/NuPlayer.h index 5f6deee..7175e15 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.h +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.h @@ -26,7 +26,7 @@ namespace android { struct ABuffer; struct AMessage; -struct MetaData; +class MetaData; struct NuPlayerDriver; struct NuPlayer : public AHandler { diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerSource.h b/media/libmediaplayerservice/nuplayer/NuPlayerSource.h index 2f06c31..9924f18 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerSource.h +++ b/media/libmediaplayerservice/nuplayer/NuPlayerSource.h @@ -28,7 +28,6 @@ namespace android { struct ABuffer; -struct MetaData; struct MediaBuffer; struct NuPlayer::Source : public AHandler { diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp index 0e9d734..26284e9 100644 --- a/media/libstagefright/ACodec.cpp +++ b/media/libstagefright/ACodec.cpp @@ -4419,7 +4419,7 @@ void ACodec::UninitializedState::stateEntered() { ALOGV("Now uninitialized"); if (mDeathNotifier != NULL) { - mCodec->mOMX->asBinder()->unlinkToDeath(mDeathNotifier); + IInterface::asBinder(mCodec->mOMX)->unlinkToDeath(mDeathNotifier); mDeathNotifier.clear(); } @@ -4512,7 +4512,7 @@ bool ACodec::UninitializedState::onAllocateComponent(const sp<AMessage> &msg) { sp<AMessage> notify = new AMessage(kWhatOMXDied, mCodec->id()); mDeathNotifier = new DeathNotifier(notify); - if (omx->asBinder()->linkToDeath(mDeathNotifier) != OK) { + if (IInterface::asBinder(omx)->linkToDeath(mDeathNotifier) != OK) { // This was a local binder, if it dies so do we, we won't care // about any notifications in the afterlife. mDeathNotifier.clear(); @@ -4557,7 +4557,7 @@ bool ACodec::UninitializedState::onAllocateComponent(const sp<AMessage> &msg) { componentName = matchingCodecs.itemAt(matchIndex).mName.string(); quirks = matchingCodecs.itemAt(matchIndex).mQuirks; - pid_t tid = androidGetTid(); + pid_t tid = gettid(); int prevPriority = androidGetThreadPriority(tid); androidSetThreadPriority(tid, ANDROID_PRIORITY_FOREGROUND); status_t err = omx->allocateNode(componentName.c_str(), observer, &node); diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp index c3a940a..ad12bdd 100644 --- a/media/libstagefright/CameraSource.cpp +++ b/media/libstagefright/CameraSource.cpp @@ -219,7 +219,7 @@ status_t CameraSource::isCameraAvailable( mCameraFlags |= FLAGS_HOT_CAMERA; mDeathNotifier = new DeathNotifier(); // isBinderAlive needs linkToDeath to work. - mCameraRecordingProxy->asBinder()->linkToDeath(mDeathNotifier); + IInterface::asBinder(mCameraRecordingProxy)->linkToDeath(mDeathNotifier); } mCamera->lock(); @@ -702,7 +702,7 @@ void CameraSource::releaseCamera() { { Mutex::Autolock autoLock(mLock); if (mCameraRecordingProxy != 0) { - mCameraRecordingProxy->asBinder()->unlinkToDeath(mDeathNotifier); + IInterface::asBinder(mCameraRecordingProxy)->unlinkToDeath(mDeathNotifier); mCameraRecordingProxy.clear(); } mCameraFlags = 0; @@ -825,7 +825,7 @@ status_t CameraSource::read( mFrameAvailableCondition.waitRelative(mLock, mTimeBetweenFrameCaptureUs * 1000LL + CAMERA_SOURCE_TIMEOUT_NS)) { if (mCameraRecordingProxy != 0 && - !mCameraRecordingProxy->asBinder()->isBinderAlive()) { + !IInterface::asBinder(mCameraRecordingProxy)->isBinderAlive()) { ALOGW("camera recording proxy is gone"); return ERROR_END_OF_STREAM; } diff --git a/media/libstagefright/OMXClient.cpp b/media/libstagefright/OMXClient.cpp index ca031aa..230c1f7 100644 --- a/media/libstagefright/OMXClient.cpp +++ b/media/libstagefright/OMXClient.cpp @@ -37,7 +37,7 @@ struct MuxOMX : public IOMX { MuxOMX(const sp<IOMX> &remoteOMX); virtual ~MuxOMX(); - virtual IBinder *onAsBinder() { return mRemoteOMX->asBinder().get(); } + virtual IBinder *onAsBinder() { return IInterface::asBinder(mRemoteOMX).get(); } virtual bool livesLocally(node_id node, pid_t pid); diff --git a/media/libstagefright/TimedEventQueue.cpp b/media/libstagefright/TimedEventQueue.cpp index 1fdb244..7d15220 100644 --- a/media/libstagefright/TimedEventQueue.cpp +++ b/media/libstagefright/TimedEventQueue.cpp @@ -52,7 +52,7 @@ TimedEventQueue::TimedEventQueue() TimedEventQueue::~TimedEventQueue() { stop(); if (mPowerManager != 0) { - sp<IBinder> binder = mPowerManager->asBinder(); + sp<IBinder> binder = IInterface::asBinder(mPowerManager); binder->unlinkToDeath(mDeathRecipient); } } diff --git a/media/libstagefright/codecs/amrnb/dec/Android.mk b/media/libstagefright/codecs/amrnb/dec/Android.mk index b067456..4aa8c17 100644 --- a/media/libstagefright/codecs/amrnb/dec/Android.mk +++ b/media/libstagefright/codecs/amrnb/dec/Android.mk @@ -83,3 +83,24 @@ LOCAL_MODULE := libstagefright_soft_amrdec LOCAL_MODULE_TAGS := optional include $(BUILD_SHARED_LIBRARY) + +################################################################################ +include $(CLEAR_VARS) +LOCAL_SRC_FILES := \ + test/amrnbdec_test.cpp + +LOCAL_C_INCLUDES := \ + $(LOCAL_PATH)/src \ + $(LOCAL_PATH)/../common/include \ + $(call include-path-for, audio-utils) + +LOCAL_STATIC_LIBRARIES := \ + libstagefright_amrnbdec libsndfile + +LOCAL_SHARED_LIBRARIES := \ + libstagefright_amrnb_common libaudioutils + +LOCAL_MODULE := libstagefright_amrnbdec_test +LOCAL_MODULE_TAGS := optional + +include $(BUILD_EXECUTABLE) diff --git a/media/libstagefright/codecs/amrnb/dec/test/amrnbdec_test.cpp b/media/libstagefright/codecs/amrnb/dec/test/amrnbdec_test.cpp new file mode 100644 index 0000000..521fe2b --- /dev/null +++ b/media/libstagefright/codecs/amrnb/dec/test/amrnbdec_test.cpp @@ -0,0 +1,149 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <stdio.h> +#include <stdint.h> +#include <string.h> +#include <assert.h> + +#include "gsmamr_dec.h" +#include <audio_utils/sndfile.h> + +// Constants for AMR-NB +enum { + kInputBufferSize = 64, + kSamplesPerFrame = 160, + kBitsPerSample = 16, + kOutputBufferSize = kSamplesPerFrame * kBitsPerSample/8, + kSampleRate = 8000, + kChannels = 1, + kFileHeaderSize = 6 +}; +const uint32_t kFrameSizes[] = {12, 13, 15, 17, 19, 20, 26, 31}; + + +int main(int argc, char *argv[]) { + + if(argc != 3) { + fprintf(stderr, "Usage %s <input file> <output file>\n", argv[0]); + return 1; + } + + // Open the input file + FILE* fpInput = fopen(argv[1], "rb"); + if (!fpInput) { + fprintf(stderr, "Could not open %s\n", argv[1]); + return 1; + } + + // Validate the input AMR file + char header[kFileHeaderSize]; + int bytesRead = fread(header, 1, kFileHeaderSize, fpInput); + if (bytesRead != kFileHeaderSize || memcmp(header, "#!AMR\n", kFileHeaderSize)) { + fprintf(stderr, "Invalid AMR-NB file\n"); + return 1; + } + + // Open the output file + SF_INFO sfInfo; + memset(&sfInfo, 0, sizeof(SF_INFO)); + sfInfo.channels = kChannels; + sfInfo.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16; + sfInfo.samplerate = kSampleRate; + SNDFILE *handle = sf_open(argv[2], SFM_WRITE, &sfInfo); + if(!handle){ + fprintf(stderr, "Could not create %s\n", argv[2]); + return 1; + } + + // Create AMR-NB decoder instance + void* amrHandle; + int err = GSMInitDecode(&amrHandle, (Word8*)"AMRNBDecoder"); + if(err != 0){ + fprintf(stderr, "Error creating AMR-NB decoder instance\n"); + return 1; + } + + //Allocate input buffer + void *inputBuf = malloc(kInputBufferSize); + assert(inputBuf != NULL); + + //Allocate output buffer + void *outputBuf = malloc(kOutputBufferSize); + assert(outputBuf != NULL); + + + // Decode loop + uint32_t retVal = 0; + while (1) { + // Read mode + uint8_t mode; + bytesRead = fread(&mode, 1, 1, fpInput); + if (bytesRead != 1) break; + + // Find frame type + Frame_Type_3GPP frameType = (Frame_Type_3GPP)((mode >> 3) & 0x0f); + if (frameType >= AMR_SID){ + fprintf(stderr, "Frame type %d not supported\n",frameType); + retVal = 1; + break; + } + + // Find frame type + int32_t frameSize = kFrameSizes[frameType]; + bytesRead = fread(inputBuf, 1, frameSize, fpInput); + if (bytesRead != frameSize) break; + + //Decode frame + int32_t decodeStatus; + decodeStatus = AMRDecode(amrHandle, frameType, (uint8_t*)inputBuf, + (int16_t*)outputBuf, MIME_IETF); + if(decodeStatus == -1) { + fprintf(stderr, "Decoder encountered error\n"); + retVal = 1; + break; + } + + //Write output to wav + sf_writef_short(handle, (int16_t*)outputBuf, kSamplesPerFrame); + + } + + // Close input and output file + fclose(fpInput); + sf_close(handle); + + //Free allocated memory + free(inputBuf); + free(outputBuf); + + // Close decoder instance + GSMDecodeFrameExit(&amrHandle); + + return retVal; +} diff --git a/media/libstagefright/codecs/amrwbenc/Android.mk b/media/libstagefright/codecs/amrwbenc/Android.mk index 64fe8d1..024a292 100644 --- a/media/libstagefright/codecs/amrwbenc/Android.mk +++ b/media/libstagefright/codecs/amrwbenc/Android.mk @@ -86,6 +86,9 @@ LOCAL_SRC_FILES += \ endif +# ARMV5E/Filt_6k_7k_opt.s does not compile with Clang. +LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as + LOCAL_MODULE := libstagefright_amrwbenc LOCAL_ARM_MODE := arm diff --git a/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp b/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp index bb55871..cfc37b7 100644 --- a/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp +++ b/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp @@ -794,13 +794,6 @@ void SoftAVCEncoder::onQueueFilled(OMX_U32 /* portIndex */) { videoInput.coding_timestamp = (inHeader->nTimeStamp + 500) / 1000; // in ms const uint8_t *inputData = NULL; if (mStoreMetaDataInBuffers) { - if (inHeader->nFilledLen != 8) { - ALOGE("MetaData buffer is wrong size! " - "(got %u bytes, expected 8)", inHeader->nFilledLen); - mSignalledError = true; - notify(OMX_EventError, OMX_ErrorUndefined, 0, 0); - return; - } inputData = extractGraphicBuffer( mInputFrameData, (mVideoWidth * mVideoHeight * 3) >> 1, diff --git a/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp b/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp index 400f320..1d0a2f0 100644 --- a/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp +++ b/media/libstagefright/codecs/m4v_h263/enc/SoftMPEG4Encoder.cpp @@ -664,13 +664,6 @@ void SoftMPEG4Encoder::onQueueFilled(OMX_U32 /* portIndex */) { if (inHeader->nFilledLen > 0) { const uint8_t *inputData = NULL; if (mStoreMetaDataInBuffers) { - if (inHeader->nFilledLen != 8) { - ALOGE("MetaData buffer is wrong size! " - "(got %u bytes, expected 8)", inHeader->nFilledLen); - mSignalledError = true; - notify(OMX_EventError, OMX_ErrorUndefined, 0, 0); - return; - } inputData = extractGraphicBuffer( mInputFrameData, (mVideoWidth * mVideoHeight * 3) >> 1, diff --git a/media/libstagefright/codecs/on2/h264dec/Android.mk b/media/libstagefright/codecs/on2/h264dec/Android.mk index bf03ad9..e63b6b1 100644 --- a/media/libstagefright/codecs/on2/h264dec/Android.mk +++ b/media/libstagefright/codecs/on2/h264dec/Android.mk @@ -94,6 +94,8 @@ ifeq ($(TARGET_ARCH),arm) LOCAL_C_INCLUDES += $(LOCAL_PATH)/./omxdl/arm_neon/api \ $(LOCAL_PATH)/./omxdl/arm_neon/vc/api \ $(LOCAL_PATH)/./omxdl/arm_neon/vc/m4p10/api + # h264bsdWriteMacroblock.S does not compile with Clang. + LOCAL_CLANG_ASFLAGS_arm += -no-integrated-as endif endif diff --git a/media/libstagefright/codecs/on2/h264dec/inc/H264SwDecApi.h b/media/libstagefright/codecs/on2/h264dec/inc/H264SwDecApi.h index fe112bc..fe112bc 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/inc/H264SwDecApi.h +++ b/media/libstagefright/codecs/on2/h264dec/inc/H264SwDecApi.h diff --git a/media/libstagefright/codecs/on2/h264dec/inc/basetype.h b/media/libstagefright/codecs/on2/h264dec/inc/basetype.h index 63d5653..63d5653 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/inc/basetype.h +++ b/media/libstagefright/codecs/on2/h264dec/inc/basetype.h diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM.h b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM.h index 64c1958..64c1958 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM.h +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM.h diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_BitDec_s.h b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_BitDec_s.h index c738f72..c738f72 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_BitDec_s.h +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_BitDec_s.h diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_Bitstream.h b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_Bitstream.h index b699034..b699034 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_Bitstream.h +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_Bitstream.h diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_IDCTTable.h b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_IDCTTable.h index e0cfdaa..e0cfdaa 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_IDCTTable.h +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_IDCTTable.h diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_IDCT_s.h b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_IDCT_s.h index 0baa087..0baa087 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_IDCT_s.h +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_IDCT_s.h diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_MaskTable.h b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_MaskTable.h index 51118fd..51118fd 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_MaskTable.h +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_MaskTable.h diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_Version.h b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_Version.h index 41b3e1e..41b3e1e 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_Version.h +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_Version.h diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_s.h b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_s.h index 0956bd1..0956bd1 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_s.h +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armCOMM_s.h diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armOMX.h b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armOMX.h index 7a68d14..7a68d14 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armOMX.h +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/armOMX.h diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/omxtypes.h b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/omxtypes.h index 912cb0d..912cb0d 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/omxtypes.h +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/omxtypes.h diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/omxtypes_s.h b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/omxtypes_s.h index 48703d1..48703d1 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/omxtypes_s.h +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/api/omxtypes_s.h diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/src/armCOMM.c b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/src/armCOMM.c index e572a89..e572a89 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/src/armCOMM.c +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/src/armCOMM.c diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/src/armCOMM_Bitstream.c b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/src/armCOMM_Bitstream.c index 9ef9319..9ef9319 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/src/armCOMM_Bitstream.c +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/src/armCOMM_Bitstream.c diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/src/armCOMM_IDCTTable.c b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/src/armCOMM_IDCTTable.c index 3f5e279..3f5e279 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/src/armCOMM_IDCTTable.c +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/src/armCOMM_IDCTTable.c diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/src/armCOMM_MaskTable.c b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/src/armCOMM_MaskTable.c index 09f88c3..09f88c3 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/src/armCOMM_MaskTable.c +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/src/armCOMM_MaskTable.c diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/api/armVC.h b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/api/armVC.h index 35b510b..35b510b 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/api/armVC.h +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/api/armVC.h diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/api/armVCCOMM_s.h b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/api/armVCCOMM_s.h index 32a0166..32a0166 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/api/armVCCOMM_s.h +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/api/armVCCOMM_s.h diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/api/omxVC.h b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/api/omxVC.h index 7b3cc72..7b3cc72 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/api/omxVC.h +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/api/omxVC.h diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/api/omxVC_s.h b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/api/omxVC_s.h index 89f3040..89f3040 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/api/omxVC_s.h +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/api/omxVC_s.h diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/api/armVCM4P10_CAVLCTables.h b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/api/armVCM4P10_CAVLCTables.h index 547a2d9..547a2d9 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/api/armVCM4P10_CAVLCTables.h +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/api/armVCM4P10_CAVLCTables.h diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/armVCM4P10_CAVLCTables.c b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/armVCM4P10_CAVLCTables.c index 137495d..137495d 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/armVCM4P10_CAVLCTables.c +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/armVCM4P10_CAVLCTables.c diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_DeblockChroma_I.c b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_DeblockChroma_I.c index 40d4d5e..40d4d5e 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_DeblockChroma_I.c +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_DeblockChroma_I.c diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_DeblockLuma_I.c b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_DeblockLuma_I.c index 619365f..619365f 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_DeblockLuma_I.c +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_DeblockLuma_I.c diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_DecodeChromaDcCoeffsToPairCAVLC.c b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_DecodeChromaDcCoeffsToPairCAVLC.c index 4e871bf..4e871bf 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_DecodeChromaDcCoeffsToPairCAVLC.c +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_DecodeChromaDcCoeffsToPairCAVLC.c diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_DecodeCoeffsToPairCAVLC.c b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_DecodeCoeffsToPairCAVLC.c index b29e576..b29e576 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_DecodeCoeffsToPairCAVLC.c +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_DecodeCoeffsToPairCAVLC.c diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_InterpolateChroma.c b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_InterpolateChroma.c index 3ce41be..3ce41be 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_InterpolateChroma.c +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p10/src/omxVCM4P10_InterpolateChroma.c diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/api/armVCM4P2_Huff_Tables_VLC.h b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/api/armVCM4P2_Huff_Tables_VLC.h index 74b5505..74b5505 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/api/armVCM4P2_Huff_Tables_VLC.h +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/api/armVCM4P2_Huff_Tables_VLC.h diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/api/armVCM4P2_ZigZag_Tables.h b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/api/armVCM4P2_ZigZag_Tables.h index e95203a..e95203a 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/api/armVCM4P2_ZigZag_Tables.h +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/api/armVCM4P2_ZigZag_Tables.h diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/armVCM4P2_Huff_Tables_VLC.c b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/armVCM4P2_Huff_Tables_VLC.c index 38af975..38af975 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/armVCM4P2_Huff_Tables_VLC.c +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/armVCM4P2_Huff_Tables_VLC.c diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/armVCM4P2_Lookup_Tables.c b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/armVCM4P2_Lookup_Tables.c index 6948f80..6948f80 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/armVCM4P2_Lookup_Tables.c +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/armVCM4P2_Lookup_Tables.c diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/armVCM4P2_Zigzag_Tables.c b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/armVCM4P2_Zigzag_Tables.c index 21fa715..21fa715 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/armVCM4P2_Zigzag_Tables.c +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/armVCM4P2_Zigzag_Tables.c diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/omxVCM4P2_DecodeBlockCoef_Inter.c b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/omxVCM4P2_DecodeBlockCoef_Inter.c index 796ad6e..796ad6e 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/omxVCM4P2_DecodeBlockCoef_Inter.c +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/omxVCM4P2_DecodeBlockCoef_Inter.c diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/omxVCM4P2_DecodeBlockCoef_Intra.c b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/omxVCM4P2_DecodeBlockCoef_Intra.c index b28657c..b28657c 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/omxVCM4P2_DecodeBlockCoef_Intra.c +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/m4p2/src/omxVCM4P2_DecodeBlockCoef_Intra.c diff --git a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/src/armVC_Version.c b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/src/armVC_Version.c index 5d93681..5d93681 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/src/armVC_Version.c +++ b/media/libstagefright/codecs/on2/h264dec/omxdl/arm_neon/vc/src/armVC_Version.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/DecTestBench.c b/media/libstagefright/codecs/on2/h264dec/source/DecTestBench.c index dcf2ef6..dcf2ef6 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/DecTestBench.c +++ b/media/libstagefright/codecs/on2/h264dec/source/DecTestBench.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/EvaluationTestBench.c b/media/libstagefright/codecs/on2/h264dec/source/EvaluationTestBench.c index aadc75f..aadc75f 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/EvaluationTestBench.c +++ b/media/libstagefright/codecs/on2/h264dec/source/EvaluationTestBench.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/TestBenchMultipleInstance.c b/media/libstagefright/codecs/on2/h264dec/source/TestBenchMultipleInstance.c index 42170d3..42170d3 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/TestBenchMultipleInstance.c +++ b/media/libstagefright/codecs/on2/h264dec/source/TestBenchMultipleInstance.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_byte_stream.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_byte_stream.c index db77f8c..db77f8c 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_byte_stream.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_byte_stream.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_byte_stream.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_byte_stream.h index 36aec76..36aec76 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_byte_stream.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_byte_stream.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_cavlc.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_cavlc.c index 91d78bd..91d78bd 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_cavlc.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_cavlc.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_cavlc.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_cavlc.h index 80353d3..80353d3 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_cavlc.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_cavlc.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_cfg.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_cfg.h index 2baba5a..2baba5a 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_cfg.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_cfg.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_conceal.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_conceal.c index 7a262ed..7a262ed 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_conceal.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_conceal.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_conceal.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_conceal.h index 3134670..3134670 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_conceal.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_conceal.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_container.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_container.h index 99b74a0..99b74a0 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_container.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_container.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_deblocking.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_deblocking.c index f8c1f76..f8c1f76 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_deblocking.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_deblocking.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_deblocking.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_deblocking.h index 2571dda..2571dda 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_deblocking.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_deblocking.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_dpb.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_dpb.c index 9517d0a..9517d0a 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_dpb.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_dpb.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_dpb.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_dpb.h index 0e25084..0e25084 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_dpb.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_dpb.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_image.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_image.c index 7b92870..7b92870 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_image.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_image.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_image.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_image.h index ed7c18c..ed7c18c 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_image.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_image.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_inter_prediction.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_inter_prediction.c index 2a81c4a..2a81c4a 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_inter_prediction.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_inter_prediction.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_inter_prediction.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_inter_prediction.h index 94dee25..94dee25 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_inter_prediction.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_inter_prediction.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_intra_prediction.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_intra_prediction.c index 52c85e5..52c85e5 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_intra_prediction.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_intra_prediction.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_intra_prediction.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_intra_prediction.h index 4652bd5..4652bd5 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_intra_prediction.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_intra_prediction.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_macroblock_layer.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_macroblock_layer.c index 2b3e7f0..2b3e7f0 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_macroblock_layer.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_macroblock_layer.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_macroblock_layer.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_macroblock_layer.h index 32bc340..32bc340 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_macroblock_layer.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_macroblock_layer.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_nal_unit.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_nal_unit.c index e44c43a..e44c43a 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_nal_unit.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_nal_unit.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_nal_unit.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_nal_unit.h index 38957bf..38957bf 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_nal_unit.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_nal_unit.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_neighbour.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_neighbour.c index ce5eeff..ce5eeff 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_neighbour.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_neighbour.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_neighbour.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_neighbour.h index fce0ad1..fce0ad1 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_neighbour.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_neighbour.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_pic_order_cnt.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_pic_order_cnt.c index fb23352..fb23352 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_pic_order_cnt.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_pic_order_cnt.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_pic_order_cnt.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_pic_order_cnt.h index 19741eb..19741eb 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_pic_order_cnt.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_pic_order_cnt.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_pic_param_set.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_pic_param_set.c index e04dea4..e04dea4 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_pic_param_set.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_pic_param_set.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_pic_param_set.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_pic_param_set.h index 6328638..6328638 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_pic_param_set.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_pic_param_set.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_reconstruct.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_reconstruct.c index b409a06..b409a06 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_reconstruct.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_reconstruct.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_reconstruct.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_reconstruct.h index 5a1a140..5a1a140 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_reconstruct.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_reconstruct.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_sei.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_sei.c index 0756c47..0756c47 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_sei.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_sei.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_sei.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_sei.h index efe543a..efe543a 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_sei.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_sei.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_seq_param_set.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_seq_param_set.h index e18df94..e18df94 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_seq_param_set.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_seq_param_set.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_data.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_data.c index c288d4b..c288d4b 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_data.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_data.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_data.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_data.h index f23d49e..f23d49e 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_data.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_data.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_group_map.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_group_map.c index 7cbb534..7cbb534 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_group_map.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_group_map.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_group_map.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_group_map.h index 4bcb6f2..4bcb6f2 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_group_map.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_group_map.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_header.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_header.c index 23401c6..23401c6 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_header.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_header.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_header.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_header.h index 198898a..198898a 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_header.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_slice_header.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_storage.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_storage.c index 3234754..3234754 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_storage.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_storage.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_storage.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_storage.h index ba3b2da..ba3b2da 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_storage.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_storage.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_stream.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_stream.c index 20d1083..20d1083 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_stream.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_stream.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_stream.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_stream.h index 4404b66..4404b66 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_stream.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_stream.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_transform.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_transform.c index 4eb6dd0..4eb6dd0 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_transform.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_transform.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_transform.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_transform.h index 4f41a23..4f41a23 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_transform.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_transform.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.c index fb97a28..fb97a28 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.h index 216ad04..216ad04 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_util.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_vlc.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_vlc.c index 060f35e..060f35e 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_vlc.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_vlc.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_vlc.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_vlc.h index 4c16773..4c16773 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_vlc.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_vlc.h diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_vui.c b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_vui.c index 4a9335a..4a9335a 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_vui.c +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_vui.c diff --git a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_vui.h b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_vui.h index 05d52a4..05d52a4 100755..100644 --- a/media/libstagefright/codecs/on2/h264dec/source/h264bsd_vui.h +++ b/media/libstagefright/codecs/on2/h264dec/source/h264bsd_vui.h diff --git a/media/libstagefright/httplive/PlaylistFetcher.h b/media/libstagefright/httplive/PlaylistFetcher.h index 78c358f..76cc852 100644 --- a/media/libstagefright/httplive/PlaylistFetcher.h +++ b/media/libstagefright/httplive/PlaylistFetcher.h @@ -31,7 +31,7 @@ struct DataSource; struct HTTPBase; struct LiveDataSource; struct M3UParser; -struct String8; +class String8; struct PlaylistFetcher : public AHandler { enum { diff --git a/media/libstagefright/include/AACEncoder.h b/media/libstagefright/include/AACEncoder.h index 3d5fc60..52beb0e 100644 --- a/media/libstagefright/include/AACEncoder.h +++ b/media/libstagefright/include/AACEncoder.h @@ -25,7 +25,7 @@ struct VO_MEM_OPERATOR; namespace android { -struct MediaBufferGroup; +class MediaBufferGroup; class AACEncoder: public MediaSource { public: diff --git a/media/libstagefright/include/ID3.h b/media/libstagefright/include/ID3.h index e83f3ef..c2c4a6d 100644 --- a/media/libstagefright/include/ID3.h +++ b/media/libstagefright/include/ID3.h @@ -22,8 +22,8 @@ namespace android { -struct DataSource; -struct String8; +class DataSource; +class String8; struct ID3 { enum Version { diff --git a/media/libstagefright/include/MPEG2TSExtractor.h b/media/libstagefright/include/MPEG2TSExtractor.h index c5e86a6..db1187d 100644 --- a/media/libstagefright/include/MPEG2TSExtractor.h +++ b/media/libstagefright/include/MPEG2TSExtractor.h @@ -28,7 +28,7 @@ namespace android { struct AMessage; struct AnotherPacketSource; struct ATSParser; -struct DataSource; +class DataSource; struct MPEG2TSSource; struct String8; diff --git a/media/libstagefright/include/avc_utils.h b/media/libstagefright/include/avc_utils.h index d517320..c270bc1 100644 --- a/media/libstagefright/include/avc_utils.h +++ b/media/libstagefright/include/avc_utils.h @@ -23,7 +23,7 @@ namespace android { -struct ABitReader; +class ABitReader; enum { kAVCProfileBaseline = 0x42, @@ -49,7 +49,7 @@ status_t getNextNALUnit( const uint8_t **nalStart, size_t *nalSize, bool startCodeFollows = false); -struct MetaData; +class MetaData; sp<MetaData> MakeAVCCodecSpecificData(const sp<ABuffer> &accessUnit); bool IsIDR(const sp<ABuffer> &accessUnit); diff --git a/media/libstagefright/mpeg2ts/ATSParser.h b/media/libstagefright/mpeg2ts/ATSParser.h index 5d76cbd..75d76dc 100644 --- a/media/libstagefright/mpeg2ts/ATSParser.h +++ b/media/libstagefright/mpeg2ts/ATSParser.h @@ -28,7 +28,7 @@ namespace android { -struct ABitReader; +class ABitReader; struct ABuffer; struct MediaSource; diff --git a/media/libstagefright/mpeg2ts/ESQueue.h b/media/libstagefright/mpeg2ts/ESQueue.h index 7c81ff0..eb4b1c9 100644 --- a/media/libstagefright/mpeg2ts/ESQueue.h +++ b/media/libstagefright/mpeg2ts/ESQueue.h @@ -26,7 +26,7 @@ namespace android { struct ABuffer; -struct MetaData; +class MetaData; struct ElementaryStreamQueue { enum Mode { diff --git a/media/libstagefright/omx/OMX.cpp b/media/libstagefright/omx/OMX.cpp index 6d46eee..f8d38ff 100644 --- a/media/libstagefright/omx/OMX.cpp +++ b/media/libstagefright/omx/OMX.cpp @@ -245,8 +245,8 @@ status_t OMX::allocateNode( instance->setHandle(*node, handle); - mLiveNodes.add(observer->asBinder(), instance); - observer->asBinder()->linkToDeath(this); + mLiveNodes.add(IInterface::asBinder(observer), instance); + IInterface::asBinder(observer)->linkToDeath(this); return OK; } @@ -256,7 +256,7 @@ status_t OMX::freeNode(node_id node) { { Mutex::Autolock autoLock(mLock); - ssize_t index = mLiveNodes.indexOfKey(instance->observer()->asBinder()); + ssize_t index = mLiveNodes.indexOfKey(IInterface::asBinder(instance->observer())); if (index < 0) { // This could conceivably happen if the observer dies at roughly the // same time that a client attempts to free the node explicitly. @@ -265,7 +265,7 @@ status_t OMX::freeNode(node_id node) { mLiveNodes.removeItemsAt(index); } - instance->observer()->asBinder()->unlinkToDeath(this); + IInterface::asBinder(instance->observer())->unlinkToDeath(this); status_t err = instance->freeNode(mMaster); diff --git a/media/libstagefright/omx/SoftVideoEncoderOMXComponent.cpp b/media/libstagefright/omx/SoftVideoEncoderOMXComponent.cpp index 8bff142..70ec6e4 100644 --- a/media/libstagefright/omx/SoftVideoEncoderOMXComponent.cpp +++ b/media/libstagefright/omx/SoftVideoEncoderOMXComponent.cpp @@ -195,12 +195,12 @@ const uint8_t *SoftVideoEncoderOMXComponent::extractGraphicBuffer( size_t srcStride; size_t srcVStride; if (usingGraphicBuffer) { - if (srcSize < 4 + sizeof(GraphicBuffer *)) { - ALOGE("Metadata is too small (%zu vs %zu)", srcSize, 4 + sizeof(GraphicBuffer *)); + if (srcSize < sizeof(OMX_U32) + sizeof(GraphicBuffer *)) { + ALOGE("Metadata is too small (%zu vs %zu)", srcSize, sizeof(OMX_U32) + sizeof(GraphicBuffer *)); return NULL; } - GraphicBuffer *buffer = *(GraphicBuffer **)(src + 4); + GraphicBuffer *buffer = *(GraphicBuffer **)(src + sizeof(OMX_U32)); handle = buffer->handle; format = buffer->format; srcStride = buffer->stride; @@ -214,12 +214,12 @@ const uint8_t *SoftVideoEncoderOMXComponent::extractGraphicBuffer( } else { // TODO: remove this part. Check if anyone uses this. - if (srcSize < 4 + sizeof(buffer_handle_t)) { - ALOGE("Metadata is too small (%zu vs %zu)", srcSize, 4 + sizeof(buffer_handle_t)); + if (srcSize < sizeof(OMX_U32) + sizeof(buffer_handle_t)) { + ALOGE("Metadata is too small (%zu vs %zu)", srcSize, sizeof(OMX_U32) + sizeof(buffer_handle_t)); return NULL; } - handle = *(buffer_handle_t *)(src + 4); + handle = *(buffer_handle_t *)(src + sizeof(OMX_U32)); // assume HAL_PIXEL_FORMAT_RGBA_8888 // there is no way to get the src stride without the graphic buffer format = HAL_PIXEL_FORMAT_RGBA_8888; diff --git a/media/libstagefright/rtsp/AMPEG2TSAssembler.h b/media/libstagefright/rtsp/AMPEG2TSAssembler.h index 712e18e..f39c2b5 100644 --- a/media/libstagefright/rtsp/AMPEG2TSAssembler.h +++ b/media/libstagefright/rtsp/AMPEG2TSAssembler.h @@ -24,7 +24,7 @@ namespace android { struct AMessage; struct AString; -struct MetaData; +class MetaData; struct AMPEG2TSAssembler : public ARTPAssembler { AMPEG2TSAssembler( diff --git a/media/libstagefright/rtsp/ARawAudioAssembler.h b/media/libstagefright/rtsp/ARawAudioAssembler.h index ed7af08..bc1dea6 100644 --- a/media/libstagefright/rtsp/ARawAudioAssembler.h +++ b/media/libstagefright/rtsp/ARawAudioAssembler.h @@ -24,7 +24,7 @@ namespace android { struct AMessage; struct AString; -struct MetaData; +class MetaData; struct ARawAudioAssembler : public ARTPAssembler { ARawAudioAssembler( diff --git a/media/libstagefright/tests/Android.mk b/media/libstagefright/tests/Android.mk index 99b480ad..8d6ff5b 100644 --- a/media/libstagefright/tests/Android.mk +++ b/media/libstagefright/tests/Android.mk @@ -1,8 +1,7 @@ # Build the unit tests. LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) - -ifneq ($(TARGET_SIMULATOR),true) +LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk LOCAL_MODULE := SurfaceMediaSource_test @@ -22,33 +21,23 @@ LOCAL_SHARED_LIBRARIES := \ libstagefright \ libstagefright_foundation \ libstagefright_omx \ - libstlport \ libsync \ libui \ libutils \ liblog -LOCAL_STATIC_LIBRARIES := \ - libgtest \ - libgtest_main \ - LOCAL_C_INCLUDES := \ - bionic \ - bionic/libstdc++/include \ - external/gtest/include \ - external/stlport/stlport \ frameworks/av/media/libstagefright \ frameworks/av/media/libstagefright/include \ $(TOP)/frameworks/native/include/media/openmax \ LOCAL_32_BIT_ONLY := true -include $(BUILD_EXECUTABLE) - -endif +include $(BUILD_NATIVE_TEST) include $(CLEAR_VARS) +LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk LOCAL_MODULE := Utils_test @@ -64,23 +53,14 @@ LOCAL_SHARED_LIBRARIES := \ libstagefright \ libstagefright_foundation \ libstagefright_omx \ - libstlport \ - -LOCAL_STATIC_LIBRARIES := \ - libgtest \ - libgtest_main \ LOCAL_C_INCLUDES := \ - bionic \ - bionic/libstdc++/include \ - external/gtest/include \ - external/stlport/stlport \ frameworks/av/include \ frameworks/av/media/libstagefright \ frameworks/av/media/libstagefright/include \ $(TOP)/frameworks/native/include/media/openmax \ -include $(BUILD_EXECUTABLE) +include $(BUILD_NATIVE_TEST) # Include subdirectory makefiles # ============================================================ diff --git a/media/libstagefright/timedtext/TimedTextPlayer.h b/media/libstagefright/timedtext/TimedTextPlayer.h index ec8ed25..9cb49ec 100644 --- a/media/libstagefright/timedtext/TimedTextPlayer.h +++ b/media/libstagefright/timedtext/TimedTextPlayer.h @@ -27,7 +27,7 @@ namespace android { -class AMessage; +struct AMessage; class MediaPlayerBase; class TimedTextDriver; class TimedTextSource; diff --git a/media/libstagefright/timedtext/TimedTextSRTSource.h b/media/libstagefright/timedtext/TimedTextSRTSource.h index 598c200..232675e 100644 --- a/media/libstagefright/timedtext/TimedTextSRTSource.h +++ b/media/libstagefright/timedtext/TimedTextSRTSource.h @@ -25,7 +25,7 @@ namespace android { -class AString; +struct AString; class DataSource; class MediaBuffer; class Parcel; diff --git a/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp b/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp index da405e2..0c39ccf 100644 --- a/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp +++ b/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp @@ -43,6 +43,10 @@ namespace android { // static +const int64_t WifiDisplaySource::kReaperIntervalUs; +const int64_t WifiDisplaySource::kTeardownTriggerTimeouSecs; +const int64_t WifiDisplaySource::kPlaybackSessionTimeoutSecs; +const int64_t WifiDisplaySource::kPlaybackSessionTimeoutUs; const AString WifiDisplaySource::sUserAgent = MakeUserAgent(); WifiDisplaySource::WifiDisplaySource( diff --git a/media/mtp/MtpDevice.cpp b/media/mtp/MtpDevice.cpp index e0d679d..3eafd6f 100644 --- a/media/mtp/MtpDevice.cpp +++ b/media/mtp/MtpDevice.cpp @@ -131,13 +131,22 @@ MtpDevice* MtpDevice::open(const char* deviceName, int fd) { struct usb_endpoint_descriptor *ep_in_desc = NULL; struct usb_endpoint_descriptor *ep_out_desc = NULL; struct usb_endpoint_descriptor *ep_intr_desc = NULL; + //USB3 add USB_DT_SS_ENDPOINT_COMP as companion descriptor; + struct usb_ss_ep_comp_descriptor *ep_ss_ep_comp_desc = NULL; for (int i = 0; i < 3; i++) { ep = (struct usb_endpoint_descriptor *)usb_descriptor_iter_next(&iter); + if (ep && ep->bDescriptorType == USB_DT_SS_ENDPOINT_COMP) { + ALOGD("Descriptor type is USB_DT_SS_ENDPOINT_COMP for USB3 \n"); + ep_ss_ep_comp_desc = (usb_ss_ep_comp_descriptor*)ep; + ep = (struct usb_endpoint_descriptor *)usb_descriptor_iter_next(&iter); + } + if (!ep || ep->bDescriptorType != USB_DT_ENDPOINT) { ALOGE("endpoints not found\n"); usb_device_close(device); return NULL; } + if (ep->bmAttributes == USB_ENDPOINT_XFER_BULK) { if (ep->bEndpointAddress & USB_ENDPOINT_DIR_MASK) ep_in_desc = ep; diff --git a/services/audioflinger/Android.mk b/services/audioflinger/Android.mk index 697fb37..83211eb 100644 --- a/services/audioflinger/Android.mk +++ b/services/audioflinger/Android.mk @@ -68,13 +68,6 @@ LOCAL_SRC_FILES += FastCapture.cpp FastCaptureState.cpp LOCAL_CFLAGS += -DSTATE_QUEUE_INSTANTIATIONS='"StateQueueInstantiations.cpp"' -# Define ANDROID_SMP appropriately. Used to get inline tracing fast-path. -ifeq ($(TARGET_CPU_SMP),true) - LOCAL_CFLAGS += -DANDROID_SMP=1 -else - LOCAL_CFLAGS += -DANDROID_SMP=0 -endif - LOCAL_CFLAGS += -fvisibility=hidden include $(BUILD_SHARED_LIBRARY) diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index ea9d7d3..fed85e9 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -1188,7 +1188,7 @@ void AudioFlinger::registerClient(const sp<IAudioFlingerClient>& client) mNotificationClients.add(pid, notificationClient); - sp<IBinder> binder = client->asBinder(); + sp<IBinder> binder = IInterface::asBinder(client); binder->linkToDeath(notificationClient); clientAdded = true; } diff --git a/services/audioflinger/AudioResamplerSinc.cpp b/services/audioflinger/AudioResamplerSinc.cpp index d03e578..e6fb76c 100644 --- a/services/audioflinger/AudioResamplerSinc.cpp +++ b/services/audioflinger/AudioResamplerSinc.cpp @@ -31,7 +31,10 @@ #include "AudioResamplerSinc.h" - +#if defined(__clang__) && !__has_builtin(__builtin_assume_aligned) +#define __builtin_assume_aligned(p, a) \ + (((uintptr_t(p) % (a)) == 0) ? (p) : (__builtin_unreachable(), (p))) +#endif #if defined(__arm__) && !defined(__thumb__) #define USE_INLINE_ASSEMBLY (true) diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 71a6a73..a75f784 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -338,7 +338,7 @@ AudioFlinger::ThreadBase::~ThreadBase() // do not lock the mutex in destructor releaseWakeLock_l(); if (mPowerManager != 0) { - sp<IBinder> binder = mPowerManager->asBinder(); + sp<IBinder> binder = IInterface::asBinder(mPowerManager); binder->unlinkToDeath(mDeathRecipient); } } diff --git a/services/audioflinger/tests/Android.mk b/services/audioflinger/tests/Android.mk index 7bba05b..8935981 100644 --- a/services/audioflinger/tests/Android.mk +++ b/services/audioflinger/tests/Android.mk @@ -10,19 +10,10 @@ LOCAL_SHARED_LIBRARIES := \ liblog \ libutils \ libcutils \ - libstlport \ libaudioutils \ libaudioresampler -LOCAL_STATIC_LIBRARIES := \ - libgtest \ - libgtest_main - LOCAL_C_INCLUDES := \ - bionic \ - bionic/libstdc++/include \ - external/gtest/include \ - external/stlport/stlport \ $(call include-path-for, audio-utils) \ frameworks/av/services/audioflinger @@ -32,7 +23,7 @@ LOCAL_SRC_FILES := \ LOCAL_MODULE := resampler_tests LOCAL_MODULE_TAGS := tests -include $(BUILD_EXECUTABLE) +include $(BUILD_NATIVE_TEST) # # audio mixer test tool @@ -44,9 +35,6 @@ LOCAL_SRC_FILES:= \ ../AudioMixer.cpp.arm \ LOCAL_C_INCLUDES := \ - bionic \ - bionic/libstdc++/include \ - external/stlport/stlport \ $(call include-path-for, audio-effects) \ $(call include-path-for, audio-utils) \ frameworks/av/services/audioflinger @@ -55,7 +43,6 @@ LOCAL_STATIC_LIBRARIES := \ libsndfile LOCAL_SHARED_LIBRARIES := \ - libstlport \ libeffects \ libnbaio \ libcommon_time_client \ @@ -70,4 +57,6 @@ LOCAL_MODULE:= test-mixer LOCAL_MODULE_TAGS := optional +LOCAL_CXX_STL := libc++ + include $(BUILD_EXECUTABLE) diff --git a/services/audiopolicy/AudioPolicyService.cpp b/services/audiopolicy/AudioPolicyService.cpp index dd4067f..da2defe 100644 --- a/services/audiopolicy/AudioPolicyService.cpp +++ b/services/audiopolicy/AudioPolicyService.cpp @@ -35,6 +35,7 @@ #include <hardware_legacy/power.h> #include <media/AudioEffect.h> #include <media/EffectsFactoryApi.h> +#include <media/AudioParameter.h> #include <hardware/hardware.h> #include <system/audio.h> @@ -160,7 +161,7 @@ void AudioPolicyService::registerClient(const sp<IAudioPolicyServiceClient>& cli mNotificationClients.add(uid, notificationClient); - sp<IBinder> binder = client->asBinder(); + sp<IBinder> binder = IInterface::asBinder(client); binder->linkToDeath(notificationClient); } } diff --git a/services/audiopolicy/AudioPolicyService.h b/services/audiopolicy/AudioPolicyService.h index 4e68ab1..a09c084 100644 --- a/services/audiopolicy/AudioPolicyService.h +++ b/services/audiopolicy/AudioPolicyService.h @@ -30,7 +30,9 @@ #include <media/IAudioPolicyService.h> #include <media/ToneGenerator.h> #include <media/AudioEffect.h> +#ifdef USE_LEGACY_AUDIO_POLICY #include <hardware_legacy/AudioPolicyInterface.h> +#endif #include "AudioPolicyEffects.h" #include "AudioPolicyManager.h" diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index fd5a426..4229538 100644 --- a/services/camera/libcameraservice/CameraService.cpp +++ b/services/camera/libcameraservice/CameraService.cpp @@ -755,7 +755,7 @@ status_t CameraService::connect( Mutex::Autolock lock(mServiceLock); sp<BasicClient> clientTmp; if (!canConnectUnsafe(cameraId, clientPackageName, - cameraClient->asBinder(), + IInterface::asBinder(cameraClient), /*out*/clientTmp)) { return -EBUSY; } else if (client.get() != NULL) { @@ -818,7 +818,7 @@ status_t CameraService::connectLegacy( Mutex::Autolock lock(mServiceLock); sp<BasicClient> clientTmp; if (!canConnectUnsafe(cameraId, clientPackageName, - cameraClient->asBinder(), + IInterface::asBinder(cameraClient), /*out*/clientTmp)) { return -EBUSY; } else if (client.get() != NULL) { @@ -888,7 +888,7 @@ status_t CameraService::connectPro( { sp<BasicClient> client; if (!canConnectUnsafe(cameraId, clientPackageName, - cameraCb->asBinder(), + IInterface::asBinder(cameraCb), /*out*/client)) { return -EBUSY; } @@ -961,7 +961,7 @@ status_t CameraService::connectDevice( { sp<BasicClient> client; if (!canConnectUnsafe(cameraId, clientPackageName, - cameraCb->asBinder(), + IInterface::asBinder(cameraCb), /*out*/client)) { return -EBUSY; } @@ -1023,7 +1023,7 @@ status_t CameraService::addListener( Vector<sp<ICameraServiceListener> >::iterator it, end; for (it = mListenerList.begin(); it != mListenerList.end(); ++it) { - if ((*it)->asBinder() == listener->asBinder()) { + if (IInterface::asBinder(*it) == IInterface::asBinder(listener)) { ALOGW("%s: Tried to add listener %p which was already subscribed", __FUNCTION__, listener.get()); return ALREADY_EXISTS; @@ -1056,7 +1056,7 @@ status_t CameraService::removeListener( Vector<sp<ICameraServiceListener> >::iterator it; for (it = mListenerList.begin(); it != mListenerList.end(); ++it) { - if ((*it)->asBinder() == listener->asBinder()) { + if (IInterface::asBinder(*it) == IInterface::asBinder(listener)) { mListenerList.erase(it); return OK; } @@ -1169,7 +1169,7 @@ void CameraService::removeClientByRemote(const wp<IBinder>& remoteBinder) { // Found our camera, clear and leave. LOG1("removeClient: clear pro %p", clientPro.get()); - clientPro->getRemoteCallback()->asBinder()->unlinkToDeath(this); + IInterface::asBinder(clientPro->getRemoteCallback())->unlinkToDeath(this); } } @@ -1363,7 +1363,8 @@ CameraService::Client::Client(const sp<CameraService>& cameraService, int cameraId, int cameraFacing, int clientPid, uid_t clientUid, int servicePid) : - CameraService::BasicClient(cameraService, cameraClient->asBinder(), + CameraService::BasicClient(cameraService, + IInterface::asBinder(cameraClient), clientPackageName, cameraId, cameraFacing, clientPid, clientUid, @@ -1476,7 +1477,9 @@ status_t CameraService::BasicClient::finishCameraOps() { } // Always stop watching, even if no camera op is active - mAppOpsManager.stopWatchingMode(mOpsCallback); + if (mOpsCallback != NULL) { + mAppOpsManager.stopWatchingMode(mOpsCallback); + } mOpsCallback.clear(); return OK; @@ -1572,7 +1575,7 @@ CameraService::ProClient::ProClient(const sp<CameraService>& cameraService, int clientPid, uid_t clientUid, int servicePid) - : CameraService::BasicClient(cameraService, remoteCallback->asBinder(), + : CameraService::BasicClient(cameraService, IInterface::asBinder(remoteCallback), clientPackageName, cameraId, cameraFacing, clientPid, clientUid, servicePid) { diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h index a7328cf..126d8d9 100644 --- a/services/camera/libcameraservice/CameraService.h +++ b/services/camera/libcameraservice/CameraService.h @@ -273,7 +273,7 @@ public: } virtual sp<IBinder> asBinderWrapper() { - return asBinder(); + return asBinder(this); } protected: diff --git a/services/camera/libcameraservice/api1/Camera2Client.cpp b/services/camera/libcameraservice/api1/Camera2Client.cpp index f3a88a1..3bdeab2 100644 --- a/services/camera/libcameraservice/api1/Camera2Client.cpp +++ b/services/camera/libcameraservice/api1/Camera2Client.cpp @@ -165,7 +165,8 @@ status_t Camera2Client::dump(int fd, const Vector<String16>& args) { String8 result; result.appendFormat("Client2[%d] (%p) Client: %s PID: %d, dump:\n", mCameraId, - getRemoteCallback()->asBinder().get(), + (getRemoteCallback() != NULL ? + (IInterface::asBinder(getRemoteCallback()).get()) : NULL), String8(mClientPackageName).string(), mClientPid); result.append(" State: "); @@ -531,7 +532,7 @@ status_t Camera2Client::setPreviewTarget( sp<IBinder> binder; sp<ANativeWindow> window; if (bufferProducer != 0) { - binder = bufferProducer->asBinder(); + binder = IInterface::asBinder(bufferProducer); // Using controlledByApp flag to ensure that the buffer queue remains in // async mode for the old camera API, where many applications depend // on that behavior. diff --git a/services/camera/libcameraservice/api1/CameraClient.cpp b/services/camera/libcameraservice/api1/CameraClient.cpp index 1a4d9a6..bbb2fe0 100644 --- a/services/camera/libcameraservice/api1/CameraClient.cpp +++ b/services/camera/libcameraservice/api1/CameraClient.cpp @@ -118,7 +118,8 @@ status_t CameraClient::dump(int fd, const Vector<String16>& args) { size_t len = snprintf(buffer, SIZE, "Client[%d] (%p) PID: %d\n", mCameraId, - getRemoteCallback()->asBinder().get(), + (getRemoteCallback() != NULL ? + IInterface::asBinder(getRemoteCallback()).get() : NULL), mClientPid); len = (len > SIZE - 1) ? SIZE - 1 : len; write(fd, buffer, len); @@ -205,7 +206,7 @@ status_t CameraClient::connect(const sp<ICameraClient>& client) { } if (mRemoteCallback != 0 && - (client->asBinder() == mRemoteCallback->asBinder())) { + (IInterface::asBinder(client) == IInterface::asBinder(mRemoteCallback))) { LOG1("Connect to the same client"); return NO_ERROR; } @@ -328,7 +329,7 @@ status_t CameraClient::setPreviewTarget( sp<IBinder> binder; sp<ANativeWindow> window; if (bufferProducer != 0) { - binder = bufferProducer->asBinder(); + binder = IInterface::asBinder(bufferProducer); // Using controlledByApp flag to ensure that the buffer queue remains in // async mode for the old camera API, where many applications depend // on that behavior. diff --git a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp index e3301aa..920adf6 100644 --- a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp +++ b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp @@ -42,8 +42,14 @@ CameraDeviceClientBase::CameraDeviceClientBase( int clientPid, uid_t clientUid, int servicePid) : - BasicClient(cameraService, remoteCallback->asBinder(), clientPackageName, - cameraId, cameraFacing, clientPid, clientUid, servicePid), + BasicClient(cameraService, + IInterface::asBinder(remoteCallback), + clientPackageName, + cameraId, + cameraFacing, + clientPid, + clientUid, + servicePid), mRemoteCallback(remoteCallback) { } @@ -157,7 +163,7 @@ status_t CameraDeviceClient::submitRequestList(List<sp<CaptureRequest> > request if (surface == 0) continue; sp<IGraphicBufferProducer> gbp = surface->getIGraphicBufferProducer(); - int idx = mStreamMap.indexOfKey(gbp->asBinder()); + int idx = mStreamMap.indexOfKey(IInterface::asBinder(gbp)); // Trying to submit request with surface that wasn't created if (idx == NAME_NOT_FOUND) { @@ -327,7 +333,7 @@ status_t CameraDeviceClient::createStream(int width, int height, int format, // Don't create multiple streams for the same target surface { - ssize_t index = mStreamMap.indexOfKey(bufferProducer->asBinder()); + ssize_t index = mStreamMap.indexOfKey(IInterface::asBinder(bufferProducer)); if (index != NAME_NOT_FOUND) { ALOGW("%s: Camera %d: Buffer producer already has a stream for it " "(ID %zd)", @@ -353,12 +359,8 @@ status_t CameraDeviceClient::createStream(int width, int height, int format, useAsync = true; } - sp<IBinder> binder; - sp<ANativeWindow> anw; - if (bufferProducer != 0) { - binder = bufferProducer->asBinder(); - anw = new Surface(bufferProducer, useAsync); - } + sp<IBinder> binder = IInterface::asBinder(bufferProducer); + sp<ANativeWindow> anw = new Surface(bufferProducer, useAsync); // TODO: remove w,h,f since we are ignoring them @@ -395,7 +397,7 @@ status_t CameraDeviceClient::createStream(int width, int height, int format, res = mDevice->createStream(anw, width, height, format, &streamId); if (res == OK) { - mStreamMap.add(bufferProducer->asBinder(), streamId); + mStreamMap.add(binder, streamId); ALOGV("%s: Camera %d: Successfully created a new stream ID %d", __FUNCTION__, mCameraId, streamId); @@ -514,7 +516,8 @@ status_t CameraDeviceClient::dump(int fd, const Vector<String16>& args) { String8 result; result.appendFormat("CameraDeviceClient[%d] (%p) dump:\n", mCameraId, - getRemoteCallback()->asBinder().get()); + (getRemoteCallback() != NULL ? + IInterface::asBinder(getRemoteCallback()).get() : NULL) ); result.appendFormat(" Current client: %s (PID %d, UID %u)\n", String8(mClientPackageName).string(), mClientPid, mClientUid); diff --git a/services/camera/libcameraservice/api_pro/ProCamera2Client.cpp b/services/camera/libcameraservice/api_pro/ProCamera2Client.cpp index 2ea460f..59e5083 100644 --- a/services/camera/libcameraservice/api_pro/ProCamera2Client.cpp +++ b/services/camera/libcameraservice/api_pro/ProCamera2Client.cpp @@ -276,7 +276,7 @@ status_t ProCamera2Client::createStream(int width, int height, int format, sp<IBinder> binder; sp<ANativeWindow> window; if (bufferProducer != 0) { - binder = bufferProducer->asBinder(); + binder = IInterface::asBinder(bufferProducer); window = new Surface(bufferProducer); } @@ -334,7 +334,8 @@ status_t ProCamera2Client::dump(int fd, const Vector<String16>& args) { String8 result; result.appendFormat("ProCamera2Client[%d] (%p) PID: %d, dump:\n", mCameraId, - getRemoteCallback()->asBinder().get(), + (getRemoteCallback() != NULL ? + IInterface::asBinder(getRemoteCallback()).get() : NULL), mClientPid); result.append(" State:\n"); write(fd, result.string(), result.size()); diff --git a/services/camera/libcameraservice/common/Camera2ClientBase.cpp b/services/camera/libcameraservice/common/Camera2ClientBase.cpp index d6db151..453c8bd 100644 --- a/services/camera/libcameraservice/common/Camera2ClientBase.cpp +++ b/services/camera/libcameraservice/common/Camera2ClientBase.cpp @@ -128,7 +128,8 @@ status_t Camera2ClientBase<TClientBase>::dump(int fd, String8 result; result.appendFormat("Camera2ClientBase[%d] (%p) PID: %d, dump:\n", TClientBase::mCameraId, - TClientBase::getRemoteCallback()->asBinder().get(), + (TClientBase::getRemoteCallback() != NULL ? + IInterface::asBinder(TClientBase::getRemoteCallback()).get() : NULL), TClientBase::mClientPid); result.append(" State: "); diff --git a/services/camera/libcameraservice/common/Camera2ClientBase.h b/services/camera/libcameraservice/common/Camera2ClientBase.h index d198e4e..e09c1b5 100644 --- a/services/camera/libcameraservice/common/Camera2ClientBase.h +++ b/services/camera/libcameraservice/common/Camera2ClientBase.h @@ -111,7 +111,7 @@ protected: pid_t mInitialClientPid; virtual sp<IBinder> asBinderWrapper() { - return IInterface::asBinder(); + return IInterface::asBinder(this); } virtual status_t dumpDevice(int fd, const Vector<String16>& args); diff --git a/services/soundtrigger/SoundTriggerHwService.cpp b/services/soundtrigger/SoundTriggerHwService.cpp index b5aaee3..b625b01 100644 --- a/services/soundtrigger/SoundTriggerHwService.cpp +++ b/services/soundtrigger/SoundTriggerHwService.cpp @@ -143,7 +143,7 @@ status_t SoundTriggerHwService::attach(const sound_trigger_module_handle_t handl sp<Module> module = mModules.valueAt(index); module->setClient(client); - client->asBinder()->linkToDeath(module); + IInterface::asBinder(client)->linkToDeath(module); moduleInterface = module; module->setCaptureState_l(mCaptureState); @@ -510,7 +510,7 @@ void SoundTriggerHwService::Module::detach() { mModels.clear(); } if (mClient != 0) { - mClient->asBinder()->unlinkToDeath(this); + IInterface::asBinder(mClient)->unlinkToDeath(this); } sp<SoundTriggerHwService> service = mService.promote(); if (service == 0) { diff --git a/soundtrigger/ISoundTrigger.cpp b/soundtrigger/ISoundTrigger.cpp index 42280d1..eecc1ea 100644 --- a/soundtrigger/ISoundTrigger.cpp +++ b/soundtrigger/ISoundTrigger.cpp @@ -58,7 +58,7 @@ public: } Parcel data, reply; data.writeInterfaceToken(ISoundTrigger::getInterfaceDescriptor()); - data.writeStrongBinder(modelMemory->asBinder()); + data.writeStrongBinder(IInterface::asBinder(modelMemory)); status_t status = remote()->transact(LOAD_SOUND_MODEL, data, &reply); if (status != NO_ERROR || (status = (status_t)reply.readInt32()) != NO_ERROR) { @@ -91,7 +91,7 @@ public: } else { data.writeInt32(dataMemory->size()); } - data.writeStrongBinder(dataMemory->asBinder()); + data.writeStrongBinder(IInterface::asBinder(dataMemory)); status_t status = remote()->transact(START_RECOGNITION, data, &reply); if (status != NO_ERROR) { status = (status_t)reply.readInt32(); diff --git a/soundtrigger/ISoundTriggerClient.cpp b/soundtrigger/ISoundTriggerClient.cpp index b0b4428..e0d3add 100644 --- a/soundtrigger/ISoundTriggerClient.cpp +++ b/soundtrigger/ISoundTriggerClient.cpp @@ -44,7 +44,7 @@ public: { Parcel data, reply; data.writeInterfaceToken(ISoundTriggerClient::getInterfaceDescriptor()); - data.writeStrongBinder(eventMemory->asBinder()); + data.writeStrongBinder(IInterface::asBinder(eventMemory)); remote()->transact(ON_RECOGNITION_EVENT, data, &reply); @@ -54,7 +54,7 @@ public: { Parcel data, reply; data.writeInterfaceToken(ISoundTriggerClient::getInterfaceDescriptor()); - data.writeStrongBinder(eventMemory->asBinder()); + data.writeStrongBinder(IInterface::asBinder(eventMemory)); remote()->transact(ON_SOUNDMODEL_EVENT, data, &reply); @@ -63,7 +63,7 @@ public: { Parcel data, reply; data.writeInterfaceToken(ISoundTriggerClient::getInterfaceDescriptor()); - data.writeStrongBinder(eventMemory->asBinder()); + data.writeStrongBinder(IInterface::asBinder(eventMemory)); remote()->transact(ON_SERVICE_STATE_CHANGE, data, &reply); diff --git a/soundtrigger/ISoundTriggerHwService.cpp b/soundtrigger/ISoundTriggerHwService.cpp index 05728e9..75f68b8 100644 --- a/soundtrigger/ISoundTriggerHwService.cpp +++ b/soundtrigger/ISoundTriggerHwService.cpp @@ -82,7 +82,7 @@ public: Parcel data, reply; data.writeInterfaceToken(ISoundTriggerHwService::getInterfaceDescriptor()); data.write(&handle, sizeof(sound_trigger_module_handle_t)); - data.writeStrongBinder(client->asBinder()); + data.writeStrongBinder(IInterface::asBinder(client)); remote()->transact(ATTACH, data, &reply); status_t status = reply.readInt32(); if (reply.readInt32() != 0) { @@ -147,7 +147,7 @@ status_t BnSoundTriggerHwService::onTransact( reply->writeInt32(status); if (module != 0) { reply->writeInt32(1); - reply->writeStrongBinder(module->asBinder()); + reply->writeStrongBinder(IInterface::asBinder(module)); } else { reply->writeInt32(0); } diff --git a/soundtrigger/SoundTrigger.cpp b/soundtrigger/SoundTrigger.cpp index 0015c30..2138cb7 100644 --- a/soundtrigger/SoundTrigger.cpp +++ b/soundtrigger/SoundTrigger.cpp @@ -104,7 +104,7 @@ sp<SoundTrigger> SoundTrigger::attach(const sound_trigger_module_handle_t module status_t status = service->attach(module, soundTrigger, soundTrigger->mISoundTrigger); if (status == NO_ERROR && soundTrigger->mISoundTrigger != 0) { - soundTrigger->mISoundTrigger->asBinder()->linkToDeath(soundTrigger); + IInterface::asBinder(soundTrigger->mISoundTrigger)->linkToDeath(soundTrigger); } else { ALOGW("Error %d connecting to sound trigger service", status); soundTrigger.clear(); @@ -144,7 +144,7 @@ void SoundTrigger::detach() { mCallback.clear(); if (mISoundTrigger != 0) { mISoundTrigger->detach(); - mISoundTrigger->asBinder()->unlinkToDeath(this); + IInterface::asBinder(mISoundTrigger)->unlinkToDeath(this); mISoundTrigger = 0; } } |