{"id":70186,"date":"2026-02-01T15:36:59","date_gmt":"2026-02-01T07:36:59","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/70186.html"},"modified":"2026-02-01T15:36:59","modified_gmt":"2026-02-01T07:36:59","slug":"%e5%9b%be%e5%83%8f%e6%98%be%e7%a4%ba%e6%a1%86%e6%9e%b6%e5%8d%81%e4%ba%8c-bufferqueue%e7%9a%84%e5%b7%a5%e4%bd%9c%e6%b5%81%e7%a8%8b%ef%bc%88%e5%9f%ba%e4%ba%8eandroid-15%e6%ba%90","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/70186.html","title":{"rendered":"\u56fe\u50cf\u663e\u793a\u6846\u67b6\u5341\u4e8c\u2014\u2014BufferQueue\u7684\u5de5\u4f5c\u6d41\u7a0b\uff08\u57fa\u4e8eAndroid 15\u6e90\u7801\u5206\u6790\uff09"},"content":{"rendered":"<\/p>\n<h2>\u4e00.\u524d\u8a00<\/h2>\n<p>\u4e0a\u4e00\u7bc7\u4e2d&#xff0c;\u57fa\u672c\u8bf4\u6e05\u695a\u4e86\u751f\u4ea7\u7aef\u7684\u5904\u7406\u903b\u8f91&#xff0c;\u8fd9\u4e00\u7bc7&#xff0c;\u6211\u4eec\u6765\u68b3\u7406\u4e0b\u6d88\u8d39\u7aef\u7684\u903b\u8f91<\/p>\n<p>Consumer\u662f\u4ec0\u4e48\u65f6\u5019\u6765\u6d88\u8d39\u6570\u636e\u7684&#xff1f;\u4ed6\u662f\u81ea\u5df1\u6765\u62ff\u7684\u8fd8\u662f\u522b\u4eba\u901a\u77e5\u4ed6\u7684&#xff1f;<\/p>\n<p>\u8fd9\u7bc7\u6587\u7ae0\u5c31\u5e26\u7740\u8fd9\u4e9b\u7591\u95ee\u6765\u5206\u6790\u6e90\u7801&#xff0c;\u518d\u628a\u6982\u8981\u6d41\u7a0b\u56fe\u8d34\u4e00\u4e0b<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"2538\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201073647-697f028fdc421.png\" width=\"1682\" \/><\/p>\n<\/p>\n<h2>\u4e8c.\u76d1\u542c\u5668\u7684\u56de\u8c03\u8fc7\u7a0b\u89e3\u6790<\/h2>\n<p>\u6e90\u7801\u4f4d\u7f6e&#xff1a;<\/p>\n<p>framework\/native\/libs\/gui\/BufferQueueConsumer.cpp<\/p>\n<p>framework\/native\/libs\/gui\/include\/gui\/BufferQueueConsumer.h<\/p>\n<p>framework\/native\/libs\/gui\/ConsumerBase.cpp<\/p>\n<p>\u4e0a\u4e00\u7bc7\u8bf4\u5230\u751f\u4ea7\u8005\u5c06\u6570\u636e\u5199\u5b8c&#xff0c;\u628abuffer\u8fd8\u7ed9buffer queue\u540e&#xff0c;\u53c8\u662f\u600e\u4e48\u6765\u901a\u77e5\u6d88\u8d39\u8005\u7684\u5462&#xff1f;<\/p>\n<p>\u9996\u5148\u7ee7\u7eed\u8d34\u4e00\u4e0b\u4e0a\u4e00\u7bc7\u4e2d\u6700\u540e\u7684\u751f\u4ea7\u8005\u5c06buffer\u8fd8\u7ed9BufferQueue\u7684\u51fd\u6570BufferQueueProducer::queueBuffer<\/p>\n<p>\/\/ \u751f\u4ea7\u8005\u5c06\u5df2\u586b\u5145\u6570\u636e\u7684\u7f13\u51b2\u533a\u5165\u961f\u7684\u6838\u5fc3\u51fd\u6570<br \/>\n\/\/ \u8fd9\u662fBufferQueueProducer\u4e2d\u5904\u7406\u751f\u4ea7\u8005\u63d0\u4ea4\u5df2\u5b8c\u6210\u6e32\u67d3\u7684\u7f13\u51b2\u533a\u7684\u5173\u952e\u51fd\u6570<br \/>\nstatus_t BufferQueueProducer::queueBuffer(int slot,                  \/\/ \u7f13\u51b2\u533a\u69fd\u4f4d\u7d22\u5f15<br \/>\n        const QueueBufferInput &amp;input,      \/\/ \u5165\u961f\u8f93\u5165\u53c2\u6570&#xff08;\u5305\u542b\u65f6\u95f4\u6233\u3001\u88c1\u526a\u3001\u53d8\u6362\u7b49\u4fe1\u606f&#xff09;<br \/>\n        QueueBufferOutput *output) {        \/\/ \u5165\u961f\u8f93\u51fa\u53c2\u6570&#xff08;\u5305\u542b\u5e27\u53f7\u3001\u5c3a\u5bf8\u7b49\u4fe1\u606f&#xff09;<br \/>\n    ATRACE_CALL();                          \/\/ \u5f00\u59cb\u6027\u80fd\u8ffd\u8e2a<br \/>\n    ATRACE_BUFFER_INDEX(slot);              \/\/ \u8ffd\u8e2a\u7279\u5b9a\u7f13\u51b2\u533a\u7684\u64cd\u4f5c<\/p>\n<p>    \/\/ 1. \u4ece\u8f93\u5165\u53c2\u6570\u4e2d\u89e3\u6790\u5404\u79cd\u4fe1\u606f<br \/>\n    int64_t requestedPresentTimestamp;      \/\/ \u8bf7\u6c42\u663e\u793a\u65f6\u95f4\u6233<br \/>\n    bool isAutoTimestamp;                   \/\/ \u662f\u5426\u81ea\u52a8\u751f\u6210\u65f6\u95f4\u6233<br \/>\n    android_dataspace dataSpace;            \/\/ \u6570\u636e\u7a7a\u95f4&#xff08;\u989c\u8272\u7a7a\u95f4&#xff09;<br \/>\n    Rect crop(Rect::EMPTY_RECT);            \/\/ \u88c1\u526a\u533a\u57df<br \/>\n    int scalingMode;                        \/\/ \u7f29\u653e\u6a21\u5f0f<br \/>\n    uint32_t transform;                     \/\/ \u53d8\u6362&#xff08;\u65cb\u8f6c\u3001\u955c\u50cf\u7b49&#xff09;<br \/>\n    uint32_t stickyTransform;               \/\/ \u7c98\u6027\u53d8\u6362&#xff08;\u6301\u4e45\u5316\u7684\u53d8\u6362&#xff09;<br \/>\n    sp&lt;Fence&gt; acquireFence;                 \/\/ \u83b7\u53d6\u6805\u680f&#xff08;\u751f\u4ea7\u8005\u5b8c\u6210\u6e32\u67d3\u7684\u540c\u6b65\u5bf9\u8c61&#xff09;<br \/>\n    bool getFrameTimestamps &#061; false;        \/\/ \u662f\u5426\u83b7\u53d6\u5e27\u65f6\u95f4\u6233<\/p>\n<p>    \/\/ \u5c06input\u4e2d\u7684\u5404\u79cd\u53c2\u6570\u89e3\u538b\u5230\u5c40\u90e8\u53d8\u91cf<br \/>\n    input.deflate(&amp;requestedPresentTimestamp, &amp;isAutoTimestamp, &amp;dataSpace,<br \/>\n            &amp;crop, &amp;scalingMode, &amp;transform, &amp;acquireFence, &amp;stickyTransform,<br \/>\n            &amp;getFrameTimestamps);<\/p>\n<p>    \/\/ \u83b7\u53d6\u8868\u9762\u635f\u574f\u533a\u57df\u548cHDR\u5143\u6570\u636e<br \/>\n    const Region&amp; surfaceDamage &#061; input.getSurfaceDamage();<br \/>\n    const HdrMetadata&amp; hdrMetadata &#061; input.getHdrMetadata();<\/p>\n<p>    \/\/ 2. \u9a8c\u8bc1acquireFence\u662f\u5426\u6709\u6548&#xff08;\u751f\u4ea7\u8005\u5fc5\u987b\u63d0\u4f9b\u6709\u6548\u7684\u6805\u680f&#xff09;<br \/>\n    if (acquireFence &#061;&#061; nullptr) {<br \/>\n        BQ_LOGE(&#034;queueBuffer: fence is NULL&#034;);<br \/>\n        return BAD_VALUE;  \/\/ \u8fd4\u56de\u53c2\u6570\u9519\u8bef<br \/>\n    }<\/p>\n<p>    \/\/ 3. \u521b\u5efaFenceTime\u5bf9\u8c61\u7528\u4e8e\u8ffd\u8e2a\u6805\u680f\u65f6\u95f4<br \/>\n    auto acquireFenceTime &#061; std::make_shared&lt;FenceTime&gt;(acquireFence);<\/p>\n<p>    \/\/ 4. \u9a8c\u8bc1\u7f29\u653e\u6a21\u5f0f\u662f\u5426\u6709\u6548<br \/>\n    switch (scalingMode) {<br \/>\n        case NATIVE_WINDOW_SCALING_MODE_FREEZE:<br \/>\n        case NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW:<br \/>\n        case NATIVE_WINDOW_SCALING_MODE_SCALE_CROP:<br \/>\n        case NATIVE_WINDOW_SCALING_MODE_NO_SCALE_CROP:<br \/>\n            break;  \/\/ \u6709\u6548\u7684\u7f29\u653e\u6a21\u5f0f<br \/>\n        default:<br \/>\n            BQ_LOGE(&#034;queueBuffer: unknown scaling mode %d&#034;, scalingMode);<br \/>\n            return BAD_VALUE;  \/\/ \u65e0\u6548\u7684\u7f29\u653e\u6a21\u5f0f<br \/>\n    }<\/p>\n<p>    \/\/ 5. \u5404\u79cd\u76d1\u542c\u5668\u548c\u72b6\u6001\u53d8\u91cf\u7684\u58f0\u660e<br \/>\n    sp&lt;IConsumerListener&gt; frameAvailableListener;   \/\/ \u5e27\u53ef\u7528\u76d1\u542c\u5668<br \/>\n    sp&lt;IConsumerListener&gt; frameReplacedListener;    \/\/ \u5e27\u66ff\u6362\u76d1\u542c\u5668<br \/>\n    int callbackTicket &#061; 0;                         \/\/ \u56de\u8c03\u7968\u53f7&#xff08;\u7528\u4e8e\u4fdd\u8bc1\u56de\u8c03\u987a\u5e8f&#xff09;<br \/>\n    uint64_t currentFrameNumber &#061; 0;                \/\/ \u5f53\u524d\u5e27\u53f7<br \/>\n    BufferItem item;                                \/\/ \u7f13\u51b2\u533a\u9879&#xff08;\u5c06\u6dfb\u52a0\u5230\u961f\u5217&#xff09;<br \/>\n    int connectedApi;                               \/\/ \u8fde\u63a5\u7684API\u7c7b\u578b<br \/>\n    sp&lt;Fence&gt; lastQueuedFence;                      \/\/ \u4e0a\u4e00\u6b21\u5165\u961f\u7684\u6805\u680f<\/p>\n<p>    \/\/ 6. \u6838\u5fc3\u52a0\u9501\u8303\u56f4&#xff08;\u4fdd\u62a4BufferQueue\u6838\u5fc3\u72b6\u6001&#xff09;<br \/>\n    {<br \/>\n        std::lock_guard&lt;std::mutex&gt; lock(mCore-&gt;mMutex);<\/p>\n<p>        \/\/ 6.1 \u68c0\u67e5BufferQueue\u662f\u5426\u88ab\u5e9f\u5f03<br \/>\n        if (mCore-&gt;mIsAbandoned) {<br \/>\n            BQ_LOGE(&#034;queueBuffer: BufferQueue has been abandoned&#034;);<br \/>\n            return NO_INIT;<br \/>\n        }<\/p>\n<p>        \/\/ 6.2 \u68c0\u67e5\u751f\u4ea7\u8005\u662f\u5426\u5df2\u8fde\u63a5<br \/>\n        if (mCore-&gt;mConnectedApi &#061;&#061; BufferQueueCore::NO_CONNECTED_API) {<br \/>\n            BQ_LOGE(&#034;queueBuffer: BufferQueue has no connected producer&#034;);<br \/>\n            return NO_INIT;<br \/>\n        }<\/p>\n<p>        \/\/ 6.3 \u9a8c\u8bc1\u69fd\u4f4d\u7d22\u5f15\u6709\u6548\u6027<br \/>\n        if (slot &lt; 0 || slot &gt;&#061; BufferQueueDefs::NUM_BUFFER_SLOTS) {<br \/>\n            BQ_LOGE(&#034;queueBuffer: slot index %d out of range [0, %d)&#034;,<br \/>\n                    slot, BufferQueueDefs::NUM_BUFFER_SLOTS);<br \/>\n            return BAD_VALUE;<br \/>\n        }<br \/>\n        \/\/ 6.4 \u9a8c\u8bc1\u7f13\u51b2\u533a\u72b6\u6001\u5fc5\u987b\u662fDEQUEUED&#xff08;\u5426\u5219\u751f\u4ea7\u8005\u65e0\u6743\u5165\u961f&#xff09;<br \/>\n        else if (!mSlots[slot].mBufferState.isDequeued()) {<br \/>\n            BQ_LOGE(&#034;queueBuffer: slot %d is not owned by the producer &#034;<br \/>\n                    &#034;(state &#061; %s)&#034;, slot, mSlots[slot].mBufferState.string());<br \/>\n            return BAD_VALUE;<br \/>\n        }<br \/>\n        \/\/ 6.5 \u9a8c\u8bc1\u7f13\u51b2\u533a\u662f\u5426\u5df2\u901a\u8fc7requestBuffer\u5206\u914d<br \/>\n        else if (!mSlots[slot].mRequestBufferCalled) {<br \/>\n            BQ_LOGE(&#034;queueBuffer: slot %d was queued without requesting &#034;<br \/>\n                    &#034;a buffer&#034;, slot);<br \/>\n            return BAD_VALUE;<br \/>\n        }<\/p>\n<p>        \/\/ 6.6 \u5171\u4eab\u7f13\u51b2\u533a\u6a21\u5f0f\u7279\u6b8a\u5904\u7406<br \/>\n        \/\/ \u5982\u679c\u521a\u542f\u7528\u5171\u4eab\u7f13\u51b2\u533a\u6a21\u5f0f&#xff0c;\u6807\u8bb0\u7b2c\u4e00\u4e2a\u5165\u961f\u7684\u7f13\u51b2\u533a\u4e3a\u5171\u4eab\u7f13\u51b2\u533a<br \/>\n        if (mCore-&gt;mSharedBufferMode &amp;&amp; mCore-&gt;mSharedBufferSlot &#061;&#061;<br \/>\n                BufferQueueCore::INVALID_BUFFER_SLOT) {<br \/>\n            mCore-&gt;mSharedBufferSlot &#061; slot;<br \/>\n            mSlots[slot].mBufferState.mShared &#061; true;<br \/>\n        }<\/p>\n<p>        \/\/ 6.7 \u8bb0\u5f55\u8be6\u7ec6\u7684\u5165\u961f\u65e5\u5fd7<br \/>\n        BQ_LOGV(&#034;queueBuffer: slot&#061;%d\/%&#034; PRIu64 &#034; time&#061;%&#034; PRIu64 &#034; dataSpace&#061;%d&#034;<br \/>\n                &#034; validHdrMetadataTypes&#061;0x%x crop&#061;[%d,%d,%d,%d] transform&#061;%#x scale&#061;%s&#034;,<br \/>\n                slot, mCore-&gt;mFrameCounter &#043; 1, requestedPresentTimestamp, dataSpace,<br \/>\n                hdrMetadata.validTypes, crop.left, crop.top, crop.right, crop.bottom,<br \/>\n                transform,<br \/>\n                BufferItem::scalingModeName(static_cast&lt;uint32_t&gt;(scalingMode)));<\/p>\n<p>        \/\/ 6.8 \u83b7\u53d6\u56fe\u5f62\u7f13\u51b2\u533a\u5e76\u9a8c\u8bc1\u88c1\u526a\u533a\u57df<br \/>\n        const sp&lt;GraphicBuffer&gt;&amp; graphicBuffer(mSlots[slot].mGraphicBuffer);<br \/>\n        Rect bufferRect(graphicBuffer-&gt;getWidth(), graphicBuffer-&gt;getHeight());<br \/>\n        Rect croppedRect(Rect::EMPTY_RECT);<br \/>\n        crop.intersect(bufferRect, &amp;croppedRect);<br \/>\n        if (croppedRect !&#061; crop) {<br \/>\n            BQ_LOGE(&#034;queueBuffer: crop rect is not contained within the &#034;<br \/>\n                    &#034;buffer in slot %d&#034;, slot);<br \/>\n            return BAD_VALUE;<br \/>\n        }<\/p>\n<p>        \/\/ 6.9 \u5982\u679c\u6570\u636e\u7a7a\u95f4\u4e3a\u672a\u77e5&#xff0c;\u4f7f\u7528\u6d88\u8d39\u8005\u9ed8\u8ba4\u503c<br \/>\n        if (dataSpace &#061;&#061; HAL_DATASPACE_UNKNOWN) {<br \/>\n            dataSpace &#061; mCore-&gt;mDefaultBufferDataSpace;<br \/>\n        }<\/p>\n<p>        \/\/ 6.10 \u66f4\u65b0\u7f13\u51b2\u533a\u72b6\u6001&#xff1a;\u4fdd\u5b58\u6805\u680f&#xff0c;\u6539\u53d8\u72b6\u6001\u4e3aQUEUED<br \/>\n        mSlots[slot].mFence &#061; acquireFence;<br \/>\n        mSlots[slot].mBufferState.queue();  \/\/ \u72b6\u6001&#xff1a;DEQUEUED \u2192 QUEUED<\/p>\n<p>        \/\/ 6.11 \u9012\u589e\u5e27\u8ba1\u6570\u5668\u5e76\u4fdd\u5b58\u5f53\u524d\u5e27\u53f7<br \/>\n        &#043;&#043;mCore-&gt;mFrameCounter;<br \/>\n        currentFrameNumber &#061; mCore-&gt;mFrameCounter;<br \/>\n        mSlots[slot].mFrameNumber &#061; currentFrameNumber;<\/p>\n<p>        \/\/ 6.12 \u51c6\u5907BufferItem&#xff08;\u5c06\u6dfb\u52a0\u5230\u961f\u5217\u7684\u6570\u636e\u7ed3\u6784&#xff09;<br \/>\n        item.mAcquireCalled &#061; mSlots[slot].mAcquireCalled;<br \/>\n        item.mGraphicBuffer &#061; mSlots[slot].mGraphicBuffer;<br \/>\n        item.mCrop &#061; crop;<br \/>\n        item.mTransform &#061; transform &amp;<br \/>\n                ~static_cast&lt;uint32_t&gt;(NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY);<br \/>\n        item.mTransformToDisplayInverse &#061;<br \/>\n                (transform &amp; NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY) !&#061; 0;<br \/>\n        item.mScalingMode &#061; static_cast&lt;uint32_t&gt;(scalingMode);<br \/>\n        item.mTimestamp &#061; requestedPresentTimestamp;<br \/>\n        item.mIsAutoTimestamp &#061; isAutoTimestamp;<br \/>\n        item.mDataSpace &#061; dataSpace;<br \/>\n        item.mHdrMetadata &#061; hdrMetadata;<br \/>\n        item.mFrameNumber &#061; currentFrameNumber;<br \/>\n        item.mSlot &#061; slot;<br \/>\n        item.mFence &#061; acquireFence;<br \/>\n        item.mFenceTime &#061; acquireFenceTime;<\/p>\n<p>        \/\/ 6.13 \u5224\u65ad\u7f13\u51b2\u533a\u662f\u5426\u53ef\u4e22\u5f03&#xff08;\u591a\u79cd\u6761\u4ef6&#xff09;<br \/>\n        item.mIsDroppable &#061; mCore-&gt;mAsyncMode ||                \/\/ \u5f02\u6b65\u6a21\u5f0f<br \/>\n                (mConsumerIsSurfaceFlinger &amp;&amp; mCore-&gt;mQueueBufferCanDrop) ||  \/\/ SurfaceFlinger\u6d88\u8d39\u8005\u4e14\u5141\u8bb8\u4e22\u5f03<br \/>\n                (mCore-&gt;mLegacyBufferDrop &amp;&amp; mCore-&gt;mQueueBufferCanDrop) ||   \/\/ \u4f20\u7edf\u7f13\u51b2\u533a\u4e22\u5f03<br \/>\n                (mCore-&gt;mSharedBufferMode &amp;&amp; mCore-&gt;mSharedBufferSlot &#061;&#061; slot); \/\/ \u5171\u4eab\u7f13\u51b2\u533a\u6a21\u5f0f<\/p>\n<p>        item.mSurfaceDamage &#061; surfaceDamage;<br \/>\n        item.mQueuedBuffer &#061; true;<br \/>\n        item.mAutoRefresh &#061; mCore-&gt;mSharedBufferMode &amp;&amp; mCore-&gt;mAutoRefresh;  \/\/ \u81ea\u52a8\u5237\u65b0&#xff08;\u5171\u4eab\u7f13\u51b2\u533a&#xff09;<br \/>\n        item.mApi &#061; mCore-&gt;mConnectedApi;<\/p>\n<p>        \/\/ 6.14 \u4fdd\u5b58\u7c98\u6027\u53d8\u6362<br \/>\n        mStickyTransform &#061; stickyTransform;<\/p>\n<p>        \/\/ 6.15 \u5982\u679c\u662f\u5171\u4eab\u7f13\u51b2\u533a\u6a21\u5f0f&#xff0c;\u7f13\u5b58\u5171\u4eab\u7f13\u51b2\u533a\u6570\u636e\u4ee5\u4fbf\u91cd\u5efaBufferItem<br \/>\n        if (mCore-&gt;mSharedBufferMode) {<br \/>\n            mCore-&gt;mSharedBufferCache.crop &#061; crop;<br \/>\n            mCore-&gt;mSharedBufferCache.transform &#061; transform;<br \/>\n            mCore-&gt;mSharedBufferCache.scalingMode &#061; static_cast&lt;uint32_t&gt;(scalingMode);<br \/>\n            mCore-&gt;mSharedBufferCache.dataspace &#061; dataSpace;<br \/>\n        }<\/p>\n<p>        \/\/ 6.16 \u521d\u59cb\u5316\u8f93\u51fa\u53c2\u6570<br \/>\n        output-&gt;bufferReplaced &#061; false;<\/p>\n<p>        \/\/ 6.17 \u961f\u5217\u5904\u7406\u903b\u8f91<br \/>\n        if (mCore-&gt;mQueue.empty()) {<br \/>\n            \/\/ \u961f\u5217\u4e3a\u7a7a&#xff1a;\u76f4\u63a5\u6dfb\u52a0\u7f13\u51b2\u533a\u9879<br \/>\n            mCore-&gt;mQueue.push_back(item);<br \/>\n            frameAvailableListener &#061; mCore-&gt;mConsumerListener;  \/\/ \u901a\u77e5\u6d88\u8d39\u8005\u6709\u65b0\u5e27\u53ef\u7528<br \/>\n        } else {<br \/>\n            \/\/ \u961f\u5217\u4e0d\u4e3a\u7a7a&#xff1a;\u68c0\u67e5\u662f\u5426\u9700\u8981\u66ff\u6362\u6700\u540e\u4e00\u5e27<br \/>\n            const BufferItem&amp; last &#061; mCore-&gt;mQueue.itemAt(mCore-&gt;mQueue.size() &#8211; 1);<br \/>\n            if (last.mIsDroppable) {<br \/>\n                \/\/ \u6700\u540e\u4e00\u5e27\u53ef\u4e22\u5f03&#xff1a;\u66ff\u6362\u5b83<br \/>\n                if (!last.mIsStale) {<br \/>\n                    \/\/ \u91ca\u653e\u88ab\u66ff\u6362\u7684\u7f13\u51b2\u533a\u72b6\u6001<br \/>\n                    mSlots[last.mSlot].mBufferState.freeQueued();<\/p>\n<p>                    \/\/ \u5171\u4eab\u7f13\u51b2\u533a\u6a21\u5f0f\u7279\u6b8a\u5904\u7406<br \/>\n                    if (!mCore-&gt;mSharedBufferMode &amp;&amp;<br \/>\n                            mSlots[last.mSlot].mBufferState.isFree()) {<br \/>\n                        mSlots[last.mSlot].mBufferState.mShared &#061; false;  \/\/ \u4e0d\u518d\u5171\u4eab<br \/>\n                    }<\/p>\n<p>                    \/\/ \u5982\u679c\u4e0d\u662f\u5171\u4eab\u7f13\u51b2\u533a&#xff0c;\u5c06\u5176\u52a0\u5165\u7a7a\u95f2\u7f13\u51b2\u533a\u5217\u8868<br \/>\n                    if (!mSlots[last.mSlot].mBufferState.isShared()) {<br \/>\n                        mCore-&gt;mActiveBuffers.erase(last.mSlot);<br \/>\n                        mCore-&gt;mFreeBuffers.push_back(last.mSlot);<br \/>\n                        output-&gt;bufferReplaced &#061; true;  \/\/ \u6807\u8bb0\u7f13\u51b2\u533a\u88ab\u66ff\u6362<br \/>\n                    }<br \/>\n                }<\/p>\n<p>                \/\/ \u5408\u5e76\u635f\u574f\u533a\u57df&#xff08;\u5c06\u88ab\u4e22\u5f03\u5e27\u7684\u635f\u574f\u533a\u57df\u5408\u5e76\u5230\u65b0\u5e27&#xff09;<br \/>\n                if (last.mSurfaceDamage.bounds() &#061;&#061; Rect::INVALID_RECT ||<br \/>\n                    item.mSurfaceDamage.bounds() &#061;&#061; Rect::INVALID_RECT) {<br \/>\n                    item.mSurfaceDamage &#061; Region::INVALID_REGION;<br \/>\n                } else {<br \/>\n                    item.mSurfaceDamage |&#061; last.mSurfaceDamage;<br \/>\n                }<\/p>\n<p>                \/\/ \u8986\u76d6\u53ef\u4e22\u5f03\u7684\u7f13\u51b2\u533a<br \/>\n                mCore-&gt;mQueue.editItemAt(mCore-&gt;mQueue.size() &#8211; 1) &#061; item;<br \/>\n                frameReplacedListener &#061; mCore-&gt;mConsumerListener;  \/\/ \u901a\u77e5\u6d88\u8d39\u8005\u5e27\u88ab\u66ff\u6362<br \/>\n            } else {<br \/>\n                \/\/ \u6700\u540e\u4e00\u5e27\u4e0d\u53ef\u4e22\u5f03&#xff1a;\u6dfb\u52a0\u5230\u961f\u5217\u672b\u5c3e<br \/>\n                mCore-&gt;mQueue.push_back(item);<br \/>\n                frameAvailableListener &#061; mCore-&gt;mConsumerListener;  \/\/ \u901a\u77e5\u6d88\u8d39\u8005\u6709\u65b0\u5e27\u53ef\u7528<br \/>\n            }<br \/>\n        }<\/p>\n<p>        \/\/ 6.18 \u66f4\u65b0BufferQueue\u72b6\u6001<br \/>\n        mCore-&gt;mBufferHasBeenQueued &#061; true;  \/\/ \u6807\u8bb0\u5df2\u6709\u7f13\u51b2\u533a\u5165\u961f<br \/>\n        mCore-&gt;mDequeueCondition.notify_all();  \/\/ \u5524\u9192\u7b49\u5f85\u51fa\u961f\u7684\u751f\u4ea7\u8005<br \/>\n        mCore-&gt;mLastQueuedSlot &#061; slot;         \/\/ \u8bb0\u5f55\u6700\u540e\u5165\u961f\u7684\u69fd\u4f4d<\/p>\n<p>        \/\/ 6.19 \u8bbe\u7f6e\u8f93\u51fa\u53c2\u6570<br \/>\n        output-&gt;width &#061; mCore-&gt;mDefaultWidth;<br \/>\n        output-&gt;height &#061; mCore-&gt;mDefaultHeight;<br \/>\n        output-&gt;transformHint &#061; mCore-&gt;mTransformHintInUse &#061; mCore-&gt;mTransformHint;<br \/>\n        output-&gt;numPendingBuffers &#061; static_cast&lt;uint32_t&gt;(mCore-&gt;mQueue.size());<br \/>\n        output-&gt;nextFrameNumber &#061; mCore-&gt;mFrameCounter &#043; 1;<\/p>\n<p>        \/\/ 6.20 \u6027\u80fd\u8ffd\u8e2a\u548c\u5360\u7528\u7387\u8ffd\u8e2a<br \/>\n        ATRACE_INT(mCore-&gt;mConsumerName.c_str(), static_cast&lt;int32_t&gt;(mCore-&gt;mQueue.size()));<br \/>\n#ifndef NO_BINDER<br \/>\n        mCore-&gt;mOccupancyTracker.registerOccupancyChange(mCore-&gt;mQueue.size());<br \/>\n#endif<\/p>\n<p>        \/\/ 6.21 \u83b7\u53d6\u56de\u8c03\u7968\u53f7&#xff08;\u4fdd\u8bc1\u56de\u8c03\u987a\u5e8f&#xff09;<br \/>\n        callbackTicket &#061; mNextCallbackTicket&#043;&#043;;<\/p>\n<p>        VALIDATE_CONSISTENCY();  \/\/ \u9a8c\u8bc1\u5185\u90e8\u4e00\u81f4\u6027<\/p>\n<p>        \/\/ 6.22 \u4fdd\u5b58\u5c40\u90e8\u72b6\u6001\u4f9b\u9501\u5916\u4f7f\u7528<br \/>\n        connectedApi &#061; mCore-&gt;mConnectedApi;<br \/>\n        lastQueuedFence &#061; std::move(mLastQueueBufferFence);<br \/>\n        mLastQueueBufferFence &#061; std::move(acquireFence);<br \/>\n        mLastQueuedCrop &#061; item.mCrop;<br \/>\n        mLastQueuedTransform &#061; item.mTransform;<br \/>\n    } \/\/ \u81ea\u52a8\u9501\u4f5c\u7528\u57df\u7ed3\u675f&#xff08;\u91ca\u653e\u6838\u5fc3\u9501&#xff09;<\/p>\n<p>    \/\/ 7. \u5982\u679c\u4e0d\u662fSurfaceFlinger\u6d88\u8d39\u8005&#xff0c;\u6e05\u9664GraphicBuffer\u5f15\u7528<br \/>\n    \/\/ SurfaceFlinger\u5728\u540c\u4e00\u8fdb\u7a0b&#xff0c;\u4e0d\u9700\u8981\u901a\u8fc7Binder\u4f20\u9012&#xff0c;\u53ef\u4ee5\u4fdd\u7559\u5f15\u7528<br \/>\n    if (!mConsumerIsSurfaceFlinger) {<br \/>\n        item.mGraphicBuffer.clear();<br \/>\n    }<\/p>\n<p>    \/\/ 8. \u66f4\u65b0\u5e27\u4e8b\u4ef6\u5386\u53f2<br \/>\n    nsecs_t postedTime &#061; systemTime(SYSTEM_TIME_MONOTONIC);<br \/>\n    NewFrameEventsEntry newFrameEventsEntry &#061; {<br \/>\n        currentFrameNumber,<br \/>\n        postedTime,<br \/>\n        requestedPresentTimestamp,<br \/>\n        std::move(acquireFenceTime)<br \/>\n    };<br \/>\n    addAndGetFrameTimestamps(&amp;newFrameEventsEntry,<br \/>\n            getFrameTimestamps ? &amp;output-&gt;frameTimestamps : nullptr);<\/p>\n<p>    \/\/ 9. \u56de\u8c03\u901a\u77e5&#xff08;\u6301\u6709\u56de\u8c03\u9501\u4f46\u4e0d\u6301\u6709\u6838\u5fc3\u9501&#xff09;<br \/>\n    {<br \/>\n        std::unique_lock&lt;std::mutex&gt; lock(mCallbackMutex);<br \/>\n        \/\/ 9.1 \u7b49\u5f85\u8f6e\u5230\u81ea\u5df1\u8fdb\u884c\u56de\u8c03&#xff08;\u786e\u4fdd\u56de\u8c03\u987a\u5e8f&#xff09;<br \/>\n        while (callbackTicket !&#061; mCurrentCallbackTicket) {<br \/>\n            mCallbackCondition.wait(lock);<br \/>\n        }<\/p>\n<p>        \/\/ 9.2 \u6267\u884c\u56de\u8c03<br \/>\n        if (frameAvailableListener !&#061; nullptr) {<br \/>\n            frameAvailableListener-&gt;onFrameAvailable(item);  \/\/ \u901a\u77e5\u65b0\u5e27\u53ef\u7528<br \/>\n        } else if (frameReplacedListener !&#061; nullptr) {<br \/>\n            frameReplacedListener-&gt;onFrameReplaced(item);    \/\/ \u901a\u77e5\u5e27\u88ab\u66ff\u6362<br \/>\n        }<\/p>\n<p>        \/\/ 9.3 \u9012\u589e\u5f53\u524d\u56de\u8c03\u7968\u53f7&#xff0c;\u5524\u9192\u7b49\u5f85\u7684\u7ebf\u7a0b<br \/>\n        &#043;&#043;mCurrentCallbackTicket;<br \/>\n        mCallbackCondition.notify_all();<br \/>\n    }<\/p>\n<p>    \/\/ 10. EGL API\u7684\u7279\u6b8a\u5904\u7406&#xff1a;\u7b49\u5f85\u4e0a\u4e00\u4e2a\u5165\u961f\u7684\u6805\u680f<br \/>\n    if (connectedApi &#061;&#061; NATIVE_WINDOW_API_EGL) {<br \/>\n        \/\/ \u8fd9\u91cc\u7b49\u5f85\u5141\u8bb8\u6392\u961f\u4e24\u4e2a\u5b8c\u6574\u7684\u7f13\u51b2\u533a&#xff0c;\u4f46\u4e0d\u5141\u8bb8\u7b2c\u4e09\u4e2a<br \/>\n        \/\/ \u5728\u5e27\u65f6\u95f4\u53d8\u5316\u7684\u60c5\u51b5\u4e0b&#xff0c;\u8fd9\u79cd\u8bbe\u8ba1\u5728\u5ef6\u8fdf\u548c\u541e\u5410\u91cf\u4e4b\u95f4\u505a\u4e86\u4e00\u4e2a\u5c0f\u7684\u6743\u8861&#xff0c;\u504f\u5411\u4e8e\u5ef6\u8fdf<br \/>\n        lastQueuedFence-&gt;waitForever(&#034;Throttling EGL Production&#034;);<br \/>\n    }<\/p>\n<p>    return NO_ERROR;  \/\/ \u6210\u529f\u8fd4\u56de<br \/>\n}<\/p>\n<p>1.\u4e0a\u4e00\u7bc7\u4ecb\u7ecd\u751f\u4ea7\u8005\u5199\u5b8c\u6570\u636e\u8c03\u7528\u4e86BufferQueueProducer::queueBuffer\u5c06buffer\u5199\u5165\u961f\u5217\u4e2d<\/p>\n<\/p>\n<p>2.\u7136\u540e\u5728queueBuffer\u7684\u51fd\u6570\u4e2d\u76849.2\u6b65\u9aa4\u8c03\u7528\u4e86frameAvailableListener-&gt;onFrameAvailable(item);\u6b64\u5904\u5c31\u662f\u7528\u6765\u8fdb\u884c\u901a\u77e5\u6d88\u8d39\u8005\u7684\u56de\u8c03<\/p>\n<\/p>\n<p>3.\u7ee7\u7eed\u67e5\u770b\u4ee3\u7801frameAvailableListener\u662fmCore-&gt;mConsumerListener&#xff0c;\u4e5f\u5c31\u662fframeAvailableListener &#061; mCore-&gt;mConsumerListener;<\/p>\n<\/p>\n<p>4. mCore\u5373\u4e3aBufferQueueCore, BufferQueueCore\u4e2d\u6709\u6210\u5458 sp mConsumerListener<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"474\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201073649-697f0291838ca.png\" width=\"942\" \/><\/p>\n<p>5.BufferQueueCore::mConsumerListener\u662f\u5728\u54ea\u91cc\u8bbe\u7f6e\u7684&#xff0c;\u662f\u4ec0\u4e48\u65f6\u5019\u8bbe\u7f6e\u7684<\/p>\n<p>\u2460.BufferQueueConsumer::connect\u4e2d\u8bbe\u7f6e<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"402\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201073649-697f0291ada5c.png\" width=\"1004\" \/><\/p>\n<p>\u2461.\u5728disconnect\u4e2d\u79fb\u9664<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"357\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201073649-697f0291cf798.png\" width=\"921\" \/><\/p>\n<p>\u524d\u9762\u4ecb\u7ecd\u8fc7&#xff0c;BufferQueueProducer\u548cBufferQueueConsumer\u662fBufferQueueCore\u7684\u53cb\u5143\u7c7b&#xff0c;\u6240\u4ee5\u53ef\u4ee5\u76f4\u63a5\u8bbf\u95ee\u5176\u79c1\u6709\u6210\u5458<\/p>\n<\/p>\n<p>6.BufferQueueConsumer::connect\u3001disconnect\u662f\u5728\u54ea\u91cc\u8c03\u7528\u7684&#xff1f;<\/p>\n<p>\u6211\u4eec\u6765\u770b\u4e0bBufferQueueConsumer.h\u4e2d\u7684\u4ee3\u7801&#xff0c;\u76f4\u63a5\u641c\u7d22connect\u548cdisconnect<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"415\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201073649-697f0291f27e5.png\" width=\"916\" \/><\/p>\n<p>\u2460.consumerConnect\u4e2d\u8c03\u7528\u4e86connect\u51fd\u6570<\/p>\n<p>\u2461.consumerDisconnect\u4e2d\u8c03\u7528\u4e86disconnect\u51fd\u6570<\/p>\n<\/p>\n<p>7.\u8c01\u8c03\u7528\u4e86consumerConnect&#xff1f;<\/p>\n<p>\u5176\u5b9e\u5728ConsumerBase\u7c7b\u4e2d\u8c03\u7528\u7684&#xff0c;\u5982\u4e0b<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"500\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201073650-697f0292273fd.png\" width=\"977\" \/><\/p>\n<p>\u2460.\u53ef\u4ee5\u770b\u51fa\u6765\u5728ConsumerBase\u7684\u6784\u9020\u51fd\u6570\u4e2d\u8c03\u7528\u4e86mConsumer-&gt;consumerConnect(proxy, controlledByApp);<\/p>\n<p>\u2461.\u8fd9\u91cc\u7684mConsumer\u662fBLASTBufferQueue\u4e2d\u521b\u5efaBLASTBufferItemConsumer\u65f6\u4e00\u8def\u8bbe\u7f6e\u4e0b\u6765\u7684BufferQueueConsumer\u5bf9\u8c61&#xff1b;<\/p>\n<\/p>\n<p>8.\u8bbe\u7f6e\u7684\u662fListener\u662f\u4ece\u54ea\u91cc\u4f20\u9012\u8fc7\u6765\u7684&#xff1f;<\/p>\n<p>\u2460.\u7ee7\u627f\u5173\u7cfb\u56fe<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1432\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201073650-697f02925813a.png\" width=\"1707\" \/><\/p>\n<p>\u2461.BLASTBufferQueue\u7684\u6784\u9020\u51fd\u6570\u4e2d&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"264\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201073651-697f0293752fe.png\" width=\"1314\" \/><\/p>\n<\/p>\n<p>9.\u6240\u4ee5\u6839\u636e\u4e0a\u8ff0\u7684\u6d41\u7a0b\u5206\u6790&#xff0c;BufferQueueCore::mConsumerListener\u8bbe\u7f6e\u7684\u5c31\u662fConsumerBase\u7684\u5b9e\u4f8b<\/p>\n<\/p>\n<p>10.\u56e0\u6b64&#xff0c;frameAvailableListener-&gt;onFrameAvailable(item)\u56de\u8c03\u65f6&#xff0c;\u4f1a\u8d70\u5230ConsumerBase::onFrameAvailable\u4e2d<\/p>\n<\/p>\n<p>11.ConsumerBase::onFrameAvailable\u4e2d\u7ee7\u7eed\u8c03\u7528<\/p>\n<p>\u4f4d\u7f6e&#xff1a;framework\/native\/libs\/gui\/ConsumerBase.cpp<\/p>\n<p>void ConsumerBase::onFrameAvailable(const BufferItem&amp; item) {<br \/>\n    CB_LOGV(&#034;onFrameAvailable&#034;);<\/p>\n<p>    sp&lt;FrameAvailableListener&gt; listener;<br \/>\n    { \/\/ scope for the lock<br \/>\n        Mutex::Autolock lock(mFrameAvailableMutex);<br \/>\n        listener &#061; mFrameAvailableListener.promote();<br \/>\n    }<\/p>\n<p>    if (listener !&#061; nullptr) {<br \/>\n        CB_LOGV(&#034;actually calling onFrameAvailable&#034;);<br \/>\n        listener-&gt;onFrameAvailable(item);<br \/>\n    }<br \/>\n}<\/p>\n<p>12.ConsumerBase\u4e2d\u7684\u6210\u5458mFrameAvailableListener\u662f\u4ec0\u4e48<\/p>\n<p>\u2460.mFrameAvailableListener\u662f\u5728framework\/native\/libs\/gui\/include\/gui\/ConsumerBase.h\u6587\u4ef6\u4e2d\u5b9a\u4e49\u7684<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0\u00a0<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"413\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201073651-697f0293a1d89.png\" width=\"992\" \/><\/p>\n<p>\u2461.\u7136\u540e\u6211\u4eec\u7ee7\u7eed\u770b\u4e0b\u4e0a\u8ff0\u7684listener-&gt;onFrameAvailable\u8c03\u7528\u5230\u54ea\u91cc\u4e86&#xff0c;\u770b\u4e0b\u8bbe\u7f6emFrameAvailableListener\u7684\u4f4d\u7f6e<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"319\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201073651-697f0293c78be.png\" width=\"832\" \/><\/p>\n<p>\u6240\u4ee5\u662f\u901a\u8fc7\u8c03\u7528setFrameAvailableListener\u51fd\u6570\u8fdb\u884c\u8bbe\u7f6e\u7684&#xff0c;\u90a3\u6211\u4eec\u7ee7\u7eed\u770b\u8c01\u53bb\u8c03\u7528\u7684<\/p>\n<p>\u2462.\u5728BLASTBufferQueue\u7ee7\u627f\u81eaConsumerBase::FrameAvailableListener&#xff0c;\u5e76\u5b9e\u73b0onFrameAvailable\u65b9\u6cd5<\/p>\n<p>\u6e90\u7801\u4f4d\u7f6e&#xff1a;framework\/native\/libs\/gui\/include\/gui\/BLASTBufferQueue.h<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"788\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201073651-697f0293e4373.png\" width=\"974\" \/><\/p>\n<p>\u2463.\u5728BLASTBufferQueue\u7684\u6784\u9020\u51fd\u6570\u4e2d&#xff1a;mBufferItemConsumer-&gt;setFrameAvailableListener(this);<\/p>\n<p>\u6e90\u7801\u4f4d\u7f6e&#xff1a;framework\/native\/libs\/gui\/BLASTBufferQueue.cpp<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"713\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201073652-697f02942aa60.png\" width=\"1040\" \/><\/p>\n<p>\u2464.\u7136\u540e\u5c31\u662f\u8c03\u7528\u5230\u4e0a\u9762\u8bf4\u7684ConsumerBase::setFrameAvailableListener\u51fd\u6570\u4e2d&#xff0c;\u6240\u4ee5ConsumerBase\u4e2d\u7684\u6210\u5458mFrameAvailableListener\u6307\u5411\u7684\u662fBLASTBufferQueue\u5b9e\u4f8b\u5bf9\u8c61<\/p>\n<\/p>\n<p>13.\u56e0\u6b64&#xff0c;\u56de\u8c03\u7684\u6d41\u7a0b\u8d70\u5230\u4e86BLASTBufferQueue::onFrameAvailable<\/p>\n<p>\/\/ BLASTBufferQueue \u7684\u5e27\u53ef\u7528\u56de\u8c03\u51fd\u6570<br \/>\n\/\/ \u5f53\u751f\u4ea7\u8005\u63d0\u4ea4\u65b0\u5e27&#xff08;queueBuffer&#xff09;\u65f6&#xff0c;\u6b64\u56de\u8c03\u88ab\u89e6\u53d1<br \/>\nvoid BLASTBufferQueue::onFrameAvailable(const BufferItem&amp; item) {<br \/>\n    \/\/ \u7528\u4e8e\u4fdd\u5b58\u524d\u4e00\u4e2a\u540c\u6b65\u4e8b\u52a1\u56de\u8c03\u7684\u4e34\u65f6\u53d8\u91cf<br \/>\n    std::function&lt;void(SurfaceComposerClient::Transaction*)&gt; prevCallback &#061; nullptr;<br \/>\n    SurfaceComposerClient::Transaction* prevTransaction &#061; nullptr;<\/p>\n<p>    {<br \/>\n        \/\/ 1. \u52a0\u9501\u4fdd\u62a4\u5171\u4eab\u72b6\u6001<br \/>\n        UNIQUE_LOCK_WITH_ASSERTION(mMutex);<br \/>\n        BBQ_TRACE();  \/\/ \u6027\u80fd\u8ddf\u8e2a\u6807\u8bb0<\/p>\n<p>        \/\/ 2. \u68c0\u67e5\u662f\u5426\u9700\u8981\u7b49\u5f85\u4e8b\u52a1\u56de\u8c03<br \/>\n        \/\/ \u5982\u679c mSyncedFrameNumbers \u975e\u7a7a&#xff0c;\u8868\u793a\u6709\u540c\u6b65\u4e8b\u52a1\u6b63\u5728\u7b49\u5f85\u56de\u8c03<br \/>\n        bool waitForTransactionCallback &#061; !mSyncedFrameNumbers.empty();<\/p>\n<p>        \/\/ 3. \u68c0\u67e5\u662f\u5426\u6709\u540c\u6b65\u4e8b\u52a1\u8bbe\u7f6e<br \/>\n        const bool syncTransactionSet &#061; mTransactionReadyCallback !&#061; nullptr;<br \/>\n        BQA_LOGV(&#034;onFrameAvailable-start syncTransactionSet&#061;%s&#034;, boolToString(syncTransactionSet));<\/p>\n<p>        \/\/ 4. \u540c\u6b65\u4e8b\u52a1\u7279\u6b8a\u5904\u7406<br \/>\n        if (syncTransactionSet) {<br \/>\n            \/\/ 4.1 \u5982\u679c\u5c06\u8981\u91cd\u7528\u540c\u4e00\u4e2a mSyncTransaction&#xff0c;\u5148\u91ca\u653e\u5df2\u8bbe\u7f6e\u7684\u7f13\u51b2\u533a<br \/>\n            \/\/ \u8fd9\u662f\u4e3a\u4e86\u5c3d\u65e9\u83b7\u5f97\u7a7a\u95f2\u69fd\u4f4d&#xff0c;\u4ee5\u4fbf\u7ee7\u7eed\u5904\u7406\u65b0\u7f13\u51b2\u533a<br \/>\n            if (!mAcquireSingleBuffer) {<br \/>\n                auto bufferData &#061; mSyncTransaction-&gt;getAndClearBuffer(mSurfaceControl);<br \/>\n                if (bufferData) {<br \/>\n                    BQA_LOGD(&#034;Releasing previous buffer when syncing: framenumber&#061;%&#034; PRIu64,<br \/>\n                             bufferData-&gt;frameNumber);<br \/>\n                    \/\/ \u91ca\u653e\u4e4b\u524d\u7684\u7f13\u51b2\u533a<br \/>\n                    releaseBuffer(bufferData-&gt;generateReleaseCallbackId(),<br \/>\n                                  bufferData-&gt;acquireFence);<br \/>\n                }<br \/>\n            }<\/p>\n<p>            \/\/ 4.2 \u5904\u7406\u7b49\u5f85\u4e8b\u52a1\u56de\u8c03\u7684\u60c5\u51b5<br \/>\n            if (waitForTransactionCallback) {<br \/>\n                \/\/ \u6b63\u5728\u7b49\u5f85\u524d\u4e00\u4e2a\u540c\u6b65\u4e8b\u52a1\u7684\u56de\u8c03&#xff0c;\u5141\u8bb8\u53e6\u4e00\u4e2a\u540c\u6b65\u4e8b\u52a1\u7ee7\u7eed<br \/>\n                \/\/ \u9700\u8981\u5148\u6e05\u9664\u4e24\u4e2a\u540c\u6b65\u4e4b\u95f4\u7684\u4e2d\u95f4\u4e8b\u52a1<br \/>\n                \/\/ \u901a\u8fc7\u5c06\u5b83\u4eec\u5408\u5e76\u5230 mSyncTransaction \u4e2d&#xff0c;\u786e\u4fdd\u4efb\u4f55\u7f13\u51b2\u533a\u5408\u5e76\u90fd\u4f1a\u89e6\u53d1\u91ca\u653e\u56de\u8c03<br \/>\n                while (mNumFrameAvailable &gt; 0) {<br \/>\n                    \/\/ \u6e05\u7a7a\u5f71\u5b50\u961f\u5217<br \/>\n                    acquireAndReleaseBuffer();<br \/>\n                }<br \/>\n            } else {<br \/>\n                \/\/ \u786e\u4fdd\u5728\u540c\u6b65\u4e4b\u524d\u5e27\u53ef\u7528\u8ba1\u6570\u4e3a0&#xff0c;\u4ee5\u786e\u4fdd\u6b63\u786e\u7684\u5e27\u7528\u4e8e\u540c\u6b65<br \/>\n                \/\/ \u5982\u679c mNumFrameAvailable &gt; 0&#xff0c;\u8bf4\u660e\u4e4b\u524d\u5df2\u7ecf\u7528\u5b8c\u4e86\u7f13\u51b2\u533a<br \/>\n                \/\/ \u8fd9\u610f\u5473\u7740\u5728\u7ee7\u7eed\u540c\u6b65\u4e4b\u524d\u9700\u8981\u6e05\u7a7a\u7f13\u51b2\u533a<br \/>\n                while (mNumFrameAvailable &gt; 0) {<br \/>\n                    BQA_LOGD(&#034;waiting until no queued buffers&#034;);<br \/>\n                    mCallbackCV.wait(_lock);<br \/>\n                }<br \/>\n            }<br \/>\n        }<\/p>\n<p>        \/\/ 5. \u5c06\u65b0\u5e27\u6dfb\u52a0\u5230\u5f71\u5b50\u961f\u5217<br \/>\n        mNumFrameAvailable&#043;&#043;;<\/p>\n<p>        \/\/ 6. \u7279\u6b8a\u5904\u7406&#xff1a;\u5982\u679c\u6b63\u5728\u7b49\u5f85\u4e8b\u52a1\u56de\u8c03\u4e14\u5df2\u6709\u591a\u4e2a\u5f85\u5904\u7406\u5e27<br \/>\n        if (waitForTransactionCallback &amp;&amp; mNumFrameAvailable &gt;&#061; 2) {<br \/>\n            acquireAndReleaseBuffer();<br \/>\n        }<\/p>\n<p>        \/\/ 7. \u6027\u80fd\u8ffd\u8e2a&#xff1a;\u8bb0\u5f55\u5f53\u524d\u961f\u5217\u6df1\u5ea6<br \/>\n        ATRACE_INT(mQueuedBufferTrace.c_str(),<br \/>\n                   mNumFrameAvailable &#043; mNumAcquired &#8211; mPendingRelease.size());<\/p>\n<p>        BQA_LOGV(&#034;onFrameAvailable framenumber&#061;%&#034; PRIu64 &#034; syncTransactionSet&#061;%s&#034;,<br \/>\n                 item.mFrameNumber, boolToString(syncTransactionSet));<\/p>\n<p>        \/\/ 8. \u6839\u636e\u540c\u6b65\u4e8b\u52a1\u8bbe\u7f6e\u5904\u7406\u65b0\u5e27<br \/>\n        if (syncTransactionSet) {<br \/>\n            \/\/ 8.1 \u5728\u7b49\u5f85\u7a7a\u95f2\u7f13\u51b2\u533a\u4e4b\u524d\u6dfb\u52a0\u5230\u540c\u6b65\u5e27\u53f7\u96c6\u5408<br \/>\n            \/\/ \u8fd9\u662f\u4e3a\u4e86\u9632\u6b62\u5728\u7b49\u5f85\u671f\u95f4\u91ca\u653e\u7684\u56de\u8c03\u5c1d\u8bd5\u83b7\u53d6\u7f13\u51b2\u533a<br \/>\n            mSyncedFrameNumbers.emplace(item.mFrameNumber);<\/p>\n<p>            \/\/ 8.2 \u7b49\u5f85\u53ef\u7528\u7f13\u51b2\u533a&#xff08;\u540c\u6b65\u4e8b\u52a1\u4fdd\u8bc1\u83b7\u53d6\u7f13\u51b2\u533a&#xff09;<br \/>\n            while (acquireNextBufferLocked(mSyncTransaction) &#061;&#061; BufferQueue::NO_BUFFER_AVAILABLE) {<br \/>\n                BQA_LOGD(&#034;waiting for available buffer&#034;);<br \/>\n                mCallbackCV.wait(_lock);<br \/>\n            }<\/p>\n<p>            \/\/ 8.3 \u6dfb\u52a0\u4e8b\u52a1\u63d0\u4ea4\u56de\u8c03&#xff0c;\u786e\u4fdd\u540c\u6b65\u7684\u7f13\u51b2\u533a\u5df2\u53d1\u9001\u5230 SurfaceFlinger<br \/>\n            incStrong((void*)transactionCommittedCallbackThunk);<br \/>\n            mSyncTransaction-&gt;addTransactionCommittedCallback(transactionCommittedCallbackThunk,<br \/>\n                                                              static_cast&lt;void*&gt;(this));<\/p>\n<p>            \/\/ 8.4 \u5982\u679c\u53ea\u83b7\u53d6\u5355\u4e2a\u7f13\u51b2\u533a&#xff0c;\u4fdd\u5b58\u5f53\u524d\u56de\u8c03\u5e76\u91cd\u7f6e<br \/>\n            if (mAcquireSingleBuffer) {<br \/>\n                prevCallback &#061; mTransactionReadyCallback;<br \/>\n                prevTransaction &#061; mSyncTransaction;<br \/>\n                mTransactionReadyCallback &#061; nullptr;<br \/>\n                mSyncTransaction &#061; nullptr;<br \/>\n            }<br \/>\n        } else if (!waitForTransactionCallback) {<br \/>\n            \/\/ 9. \u975e\u540c\u6b65\u4e8b\u52a1\u6216\u4e0d\u9700\u8981\u7b49\u5f85\u56de\u8c03\u65f6&#xff0c;\u76f4\u63a5\u5c1d\u8bd5\u83b7\u53d6\u7f13\u51b2\u533a<br \/>\n            acquireNextBufferLocked(std::nullopt);<br \/>\n        }<br \/>\n    }  \/\/ \u81ea\u52a8\u91ca\u653e\u9501<\/p>\n<p>    \/\/ 10. \u5728\u9501\u5916\u6267\u884c\u5148\u524d\u4fdd\u5b58\u7684\u56de\u8c03<br \/>\n    if (prevCallback) {<br \/>\n        prevCallback(prevTransaction);<br \/>\n    }<br \/>\n}<\/p>\n<p>\u4e0a\u8ff0\u7684\u4ee3\u7801\u903b\u8f91\u5f88\u591a\u5f88\u957f&#xff0c;\u6211\u4eec\u91cd\u70b9\u67e5\u770b\u4e8b\u52a1\u76f8\u5173\u903b\u8f91&#xff0c;\u57288.2\u7684\u6d41\u7a0bacquireNextBufferLocked\u83b7\u53d6\u53ef\u7528\u7684\u7f13\u51b2\u533a(\u6b64\u5904\u5c31\u662f\u4e4b\u524d\u6d41\u7a0b\u56fe\u4e2dAndroid12\u7684acquireBuffer&#xff0c;\u4e0d\u8fc7\u5728Android15\u4e2d\u6d41\u7a0b\u6709\u6240\u4fee\u6539)&#xff0c;\u7136\u540e\u57288.3\u7684\u6b65\u9aa4\u4e2d\u6dfb\u52a0\u4e8b\u52a1\u56de\u8c03&#xff0c;\u901a\u8fc7\u00a0mSyncTransaction-&gt;addTransactionCommittedCallback(transactionCommittedCallbackThunk,<br \/>\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 static_cast&lt;void*&gt;(this));\u5c06\u7f13\u5b58\u533a\u63d0\u4ea4\u7ed9SurfaceFlinger\u4e86<\/p>\n<p>\u4e0a\u8ff0\u7684\u6d41\u7a0b\u56fe\u5982\u4e0b&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"4111\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201073652-697f02949c03e.png\" width=\"1829\" \/><\/p>\n<\/p>\n<h2>\u4e09.\u603b\u7ed3<\/h2>\n<h5>\u6838\u5fc3\u7ed3\u8bba&#xff1a;<\/h5>\n<p>\u6d88\u8d39\u8005\u5e76\u975e\u4e3b\u52a8\u8f6e\u8be2&#xff0c;\u800c\u662f\u901a\u8fc7\u4e00\u4e2a\u76d1\u542c\u5668\u56de\u8c03\u673a\u5236\u88ab\u88ab\u52a8\u901a\u77e5\u3002\u5f53\u751f\u4ea7\u8005\u5c06\u6e32\u67d3\u597d\u7684\u7f13\u51b2\u533a\u653e\u5165\u961f\u5217\u540e&#xff0c;\u4f1a\u89e6\u53d1\u4e00\u4e2a\u94fe\u5f0f\u56de\u8c03&#xff0c;\u6700\u7ec8\u901a\u77e5\u5230\u6d88\u8d39\u8005\u3002<\/p>\n<h5>\u6d41\u7a0b\u56fe&#xff1a;<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"2400\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201073655-697f02979a9d2.png\" width=\"2701\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00.\u524d\u8a00\u4e0a\u4e00\u7bc7\u4e2d&#xff0c;\u57fa\u672c\u8bf4\u6e05\u695a\u4e86\u751f\u4ea7\u7aef\u7684\u5904\u7406\u903b\u8f91&#xff0c;\u8fd9\u4e00\u7bc7&#xff0c;\u6211\u4eec\u6765\u68b3\u7406\u4e0b\u6d88\u8d39\u7aef\u7684\u903b\u8f91Consumer\u662f\u4ec0\u4e48\u65f6\u5019\u6765\u6d88\u8d39\u6570\u636e\u7684&#xff1f;\u4ed6\u662f\u81ea\u5df1\u6765\u62ff\u7684\u8fd8\u662f\u522b\u4eba\u901a\u77e5\u4ed6\u7684&#xff1f;\u8fd9\u7bc7\u6587\u7ae0\u5c31\u5e26\u7740\u8fd9\u4e9b\u7591\u95ee\u6765\u5206\u6790\u6e90\u7801&#xff0c;\u518d\u628a\u6982\u8981\u6d41\u7a0b\u56fe\u8d34\u4e00\u4e0b\u4e8c.\u76d1\u542c\u5668\u7684\u56de\u8c03\u8fc7\u7a0b\u89e3\u6790\u6e90\u7801\u4f4d\u7f6e&#xff1a;framework\/native\/libs\/gui\/BufferQueueConsumer.cppframework\/native\/libs\/<\/p>\n","protected":false},"author":2,"featured_media":70172,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[84],"topic":[],"class_list":["post-70186","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-android"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u56fe\u50cf\u663e\u793a\u6846\u67b6\u5341\u4e8c\u2014\u2014BufferQueue\u7684\u5de5\u4f5c\u6d41\u7a0b\uff08\u57fa\u4e8eAndroid 15\u6e90\u7801\u5206\u6790\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/70186.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u56fe\u50cf\u663e\u793a\u6846\u67b6\u5341\u4e8c\u2014\u2014BufferQueue\u7684\u5de5\u4f5c\u6d41\u7a0b\uff08\u57fa\u4e8eAndroid 15\u6e90\u7801\u5206\u6790\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00.\u524d\u8a00\u4e0a\u4e00\u7bc7\u4e2d&#xff0c;\u57fa\u672c\u8bf4\u6e05\u695a\u4e86\u751f\u4ea7\u7aef\u7684\u5904\u7406\u903b\u8f91&#xff0c;\u8fd9\u4e00\u7bc7&#xff0c;\u6211\u4eec\u6765\u68b3\u7406\u4e0b\u6d88\u8d39\u7aef\u7684\u903b\u8f91Consumer\u662f\u4ec0\u4e48\u65f6\u5019\u6765\u6d88\u8d39\u6570\u636e\u7684&#xff1f;\u4ed6\u662f\u81ea\u5df1\u6765\u62ff\u7684\u8fd8\u662f\u522b\u4eba\u901a\u77e5\u4ed6\u7684&#xff1f;\u8fd9\u7bc7\u6587\u7ae0\u5c31\u5e26\u7740\u8fd9\u4e9b\u7591\u95ee\u6765\u5206\u6790\u6e90\u7801&#xff0c;\u518d\u628a\u6982\u8981\u6d41\u7a0b\u56fe\u8d34\u4e00\u4e0b\u4e8c.\u76d1\u542c\u5668\u7684\u56de\u8c03\u8fc7\u7a0b\u89e3\u6790\u6e90\u7801\u4f4d\u7f6e&#xff1a;framework\/native\/libs\/gui\/BufferQueueConsumer.cppframework\/native\/libs\/\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/70186.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-01T07:36:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201073647-697f028fdc421.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/70186.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/70186.html\",\"name\":\"\u56fe\u50cf\u663e\u793a\u6846\u67b6\u5341\u4e8c\u2014\u2014BufferQueue\u7684\u5de5\u4f5c\u6d41\u7a0b\uff08\u57fa\u4e8eAndroid 15\u6e90\u7801\u5206\u6790\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-01T07:36:59+00:00\",\"dateModified\":\"2026-02-01T07:36:59+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/70186.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/70186.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/70186.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u56fe\u50cf\u663e\u793a\u6846\u67b6\u5341\u4e8c\u2014\u2014BufferQueue\u7684\u5de5\u4f5c\u6d41\u7a0b\uff08\u57fa\u4e8eAndroid 15\u6e90\u7801\u5206\u6790\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u56fe\u50cf\u663e\u793a\u6846\u67b6\u5341\u4e8c\u2014\u2014BufferQueue\u7684\u5de5\u4f5c\u6d41\u7a0b\uff08\u57fa\u4e8eAndroid 15\u6e90\u7801\u5206\u6790\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/70186.html","og_locale":"zh_CN","og_type":"article","og_title":"\u56fe\u50cf\u663e\u793a\u6846\u67b6\u5341\u4e8c\u2014\u2014BufferQueue\u7684\u5de5\u4f5c\u6d41\u7a0b\uff08\u57fa\u4e8eAndroid 15\u6e90\u7801\u5206\u6790\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00.\u524d\u8a00\u4e0a\u4e00\u7bc7\u4e2d&#xff0c;\u57fa\u672c\u8bf4\u6e05\u695a\u4e86\u751f\u4ea7\u7aef\u7684\u5904\u7406\u903b\u8f91&#xff0c;\u8fd9\u4e00\u7bc7&#xff0c;\u6211\u4eec\u6765\u68b3\u7406\u4e0b\u6d88\u8d39\u7aef\u7684\u903b\u8f91Consumer\u662f\u4ec0\u4e48\u65f6\u5019\u6765\u6d88\u8d39\u6570\u636e\u7684&#xff1f;\u4ed6\u662f\u81ea\u5df1\u6765\u62ff\u7684\u8fd8\u662f\u522b\u4eba\u901a\u77e5\u4ed6\u7684&#xff1f;\u8fd9\u7bc7\u6587\u7ae0\u5c31\u5e26\u7740\u8fd9\u4e9b\u7591\u95ee\u6765\u5206\u6790\u6e90\u7801&#xff0c;\u518d\u628a\u6982\u8981\u6d41\u7a0b\u56fe\u8d34\u4e00\u4e0b\u4e8c.\u76d1\u542c\u5668\u7684\u56de\u8c03\u8fc7\u7a0b\u89e3\u6790\u6e90\u7801\u4f4d\u7f6e&#xff1a;framework\/native\/libs\/gui\/BufferQueueConsumer.cppframework\/native\/libs\/","og_url":"https:\/\/www.wsisp.com\/helps\/70186.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-01T07:36:59+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260201073647-697f028fdc421.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/70186.html","url":"https:\/\/www.wsisp.com\/helps\/70186.html","name":"\u56fe\u50cf\u663e\u793a\u6846\u67b6\u5341\u4e8c\u2014\u2014BufferQueue\u7684\u5de5\u4f5c\u6d41\u7a0b\uff08\u57fa\u4e8eAndroid 15\u6e90\u7801\u5206\u6790\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-01T07:36:59+00:00","dateModified":"2026-02-01T07:36:59+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/70186.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/70186.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/70186.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u56fe\u50cf\u663e\u793a\u6846\u67b6\u5341\u4e8c\u2014\u2014BufferQueue\u7684\u5de5\u4f5c\u6d41\u7a0b\uff08\u57fa\u4e8eAndroid 15\u6e90\u7801\u5206\u6790\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/70186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=70186"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/70186\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/70172"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=70186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=70186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=70186"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=70186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}