Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Marco Nelissen | b65990f | 2015-11-09 15:39:49 -0800 | [diff] [blame] | 17 | //#define LOG_NDEBUG 0 |
Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 18 | #define LOG_TAG "BpMediaExtractor" |
| 19 | #include <utils/Log.h> |
| 20 | |
| 21 | #include <stdint.h> |
Marco Nelissen | b589437 | 2019-01-10 14:44:13 -0800 | [diff] [blame] | 22 | #include <time.h> |
Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 23 | #include <sys/types.h> |
| 24 | |
Marco Nelissen | 69d3d8a | 2016-03-07 13:20:01 -0800 | [diff] [blame] | 25 | #include <binder/IPCThreadState.h> |
Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 26 | #include <binder/Parcel.h> |
ray-cy.lee | b596c34 | 2017-03-07 18:25:15 +0800 | [diff] [blame] | 27 | #include <binder/PermissionCache.h> |
Marco Nelissen | dab79b3 | 2019-11-18 08:25:47 -0800 | [diff] [blame] | 28 | #include <android/IMediaExtractor.h> |
Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 29 | #include <media/stagefright/MetaData.h> |
| 30 | |
| 31 | namespace android { |
| 32 | |
| 33 | enum { |
| 34 | COUNTTRACKS = IBinder::FIRST_CALL_TRANSACTION, |
| 35 | GETTRACK, |
| 36 | GETTRACKMETADATA, |
| 37 | GETMETADATA, |
| 38 | FLAGS, |
Chong Zhang | 9dbe9a5 | 2017-01-03 11:35:15 -0800 | [diff] [blame] | 39 | SETMEDIACAS, |
Ray Essick | ba13b7b | 2017-02-07 10:03:18 -0800 | [diff] [blame] | 40 | NAME, |
Santiago Seifert | 79c34f2 | 2020-11-11 23:49:28 +0000 | [diff] [blame] | 41 | GETMETRICS, |
Santiago Seifert | 6dbe0d0 | 2021-04-28 23:38:51 +0100 | [diff] [blame^] | 42 | SETENTRYPOINT, |
| 43 | SETLOGSESSIONID |
Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | class BpMediaExtractor : public BpInterface<IMediaExtractor> { |
| 47 | public: |
Chih-Hung Hsieh | 64a2870 | 2016-05-03 09:52:51 -0700 | [diff] [blame] | 48 | explicit BpMediaExtractor(const sp<IBinder>& impl) |
Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 49 | : BpInterface<IMediaExtractor>(impl) |
| 50 | { |
| 51 | } |
| 52 | |
| 53 | virtual size_t countTracks() { |
| 54 | ALOGV("countTracks"); |
| 55 | Parcel data, reply; |
| 56 | data.writeInterfaceToken(BpMediaExtractor::getInterfaceDescriptor()); |
| 57 | status_t ret = remote()->transact(COUNTTRACKS, data, &reply); |
| 58 | size_t numTracks = 0; |
| 59 | if (ret == NO_ERROR) { |
| 60 | numTracks = reply.readUint32(); |
| 61 | } |
| 62 | return numTracks; |
| 63 | } |
| 64 | virtual sp<IMediaSource> getTrack(size_t index) { |
| 65 | ALOGV("getTrack(%zu)", index); |
| 66 | Parcel data, reply; |
| 67 | data.writeInterfaceToken(BpMediaExtractor::getInterfaceDescriptor()); |
| 68 | data.writeUint32(index); |
| 69 | status_t ret = remote()->transact(GETTRACK, data, &reply); |
| 70 | if (ret == NO_ERROR) { |
| 71 | return interface_cast<IMediaSource>(reply.readStrongBinder()); |
| 72 | } |
| 73 | return NULL; |
| 74 | } |
| 75 | |
| 76 | virtual sp<MetaData> getTrackMetaData( |
| 77 | size_t index, uint32_t flags) { |
| 78 | ALOGV("getTrackMetaData(%zu, %u)", index, flags); |
| 79 | Parcel data, reply; |
| 80 | data.writeInterfaceToken(BpMediaExtractor::getInterfaceDescriptor()); |
| 81 | data.writeUint32(index); |
| 82 | data.writeUint32(flags); |
| 83 | status_t ret = remote()->transact(GETTRACKMETADATA, data, &reply); |
| 84 | if (ret == NO_ERROR) { |
| 85 | return MetaData::createFromParcel(reply); |
| 86 | } |
| 87 | return NULL; |
| 88 | } |
| 89 | |
| 90 | virtual sp<MetaData> getMetaData() { |
| 91 | ALOGV("getMetaData"); |
| 92 | Parcel data, reply; |
| 93 | data.writeInterfaceToken(BpMediaExtractor::getInterfaceDescriptor()); |
| 94 | status_t ret = remote()->transact(GETMETADATA, data, &reply); |
| 95 | if (ret == NO_ERROR) { |
| 96 | return MetaData::createFromParcel(reply); |
| 97 | } |
| 98 | return NULL; |
| 99 | } |
| 100 | |
Ray Essick | ba13b7b | 2017-02-07 10:03:18 -0800 | [diff] [blame] | 101 | virtual status_t getMetrics(Parcel * reply) { |
| 102 | Parcel data; |
| 103 | data.writeInterfaceToken(BpMediaExtractor::getInterfaceDescriptor()); |
| 104 | status_t ret = remote()->transact(GETMETRICS, data, reply); |
| 105 | if (ret == NO_ERROR) { |
| 106 | return OK; |
| 107 | } |
| 108 | return UNKNOWN_ERROR; |
| 109 | } |
| 110 | |
Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 111 | virtual uint32_t flags() const { |
Marco Nelissen | e4f4b79 | 2020-01-17 13:15:18 -0800 | [diff] [blame] | 112 | ALOGV("flags"); |
| 113 | Parcel data, reply; |
| 114 | data.writeInterfaceToken(BpMediaExtractor::getInterfaceDescriptor()); |
| 115 | status_t ret = remote()->transact(FLAGS, data, &reply); |
| 116 | int flgs = 0; |
| 117 | if (ret == NO_ERROR) { |
| 118 | flgs = reply.readUint32(); |
| 119 | } |
| 120 | return flgs; |
Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 121 | } |
| 122 | |
Chong Zhang | d5a416a | 2017-05-16 11:16:34 -0700 | [diff] [blame] | 123 | virtual status_t setMediaCas(const HInterfaceToken &casToken) { |
Chong Zhang | 9dbe9a5 | 2017-01-03 11:35:15 -0800 | [diff] [blame] | 124 | ALOGV("setMediaCas"); |
| 125 | |
| 126 | Parcel data, reply; |
| 127 | data.writeInterfaceToken(BpMediaExtractor::getInterfaceDescriptor()); |
Chong Zhang | d5a416a | 2017-05-16 11:16:34 -0700 | [diff] [blame] | 128 | data.writeByteVector(casToken); |
Chong Zhang | 9dbe9a5 | 2017-01-03 11:35:15 -0800 | [diff] [blame] | 129 | |
| 130 | status_t err = remote()->transact(SETMEDIACAS, data, &reply); |
| 131 | if (err != NO_ERROR) { |
| 132 | return err; |
| 133 | } |
| 134 | return reply.readInt32(); |
| 135 | } |
| 136 | |
Marco Nelissen | e4f4b79 | 2020-01-17 13:15:18 -0800 | [diff] [blame] | 137 | virtual String8 name() { |
| 138 | Parcel data, reply; |
| 139 | data.writeInterfaceToken(BpMediaExtractor::getInterfaceDescriptor()); |
| 140 | status_t ret = remote()->transact(NAME, data, &reply); |
| 141 | String8 nm; |
| 142 | if (ret == NO_ERROR) { |
| 143 | nm = reply.readString8(); |
| 144 | } |
| 145 | return nm; |
Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 146 | } |
Santiago Seifert | 79c34f2 | 2020-11-11 23:49:28 +0000 | [diff] [blame] | 147 | |
| 148 | virtual status_t setEntryPoint(EntryPoint entryPoint) { |
| 149 | Parcel data, reply; |
| 150 | data.writeInterfaceToken(BpMediaExtractor::getInterfaceDescriptor()); |
| 151 | data.writeInt32(static_cast<int32_t>(entryPoint)); |
| 152 | return remote()->transact(SETENTRYPOINT, data, &reply); |
| 153 | } |
Santiago Seifert | 6dbe0d0 | 2021-04-28 23:38:51 +0100 | [diff] [blame^] | 154 | |
| 155 | virtual status_t setLogSessionId(const String8& logSessionId) { |
| 156 | Parcel data, reply; |
| 157 | data.writeInterfaceToken(BpMediaExtractor::getInterfaceDescriptor()); |
| 158 | data.writeString8(logSessionId); |
| 159 | return remote()->transact(SETLOGSESSIONID, data, &reply); |
| 160 | } |
Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 161 | }; |
| 162 | |
| 163 | IMPLEMENT_META_INTERFACE(MediaExtractor, "android.media.IMediaExtractor"); |
| 164 | |
| 165 | #undef LOG_TAG |
| 166 | #define LOG_TAG "BnMediaExtractor" |
| 167 | |
| 168 | status_t BnMediaExtractor::onTransact( |
| 169 | uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) |
| 170 | { |
| 171 | switch (code) { |
| 172 | case COUNTTRACKS: { |
| 173 | ALOGV("countTracks"); |
| 174 | CHECK_INTERFACE(IMediaExtractor, data, reply); |
| 175 | size_t numTracks = countTracks(); |
| 176 | if (numTracks > INT32_MAX) { |
| 177 | numTracks = 0; |
| 178 | } |
| 179 | reply->writeUint32(uint32_t(numTracks)); |
| 180 | return NO_ERROR; |
| 181 | } |
| 182 | case GETTRACK: { |
| 183 | ALOGV("getTrack()"); |
| 184 | CHECK_INTERFACE(IMediaExtractor, data, reply); |
| 185 | uint32_t idx; |
| 186 | if (data.readUint32(&idx) == NO_ERROR) { |
Marco Nelissen | 69d3d8a | 2016-03-07 13:20:01 -0800 | [diff] [blame] | 187 | const sp<IMediaSource> track = getTrack(size_t(idx)); |
| 188 | registerMediaSource(this, track); |
| 189 | return reply->writeStrongBinder(IInterface::asBinder(track)); |
Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 190 | } |
| 191 | return UNKNOWN_ERROR; |
| 192 | } |
| 193 | case GETTRACKMETADATA: { |
| 194 | ALOGV("getTrackMetaData"); |
| 195 | CHECK_INTERFACE(IMediaExtractor, data, reply); |
| 196 | uint32_t idx; |
| 197 | uint32_t flags; |
| 198 | if (data.readUint32(&idx) == NO_ERROR && |
| 199 | data.readUint32(&flags) == NO_ERROR) { |
| 200 | sp<MetaData> meta = getTrackMetaData(idx, flags); |
Marco Nelissen | 0d13824 | 2016-10-06 15:31:52 -0700 | [diff] [blame] | 201 | if (meta == NULL) { |
| 202 | return UNKNOWN_ERROR; |
| 203 | } |
Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 204 | meta->writeToParcel(*reply); |
| 205 | return NO_ERROR; |
| 206 | } |
| 207 | return UNKNOWN_ERROR; |
| 208 | } |
| 209 | case GETMETADATA: { |
| 210 | ALOGV("getMetaData"); |
| 211 | CHECK_INTERFACE(IMediaExtractor, data, reply); |
| 212 | sp<MetaData> meta = getMetaData(); |
| 213 | if (meta != NULL) { |
| 214 | meta->writeToParcel(*reply); |
| 215 | return NO_ERROR; |
| 216 | } |
| 217 | return UNKNOWN_ERROR; |
| 218 | } |
Ray Essick | ba13b7b | 2017-02-07 10:03:18 -0800 | [diff] [blame] | 219 | case GETMETRICS: { |
| 220 | CHECK_INTERFACE(IMediaExtractor, data, reply); |
| 221 | status_t ret = getMetrics(reply); |
| 222 | return ret; |
| 223 | } |
Marco Nelissen | e4f4b79 | 2020-01-17 13:15:18 -0800 | [diff] [blame] | 224 | case FLAGS: { |
| 225 | ALOGV("flags"); |
| 226 | CHECK_INTERFACE(IMediaExtractor, data, reply); |
| 227 | reply->writeUint32(this->flags()); |
| 228 | return NO_ERROR; |
| 229 | } |
Chong Zhang | 9dbe9a5 | 2017-01-03 11:35:15 -0800 | [diff] [blame] | 230 | case SETMEDIACAS: { |
| 231 | ALOGV("setMediaCas"); |
| 232 | CHECK_INTERFACE(IMediaExtractor, data, reply); |
| 233 | |
Chong Zhang | d5a416a | 2017-05-16 11:16:34 -0700 | [diff] [blame] | 234 | HInterfaceToken casToken; |
| 235 | status_t err = data.readByteVector(&casToken); |
Chong Zhang | 9dbe9a5 | 2017-01-03 11:35:15 -0800 | [diff] [blame] | 236 | if (err != NO_ERROR) { |
Chong Zhang | d5a416a | 2017-05-16 11:16:34 -0700 | [diff] [blame] | 237 | ALOGE("Error reading casToken from parcel"); |
Chong Zhang | 9dbe9a5 | 2017-01-03 11:35:15 -0800 | [diff] [blame] | 238 | return err; |
| 239 | } |
Chong Zhang | 9dbe9a5 | 2017-01-03 11:35:15 -0800 | [diff] [blame] | 240 | |
Chong Zhang | d5a416a | 2017-05-16 11:16:34 -0700 | [diff] [blame] | 241 | reply->writeInt32(setMediaCas(casToken)); |
Chong Zhang | 9dbe9a5 | 2017-01-03 11:35:15 -0800 | [diff] [blame] | 242 | return OK; |
| 243 | } |
Marco Nelissen | e4f4b79 | 2020-01-17 13:15:18 -0800 | [diff] [blame] | 244 | case NAME: { |
| 245 | ALOGV("name"); |
| 246 | CHECK_INTERFACE(IMediaExtractor, data, reply); |
| 247 | String8 nm = name(); |
| 248 | reply->writeString8(nm); |
| 249 | return NO_ERROR; |
| 250 | } |
Santiago Seifert | 79c34f2 | 2020-11-11 23:49:28 +0000 | [diff] [blame] | 251 | case SETENTRYPOINT: { |
| 252 | ALOGV("setEntryPoint"); |
| 253 | CHECK_INTERFACE(IMediaExtractor, data, reply); |
| 254 | int32_t entryPoint; |
| 255 | status_t err = data.readInt32(&entryPoint); |
| 256 | if (err == OK) { |
| 257 | setEntryPoint(EntryPoint(entryPoint)); |
| 258 | } |
| 259 | return err; |
| 260 | } |
Santiago Seifert | 6dbe0d0 | 2021-04-28 23:38:51 +0100 | [diff] [blame^] | 261 | case SETLOGSESSIONID: { |
| 262 | ALOGV("setLogSessionId"); |
| 263 | CHECK_INTERFACE(IMediaExtractor, data, reply); |
| 264 | String8 logSessionId; |
| 265 | status_t status = data.readString8(&logSessionId); |
| 266 | if (status == OK) { |
| 267 | setLogSessionId(logSessionId); |
| 268 | } |
| 269 | return status; |
| 270 | } |
Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 271 | default: |
| 272 | return BBinder::onTransact(code, data, reply, flags); |
| 273 | } |
| 274 | } |
| 275 | |
Marco Nelissen | 69d3d8a | 2016-03-07 13:20:01 -0800 | [diff] [blame] | 276 | typedef struct { |
| 277 | String8 mime; |
| 278 | String8 name; |
| 279 | String8 sourceDescription; |
| 280 | pid_t owner; |
| 281 | wp<IMediaExtractor> extractor; |
| 282 | Vector<wp<IMediaSource>> tracks; |
| 283 | Vector<String8> trackDescriptions; |
| 284 | String8 toString() const; |
Marco Nelissen | b589437 | 2019-01-10 14:44:13 -0800 | [diff] [blame] | 285 | time_t when; |
Marco Nelissen | 69d3d8a | 2016-03-07 13:20:01 -0800 | [diff] [blame] | 286 | } ExtractorInstance; |
| 287 | |
| 288 | String8 ExtractorInstance::toString() const { |
Marco Nelissen | b589437 | 2019-01-10 14:44:13 -0800 | [diff] [blame] | 289 | String8 str; |
| 290 | char timeString[32]; |
| 291 | strftime(timeString, sizeof(timeString), "%m-%d %T", localtime(&when)); |
| 292 | str.append(timeString); |
| 293 | str.append(": "); |
| 294 | str.append(name); |
Marco Nelissen | 69d3d8a | 2016-03-07 13:20:01 -0800 | [diff] [blame] | 295 | str.append(" for mime "); |
| 296 | str.append(mime); |
| 297 | str.append(", source "); |
| 298 | str.append(sourceDescription); |
| 299 | str.append(String8::format(", pid %d: ", owner)); |
| 300 | if (extractor.promote() == NULL) { |
| 301 | str.append("deleted\n"); |
| 302 | } else { |
| 303 | str.append("active\n"); |
| 304 | } |
| 305 | for (size_t i = 0; i < tracks.size(); i++) { |
| 306 | const String8 desc = trackDescriptions.itemAt(i); |
| 307 | str.appendFormat(" track {%s} ", desc.string()); |
Marco Nelissen | 460b7e8 | 2016-12-19 14:06:30 -0800 | [diff] [blame] | 308 | wp<IMediaSource> wSource = tracks.itemAt(i); |
| 309 | if (wSource == NULL) { |
| 310 | str.append(": null\n"); |
Marco Nelissen | 69d3d8a | 2016-03-07 13:20:01 -0800 | [diff] [blame] | 311 | } else { |
Marco Nelissen | 460b7e8 | 2016-12-19 14:06:30 -0800 | [diff] [blame] | 312 | const sp<IMediaSource> source = wSource.promote(); |
| 313 | if (source == NULL) { |
| 314 | str.append(": deleted\n"); |
| 315 | } else { |
| 316 | str.appendFormat(": active\n"); |
| 317 | } |
Marco Nelissen | 69d3d8a | 2016-03-07 13:20:01 -0800 | [diff] [blame] | 318 | } |
| 319 | } |
| 320 | return str; |
| 321 | } |
| 322 | |
Marco Nelissen | 8d27f5e | 2016-04-14 08:06:26 -0700 | [diff] [blame] | 323 | static Vector<ExtractorInstance> sExtractors; |
| 324 | static Mutex sExtractorsLock; |
Marco Nelissen | 69d3d8a | 2016-03-07 13:20:01 -0800 | [diff] [blame] | 325 | |
| 326 | void registerMediaSource( |
| 327 | const sp<IMediaExtractor> &ex, |
| 328 | const sp<IMediaSource> &source) { |
Marco Nelissen | 8d27f5e | 2016-04-14 08:06:26 -0700 | [diff] [blame] | 329 | Mutex::Autolock lock(sExtractorsLock); |
| 330 | for (size_t i = 0; i < sExtractors.size(); i++) { |
| 331 | ExtractorInstance &instance = sExtractors.editItemAt(i); |
Marco Nelissen | 69d3d8a | 2016-03-07 13:20:01 -0800 | [diff] [blame] | 332 | sp<IMediaExtractor> extractor = instance.extractor.promote(); |
| 333 | if (extractor != NULL && extractor == ex) { |
| 334 | if (instance.tracks.size() > 5) { |
| 335 | instance.tracks.resize(5); |
Marco Nelissen | 460b7e8 | 2016-12-19 14:06:30 -0800 | [diff] [blame] | 336 | instance.trackDescriptions.resize(5); |
Marco Nelissen | 69d3d8a | 2016-03-07 13:20:01 -0800 | [diff] [blame] | 337 | } |
| 338 | instance.tracks.push_front(source); |
Marco Nelissen | 460b7e8 | 2016-12-19 14:06:30 -0800 | [diff] [blame] | 339 | if (source != NULL) { |
| 340 | instance.trackDescriptions.push_front(source->getFormat()->toString()); |
| 341 | } else { |
| 342 | instance.trackDescriptions.push_front(String8::empty()); |
| 343 | } |
Marco Nelissen | 69d3d8a | 2016-03-07 13:20:01 -0800 | [diff] [blame] | 344 | break; |
| 345 | } |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | void registerMediaExtractor( |
| 350 | const sp<IMediaExtractor> &extractor, |
Marco Nelissen | a321469 | 2016-05-06 10:57:20 -0700 | [diff] [blame] | 351 | const sp<DataSource> &source, |
Marco Nelissen | 69d3d8a | 2016-03-07 13:20:01 -0800 | [diff] [blame] | 352 | const char *mime) { |
| 353 | ExtractorInstance ex; |
| 354 | ex.mime = mime == NULL ? "NULL" : mime; |
| 355 | ex.name = extractor->name(); |
| 356 | ex.sourceDescription = source->toString(); |
| 357 | ex.owner = IPCThreadState::self()->getCallingPid(); |
| 358 | ex.extractor = extractor; |
Marco Nelissen | b589437 | 2019-01-10 14:44:13 -0800 | [diff] [blame] | 359 | ex.when = time(NULL); |
Marco Nelissen | 69d3d8a | 2016-03-07 13:20:01 -0800 | [diff] [blame] | 360 | |
Marco Nelissen | 8d27f5e | 2016-04-14 08:06:26 -0700 | [diff] [blame] | 361 | { |
| 362 | Mutex::Autolock lock(sExtractorsLock); |
| 363 | if (sExtractors.size() > 10) { |
| 364 | sExtractors.resize(10); |
| 365 | } |
| 366 | sExtractors.push_front(ex); |
Marco Nelissen | 69d3d8a | 2016-03-07 13:20:01 -0800 | [diff] [blame] | 367 | } |
Marco Nelissen | 69d3d8a | 2016-03-07 13:20:01 -0800 | [diff] [blame] | 368 | } |
| 369 | |
| 370 | status_t dumpExtractors(int fd, const Vector<String16>&) { |
| 371 | String8 out; |
ray-cy.lee | b596c34 | 2017-03-07 18:25:15 +0800 | [diff] [blame] | 372 | const IPCThreadState* ipc = IPCThreadState::self(); |
| 373 | const int pid = ipc->getCallingPid(); |
| 374 | const int uid = ipc->getCallingUid(); |
| 375 | if (!PermissionCache::checkPermission(String16("android.permission.DUMP"), pid, uid)) { |
| 376 | out.appendFormat("Permission Denial: " |
| 377 | "can't dump MediaExtractor from pid=%d, uid=%d\n", pid, uid); |
| 378 | } else { |
| 379 | out.append("Recent extractors, most recent first:\n"); |
| 380 | { |
| 381 | Mutex::Autolock lock(sExtractorsLock); |
| 382 | for (size_t i = 0; i < sExtractors.size(); i++) { |
| 383 | const ExtractorInstance &instance = sExtractors.itemAt(i); |
| 384 | out.append(" "); |
| 385 | out.append(instance.toString()); |
| 386 | } |
Marco Nelissen | 8d27f5e | 2016-04-14 08:06:26 -0700 | [diff] [blame] | 387 | } |
Marco Nelissen | 69d3d8a | 2016-03-07 13:20:01 -0800 | [diff] [blame] | 388 | } |
| 389 | write(fd, out.string(), out.size()); |
| 390 | return OK; |
| 391 | } |
| 392 | |
Marco Nelissen | b2487f0 | 2015-09-01 13:23:23 -0700 | [diff] [blame] | 393 | |
| 394 | } // namespace android |
| 395 | |