diff options
author | Gloria Wang <gwang@google.com> | 2010-11-01 15:53:16 -0700 |
---|---|---|
committer | Gloria Wang <gwang@google.com> | 2010-11-05 10:33:58 -0700 |
commit | c2c22e7e20a3b10c180c2fed2bf24aedef8ed269 (patch) | |
tree | ac1ed8b7a2841e75fe6b012016bcf1ac93919ffb /media/libstagefright/NuHTTPDataSource.cpp | |
parent | a25c0305bca20c09e71f65036b81601f360507af (diff) | |
download | frameworks_base-c2c22e7e20a3b10c180c2fed2bf24aedef8ed269.zip frameworks_base-c2c22e7e20a3b10c180c2fed2bf24aedef8ed269.tar.gz frameworks_base-c2c22e7e20a3b10c180c2fed2bf24aedef8ed269.tar.bz2 |
Add support for WV DRM
Change-Id: I0408c5e0a488f112a84337b21b0cd4613a4da461
Diffstat (limited to 'media/libstagefright/NuHTTPDataSource.cpp')
-rw-r--r-- | media/libstagefright/NuHTTPDataSource.cpp | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/media/libstagefright/NuHTTPDataSource.cpp b/media/libstagefright/NuHTTPDataSource.cpp index 2743b2f..7aac447 100644 --- a/media/libstagefright/NuHTTPDataSource.cpp +++ b/media/libstagefright/NuHTTPDataSource.cpp @@ -67,7 +67,9 @@ NuHTTPDataSource::NuHTTPDataSource() mPort(0), mOffset(0), mContentLength(0), - mContentLengthValid(false) { + mContentLengthValid(false), + mDecryptHandle(NULL), + mDrmManagerClient(NULL) { } NuHTTPDataSource::~NuHTTPDataSource() { @@ -89,6 +91,9 @@ status_t NuHTTPDataSource::connect( off_t offset) { String8 host, path; unsigned port; + + mUri = uri; + if (!ParseURL(uri, &host, &port, &path)) { return ERROR_MALFORMED; } @@ -340,4 +345,30 @@ void NuHTTPDataSource::applyTimeoutResponse() { } } +DecryptHandle* NuHTTPDataSource::DrmInitialization(DrmManagerClient* client) { + if (client == NULL) { + return NULL; + } + mDrmManagerClient = client; + + if (mDecryptHandle == NULL) { + /* Note if redirect occurs, mUri is the redirect uri instead of the + * original one + */ + mDecryptHandle = mDrmManagerClient->openDecryptSession(mUri); + } + + if (mDecryptHandle == NULL) { + mDrmManagerClient = NULL; + } + + return mDecryptHandle; +} + +void NuHTTPDataSource::getDrmInfo(DecryptHandle **handle, DrmManagerClient **client) { + *handle = mDecryptHandle; + + *client = mDrmManagerClient; +} + } // namespace android |