从 dumpsys 信息中可以查看 MediaCodec 的创建情况. dumpsys media.resource_manager $ dumpsys media.resource_manager ResourceManagerService: 0xefc81510 Policies: SupportsMultipleSecureCodecs: 1 SupportsSecureWithNonSecureCodec: 1 Processes: Pid: 1564 Client: Id: -54763766629 ...
ResourceManagerService (4.3) markClientForPendingRemoval reclaimResourcesFromClientsPendingRemoval
ResourceManagerService (4.3) markClientForPendingRemoval 和 reclaimResourcesFromClientsPendingRemoval markClientForPendingRemoval 标记客户端可被移除 在下一个 reclaimResourcesFromClientsPendingRemoval 被调用时,被释放。 接口: // frameworks/av/media/libmedia/aidl/android/media/IResourceManagerService.aidl /** * Mark a client for pending removal * * @param pid pid from which the client's resources will be removed. * @param clientId cl ...
ResourceManagerService(4.1) addResource
应用向 ResourceManagerService 注册资源的接口 接口 ResourceManagerService 中对 addResource 信息的保存封装类 addResource 流程 接口: // frameworks/av/media/libmedia/aidl/android/media/IResourceManagerService.aidl /** * Add a client to a process with a list of resources. * * @param pid pid of the client. * @param uid uid of the client. * @param clientId an identifier that uniquely identifies the client within the pid. * @p ...
ResourceManagerService (3) IResourceManagerClient
IResourceManagerClient – 回调应用提供的接口 ResourceManagerService 调用 Client 的接口. 主要是 reclaimResource(), 通知 Client 回收资源. // frameworks/av/media/libmedia/aidl/android/media/IResourceManagerClient.aidl interface IResourceManagerClient { /** * Instruct the client to reclaim its resources. * * @return true if the reclaim was successful and false otherwise. */ boolean reclaimResource(); /** * Retrie ...
ResourceManagerService (2)MediaResourceParcel – MediaResource 的描述信息
aidl 接口 // frameworks/av/media/libmedia/aidl/android/media/MediaResourceParcel.aidl parcelable MediaResourceParcel { // TODO: default enum value is not supported yet. // Set default enum value when b/142739329 is fixed. /** * Type of the media resource. */ MediaResourceType type;// = MediaResourceTypeEnum::kUnspecified; /** * Sub-type of the media resource. */ MediaResourceSubType subType;// = Media ...
ResourceManagerService(1) 启动时机与提供的接口
作用 管理资源(Resource), 应用添加和移除资源时通知到 Service. 资源紧张时, 将根据优先级释放资源. 释放资源通过 IResourceManagerClient.reclaimResource 通知应用进行释放 启动时机 在 mediaserver 初始化时启动,并且被添加到 Service Manager 中 1.0 在 meida server 的 main 函数中实例化对象 // frameworks/av/media/mediaserver/main_mediaserver.cpp int main(int argc __unused, char **argv __unused) { ... ResourceManagerService::instantiate();// 见 2.0 ... } ...