从 dumpsys 信息中可以查看 MediaCodec 的创建情况.
dumpsys media.resource_manager
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
$ dumpsys media.resource_manager ResourceManagerService: 0xefc81510 Policies: SupportsMultipleSecureCodecs: 1 SupportsSecureWithNonSecureCodec: 1 Processes: Pid: 1564 Client: Id: -5476376662914691248 Name: c2.qti.avc.encoder Resources: non-secure-codec/video-codec:[]:1 battery/video-codec:[]:1 Pid: 6276 Client: Id: 3147417280 Name: c2.qti.avc.decoder Resources: non-secure-codec/video-codec:[]:1 battery/video-codec:[]:1 Client: Id: 3147421744 Name: c2.qti.avc.decoder Resources: non-secure-codec/video-codec:[]:1 battery/video-codec:[]:1 Client: Id: 3471746192 Name: c2.qti.avc.decoder Resources: non-secure-codec/video-codec:[]:1 battery/video-codec:[]:1 Process Pid override: Events logs (most recent at top): 05-26 11:09:06 reclaimResourcesFromClientsPendingRemoval(pid 6276) 05-26 11:09:06 removeResource(pid 6276, clientId 4024266256) 05-26 11:09:06 removeResource(pid 6276, clientId 4024266256) 05-26 11:09:06 reclaimResourcesFromClientsPendingRemoval(pid 6276) 05-26 11:09:06 removeResource(pid 6276, clientId 4024260304) 05-26 11:09:06 removeResource(pid 6276, clientId 4024260304) 05-26 11:08:29 removeResource(pid 6276, clientId 4024271200) 05-26 11:08:29 removeResource(pid 6276, clientId 4024271200) 05-26 11:08:29 reclaimResourcesFromClientsPendingRemoval(pid 6276) 05-26 11:08:29 removeResource(pid 6276, clientId 4024297840) 05-26 11:08:29 removeResource(pid 6276, clientId 4024297840) 05-26 11:08:29 reclaimResourcesFromClientsPendingRemoval(pid 6276) 05-26 11:07:30 removeResource(pid 6276, clientId 4024219408) 05-26 11:07:30 removeResource(pid 6276, clientId 4024219408) 05-26 11:07:29 reclaimResourcesFromClientsPendingRemoval(pid 6276) 05-26 11:07:29 removeResource(pid 6276, clientId 4024273504) 05-26 11:07:29 removeResource(pid 6276, clientId 4024273504) 05-26 11:07:29 reclaimResourcesFromClientsPendingRemoval(pid 6276) 05-26 11:06:31 addResource(pid 6276, clientId 3147417280, resources battery/video-codec:[]:1 ) |
ServiceLog
内部使用 RingBuffer 循环缓冲区,保存操作日志,在 dump 时,这些操作会被打印。
保存以下操作:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
Status ResourceManagerService::config(const std::vector<MediaResourcePolicyParcel>& policies) { String8 log = String8::format("config(%s)", getString(policies).string()); mServiceLog->add(log); ... return Status::ok(); } Status ResourceManagerService::addResource( int32_t pid, int32_t uid, int64_t clientId, const std::shared_ptr<IResourceManagerClient>& client, const std::vector<MediaResourceParcel>& resources) { String8 log = String8::format("addResource(pid %d, clientId %lld, resources %s)", pid, (long long) clientId, getString(resources).string()); mServiceLog->add(log); ... } Status ResourceManagerService::removeResource( int32_t pid, int64_t clientId, const std::vector<MediaResourceParcel>& resources) { String8 log = String8::format("removeResource(pid %d, clientId %lld, resources %s)", pid, (long long) clientId, getString(resources).string()); mServiceLog->add(log); ... } Status ResourceManagerService::removeResource(int pid, int64_t clientId, bool checkValid) { String8 log = String8::format( "removeResource(pid %d, clientId %lld)", pid, (long long) clientId); mServiceLog->add(log); ... } Status ResourceManagerService::reclaimResource( int32_t callingPid, const std::vector<MediaResourceParcel>& resources, bool* _aidl_return) { String8 log = String8::format("reclaimResource(callingPid %d, resources %s)", callingPid, getString(resources).string()); mServiceLog->add(log); ... } bool ResourceManagerService::reclaimInternal( const Vector<std::shared_ptr<IResourceManagerClient>> &clients) { ... std::shared_ptr<IResourceManagerClient> failedClient; for (size_t i = 0; i < clients.size(); ++i) { String8 log = String8::format("reclaimResource from client %p", clients[i].get()); mServiceLog->add(log); ... } ... } Status ResourceManagerService::overridePid( int originalPid, int newPid) { String8 log = String8::format("overridePid(originalPid %d, newPid %d)", originalPid, newPid); mServiceLog->add(log); ... } Status ResourceManagerService::markClientForPendingRemoval(int32_t pid, int64_t clientId) { String8 log = String8::format( "markClientForPendingRemoval(pid %d, clientId %lld)", pid, (long long) clientId); mServiceLog->add(log); ... } Status ResourceManagerService::reclaimResourcesFromClientsPendingRemoval(int32_t pid) { String8 log = String8::format("reclaimResourcesFromClientsPendingRemoval(pid %d)", pid); mServiceLog->add(log); ... } |
0 Comments