Merge "cas: retrieve detailed error from descrambler"

This commit is contained in:
TreeHugger Robot
2019-01-15 20:41:05 +00:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 3 deletions

View File

@@ -23,10 +23,10 @@ cc_defaults {
"libhidlmemory",
"libhidltransport",
"liblog",
"libstagefright_foundation",
"libutils",
],
header_libs: [
"libstagefright_foundation_headers",
"media_plugin_headers",
],
}

View File

@@ -20,6 +20,7 @@
#include <hidlmemory/mapping.h>
#include <media/cas/DescramblerAPI.h>
#include <media/hardware/CryptoAPI.h>
#include <media/stagefright/foundation/AString.h>
#include <media/stagefright/foundation/AUtils.h>
#include <utils/Log.h>
@@ -177,6 +178,7 @@ Return<void> DescramblerImpl::descramble(
// Casting hidl SubSample to DescramblerPlugin::SubSample, but need
// to ensure structs are actually idential
AString detailedError;
int32_t result = holder->descramble(
dstBuffer.type != BufferType::SHARED_MEMORY,
(DescramblerPlugin::ScramblingControl)scramblingControl,
@@ -186,10 +188,10 @@ Return<void> DescramblerImpl::descramble(
srcOffset,
dstPtr,
dstOffset,
NULL);
&detailedError);
holder.reset();
_hidl_cb(toStatus(result >= 0 ? OK : result), result, NULL);
_hidl_cb(toStatus(result >= 0 ? OK : result), result, detailedError.c_str());
return Void();
}