summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2011-03-23 17:03:46 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-03-23 17:03:46 -0700
commit0b1b2a3212cc6c96959e009a9705f94f2ed8b4f4 (patch)
tree18cb223d20b4b138cda664121b2d12028b478186 /media
parentefb8eda41a2dce03db0984c490c16f6a32867ded (diff)
parent1b11b64bb66b624f1bcfef89c4b6f6af75a06ff1 (diff)
downloadframeworks_base-0b1b2a3212cc6c96959e009a9705f94f2ed8b4f4.zip
frameworks_base-0b1b2a3212cc6c96959e009a9705f94f2ed8b4f4.tar.gz
frameworks_base-0b1b2a3212cc6c96959e009a9705f94f2ed8b4f4.tar.bz2
Merge "Bug 4159373 Use HDCP debug settings" into honeycomb-mr1
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/AwesomePlayer.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp
index 1f8de9f..bac1334 100644
--- a/media/libstagefright/AwesomePlayer.cpp
+++ b/media/libstagefright/AwesomePlayer.cpp
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+#define DEBUG_HDCP
+
//#define LOG_NDEBUG 0
#define LOG_TAG "AwesomePlayer"
#include <utils/Log.h>
@@ -50,6 +52,8 @@
#include <media/stagefright/foundation/ALooper.h>
#include <media/stagefright/foundation/AMessage.h>
+#include <cutils/properties.h>
+
#define USE_SURFACE_ALLOC 1
#define FRAME_DROP_FREQ 0
@@ -1192,9 +1196,42 @@ status_t AwesomePlayer::initVideoDecoder(uint32_t flags) {
// (USE_SURFACE_ALLOC && (mSurface != 0) &&
// (mSurface->getFlags() & ISurfaceComposer::eProtectedByApp))
// will be true, but that part is already handled by SurfaceFlinger.
+
+#ifdef DEBUG_HDCP
+ // For debugging, we allow a system property to control the protected usage.
+ // In case of uninitialized or unexpected property, we default to "DRM only".
+ bool setProtectionBit = false;
+ char value[PROPERTY_VALUE_MAX];
+ if (property_get("persist.sys.hdcp_checking", value, NULL)) {
+ if (!strcmp(value, "never")) {
+ // nop
+ } else if (!strcmp(value, "always")) {
+ setProtectionBit = true;
+ } else if (!strcmp(value, "drm-only")) {
+ if (mDecryptHandle != NULL) {
+ setProtectionBit = true;
+ }
+ // property value is empty, or unexpected value
+ } else {
+ if (mDecryptHandle != NULL) {
+ setProtectionBit = true;
+ }
+ }
+ // can' read property value
+ } else {
+ if (mDecryptHandle != NULL) {
+ setProtectionBit = true;
+ }
+ }
+ // note that usage bit is already cleared, so no need to clear it in the "else" case
+ if (setProtectionBit) {
+ flags |= OMXCodec::kEnableGrallocUsageProtected;
+ }
+#else
if (mDecryptHandle != NULL) {
flags |= OMXCodec::kEnableGrallocUsageProtected;
}
+#endif
LOGV("initVideoDecoder flags=0x%x", flags);
mVideoSource = OMXCodec::Create(
mClient.interface(), mVideoTrack->getFormat(),