RenderScript 输入/输出函数
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
概览
这些函数用于:
- 将信息发送到 Java 客户端,以及
- 发送已处理的分配或接收下一个要处理的分配。
总结
函数
rsAllocationIoReceive
:从队列中接收新内容
从队列中接收一组新内容。
此函数不应从内核内部调用,也不应从可能直接或间接从内核调用的函数调用。这样做会导致运行时错误。
rsAllocationIoSend
:将新内容发送到队列
将 Allocation 的内容发送到队列。
此函数不应从内核内部调用,也不应从可能直接或间接从内核调用的函数调用。这样做会导致运行时错误。
bool rsSendToClient(int cmdID);
|
|
bool rsSendToClient(int cmdID, const void* data, uint len);
|
|
参数
cmdID | |
data | 应用专属数据。 |
智能镜头 | 数据的长度(以字节为单位)。 |
void rsSendToClientBlocking(int cmdID);
|
|
void rsSendToClientBlocking(int cmdID, const void* data, uint len);
|
|
参数
cmdID | |
data | 应用专属数据。 |
智能镜头 | 数据的长度(以字节为单位)。 |
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# RenderScript Input/Output Functions\n\nOverview\n--------\n\nThese functions are used to:\n\n- Send information to the Java client, and\n- Send the processed allocation or receive the next allocation to process.\n\n\u003cbr /\u003e\n\nSummary\n-------\n\n| Functions ||\n|--------------------------------------------------------------------------------------------------------|--------------------------------------------|\n| [rsAllocationIoReceive](/guide/topics/renderscript/reference/rs_io#android_rs:rsAllocationIoReceive) | Receive new content from the queue |\n| [rsAllocationIoSend](/guide/topics/renderscript/reference/rs_io#android_rs:rsAllocationIoSend) | Send new content to the queue |\n| [rsSendToClient](/guide/topics/renderscript/reference/rs_io#android_rs:rsSendToClient) | Send a message to the client, non-blocking |\n| [rsSendToClientBlocking](/guide/topics/renderscript/reference/rs_io#android_rs:rsSendToClientBlocking) | Send a message to the client, blocking |\n\nFunctions\n---------\n\n#### rsAllocationIoReceive\n: Receive new content from the queue\n\n|-------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------|\n| void rsAllocationIoReceive([rs_allocation](/guide/topics/renderscript/reference/rs_object_types#android_rs:rs_allocation) a); | Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) |\n\n##### Parameters\n\n| a | Allocation to work on. |\n|---|------------------------|\n\nReceive a new set of contents from the queue.\n\nThis function should not be called from inside a kernel, or from any function\nthat may be called directly or indirectly from a kernel. Doing so would cause a\nruntime error. \n\n#### rsAllocationIoSend\n: Send new content to the queue\n\n|----------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------|\n| void rsAllocationIoSend([rs_allocation](/guide/topics/renderscript/reference/rs_object_types#android_rs:rs_allocation) a); | Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) |\n\n##### Parameters\n\n| a | Allocation to work on. |\n|---|------------------------|\n\nSend the contents of the Allocation to the queue.\n\nThis function should not be called from inside a kernel, or from any function\nthat may be called directly or indirectly from a kernel. Doing so would cause a\nruntime error. \n\n#### rsSendToClient\n: Send a message to the client, non-blocking\n\n|-------------------------------------------------------------------------------------------------------------------------------------|---|\n| bool rsSendToClient(int cmdID); | |\n| bool rsSendToClient(int cmdID, const void\\* data, [uint](/guide/topics/renderscript/reference/rs_value_types#android_rs:uint) len); | |\n\n##### Parameters\n\n| cmdID | |\n| data | Application specific data. |\n| len | Length of the data, in bytes. |\n|-------|-------------------------------|\n\nSends a message back to the client. This call does not block.\nIt returns true if the message was sent and false if the\nmessage queue is full.\n\nA message ID is required. The data payload is optional.\n\nSee [RenderScript.RSMessageHandler](https://developer.android.com/reference/android/renderscript/RenderScript.RSMessageHandler.html). \n\n#### rsSendToClientBlocking\n: Send a message to the client, blocking\n\n|---------------------------------------------------------------------------------------------------------------------------------------------|---|\n| void rsSendToClientBlocking(int cmdID); | |\n| void rsSendToClientBlocking(int cmdID, const void\\* data, [uint](/guide/topics/renderscript/reference/rs_value_types#android_rs:uint) len); | |\n\n##### Parameters\n\n| cmdID | |\n| data | Application specific data. |\n| len | Length of the data, in bytes. |\n|-------|-------------------------------|\n\nSends a message back to the client. This function will block\nuntil there is room on the message queue for this message.\nThis function may return before the message was delivered and\nprocessed by the client.\n\nA message ID is required. The data payload is optional.\n\nSee [RenderScript.RSMessageHandler](https://developer.android.com/reference/android/renderscript/RenderScript.RSMessageHandler.html)."]]