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

Commit 6681984c authored by Gloria Wang's avatar Gloria Wang
Browse files

- Update from Widevine

- Bug fixes

Change-Id: I494cfe145e7aad36f3d8c68841cab847487dd85b
parent 10d63fad
Loading
Loading
Loading
Loading
+48 −0
Original line number Original line Diff line number Diff line
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

ifeq ($(TARGET_ARCH),arm)

LOCAL_SRC_FILES:= \
    src/WVMDrmPlugin.cpp \
    src/WVMLogging.cpp

LOCAL_C_INCLUDES:= \
    bionic \
    bionic/libstdc++/include \
    external/stlport/stlport \
    vendor/widevine/proprietary/include \
    frameworks/base/drm/libdrmframework/plugins/widevine/include

LOCAL_MODULE := libdrmwvmplugin
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/drm

LOCAL_STATIC_LIBRARIES := \
    libdrmframeworkcommon

LOCAL_SHARED_LIBRARIES := \
    libutils              \
    libcutils             \
    libstlport            \
    libz                  \
    libwvdrm              \
    libWVStreamControlAPI

ifeq ($(TARGET_SIMULATOR),true)
 LOCAL_LDLIBS += -ldl
else
 LOCAL_SHARED_LIBRARIES += libdl
endif

LOCAL_PRELINK_MODULE := false

LOCAL_C_INCLUDES += \
    $(TOP)/frameworks/base/drm/libdrmframework/include \
    $(TOP)/frameworks/base/drm/libdrmframework/plugins/common/include \
    $(TOP)/frameworks/base/include

LOCAL_MODULE_TAGS := optional

include $(BUILD_SHARED_LIBRARY)

endif
+111 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2011 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __WVMDRMPLUGIN_H__
#define __WVMDRMPLUGIN_H__


#include <AndroidConfig.h>
#include <DrmEngineBase.h>

#include "WVDRMPluginAPI.h"


namespace android {

    class WVMDrmPlugin : public DrmEngineBase
    {

public:
    WVMDrmPlugin();
    virtual ~WVMDrmPlugin();

protected:
    DrmConstraints* onGetConstraints(int uniqueId, const String8* path, int action);

    DrmMetadata* onGetMetadata(int uniqueId, const String8* path);

    status_t onInitialize(int uniqueId);

    status_t onSetOnInfoListener(int uniqueId, const IDrmEngine::OnInfoListener* infoListener);

    status_t onTerminate(int uniqueId);

    bool onCanHandle(int uniqueId, const String8& path);

    DrmInfoStatus* onProcessDrmInfo(int uniqueId, const DrmInfo* drmInfo);

    status_t onSaveRights(int uniqueId, const DrmRights& drmRights,
            const String8& rightsPath, const String8& contentPath);

    DrmInfo* onAcquireDrmInfo(int uniqueId, const DrmInfoRequest* drmInfoRequest);

    String8 onGetOriginalMimeType(int uniqueId, const String8& path);

    int onGetDrmObjectType(int uniqueId, const String8& path, const String8& mimeType);

    int onCheckRightsStatus(int uniqueId, const String8& path, int action);

    status_t onConsumeRights(int uniqueId, DecryptHandle* decryptHandle, int action, bool reserve);

    status_t onSetPlaybackStatus(
            int uniqueId, DecryptHandle* decryptHandle, int playbackStatus, off64_t position);

    bool onValidateAction(
            int uniqueId, const String8& path, int action, const ActionDescription& description);

    status_t onRemoveRights(int uniqueId, const String8& path);

    status_t onRemoveAllRights(int uniqueId);

    status_t onOpenConvertSession(int uniqueId, int convertId);

    DrmConvertedStatus* onConvertData(int uniqueId, int convertId, const DrmBuffer* inputData);

    DrmConvertedStatus* onCloseConvertSession(int uniqueId, int convertId);

    DrmSupportInfo* onGetSupportInfo(int uniqueId);

    status_t onOpenDecryptSession(int uniqueId, DecryptHandle *decryptHandle,
                                        int fd, off64_t offset, off64_t length);

    status_t onOpenDecryptSession(int uniqueId, DecryptHandle *decryptHandle,
                                  const char *uri);

    status_t onCloseDecryptSession(int uniqueId, DecryptHandle* decryptHandle);

    status_t onInitializeDecryptUnit(int uniqueId, DecryptHandle* decryptHandle,
                                     int decryptUnitId, const DrmBuffer* headerInfo);

    status_t onDecrypt(int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId,
                       const DrmBuffer* encBuffer, DrmBuffer** decBuffer,
                       DrmBuffer *ivBuffer);


    status_t onFinalizeDecryptUnit(int uniqueId, DecryptHandle* decryptHandle, int decryptUnitId);

    ssize_t onPread(int uniqueId, DecryptHandle* decryptHandle,
            void* buffer, ssize_t numBytes, off64_t offset);

private:
    const IDrmEngine::OnInfoListener *mOnInfoListener;
    WVDRMPluginAPI *mDrmPluginImpl;
};

};

#endif /* __WVMDRMPLUGIN__ */
+22 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2011 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __WVMLOGGING_H__
#define __WVMLOGGING_H__

void android_printbuf(const char *buf);

#endif
+726 −0

File added.

Preview size limit exceeded, changes collapsed.

+25 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2011 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#define LOG_TAG "WVMLogging"
#include <utils/Log.h>
#include "WVMLogging.h"

// Connect Widevine debug logging into Android logging

void android_printbuf(const char *buf)
{
    LOGD("%s", buf);
}
Loading