(This is a merge of http://go/wvgerrit/14531) As an optimization, the Media Server now unloads our library when not in use. This has exposed a bug by which we were never deleting the CDM singleton. Fix is to make WvContentDecryptionModule an Android smart pointer ref base and then make sure all the plugins store a strong pointer to it. The singleton is a weak pointer, so when the last plugin is cleaned up, the CDM will be as well. And on the off chance that the library isn't immediately unloaded, the singleton code will generate a new CDM next time one is needed. Bug: 21153732 Change-Id: Ifaf02fa9afe0a70a8b53e8b92ee0a3d1359ca001
19 lines
320 B
C++
19 lines
320 B
C++
//
|
|
// Copyright 2013 Google Inc. All Rights Reserved.
|
|
//
|
|
|
|
#ifndef WV_CDM_SINGLETON_H_
|
|
#define WV_CDM_SINGLETON_H_
|
|
|
|
#include "utils/StrongPointer.h"
|
|
|
|
#include "wv_content_decryption_module.h"
|
|
|
|
namespace wvdrm {
|
|
|
|
android::sp<wvcdm::WvContentDecryptionModule> getCDM();
|
|
|
|
} // namespace wvdrm
|
|
|
|
#endif // WV_CDM_SINGLETON_H_
|