博客
关于我
ACodec从UninitializedState状态到LoadedState状态分析
阅读量:380 次
发布时间:2019-03-05

本文共 2603 字,大约阅读时间需要 8 分钟。

MediaCodec native???????create?config

MediaCodec??Android??????????native??????create?config?????????????????????????????????

????

?????mediacodec?create?config????native??????????????????????

??create?native?????

?mediacodec?????????????ACodec???ACodec???????????????????UninitializedState???????????

MediaCodec.cppstatus_t MediaCodec::init(const AString &name, bool nameIsType, bool encoder) {    // 1. ???ACodec    mCodec = new ACodec;        // 2. ?MediaCodec??????ALooper???ACodec??????    if (needDedicatedLooper) {        if (mCodecLooper == NULL) {            mCodecLooper = new ALooper;            mCodecLooper->setName("CodecLooper");            mCodecLooper->start(false, false, ANDROID_PRIORITY_AUDIO);        }        mCodecLooper->registerHandler(mCodec);    } else {        // 3. ?ACodec???MediaCodec???ALooper?        mLooper->registerHandler(mCodec);    }        // 4. ?MediaCodec???jni????ALooper?    mLooper->registerHandler(this);    mCodec->setNotificationMessage(new AMessage(kWhatCodecNotify, id()));        // 5. ????kWhatInit??    sp
msg = new AMessage(kWhatInit, id()); msg->setString("name", name); msg->setInt32("nameIsType", nameIsType); if (nameIsType) { msg->setInt32("encoder", encoder); } sp
response; return PostAndAwaitResponse(msg, &response);}
?????
  • ?????init?????????ACodec???ACodec??????????????AHierarchicalStateMachine????
  • ??????kWhatInit??????onMessageReceived?????
  • ?onMessageReceived??????????kWhatInit??????????UNINITIALIZED????????mReplyID??????INITIALIZING????ACodec?initiateAllocateComponent???

    ACodec?????

    ACodec?????AHierarchicalStateMachine????????UninitializedState?????changeState???????UninitializedState???kWhatAllocateComponent??????onAllocateComponent???

    onAllocateComponent????
  • ??mediaplayerservice????
  • ??OMXClient???OMX???
  • ?????????????
  • ??OMX::allocateNode?????
  • ???????????kWhatComponentAllocated????????LoadedState?
  • ??configur?native?????

    ?config???mediacodec???kWhatConfigure?????onMessageReceived?????

    onMessageReceived????

    ??????kWhatConfigure???initiateConfigureComponent???LoadedState?onMessageReceived?????kWhatConfigureComponent?????configureCodec???

    configureCodec????

    ??ACodec?configureCodec????????mime???componentName??????????

    ????

    mediacodec?create?config????native?????????????

  • ACodec?????????????init?????ACodec?????UninitializedState???
  • ?????????????????????kWhatInit?kWhatAllocateComponent????????
  • OMX????????OMXClient????????????????????
  • ???????AHierarchicalStateMachine??????????????????
  • ???????mediacodec?Android????????????????????????????????

    转载地址:http://gfwwz.baihongyu.com/

    你可能感兴趣的文章
    python及pycharm2018软件安装教程
    查看>>
    python去重txt文本_Python实现的txt文件去重功能示例
    查看>>
    python去掉列表的逗号,从Python列表项中删除标点符号
    查看>>
    Python卸载所有包
    查看>>
    python单线程下实现多个socket并发
    查看>>
    Python单元测试框架介绍(超详细~)
    查看>>
    Python单元测试框架
    查看>>
    python单元测试之unittest
    查看>>
    Python单元测试unittest实战
    查看>>
    Python单元测试-模拟VS补丁
    查看>>
    python协程实时输出_Python 协程以及事件循环的问题,怎么知道 IO 读取结束了呢?...
    查看>>
    Python十进制&;包提供错误的结果
    查看>>
    Python化身“安全老中医”:一键搞定工控系统漏洞,从零基础到精通,收藏这篇就够了!
    查看>>
    Python加速运行技巧
    查看>>
    python办公自动化基础遍历文件夹
    查看>>
    python办公自动化基础输出文件和文件夹
    查看>>
    python办公自动化基础搜索文件
    查看>>
    python知识:@classmethod和@staticmethod的异同
    查看>>
    python前端之css
    查看>>
    Python制作进度条,原来有这么多方法
    查看>>