diff options
Diffstat (limited to 'xbmc/media/drm/CryptoSession.cpp')
-rw-r--r-- | xbmc/media/drm/CryptoSession.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/xbmc/media/drm/CryptoSession.cpp b/xbmc/media/drm/CryptoSession.cpp new file mode 100644 index 0000000..9e5e888 --- /dev/null +++ b/xbmc/media/drm/CryptoSession.cpp @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#include "CryptoSession.h" + +using namespace DRM; + +std::vector<GET_CRYPTO_SESSION_INTERFACE_FN> CCryptoSession::s_registeredInterfaces; + +void CCryptoSession::RegisterInterface(GET_CRYPTO_SESSION_INTERFACE_FN fn) +{ + s_registeredInterfaces.push_back(fn); +} + +CCryptoSession* CCryptoSession::GetCryptoSession(const std::string& UUID, const std::string& cipherAlgo, const std::string& macAlgo) +{ + CCryptoSession* retVal = nullptr; + for (auto fn : s_registeredInterfaces) + if ((retVal = fn(UUID, cipherAlgo, macAlgo))) + break; + return retVal; +} |