diff options
author | Mathias Agopian <mathias@google.com> | 2009-05-22 01:27:01 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-05-22 02:16:08 -0700 |
commit | 794aaef95e1afa06b68a93c9fe9c881cf438c76a (patch) | |
tree | bbfcb678a832f347f6f4fe8398c40c744f4ed0b9 | |
parent | cde489a26a200a21bcd6a3936435ec29dc389c42 (diff) | |
parent | 0058db5fae0fecf66ee47aa1c35ddd6e11b6c66f (diff) | |
download | frameworks_av-794aaef95e1afa06b68a93c9fe9c881cf438c76a.zip frameworks_av-794aaef95e1afa06b68a93c9fe9c881cf438c76a.tar.gz frameworks_av-794aaef95e1afa06b68a93c9fe9c881cf438c76a.tar.bz2 |
merge master to master_gl
39 files changed, 109 insertions, 87 deletions
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h index 6aa40d0..e962db6 100644 --- a/include/media/AudioRecord.h +++ b/include/media/AudioRecord.h @@ -26,8 +26,8 @@ #include <utils/RefBase.h> #include <utils/Errors.h> -#include <utils/IInterface.h> -#include <utils/IMemory.h> +#include <binder/IInterface.h> +#include <binder/IMemory.h> #include <utils/threads.h> diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index ba0467c..0955819 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -26,8 +26,8 @@ #include <utils/RefBase.h> #include <utils/Errors.h> -#include <utils/IInterface.h> -#include <utils/IMemory.h> +#include <binder/IInterface.h> +#include <binder/IMemory.h> #include <utils/threads.h> diff --git a/include/media/IAudioFlinger.h b/include/media/IAudioFlinger.h index 6f13fe0..031335e 100644 --- a/include/media/IAudioFlinger.h +++ b/include/media/IAudioFlinger.h @@ -23,7 +23,7 @@ #include <utils/RefBase.h> #include <utils/Errors.h> -#include <utils/IInterface.h> +#include <binder/IInterface.h> #include <media/IAudioTrack.h> #include <media/IAudioRecord.h> #include <media/IAudioFlingerClient.h> diff --git a/include/media/IAudioFlingerClient.h b/include/media/IAudioFlingerClient.h index c3deb0b..383ec0c 100644 --- a/include/media/IAudioFlingerClient.h +++ b/include/media/IAudioFlingerClient.h @@ -19,7 +19,7 @@ #include <utils/RefBase.h> -#include <utils/IInterface.h> +#include <binder/IInterface.h> namespace android { diff --git a/include/media/IAudioRecord.h b/include/media/IAudioRecord.h index 9d45d2d..46735de 100644 --- a/include/media/IAudioRecord.h +++ b/include/media/IAudioRecord.h @@ -22,8 +22,8 @@ #include <utils/RefBase.h> #include <utils/Errors.h> -#include <utils/IInterface.h> -#include <utils/IMemory.h> +#include <binder/IInterface.h> +#include <binder/IMemory.h> namespace android { diff --git a/include/media/IAudioTrack.h b/include/media/IAudioTrack.h index 12f2111..de6426a 100644 --- a/include/media/IAudioTrack.h +++ b/include/media/IAudioTrack.h @@ -22,8 +22,8 @@ #include <utils/RefBase.h> #include <utils/Errors.h> -#include <utils/IInterface.h> -#include <utils/IMemory.h> +#include <binder/IInterface.h> +#include <binder/IMemory.h> namespace android { diff --git a/include/media/IMediaMetadataRetriever.h b/include/media/IMediaMetadataRetriever.h index c677e83..9baba8e 100644 --- a/include/media/IMediaMetadataRetriever.h +++ b/include/media/IMediaMetadataRetriever.h @@ -19,9 +19,9 @@ #define ANDROID_IMEDIAMETADATARETRIEVER_H #include <utils/RefBase.h> -#include <utils/IInterface.h> -#include <utils/Parcel.h> -#include <utils/IMemory.h> +#include <binder/IInterface.h> +#include <binder/Parcel.h> +#include <binder/IMemory.h> namespace android { diff --git a/include/media/IMediaPlayer.h b/include/media/IMediaPlayer.h index a683e74..2c4bc2a 100644 --- a/include/media/IMediaPlayer.h +++ b/include/media/IMediaPlayer.h @@ -18,8 +18,8 @@ #define ANDROID_IMEDIAPLAYER_H #include <utils/RefBase.h> -#include <utils/IInterface.h> -#include <utils/Parcel.h> +#include <binder/IInterface.h> +#include <binder/Parcel.h> namespace android { diff --git a/include/media/IMediaPlayerClient.h b/include/media/IMediaPlayerClient.h index 5d32811..eee6c97 100644 --- a/include/media/IMediaPlayerClient.h +++ b/include/media/IMediaPlayerClient.h @@ -18,8 +18,8 @@ #define ANDROID_IMEDIAPLAYERCLIENT_H #include <utils/RefBase.h> -#include <utils/IInterface.h> -#include <utils/Parcel.h> +#include <binder/IInterface.h> +#include <binder/Parcel.h> namespace android { diff --git a/include/media/IMediaPlayerService.h b/include/media/IMediaPlayerService.h index 8125cc9..469098c 100644 --- a/include/media/IMediaPlayerService.h +++ b/include/media/IMediaPlayerService.h @@ -18,8 +18,8 @@ #define ANDROID_IMEDIAPLAYERSERVICE_H #include <utils/RefBase.h> -#include <utils/IInterface.h> -#include <utils/Parcel.h> +#include <binder/IInterface.h> +#include <binder/Parcel.h> #include <media/IMediaPlayerClient.h> #include <media/IMediaPlayer.h> diff --git a/include/media/IMediaRecorder.h b/include/media/IMediaRecorder.h index 64d3a40..24ac82b 100644 --- a/include/media/IMediaRecorder.h +++ b/include/media/IMediaRecorder.h @@ -18,7 +18,7 @@ #ifndef ANDROID_IMEDIARECORDER_H #define ANDROID_IMEDIARECORDER_H -#include <utils/IInterface.h> +#include <binder/IInterface.h> namespace android { diff --git a/include/media/mediametadataretriever.h b/include/media/mediametadataretriever.h index f2719d3..3db8a0f 100644 --- a/include/media/mediametadataretriever.h +++ b/include/media/mediametadataretriever.h @@ -20,7 +20,7 @@ #include <utils/Errors.h> // for status_t #include <utils/threads.h> -#include <utils/IMemory.h> +#include <binder/IMemory.h> #include <media/IMediaMetadataRetriever.h> namespace android { diff --git a/include/media/mediaplayer.h b/include/media/mediaplayer.h index 255a67b..704a8cb 100644 --- a/include/media/mediaplayer.h +++ b/include/media/mediaplayer.h @@ -17,7 +17,7 @@ #ifndef ANDROID_MEDIAPLAYER_H #define ANDROID_MEDIAPLAYER_H -#include <utils/IMemory.h> +#include <binder/IMemory.h> #include <ui/Surface.h> #include <media/IMediaPlayerClient.h> #include <media/IMediaPlayer.h> diff --git a/include/private/binder/Static.h b/include/private/binder/Static.h new file mode 100644 index 0000000..5b0f9fc --- /dev/null +++ b/include/private/binder/Static.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2008 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. + */ + +// All static variables go here, to control initialization and +// destruction order in the library. + +#include <utils/threads.h> + +#include <binder/IBinder.h> +#include <binder/IMemory.h> +#include <binder/ProcessState.h> +#include <binder/IPermissionController.h> +#include <binder/IServiceManager.h> + +namespace android { + +// For ProcessState.cpp +extern Mutex gProcessMutex; +extern sp<ProcessState> gProcess; + +// For ServiceManager.cpp +extern Mutex gDefaultServiceManagerLock; +extern sp<IServiceManager> gDefaultServiceManager; +extern sp<IPermissionController> gPermissionController; + +} // namespace android diff --git a/include/private/utils/binder_module.h b/include/private/binder/binder_module.h index fdf327e..fdf327e 100644 --- a/include/private/utils/binder_module.h +++ b/include/private/binder/binder_module.h diff --git a/include/private/utils/Static.h b/include/private/utils/Static.h index f1439b7..d95ae0d 100644 --- a/include/private/utils/Static.h +++ b/include/private/utils/Static.h @@ -20,14 +20,6 @@ #include <utils/threads.h> #include <utils/KeyedVector.h> -#ifndef LIBUTILS_NATIVE -#include <utils/IBinder.h> -#include <utils/IMemory.h> -#include <utils/ProcessState.h> -#include <utils/IPermissionController.h> -#include <utils/IServiceManager.h> -#endif - namespace android { // For TextStream.cpp extern Vector<int32_t> gTextBuffers; @@ -40,19 +32,4 @@ extern void terminate_string8(); extern void initialize_string16(); extern void terminate_string16(); - - -#ifndef LIBUTILS_NATIVE - -// For ProcessState.cpp -extern Mutex gProcessMutex; -extern sp<ProcessState> gProcess; - -// For ServiceManager.cpp -extern Mutex gDefaultServiceManagerLock; -extern sp<IServiceManager> gDefaultServiceManager; -extern sp<IPermissionController> gPermissionController; - -#endif - } // namespace android diff --git a/media/libmedia/Android.mk b/media/libmedia/Android.mk index 8020da2..806ef52 100644 --- a/media/libmedia/Android.mk +++ b/media/libmedia/Android.mk @@ -21,7 +21,7 @@ LOCAL_SRC_FILES:= \ JetPlayer.cpp LOCAL_SHARED_LIBRARIES := \ - libui libcutils libutils libsonivox + libui libcutils libutils libbinder libsonivox LOCAL_MODULE:= libmedia diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp index 1720af0..793bbf4 100644 --- a/media/libmedia/AudioRecord.cpp +++ b/media/libmedia/AudioRecord.cpp @@ -29,11 +29,11 @@ #include <media/AudioSystem.h> #include <media/AudioRecord.h> -#include <utils/IServiceManager.h> +#include <binder/IServiceManager.h> #include <utils/Log.h> -#include <utils/MemoryDealer.h> -#include <utils/Parcel.h> -#include <utils/IPCThreadState.h> +#include <binder/MemoryDealer.h> +#include <binder/Parcel.h> +#include <binder/IPCThreadState.h> #include <utils/Timers.h> #include <cutils/atomic.h> diff --git a/media/libmedia/AudioSystem.cpp b/media/libmedia/AudioSystem.cpp index a21a7a4..86d0542 100644 --- a/media/libmedia/AudioSystem.cpp +++ b/media/libmedia/AudioSystem.cpp @@ -18,7 +18,7 @@ //#define LOG_NDEBUG 0 #include <utils/Log.h> -#include <utils/IServiceManager.h> +#include <binder/IServiceManager.h> #include <media/AudioSystem.h> #include <math.h> diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 289bd75..4a1b69e 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -32,9 +32,9 @@ #include <media/AudioTrack.h> #include <utils/Log.h> -#include <utils/MemoryDealer.h> -#include <utils/Parcel.h> -#include <utils/IPCThreadState.h> +#include <binder/MemoryDealer.h> +#include <binder/Parcel.h> +#include <binder/IPCThreadState.h> #include <utils/Timers.h> #include <cutils/atomic.h> diff --git a/media/libmedia/IAudioFlinger.cpp b/media/libmedia/IAudioFlinger.cpp index 52bd7d4..7395885 100644 --- a/media/libmedia/IAudioFlinger.cpp +++ b/media/libmedia/IAudioFlinger.cpp @@ -21,7 +21,7 @@ #include <stdint.h> #include <sys/types.h> -#include <utils/Parcel.h> +#include <binder/Parcel.h> #include <media/IAudioFlinger.h> diff --git a/media/libmedia/IAudioFlingerClient.cpp b/media/libmedia/IAudioFlingerClient.cpp index 9d00aef..dbc2bba 100644 --- a/media/libmedia/IAudioFlingerClient.cpp +++ b/media/libmedia/IAudioFlingerClient.cpp @@ -20,7 +20,7 @@ #include <stdint.h> #include <sys/types.h> -#include <utils/Parcel.h> +#include <binder/Parcel.h> #include <media/IAudioFlingerClient.h> diff --git a/media/libmedia/IAudioRecord.cpp b/media/libmedia/IAudioRecord.cpp index 6e42dac..000a304 100644 --- a/media/libmedia/IAudioRecord.cpp +++ b/media/libmedia/IAudioRecord.cpp @@ -18,7 +18,7 @@ #include <stdint.h> #include <sys/types.h> -#include <utils/Parcel.h> +#include <binder/Parcel.h> #include <media/IAudioRecord.h> diff --git a/media/libmedia/IAudioTrack.cpp b/media/libmedia/IAudioTrack.cpp index abc202d..3d25a3e 100644 --- a/media/libmedia/IAudioTrack.cpp +++ b/media/libmedia/IAudioTrack.cpp @@ -18,7 +18,7 @@ #include <stdint.h> #include <sys/types.h> -#include <utils/Parcel.h> +#include <binder/Parcel.h> #include <media/IAudioTrack.h> diff --git a/media/libmedia/IMediaMetadataRetriever.cpp b/media/libmedia/IMediaMetadataRetriever.cpp index 85b5944..dd4df99 100644 --- a/media/libmedia/IMediaMetadataRetriever.cpp +++ b/media/libmedia/IMediaMetadataRetriever.cpp @@ -17,7 +17,7 @@ #include <stdint.h> #include <sys/types.h> -#include <utils/Parcel.h> +#include <binder/Parcel.h> #include <SkBitmap.h> #include <media/IMediaMetadataRetriever.h> diff --git a/media/libmedia/IMediaPlayer.cpp b/media/libmedia/IMediaPlayer.cpp index f37519f..997251b 100644 --- a/media/libmedia/IMediaPlayer.cpp +++ b/media/libmedia/IMediaPlayer.cpp @@ -18,7 +18,7 @@ #include <stdint.h> #include <sys/types.h> -#include <utils/Parcel.h> +#include <binder/Parcel.h> #include <media/IMediaPlayer.h> #include <ui/ISurface.h> diff --git a/media/libmedia/IMediaPlayerClient.cpp b/media/libmedia/IMediaPlayerClient.cpp index 65022cd..d1f08bd 100644 --- a/media/libmedia/IMediaPlayerClient.cpp +++ b/media/libmedia/IMediaPlayerClient.cpp @@ -16,8 +16,8 @@ */ #include <utils/RefBase.h> -#include <utils/IInterface.h> -#include <utils/Parcel.h> +#include <binder/IInterface.h> +#include <binder/Parcel.h> #include <media/IMediaPlayerClient.h> diff --git a/media/libmedia/IMediaPlayerService.cpp b/media/libmedia/IMediaPlayerService.cpp index 370e3fb..8fd13ae 100644 --- a/media/libmedia/IMediaPlayerService.cpp +++ b/media/libmedia/IMediaPlayerService.cpp @@ -17,9 +17,9 @@ #include <stdint.h> #include <sys/types.h> -#include <utils/Parcel.h> +#include <binder/Parcel.h> -#include <utils/IMemory.h> +#include <binder/IMemory.h> #include <media/IMediaPlayerService.h> #include <media/IMediaRecorder.h> diff --git a/media/libmedia/IMediaRecorder.cpp b/media/libmedia/IMediaRecorder.cpp index 84d08c4..dadb38a 100644 --- a/media/libmedia/IMediaRecorder.cpp +++ b/media/libmedia/IMediaRecorder.cpp @@ -18,7 +18,7 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "IMediaRecorder" #include <utils/Log.h> -#include <utils/Parcel.h> +#include <binder/Parcel.h> #include <ui/ISurface.h> #include <ui/ICamera.h> #include <media/IMediaPlayerClient.h> diff --git a/media/libmedia/mediametadataretriever.cpp b/media/libmedia/mediametadataretriever.cpp index 09afc6c..d34a8ed 100644 --- a/media/libmedia/mediametadataretriever.cpp +++ b/media/libmedia/mediametadataretriever.cpp @@ -18,8 +18,8 @@ //#define LOG_NDEBUG 0 #define LOG_TAG "MediaMetadataRetriever" -#include <utils/IServiceManager.h> -#include <utils/IPCThreadState.h> +#include <binder/IServiceManager.h> +#include <binder/IPCThreadState.h> #include <media/mediametadataretriever.h> #include <media/IMediaPlayerService.h> #include <utils/Log.h> diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp index 809316a..0f3eb70 100644 --- a/media/libmedia/mediaplayer.cpp +++ b/media/libmedia/mediaplayer.cpp @@ -24,13 +24,13 @@ #include <unistd.h> #include <fcntl.h> -#include <utils/IServiceManager.h> -#include <utils/IPCThreadState.h> +#include <binder/IServiceManager.h> +#include <binder/IPCThreadState.h> #include <media/mediaplayer.h> #include <media/AudioTrack.h> -#include <utils/MemoryBase.h> +#include <binder/MemoryBase.h> namespace android { diff --git a/media/libmedia/mediarecorder.cpp b/media/libmedia/mediarecorder.cpp index 6b26faf..0a5df0d 100644 --- a/media/libmedia/mediarecorder.cpp +++ b/media/libmedia/mediarecorder.cpp @@ -20,7 +20,7 @@ #include <utils/Log.h> #include <ui/Surface.h> #include <media/mediarecorder.h> -#include <utils/IServiceManager.h> +#include <binder/IServiceManager.h> #include <utils/String8.h> #include <media/IMediaPlayerService.h> #include <media/IMediaRecorder.h> diff --git a/media/libmediaplayerservice/Android.mk b/media/libmediaplayerservice/Android.mk index f7f2490..0877142 100644 --- a/media/libmediaplayerservice/Android.mk +++ b/media/libmediaplayerservice/Android.mk @@ -20,6 +20,7 @@ endif LOCAL_SHARED_LIBRARIES := \ libcutils \ libutils \ + libbinder \ libvorbisidec \ libsonivox \ libopencore_player \ diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp index 8ef0dc6..a17e651 100644 --- a/media/libmediaplayerservice/MediaPlayerService.cpp +++ b/media/libmediaplayerservice/MediaPlayerService.cpp @@ -30,10 +30,10 @@ #include <cutils/atomic.h> #include <android_runtime/ActivityManager.h> -#include <utils/IPCThreadState.h> -#include <utils/IServiceManager.h> -#include <utils/MemoryHeapBase.h> -#include <utils/MemoryBase.h> +#include <binder/IPCThreadState.h> +#include <binder/IServiceManager.h> +#include <binder/MemoryHeapBase.h> +#include <binder/MemoryBase.h> #include <cutils/properties.h> #include <media/MediaPlayerInterface.h> diff --git a/media/libmediaplayerservice/MediaRecorderClient.cpp b/media/libmediaplayerservice/MediaRecorderClient.cpp index e0d2947..e54f20d 100644 --- a/media/libmediaplayerservice/MediaRecorderClient.cpp +++ b/media/libmediaplayerservice/MediaRecorderClient.cpp @@ -25,10 +25,10 @@ #include <string.h> #include <cutils/atomic.h> #include <android_runtime/ActivityManager.h> -#include <utils/IPCThreadState.h> -#include <utils/IServiceManager.h> -#include <utils/MemoryHeapBase.h> -#include <utils/MemoryBase.h> +#include <binder/IPCThreadState.h> +#include <binder/IServiceManager.h> +#include <binder/MemoryHeapBase.h> +#include <binder/MemoryBase.h> #include <media/PVMediaRecorder.h> #include <utils/String16.h> @@ -37,6 +37,7 @@ namespace android { const char* cameraPermission = "android.permission.CAMERA"; +const char* recordAudioPermission = "android.permission.RECORD_AUDIO"; static bool checkPermission(const char* permissionString) { #ifndef HAVE_ANDROID_OS @@ -86,6 +87,9 @@ status_t MediaRecorderClient::setVideoSource(int vs) status_t MediaRecorderClient::setAudioSource(int as) { LOGV("setAudioSource(%d)", as); + if (!checkPermission(recordAudioPermission)) { + return PERMISSION_DENIED; + } Mutex::Autolock lock(mLock); if (mRecorder == NULL) { LOGE("recorder is not initialized"); diff --git a/media/libmediaplayerservice/MetadataRetrieverClient.cpp b/media/libmediaplayerservice/MetadataRetrieverClient.cpp index 6cb4a34..ba8d9a8 100644 --- a/media/libmediaplayerservice/MetadataRetrieverClient.cpp +++ b/media/libmediaplayerservice/MetadataRetrieverClient.cpp @@ -26,10 +26,10 @@ #include <string.h> #include <cutils/atomic.h> -#include <utils/MemoryDealer.h> +#include <binder/MemoryDealer.h> #include <android_runtime/ActivityManager.h> -#include <utils/IPCThreadState.h> -#include <utils/IServiceManager.h> +#include <binder/IPCThreadState.h> +#include <binder/IServiceManager.h> #include <media/MediaMetadataRetrieverInterface.h> #include <media/MediaPlayerInterface.h> #include <media/PVMetadataRetriever.h> diff --git a/media/libmediaplayerservice/MetadataRetrieverClient.h b/media/libmediaplayerservice/MetadataRetrieverClient.h index ce29c98..f31f6c0 100644 --- a/media/libmediaplayerservice/MetadataRetrieverClient.h +++ b/media/libmediaplayerservice/MetadataRetrieverClient.h @@ -20,7 +20,7 @@ #include <utils.h> #include <utils/KeyedVector.h> -#include <utils/IMemory.h> +#include <binder/IMemory.h> #include <media/MediaMetadataRetrieverInterface.h> diff --git a/media/mediaserver/Android.mk b/media/mediaserver/Android.mk index c681698..a92cea8 100644 --- a/media/mediaserver/Android.mk +++ b/media/mediaserver/Android.mk @@ -8,7 +8,8 @@ LOCAL_SHARED_LIBRARIES := \ libaudioflinger \ libcameraservice \ libmediaplayerservice \ - libutils + libutils \ + libbinder base := $(LOCAL_PATH)/../.. diff --git a/media/mediaserver/main_mediaserver.cpp b/media/mediaserver/main_mediaserver.cpp index 6954b63..fbea0d4 100644 --- a/media/mediaserver/main_mediaserver.cpp +++ b/media/mediaserver/main_mediaserver.cpp @@ -20,9 +20,9 @@ #include <unistd.h> #include <grp.h> -#include <utils/IPCThreadState.h> -#include <utils/ProcessState.h> -#include <utils/IServiceManager.h> +#include <binder/IPCThreadState.h> +#include <binder/ProcessState.h> +#include <binder/IServiceManager.h> #include <utils/Log.h> #include <AudioFlinger.h> |