博客
关于我
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/

    你可能感兴趣的文章
    Oracle RAC性能调整的方案
    查看>>
    oracle rac集群的东西之QQ聊天
    查看>>
    UML— 用例图
    查看>>
    Oracle Schema Objects——Tables——Table Compression
    查看>>
    oracle scott趣事
    查看>>
    oracle script
    查看>>
    Oracle select表要带双引号的原因
    查看>>
    Oracle SOA Suit Adapter
    查看>>
    Oracle Spatial GeoRaster 金字塔栅格存储
    查看>>
    Oracle spatial 周边查询SQL
    查看>>
    Oracle Spatial空间数据库建立
    查看>>
    UML— 活动图
    查看>>
    oracle sqlplus已停止工作,安装完成客户端后sqlplus报“段错误”
    查看>>
    oracle SQLserver 函数
    查看>>
    oracle sql分组(group,根据多个内容分组)在select之后from之前 再进行select查询,复杂子查询的使用
    查看>>
    UML— 时序图
    查看>>
    Oracle Statspack分析报告详解(一)
    查看>>
    oracle tirger_在Oracle中,临时表和全局临时表有什么区别?
    查看>>
    Oracle Validated Configurations 安装使用 说明
    查看>>
    oracle where 条件的执行顺序分析1
    查看>>