189 8069 5689

codec编码传输流程是怎么样的-创新互联

codec编码传输流程是怎么样的,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。

创新互联坚持“要么做到,要么别承诺”的工作理念,服务领域包括:网站建设、网站设计、企业官网、英文网站、手机端网站、网站推广等服务,满足客户于互联网时代的上蔡网站设计、移动媒体设计的需求,帮助企业找到有效的互联网解决方案。努力成为您成熟可靠的网络建设合作伙伴!
  1.  SurfaceMediaSource::read()锁控制从IGraphicBufferConsumer处读取buffer,当graphic产生数据
    Overrun时等待

     while (mStarted && mNumPendingBuffers == mMaxAcquiredBufferCount) {

        mMediaBuffersAvailableCondition.wait(mMutex);

      }


  2. MediaPuller拿到该buffer后
    status_t err = mSource->read(&mbuf);



    notify->setInt32("what", kWhatAccessUnit);

    notify->setBuffer("accessUnit", accessUnit);

    notify->post();

  3. Converter 接收CHECK_EQ(what, MediaPuller::kWhatAccessUnit);

    mInputBufferQueue.push_back(accessUnit);

    feedEncoderInputBuffers();

  4. Converter::feedEncoderInputBuffers() 中拷贝buffer数据到codec的mEncoderInputBuffers
    通过这个while循环来等待拷贝

    while (!mInputBufferQueue.empty()&& !mAvailEncoderInputIndices.empty()){

    memcpy(mEncoderInputBuffers.itemAt(bufferIndex)->data(),

              buffer->data(),

              buffer->size());

  status_t err = mEncoder->queueInputBuffer(

        bufferIndex, 0, (buffer == NULL) ? 0 : buffer->size(),

        timeUs, flags);

5. 上面流程传递的是主要是共享内存buffer_handle_t,当codec 完成ACodec::BaseState::onOMXEmptyBufferDone后

 // We're in "store-metadata-in-buffers" mode, the underlying

  // OMX component had access to data that's implicitly refcounted

  // by this "MediaBuffer" object. Now that the OMX component has

  // told us that it's done with the input buffer, we can decrement

  // the mediaBuffer's reference count.

  info->mData->setMediaBufferBase(NULL);

  才通知SurfaceMediaSource::signalBufferReturned()让graphic consumer来真正释放

     mConsumer->releaseBuffer();

Stack 信息

 #06 pc 000f4583  /system/lib/libstagefright.so (android::SurfaceMediaSource::signalBufferReturned(android::MediaBuffer*)+38)

 #07 pc 000f45a5  /system/lib/libstagefright.so (non-virtual thunk to android::SurfaceMediaSource::signalBufferReturned(android::MediaBuffer*)+4)

 #08 pc 0000b011  /system/lib/libstagefright_foundation.so (android::ABuffer::setMediaBufferBase(android::MediaBufferBase*)+16)

 #09 pc 0008adeb  /system/lib/libstagefright.so (android::ACodec::BaseState::onOMXEmptyBufferDone(unsigned int, int)+78)

 #10 pc 0008aab5  /system/lib/libstagefright.so (android::ACodec::BaseState::onOMXMessage(android::sp const&)+228)

 #11 pc 0008a731  /system/lib/libstagefright.so (android::ACodec::BaseState::onMessageReceived(android::sp const&)+744)

 #12 pc 0008e779  /system/lib/libstagefright.so (android::ACodec::ExecutingState::onMessageReceived(android::sp const&)+508)

 #13 pc 0000b5a1  /system/lib/libstagefright_foundation.so (android::AHierarchicalStateMachine::handleMessage(android::sp const&)+64)

 #14 pc 0008a917  /system/lib/libstagefright.so (android::ACodec::BaseState::onOMXMessageList(android::sp const&)+106)

 #15 pc 0008a5e7  /system/lib/libstagefright.so (android::ACodec::BaseState::onMessageReceived(android::sp const&)+414)

 #16 pc 0008e779  /system/lib/libstagefright.so (android::ACodec::ExecutingState::onMessageReceived(android::sp const&)+508)

看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注创新互联行业资讯频道,感谢您对创新互联的支持。

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


文章名称:codec编码传输流程是怎么样的-创新互联
网站URL:http://cdxtjz.com/article/cspooc.html

其他资讯