#ifndef __ESPLUSPLAYER_DRM_H__
#define __ESPLUSPLAYER_DRM_H__
+#include <map>
+
namespace esplusplayer {
namespace drm {
kMax
};
+const std::map<std::string, std::string> KeySystemToDrmNameConverter = {
+ {"com.apple.fps", "EME_FairPlay"},
+ {"com.atsc3us.wv", "EME_Atsc3us-cdm"},
+ {"com.microsoft.playready", "EME_Playready"},
+ {"com.microsoft.playready.v3", "EME_Playready"},
+ {"com.tvkey.drm", "EME_NagSam"},
+ {"com.widevine.alpha", "EME_Widevine"},
+ {"kr.atsc3.uhdcp", "EME_Atsc3uhdcp"},
+ {"org.w3.clearkey", "EME_ClearKey"}
+};
+
// post from hlsdemux for getright
struct Property {
EsStateManager state_manager_;
SubmitDataType submit_data_type_ = SubmitDataType::kCleanData;
- std::string key_system_ = "";
+ std::string key_system_;
bool key_system_acquired_ = false;
drm::Property drm_property_;
std::uint32_t low_latency_mode_ = 0;
};
if (!key_system_acquired_) {
key_system_ = eme::IEME::getKeySystemName(drm_info.handle);
- LOG_ERROR("KeySystemName :: [%s] ", key_system_.c_str());
+ LOG_INFO("KeySystemName :: [%s] ", key_system_.c_str());
if (!state_manager_.GetPreparingState()) { //if the stream comes with clean data at the begining, re-post kpi when we get key system.
kpi::CodecLogger logger;
kpi::EsCodecLoggerKeys event_keys = MakeKpiKeys_();
LOG_ENTER;
std::string ptype = keys.is_clean ? "MSE" : "EME";
- std::string drm_type = keys.is_clean ? "NONE" : "EME";
+ std::string drm_type = keys.is_clean ? "NONE" : drm::KeySystemToDrmNameConverter.at(keys.key_system);
std::string v_decoder_type("HW");
std::string a_decoder_type("HW");
std::string container_type("EsPlusplayer");
str << ";a_codec=" << keys.a_codec;
str << ";a_tag=0x" << std::hex << audio_tag;
str << ";app_id=" << keys.app_id;
- if(!keys.is_clean) str << ";key_system=" << keys.key_system;
str << "}";
return SendKpi_(event_case, str);