Android MediaPlayerService解析

本文主要探讨了Android系统的MediaPlayerService,详细介绍了其内部类Client和AudioOutput,以及IMediaPlayerService接口。MediaPlayerService作为native服务,通过ServiceManager注册。文章还提到了如何创建和注册播放器工厂以及MediaRecorder的使用,特别强调了Client在播放过程中的作用。
摘要由CSDN通过智能技术生成

frameworks/av/media/libmediaplayerservice/MediaPlayerService.h

MediaPlayerService 类的继承关系如下:
这里写图片描述

Client 和 AudioOutput 是 MediaPlayerService的内部类
IMediaPlayerService是对为提供的接口类, 定义如下:

frameworks/av/include/media/IMediaPlayerService.h
43class IMediaPlayerService: public IInterface
44{
45public:
46    DECLARE_META_INTERFACE(MediaPlayerService);
47
48    virtual sp<IMediaRecorder> createMediaRecorder(const String16 &opPackageName) = 0;
49    virtual sp<IMediaMetadataRetriever> createMetadataRetriever() = 0;
50    virtual sp<IMediaPlayer> create(const sp<IMediaPlayerClient>& client,
51            audio_session_t audioSessionId = AUDIO_SESSION_ALLOCATE) = 0;
52    virtual sp<IOMX>            getOMX() = 0;
53    virtual sp<IHDCP>           makeHDCP(bool createEncryptionModule) = 0;
54    virtual sp<IMediaCodecList> getCodecList() const = 0;
55
56    // Connects to a remote display.
57    // 'iface' specifies the address of the local interface on which to listen for
58    // a connection from the remote display as an ip address and port number
59    // of the form "x.x.x.x:y".  The media server should call back into the provided remote
60    // display client when display connection, disconnection or errors occur.
61    // The assumption is that at most one remote display will be connected to the
62    // provided interface at a time.
63    virtual sp<IRemoteDisplay> listenForRemoteDisplay(
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值