Android MediaPlayer Architecture — Introduction (2)

This article is for the author's own study. The content of the article only comes from the author's poor thinking. Please don't hesitate to give advice on the problems.

Invalid Sign

Source files involved in this article:

  frameworks/av/include/media/mediaplayer.h

  frameworks/av/media/libmedia/mediaplayer.cpp

  frameworks/av/include/media/IMediaDeathNotifier.h

  frameworksav/media/libmedia/IMediaDeathNotifier.cpp

First of all, we should make it clear that getmediaplayerservice () is a public static member function of imediadeathnotifier class, and mediaplayer inherits from imediadeathnotifier, so it can be referenced directly.

Getmediaplayerservice() declaration in imediadeathnotifier class:

Mediaplayer inherits from imediadeathnotifier:

Focus on the definition of getmediaplayerservice () method:

The function implementation of the above code is a typical process of obtaining the binder service through the service manager.

By the way, the registration of mediaplayerservice is completed in MediaServer (frameworks / AV / media / MediaServer / main_mediaserver. CPP)

The instance function of mediaplayerservice:

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>