Merge "Frameworks/base: Wall Werror in media/jni"
This commit is contained in:
@@ -64,7 +64,7 @@ LOCAL_C_INCLUDES += \
|
||||
$(PV_INCLUDES) \
|
||||
$(JNI_H_INCLUDE)
|
||||
|
||||
LOCAL_CFLAGS +=
|
||||
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
|
||||
|
||||
LOCAL_MODULE:= libmedia_jni
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ struct GsmAmrEncoderState {
|
||||
};
|
||||
|
||||
static jlong android_media_AmrInputStream_GsmAmrEncoderNew
|
||||
(JNIEnv *env, jclass clazz) {
|
||||
(JNIEnv *env, jclass /* clazz */) {
|
||||
GsmAmrEncoderState* gae = new GsmAmrEncoderState();
|
||||
if (gae == NULL) {
|
||||
jniThrowRuntimeException(env, "Out of memory");
|
||||
@@ -59,7 +59,7 @@ static jlong android_media_AmrInputStream_GsmAmrEncoderNew
|
||||
}
|
||||
|
||||
static void android_media_AmrInputStream_GsmAmrEncoderInitialize
|
||||
(JNIEnv *env, jclass clazz, jlong gae) {
|
||||
(JNIEnv *env, jclass /* clazz */, jlong gae) {
|
||||
GsmAmrEncoderState *state = (GsmAmrEncoderState *) gae;
|
||||
int32_t nResult = AMREncodeInit(&state->mEncState, &state->mSidState, false);
|
||||
if (nResult != OK) {
|
||||
@@ -69,7 +69,7 @@ static void android_media_AmrInputStream_GsmAmrEncoderInitialize
|
||||
}
|
||||
|
||||
static jint android_media_AmrInputStream_GsmAmrEncoderEncode
|
||||
(JNIEnv *env, jclass clazz,
|
||||
(JNIEnv *env, jclass /* clazz */,
|
||||
jlong gae, jbyteArray pcm, jint pcmOffset, jbyteArray amr, jint amrOffset) {
|
||||
|
||||
jbyte inBuf[BYTES_PER_FRAME];
|
||||
@@ -105,7 +105,7 @@ static jint android_media_AmrInputStream_GsmAmrEncoderEncode
|
||||
}
|
||||
|
||||
static void android_media_AmrInputStream_GsmAmrEncoderCleanup
|
||||
(JNIEnv *env, jclass clazz, jlong gae) {
|
||||
(JNIEnv* /* env */, jclass /* clazz */, jlong gae) {
|
||||
GsmAmrEncoderState *state = (GsmAmrEncoderState *) gae;
|
||||
AMREncodeExit(&state->mEncState, &state->mSidState);
|
||||
state->mEncState = NULL;
|
||||
@@ -113,7 +113,7 @@ static void android_media_AmrInputStream_GsmAmrEncoderCleanup
|
||||
}
|
||||
|
||||
static void android_media_AmrInputStream_GsmAmrEncoderDelete
|
||||
(JNIEnv *env, jclass clazz, jlong gae) {
|
||||
(JNIEnv* /* env */, jclass /* clazz */, jlong gae) {
|
||||
delete (GsmAmrEncoderState*)gae;
|
||||
}
|
||||
|
||||
|
||||
@@ -502,7 +502,6 @@ static jint Image_imageGetPixelStride(JNIEnv* env, CpuConsumer::LockedBuffer* bu
|
||||
case HAL_PIXEL_FORMAT_Y8:
|
||||
// Single plane 8bpp data.
|
||||
ALOG_ASSERT(idx == 0, "Wrong index: %d", idx);
|
||||
pixelStride;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_YV12:
|
||||
pixelStride = 1;
|
||||
|
||||
@@ -42,7 +42,7 @@ static sp<IMediaCodecList> getCodecList(JNIEnv *env) {
|
||||
}
|
||||
|
||||
static jint android_media_MediaCodecList_getCodecCount(
|
||||
JNIEnv *env, jobject thiz) {
|
||||
JNIEnv *env, jobject /* thiz */) {
|
||||
sp<IMediaCodecList> mcl = getCodecList(env);
|
||||
if (mcl == NULL) {
|
||||
// Runtime exception already pending.
|
||||
@@ -52,7 +52,7 @@ static jint android_media_MediaCodecList_getCodecCount(
|
||||
}
|
||||
|
||||
static jstring android_media_MediaCodecList_getCodecName(
|
||||
JNIEnv *env, jobject thiz, jint index) {
|
||||
JNIEnv *env, jobject /* thiz */, jint index) {
|
||||
sp<IMediaCodecList> mcl = getCodecList(env);
|
||||
if (mcl == NULL) {
|
||||
// Runtime exception already pending.
|
||||
@@ -70,7 +70,7 @@ static jstring android_media_MediaCodecList_getCodecName(
|
||||
}
|
||||
|
||||
static jint android_media_MediaCodecList_findCodecByName(
|
||||
JNIEnv *env, jobject thiz, jstring name) {
|
||||
JNIEnv *env, jobject /* thiz */, jstring name) {
|
||||
if (name == NULL) {
|
||||
jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
|
||||
return -ENOENT;
|
||||
@@ -95,7 +95,7 @@ static jint android_media_MediaCodecList_findCodecByName(
|
||||
}
|
||||
|
||||
static jboolean android_media_MediaCodecList_isEncoder(
|
||||
JNIEnv *env, jobject thiz, jint index) {
|
||||
JNIEnv *env, jobject /* thiz */, jint index) {
|
||||
sp<IMediaCodecList> mcl = getCodecList(env);
|
||||
if (mcl == NULL) {
|
||||
// Runtime exception already pending.
|
||||
@@ -112,7 +112,7 @@ static jboolean android_media_MediaCodecList_isEncoder(
|
||||
}
|
||||
|
||||
static jarray android_media_MediaCodecList_getSupportedTypes(
|
||||
JNIEnv *env, jobject thiz, jint index) {
|
||||
JNIEnv *env, jobject /* thiz */, jint index) {
|
||||
sp<IMediaCodecList> mcl = getCodecList(env);
|
||||
if (mcl == NULL) {
|
||||
// Runtime exception already pending.
|
||||
@@ -144,7 +144,7 @@ static jarray android_media_MediaCodecList_getSupportedTypes(
|
||||
}
|
||||
|
||||
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) {
|
||||
jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
|
||||
return NULL;
|
||||
@@ -262,7 +262,7 @@ static jobject android_media_MediaCodecList_getCodecCapabilities(
|
||||
return caps;
|
||||
}
|
||||
|
||||
static void android_media_MediaCodecList_native_init(JNIEnv *env) {
|
||||
static void android_media_MediaCodecList_native_init(JNIEnv* /* env */) {
|
||||
}
|
||||
|
||||
static JNINativeMethod gMethods[] = {
|
||||
|
||||
@@ -224,7 +224,7 @@ static void android_media_MediaCrypto_native_finalize(
|
||||
}
|
||||
|
||||
static jboolean android_media_MediaCrypto_isCryptoSchemeSupportedNative(
|
||||
JNIEnv *env, jobject thiz, jbyteArray uuidObj) {
|
||||
JNIEnv *env, jobject /* thiz */, jbyteArray uuidObj) {
|
||||
jsize uuidLength = env->GetArrayLength(uuidObj);
|
||||
|
||||
if (uuidLength != 16) {
|
||||
|
||||
@@ -667,7 +667,7 @@ static void android_media_MediaDrm_native_finalize(
|
||||
}
|
||||
|
||||
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) {
|
||||
jniThrowException(env, "java/lang/IllegalArgumentException", NULL);
|
||||
@@ -1137,7 +1137,7 @@ static void android_media_MediaDrm_setPropertyByteArray(
|
||||
}
|
||||
|
||||
static void android_media_MediaDrm_setCipherAlgorithmNative(
|
||||
JNIEnv *env, jobject thiz, jobject jdrm, jbyteArray jsessionId,
|
||||
JNIEnv *env, jobject /* thiz */, jobject jdrm, jbyteArray jsessionId,
|
||||
jstring jalgorithm) {
|
||||
|
||||
sp<IDrm> drm = GetDrm(env, jdrm);
|
||||
@@ -1161,7 +1161,7 @@ static void android_media_MediaDrm_setCipherAlgorithmNative(
|
||||
}
|
||||
|
||||
static void android_media_MediaDrm_setMacAlgorithmNative(
|
||||
JNIEnv *env, jobject thiz, jobject jdrm, jbyteArray jsessionId,
|
||||
JNIEnv *env, jobject /* thiz */, jobject jdrm, jbyteArray jsessionId,
|
||||
jstring jalgorithm) {
|
||||
|
||||
sp<IDrm> drm = GetDrm(env, jdrm);
|
||||
@@ -1186,7 +1186,7 @@ static void android_media_MediaDrm_setMacAlgorithmNative(
|
||||
|
||||
|
||||
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) {
|
||||
|
||||
sp<IDrm> drm = GetDrm(env, jdrm);
|
||||
@@ -1217,7 +1217,7 @@ static jbyteArray android_media_MediaDrm_encryptNative(
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
sp<IDrm> drm = GetDrm(env, jdrm);
|
||||
@@ -1247,7 +1247,7 @@ static jbyteArray android_media_MediaDrm_decryptNative(
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
sp<IDrm> drm = GetDrm(env, jdrm);
|
||||
@@ -1277,7 +1277,7 @@ static jbyteArray android_media_MediaDrm_signNative(
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
sp<IDrm> drm = GetDrm(env, jdrm);
|
||||
@@ -1306,7 +1306,7 @@ static jboolean android_media_MediaDrm_verifyNative(
|
||||
|
||||
|
||||
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) {
|
||||
|
||||
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)
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ static fields_t gFields;
|
||||
using namespace android;
|
||||
|
||||
static jint android_media_MediaMuxer_addTrack(
|
||||
JNIEnv *env, jclass clazz, jlong nativeObject, jobjectArray keys,
|
||||
JNIEnv *env, jclass /* clazz */, jlong nativeObject, jobjectArray keys,
|
||||
jobjectArray values) {
|
||||
sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject));
|
||||
if (muxer == NULL) {
|
||||
@@ -71,7 +71,7 @@ static jint android_media_MediaMuxer_addTrack(
|
||||
}
|
||||
|
||||
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) {
|
||||
sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject));
|
||||
if (muxer == NULL) {
|
||||
@@ -146,7 +146,7 @@ static jlong android_media_MediaMuxer_native_setup(
|
||||
}
|
||||
|
||||
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));
|
||||
if (muxer == NULL) {
|
||||
jniThrowException(env, "java/lang/IllegalStateException",
|
||||
@@ -164,7 +164,7 @@ static void android_media_MediaMuxer_setOrientationHint(
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
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) {
|
||||
sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject));
|
||||
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) {
|
||||
sp<MediaMuxer> muxer(reinterpret_cast<MediaMuxer *>(nativeObject));
|
||||
if (muxer == NULL) {
|
||||
@@ -212,7 +212,7 @@ static void android_media_MediaMuxer_stop(JNIEnv *env, jclass clazz,
|
||||
}
|
||||
|
||||
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));
|
||||
if (muxer != NULL) {
|
||||
muxer->decStrong(clazz);
|
||||
|
||||
@@ -34,7 +34,7 @@ MediaProfiles *sProfiles = NULL;
|
||||
// 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.
|
||||
static void
|
||||
android_media_MediaProfiles_native_init(JNIEnv *env)
|
||||
android_media_MediaProfiles_native_init(JNIEnv* /* env */)
|
||||
{
|
||||
ALOGV("native_init");
|
||||
Mutex::Autolock lock(sLock);
|
||||
@@ -45,14 +45,14 @@ android_media_MediaProfiles_native_init(JNIEnv *env)
|
||||
}
|
||||
|
||||
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");
|
||||
return (jint) sProfiles->getOutputFileFormats().size();
|
||||
}
|
||||
|
||||
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);
|
||||
Vector<output_format> formats = sProfiles->getOutputFileFormats();
|
||||
@@ -65,14 +65,15 @@ android_media_MediaProfiles_native_get_file_format(JNIEnv *env, jobject thiz, ji
|
||||
}
|
||||
|
||||
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");
|
||||
return sProfiles->getVideoEncoders().size();
|
||||
}
|
||||
|
||||
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);
|
||||
Vector<video_encoder> encoders = sProfiles->getVideoEncoders();
|
||||
@@ -116,14 +117,15 @@ android_media_MediaProfiles_native_get_video_encoder_cap(JNIEnv *env, jobject th
|
||||
}
|
||||
|
||||
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");
|
||||
return (jint) sProfiles->getAudioEncoders().size();
|
||||
}
|
||||
|
||||
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);
|
||||
Vector<audio_encoder> encoders = sProfiles->getAudioEncoders();
|
||||
@@ -172,7 +174,8 @@ static bool isCamcorderQualityKnown(int quality)
|
||||
}
|
||||
|
||||
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);
|
||||
if (!isCamcorderQualityKnown(quality)) {
|
||||
@@ -221,7 +224,8 @@ android_media_MediaProfiles_native_get_camcorder_profile(JNIEnv *env, jobject th
|
||||
}
|
||||
|
||||
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);
|
||||
if (!isCamcorderQualityKnown(quality)) {
|
||||
@@ -233,14 +237,15 @@ android_media_MediaProfiles_native_has_camcorder_profile(JNIEnv *env, jobject th
|
||||
}
|
||||
|
||||
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");
|
||||
return (jint) sProfiles->getVideoDecoders().size();
|
||||
}
|
||||
|
||||
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);
|
||||
Vector<video_decoder> decoders = sProfiles->getVideoDecoders();
|
||||
@@ -254,14 +259,15 @@ android_media_MediaProfiles_native_get_video_decoder_type(JNIEnv *env, jobject t
|
||||
}
|
||||
|
||||
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");
|
||||
return (jint) sProfiles->getAudioDecoders().size();
|
||||
}
|
||||
|
||||
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);
|
||||
Vector<audio_decoder> decoders = sProfiles->getAudioDecoders();
|
||||
@@ -275,14 +281,17 @@ android_media_MediaProfiles_native_get_audio_decoder_type(JNIEnv *env, jobject t
|
||||
}
|
||||
|
||||
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");
|
||||
return (jint) sProfiles->getImageEncodingQualityLevels(cameraId).size();
|
||||
}
|
||||
|
||||
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");
|
||||
Vector<int> levels = sProfiles->getImageEncodingQualityLevels(cameraId);
|
||||
|
||||
@@ -360,7 +360,6 @@ android_media_MediaScanner_extractAlbumArt(
|
||||
env->SetByteArrayRegion(array, 0, mediaAlbumArt->size(), data);
|
||||
}
|
||||
|
||||
done:
|
||||
free(mediaAlbumArt);
|
||||
// if NewByteArray() returned NULL, an out-of-memory
|
||||
// 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 void android_media_ResampleInputStream_fir21(JNIEnv *env, jclass clazz,
|
||||
static void android_media_ResampleInputStream_fir21(JNIEnv *env, jclass /* clazz */,
|
||||
jbyteArray jIn, jint jInOffset,
|
||||
jbyteArray jOut, jint jOutOffset,
|
||||
jint jNpoints) {
|
||||
|
||||
@@ -136,8 +136,7 @@ static void SetMapInt32(
|
||||
jstring keyObj = env->NewStringUTF(key);
|
||||
jobject valueObj = makeIntegerObject(env, value);
|
||||
|
||||
jobject res = env->CallObjectMethod(
|
||||
hashMapObj, hashMapPutID, keyObj, valueObj);
|
||||
env->CallObjectMethod(hashMapObj, hashMapPutID, keyObj, valueObj);
|
||||
|
||||
env->DeleteLocalRef(valueObj); valueObj = NULL;
|
||||
env->DeleteLocalRef(keyObj); keyObj = NULL;
|
||||
@@ -266,8 +265,7 @@ status_t ConvertMessageToMap(
|
||||
if (valueObj != NULL) {
|
||||
jstring keyObj = env->NewStringUTF(key);
|
||||
|
||||
jobject res = env->CallObjectMethod(
|
||||
hashMap, hashMapPutID, keyObj, valueObj);
|
||||
env->CallObjectMethod(hashMap, hashMapPutID, keyObj, valueObj);
|
||||
|
||||
env->DeleteLocalRef(keyObj); keyObj = NULL;
|
||||
env->DeleteLocalRef(valueObj); valueObj = NULL;
|
||||
|
||||
@@ -761,7 +761,7 @@ MtpResponseCode MyMtpDatabase::getObjectPropertyList(MtpObjectHandle handle,
|
||||
return result;
|
||||
}
|
||||
|
||||
static void foreachentry(ExifEntry *entry, void *user) {
|
||||
static void foreachentry(ExifEntry *entry, void* /* user */) {
|
||||
char buf[1024];
|
||||
ALOGI("entry %x, format %d, size %d: %s",
|
||||
entry->tag, entry->format, entry->size, exif_entry_get_value(entry, buf, sizeof(buf)));
|
||||
@@ -779,7 +779,6 @@ static long getLongFromExifEntry(ExifEntry *e) {
|
||||
|
||||
MtpResponseCode MyMtpDatabase::getObjectInfo(MtpObjectHandle handle,
|
||||
MtpObjectInfo& info) {
|
||||
char date[20];
|
||||
MtpString path;
|
||||
int64_t length;
|
||||
MtpObjectFormat format;
|
||||
@@ -807,9 +806,11 @@ MtpResponseCode MyMtpDatabase::getObjectInfo(MtpObjectHandle handle,
|
||||
info.mDateModified = longValues[1];
|
||||
env->ReleaseLongArrayElements(mLongBuffer, longValues, 0);
|
||||
|
||||
// info.mAssociationType = (format == MTP_FORMAT_ASSOCIATION ?
|
||||
// MTP_ASSOCIATION_TYPE_GENERIC_FOLDER :
|
||||
// MTP_ASSOCIATION_TYPE_UNDEFINED);
|
||||
if ((false)) {
|
||||
info.mAssociationType = (format == MTP_FORMAT_ASSOCIATION ?
|
||||
MTP_ASSOCIATION_TYPE_GENERIC_FOLDER :
|
||||
MTP_ASSOCIATION_TYPE_UNDEFINED);
|
||||
}
|
||||
info.mAssociationType = MTP_ASSOCIATION_TYPE_UNDEFINED;
|
||||
|
||||
jchar* str = env->GetCharArrayElements(mStringBuffer, 0);
|
||||
@@ -822,7 +823,9 @@ MtpResponseCode MyMtpDatabase::getObjectInfo(MtpObjectHandle handle,
|
||||
|
||||
ExifData *exifdata = exif_data_new_from_file(path);
|
||||
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?
|
||||
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);
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
@@ -2,20 +2,22 @@ LOCAL_PATH:= $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES:= \
|
||||
android_media_AudioEffect.cpp \
|
||||
android_media_Visualizer.cpp
|
||||
android_media_AudioEffect.cpp \
|
||||
android_media_Visualizer.cpp
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
liblog \
|
||||
libcutils \
|
||||
libutils \
|
||||
libandroid_runtime \
|
||||
libnativehelper \
|
||||
libmedia
|
||||
liblog \
|
||||
libcutils \
|
||||
libutils \
|
||||
libandroid_runtime \
|
||||
libnativehelper \
|
||||
libmedia
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(call include-path-for, audio-effects)
|
||||
$(call include-path-for, audio-effects)
|
||||
|
||||
LOCAL_MODULE:= libaudioeffect_jni
|
||||
|
||||
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
@@ -162,10 +162,6 @@ static void captureCallback(void* user,
|
||||
uint8_t *fft,
|
||||
uint32_t samplingrate) {
|
||||
|
||||
int arg1 = 0;
|
||||
int arg2 = 0;
|
||||
size_t size;
|
||||
|
||||
visualizer_callback_cookie *callbackInfo = (visualizer_callback_cookie *)user;
|
||||
JNIEnv *env = AndroidRuntime::getJNIEnv();
|
||||
|
||||
@@ -486,7 +482,7 @@ android_media_visualizer_native_getEnabled(JNIEnv *env, jobject thiz)
|
||||
}
|
||||
|
||||
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);
|
||||
jint *nRange = env->GetIntArrayElements(jRange, NULL);
|
||||
@@ -498,7 +494,7 @@ android_media_visualizer_native_getCaptureSizeRange(JNIEnv *env, jobject thiz)
|
||||
}
|
||||
|
||||
static jint
|
||||
android_media_visualizer_native_getMaxCaptureRate(JNIEnv *env, jobject thiz)
|
||||
android_media_visualizer_native_getMaxCaptureRate(JNIEnv* /* env */, jobject /* thiz */)
|
||||
{
|
||||
return (jint) Visualizer::getMaxCaptureRate();
|
||||
}
|
||||
|
||||
@@ -2,16 +2,18 @@ LOCAL_PATH:= $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES:= \
|
||||
android_media_SoundPool_SoundPoolImpl.cpp
|
||||
android_media_SoundPool_SoundPoolImpl.cpp
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
liblog \
|
||||
libcutils \
|
||||
libutils \
|
||||
libandroid_runtime \
|
||||
libnativehelper \
|
||||
libmedia
|
||||
liblog \
|
||||
libcutils \
|
||||
libutils \
|
||||
libandroid_runtime \
|
||||
libnativehelper \
|
||||
libmedia
|
||||
|
||||
LOCAL_MODULE:= libsoundpool
|
||||
|
||||
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
@@ -312,7 +312,7 @@ static JNINativeMethod gMethods[] = {
|
||||
|
||||
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;
|
||||
jint result = -1;
|
||||
|
||||
Reference in New Issue
Block a user