{"id":112816,"date":"2026-10-05T00:09:15","date_gmt":"2026-10-04T16:09:15","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/112816.html"},"modified":"2026-10-05T00:09:15","modified_gmt":"2026-10-04T16:09:15","slug":"%e9%80%82%e9%85%8d%e5%99%a8%e6%a8%a1%e5%bc%8f%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/112816.html","title":{"rendered":"\u9002\u914d\u5668\u6a21\u5f0f\u8be6\u89e3"},"content":{"rendered":"<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E5%89%8D%E8%A8%80%C2%A0%20%C2%A0%20%C2%A0%20%C2%A0%C2%A0-toc\" style=\"margin-left:0px\">\u524d\u8a00\u00a0 \u00a0 \u00a0 \u00a0\u00a0<\/p>\n<p id=\"%E4%B8%80%E3%80%81%E7%BC%9D%E5%9C%A8%E6%8E%A5%E5%8F%A3%E4%B8%8A-toc\" style=\"margin-left:0px\">\u4e00\u3001\u7f1d\u5728\u63a5\u53e3\u4e0a<\/p>\n<p id=\"%E4%BA%8C%E3%80%81%E5%9B%9B%E4%B8%AA%E8%A7%92%E8%89%B2-toc\" style=\"margin-left:0px\">\u4e8c\u3001\u56db\u4e2a\u89d2\u8272<\/p>\n<p id=\"%E4%B8%89%E3%80%81%E5%AF%B9%E8%B1%A1%E9%80%82%E9%85%8D%E5%99%A8%E4%B8%8E%E7%B1%BB%E9%80%82%E9%85%8D%E5%99%A8-toc\" style=\"margin-left:0px\">\u4e09\u3001\u5bf9\u8c61\u9002\u914d\u5668\u4e0e\u7c7b\u9002\u914d\u5668<\/p>\n<p id=\"%E5%9B%9B%E3%80%81C%2B%2B%EF%BC%9A%E6%8A%8A%E4%B8%A4%E5%AE%B6%20SDK%20%E6%94%B6%E6%88%90%E5%90%8C%E4%B8%80%E7%A7%8D%E5%B8%A7%E6%BA%90-toc\" style=\"margin-left:0px\">\u56db\u3001C&#043;&#043;&#xff1a;\u628a\u4e24\u5bb6 SDK \u6536\u6210\u540c\u4e00\u79cd\u5e27\u6e90<\/p>\n<p id=\"4.1%20Target%EF%BC%9A%E6%92%AD%E6%94%BE%E5%99%A8%E5%94%AF%E4%B8%80%E8%AE%A4%E8%AF%86%E7%9A%84%E7%B1%BB%E5%9E%8B-toc\" style=\"margin-left:40px\">4.1 Target&#xff1a;\u64ad\u653e\u5668\u552f\u4e00\u8ba4\u8bc6\u7684\u7c7b\u578b<\/p>\n<p id=\"4.2%20Adaptee%EF%BC%9A%E5%81%87%E5%AE%9A%E6%94%B9%E4%B8%8D%E4%BA%86%E7%9A%84%20SDK-toc\" style=\"margin-left:40px\">4.2 Adaptee&#xff1a;\u5047\u5b9a\u6539\u4e0d\u4e86\u7684 SDK<\/p>\n<p id=\"4.3%20%E5%AF%B9%E8%B1%A1%E9%80%82%E9%85%8D%E5%99%A8-toc\" style=\"margin-left:40px\">4.3 \u5bf9\u8c61\u9002\u914d\u5668<\/p>\n<p id=\"4.4%20%E6%92%AD%E6%94%BE%E5%99%A8%E5%8F%AA%E8%AE%A4%E6%8E%A5%E5%8F%A3-toc\" style=\"margin-left:40px\">4.4 \u64ad\u653e\u5668\u53ea\u8ba4\u63a5\u53e3<\/p>\n<p id=\"4.5%20%E7%B1%BB%E9%80%82%E9%85%8D%E5%99%A8%E5%AF%B9%E7%85%A7-toc\" style=\"margin-left:40px\">4.5 \u7c7b\u9002\u914d\u5668\u5bf9\u7167<\/p>\n<p id=\"4.6%20%E8%B7%91%E5%87%BA%E6%9D%A5%E7%9A%84%E7%BB%93%E6%9E%9C-toc\" style=\"margin-left:40px\">4.6 \u8dd1\u51fa\u6765\u7684\u7ed3\u679c<\/p>\n<p id=\"%E4%BA%94%E3%80%81Python%EF%BC%9A%E5%90%8C%E4%B8%80%E6%9D%A1%E7%BC%9D%EF%BC%8C%E5%8F%A6%E4%B8%80%E5%A5%97%E7%B1%BB%E5%9E%8B%E6%9C%BA%E5%88%B6-toc\" style=\"margin-left:0px\">\u4e94\u3001Python&#xff1a;\u540c\u4e00\u6761\u7f1d&#xff0c;\u53e6\u4e00\u5957\u7c7b\u578b\u673a\u5236<\/p>\n<p id=\"5.1%20Protocol%20%E4%B8%8E%E5%AF%B9%E8%B1%A1%E9%80%82%E9%85%8D%E5%99%A8-toc\" style=\"margin-left:40px\">5.1 Protocol \u4e0e\u5bf9\u8c61\u9002\u914d\u5668<\/p>\n<p id=\"5.2%20%E7%B1%BB%E9%80%82%E9%85%8D%E5%99%A8%E5%8C%85%E4%B8%8D%E8%BF%9B%E7%8E%B0%E6%88%90%E5%AE%9E%E4%BE%8B-toc\" style=\"margin-left:40px\">5.2 \u7c7b\u9002\u914d\u5668\u5305\u4e0d\u8fdb\u73b0\u6210\u5b9e\u4f8b<\/p>\n<p id=\"5.3%20%E4%B8%80%E4%B8%AA%E5%87%BD%E6%95%B0%E5%B0%B1%E5%86%99%E6%88%90%E9%97%AD%E5%8C%85-toc\" style=\"margin-left:40px\">5.3 \u4e00\u4e2a\u51fd\u6570\u5c31\u5199\u6210\u95ed\u5305<\/p>\n<p id=\"5.4%20%E6%A0%87%E5%87%86%E5%BA%93%E9%87%8C%E7%9A%84%E6%96%87%E6%9C%AC%E9%80%82%E9%85%8D%E5%99%A8-toc\" style=\"margin-left:40px\">5.4 \u6807\u51c6\u5e93\u91cc\u7684\u6587\u672c\u9002\u914d\u5668<\/p>\n<p id=\"%E5%85%AD%E3%80%81%E7%BF%BB%E8%AF%91%E5%8F%AF%E4%BB%A5%E6%8E%A5%E6%88%90%E9%93%BE-toc\" style=\"margin-left:0px\">\u516d\u3001\u7ffb\u8bd1\u53ef\u4ee5\u63a5\u6210\u94fe<\/p>\n<p id=\"%E4%B8%83%E3%80%81%E6%A0%87%E5%87%86%E5%BA%93%E6%97%A9%E5%B0%B1%E5%9C%A8%E7%94%A8%E8%BF%99%E7%A7%8D%E7%BB%93%E6%9E%84-toc\" style=\"margin-left:0px\">\u4e03\u3001\u6807\u51c6\u5e93\u65e9\u5c31\u5728\u7528\u8fd9\u79cd\u7ed3\u6784<\/p>\n<p id=\"%E5%85%AB%E3%80%81%E5%90%8C%E6%A0%B7%E6%98%AF%E5%8C%85%E4%B8%80%E5%B1%82%EF%BC%8C%E9%97%AE%E6%8E%A5%E5%8F%A3%E5%8F%98%E4%BA%86%E6%B2%A1%E6%9C%89-toc\" style=\"margin-left:0px\">\u516b\u3001\u540c\u6837\u662f\u5305\u4e00\u5c42&#xff0c;\u95ee\u63a5\u53e3\u53d8\u4e86\u6ca1\u6709<\/p>\n<p id=\"%E4%B9%9D%E3%80%81%E6%94%BE%E5%9C%A8%E6%92%AD%E6%94%BE%E9%93%BE%E8%B7%AF%E4%B8%8A-toc\" style=\"margin-left:0px\">\u4e5d\u3001\u653e\u5728\u64ad\u653e\u94fe\u8def\u4e0a<\/p>\n<p id=\"%E5%8D%81%E3%80%81%E6%80%BB%E7%BB%93-toc\" style=\"margin-left:0px\">\u5341\u3001\u603b\u7ed3<\/p>\n<hr id=\"hr-toc\" \/>\n<h2>\u524d\u8a00\u00a0 \u00a0 \u00a0 \u00a0\u00a0<\/h2>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u64ad\u653e\u5668\u3001\u7f16\u7801\u5668\u548c\u89c6\u89c9\u7b97\u6cd5\u5e0c\u671b\u201c\u4e0b\u4e00\u5e27\u201d\u957f\u5f97\u4e00\u6837&#xff1a;\u540c\u4e00\u4e2a\u51fd\u6570\u540d&#xff0c;\u540c\u4e00\u79cd\u50cf\u7d20\u5e03\u5c40&#xff0c;\u540c\u4e00\u79cd\u201c\u6ca1\u6709\u66f4\u591a\u6570\u636e\u201d\u7684\u8868\u793a\u3002\u91c7\u96c6\u5361\u5382\u5546\u4e0d\u6309\u8fd9\u4e2a\u4e60\u60ef\u8bbe\u8ba1\u3002\u5b83\u7684 SDK \u53eb pullBuffer&#xff0c;\u5410\u51fa RGB24\u3002\u9694\u58c1\u7f51\u7edc\u6444\u50cf\u673a\u7684 SDK \u53eb fetchGray&#xff0c;\u5410\u51fa\u7070\u5ea6\u3002\u4e24\u4efd\u5934\u6587\u4ef6\u901a\u5e38\u6539\u4e0d\u4e86&#xff0c;\u64ad\u653e\u5668\u91cc\u4e5f\u4e0d\u8be5\u6563\u843d if (vendor &#061;&#061; &#8230;)\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u9002\u914d\u5668\u6a21\u5f0f\u586b\u7684\u5c31\u662f\u8fd9\u6761\u7f1d\u3002\u5b83\u628a\u4e00\u4e2a\u5df2\u7ecf\u5b58\u5728\u7684\u7c7b&#xff0c;\u7ffb\u8bd1\u6210\u5ba2\u6237\u7aef\u6b63\u5728\u4f7f\u7528\u7684\u63a5\u53e3&#xff0c;\u8ba9\u4e24\u8fb9\u5728\u5404\u81ea\u90fd\u4e0d\u6539\u6e90\u7801\u7684\u524d\u63d0\u4e0b\u534f\u4f5c\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u4e00\u53e5\u8bdd&#xff0c;\u9002\u914d\u5668\u8d1f\u8d23\u628a\u8c03\u7528\u65b9\u5f0f\u548c\u6570\u636e\u5f62\u72b6\u5bf9\u9f50\u3002\u91cd\u8fde\u3001\u6392\u961f\u3001\u6ee4\u955c\u3001\u89e3\u7801\u6d41\u7a0b\u7559\u5728\u9002\u914d\u5668\u5916\u9762\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u672c\u6587\u7528\u540c\u4e00\u7ec4\u6570\u636e\u8d70\u901a C&#043;&#043; \u548c Python&#xff1a;\u4e00\u5f20 2\u00d72 \u7684 RGB24&#xff0c;\u9996\u50cf\u7d20\u662f\u7ea2 (255,0,0)&#xff1b;\u4e00\u5f20 2\u00d72 \u7684\u7070\u5ea6\u56fe&#xff0c;\u9996\u50cf\u7d20\u4eae\u5ea6\u662f 10\u3002\u7ffb\u8bd1\u4e4b\u540e&#xff0c;\u64ad\u653e\u5668\u90fd\u53ea\u770b\u89c1 RGBA\u3002\u5b8c\u6574\u7a0b\u5e8f\u5728 examples\/frame_adapter.cpp \u548c examples\/frame_adapter.py\u3002<\/p>\n<h2 id=\"%E4%B8%80%E3%80%81%E7%BC%9D%E5%9C%A8%E6%8E%A5%E5%8F%A3%E4%B8%8A\">\u4e00\u3001\u7f1d\u5728\u63a5\u53e3\u4e0a<\/h2>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5148\u628a\u4e09\u79cd\u89d2\u8272\u6446\u5728\u4e00\u8d77\u770b\u3002<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"360\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004160913-6ac27a2978929.png\" width=\"781\" \/><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u56fe 1&#xff1a;\u64ad\u653e\u5668\u53ea\u8ba4 IFrameSource::read \u548c RGBA&#xff1b;\u4e24\u5bb6 SDK \u7684\u65b9\u6cd5\u540d\u548c\u7f13\u51b2\u5e03\u5c40\u5404\u81ea\u4e00\u5957<\/p>\n<p>\u5ba2\u6237\u7aef\u5df2\u7ecf\u5199\u6b7b\u7684\u7ea6\u5b9a\u662f&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"162\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004160913-6ac27a29af438.png\" width=\"650\" \/><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u91c7\u96c6\u5361\u63d0\u4f9b\u7684\u662f pullBuffer \u52a0\u4e00\u5757 RGB24\u3002\u7f51\u7edc\u6444\u50cf\u673a\u63d0\u4f9b\u7684\u662f fetchGray \u52a0\u4e00\u5757\u5355\u901a\u9053\u4eae\u5ea6\u3002\u80fd\u529b\u90fd\u662f\u201c\u7ed9\u51fa\u4e00\u5e45\u56fe\u201d&#xff0c;\u7b7e\u540d\u548c\u5185\u5b58\u5e03\u5c40\u5bf9\u4e0d\u4e0a\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u8fd9\u79cd\u65f6\u5019\u6709\u4e09\u6761\u8def&#xff1a;<\/p>\n<p>(1). \u6539 SDK\u3002\u5382\u5546\u5934\u6587\u4ef6\u3001\u5df2\u7ecf\u53d1\u5e03\u7684\u52a8\u6001\u5e93&#xff0c;\u901a\u5e38\u8d70\u4e0d\u901a\u3002<\/p>\n<p>(2). \u6539\u64ad\u653e\u5668&#xff0c;\u8ba9\u5b83\u8ba4\u8bc6\u6bcf\u4e00\u79cd SDK\u3002\u6bcf\u63a5\u4e00\u5bb6\u8bbe\u5907&#xff0c;\u64ad\u653e\u5668\u5c31\u591a\u4e00\u6761\u5206\u652f&#xff0c;\u6d4b\u8bd5\u77e9\u9635\u8ddf\u7740\u6da8\u3002<\/p>\n<p>(3). \u5728\u4e2d\u95f4\u52a0\u4e00\u5c42\u7ffb\u8bd1\u3002\u64ad\u653e\u5668\u7ee7\u7eed\u53ea\u4f9d\u8d56\u81ea\u5df1\u7684\u63a5\u53e3&#xff0c;\u6bcf\u5bb6 SDK \u914d\u4e00\u4e2a\u9002\u914d\u5668\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u7b2c\u4e09\u6761\u5c31\u662f\u9002\u914d\u5668\u3002\u5224\u65ad\u6807\u51c6\u4e5f\u5f88\u5177\u4f53&#xff1a;\u4e24\u8fb9\u8bed\u4e49\u90fd\u8fd8\u662f\u201c\u8bfb\u51fa\u4e0b\u4e00\u5e27\u201d&#xff0c;\u5dee\u522b\u4e3b\u8981\u5728\u540d\u5b57\u3001\u53c2\u6570\u987a\u5e8f\u3001\u5b57\u8282\u5e03\u5c40\u548c\u9519\u8bef\u7801\u3002\u8bed\u4e49\u8981\u662f\u5df2\u7ecf\u53d8\u4e86\u2014\u2014\u6bd4\u5982\u4e00\u8fb9\u7ed9\u7684\u662f\u7f16\u7801\u5305&#xff0c;\u4e00\u8fb9\u8981\u7684\u662f\u50cf\u7d20\u2014\u2014\u90a3\u4e00\u5c42\u5c31\u4e0d\u8be5\u53eb\u9002\u914d\u5668&#xff0c;\u89e3\u7801\u8be5\u5355\u72ec\u6210\u6a21\u5757\u3002<\/p>\n<h2 id=\"%E4%BA%8C%E3%80%81%E5%9B%9B%E4%B8%AA%E8%A7%92%E8%89%B2\">\u4e8c\u3001\u56db\u4e2a\u89d2\u8272<\/h2>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u300a\u8bbe\u8ba1\u6a21\u5f0f\u300b\u91cc\u8fd9\u7ec4\u7ed3\u6784\u6709\u56db\u4e2a\u53c2\u4e0e\u8005\u3002\u653e\u5230\u4e0a\u9762\u7684\u573a\u666f\u91cc&#xff0c;\u5bf9\u5e94\u5173\u7cfb\u662f&#xff1a;<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"189\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004160913-6ac27a29bd2a6.png\" width=\"846\" \/><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u534f\u4f5c\u8fc7\u7a0b\u5c31\u4e00\u53e5\u8bdd&#xff1a;\u5ba2\u6237\u7aef\u8c03\u7528\u9002\u914d\u5668\u7684 read&#xff0c;\u9002\u914d\u5668\u53bb\u8c03 SDK&#xff0c;\u628a\u7ed3\u679c\u88c5\u8fdb Frame \u518d\u4ea4\u56de\u53bb\u3002<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"565\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004160913-6ac27a29d161e.png\" width=\"943\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u56fe 2&#xff1a;\u4e24\u4e2a\u9002\u914d\u5668\u90fd\u5b9e\u73b0 IFrameSource&#xff0c;\u5404\u81ea\u6301\u6709\u4e00\u5bb6\u5df2\u7ecf\u521b\u5efa\u597d\u7684 SDK<\/p>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u56fe2\u662f\u5bf9\u8c61\u9002\u914d\u5668&#xff1a;\u9002\u914d\u5668\u662f\u4e00\u4e2a\u72ec\u7acb\u5bf9\u8c61&#xff0c;\u91cc\u9762\u653e\u7740\u88ab\u9002\u914d\u8005\u3002\u8fd9\u4e5f\u662f C&#043;&#043; \u548c Python \u91cc\u90fd\u5e94\u8be5\u9ed8\u8ba4\u91c7\u7528\u7684\u5f62\u5f0f\u3002\u64ad\u653e\u5668\u4f9d\u8d56\u7684\u662f\u63a5\u53e3&#xff0c;\u6240\u4ee5\u540c\u4e00\u5957 play() \u65e2\u80fd\u64ad\u91c7\u96c6\u5361&#xff0c;\u4e5f\u80fd\u64ad\u7f51\u7edc\u6444\u50cf\u673a\u3002\u6362\u8bbe\u5907\u65f6\u66ff\u6362\u9002\u914d\u5668&#xff0c;\u64ad\u653e\u5faa\u73af\u4e00\u4e2a\u5b57\u90fd\u4e0d\u7528\u6539\u3002<\/p>\n<h2 id=\"%E4%B8%89%E3%80%81%E5%AF%B9%E8%B1%A1%E9%80%82%E9%85%8D%E5%99%A8%E4%B8%8E%E7%B1%BB%E9%80%82%E9%85%8D%E5%99%A8\">\u4e09\u3001\u5bf9\u8c61\u9002\u914d\u5668\u4e0e\u7c7b\u9002\u914d\u5668<\/h2>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5bf9\u8c61\u9002\u914d\u5668\u7528\u7ec4\u5408\u3002\u7c7b\u9002\u914d\u5668\u7528\u7ee7\u627f&#xff0c;\u5728 C&#043;&#043; \u91cc\u5c31\u662f\u8ba9\u9002\u914d\u5668\u540c\u65f6\u7ee7\u627f Target \u548c Adaptee\u3002<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"295\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004160914-6ac27a2a04612.png\" width=\"619\" \/><\/p>\n<p style=\"text-align:center\"><span style=\"color:#555555\">\u56fe 3&#xff1a;\u5de6\u8fb9\u5305\u4f4f\u4e00\u4e2a\u5df2\u7ecf\u5b58\u5728\u7684 SDK \u5b9e\u4f8b&#xff1b;\u53f3\u8fb9\u7684\u9002\u914d\u5668\u81ea\u5df1\u5c31\u662f SDK \u7684\u5b50\u7c7b<\/span><\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"185\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004160914-6ac27a2a13c48.png\" width=\"808\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0\u5bf9\u8c61\u9002\u914d\u5668\u591a\u4e00\u6b21\u6307\u9488\u8df3\u8f6c&#xff0c;\u6362\u6765\u7684\u662f\u751f\u547d\u671f\u548c\u66ff\u6362\u81ea\u7531\u3002\u7c7b\u9002\u914d\u5668\u5c11\u4e00\u4e2a\u5bf9\u8c61&#xff0c;\u4ee3\u4ef7\u662f\u548c\u5177\u4f53 SDK \u7c7b\u710a\u5728\u4e00\u8d77\u3002\u5382\u5546 SDK \u5f88\u5c11\u4e3a\u4e86\u8ba9\u4f60\u8986\u76d6\u884c\u4e3a\u53bb\u7559\u865a\u51fd\u6570&#xff0c;\u7c7b\u9002\u914d\u5668\u90a3\u4e2a\u201c\u53ef\u4ee5\u6539\u5199\u201d\u7684\u4f18\u70b9\u5e38\u5e38\u7528\u4e0d\u4e0a\u3002<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0\u672c\u6587\u7684 C&#043;&#043; \u7c7b\u9002\u914d\u5668\u4f7f\u7528\u79c1\u6709\u7ee7\u627f\u3002\u516c\u6709\u591a\u7ee7\u627f\u4f1a\u8ba9\u9002\u914d\u5668\u540c\u65f6\u66b4\u9732 read \u548c pullBuffer&#xff0c;\u8c03\u7528\u65b9\u53ef\u4ee5\u7ed5\u8fc7\u7ffb\u8bd1&#xff0c;\u76f4\u63a5\u62ff\u8d70 RGB24\u3002\u79c1\u6709\u7ee7\u627f\u628a SDK \u7684\u65b9\u6cd5\u7559\u5728\u7c7b\u5185\u90e8&#xff0c;\u5bf9\u5916\u53ea\u5269\u4e0b IFrameSource\u3002\u9650\u5236\u8fd8\u5728&#xff1a;\u5b83\u4ecd\u7136\u4e0d\u80fd\u5305\u88c5\u4e00\u4e2a\u5df2\u7ecf\u6784\u9020\u597d\u7684 CaptureCardSdk\u3002<\/p>\n<h2 id=\"%E5%9B%9B%E3%80%81C%2B%2B%EF%BC%9A%E6%8A%8A%E4%B8%A4%E5%AE%B6%20SDK%20%E6%94%B6%E6%88%90%E5%90%8C%E4%B8%80%E7%A7%8D%E5%B8%A7%E6%BA%90\">\u56db\u3001C&#043;&#043;&#xff1a;\u628a\u4e24\u5bb6 SDK \u6536\u6210\u540c\u4e00\u79cd\u5e27\u6e90<\/h2>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u793a\u4f8b\u6309 C&#043;&#043;17 \u7f16\u5199&#xff0c;\u53ef\u4ee5\u7528\u4e0b\u9762\u4efb\u4e00\u547d\u4ee4\u7f16\u8bd1&#xff1a;<\/p>\n<p>g&#043;&#043; -std&#061;c&#043;&#043;17 -Wall -Wextra -o frame_adapter frame_adapter.cpp<br \/>\ncl \/nologo \/std:c&#043;&#043;17 \/EHsc \/utf-8 \/W4 frame_adapter.cpp <\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0MSVC \u9700\u8981 \/utf-8&#xff0c;\u5426\u5219\u6e90\u6587\u4ef6\u91cc\u7684\u4e2d\u6587\u6ce8\u91ca\u53ef\u80fd\u89e6\u53d1 C4819\u3002\u4e0b\u9762\u662f\u5176\u4e2d\u7684\u6838\u5fc3\u7c7b\u578b&#xff0c;\u7070\u5ea6\u8f6c\u6362\u3001NetworkCamSdk \u548c main \u5728 examples\/frame_adapter.cpp \u91cc&#xff0c;\u4e0e\u8fd9\u91cc\u7684\u91c7\u96c6\u5361\u8def\u5f84\u540c\u4e00\u7ed3\u6784\u3002<\/p>\n<h3 id=\"4.1%20Target%EF%BC%9A%E6%92%AD%E6%94%BE%E5%99%A8%E5%94%AF%E4%B8%80%E8%AE%A4%E8%AF%86%E7%9A%84%E7%B1%BB%E5%9E%8B\">4.1 Target&#xff1a;\u64ad\u653e\u5668\u552f\u4e00\u8ba4\u8bc6\u7684\u7c7b\u578b<\/h3>\n<p>struct Frame {<br \/>\n    int width &#061; 0;<br \/>\n    int height &#061; 0;<br \/>\n    std::vector&lt;std::uint8_t&gt; rgba;  \/\/ width * height * 4<br \/>\n};<\/p>\n<p>class IFrameSource {<br \/>\npublic:<br \/>\n    virtual ~IFrameSource() &#061; default;<br \/>\n    virtual bool read(Frame&amp; out) &#061; 0;<br \/>\n}; <\/p>\n<p>\u00a0 \u00a0 \u00a0\u00a0\u63a5\u53e3\u4e0a\u53ea\u6709\u4e00\u4e2a\u7eaf\u865a\u51fd\u6570\u3002\u5382\u5546\u540d\u3001SDK \u53e5\u67c4\u3001\u50cf\u7d20\u683c\u5f0f\u679a\u4e3e\u90fd\u4e0d\u51fa\u73b0\u5728 Target \u4e0a\u3002\u8fd9\u4e9b\u4fe1\u606f\u4e00\u65e6\u6f0f\u51fa\u53bb&#xff0c;\u64ad\u653e\u5668\u5c31\u4f1a\u91cd\u65b0\u957f\u51fa\u5206\u652f\u3002<\/p>\n<p>\u00a0 \u00a0 \u00a0\u00a0\u50cf\u7d20\u7ffb\u8bd1\u662f\u7eaf\u51fd\u6570&#xff0c;\u9002\u914d\u5668\u8c03\u7528\u5b83&#xff0c;\u800c\u4e0d\u662f\u628a\u5faa\u73af\u63c9\u8fdb\u7c7b\u7684\u6210\u5458\u91cc\u3002\u8fd9\u6837 RGB24 \u548c\u7070\u5ea6\u4e24\u6761\u8def\u5f84\u53ef\u4ee5\u5206\u5f00\u6d4b\u3002<\/p>\n<p>Frame rgb24ToRgba(const std::vector&lt;std::uint8_t&gt;&amp; rgb24, int width, int height) {<br \/>\n    if (width &lt;&#061; 0 || height &lt;&#061; 0) {<br \/>\n        throw std::invalid_argument(&#034;invalid frame size&#034;);<br \/>\n    }<br \/>\n    const std::size_t pixels &#061;<br \/>\n        static_cast&lt;std::size_t&gt;(width) * static_cast&lt;std::size_t&gt;(height);<br \/>\n    if (rgb24.size() !&#061; pixels * 3) {<br \/>\n        throw std::invalid_argument(&#034;RGB24 buffer size mismatch&#034;);<br \/>\n    }<\/p>\n<p>    Frame out;<br \/>\n    out.width &#061; width;<br \/>\n    out.height &#061; height;<br \/>\n    out.rgba.resize(pixels * 4);<br \/>\n    for (std::size_t i &#061; 0; i &lt; pixels; &#043;&#043;i) {<br \/>\n        out.rgba[i * 4 &#043; 0] &#061; rgb24[i * 3 &#043; 0];<br \/>\n        out.rgba[i * 4 &#043; 1] &#061; rgb24[i * 3 &#043; 1];<br \/>\n        out.rgba[i * 4 &#043; 2] &#061; rgb24[i * 3 &#043; 2];<br \/>\n        out.rgba[i * 4 &#043; 3] &#061; 255;<br \/>\n    }<br \/>\n    return out;<br \/>\n} <\/p>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0grayToRgba \u540c\u6784&#xff1a;\u6bcf\u4e2a\u4eae\u5ea6\u590d\u5236\u5230 R\u3001G\u3001B&#xff0c;Alpha \u4ecd\u662f 255\u3002\u5c3a\u5bf8\u4e0d\u5408\u6cd5\u3001\u7f13\u51b2\u957f\u5ea6\u548c\u5bbd\u9ad8\u4e0d\u7b26&#xff0c;\u5c5e\u4e8e\u8c03\u7528\u5951\u7ea6\u88ab\u7834\u574f&#xff0c;\u7528\u5f02\u5e38&#xff1b;\u201c\u8fd9\u6b21\u6ca1\u6709\u5e27\u201d\u5c5e\u4e8e\u6b63\u5e38\u7684\u6d41\u7ed3\u675f&#xff0c;\u7528 false\u3002\u4e24\u79cd\u5931\u8d25\u4e0d\u8981\u6df7\u6210\u540c\u4e00\u4e2a\u8fd4\u56de\u503c\u3002<\/p>\n<h3 id=\"4.2%20Adaptee%EF%BC%9A%E5%81%87%E5%AE%9A%E6%94%B9%E4%B8%8D%E4%BA%86%E7%9A%84%20SDK\">4.2 Adaptee&#xff1a;\u5047\u5b9a\u6539\u4e0d\u4e86\u7684 SDK<\/h3>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u793a\u4f8b\u91cc\u7684 SDK \u7528\u5185\u5b58\u4e2d\u7684\u4e00\u5e45\u56fe\u6a21\u62df\u8bbe\u5907&#xff0c;\u907f\u514d\u6587\u7ae0\u4f9d\u8d56\u771f\u5b9e\u91c7\u96c6\u5361\u3002\u7ffb\u8bd1\u7ed3\u6784\u4e0e\u63a5\u771f\u8bbe\u5907\u65f6\u76f8\u540c&#xff1a;\u9002\u914d\u5668\u4e0d\u5173\u5fc3\u6570\u636e\u4ece\u54ea\u6765&#xff0c;\u53ea\u5173\u5fc3\u51fd\u6570\u540d\u548c\u7f13\u51b2\u5e03\u5c40\u3002<\/p>\n<p>class CaptureCardSdk {<br \/>\npublic:<br \/>\n    CaptureCardSdk() {<br \/>\n        frames_.push_back(Raw{<br \/>\n            2, 2,<br \/>\n            {255, 0, 0, 0, 255, 0, 0, 0, 255, 255, 255, 255},<br \/>\n        });<br \/>\n    }<\/p>\n<p>    bool pullBuffer(std::vector&lt;std::uint8_t&gt;&amp; rgb24, int&amp; width, int&amp; height) {<br \/>\n        if (index_ &gt;&#061; frames_.size()) {<br \/>\n            return false;<br \/>\n        }<br \/>\n        const Raw&amp; raw &#061; frames_[index_&#043;&#043;];<br \/>\n        width &#061; raw.width;<br \/>\n        height &#061; raw.height;<br \/>\n        rgb24 &#061; raw.rgb24;<br \/>\n        return true;<br \/>\n    }<\/p>\n<p>private:<br \/>\n    struct Raw {<br \/>\n        int width;<br \/>\n        int height;<br \/>\n        std::vector&lt;std::uint8_t&gt; rgb24;<br \/>\n    };<\/p>\n<p>    std::vector&lt;Raw&gt; frames_;<br \/>\n    std::size_t index_ &#061; 0;<br \/>\n}; <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0NetworkCamSdk::fetchGray \u7684\u5f62\u72b6\u4e00\u6837&#xff0c;\u7f13\u51b2\u6362\u6210 {10, 20, 30, 40}\u3002\u4e24\u5bb6 SDK \u751a\u81f3\u8fde\u201c\u6ca1\u6709\u5e27\u201d\u90fd\u5df2\u7ecf\u7528 bool \u8868\u793a\u3002\u771f\u5b9e\u73b0\u573a\u7ecf\u5e38\u4e0d\u662f\u8fd9\u6837&#xff0c;\u9519\u8bef\u7801\u8981\u5728\u9002\u914d\u5668\u8fb9\u754c\u6536\u53e3&#xff1a;<\/p>\n<p>\/\/ \u793a\u610f&#xff1a;\u5382\u5546\u7528\u9519\u8bef\u7801\u65f6&#xff0c;Target \u4ecd\u7136\u53ea\u770b\u89c1 true \/ false \/ \u5f02\u5e38<br \/>\nbool CaptureCardAdapter::read(Frame&amp; out) {<br \/>\n    int code &#061; sdk_.pullBuffer(rgb24, width, height);<br \/>\n    if (code &#061;&#061; CaptureCardSdk::kEof) {<br \/>\n        return false;<br \/>\n    }<br \/>\n    if (code !&#061; CaptureCardSdk::kOk) {<br \/>\n        throw SdkError(code);<br \/>\n    }<br \/>\n    out &#061; rgb24ToRgba(rgb24, width, height);<br \/>\n    return true;<br \/>\n} <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u64ad\u653e\u5668\u4e0d\u5305\u542b &lt;vendor\/capture_card.h&gt;&#xff0c;\u4e5f\u5c31\u4e0d\u4f1a\u51fa\u73b0\u5382\u5546\u9519\u8bef\u7801\u3002<\/p>\n<h3 id=\"4.3%20%E5%AF%B9%E8%B1%A1%E9%80%82%E9%85%8D%E5%99%A8\">4.3 \u5bf9\u8c61\u9002\u914d\u5668<\/h3>\n<p>class CaptureCardAdapter : public IFrameSource {<br \/>\npublic:<br \/>\n    explicit CaptureCardAdapter(CaptureCardSdk&amp; sdk) : sdk_(sdk) {}<\/p>\n<p>    bool read(Frame&amp; out) override {<br \/>\n        std::vector&lt;std::uint8_t&gt; rgb24;<br \/>\n        int width &#061; 0;<br \/>\n        int height &#061; 0;<br \/>\n        if (!sdk_.pullBuffer(rgb24, width, height)) {<br \/>\n            return false;<br \/>\n        }<br \/>\n        out &#061; rgb24ToRgba(rgb24, width, height);<br \/>\n        return true;<br \/>\n    }<\/p>\n<p>private:<br \/>\n    CaptureCardSdk&amp; sdk_;<br \/>\n}; <\/p>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0NetworkCamAdapter \u53ea\u628a pullBuffer \u6362\u6210 fetchGray&#xff0c;\u628a rgb24ToRgba \u6362\u6210 grayToRgba\u3002<\/p>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u8fd9\u91cc\u7528\u5f15\u7528&#xff0c;\u662f\u56e0\u4e3a main \u540c\u65f6\u62e5\u6709 SDK \u548c\u9002\u914d\u5668&#xff0c;\u5f15\u7528\u4e0d\u5ef6\u957f\u5bf9\u65b9\u7684\u751f\u547d\u671f\u3002\u9002\u914d\u5668\u82e5\u6bd4 SDK \u6d3b\u5f97\u4e45&#xff0c;\u5c31\u662f\u60ac\u7a7a\u5f15\u7528\u3002\u9002\u914d\u5668\u9700\u8981\u72ec\u5360\u8bbe\u5907\u65f6&#xff0c;\u6539\u6210\u6301\u6709 std::unique_ptr&lt;CaptureCardSdk&gt;&#xff0c;\u5728\u6784\u9020\u51fd\u6570\u91cc std::move \u8fdb\u6765\u3002<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"489\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004160914-6ac27a2a28d1f.png\" width=\"921\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u56fe 4&#xff1a;\u64ad\u653e\u5668\u6ca1\u6709\u76f4\u63a5\u78b0\u5230 pullBuffer&#xff0c;RGB24 \u5230 RGBA \u7684\u8f6c\u6362\u53d1\u751f\u5728\u9002\u914d\u5668\u5185\u90e8<\/p>\n<h3 id=\"4.4%20%E6%92%AD%E6%94%BE%E5%99%A8%E5%8F%AA%E8%AE%A4%E6%8E%A5%E5%8F%A3\">4.4 \u64ad\u653e\u5668\u53ea\u8ba4\u63a5\u53e3<\/h3>\n<p>void playFrames(const std::function&lt;bool(Frame&amp;)&gt;&amp; read, const std::string&amp; label) {<br \/>\n    std::cout &lt;&lt; label &lt;&lt; &#034;\\\\n&#034;;<br \/>\n    Frame frame;<br \/>\n    int count &#061; 0;<br \/>\n    while (read(frame)) {<br \/>\n        &#043;&#043;count;<br \/>\n        std::cout &lt;&lt; &#034;  &#034; &lt;&lt; frame.width &lt;&lt; &#034;x&#034; &lt;&lt; frame.height &lt;&lt; &#034; rgba0&#061;(&#034;<br \/>\n                  &lt;&lt; static_cast&lt;int&gt;(frame.rgba.at(0)) &lt;&lt; &#034;,&#034;<br \/>\n                  &lt;&lt; static_cast&lt;int&gt;(frame.rgba.at(1)) &lt;&lt; &#034;,&#034;<br \/>\n                  &lt;&lt; static_cast&lt;int&gt;(frame.rgba.at(2)) &lt;&lt; &#034;,&#034;<br \/>\n                  &lt;&lt; static_cast&lt;int&gt;(frame.rgba.at(3)) &lt;&lt; &#034;)\\\\n&#034;;<br \/>\n    }<br \/>\n    std::cout &lt;&lt; &#034;  frames&#061;&#034; &lt;&lt; count &lt;&lt; &#034; eof\\\\n&#034;;<br \/>\n}<\/p>\n<p>void play(IFrameSource&amp; source, const std::string&amp; label) {<br \/>\n    playFrames([&amp;source](Frame&amp; frame) { return source.read(frame); }, label);<br \/>\n} <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0play \u7684\u53c2\u6570\u7c7b\u578b\u662f IFrameSource&amp;\u3002\u91c7\u96c6\u5361\u9002\u914d\u5668\u3001\u7f51\u7edc\u6444\u50cf\u673a\u9002\u914d\u5668\u3001\u6d4b\u8bd5\u7528\u7684\u5047\u5e27\u6e90&#xff0c;\u8d70\u7684\u662f\u540c\u4e00\u4e2a\u51fd\u6570\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Target \u4e0a\u5982\u679c\u771f\u7684\u53ea\u6709\u4e00\u4e2a\u64cd\u4f5c&#xff0c;\u53ef\u4ee5\u4e0d\u58f0\u660e\u7c7b&#xff0c;\u76f4\u63a5\u628a\u7ffb\u8bd1\u5199\u6210 lambda&#xff0c;\u4ea4\u7ed9 playFrames&#xff1a;<\/p>\n<p>NetworkCamSdk camFn;<br \/>\nplayFrames(<br \/>\n    [&amp;camFn](Frame&amp; out) {<br \/>\n        std::vector&lt;std::uint8_t&gt; gray;<br \/>\n        int width &#061; 0;<br \/>\n        int height &#061; 0;<br \/>\n        if (!camFn.fetchGray(gray, width, height)) {<br \/>\n            return false;<br \/>\n        }<br \/>\n        out &#061; grayToRgba(gray, width, height);<br \/>\n        return true;<br \/>\n    },<br \/>\n    &#034;function adapter \/ network&#034;); <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u7c7b\u5f62\u5f0f\u7684\u9002\u914d\u5668\u4ecd\u7136\u6709\u5b83\u7684\u4f4d\u7f6e&#xff1a;Target \u4f1a\u589e\u957f\u6210\u4e00\u7ec4\u65b9\u6cd5\u3001\u9002\u914d\u5668\u8981\u4fdd\u5b58\u683c\u5f0f\u534f\u5546\u7684\u7ed3\u679c&#xff0c;\u6216\u8005\u8c03\u7528\u65b9\u5df2\u7ecf\u5728\u7528 IFrameSource* \u505a\u591a\u6001\u5bb9\u5668\u3002\u53ea\u6709\u4e00\u4e2a\u51fd\u6570\u8981\u7ffb\u8bd1\u65f6&#xff0c;std::function \u6216\u51fd\u6570\u6a21\u677f\u66f4\u77ed\u3002<\/p>\n<h3 id=\"4.5%20%E7%B1%BB%E9%80%82%E9%85%8D%E5%99%A8%E5%AF%B9%E7%85%A7\">4.5 \u7c7b\u9002\u914d\u5668\u5bf9\u7167<\/h3>\n<p>class CaptureCardClassAdapter : public IFrameSource, private CaptureCardSdk {<br \/>\npublic:<br \/>\n    bool read(Frame&amp; out) override {<br \/>\n        std::vector&lt;std::uint8_t&gt; rgb24;<br \/>\n        int width &#061; 0;<br \/>\n        int height &#061; 0;<br \/>\n        if (!pullBuffer(rgb24, width, height)) {<br \/>\n            return false;<br \/>\n        }<br \/>\n        out &#061; rgb24ToRgba(rgb24, width, height);<br \/>\n        return true;<br \/>\n    }<br \/>\n}; <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0pullBuffer \u6765\u81ea\u57fa\u7c7b&#xff0c;\u4e0d\u662f\u6765\u81ea\u6210\u5458\u3002\u8c03\u7528\u65b9\u5199 classAdapter.pullBuffer(&#8230;) \u4f1a\u7f16\u8bd1\u5931\u8d25&#xff0c;\u56e0\u4e3a\u7ee7\u627f\u662f\u79c1\u6709\u7684\u3002\u4e0e\u6b64\u540c\u65f6&#xff0c;\u4f60\u4e5f\u65e0\u6cd5\u5199\u51fa CaptureCardClassAdapter adapter(alreadyOpenedCard)&#xff1a;\u8fd9\u4e2a\u7c7b\u6ca1\u6709\u53ef\u4ee5\u63a5\u6536\u5916\u90e8 SDK \u7684\u6784\u9020\u51fd\u6570&#xff0c;\u5b83\u5185\u90e8\u90a3\u53f0\u201c\u91c7\u96c6\u5361\u201d\u662f\u57fa\u7c7b\u5b50\u5bf9\u8c61\u3002<\/p>\n<h3 id=\"4.6%20%E8%B7%91%E5%87%BA%E6%9D%A5%E7%9A%84%E7%BB%93%E6%9E%9C\">4.6 \u8dd1\u51fa\u6765\u7684\u7ed3\u679c<\/h3>\n<p>object adapter \/ capture<br \/>\n  2&#215;2 rgba0&#061;(255,0,0,255)<br \/>\n  frames&#061;1 eof<br \/>\nobject adapter \/ network<br \/>\n  2&#215;2 rgba0&#061;(10,10,10,255)<br \/>\n  frames&#061;1 eof<br \/>\nclass adapter \/ capture<br \/>\n  2&#215;2 rgba0&#061;(255,0,0,255)<br \/>\n  frames&#061;1 eof<br \/>\nfunction adapter \/ network<br \/>\n  2&#215;2 rgba0&#061;(10,10,10,255)<br \/>\n  frames&#061;1 eof <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u56db\u6761\u8def\u5f84\u7684\u9996\u50cf\u7d20\u90fd\u7b26\u5408\u9884\u671f&#xff1a;RGB24 \u7684\u7ea2\u8865\u4e0a Alpha \u6210\u4e3a (255,0,0,255)&#xff0c;\u7070\u5ea6 10 \u94fa\u6210 (10,10,10,255)\u3002\u7b2c\u4e8c\u5e27\u4e0d\u5b58\u5728&#xff0c;\u7edf\u4e00\u6253\u5370 eof\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u64ad\u653e\u5668\u8981\u5355\u6d4b\u65f6&#xff0c;\u518d\u63d0\u4f9b\u4e00\u4e2a\u4e0d\u78b0\u786c\u4ef6\u7684 Target \u5b9e\u73b0\u5373\u53ef&#xff1a;<\/p>\n<p>class FakeSource : public IFrameSource {<br \/>\npublic:<br \/>\n    explicit FakeSource(std::vector&lt;Frame&gt; frames) : frames_(std::move(frames)) {}<\/p>\n<p>    bool read(Frame&amp; out) override {<br \/>\n        if (index_ &gt;&#061; frames_.size()) {<br \/>\n            return false;<br \/>\n        }<br \/>\n        out &#061; frames_[index_&#043;&#043;];<br \/>\n        return true;<br \/>\n    }<\/p>\n<p>private:<br \/>\n    std::vector&lt;Frame&gt; frames_;<br \/>\n    std::size_t index_ &#061; 0;<br \/>\n}; <\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0\u8fd9\u6bb5\u793a\u610f\u9700\u8981 &lt;utility&gt; \u91cc\u7684 std::move\u3002play(fake, &#034;test&#034;) \u548c play(cardAdapter, &#034;device&#034;) \u662f\u540c\u4e00\u6761\u8c03\u7528\u94fe\u3002\u9002\u914d\u5668\u628a\u8bbe\u5907\u5dee\u5f02\u5173\u5728\u64ad\u653e\u5668\u5916\u9762&#xff0c;\u6d4b\u8bd5\u5c31\u53ef\u4ee5\u53ea\u6784\u9020 Frame\u3002<\/p>\n<h2 id=\"%E4%BA%94%E3%80%81Python%EF%BC%9A%E5%90%8C%E4%B8%80%E6%9D%A1%E7%BC%9D%EF%BC%8C%E5%8F%A6%E4%B8%80%E5%A5%97%E7%B1%BB%E5%9E%8B%E6%9C%BA%E5%88%B6\">\u4e94\u3001Python&#xff1a;\u540c\u4e00\u6761\u7f1d&#xff0c;\u53e6\u4e00\u5957\u7c7b\u578b\u673a\u5236<\/h2>\n<p>\u00a0 \u00a0\u00a0 \u00a0Python \u6ca1\u6709 C&#043;&#043; \u90a3\u79cd\u5fc5\u987b\u7ee7\u627f\u624d\u80fd\u6ee1\u8db3\u63a5\u53e3\u7684\u8981\u6c42\u3002typing.Protocol \u505a\u7684\u662f\u7ed3\u6784\u5339\u914d&#xff1a;\u8c01\u6709\u7b26\u5408\u7b7e\u540d\u7684 read&#xff0c;\u8c01\u5c31\u80fd\u4f20\u7ed9 play\u3002\u9002\u914d\u5668\u5728\u8fd9\u91cc\u4f9d\u7136\u6709\u7528&#xff0c;\u56e0\u4e3a\u5bf9\u4e0d\u4e0a\u7684\u662f\u65b9\u6cd5\u540d\u548c\u5b57\u8282\u5e03\u5c40&#xff0c;\u4e0d\u662f\u201c\u7f3a\u4e00\u4e2a\u57fa\u7c7b\u201d\u3002<\/p>\n<p>\u00a0 \u00a0\u00a0 \u00a0\u6570\u636e\u4e0e C&#043;&#043; \u793a\u4f8b\u76f8\u540c\u3002\u5b8c\u6574\u811a\u672c\u662f examples\/frame_adapter.py&#xff0c;\u76f4\u63a5 python frame_adapter.py\u3002<\/p>\n<h3 id=\"5.1%20Protocol%20%E4%B8%8E%E5%AF%B9%E8%B1%A1%E9%80%82%E9%85%8D%E5%99%A8\">5.1 Protocol \u4e0e\u5bf9\u8c61\u9002\u914d\u5668<\/h3>\n<p>&#064;dataclass(frozen&#061;True)<br \/>\nclass Frame:<br \/>\n    width: int<br \/>\n    height: int<br \/>\n    rgba: bytes  # width * height * 4<\/p>\n<p>class FrameSource(Protocol):<br \/>\n    def read(self) -&gt; Optional[Frame]:<br \/>\n        &#8230;<\/p>\n<p>class CaptureCardAdapter:<br \/>\n    def __init__(self, sdk: CaptureCardSdk) -&gt; None:<br \/>\n        self._sdk &#061; sdk<\/p>\n<p>    def read(self) -&gt; Optional[Frame]:<br \/>\n        pulled &#061; self._sdk.pull_buffer()<br \/>\n        if pulled is None:<br \/>\n            return None<br \/>\n        rgb24, width, height &#061; pulled<br \/>\n        return rgb24_to_rgba(rgb24, width, height) <\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 CaptureCardAdapter \u6ca1\u6709\u7ee7\u627f\u4efb\u4f55\u5e27\u6e90\u57fa\u7c7b\u3002\u5b83\u6709 read&#xff0c;play(source: FrameSource) \u5c31\u63a5\u53d7\u5b83\u3002SDK \u8fd4\u56de None \u8868\u793a\u6ca1\u6709\u66f4\u591a\u5e27&#xff0c;\u9002\u914d\u5668\u4fdd\u6301\u8fd9\u4e2a\u7ea6\u5b9a&#xff0c;\u4e0d\u628a None \u7ffb\u8bd1\u6210\u7a7a Frame\u3002\u7a7a Frame \u548c\u201c\u6d41\u7ed3\u675f\u201d\u662f\u4e24\u4ef6\u4e0d\u540c\u7684\u4e8b\u3002<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 NetworkCamAdapter \u540c\u6837\u5305\u4f4f\u4e00\u4e2a\u5df2\u7ecf\u5b58\u5728\u7684 NetworkCamSdk\u3002\u5bf9\u8c61\u9002\u914d\u5668\u5728 Python \u91cc\u7684\u610f\u4e49\u548c C&#043;&#043; \u4e00\u6837&#xff1a;\u8bbe\u5907\u5f80\u5f80\u662f\u5148\u6253\u5f00\u7684&#xff0c;\u9002\u914d\u5668\u540e\u5305\u4e0a\u53bb\u3002<\/p>\n<h3 id=\"5.2%20%E7%B1%BB%E9%80%82%E9%85%8D%E5%99%A8%E5%8C%85%E4%B8%8D%E8%BF%9B%E7%8E%B0%E6%88%90%E5%AE%9E%E4%BE%8B\">5.2 \u7c7b\u9002\u914d\u5668\u5305\u4e0d\u8fdb\u73b0\u6210\u5b9e\u4f8b<\/h3>\n<p>class CaptureCardClassAdapter(CaptureCardSdk):<br \/>\n    def read(self) -&gt; Optional[Frame]:<br \/>\n        pulled &#061; self.pull_buffer()<br \/>\n        if pulled is None:<br \/>\n            return None<br \/>\n        rgb24, width, height &#061; pulled<br \/>\n        return rgb24_to_rgba(rgb24, width, height) <\/p>\n<p>\u00a0\u00a0\u00a0 \u00a0\u00a0 \u00a0\u8fd9\u6bb5\u80fd\u8dd1&#xff0c;play(CaptureCardClassAdapter(), &#8230;) \u7684\u9996\u50cf\u7d20\u540c\u6837\u662f (255, 0, 0, 255)\u3002\u5b83\u548c C&#043;&#043; \u79c1\u6709\u7ee7\u627f\u6709\u4e00\u5904\u91cd\u8981\u5dee\u522b&#xff1a;Python \u6ca1\u6709\u79c1\u6709\u7ee7\u627f&#xff0c;pull_buffer \u4ecd\u7136\u662f\u516c\u5f00\u65b9\u6cd5\u3002\u62ff\u5230\u7c7b\u9002\u914d\u5668\u7684\u4eba\u53ef\u4ee5\u76f4\u63a5\u8bfb RGB24&#xff0c;\u7ffb\u8bd1\u5c42\u5c31\u88ab\u7ed5\u5f00\u4e86\u3002<\/p>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u6240\u4ee5\u5728 Python \u91cc&#xff0c;\u53ea\u8981\u76ee\u6807\u662f\u201c\u5bf9\u5916\u53ea\u7559 read\u201d&#xff0c;\u5c31\u7528\u7ec4\u5408&#xff0c;\u628a SDK \u653e\u5728 self._sdk\u3002\u4e0b\u5212\u7ebf\u53ea\u662f\u7ea6\u5b9a&#xff0c;\u771f\u6b63\u9632\u6f0f\u63a5\u53e3\u7684\u529e\u6cd5\u662f\u4e0d\u628a\u88ab\u9002\u914d\u8005\u7684\u65b9\u6cd5\u8f6c\u53d1\u51fa\u53bb\u3002<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0\u4e0b\u9762\u8fd9\u79cd\u5199\u6cd5\u4f1a\u628a\u7f1d\u91cd\u65b0\u6495\u5f00&#xff1a;<\/p>\n<p>def __getattr__(self, name):<br \/>\n    return getattr(self._sdk, name) <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u64ad\u653e\u5668\u4e00\u65e6\u80fd\u901a\u8fc7\u9002\u914d\u5668\u6478\u5230 pull_buffer&#xff0c;\u540e\u9762\u7684\u4ee3\u7801\u5c31\u4f1a\u4f9d\u8d56\u5382\u5546\u7b7e\u540d\u3002\u9002\u914d\u5668\u8981\u663e\u5f0f\u5199\u51fa\u81ea\u5df1\u627f\u8bfa\u7684\u90a3\u51e0\u4e2a\u65b9\u6cd5\u3002<\/p>\n<h3 id=\"5.3%20%E4%B8%80%E4%B8%AA%E5%87%BD%E6%95%B0%E5%B0%B1%E5%86%99%E6%88%90%E9%97%AD%E5%8C%85\">5.3 \u4e00\u4e2a\u51fd\u6570\u5c31\u5199\u6210\u95ed\u5305<\/h3>\n<p>def adapt_network_cam(sdk: NetworkCamSdk) -&gt; Callable[[], Optional[Frame]]:<br \/>\n    def read() -&gt; Optional[Frame]:<br \/>\n        fetched &#061; sdk.fetch_gray()<br \/>\n        if fetched is None:<br \/>\n            return None<br \/>\n        gray, width, height &#061; fetched<br \/>\n        return gray_to_rgba(gray, width, height)<\/p>\n<p>    return read <\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u95ed\u5305\u6355\u83b7\u7684\u662f\u90a3\u53f0\u5df2\u7ecf\u6253\u5f00\u7684\u6444\u50cf\u673a&#xff0c;\u548c\u5bf9\u8c61\u9002\u914d\u5668\u6301\u6709 SDK \u662f\u540c\u4e00\u4ef6\u4e8b&#xff0c;\u53ea\u662f\u6ca1\u6709\u518d\u58f0\u660e\u4e00\u4e2a\u7c7b\u3002Target \u4ee5\u540e\u82e5\u8981\u52a0 stop()\u3001format()&#xff0c;\u518d\u6536\u6210\u7c7b\u4e0d\u8fdf\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u811a\u672c\u5b9e\u9645\u6253\u5370\u4e0e C&#043;&#043; \u7684\u524d\u4e09\u6bb5\u4e00\u81f4&#xff0c;\u95ed\u5305\u8def\u5f84\u7528\u65ad\u8a00\u68c0\u67e5\u9996\u50cf\u7d20&#xff0c;\u6587\u672c\u9002\u914d\u5668\u901a\u8fc7\u540e\u6253\u5370 ok&#xff1a;<\/p>\n<p>object adapter \/ capture<br \/>\n  2&#215;2 rgba0&#061;(255, 0, 0, 255)<br \/>\n  frames&#061;1 eof<br \/>\nobject adapter \/ network<br \/>\n  2&#215;2 rgba0&#061;(10, 10, 10, 255)<br \/>\n  frames&#061;1 eof<br \/>\nclass adapter \/ capture<br \/>\n  2&#215;2 rgba0&#061;(255, 0, 0, 255)<br \/>\n  frames&#061;1 eof<br \/>\nok <\/p>\n<h3 id=\"5.4%20%E6%A0%87%E5%87%86%E5%BA%93%E9%87%8C%E7%9A%84%E6%96%87%E6%9C%AC%E9%80%82%E9%85%8D%E5%99%A8\">5.4 \u6807\u51c6\u5e93\u91cc\u7684\u6587\u672c\u9002\u914d\u5668<\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0io.TextIOWrapper \u628a\u4e8c\u8fdb\u5236\u6d41\u7ffb\u8bd1\u6210 str \u7684\u6587\u4ef6\u63a5\u53e3&#xff0c;\u662f Python \u91cc\u5f88\u5178\u578b\u7684\u9002\u914d\u5668&#xff1a;\u5e95\u5c42\u7f13\u51b2\u7684 read \u8fd4\u56de bytes&#xff0c;\u5305\u88c5\u4e4b\u540e read \u8fd4\u56de str\u3002<\/p>\n<p>def demo_text_wrapper() -&gt; str:<br \/>\n    raw &#061; io.BytesIO(b&#034;hello\\\\n&#034;)<br \/>\n    text &#061; io.TextIOWrapper(raw, encoding&#061;&#034;utf-8&#034;)<br \/>\n    try:<br \/>\n        return text.read()<br \/>\n    finally:<br \/>\n        text.detach() <\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0\u8fd9\u91cc\u6709\u4e00\u4e2a\u548c C&#043;&#043; \u5f15\u7528\u751f\u547d\u671f\u540c\u7c7b\u7684\u95ee\u9898\u3002TextIOWrapper.close() \u9ed8\u8ba4\u4f1a\u628a\u5e95\u5c42\u4e8c\u8fdb\u5236\u6d41\u4e00\u8d77\u5173\u6389\u3002\u5e95\u5c42\u6d41\u7684\u4e3b\u4eba\u82e5\u662f\u8c03\u7528\u65b9&#xff0c;\u5c31\u5728\u7528\u5b8c\u6587\u672c\u63a5\u53e3\u4e4b\u540e detach()&#xff0c;\u628a\u6240\u6709\u6743\u8fd8\u56de\u53bb\u3002\u793a\u4f8b\u65ad\u8a00\u8fd4\u56de\u503c\u662f &#034;hello\\\\n&#034;\u3002<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0\u987a\u5e26\u4e00\u63d0&#xff1a;\u6807\u51c6\u5e93\u91cc\u540d\u5b57\u5e26 Adapter \u7684\u7c7b&#xff0c;\u4e0d\u4e00\u5b9a\u662f\u8fd9\u4e2a\u6a21\u5f0f\u3002logging.LoggerAdapter \u5728\u539f\u6709\u65e5\u5fd7\u63a5\u53e3\u4e0a\u9644\u52a0\u4e0a\u4e0b\u6587&#xff0c;\u63a5\u53e3\u672c\u8eab\u6ca1\u6709\u6362\u6210\u53e6\u4e00\u5957&#xff0c;\u5b83\u66f4\u63a5\u8fd1\u540e\u9762\u8981\u8bf4\u7684\u88c5\u9970\u5668\u3002\u770b\u7c7b\u505a\u4e86\u54ea\u4e00\u79cd\u7ffb\u8bd1&#xff0c;\u518d\u51b3\u5b9a\u5b83\u5c5e\u4e8e\u54ea\u4e00\u79cd\u7ed3\u6784\u3002<\/p>\n<h2 id=\"%E5%85%AD%E3%80%81%E7%BF%BB%E8%AF%91%E5%8F%AF%E4%BB%A5%E6%8E%A5%E6%88%90%E9%93%BE\">\u516d\u3001\u7ffb\u8bd1\u53ef\u4ee5\u63a5\u6210\u94fe<\/h2>\n<p>\u00a0 \u00a0 \u00a0 \u00a0\u6709\u65f6\u4e00\u6b21\u7ffb\u8bd1\u5230\u4e0d\u4e86\u64ad\u653e\u5668\u8981\u7684\u7ec8\u70b9\u3002\u91c7\u96c6\u5361\u7ed9\u51fa RGB24&#xff0c;\u7b97\u6cd5\u6a21\u5757\u8981 YUV&#xff0c;\u6e32\u67d3\u8981 RGBA\u3002\u53ef\u4ee5\u53e0\u4e24\u5c42\u9002\u914d\u5668&#xff0c;\u4f46\u6bcf\u4e00\u5c42\u7684 Target \u5fc5\u987b\u4e0d\u540c&#xff0c;\u800c\u4e14\u6bcf\u4e00\u5c42\u53ea\u505a\u4e00\u79cd\u5e03\u5c40\u8f6c\u6362\u3002<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"383\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004160914-6ac27a2a4b71e.png\" width=\"1380\" \/><\/p>\n<p style=\"text-align:center\"><span style=\"color:#555555\">\u56fe 5&#xff1a;<\/span><span style=\"color:#555555\">pullBuffer<\/span><span style=\"color:#555555\">\u00a0\u2192 <\/span><span style=\"color:#555555\">IYuvSource<\/span><span style=\"color:#555555\">\u00a0\u2192 <\/span><span style=\"color:#555555\">IFrameSource<\/span><span style=\"color:#555555\">&#xff0c;\u6bcf\u4e00\u8df3\u7684\u76ee\u6807\u63a5\u53e3\u90fd\u53d8\u4e86<\/span><\/p>\n<p>class IYuvSource {<br \/>\npublic:<br \/>\n    virtual ~IYuvSource() &#061; default;<br \/>\n    virtual bool read(YuvFrame&amp; out) &#061; 0;<br \/>\n};<\/p>\n<p>class RawToYuvAdapter : public IYuvSource {<br \/>\n    \/\/ \u6301\u6709 CaptureCardSdk&#xff0c;\u628a RGB24 \u8bd1\u6210 YUV<br \/>\n};<\/p>\n<p>class YuvToRgbaAdapter : public IFrameSource {<br \/>\npublic:<br \/>\n    explicit YuvToRgbaAdapter(IYuvSource&amp; yuv) : yuv_(yuv) {}<br \/>\n    bool read(Frame&amp; out) override;  \/\/ \u53ea\u8ba4\u8bc6 IYuvSource<br \/>\nprivate:<br \/>\n    IYuvSource&amp; yuv_;<br \/>\n}; <\/p>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u7b2c\u4e8c\u5c42\u4f9d\u8d56\u7684\u662f IYuvSource&#xff0c;\u4e0d\u4f9d\u8d56\u91c7\u96c6\u5361\u3002\u4ee5\u540e\u6587\u4ef6\u89e3\u590d\u7528\u5982\u679c\u4e5f\u80fd\u4ea7\u51fa IYuvSource&#xff0c;RGBA \u8fd9\u5c42\u9002\u914d\u5668\u53ef\u4ee5\u590d\u7528\u3002<\/p>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u82e5\u67d0\u4e00\u5c42\u7684\u5165\u53e3\u548c\u51fa\u53e3\u90fd\u662f IFrameSource&#xff0c;\u5b83\u5c31\u4e0d\u518d\u662f\u9002\u914d\u5668\u3002\u5728 read \u524d\u540e\u6253\u65f6\u95f4\u6233\u3001\u53e0\u52a0\u4e00\u9053\u6ee4\u955c&#xff0c;\u63a5\u53e3\u6ca1\u53d8&#xff0c;\u90a3\u662f\u88c5\u9970\u5668\u3002\u56fe 5 \u5e95\u90e8\u90a3\u53e5\u8bdd\u5c31\u662f\u8fd9\u6761\u5206\u754c\u3002<\/p>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u53cc\u5411\u9002\u914d\u5668\u2014\u2014\u4e00\u4e2a\u7c7b\u540c\u65f6\u628a A \u8bd1\u6210 B\u3001\u628a B \u8bd1\u6210 A\u2014\u2014\u5076\u5c14\u51fa\u73b0\u5728\u4e24\u5957\u90fd\u5df2\u53d1\u5e03\u3001\u8fd8\u5fc5\u987b\u4e92\u76f8\u8c03\u7528\u7684\u63a5\u53e3\u4e4b\u95f4\u3002\u5b83\u4f1a\u628a\u751f\u547d\u671f\u548c\u9519\u8bef\u7801\u62e7\u5728\u4e00\u8d77\u3002\u80fd\u62c6\u6210\u4e24\u4e2a\u5355\u5411\u9002\u914d\u5668\u65f6&#xff0c;\u6d4b\u8bd5\u548c\u7ef4\u62a4\u90fd\u66f4\u6e05\u695a\u3002<\/p>\n<h2 id=\"%E4%B8%83%E3%80%81%E6%A0%87%E5%87%86%E5%BA%93%E6%97%A9%E5%B0%B1%E5%9C%A8%E7%94%A8%E8%BF%99%E7%A7%8D%E7%BB%93%E6%9E%84\">\u4e03\u3001\u6807\u51c6\u5e93\u65e9\u5c31\u5728\u7528\u8fd9\u79cd\u7ed3\u6784<\/h2>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0C&#043;&#043; \u5bb9\u5668\u9002\u914d\u5668\u662f\u540c\u4e00\u7ed3\u6784\u7684\u4e00\u4e2a\u6781\u7b80\u5f62\u5f0f\u3002std::stack\u3001std::queue\u3001std::priority_queue \u4e0d\u81ea\u5df1\u7ba1\u7406\u4e00\u5757\u65b0\u7684\u5185\u5b58\u5e03\u5c40&#xff0c;\u5b83\u4eec\u6301\u6709\u4e00\u4e2a\u5e8f\u5217\u5bb9\u5668&#xff0c;\u5bf9\u5916\u7ed9\u51fa\u53e6\u4e00\u5957\u64cd\u4f5c\u3002\u4e0b\u9762\u662f stack \u7684\u7b80\u5316\u793a\u610f&#xff0c;\u4e0d\u662f\u6807\u51c6\u5e93\u539f\u6587&#xff1a;<\/p>\n<p>template &lt;typename T, typename Container &#061; std::deque&lt;T&gt;&gt;<br \/>\nclass Stack {<br \/>\npublic:<br \/>\n    void push(const T&amp; value) { data_.push_back(value); }<br \/>\n    void pop() { data_.pop_back(); }<br \/>\n    T&amp; top() { return data_.back(); }<br \/>\n    bool empty() const { return data_.empty(); }<\/p>\n<p>private:<br \/>\n    Container data_;<br \/>\n}; <\/p>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0deque \u4e24\u7aef\u90fd\u80fd\u63d2\u5165\u3002Stack \u628a\u8fd9\u5957\u63a5\u53e3\u6536\u6210\u53ea\u80fd\u4ece\u80cc\u7aef\u8fdb\u51fa\u3002\u4f7f\u7528\u65b9\u5199 push \/ pop \/ top&#xff0c;\u63a5\u89e6\u4e0d\u5230 push_front\u3002\u628a Container \u6362\u6210 std::vector&lt;T&gt;&#xff0c;\u7ffb\u8bd1\u5c42\u4e0d\u53d8&#xff0c;\u5e95\u5c42\u5bb9\u5668\u53ef\u4ee5\u6362\u3002\u8fd9\u5c31\u662f\u5bf9\u8c61\u9002\u914d\u5668&#xff1a;\u5bf9\u5916\u7684\u65b9\u6cd5\u96c6\u5408\u548c\u88ab\u9002\u914d\u8005\u4e0d\u540c&#xff0c;\u5185\u90e8\u7528\u7ec4\u5408\u8f6c\u53d1\u3002<\/p>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u8fed\u4ee3\u5668\u9002\u914d\u5668\u505a\u7684\u662f\u53e6\u4e00\u7c7b\u7ffb\u8bd1\u3002std::reverse_iterator \u628a\u201c\u5411\u524d\u201d\u8bd1\u6210\u201c\u5411\u540e\u201d&#xff0c;std::back_insert_iterator \u628a\u8d4b\u503c\u8bd1\u6210 push_back\u3002\u65e9\u671f\u7684 bind1st \u4e00\u7c7b\u51fd\u6570\u9002\u914d\u5668&#xff0c;\u73b0\u5728\u4e00\u822c\u7531 lambda \u548c std::bind \u627f\u62c5&#xff0c;\u4e5f\u5c31\u662f\u7b2c\u56db\u8282\u91cc playFrames \u90a3\u79cd\u5199\u6cd5\u3002<\/p>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0Python \u4fa7\u9664\u4e86 io.TextIOWrapper&#xff0c;socket.makefile() \u4e5f\u662f\u628a\u5957\u63a5\u5b57\u6536\u6210\u6587\u4ef6\u5bf9\u8c61\u3002\u8c03\u7528\u65b9\u968f\u540e\u6309\u6587\u4ef6\u63a5\u53e3\u8bfb&#xff0c;\u800c\u4e0d\u662f\u6309 recv \u7684\u7f13\u51b2\u533a\u7ea6\u5b9a\u8bfb\u3002<\/p>\n<h2 id=\"%E5%85%AB%E3%80%81%E5%90%8C%E6%A0%B7%E6%98%AF%E5%8C%85%E4%B8%80%E5%B1%82%EF%BC%8C%E9%97%AE%E6%8E%A5%E5%8F%A3%E5%8F%98%E4%BA%86%E6%B2%A1%E6%9C%89\">\u516b\u3001\u540c\u6837\u662f\u5305\u4e00\u5c42&#xff0c;\u95ee\u63a5\u53e3\u53d8\u4e86\u6ca1\u6709<\/h2>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u9002\u914d\u5668\u3001\u5916\u89c2\u3001\u6865\u63a5\u3001\u88c5\u9970\u5668\u3001\u4ee3\u7406&#xff0c;\u753b\u51fa\u6765\u90fd\u50cf\u201c\u5916\u9762\u591a\u4e86\u4e00\u4e2a\u7c7b\u201d\u3002\u5206\u5f00\u5b83\u4eec\u7684\u529e\u6cd5\u662f\u770b\u63a5\u53e3&#xff0c;\u4ee5\u53ca\u8fd9\u5c42\u662f\u8bbe\u8ba1\u4e4b\u521d\u5c31\u5728&#xff0c;\u8fd8\u662f\u4e8b\u540e\u8865\u4e0a\u7684\u3002<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"577\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004160914-6ac27a2a77ecc.png\" width=\"956\" \/><\/p>\n<p style=\"text-align:center\"><span style=\"color:#555555\">\u56fe 6&#xff1a;\u5de6\u53f3\u4e24\u8fb9\u7684\u7b7e\u540d\u76f8\u540c&#xff0c;\u5c31\u662f\u88c5\u9970\u5668\u6216\u4ee3\u7406&#xff1b;\u7b7e\u540d\u4e0d\u540c&#xff0c;\u624d\u662f\u9002\u914d\u5668\u3001\u5916\u89c2\u6216\u6865\u63a5<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"299\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004160914-6ac27a2aa0921.png\" width=\"752\" \/><\/p>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u6865\u63a5\u5bb9\u6613\u548c\u9002\u914d\u5668\u8bb0\u6df7&#xff0c;\u56e0\u4e3a\u4e24\u8005\u90fd\u7528\u7ec4\u5408\u3002\u5dee\u522b\u5728\u53d8\u5316\u4ece\u54ea\u6765\u3002<\/p>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u6865\u63a5\u9762\u5bf9\u7684\u662f\u4e24\u4e2a\u90fd\u4f1a\u589e\u957f\u7684\u5c42\u6b21\u3002\u64ad\u653e\u63a7\u5236\u4e00\u8fb9\u53ef\u80fd\u957f\u51fa\u500d\u901f\u3001\u9010\u5e27\u3001\u53ea\u89e3\u5173\u952e\u5e27&#xff1b;\u6e32\u67d3\u4e00\u8fb9\u53ef\u80fd\u957f\u51fa OpenGL\u3001Vulkan\u3001D3D\u3002\u8ba9\u201c\u500d\u901f\u64ad\u653e\u201d\u76f4\u63a5\u7ee7\u627f\u201cVulkan \u64ad\u653e\u5668\u201d&#xff0c;\u6bcf\u52a0\u4e00\u79cd\u753b\u6cd5\u5c31\u8981\u518d\u590d\u5236\u4e00\u5957\u63a7\u5236\u903b\u8f91\u3002\u6865\u63a5\u7684\u505a\u6cd5\u662f\u64ad\u653e\u62bd\u8c61\u6301\u6709\u6e32\u67d3\u5b9e\u73b0\u63a5\u53e3&#xff0c;\u4e24\u4e2a\u5c42\u6b21\u5404\u81ea\u6d3e\u751f&#xff0c;\u7528\u7ec4\u5408\u8fde\u4e0a\u3002\u8fd9\u662f\u642d\u7ed3\u6784\u7684\u65f6\u5019\u5c31\u51b3\u5b9a\u7684\u3002<\/p>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u9002\u914d\u5668\u9762\u5bf9\u7684\u662f\u4e00\u5757\u5df2\u7ecf\u5b58\u5728\u3001\u7b7e\u540d\u4e0d\u5408\u7684\u4ee3\u7801\u3002\u7b2c\u4e09\u65b9 GL \u5c01\u88c5\u7684\u51fd\u6570\u540d\u548c\u4f60\u7684\u6e32\u67d3\u5b9e\u73b0\u63a5\u53e3\u4e0d\u4e00\u81f4\u65f6&#xff0c;\u518d\u5199\u4e00\u4e2a\u9002\u914d\u5668\u628a\u5b83\u63a5\u8fdb\u6865\u7684\u5b9e\u73b0\u7aef\u3002\u6865\u63a5\u8d1f\u8d23\u4e24\u8fb9\u80fd\u72ec\u7acb\u6269\u5c55&#xff0c;\u9002\u914d\u5668\u8d1f\u8d23\u67d0\u4e00\u7aef\u7684\u5177\u4f53\u7c7b\u80fd\u63d2\u8fdb\u5df2\u7ecf\u5b9a\u4e0b\u6765\u7684\u63a5\u53e3\u3002<\/p>\n<h2 id=\"%E4%B9%9D%E3%80%81%E6%94%BE%E5%9C%A8%E6%92%AD%E6%94%BE%E9%93%BE%E8%B7%AF%E4%B8%8A\">\u4e5d\u3001\u653e\u5728\u64ad\u653e\u94fe\u8def\u4e0a<\/h2>\n<p>\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u9002\u914d\u5668\u503c\u5f97\u5199&#xff0c;\u901a\u5e38\u662f\u56e0\u4e3a\u8fb9\u754c\u4e0d\u5c5e\u4e8e\u4f60&#xff0c;\u6216\u8005\u5df2\u7ecf\u53d1\u5e03\u3001\u4e0d\u80fd\u6539\u7b7e\u540d&#xff1a;\u5382\u5546\u91c7\u96c6 SDK\u3001\u53e6\u4e00\u7ec4\u4eba\u51bb\u7ed3\u7684\u5e27\u63a5\u53e3\u3001\u6807\u51c6\u5e93\u7684\u6d41\u7c7b\u578b\u3002\u5ba2\u6237\u7aef\u63a5\u53e3\u5df2\u7ecf\u7a33\u5b9a&#xff0c;\u800c\u4e14\u540e\u9762\u8fd8\u4f1a\u63a5\u7b2c\u4e8c\u5bb6\u3001\u7b2c\u4e09\u5bb6\u5b9e\u73b0\u3002<\/p>\n<p>\u4e0b\u9762\u8fd9\u4e9b\u60c5\u51b5&#xff0c;\u52a0\u9002\u914d\u5668\u53ea\u4f1a\u591a\u4e00\u5c42\u8df3\u8f6c&#xff1a;<\/p>\n<ul>\n<li>\u63a5\u53e3\u548c\u5b9e\u73b0\u90fd\u5728\u540c\u4e00\u4e2a\u4ed3\u5e93&#xff0c;\u8c03\u7528\u65b9\u4e5f\u662f\u4f60\u81ea\u5df1\u3002\u76f4\u63a5\u6539\u7b7e\u540d&#xff0c;\u8ba9\u751f\u4ea7\u8005\u6309 IFrameSource \u8f93\u51fa\u3002<\/li>\n<li>\u5dee\u5f02\u5df2\u7ecf\u4e0d\u662f\u5e03\u5c40&#xff0c;\u800c\u662f\u542b\u4e49\u3002SDK \u7ed9\u51fa\u7f16\u7801\u5305&#xff0c;\u64ad\u653e\u5668\u8981\u50cf\u7d20\u3002\u89e3\u7801\u3001\u7f13\u51b2\u548c\u7ebf\u7a0b\u6a21\u578b\u5355\u72ec\u6210\u6a21\u5757&#xff0c;\u9002\u914d\u5668\u6700\u591a\u7ad9\u5728\u89e3\u7801\u5668\u51fa\u53e3&#xff0c;\u628a AVFrame \u6216\u5382\u5546\u5e27\u8bd1\u6210\u4f60\u7684 Frame\u3002<\/li>\n<li>\u9002\u914d\u5668\u91cc\u51fa\u73b0\u91cd\u8fde\u3001\u5e27\u961f\u5217\u3001\u97f3\u89c6\u9891\u540c\u6b65\u3002\u90a3\u662f\u8fde\u63a5\u7ba1\u7406\u548c\u7f13\u51b2\u7ec4\u4ef6&#xff0c;\u5b83\u4eec\u53ef\u4ee5\u4f9d\u8d56\u00a0\u00a0IFrameSource&#xff0c;\u4e0d\u5fc5\u4f2a\u88c5\u6210\u7ffb\u8bd1\u5c42\u3002<\/li>\n<li>\u8272\u5f69\u8f6c\u6362\u5df2\u7ecf\u662f\u4e00\u6574\u6761\u7ba1\u7ebf&#xff1a;10bit\u3001HDR\u3001\u786c\u4ef6\u8272\u5f69\u7a7a\u95f4\u3002RGB24 \u8865 Alpha \u53ef\u4ee5\u7559\u5728\u9002\u914d\u5668\u8c03\u7528\u7684\u7eaf\u51fd\u6570\u91cc&#xff1b;\u5927\u7ba1\u7ebf\u5355\u72ec\u6d4b\u8bd5&#xff0c;\u9002\u914d\u5668\u53ea\u8c03\u7528\u5b83\u3002<\/li>\n<\/ul>\n<p>\u4e00\u6761\u6bd4\u8f83\u7a33\u7684\u64ad\u653e\u94fe\u8def\u662f&#xff1a;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u5382\u5546 SDK \u2192 \u9002\u914d\u5668&#xff08;\u5f97\u5230\u7edf\u4e00\u7684 &#096;Frame&#096; \/ \u5305&#xff09;\u2192 \u961f\u5217\u4e0e\u65f6\u949f \u2192 \u89e3\u7801\u6216\u6e32\u67d3 \u2192 \u88c5\u9970\u5668&#xff08;\u6253\u70b9\u3001\u5b57\u5e55&#xff09;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Qt \u5de5\u7a0b\u91cc&#xff0c;\u8fd9\u6761\u7f1d\u51fa\u73b0\u5728\u5382\u5546\u91c7\u96c6\u548c\u4f60\u81ea\u5df1\u7684\u89c6\u9891\u6e90\u4e4b\u95f4\u3002\u9002\u914d\u5668\u5b9e\u73b0\u4f60\u7684\u5e27\u6e90\u63a5\u53e3&#xff0c;\u5185\u90e8\u8c03\u7528 SDK\u3002\u754c\u9762\u5237\u65b0\u3001\u6ee4\u955c\u94fe\u3001\u500d\u901f\u64ad\u653e\u4e0d\u8981\u5199\u8fdb\u8fd9\u4e2a\u7c7b\u3002FFmpeg \u5de5\u7a0b\u91cc&#xff0c;<span style=\"color:#333333\">data<\/span>\u3001<span style=\"color:#333333\">linesize<\/span>\u3001<span style=\"color:#333333\">format<\/span>\u3001<span style=\"color:#333333\">pts<\/span>\u00a0\u8fd9\u4e9b\u5b57\u6bb5\u7684\u5bf9\u5e94\u5c5e\u4e8e\u9002\u914d&#xff1b;<span style=\"color:#333333\">avcodec_send_packet<\/span>\u00a0\/ <span style=\"color:#333333\">avcodec_receive_frame<\/span>\u00a0\u90a3\u4e00\u6bb5\u662f\u89e3\u7801\u6d41\u7a0b&#xff0c;\u5b9c\u653e\u5728\u89e3\u7801\u5668\u91cc&#xff0c;\u7531\u5b83\u5728\u51fa\u53e3\u5904\u8c03\u7528\u4e00\u4e2a\u5f88\u8584\u7684\u5e27\u9002\u914d\u3002<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u603b\u4e4b&#xff0c;\u4e0d\u8fc7\u662fC&#043;&#043;\u00a0\u8fd8\u662fPython&#xff1a;\u8c01\u521b\u5efa\u88ab\u9002\u914d\u8005&#xff0c;\u8c01\u5c31\u8981\u8bf4\u6e05\u695a\u8c01\u6700\u540e\u9500\u6bc1\u5b83\u3002\u9002\u914d\u5668\u6301\u6709\u5f15\u7528\u6216\u88f8\u6307\u9488\u65f6&#xff0c;\u8c03\u7528\u65b9\u4fdd\u8bc1 SDK \u6d3b\u5f97\u66f4\u4e45&#xff1b;\u9002\u914d\u5668\u6301\u6709 unique_ptr \u65f6&#xff0c;\u8bbe\u5907\u968f\u9002\u914d\u5668\u4e00\u8d77\u91ca\u653e\u3002Python \u7684 TextIOWrapper.detach() \u662f\u540c\u4e00\u7ea6\u5b9a\u7684\u5e93\u51fd\u6570\u7248\u672c\u3002<\/p>\n<h2 id=\"%E5%8D%81%E3%80%81%E6%80%BB%E7%BB%93\">\u5341\u3001\u603b\u7ed3<\/h2>\n<p>(1). \u9002\u914d\u5668\u7ffb\u8bd1\u7684\u662f\u63a5\u53e3&#xff1a;\u65b9\u6cd5\u540d\u3001\u53c2\u6570\u3001\u6570\u636e\u5e03\u5c40\u3001\u9519\u8bef\u7801\u3002\u5b83\u4e0d\u8d1f\u8d23\u628a\u4e00\u79cd\u4e1a\u52a1\u80fd\u529b\u53d8\u6210\u53e6\u4e00\u79cd\u3002<\/p>\n<p>(2). \u9ed8\u8ba4\u5199\u5bf9\u8c61\u9002\u914d\u5668&#xff0c;\u7528\u7ec4\u5408\u5305\u4f4f\u5df2\u7ecf\u5b58\u5728\u7684\u5b9e\u4f8b\u3002C&#043;&#043; \u7684\u7c7b\u9002\u914d\u5668\u5373\u4f7f\u7528\u79c1\u6709\u7ee7\u627f&#xff0c;\u4e5f\u5305\u4e0d\u8fdb\u4e00\u53f0\u5df2\u7ecf\u6253\u5f00\u7684\u8bbe\u5907&#xff1b;Python \u7684\u5b50\u7c7b\u8fd8\u4f1a\u628a SDK \u65b9\u6cd5\u9732\u5728\u5916\u9762\u3002<\/p>\n<p>(3). Target \u53ea\u6709\u4e00\u4e2a\u51fd\u6570\u65f6&#xff0c;C&#043;&#043; \u53ef\u4ee5\u7528 lambda \/ std::function&#xff0c;Python \u53ef\u4ee5\u7528\u95ed\u5305\u3002\u65b9\u6cd5\u53d8\u591a\u3001\u9700\u8981\u591a\u6001\u5bb9\u5668\u65f6&#xff0c;\u518d\u6536\u6210\u7c7b\u3002<\/p>\n<p>(4). \u9002\u914d\u5668\u53ef\u4ee5\u53e0&#xff0c;\u6bcf\u4e00\u5c42\u7684\u76ee\u6807\u63a5\u53e3\u8981\u4e0d\u540c\u3002\u63a5\u53e3\u6ca1\u53d8\u7684\u90a3\u4e00\u5c42&#xff0c;\u662f\u88c5\u9970\u5668\u6216\u4ee3\u7406\u3002<\/p>\n<p>(5). \u64ad\u653e\u5668\u53ea\u4f9d\u8d56 Target\u3002\u8bbe\u5907\u5dee\u5f02\u7559\u5728\u9002\u914d\u5668\u91cc&#xff0c;\u6d4b\u8bd5\u7528\u5047\u7684 IFrameSource \u5c31\u80fd\u628a\u64ad\u653e\u5faa\u73af\u8dd1\u8d77\u6765\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u5f55<br \/>\n\u524d\u8a00\u00a0 \u00a0 \u00a0 \u00a0\u00a0<br \/>\n\u4e00\u3001\u7f1d\u5728\u63a5\u53e3\u4e0a<br \/>\n\u4e8c\u3001\u56db\u4e2a\u89d2\u8272<br \/>\n\u4e09\u3001\u5bf9\u8c61\u9002\u914d\u5668\u4e0e\u7c7b\u9002\u914d\u5668<br \/>\n\u56db\u3001C&#xff1a;\u628a\u4e24\u5bb6 SDK \u6536\u6210\u540c\u4e00\u79cd\u5e27\u6e90<br \/>\n4.1 Target&#xff1a;\u64ad\u653e\u5668\u552f\u4e00\u8ba4\u8bc6\u7684\u7c7b\u578b<br \/>\n4.2 Adaptee&#xff1a;\u5047\u5b9a\u6539\u4e0d\u4e86\u7684 SDK<br \/>\n4.3 \u5bf9\u8c61\u9002\u914d\u5668<br \/>\n4.4 \u64ad\u653e\u5668\u53ea\u8ba4\u63a5\u53e3<br \/>\n4.5 \u7c7b\u9002\u914d\u5668\u5bf9\u7167<br \/>\n4.6 \u8dd1\u51fa\u6765\u7684\u7ed3\u679c<br \/>\n\u4e94\u3001Python&#xff1a;\u540c\u4e00\u6761\u7f1d&#xff0c;\u53e6\u4e00\u5957\u7c7b\u578b\u673a\u5236<br \/>\n5.1 Protocol \u4e0e\u5bf9\u8c61\u9002\u914d\u5668<\/p>\n","protected":false},"author":2,"featured_media":112806,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[190,4506],"topic":[],"class_list":["post-112816","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-190","tag-4506"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u9002\u914d\u5668\u6a21\u5f0f\u8be6\u89e3 - \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\/112816.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u9002\u914d\u5668\u6a21\u5f0f\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u76ee\u5f55 \u524d\u8a00\u00a0 \u00a0 \u00a0 \u00a0\u00a0 \u4e00\u3001\u7f1d\u5728\u63a5\u53e3\u4e0a \u4e8c\u3001\u56db\u4e2a\u89d2\u8272 \u4e09\u3001\u5bf9\u8c61\u9002\u914d\u5668\u4e0e\u7c7b\u9002\u914d\u5668 \u56db\u3001C&#xff1a;\u628a\u4e24\u5bb6 SDK \u6536\u6210\u540c\u4e00\u79cd\u5e27\u6e90 4.1 Target&#xff1a;\u64ad\u653e\u5668\u552f\u4e00\u8ba4\u8bc6\u7684\u7c7b\u578b 4.2 Adaptee&#xff1a;\u5047\u5b9a\u6539\u4e0d\u4e86\u7684 SDK 4.3 \u5bf9\u8c61\u9002\u914d\u5668 4.4 \u64ad\u653e\u5668\u53ea\u8ba4\u63a5\u53e3 4.5 \u7c7b\u9002\u914d\u5668\u5bf9\u7167 4.6 \u8dd1\u51fa\u6765\u7684\u7ed3\u679c \u4e94\u3001Python&#xff1a;\u540c\u4e00\u6761\u7f1d&#xff0c;\u53e6\u4e00\u5957\u7c7b\u578b\u673a\u5236 5.1 Protocol \u4e0e\u5bf9\u8c61\u9002\u914d\u5668\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/112816.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-04T16:09:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004160913-6ac27a2978929.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=\"8 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/112816.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/112816.html\",\"name\":\"\u9002\u914d\u5668\u6a21\u5f0f\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-04T16:09:15+00:00\",\"dateModified\":\"2026-10-04T16:09:15+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/112816.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/112816.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/112816.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u9002\u914d\u5668\u6a21\u5f0f\u8be6\u89e3\"}]},{\"@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":"\u9002\u914d\u5668\u6a21\u5f0f\u8be6\u89e3 - \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\/112816.html","og_locale":"zh_CN","og_type":"article","og_title":"\u9002\u914d\u5668\u6a21\u5f0f\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u76ee\u5f55 \u524d\u8a00\u00a0 \u00a0 \u00a0 \u00a0\u00a0 \u4e00\u3001\u7f1d\u5728\u63a5\u53e3\u4e0a \u4e8c\u3001\u56db\u4e2a\u89d2\u8272 \u4e09\u3001\u5bf9\u8c61\u9002\u914d\u5668\u4e0e\u7c7b\u9002\u914d\u5668 \u56db\u3001C&#xff1a;\u628a\u4e24\u5bb6 SDK \u6536\u6210\u540c\u4e00\u79cd\u5e27\u6e90 4.1 Target&#xff1a;\u64ad\u653e\u5668\u552f\u4e00\u8ba4\u8bc6\u7684\u7c7b\u578b 4.2 Adaptee&#xff1a;\u5047\u5b9a\u6539\u4e0d\u4e86\u7684 SDK 4.3 \u5bf9\u8c61\u9002\u914d\u5668 4.4 \u64ad\u653e\u5668\u53ea\u8ba4\u63a5\u53e3 4.5 \u7c7b\u9002\u914d\u5668\u5bf9\u7167 4.6 \u8dd1\u51fa\u6765\u7684\u7ed3\u679c \u4e94\u3001Python&#xff1a;\u540c\u4e00\u6761\u7f1d&#xff0c;\u53e6\u4e00\u5957\u7c7b\u578b\u673a\u5236 5.1 Protocol \u4e0e\u5bf9\u8c61\u9002\u914d\u5668","og_url":"https:\/\/www.wsisp.com\/helps\/112816.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-04T16:09:15+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004160913-6ac27a2978929.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"8 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/112816.html","url":"https:\/\/www.wsisp.com\/helps\/112816.html","name":"\u9002\u914d\u5668\u6a21\u5f0f\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-04T16:09:15+00:00","dateModified":"2026-10-04T16:09:15+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/112816.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/112816.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/112816.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u9002\u914d\u5668\u6a21\u5f0f\u8be6\u89e3"}]},{"@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\/112816","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=112816"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/112816\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/112806"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=112816"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=112816"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=112816"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=112816"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}