Loading OMA1 sample CPM plugin

10 views
Skip to first unread message

Andrew

unread,
Jul 21, 2009, 12:20:53 PM7/21/09
to android-platform
Hello,

I am trying to understand how and when a CPM plugin gets loaded. I
have created an image with PVLOGGING=1, wrote a simple app to create a
MediaPlayer instance on the emulator, and am viewing logs through
LogCat on Eclipse. LogCat shows that pvplayer.cfg is parsed and
several shared object files are loaded, but there are no entries for
any CPM plugins. From the code samples it seems that
PvmfOma1PassthruPluginPopulator should create
PVMFOma1PassthruPluginFactory.

Could somebody please explain how a CPM plugin is loaded? Is it after
a splitter node recognizes that a file is DRM-protected, or when the
media player starts up, or at some other time?

Thanks,
~Andrew

P.S. I had just posted this question on android-framework, but as
that group is being shut down and messages will not be moved over, I
have added it here. I apologize for any confusion.

Freepine

unread,
Jul 23, 2009, 9:12:58 AM7/23/09
to android-...@googlegroups.com
CPM plugins are loaded when PVPlayerEngine invokes SetSourceInitializationData on the source node via PVMFDataSourceInitializationExtensionInterface interface. However, you need add an entry in pvplayer.cfg file with PVMF_CPM_PLUGIN_REGISTRY_POPULATOR_UUID and your .so name, then it can be added into CPMPluginRegistry as a dynamic module at runtime.

You can have a look at external/opencore/modules/cpm_oma1_passthru/build/make/pvdrm_oma1passthru.cfg as an example:

Andrew

unread,
Jul 27, 2009, 12:26:12 PM7/27/09
to android-platform
Thank you for pointing me in the right direction, Freepine. I
especially appreciate the note about
PVMFDataSourceInitializationExtensionInterface::SetSourceInitializationData
(). I was following the CPM Developer's Guide, and although it
mentions SetSourceInitializationData(), I thought it referred to
PVMFCPMPluginInterface::SetSourceInitializationData(), because that is
used in the reference implementation in \pvmi\content_policy_manager
\plugins\oma1\passthru.

I guess I am confused why the reference implementation does not use
PVMFDataSourceInitializationExtensionInterface. Is there a better or
newer reference for dynamically loaded CPM plugins?

That also leads me to wonder if the docs in external\opencore\doc are
still relevant? For example, the PVPlayer SDK Developer's Guide
mentions that "CPM plug-ins are registered with a factory function and
a MIME string, using the PVMFCPMPluginFactoryRegistryClient class"...
Maybe the docs are for OpenCORE 1.x?

Again, thanks. I was able to get a basic CPM plug-in to be loaded in
LoadLibrary(). Now I just need to get it to Init() and actually do
something ;)

~Andrew


On Jul 23, 6:12 am, Freepine <freep...@gmail.com> wrote:
> CPM plugins are loaded when PVPlayerEngine invokes
> SetSourceInitializationData on the source node via
> PVMFDataSourceInitializationExtensionInterface interface. However, you need
> add an entry in pvplayer.cfg file with
> PVMF_CPM_PLUGIN_REGISTRY_POPULATOR_UUID and your .so name, then it can be
> added into CPMPluginRegistry as a dynamic module at runtime.
> You can have a look at external/opencore/
> modules/cpm_oma1_passthru/build/make/pvdrm_oma1passthru.cfg as an example:http://android.git.kernel.org/?p=platform/external/opencore.git;a=blo...
>
> On Wed, Jul 22, 2009 at 12:20 AM, Andrew <awoo...@gmail.com> wrote:
>
> > Hello,
>
> > I am trying to understand how and when a CPM plugin gets loaded.  I
> > have created an image with PVLOGGING=1, wrote a simple app to create a
> > MediaPlayer instance on the emulator, and am viewing logs through
> > LogCat on Eclipse.  LogCat shows that pvplayer.cfg is parsed and
> > several shared object files are loaded, but there are no entries for
> > any CPM plugins.  From the code samples it seems that
> > PvmfOma1PassthruPluginPopulator should create
> > PVMFOma1PassthruPluginFactory.
>
> > Could somebody please explain how a CPM plugin is loaded?  Is it after
> > a splitter node recognizes that a file is DRM-protected, or when the
> > media player starts up, or at some other time?
>
> > Thanks,
> > ~Andrew
>
> > P.S.  I had just posted this question on android-framework, but as
> > that group is being shut down and messages will not be moved over, I
> > have added it here.  I apologize for any confusion.
>
> Thank you for pointing me in the right direction, Freepine. I especially appreciate the note about PVMFDataSourceInitializationExtensionInterface::SetSourceInitializationData(). I was following the CPM Developer's Guide, and although it mentions SetSourceInitializationData(), I thought it referred to PVMFCPMPluginInterface::SetSourceInitializationData(), which is used in the reference implementation in \pvmi\content_policy_manager\plugins\oma1\passthru.

