如何访问MediaMetadataRetriever.setDataSource(...)状态代码?
-
21-12-2019 - |
题
我得到以下错误 java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
我想知道这是什么状况。我正在使用函数 MediaMetaDataRetriever.setDataSource(String filePath)
解决方案 2
它埋得很好,但我找到了源头。 以下是错误代码的链接
这是ICS的构建,我不确定它在当前构建中的位置。
当我使用midi文件时,我的错误是不支持的错误。
资料来源:
/*
* Copyright (C) 2009 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.
*/
#ifndef MEDIA_ERRORS_H_
#define MEDIA_ERRORS_H_
#include <utils/Errors.h>
namespace android {
enum {
MEDIA_ERROR_BASE = -1000,
ERROR_ALREADY_CONNECTED = MEDIA_ERROR_BASE,
ERROR_NOT_CONNECTED = MEDIA_ERROR_BASE - 1,
ERROR_UNKNOWN_HOST = MEDIA_ERROR_BASE - 2,
ERROR_CANNOT_CONNECT = MEDIA_ERROR_BASE - 3,
ERROR_IO = MEDIA_ERROR_BASE - 4,
ERROR_CONNECTION_LOST = MEDIA_ERROR_BASE - 5,
ERROR_MALFORMED = MEDIA_ERROR_BASE - 7,
ERROR_OUT_OF_RANGE = MEDIA_ERROR_BASE - 8,
ERROR_BUFFER_TOO_SMALL = MEDIA_ERROR_BASE - 9,
ERROR_UNSUPPORTED = MEDIA_ERROR_BASE - 10,
ERROR_END_OF_STREAM = MEDIA_ERROR_BASE - 11,
// Not technically an error.
INFO_FORMAT_CHANGED = MEDIA_ERROR_BASE - 12,
INFO_DISCONTINUITY = MEDIA_ERROR_BASE - 13,
// The following constant values should be in sync with
// drm/drm_framework_common.h
DRM_ERROR_BASE = -2000,
ERROR_DRM_UNKNOWN = DRM_ERROR_BASE,
ERROR_DRM_NO_LICENSE = DRM_ERROR_BASE - 1,
ERROR_DRM_LICENSE_EXPIRED = DRM_ERROR_BASE - 2,
ERROR_DRM_SESSION_NOT_OPENED = DRM_ERROR_BASE - 3,
ERROR_DRM_DECRYPT_UNIT_NOT_INITIALIZED = DRM_ERROR_BASE - 4,
ERROR_DRM_DECRYPT = DRM_ERROR_BASE - 5,
ERROR_DRM_CANNOT_HANDLE = DRM_ERROR_BASE - 6,
ERROR_DRM_TAMPER_DETECTED = DRM_ERROR_BASE - 7,
// Heartbeat Error Codes
HEARTBEAT_ERROR_BASE = -3000,
ERROR_HEARTBEAT_AUTHENTICATION_FAILURE = HEARTBEAT_ERROR_BASE,
ERROR_HEARTBEAT_NO_ACTIVE_PURCHASE_AGREEMENT = HEARTBEAT_ERROR_BASE - 1,
ERROR_HEARTBEAT_CONCURRENT_PLAYBACK = HEARTBEAT_ERROR_BASE - 2,
ERROR_HEARTBEAT_UNUSUAL_ACTIVITY = HEARTBEAT_ERROR_BASE - 3,
ERROR_HEARTBEAT_STREAMING_UNAVAILABLE = HEARTBEAT_ERROR_BASE - 4,
ERROR_HEARTBEAT_CANNOT_ACTIVATE_RENTAL = HEARTBEAT_ERROR_BASE - 5,
ERROR_HEARTBEAT_TERMINATE_REQUESTED = HEARTBEAT_ERROR_BASE - 6,
};
} // namespace android
#endif // MEDIA_ERRORS_H_
其他提示
我得到这个错误 java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
当试图打电话 void setDataSource(String path)
在一个空文件上。(0字节)
您需要100%确定文件的路径不是null,不是空的,文件本身存在并且有效。
我得到这个错误: setDataSource failed: status = 0xFFFFFFEA
因为我的设备上不存在该文件。
当我的音频文件被brocken时,我发现了这个错误,当我更改文件时它解决了,你可以尝试手动设置不同的源路径
我的代码中没有空文件或任何其他此处提到的错误。我尝试使用的文件很好。我不完全知道为什么,但当我简单地使用另一个过载时,它对我有用。 setDataSource
.
我使用的那些抛出这个异常的是 MediaMetadataRetriever.setDataSource(String)
和 MediaMetadataRetriever.setDataSource(String, HashMap)
一个简单的工作是 MediaMetadataRetriever.setDataSource(Context, URI)
.
当我尝试使用0kb mp3文件时,我遇到了这个问题,我在删除该文件后解决了它。也许你可以抓住这个异常。