Merge "- Move the business rule management down to DRM agents. - Do not register DRM sniffer because drmserver is not enabled."
This commit is contained in:
@ -288,14 +288,9 @@ status_t AwesomePlayer::setDataSource_l(
|
|||||||
}
|
}
|
||||||
|
|
||||||
dataSource->getDrmInfo(&mDecryptHandle, &mDrmManagerClient);
|
dataSource->getDrmInfo(&mDecryptHandle, &mDrmManagerClient);
|
||||||
if (mDecryptHandle != NULL) {
|
if (mDecryptHandle != NULL
|
||||||
if (RightsStatus::RIGHTS_VALID == mDecryptHandle->status) {
|
&& RightsStatus::RIGHTS_VALID != mDecryptHandle->status) {
|
||||||
if (DecryptApiType::CONTAINER_BASED == mDecryptHandle->decryptApiType) {
|
notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_NO_LICENSE);
|
||||||
mDrmManagerClient->consumeRights(mDecryptHandle, Action::PLAY, true);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_NO_LICENSE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return setDataSource_l(extractor);
|
return setDataSource_l(extractor);
|
||||||
@ -328,11 +323,6 @@ status_t AwesomePlayer::setDataSource_l(const sp<MediaExtractor> &extractor) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mExtractorFlags = extractor->flags();
|
mExtractorFlags = extractor->flags();
|
||||||
if (mDecryptHandle != NULL) {
|
|
||||||
if (DecryptApiType::ELEMENTARY_STREAM_BASED == mDecryptHandle->decryptApiType) {
|
|
||||||
mDrmManagerClient->consumeRights(mDecryptHandle, Action::PLAY, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@ -346,8 +336,6 @@ void AwesomePlayer::reset_l() {
|
|||||||
if (mDecryptHandle != NULL) {
|
if (mDecryptHandle != NULL) {
|
||||||
mDrmManagerClient->setPlaybackStatus(mDecryptHandle,
|
mDrmManagerClient->setPlaybackStatus(mDecryptHandle,
|
||||||
Playback::STOP, 0);
|
Playback::STOP, 0);
|
||||||
mDrmManagerClient->consumeRights(mDecryptHandle,
|
|
||||||
Action::PLAY, false);
|
|
||||||
mDecryptHandle = NULL;
|
mDecryptHandle = NULL;
|
||||||
mDrmManagerClient = NULL;
|
mDrmManagerClient = NULL;
|
||||||
}
|
}
|
||||||
@ -1190,14 +1178,9 @@ status_t AwesomePlayer::finishSetDataSource_l() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dataSource->getDrmInfo(&mDecryptHandle, &mDrmManagerClient);
|
dataSource->getDrmInfo(&mDecryptHandle, &mDrmManagerClient);
|
||||||
if (mDecryptHandle != NULL) {
|
if (mDecryptHandle != NULL
|
||||||
if (RightsStatus::RIGHTS_VALID == mDecryptHandle->status) {
|
&& RightsStatus::RIGHTS_VALID != mDecryptHandle->status) {
|
||||||
if (DecryptApiType::CONTAINER_BASED == mDecryptHandle->decryptApiType) {
|
notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_NO_LICENSE);
|
||||||
mDrmManagerClient->consumeRights(mDecryptHandle, Action::PLAY, true);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_NO_LICENSE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dataSource->flags() & DataSource::kWantsPrefetching) {
|
if (dataSource->flags() & DataSource::kWantsPrefetching) {
|
||||||
|
@ -28,6 +28,8 @@
|
|||||||
#include <media/stagefright/MediaErrors.h>
|
#include <media/stagefright/MediaErrors.h>
|
||||||
#include <utils/String8.h>
|
#include <utils/String8.h>
|
||||||
|
|
||||||
|
#include <cutils/properties.h>
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
|
||||||
bool DataSource::getUInt16(off_t offset, uint16_t *x) {
|
bool DataSource::getUInt16(off_t offset, uint16_t *x) {
|
||||||
@ -95,7 +97,12 @@ void DataSource::RegisterDefaultSniffers() {
|
|||||||
RegisterSniffer(SniffAMR);
|
RegisterSniffer(SniffAMR);
|
||||||
RegisterSniffer(SniffWAV);
|
RegisterSniffer(SniffWAV);
|
||||||
RegisterSniffer(SniffOgg);
|
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
|
// static
|
||||||
|
Reference in New Issue
Block a user