1 /*
2  * Copyright 2021 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 
17 //#define LOG_NDEBUG 0
18 #define LOG_TAG "Codec2-ComponentStore@1.2"
19 #include <android-base/logging.h>
20 
21 #include <codec2/hidl/1.2/ComponentStore.h>
22 #include <codec2/hidl/1.2/InputSurface.h>
23 #include <codec2/hidl/1.2/types.h>
24 
25 #include <android-base/file.h>
26 #include <media/stagefright/bqhelper/GraphicBufferSource.h>
27 #include <utils/Errors.h>
28 
29 #include <C2PlatformSupport.h>
30 #include <util/C2InterfaceHelper.h>
31 
32 #include <chrono>
33 #include <ctime>
34 #include <iomanip>
35 #include <ostream>
36 #include <sstream>
37 
38 #ifndef __ANDROID_APEX__
39 #include <codec2/hidl/plugin/FilterPlugin.h>
40 #include <dlfcn.h>
41 #include <C2Config.h>
42 #include <DefaultFilterPlugin.h>
43 #include <FilterWrapper.h>
44 #endif
45 
46 namespace android {
47 namespace hardware {
48 namespace media {
49 namespace c2 {
50 namespace V1_2 {
51 namespace utils {
52 
53 using namespace ::android;
54 using ::android::GraphicBufferSource;
55 using namespace ::android::hardware::media::bufferpool::V2_0::implementation;
56 
57 namespace /* unnamed */ {
58 
59 struct StoreIntf : public ConfigurableC2Intf {
StoreIntfandroid::hardware::media::c2::V1_2::utils::__anond1683e680111::StoreIntf60     StoreIntf(const std::shared_ptr<C2ComponentStore>& store)
61           : ConfigurableC2Intf{store ? store->getName() : "", 0},
62             mStore{store} {
63     }
64 
configandroid::hardware::media::c2::V1_2::utils::__anond1683e680111::StoreIntf65     virtual c2_status_t config(
66             const std::vector<C2Param*> &params,
67             c2_blocking_t mayBlock,
68             std::vector<std::unique_ptr<C2SettingResult>> *const failures
69             ) override {
70         // Assume all params are blocking
71         // TODO: Filter for supported params
72         if (mayBlock == C2_DONT_BLOCK && params.size() != 0) {
73             return C2_BLOCKING;
74         }
75         return mStore->config_sm(params, failures);
76     }
77 
queryandroid::hardware::media::c2::V1_2::utils::__anond1683e680111::StoreIntf78     virtual c2_status_t query(
79             const std::vector<C2Param::Index> &indices,
80             c2_blocking_t mayBlock,
81             std::vector<std::unique_ptr<C2Param>> *const params) const override {
82         // Assume all params are blocking
83         // TODO: Filter for supported params
84         if (mayBlock == C2_DONT_BLOCK && indices.size() != 0) {
85             return C2_BLOCKING;
86         }
87         return mStore->query_sm({}, indices, params);
88     }
89 
querySupportedParamsandroid::hardware::media::c2::V1_2::utils::__anond1683e680111::StoreIntf90     virtual c2_status_t querySupportedParams(
91             std::vector<std::shared_ptr<C2ParamDescriptor>> *const params
92             ) const override {
93         return mStore->querySupportedParams_nb(params);
94     }
95 
querySupportedValuesandroid::hardware::media::c2::V1_2::utils::__anond1683e680111::StoreIntf96     virtual c2_status_t querySupportedValues(
97             std::vector<C2FieldSupportedValuesQuery> &fields,
98             c2_blocking_t mayBlock) const override {
99         // Assume all params are blocking
100         // TODO: Filter for supported params
101         if (mayBlock == C2_DONT_BLOCK && fields.size() != 0) {
102             return C2_BLOCKING;
103         }
104         return mStore->querySupportedValues_sm(fields);
105     }
106 
107 protected:
108     std::shared_ptr<C2ComponentStore> mStore;
109 };
110 
111 } // unnamed namespace
112 
113 struct ComponentStore::StoreParameterCache : public ParameterCache {
114     std::mutex mStoreMutex;
115     ComponentStore* mStore;
116 
StoreParameterCacheandroid::hardware::media::c2::V1_2::utils::ComponentStore::StoreParameterCache117     StoreParameterCache(ComponentStore* store): mStore{store} {
118     }
119 
validateandroid::hardware::media::c2::V1_2::utils::ComponentStore::StoreParameterCache120     virtual c2_status_t validate(
121             const std::vector<std::shared_ptr<C2ParamDescriptor>>& params
122             ) override {
123         std::scoped_lock _lock(mStoreMutex);
124         return mStore ? mStore->validateSupportedParams(params) : C2_NO_INIT;
125     }
126 
onStoreDestroyedandroid::hardware::media::c2::V1_2::utils::ComponentStore::StoreParameterCache127     void onStoreDestroyed() {
128         std::scoped_lock _lock(mStoreMutex);
129         mStore = nullptr;
130     }
131 };
132 
ComponentStore(const std::shared_ptr<C2ComponentStore> & store)133 ComponentStore::ComponentStore(const std::shared_ptr<C2ComponentStore>& store)
134       : mConfigurable{new CachedConfigurable(std::make_unique<StoreIntf>(store))},
135         mParameterCache{std::make_shared<StoreParameterCache>(this)},
136         mStore{store} {
137 
138     std::shared_ptr<C2ComponentStore> platformStore = android::GetCodec2PlatformComponentStore();
139     SetPreferredCodec2ComponentStore(store);
140 
141     // Retrieve struct descriptors
142     mParamReflectors.push_back(mStore->getParamReflector());
143 #ifndef __ANDROID_APEX__
144     std::shared_ptr<C2ParamReflector> paramReflector =
145         GetFilterWrapper()->getParamReflector();
146     if (paramReflector != nullptr) {
147         ALOGD("[%s] added param reflector from filter wrapper", mStore->getName().c_str());
148         mParamReflectors.push_back(paramReflector);
149     }
150 #endif
151 
152     // Retrieve supported parameters from store
153     using namespace std::placeholders;
154     mInit = mConfigurable->init(mParameterCache);
155 }
156 
~ComponentStore()157 ComponentStore::~ComponentStore() {
158     mParameterCache->onStoreDestroyed();
159 }
160 
status() const161 c2_status_t ComponentStore::status() const {
162     return mInit;
163 }
164 
validateSupportedParams(const std::vector<std::shared_ptr<C2ParamDescriptor>> & params)165 c2_status_t ComponentStore::validateSupportedParams(
166         const std::vector<std::shared_ptr<C2ParamDescriptor>>& params) {
167     c2_status_t res = C2_OK;
168 
169     for (const std::shared_ptr<C2ParamDescriptor> &desc : params) {
170         if (!desc) {
171             // All descriptors should be valid
172             res = res ? res : C2_BAD_VALUE;
173             continue;
174         }
175         C2Param::CoreIndex coreIndex = desc->index().coreIndex();
176         std::lock_guard<std::mutex> lock(mStructDescriptorsMutex);
177         auto it = mStructDescriptors.find(coreIndex);
178         if (it == mStructDescriptors.end()) {
179             std::shared_ptr<C2StructDescriptor> structDesc = describe(coreIndex);
180             if (!structDesc) {
181                 // All supported params must be described
182                 res = C2_BAD_INDEX;
183             }
184             mStructDescriptors.insert({ coreIndex, structDesc });
185         }
186     }
187     return res;
188 }
189 
getParameterCache() const190 std::shared_ptr<ParameterCache> ComponentStore::getParameterCache() const {
191     return mParameterCache;
192 }
193 
194 #ifndef __ANDROID_APEX__
195 // static
GetFilterWrapper()196 std::shared_ptr<FilterWrapper> ComponentStore::GetFilterWrapper() {
197     constexpr const char kPluginPath[] = "libc2filterplugin.so";
198     static std::shared_ptr<FilterWrapper> wrapper = FilterWrapper::Create(
199             std::make_unique<DefaultFilterPlugin>(kPluginPath));
200     return wrapper;
201 }
202 #endif
203 
tryCreateMultiAccessUnitInterface(const std::shared_ptr<C2ComponentInterface> & c2interface)204 std::shared_ptr<MultiAccessUnitInterface> ComponentStore::tryCreateMultiAccessUnitInterface(
205         const std::shared_ptr<C2ComponentInterface> &c2interface) {
206     std::shared_ptr<MultiAccessUnitInterface> multiAccessUnitIntf = nullptr;
207     if (c2interface == nullptr) {
208         return nullptr;
209     }
210     if (MultiAccessUnitHelper::isEnabledOnPlatform()) {
211         c2_status_t err = C2_OK;
212         C2ComponentDomainSetting domain;
213         std::vector<std::unique_ptr<C2Param>> heapParams;
214         err = c2interface->query_vb({&domain}, {}, C2_MAY_BLOCK, &heapParams);
215         if (err == C2_OK && (domain.value == C2Component::DOMAIN_AUDIO)) {
216             std::vector<std::shared_ptr<C2ParamDescriptor>> params;
217             bool isComponentSupportsLargeAudioFrame = false;
218             c2interface->querySupportedParams_nb(&params);
219             for (const auto &paramDesc : params) {
220                 if (paramDesc->name().compare(C2_PARAMKEY_OUTPUT_LARGE_FRAME) == 0) {
221                     isComponentSupportsLargeAudioFrame = true;
222                     break;
223                 }
224             }
225             if (!isComponentSupportsLargeAudioFrame) {
226                 multiAccessUnitIntf = std::make_shared<MultiAccessUnitInterface>(
227                         c2interface,
228                         std::static_pointer_cast<C2ReflectorHelper>(mParamReflectors[0]));
229             }
230         }
231     }
232     return multiAccessUnitIntf;
233 }
234 
235 // Methods from ::android::hardware::media::c2::V1_0::IComponentStore
createComponent(const hidl_string & name,const sp<IComponentListener> & listener,const sp<IClientManager> & pool,createComponent_cb _hidl_cb)236 Return<void> ComponentStore::createComponent(
237         const hidl_string& name,
238         const sp<IComponentListener>& listener,
239         const sp<IClientManager>& pool,
240         createComponent_cb _hidl_cb) {
241 
242     sp<Component> component;
243     std::shared_ptr<C2Component> c2component;
244     Status status = static_cast<Status>(
245             mStore->createComponent(name, &c2component));
246 
247     if (status == Status::OK) {
248 #ifndef __ANDROID_APEX__
249         c2component = GetFilterWrapper()->maybeWrapComponent(c2component);
250 #endif
251         onInterfaceLoaded(c2component->intf());
252         component = new Component(c2component, listener, this, pool);
253         if (!component) {
254             status = Status::CORRUPTED;
255         } else {
256             reportComponentBirth(component.get());
257             if (component->status() != C2_OK) {
258                 status = static_cast<Status>(component->status());
259             } else {
260                 component->initListener(component);
261                 if (component->status() != C2_OK) {
262                     status = static_cast<Status>(component->status());
263                 }
264             }
265         }
266     }
267     _hidl_cb(status, component);
268     return Void();
269 }
270 
createInterface(const hidl_string & name,createInterface_cb _hidl_cb)271 Return<void> ComponentStore::createInterface(
272         const hidl_string& name,
273         createInterface_cb _hidl_cb) {
274     std::shared_ptr<C2ComponentInterface> c2interface;
275     c2_status_t res = mStore->createInterface(name, &c2interface);
276     sp<IComponentInterface> interface;
277     if (res == C2_OK) {
278 #ifndef __ANDROID_APEX__
279         c2interface = GetFilterWrapper()->maybeWrapInterface(c2interface);
280 #endif
281         onInterfaceLoaded(c2interface);
282         std::shared_ptr<MultiAccessUnitInterface> multiAccessUnitIntf =
283                 tryCreateMultiAccessUnitInterface(c2interface);
284         interface = new ComponentInterface(c2interface, multiAccessUnitIntf, mParameterCache);
285     }
286     _hidl_cb(static_cast<Status>(res), interface);
287     return Void();
288 }
289 
listComponents(listComponents_cb _hidl_cb)290 Return<void> ComponentStore::listComponents(listComponents_cb _hidl_cb) {
291     std::vector<std::shared_ptr<const C2Component::Traits>> c2traits =
292             mStore->listComponents();
293     hidl_vec<IComponentStore::ComponentTraits> traits(c2traits.size());
294     size_t ix = 0;
295     for (const std::shared_ptr<const C2Component::Traits> &c2trait : c2traits) {
296         if (c2trait) {
297             if (objcpy(&traits[ix], *c2trait)) {
298                 ++ix;
299             } else {
300                 break;
301             }
302         }
303     }
304     traits.resize(ix);
305     _hidl_cb(Status::OK, traits);
306     return Void();
307 }
308 
createInputSurface(createInputSurface_cb _hidl_cb)309 Return<void> ComponentStore::createInputSurface(createInputSurface_cb _hidl_cb) {
310     sp<GraphicBufferSource> source = new GraphicBufferSource();
311     if (source->initCheck() != OK) {
312         _hidl_cb(Status::CORRUPTED, nullptr);
313         return Void();
314     }
315     using namespace std::placeholders;
316     sp<InputSurface> inputSurface = new InputSurface(
317             mParameterCache,
318             std::make_shared<C2ReflectorHelper>(),
319             source->getHGraphicBufferProducer(),
320             source);
321     _hidl_cb(inputSurface ? Status::OK : Status::NO_MEMORY,
322              inputSurface);
323     return Void();
324 }
325 
onInterfaceLoaded(const std::shared_ptr<C2ComponentInterface> & intf)326 void ComponentStore::onInterfaceLoaded(const std::shared_ptr<C2ComponentInterface> &intf) {
327     // invalidate unsupported struct descriptors if a new interface is loaded as it may have
328     // exposed new descriptors
329     std::lock_guard<std::mutex> lock(mStructDescriptorsMutex);
330     if (!mLoadedInterfaces.count(intf->getName())) {
331         mUnsupportedStructDescriptors.clear();
332         mLoadedInterfaces.emplace(intf->getName());
333     }
334 }
335 
getStructDescriptors(const hidl_vec<uint32_t> & indices,getStructDescriptors_cb _hidl_cb)336 Return<void> ComponentStore::getStructDescriptors(
337         const hidl_vec<uint32_t>& indices,
338         getStructDescriptors_cb _hidl_cb) {
339     hidl_vec<StructDescriptor> descriptors(indices.size());
340     size_t dstIx = 0;
341     Status res = Status::OK;
342     for (size_t srcIx = 0; srcIx < indices.size(); ++srcIx) {
343         std::lock_guard<std::mutex> lock(mStructDescriptorsMutex);
344         const C2Param::CoreIndex coreIndex = C2Param::CoreIndex(indices[srcIx]).coreIndex();
345         const auto item = mStructDescriptors.find(coreIndex);
346         if (item == mStructDescriptors.end()) {
347             // not in the cache, and not known to be unsupported, query local reflector
348             if (!mUnsupportedStructDescriptors.count(coreIndex)) {
349                 std::shared_ptr<C2StructDescriptor> structDesc = describe(coreIndex);
350                 if (!structDesc) {
351                     mUnsupportedStructDescriptors.emplace(coreIndex);
352                 } else {
353                     mStructDescriptors.insert({ coreIndex, structDesc });
354                     if (objcpy(&descriptors[dstIx], *structDesc)) {
355                         ++dstIx;
356                         continue;
357                     }
358                     res = Status::CORRUPTED;
359                     break;
360                 }
361             }
362             res = Status::NOT_FOUND;
363         } else if (item->second) {
364             if (objcpy(&descriptors[dstIx], *item->second)) {
365                 ++dstIx;
366                 continue;
367             }
368             res = Status::CORRUPTED;
369             break;
370         } else {
371             res = Status::NO_MEMORY;
372             break;
373         }
374     }
375     descriptors.resize(dstIx);
376     _hidl_cb(res, descriptors);
377     return Void();
378 }
379 
getPoolClientManager()380 Return<sp<IClientManager>> ComponentStore::getPoolClientManager() {
381     return ClientManager::getInstance();
382 }
383 
copyBuffer(const Buffer & src,const Buffer & dst)384 Return<Status> ComponentStore::copyBuffer(const Buffer& src, const Buffer& dst) {
385     // TODO implement
386     (void)src;
387     (void)dst;
388     return Status::OMITTED;
389 }
390 
getConfigurable()391 Return<sp<IConfigurable>> ComponentStore::getConfigurable() {
392     return mConfigurable;
393 }
394 
395 // Methods from ::android::hardware::media::c2::V1_1::IComponentStore
createComponent_1_1(const hidl_string & name,const sp<IComponentListener> & listener,const sp<IClientManager> & pool,createComponent_1_1_cb _hidl_cb)396 Return<void> ComponentStore::createComponent_1_1(
397         const hidl_string& name,
398         const sp<IComponentListener>& listener,
399         const sp<IClientManager>& pool,
400         createComponent_1_1_cb _hidl_cb) {
401 
402     sp<Component> component;
403     std::shared_ptr<C2Component> c2component;
404     Status status = static_cast<Status>(
405             mStore->createComponent(name, &c2component));
406 
407     if (status == Status::OK) {
408 #ifndef __ANDROID_APEX__
409         c2component = GetFilterWrapper()->maybeWrapComponent(c2component);
410 #endif
411         onInterfaceLoaded(c2component->intf());
412         component = new Component(c2component, listener, this, pool);
413         if (!component) {
414             status = Status::CORRUPTED;
415         } else {
416             reportComponentBirth(component.get());
417             if (component->status() != C2_OK) {
418                 status = static_cast<Status>(component->status());
419             } else {
420                 component->initListener(component);
421                 if (component->status() != C2_OK) {
422                     status = static_cast<Status>(component->status());
423                 }
424             }
425         }
426     }
427     _hidl_cb(status, component);
428     return Void();
429 }
430 
431 // Methods from ::android::hardware::media::c2::V1_2::IComponentStore
createComponent_1_2(const hidl_string & name,const sp<IComponentListener> & listener,const sp<IClientManager> & pool,createComponent_1_2_cb _hidl_cb)432 Return<void> ComponentStore::createComponent_1_2(
433         const hidl_string& name,
434         const sp<IComponentListener>& listener,
435         const sp<IClientManager>& pool,
436         createComponent_1_2_cb _hidl_cb) {
437 
438     sp<Component> component;
439     std::shared_ptr<C2Component> c2component;
440     Status status = static_cast<Status>(
441             mStore->createComponent(name, &c2component));
442 
443     if (status == Status::OK) {
444 #ifndef __ANDROID_APEX__
445         c2component = GetFilterWrapper()->maybeWrapComponent(c2component);
446 #endif
447         onInterfaceLoaded(c2component->intf());
448         component = new Component(c2component, listener, this, pool);
449         if (!component) {
450             status = Status::CORRUPTED;
451         } else {
452             reportComponentBirth(component.get());
453             if (component->status() != C2_OK) {
454                 status = static_cast<Status>(component->status());
455             } else {
456                 component->initListener(component);
457                 if (component->status() != C2_OK) {
458                     status = static_cast<Status>(component->status());
459                 }
460             }
461         }
462     }
463     _hidl_cb(status, component);
464     return Void();
465 }
466 
describe(const C2Param::CoreIndex & index)467 std::shared_ptr<C2StructDescriptor> ComponentStore::describe(const C2Param::CoreIndex &index) {
468     for (const std::shared_ptr<C2ParamReflector> &reflector : mParamReflectors) {
469         std::shared_ptr<C2StructDescriptor> desc = reflector->describe(index);
470         if (desc) {
471             return desc;
472         }
473     }
474     return nullptr;
475 }
476 
477 // Called from createComponent() after a successful creation of `component`.
reportComponentBirth(Component * component)478 void ComponentStore::reportComponentBirth(Component* component) {
479     ComponentStatus componentStatus;
480     componentStatus.c2Component = component->mComponent;
481     componentStatus.birthTime = std::chrono::system_clock::now();
482 
483     std::lock_guard<std::mutex> lock(mComponentRosterMutex);
484     mComponentRoster.emplace(component, componentStatus);
485 }
486 
487 // Called from within the destructor of `component`. No virtual function calls
488 // are made on `component` here.
reportComponentDeath(Component * component)489 void ComponentStore::reportComponentDeath(Component* component) {
490     std::lock_guard<std::mutex> lock(mComponentRosterMutex);
491     mComponentRoster.erase(component);
492 }
493 
494 // Dumps component traits.
dump(std::ostream & out,const std::shared_ptr<const C2Component::Traits> & comp)495 std::ostream& ComponentStore::dump(
496         std::ostream& out,
497         const std::shared_ptr<const C2Component::Traits>& comp) {
498 
499     constexpr const char indent[] = "    ";
500 
501     out << indent << "name: " << comp->name << std::endl;
502     out << indent << "domain: " << comp->domain << std::endl;
503     out << indent << "kind: " << comp->kind << std::endl;
504     out << indent << "rank: " << comp->rank << std::endl;
505     out << indent << "mediaType: " << comp->mediaType << std::endl;
506     out << indent << "aliases:";
507     for (const auto& alias : comp->aliases) {
508         out << ' ' << alias;
509     }
510     out << std::endl;
511 
512     return out;
513 }
514 
515 // Dumps component status.
dump(std::ostream & out,ComponentStatus & compStatus)516 std::ostream& ComponentStore::dump(
517         std::ostream& out,
518         ComponentStatus& compStatus) {
519 
520     constexpr const char indent[] = "    ";
521 
522     // Print birth time.
523     std::chrono::milliseconds ms =
524             std::chrono::duration_cast<std::chrono::milliseconds>(
525                 compStatus.birthTime.time_since_epoch());
526     std::time_t birthTime = std::chrono::system_clock::to_time_t(
527             compStatus.birthTime);
528     std::tm tm = *std::localtime(&birthTime);
529     out << indent << "Creation time: "
530         << std::put_time(&tm, "%Y-%m-%d %H:%M:%S")
531         << '.' << std::setfill('0') << std::setw(3) << ms.count() % 1000
532         << std::endl;
533 
534     // Print name and id.
535     std::shared_ptr<C2ComponentInterface> intf = compStatus.c2Component->intf();
536     if (!intf) {
537         out << indent << "Unknown component -- null interface" << std::endl;
538         return out;
539     }
540     out << indent << "Name: " << intf->getName() << std::endl;
541     out << indent << "Id: " << intf->getId() << std::endl;
542 
543     return out;
544 }
545 
546 // Dumps information when lshal is called.
debug(const hidl_handle & handle,const hidl_vec<hidl_string> &)547 Return<void> ComponentStore::debug(
548         const hidl_handle& handle,
549         const hidl_vec<hidl_string>& /* args */) {
550     LOG(INFO) << "debug -- dumping...";
551     const native_handle_t *h = handle.getNativeHandle();
552     if (!h || h->numFds != 1) {
553        LOG(ERROR) << "debug -- dumping failed -- "
554                "invalid file descriptor to dump to";
555        return Void();
556     }
557     std::ostringstream out;
558 
559     { // Populate "out".
560 
561         constexpr const char indent[] = "  ";
562 
563         // Show name.
564         out << "Beginning of dump -- C2ComponentStore: "
565                 << mStore->getName() << std::endl << std::endl;
566 
567         // Retrieve the list of supported components.
568         std::vector<std::shared_ptr<const C2Component::Traits>> traitsList =
569                 mStore->listComponents();
570 
571         // Dump the traits of supported components.
572         out << indent << "Supported components:" << std::endl << std::endl;
573         if (traitsList.size() == 0) {
574             out << indent << indent << "NONE" << std::endl << std::endl;
575         } else {
576             for (const auto& traits : traitsList) {
577                 dump(out, traits) << std::endl;
578             }
579         }
580 
581         // Dump active components.
582         {
583             out << indent << "Active components:" << std::endl << std::endl;
584             std::lock_guard<std::mutex> lock(mComponentRosterMutex);
585             if (mComponentRoster.size() == 0) {
586                 out << indent << indent << "NONE" << std::endl << std::endl;
587             } else {
588                 for (auto& pair : mComponentRoster) {
589                     dump(out, pair.second) << std::endl;
590                 }
591             }
592         }
593 
594         out << "End of dump -- C2ComponentStore: "
595                 << mStore->getName() << std::endl;
596     }
597 
598     if (!android::base::WriteStringToFd(out.str(), h->data[0])) {
599         PLOG(WARNING) << "debug -- dumping failed -- write()";
600     } else {
601         LOG(INFO) << "debug -- dumping succeeded";
602     }
603     return Void();
604 }
605 
606 } // namespace utils
607 } // namespace V1_2
608 } // namespace c2
609 } // namespace media
610 } // namespace hardware
611 } // namespace android
612