}
dataSource->getDrmInfo(&mDecryptHandle, &mDrmManagerClient);
- if (mDecryptHandle != NULL) {
- if (RightsStatus::RIGHTS_VALID == mDecryptHandle->status) {
- if (DecryptApiType::CONTAINER_BASED == mDecryptHandle->decryptApiType) {
- mDrmManagerClient->consumeRights(mDecryptHandle, Action::PLAY, true);
- }
- } else {
- notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_NO_LICENSE);
- }
+ if (mDecryptHandle != NULL
+ && RightsStatus::RIGHTS_VALID != mDecryptHandle->status) {
+ notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_NO_LICENSE);
}
return setDataSource_l(extractor);
}
mExtractorFlags = extractor->flags();
- if (mDecryptHandle != NULL) {
- if (DecryptApiType::ELEMENTARY_STREAM_BASED == mDecryptHandle->decryptApiType) {
- mDrmManagerClient->consumeRights(mDecryptHandle, Action::PLAY, true);
- }
- }
return OK;
}
if (mDecryptHandle != NULL) {
mDrmManagerClient->setPlaybackStatus(mDecryptHandle,
Playback::STOP, 0);
- mDrmManagerClient->consumeRights(mDecryptHandle,
- Action::PLAY, false);
mDecryptHandle = NULL;
mDrmManagerClient = NULL;
}
}
dataSource->getDrmInfo(&mDecryptHandle, &mDrmManagerClient);
- if (mDecryptHandle != NULL) {
- if (RightsStatus::RIGHTS_VALID == mDecryptHandle->status) {
- if (DecryptApiType::CONTAINER_BASED == mDecryptHandle->decryptApiType) {
- mDrmManagerClient->consumeRights(mDecryptHandle, Action::PLAY, true);
- }
- } else {
- notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_NO_LICENSE);
- }
+ if (mDecryptHandle != NULL
+ && RightsStatus::RIGHTS_VALID != mDecryptHandle->status) {
+ notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_NO_LICENSE);
}
if (dataSource->flags() & DataSource::kWantsPrefetching) {
#include <media/stagefright/MediaErrors.h>
#include <utils/String8.h>
+#include <cutils/properties.h>
+
namespace android {
bool DataSource::getUInt16(off_t offset, uint16_t *x) {
RegisterSniffer(SniffAMR);
RegisterSniffer(SniffWAV);
RegisterSniffer(SniffOgg);
- RegisterSniffer(SniffDRM);
+
+ char value[PROPERTY_VALUE_MAX];
+ if (property_get("drm.service.enabled", value, NULL)
+ && (!strcmp(value, "1") || !strcasecmp(value, "true"))) {
+ RegisterSniffer(SniffDRM);
+ }
}
// static