I guess I am confused why the reference implementation does not use
PVMFDataSourceInitializationExtensionInterface. Is there a better or
newer reference for dynamically loaded CPM plugins?

That also leads me to wonder if the docs in external\opencore\doc are
still relevant? For example, the PVPlayer SDK Developer's Guide
mentions that "CPM plug-ins are registered with a factory function and
a MIME string, using the PVMFCPMPluginFactoryRegistryClient class"...

~Andrew

Freepine

unread,
Jul 28, 2009, 8:50:28 AM7/28/09
to android-...@googlegroups.com
Hi Andrew,

Yes, the mechanism to dynamically load CPM plugins was introduced in OpenCORE 2.0, and I agree some sections of the cpm guide might need to be updated accordingly, but I am not aware of a newer reference:)
As to SetSourceInitializationData(), PVMFCPMPluginInterface also has the same API, but it's invoked when the source node trying to register the content with PVMFCPM. It is different from the parser node's SetSourceInitializationData() called by player engine. And it seems the sequence diagrams in the doc illustrating the interaction between file parser node and CPM are still informative:)  

-Freepine
Message has been deleted
Message has been deleted

Andrew

unread,
Jul 28, 2009, 10:12:31 PM7/28/09
to android-platform
Thanks for your help with *how* to build a CPM plugin, but do you know
of any documentation that explains *why* to build a CPM plugin? More
generically, what are the benefits to using CPM? I know it offers an
abstraction layer for a DRM agent, but does it provide any additional
security, such as access to secure memory or a protected channel for
decrypted data?

It seems like it opens a new point of attack. For example, to remove
encryption from a file in Android, wouldn't it be easy to just write a
file parser that connects to the CPM node and simply outputs the
decrypted data stream to a file?


On Jul 28, 5:50 am, Freepine <freep...@gmail.com> wrote:
> Hi Andrew,
>
> Yes, the mechanism to dynamically load CPM plugins was introduced in
> OpenCORE 2.0, and I agree some sections of the cpm guide might need to be
> updated accordingly, but I am not aware of a newer reference:)As
> to SetSourceInitializationData(), PVMFCPMPluginInterface also has the same
> API, but it's invoked when the source node trying to register the content
> with PVMFCPM. It is different from the parser
> node's SetSourceInitializationData() called by player engine. And it seems
> the sequence diagrams in the doc illustrating the interaction between file
> parser node and CPM are still informative:)
>
> -Freepine
>

RaviY

unread,
Jul 28, 2009, 10:36:18 PM7/28/09
to android-platform
We will update the docs. Thanks for pointing it out.

-Ravi

On Jul 28, 7:50 am, Freepine <freep...@gmail.com> wrote:
> Hi Andrew,
>
> Yes, the mechanism to dynamically load CPM plugins was introduced in
> OpenCORE 2.0, and I agree some sections of the cpm guide might need to be
> updated accordingly, but I am not aware of a newer reference:)As
> to SetSourceInitializationData(), PVMFCPMPluginInterface also has the same
> API, but it's invoked when the source node trying to register the content
> with PVMFCPM. It is different from the parser
> node's SetSourceInitializationData() called by player engine. And it seems
> the sequence diagrams in the doc illustrating the interaction between file
> parser node and CPM are still informative:)
>
> -Freepine
>

Andrew

unread,
Jul 31, 2009, 2:07:21 PM7/31/09
to android-platform
Is my security concern valid? One wouldn't need access to the CPM
source code. One would just write a rogue file parser.

RaviY

unread,
Jul 31, 2009, 4:19:16 PM7/31/09
to android-platform
Technically speaking, yes. But, there are many other ways to do what
you are saying. Another example is: Place a dummy decoder that could
also potentially it's received input data to a file.

However, all this is possible only if the "rogue" component is
accepted into the mediaserver process. And, for this, you would have
to mess with the system image.

-Ravi
Reply all
Reply to author
Forward
0 new messages