Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72554a21 authored by Chong Zhang's avatar Chong Zhang Committed by Android Git Automerger
Browse files

am 96b7af16: am b15486f9: Merge "set secure flag for secure file playback" into lmp-dev

* commit '96b7af16':
  set secure flag for secure file playback
parents 789595c0 96b7af16
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -14,6 +14,9 @@
 * limitations under the License.
 */

//#define LOG_NDEBUG 0
#define LOG_TAG "GenericSource"

#include "GenericSource.h"

#include "AnotherPacketSource.h"
@@ -65,7 +68,9 @@ NuPlayer::GenericSource::GenericSource(
      mFetchTimedTextDataGeneration(0),
      mDurationUs(0ll),
      mAudioIsVorbis(false),
      mIsWidevine(false) {
      mIsWidevine(false),
      mUIDValid(false),
      mUID(0) {
    DataSource::RegisterDefaultSniffers();

    sp<DataSource> dataSource = new FileSource(dup(fd), offset, length);
@@ -134,6 +139,12 @@ void NuPlayer::GenericSource::initFromDataSource(
            if (mVideoTrack.mSource == NULL) {
                mVideoTrack.mIndex = i;
                mVideoTrack.mSource = track;

                // check if the source requires secure buffers
                int32_t secure;
                if (meta->findInt32(kKeyRequiresSecureBuffers, &secure) && secure) {
                    mIsWidevine = true;
                }
            }
        }

+3 −1
Original line number Diff line number Diff line
@@ -227,7 +227,9 @@ void NuPlayer::setDataSourceAsync(
    } else if ((!strncasecmp(url, "widevine://", 11))) {
        source = new GenericSource(notify, httpService, url, headers,
                true /* isWidevine */, mUIDValid, mUID);
        mSourceFlags |= Source::FLAG_SECURE;
        // Don't set FLAG_SECURE on mSourceFlags here, the correct flags
        // will be updated in Source::kWhatFlagsChanged handler when
        // GenericSource is prepared.
    } else {
        source = new GenericSource(notify, httpService, url, headers);
    }