No-Typo-Check: From a third party header file Bug: 260918793 Test: unit tests Test: atp v2/widevine-eng/drm_compliance Change-Id: I36effd6a10a99bdb2399ab1f4a0fad026d607c70
57 lines
1.6 KiB
C++
57 lines
1.6 KiB
C++
//
|
|
// Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary
|
|
// source code may only be used and distributed under the Widevine License
|
|
// Agreement.
|
|
//
|
|
|
|
#ifndef WV_TYPES_H_
|
|
#define WV_TYPES_H_
|
|
|
|
#include <aidl/android/hardware/drm/Status.h>
|
|
|
|
#include "wv_cdm_types.h"
|
|
|
|
namespace wvdrm {
|
|
|
|
using AidlDrmStatus = ::aidl::android::hardware::drm::Status;
|
|
|
|
#define WVDRM_DISALLOW_COPY_AND_ASSIGN(TypeName) \
|
|
TypeName(const TypeName&) = delete; \
|
|
void operator=(const TypeName&) = delete;
|
|
|
|
#define WVDRM_DISALLOW_COPY_AND_ASSIGN_AND_NEW(TypeName) \
|
|
TypeName() = delete; \
|
|
TypeName(const TypeName&) = delete; \
|
|
void operator=(const TypeName&) = delete;
|
|
|
|
struct WvStatus {
|
|
public:
|
|
explicit WvStatus(AidlDrmStatus status) : mStatus(status) {}
|
|
WvStatus() : mStatus(AidlDrmStatus::OK) {}
|
|
WvStatus(AidlDrmStatus status, wvcdm::CdmResponseType cdmErr)
|
|
: mStatus(status), mCdmErr(cdmErr) {}
|
|
|
|
explicit operator AidlDrmStatus() const { return mStatus; }
|
|
explicit operator int32_t() const { return static_cast<int32_t>(mStatus); }
|
|
|
|
AidlDrmStatus get() const { return mStatus; }
|
|
|
|
bool operator==(const AidlDrmStatus other) const { return mStatus == other; }
|
|
bool operator!=(const AidlDrmStatus other) const { return mStatus != other; }
|
|
|
|
WvStatus &setCdmErr(wvcdm::CdmResponseType cdmErr) {
|
|
mCdmErr = cdmErr;
|
|
return *this;
|
|
}
|
|
wvcdm::CdmResponseType getCdmErr() const { return mCdmErr; }
|
|
|
|
private:
|
|
AidlDrmStatus mStatus{};
|
|
wvcdm::CdmResponseType mCdmErr{};
|
|
// WVDRM_DISALLOW_COPY_AND_ASSIGN_AND_NEW(WvStatus);
|
|
};
|
|
|
|
} // namespace wvdrm
|
|
|
|
#endif // WV_TYPES_H_
|