resolved conflicts for merge of 6957369d to lmp-mr1-dev-plus-aosp
Change-Id: Ie3bd0e24c69c0c7ae500b8eb4a1198650e993a19
This commit is contained in:
@@ -64,7 +64,7 @@ LOCAL_C_INCLUDES += \
|
|||||||
$(PV_INCLUDES) \
|
$(PV_INCLUDES) \
|
||||||
$(JNI_H_INCLUDE)
|
$(JNI_H_INCLUDE)
|
||||||
|
|
||||||
LOCAL_CFLAGS +=
|
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
|
||||||
|
|
||||||
LOCAL_MODULE:= libmedia_jni
|
LOCAL_MODULE:= libmedia_jni
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ struct GsmAmrEncoderState {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static jlong android_media_AmrInputStream_GsmAmrEncoderNew
|
static jlong android_media_AmrInputStream_GsmAmrEncoderNew
|
||||||
(JNIEnv *env, jclass clazz) {
|
(JNIEnv *env, jclass /* clazz */) {
|
||||||
GsmAmrEncoderState* gae = new GsmAmrEncoderState();
|
GsmAmrEncoderState* gae = new GsmAmrEncoderState();
|
||||||
if (gae == NULL) {
|
if (gae == NULL) {
|
||||||
jniThrowRuntimeException(env, "Out of memory");
|
jniThrowRuntimeException(env, "Out of memory");
|
||||||
@@ -59,7 +59,7 @@ static jlong android_media_AmrInputStream_GsmAmrEncoderNew
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void android_media_AmrInputStream_GsmAmrEncoderInitialize
|
static void android_media_AmrInputStream_GsmAmrEncoderInitialize
|
||||||
(JNIEnv *env, jclass clazz, jlong gae) {
|
(JNIEnv *env, jclass /* clazz */, jlong gae) {
|
||||||
GsmAmrEncoderState *state = (GsmAmrEncoderState *) gae;
|
GsmAmrEncoderState *state = (GsmAmrEncoderState *) gae;
|
||||||
int32_t nResult = AMREncodeInit(&state->mEncState, &state->mSidState, false);
|
int32_t nResult = AMREncodeInit(&state->mEncState, &state->mSidState, false);
|
||||||
if (nResult != OK) {
|
if (nResult != OK) {
|
||||||
@@ -69,7 +69,7 @@ static void android_media_AmrInputStream_GsmAmrEncoderInitialize
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jint android_media_AmrInputStream_GsmAmrEncoderEncode
|
static jint android_media_AmrInputStream_GsmAmrEncoderEncode
|
||||||
(JNIEnv *env, jclass clazz,
|
(JNIEnv *env, jclass /* clazz */,
|
||||||
jlong gae, jbyteArray pcm, jint pcmOffset, jbyteArray amr, jint amrOffset) {
|
jlong gae, jbyteArray pcm, jint pcmOffset, jbyteArray amr, jint amrOffset) {
|
||||||
|
|
||||||
jbyte inBuf[BYTES_PER_FRAME];
|
jbyte inBuf[BYTES_PER_FRAME];
|
||||||
@@ -105,7 +105,7 @@ static jint android_media_AmrInputStream_GsmAmrEncoderEncode
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void android_media_AmrInputStream_GsmAmrEncoderCleanup
|
static void android_media_AmrInputStream_GsmAmrEncoderCleanup
|
||||||
(JNIEnv *env, jclass clazz, jlong gae) {
|
(JNIEnv* /* env */, jclass /* clazz */, jlong gae) {
|
||||||
GsmAmrEncoderState *state = (GsmAmrEncoderState *) gae;
|
GsmAmrEncoderState *state = (GsmAmrEncoderState *) gae;
|
||||||
AMREncodeExit(&state->mEncState, &state->mSidState);
|
AMREncodeExit(&state->mEncState, &state->mSidState);
|
||||||
state->mEncState = NULL;
|
state->mEncState = NULL;
|
||||||
@@ -113,7 +113,7 @@ static void android_media_AmrInputStream_GsmAmrEncoderCleanup
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void android_media_AmrInputStream_GsmAmrEncoderDelete
|
static void android_media_AmrInputStream_GsmAmrEncoderDelete
|
||||||
(JNIEnv *env, jclass clazz, jlong gae) {
|
(JNIEnv* /* env */, jclass /* clazz */, jlong gae) {
|
||||||
delete (GsmAmrEncoderState*)gae;
|
delete (GsmAmrEncoderState*)gae;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -502,7 +502,6 @@ static jint Image_imageGetPixelStride(JNIEnv* env, CpuConsumer::LockedBuffer* bu
|
|||||||
case HAL_PIXEL_FORMAT_Y8:
|
case HAL_PIXEL_FORMAT_Y8:
|
||||||
// Single plane 8bpp data.
|
// Single plane 8bpp data.
|
||||||
ALOG_ASSERT(idx == 0, "Wrong index: %d", idx);
|
ALOG_ASSERT(idx == 0, "Wrong index: %d", idx);
|
||||||
pixelStride;
|
|
||||||
break;
|
break;
|
||||||
case HAL_PIXEL_FORMAT_YV12:
|
case HAL_PIXEL_FORMAT_YV12:
|
||||||
pixelStride = 1;
|
pixelStride = 1;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ static sp<IMediaCodecList> getCodecList(JNIEnv *env) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jint android_media_MediaCodecList_getCodecCount(
|
static jint android_media_MediaCodecList_getCodecCount(
|
||||||
JNIEnv *env, jobject thiz) {
|
JNIEnv *env, jobject /* thiz */) {
|
||||||
sp<IMediaCodecList> mcl = getCodecList(env);
|
sp<IMediaCodecList> mcl = getCodecList(env);
|
||||||
if (mcl == NULL) {
|
if (mcl == NULL) {
|
||||||
// Runtime exception already pending.
|
// Runtime exception already pending.
|
||||||
@@ -52,7 +52,7 @@ static jint android_media_MediaCodecList_getCodecCount(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jstring android_media_MediaCodecList_getCodecName(
|
static jstring android_media_MediaCodecList_getCodecName(
|
||||||
JNIEnv *env, jobject thiz, jint index) {
|
JNIEnv *env, jobject /* thiz */, jint index) {
|
||||||
sp<IMediaCodecList> mcl = getCodecList(env);
|
sp<IMediaCodecList> mcl = getCodecList(env);
|
||||||
if (mcl == NULL) {
|
if (mcl == NULL) {
|
||||||
// Runtime exception already pending.
|
// Runtime exception already pending.
|
||||||
@@ -70,7 +70,7 @@ static jstring android_media_MediaCodecList_getCodecName(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jint android_media_MediaCodecList_findCodecByName(
|
static jint android_media_MediaCodecList_findCodecByName(
|
||||||
JNIEnv *env, jobject thiz, jstring name) {
|
JNIEnv *env, jobject /* thiz */, jstring name) {
|
||||||
if (name == NULL) {
|
if (name == NULL) {
|
||||||
jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
|
jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
@@ -95,7 +95,7 @@ static jint android_media_MediaCodecList_findCodecByName(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jboolean android_media_MediaCodecList_isEncoder(
|
static jboolean android_media_MediaCodecList_isEncoder(
|
||||||
JNIEnv *env, jobject thiz, jint index) {
|
JNIEnv *env, jobject /* thiz */, jint index) {
|
||||||
sp<IMediaCodecList> mcl = getCodecList(env);
|
sp<IMediaCodecList> mcl = getCodecList(env);
|
||||||
if (mcl == NULL) {
|
if (mcl == NULL) {
|
||||||
// Runtime exception already pending.
|
// Runtime exception already pending.
|
||||||
@@ -112,7 +112,7 @@ static jboolean android_media_MediaCodecList_isEncoder(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jarray android_media_MediaCodecList_getSupportedTypes(
|
static jarray android_media_MediaCodecList_getSupportedTypes(
|
||||||
JNIEnv *env, jobject thiz, jint index) {
|
JNIEnv *env, jobject /* thiz */, jint index) {
|
||||||
sp<IMediaCodecList> mcl = getCodecList(env);
|
sp<IMediaCodecList> mcl = getCodecList(env);
|
||||||
if (mcl == NULL) {
|
if (mcl == NULL) {
|
||||||
// Runtime exception already pending.
|
// Runtime exception already pending.
|
||||||
@@ -144,7 +144,7 @@ static jarray android_media_MediaCodecList_getSupportedTypes(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jobject android_media_MediaCodecList_getCodecCapabilities(
|
static jobject android_media_MediaCodecList_getCodecCapabilities(
|
||||||
JNIEnv *env, jobject thiz, jint index, jstring type) {
|
JNIEnv *env, jobject /* thiz */, jint index, jstring type) {
|
||||||
if (type == NULL) {
|
if (type == NULL) {
|
||||||
jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
|
jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -262,7 +262,7 @@ static jobject android_media_MediaCodecList_getCodecCapabilities(
|
|||||||
return caps;
|
return caps;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void android_media_MediaCodecList_native_init(JNIEnv *env) {
|
static void android_media_MediaCodecList_native_init(JNIEnv* /* env */) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static JNINativeMethod gMethods[] = {
|
static JNINativeMethod gMethods[] = {
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ static void android_media_MediaCrypto_native_finalize(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jboolean android_media_MediaCrypto_isCryptoSchemeSupportedNative(
|
static jboolean android_media_MediaCrypto_isCryptoSchemeSupportedNative(
|
||||||
JNIEnv *env, jobject thiz, jbyteArray uuidObj) {
|
JNIEnv *env, jobject /* thiz */, jbyteArray uuidObj) {
|
||||||
jsize uuidLength = env->GetArrayLength(uuidObj);
|
jsize uuidLength = env->GetArrayLength(uuidObj);
|
||||||
|
|
||||||
if (uuidLength != 16) {
|
if (uuidLength != 16) {
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ static void android_media_MediaDrm_native_finalize(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jboolean android_media_MediaDrm_isCryptoSchemeSupportedNative(
|
static jboolean android_media_MediaDrm_isCryptoSchemeSupportedNative(
|
||||||
JNIEnv *env, jobject thiz, jbyteArray uuidObj, jstring jmimeType) {
|
JNIEnv *env, jobject /* thiz */, jbyteArray uuidObj, jstring jmimeType) {
|
||||||
|
|
||||||
if (uuidObj == NULL) {
|
if (uuidObj == NULL) {
|
||||||
jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
|
jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
|
||||||
@@ -1173,7 +1173,7 @@ static void android_media_MediaDrm_setPropertyByteArray(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void android_media_MediaDrm_setCipherAlgorithmNative(
|
static void android_media_MediaDrm_setCipherAlgorithmNative(
|
||||||
JNIEnv *env, jobject thiz, jobject jdrm, jbyteArray jsessionId,
|
JNIEnv *env, jobject /* thiz */, jobject jdrm, jbyteArray jsessionId,
|
||||||
jstring jalgorithm) {
|
jstring jalgorithm) {
|
||||||
|
|
||||||
sp<IDrm> drm = GetDrm(env, jdrm);
|
sp<IDrm> drm = GetDrm(env, jdrm);
|
||||||
@@ -1197,7 +1197,7 @@ static void android_media_MediaDrm_setCipherAlgorithmNative(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void android_media_MediaDrm_setMacAlgorithmNative(
|
static void android_media_MediaDrm_setMacAlgorithmNative(
|
||||||
JNIEnv *env, jobject thiz, jobject jdrm, jbyteArray jsessionId,
|
JNIEnv *env, jobject /* thiz */, jobject jdrm, jbyteArray jsessionId,
|
||||||
jstring jalgorithm) {
|
jstring jalgorithm) {
|
||||||
|
|
||||||
sp<IDrm> drm = GetDrm(env, jdrm);
|
sp<IDrm> drm = GetDrm(env, jdrm);
|
||||||
@@ -1222,7 +1222,7 @@ static void android_media_MediaDrm_setMacAlgorithmNative(
|
|||||||
|
|
||||||
|
|
||||||
static jbyteArray android_media_MediaDrm_encryptNative(
|
static jbyteArray android_media_MediaDrm_encryptNative(
|
||||||
JNIEnv *env, jobject thiz, jobject jdrm, jbyteArray jsessionId,
|
JNIEnv *env, jobject /* thiz */, jobject jdrm, jbyteArray jsessionId,
|
||||||
jbyteArray jkeyId, jbyteArray jinput, jbyteArray jiv) {
|
jbyteArray jkeyId, jbyteArray jinput, jbyteArray jiv) {
|
||||||
|
|
||||||
sp<IDrm> drm = GetDrm(env, jdrm);
|
sp<IDrm> drm = GetDrm(env, jdrm);
|
||||||
@@ -1253,7 +1253,7 @@ static jbyteArray android_media_MediaDrm_encryptNative(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jbyteArray android_media_MediaDrm_decryptNative(
|
static jbyteArray android_media_MediaDrm_decryptNative(
|
||||||
JNIEnv *env, jobject thiz, jobject jdrm, jbyteArray jsessionId,
|
JNIEnv *env, jobject /* thiz */, jobject jdrm, jbyteArray jsessionId,
|
||||||
jbyteArray jkeyId, jbyteArray jinput, jbyteArray jiv) {
|
jbyteArray jkeyId, jbyteArray jinput, jbyteArray jiv) {
|
||||||
|
|
||||||
sp<IDrm> drm = GetDrm(env, jdrm);
|
sp<IDrm> drm = GetDrm(env, jdrm);
|
||||||
@@ -1283,7 +1283,7 @@ static jbyteArray android_media_MediaDrm_decryptNative(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jbyteArray android_media_MediaDrm_signNative(
|
static jbyteArray android_media_MediaDrm_signNative(
|
||||||
JNIEnv *env, jobject thiz, jobject jdrm, jbyteArray jsessionId,
|
JNIEnv *env, jobject /* thiz */, jobject jdrm, jbyteArray jsessionId,
|
||||||
jbyteArray jkeyId, jbyteArray jmessage) {
|
jbyteArray jkeyId, jbyteArray jmessage) {
|
||||||
|
|
||||||
sp<IDrm> drm = GetDrm(env, jdrm);
|
sp<IDrm> drm = GetDrm(env, jdrm);
|
||||||
@@ -1313,7 +1313,7 @@ static jbyteArray android_media_MediaDrm_signNative(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jboolean android_media_MediaDrm_verifyNative(
|
static jboolean android_media_MediaDrm_verifyNative(
|
||||||
JNIEnv *env, jobject thiz, jobject jdrm, jbyteArray jsessionId,
|
JNIEnv *env, jobject /* thiz */, jobject jdrm, jbyteArray jsessionId,
|
||||||
jbyteArray jkeyId, jbyteArray jmessage, jbyteArray jsignature) {
|
jbyteArray jkeyId, jbyteArray jmessage, jbyteArray jsignature) {
|
||||||
|
|
||||||
sp<IDrm> drm = GetDrm(env, jdrm);
|
sp<IDrm> drm = GetDrm(env, jdrm);
|
||||||
@@ -1342,7 +1342,7 @@ static jboolean android_media_MediaDrm_verifyNative(
|
|||||||
|
|
||||||
|
|
||||||
static jbyteArray android_media_MediaDrm_signRSANative(
|
static jbyteArray android_media_MediaDrm_signRSANative(
|
||||||
JNIEnv *env, jobject thiz, jobject jdrm, jbyteArray jsessionId,
|
JNIEnv *env, jobject /* thiz */, jobject jdrm, jbyteArray jsessionId,
|
||||||
jstring jalgorithm, jbyteArray jwrappedKey, jbyteArray jmessage) {
|
jstring jalgorithm, jbyteArray jwrappedKey, jbyteArray jmessage) {
|
||||||
|
|
||||||
sp<IDrm> drm = GetDrm(env, jdrm);
|
sp<IDrm> drm = GetDrm(env, jdrm);
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ static MediaMetadataRetriever* getRetriever(JNIEnv* env, jobject thiz)
|
|||||||
static void setRetriever(JNIEnv* env, jobject thiz, MediaMetadataRetriever* retriever)
|
static void setRetriever(JNIEnv* env, jobject thiz, MediaMetadataRetriever* retriever)
|
||||||
{
|
{
|
||||||
// No lock is needed, since it is called internally by other methods that are protected
|
// No lock is needed, since it is called internally by other methods that are protected
|
||||||
MediaMetadataRetriever *old = (MediaMetadataRetriever*) env->GetLongField(thiz, fields.context);
|
|
||||||
env->SetLongField(thiz, fields.context, (jlong) retriever);
|
env->SetLongField(thiz, fields.context, (jlong) retriever);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ static fields_t gFields;
|
|||||||
using namespace android;
|
using namespace android;
|
||||||
|
|
||||||
static jint android_media_MediaMuxer_addTrack(
|
static jint android_media_MediaMuxer_addTrack(
|
||||||
JNIEnv *env, jclass clazz, jlong nativeObject, jobjectArray keys,
|
JNIEnv *env, jclass /* clazz */, jlong nativeObject, jobjectArray keys,
|
||||||
jobjectArray values) {
|
jobjectArray values) {
|
||||||
sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject));
|
sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject));
|
||||||
if (muxer == NULL) {
|
if (muxer == NULL) {
|
||||||
@@ -71,7 +71,7 @@ static jint android_media_MediaMuxer_addTrack(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void android_media_MediaMuxer_writeSampleData(
|
static void android_media_MediaMuxer_writeSampleData(
|
||||||
JNIEnv *env, jclass clazz, jlong nativeObject, jint trackIndex,
|
JNIEnv *env, jclass /* clazz */, jlong nativeObject, jint trackIndex,
|
||||||
jobject byteBuf, jint offset, jint size, jlong timeUs, jint flags) {
|
jobject byteBuf, jint offset, jint size, jlong timeUs, jint flags) {
|
||||||
sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject));
|
sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject));
|
||||||
if (muxer == NULL) {
|
if (muxer == NULL) {
|
||||||
@@ -146,7 +146,7 @@ static jlong android_media_MediaMuxer_native_setup(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void android_media_MediaMuxer_setOrientationHint(
|
static void android_media_MediaMuxer_setOrientationHint(
|
||||||
JNIEnv *env, jclass clazz, jlong nativeObject, jint degrees) {
|
JNIEnv *env, jclass /* clazz */, jlong nativeObject, jint degrees) {
|
||||||
sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject));
|
sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject));
|
||||||
if (muxer == NULL) {
|
if (muxer == NULL) {
|
||||||
jniThrowException(env, "java/lang/IllegalStateException",
|
jniThrowException(env, "java/lang/IllegalStateException",
|
||||||
@@ -164,7 +164,7 @@ static void android_media_MediaMuxer_setOrientationHint(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void android_media_MediaMuxer_setLocation(
|
static void android_media_MediaMuxer_setLocation(
|
||||||
JNIEnv *env, jclass clazz, jlong nativeObject, jint latitude, jint longitude) {
|
JNIEnv *env, jclass /* clazz */, jlong nativeObject, jint latitude, jint longitude) {
|
||||||
MediaMuxer* muxer = reinterpret_cast<MediaMuxer *>(nativeObject);
|
MediaMuxer* muxer = reinterpret_cast<MediaMuxer *>(nativeObject);
|
||||||
|
|
||||||
status_t res = muxer->setLocation(latitude, longitude);
|
status_t res = muxer->setLocation(latitude, longitude);
|
||||||
@@ -175,7 +175,7 @@ static void android_media_MediaMuxer_setLocation(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void android_media_MediaMuxer_start(JNIEnv *env, jclass clazz,
|
static void android_media_MediaMuxer_start(JNIEnv *env, jclass /* clazz */,
|
||||||
jlong nativeObject) {
|
jlong nativeObject) {
|
||||||
sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject));
|
sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject));
|
||||||
if (muxer == NULL) {
|
if (muxer == NULL) {
|
||||||
@@ -193,7 +193,7 @@ static void android_media_MediaMuxer_start(JNIEnv *env, jclass clazz,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void android_media_MediaMuxer_stop(JNIEnv *env, jclass clazz,
|
static void android_media_MediaMuxer_stop(JNIEnv *env, jclass /* clazz */,
|
||||||
jlong nativeObject) {
|
jlong nativeObject) {
|
||||||
sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject));
|
sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject));
|
||||||
if (muxer == NULL) {
|
if (muxer == NULL) {
|
||||||
@@ -212,7 +212,7 @@ static void android_media_MediaMuxer_stop(JNIEnv *env, jclass clazz,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void android_media_MediaMuxer_native_release(
|
static void android_media_MediaMuxer_native_release(
|
||||||
JNIEnv *env, jclass clazz, jlong nativeObject) {
|
JNIEnv* /* env */, jclass clazz, jlong nativeObject) {
|
||||||
sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject));
|
sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject));
|
||||||
if (muxer != NULL) {
|
if (muxer != NULL) {
|
||||||
muxer->decStrong(clazz);
|
muxer->decStrong(clazz);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ MediaProfiles *sProfiles = NULL;
|
|||||||
// This function is called from a static block in MediaProfiles.java class,
|
// This function is called from a static block in MediaProfiles.java class,
|
||||||
// which won't run until the first time an instance of this class is used.
|
// which won't run until the first time an instance of this class is used.
|
||||||
static void
|
static void
|
||||||
android_media_MediaProfiles_native_init(JNIEnv *env)
|
android_media_MediaProfiles_native_init(JNIEnv* /* env */)
|
||||||
{
|
{
|
||||||
ALOGV("native_init");
|
ALOGV("native_init");
|
||||||
Mutex::Autolock lock(sLock);
|
Mutex::Autolock lock(sLock);
|
||||||
@@ -45,14 +45,14 @@ android_media_MediaProfiles_native_init(JNIEnv *env)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
android_media_MediaProfiles_native_get_num_file_formats(JNIEnv *env, jobject thiz)
|
android_media_MediaProfiles_native_get_num_file_formats(JNIEnv* /* env */, jobject /* thiz */)
|
||||||
{
|
{
|
||||||
ALOGV("native_get_num_file_formats");
|
ALOGV("native_get_num_file_formats");
|
||||||
return (jint) sProfiles->getOutputFileFormats().size();
|
return (jint) sProfiles->getOutputFileFormats().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
android_media_MediaProfiles_native_get_file_format(JNIEnv *env, jobject thiz, jint index)
|
android_media_MediaProfiles_native_get_file_format(JNIEnv *env, jobject /* thiz */, jint index)
|
||||||
{
|
{
|
||||||
ALOGV("native_get_file_format: %d", index);
|
ALOGV("native_get_file_format: %d", index);
|
||||||
Vector<output_format> formats = sProfiles->getOutputFileFormats();
|
Vector<output_format> formats = sProfiles->getOutputFileFormats();
|
||||||
@@ -65,14 +65,15 @@ android_media_MediaProfiles_native_get_file_format(JNIEnv *env, jobject thiz, ji
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
android_media_MediaProfiles_native_get_num_video_encoders(JNIEnv *env, jobject thiz)
|
android_media_MediaProfiles_native_get_num_video_encoders(JNIEnv* /* env */, jobject /* thiz */)
|
||||||
{
|
{
|
||||||
ALOGV("native_get_num_video_encoders");
|
ALOGV("native_get_num_video_encoders");
|
||||||
return sProfiles->getVideoEncoders().size();
|
return sProfiles->getVideoEncoders().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
static jobject
|
static jobject
|
||||||
android_media_MediaProfiles_native_get_video_encoder_cap(JNIEnv *env, jobject thiz, jint index)
|
android_media_MediaProfiles_native_get_video_encoder_cap(JNIEnv *env, jobject /* thiz */,
|
||||||
|
jint index)
|
||||||
{
|
{
|
||||||
ALOGV("native_get_video_encoder_cap: %d", index);
|
ALOGV("native_get_video_encoder_cap: %d", index);
|
||||||
Vector<video_encoder> encoders = sProfiles->getVideoEncoders();
|
Vector<video_encoder> encoders = sProfiles->getVideoEncoders();
|
||||||
@@ -116,14 +117,15 @@ android_media_MediaProfiles_native_get_video_encoder_cap(JNIEnv *env, jobject th
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
android_media_MediaProfiles_native_get_num_audio_encoders(JNIEnv *env, jobject thiz)
|
android_media_MediaProfiles_native_get_num_audio_encoders(JNIEnv* /* env */, jobject /* thiz */)
|
||||||
{
|
{
|
||||||
ALOGV("native_get_num_audio_encoders");
|
ALOGV("native_get_num_audio_encoders");
|
||||||
return (jint) sProfiles->getAudioEncoders().size();
|
return (jint) sProfiles->getAudioEncoders().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
static jobject
|
static jobject
|
||||||
android_media_MediaProfiles_native_get_audio_encoder_cap(JNIEnv *env, jobject thiz, jint index)
|
android_media_MediaProfiles_native_get_audio_encoder_cap(JNIEnv *env, jobject /* thiz */,
|
||||||
|
jint index)
|
||||||
{
|
{
|
||||||
ALOGV("native_get_audio_encoder_cap: %d", index);
|
ALOGV("native_get_audio_encoder_cap: %d", index);
|
||||||
Vector<audio_encoder> encoders = sProfiles->getAudioEncoders();
|
Vector<audio_encoder> encoders = sProfiles->getAudioEncoders();
|
||||||
@@ -172,7 +174,8 @@ static bool isCamcorderQualityKnown(int quality)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jobject
|
static jobject
|
||||||
android_media_MediaProfiles_native_get_camcorder_profile(JNIEnv *env, jobject thiz, jint id, jint quality)
|
android_media_MediaProfiles_native_get_camcorder_profile(JNIEnv *env, jobject /* thiz */, jint id,
|
||||||
|
jint quality)
|
||||||
{
|
{
|
||||||
ALOGV("native_get_camcorder_profile: %d %d", id, quality);
|
ALOGV("native_get_camcorder_profile: %d %d", id, quality);
|
||||||
if (!isCamcorderQualityKnown(quality)) {
|
if (!isCamcorderQualityKnown(quality)) {
|
||||||
@@ -221,7 +224,8 @@ android_media_MediaProfiles_native_get_camcorder_profile(JNIEnv *env, jobject th
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jboolean
|
static jboolean
|
||||||
android_media_MediaProfiles_native_has_camcorder_profile(JNIEnv *env, jobject thiz, jint id, jint quality)
|
android_media_MediaProfiles_native_has_camcorder_profile(JNIEnv* /* env */, jobject /* thiz */,
|
||||||
|
jint id, jint quality)
|
||||||
{
|
{
|
||||||
ALOGV("native_has_camcorder_profile: %d %d", id, quality);
|
ALOGV("native_has_camcorder_profile: %d %d", id, quality);
|
||||||
if (!isCamcorderQualityKnown(quality)) {
|
if (!isCamcorderQualityKnown(quality)) {
|
||||||
@@ -233,14 +237,15 @@ android_media_MediaProfiles_native_has_camcorder_profile(JNIEnv *env, jobject th
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
android_media_MediaProfiles_native_get_num_video_decoders(JNIEnv *env, jobject thiz)
|
android_media_MediaProfiles_native_get_num_video_decoders(JNIEnv* /* env */, jobject /* thiz */)
|
||||||
{
|
{
|
||||||
ALOGV("native_get_num_video_decoders");
|
ALOGV("native_get_num_video_decoders");
|
||||||
return (jint) sProfiles->getVideoDecoders().size();
|
return (jint) sProfiles->getVideoDecoders().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
android_media_MediaProfiles_native_get_video_decoder_type(JNIEnv *env, jobject thiz, jint index)
|
android_media_MediaProfiles_native_get_video_decoder_type(JNIEnv *env, jobject /* thiz */,
|
||||||
|
jint index)
|
||||||
{
|
{
|
||||||
ALOGV("native_get_video_decoder_type: %d", index);
|
ALOGV("native_get_video_decoder_type: %d", index);
|
||||||
Vector<video_decoder> decoders = sProfiles->getVideoDecoders();
|
Vector<video_decoder> decoders = sProfiles->getVideoDecoders();
|
||||||
@@ -254,14 +259,15 @@ android_media_MediaProfiles_native_get_video_decoder_type(JNIEnv *env, jobject t
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
android_media_MediaProfiles_native_get_num_audio_decoders(JNIEnv *env, jobject thiz)
|
android_media_MediaProfiles_native_get_num_audio_decoders(JNIEnv* /* env */, jobject /* thiz */)
|
||||||
{
|
{
|
||||||
ALOGV("native_get_num_audio_decoders");
|
ALOGV("native_get_num_audio_decoders");
|
||||||
return (jint) sProfiles->getAudioDecoders().size();
|
return (jint) sProfiles->getAudioDecoders().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
android_media_MediaProfiles_native_get_audio_decoder_type(JNIEnv *env, jobject thiz, jint index)
|
android_media_MediaProfiles_native_get_audio_decoder_type(JNIEnv *env, jobject /* thiz */,
|
||||||
|
jint index)
|
||||||
{
|
{
|
||||||
ALOGV("native_get_audio_decoder_type: %d", index);
|
ALOGV("native_get_audio_decoder_type: %d", index);
|
||||||
Vector<audio_decoder> decoders = sProfiles->getAudioDecoders();
|
Vector<audio_decoder> decoders = sProfiles->getAudioDecoders();
|
||||||
@@ -275,14 +281,17 @@ android_media_MediaProfiles_native_get_audio_decoder_type(JNIEnv *env, jobject t
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
android_media_MediaProfiles_native_get_num_image_encoding_quality_levels(JNIEnv *env, jobject thiz, jint cameraId)
|
android_media_MediaProfiles_native_get_num_image_encoding_quality_levels(JNIEnv* /* env */,
|
||||||
|
jobject /* thiz */,
|
||||||
|
jint cameraId)
|
||||||
{
|
{
|
||||||
ALOGV("native_get_num_image_encoding_quality_levels");
|
ALOGV("native_get_num_image_encoding_quality_levels");
|
||||||
return (jint) sProfiles->getImageEncodingQualityLevels(cameraId).size();
|
return (jint) sProfiles->getImageEncodingQualityLevels(cameraId).size();
|
||||||
}
|
}
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
android_media_MediaProfiles_native_get_image_encoding_quality_level(JNIEnv *env, jobject thiz, jint cameraId, jint index)
|
android_media_MediaProfiles_native_get_image_encoding_quality_level(JNIEnv *env, jobject /* thiz */,
|
||||||
|
jint cameraId, jint index)
|
||||||
{
|
{
|
||||||
ALOGV("native_get_image_encoding_quality_level");
|
ALOGV("native_get_image_encoding_quality_level");
|
||||||
Vector<int> levels = sProfiles->getImageEncodingQualityLevels(cameraId);
|
Vector<int> levels = sProfiles->getImageEncodingQualityLevels(cameraId);
|
||||||
|
|||||||
@@ -360,7 +360,6 @@ android_media_MediaScanner_extractAlbumArt(
|
|||||||
env->SetByteArrayRegion(array, 0, mediaAlbumArt->size(), data);
|
env->SetByteArrayRegion(array, 0, mediaAlbumArt->size(), data);
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
|
||||||
free(mediaAlbumArt);
|
free(mediaAlbumArt);
|
||||||
// if NewByteArray() returned NULL, an out-of-memory
|
// if NewByteArray() returned NULL, an out-of-memory
|
||||||
// exception will have been raised. I just want to
|
// exception will have been raised. I just want to
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ static const int nFir21 = sizeof(fir21) / sizeof(fir21[0]);
|
|||||||
static const int BUF_SIZE = 2048;
|
static const int BUF_SIZE = 2048;
|
||||||
|
|
||||||
|
|
||||||
static void android_media_ResampleInputStream_fir21(JNIEnv *env, jclass clazz,
|
static void android_media_ResampleInputStream_fir21(JNIEnv *env, jclass /* clazz */,
|
||||||
jbyteArray jIn, jint jInOffset,
|
jbyteArray jIn, jint jInOffset,
|
||||||
jbyteArray jOut, jint jOutOffset,
|
jbyteArray jOut, jint jOutOffset,
|
||||||
jint jNpoints) {
|
jint jNpoints) {
|
||||||
|
|||||||
@@ -136,8 +136,7 @@ static void SetMapInt32(
|
|||||||
jstring keyObj = env->NewStringUTF(key);
|
jstring keyObj = env->NewStringUTF(key);
|
||||||
jobject valueObj = makeIntegerObject(env, value);
|
jobject valueObj = makeIntegerObject(env, value);
|
||||||
|
|
||||||
jobject res = env->CallObjectMethod(
|
env->CallObjectMethod(hashMapObj, hashMapPutID, keyObj, valueObj);
|
||||||
hashMapObj, hashMapPutID, keyObj, valueObj);
|
|
||||||
|
|
||||||
env->DeleteLocalRef(valueObj); valueObj = NULL;
|
env->DeleteLocalRef(valueObj); valueObj = NULL;
|
||||||
env->DeleteLocalRef(keyObj); keyObj = NULL;
|
env->DeleteLocalRef(keyObj); keyObj = NULL;
|
||||||
@@ -266,8 +265,7 @@ status_t ConvertMessageToMap(
|
|||||||
if (valueObj != NULL) {
|
if (valueObj != NULL) {
|
||||||
jstring keyObj = env->NewStringUTF(key);
|
jstring keyObj = env->NewStringUTF(key);
|
||||||
|
|
||||||
jobject res = env->CallObjectMethod(
|
env->CallObjectMethod(hashMap, hashMapPutID, keyObj, valueObj);
|
||||||
hashMap, hashMapPutID, keyObj, valueObj);
|
|
||||||
|
|
||||||
env->DeleteLocalRef(keyObj); keyObj = NULL;
|
env->DeleteLocalRef(keyObj); keyObj = NULL;
|
||||||
env->DeleteLocalRef(valueObj); valueObj = NULL;
|
env->DeleteLocalRef(valueObj); valueObj = NULL;
|
||||||
|
|||||||
@@ -762,7 +762,7 @@ MtpResponseCode MyMtpDatabase::getObjectPropertyList(MtpObjectHandle handle,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void foreachentry(ExifEntry *entry, void * /*user*/) {
|
static void foreachentry(ExifEntry *entry, void* /* user */) {
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
ALOGI("entry %x, format %d, size %d: %s",
|
ALOGI("entry %x, format %d, size %d: %s",
|
||||||
entry->tag, entry->format, entry->size, exif_entry_get_value(entry, buf, sizeof(buf)));
|
entry->tag, entry->format, entry->size, exif_entry_get_value(entry, buf, sizeof(buf)));
|
||||||
@@ -780,7 +780,6 @@ static long getLongFromExifEntry(ExifEntry *e) {
|
|||||||
|
|
||||||
MtpResponseCode MyMtpDatabase::getObjectInfo(MtpObjectHandle handle,
|
MtpResponseCode MyMtpDatabase::getObjectInfo(MtpObjectHandle handle,
|
||||||
MtpObjectInfo& info) {
|
MtpObjectInfo& info) {
|
||||||
char date[20];
|
|
||||||
MtpString path;
|
MtpString path;
|
||||||
int64_t length;
|
int64_t length;
|
||||||
MtpObjectFormat format;
|
MtpObjectFormat format;
|
||||||
@@ -808,9 +807,11 @@ MtpResponseCode MyMtpDatabase::getObjectInfo(MtpObjectHandle handle,
|
|||||||
info.mDateModified = longValues[1];
|
info.mDateModified = longValues[1];
|
||||||
env->ReleaseLongArrayElements(mLongBuffer, longValues, 0);
|
env->ReleaseLongArrayElements(mLongBuffer, longValues, 0);
|
||||||
|
|
||||||
// info.mAssociationType = (format == MTP_FORMAT_ASSOCIATION ?
|
if ((false)) {
|
||||||
// MTP_ASSOCIATION_TYPE_GENERIC_FOLDER :
|
info.mAssociationType = (format == MTP_FORMAT_ASSOCIATION ?
|
||||||
// MTP_ASSOCIATION_TYPE_UNDEFINED);
|
MTP_ASSOCIATION_TYPE_GENERIC_FOLDER :
|
||||||
|
MTP_ASSOCIATION_TYPE_UNDEFINED);
|
||||||
|
}
|
||||||
info.mAssociationType = MTP_ASSOCIATION_TYPE_UNDEFINED;
|
info.mAssociationType = MTP_ASSOCIATION_TYPE_UNDEFINED;
|
||||||
|
|
||||||
jchar* str = env->GetCharArrayElements(mStringBuffer, 0);
|
jchar* str = env->GetCharArrayElements(mStringBuffer, 0);
|
||||||
@@ -823,7 +824,9 @@ MtpResponseCode MyMtpDatabase::getObjectInfo(MtpObjectHandle handle,
|
|||||||
|
|
||||||
ExifData *exifdata = exif_data_new_from_file(path);
|
ExifData *exifdata = exif_data_new_from_file(path);
|
||||||
if (exifdata) {
|
if (exifdata) {
|
||||||
//exif_data_foreach_content(exifdata, foreachcontent, NULL);
|
if ((false)) {
|
||||||
|
exif_data_foreach_content(exifdata, foreachcontent, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
// XXX get this from exif, or parse jpeg header instead?
|
// XXX get this from exif, or parse jpeg header instead?
|
||||||
ExifEntry *w = exif_content_get_entry(
|
ExifEntry *w = exif_content_get_entry(
|
||||||
|
|||||||
@@ -91,14 +91,6 @@ MtpDevice* get_device_from_object(JNIEnv* env, jobject javaDevice)
|
|||||||
return (MtpDevice*)env->GetLongField(javaDevice, field_context);
|
return (MtpDevice*)env->GetLongField(javaDevice, field_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void checkAndClearExceptionFromCallback(JNIEnv* env, const char* methodName) {
|
|
||||||
if (env->ExceptionCheck()) {
|
|
||||||
ALOGE("An exception was thrown by callback '%s'.", methodName);
|
|
||||||
LOGE_EX(env);
|
|
||||||
env->ExceptionClear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
static jboolean
|
static jboolean
|
||||||
|
|||||||
@@ -18,4 +18,6 @@ LOCAL_C_INCLUDES := \
|
|||||||
|
|
||||||
LOCAL_MODULE:= libaudioeffect_jni
|
LOCAL_MODULE:= libaudioeffect_jni
|
||||||
|
|
||||||
|
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|||||||
@@ -162,10 +162,6 @@ static void captureCallback(void* user,
|
|||||||
uint8_t *fft,
|
uint8_t *fft,
|
||||||
uint32_t samplingrate) {
|
uint32_t samplingrate) {
|
||||||
|
|
||||||
int arg1 = 0;
|
|
||||||
int arg2 = 0;
|
|
||||||
size_t size;
|
|
||||||
|
|
||||||
visualizer_callback_cookie *callbackInfo = (visualizer_callback_cookie *)user;
|
visualizer_callback_cookie *callbackInfo = (visualizer_callback_cookie *)user;
|
||||||
JNIEnv *env = AndroidRuntime::getJNIEnv();
|
JNIEnv *env = AndroidRuntime::getJNIEnv();
|
||||||
|
|
||||||
@@ -486,7 +482,7 @@ android_media_visualizer_native_getEnabled(JNIEnv *env, jobject thiz)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jintArray
|
static jintArray
|
||||||
android_media_visualizer_native_getCaptureSizeRange(JNIEnv *env, jobject thiz)
|
android_media_visualizer_native_getCaptureSizeRange(JNIEnv *env, jobject /* thiz */)
|
||||||
{
|
{
|
||||||
jintArray jRange = env->NewIntArray(2);
|
jintArray jRange = env->NewIntArray(2);
|
||||||
jint *nRange = env->GetIntArrayElements(jRange, NULL);
|
jint *nRange = env->GetIntArrayElements(jRange, NULL);
|
||||||
@@ -498,7 +494,7 @@ android_media_visualizer_native_getCaptureSizeRange(JNIEnv *env, jobject thiz)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static jint
|
static jint
|
||||||
android_media_visualizer_native_getMaxCaptureRate(JNIEnv *env, jobject thiz)
|
android_media_visualizer_native_getMaxCaptureRate(JNIEnv* /* env */, jobject /* thiz */)
|
||||||
{
|
{
|
||||||
return (jint) Visualizer::getMaxCaptureRate();
|
return (jint) Visualizer::getMaxCaptureRate();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,4 +14,6 @@ LOCAL_SHARED_LIBRARIES := \
|
|||||||
|
|
||||||
LOCAL_MODULE:= libsoundpool
|
LOCAL_MODULE:= libsoundpool
|
||||||
|
|
||||||
|
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ static JNINativeMethod gMethods[] = {
|
|||||||
|
|
||||||
static const char* const kClassPathName = "android/media/SoundPool$SoundPoolImpl";
|
static const char* const kClassPathName = "android/media/SoundPool$SoundPoolImpl";
|
||||||
|
|
||||||
jint JNI_OnLoad(JavaVM* vm, void* reserved)
|
jint JNI_OnLoad(JavaVM* vm, void* /* reserved */)
|
||||||
{
|
{
|
||||||
JNIEnv* env = NULL;
|
JNIEnv* env = NULL;
|
||||||
jint result = -1;
|
jint result = -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user