ฟังก์ชันอินพุต/เอาต์พุตของ RenderScript
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ภาพรวม
ฟังก์ชันเหล่านี้มีไว้เพื่อดำเนินการต่อไปนี้
- ส่งข้อมูลไปยังไคลเอ็นต์ Java และ
- ส่งการจัดสรรที่ประมวลผลแล้วหรือรับการจัดสรรถัดไปเพื่อประมวลผล
สรุป
ฟังก์ชัน
rsAllocationIoReceive
: รับเนื้อหาใหม่จากคิว
รับชุดเนื้อหาใหม่จากคิว
ไม่ควรเรียกใช้ฟังก์ชันนี้จากภายในเคอร์เนล หรือจากฟังก์ชันใดๆ ที่อาจเรียกใช้จากเคอร์เนลโดยตรงหรือโดยอ้อม เนื่องจากจะทำให้เกิดข้อผิดพลาดรันไทม์
rsAllocationIoSend
: ส่งเนื้อหาใหม่ไปยังคิว
ส่งเนื้อหาของการแบ่งไปยังคิว
ไม่ควรเรียกใช้ฟังก์ชันนี้จากภายในเคอร์เนล หรือจากฟังก์ชันใดๆ ที่อาจเรียกใช้จากเคอร์เนลโดยตรงหรือโดยอ้อม เนื่องจากจะทำให้เกิดข้อผิดพลาดรันไทม์
bool rsSendToClient(int cmdID);
|
|
bool rsSendToClient(int cmdID, const void* data, uint len);
|
|
พารามิเตอร์
cmdID | |
ข้อมูล | ข้อมูลเฉพาะแอปพลิเคชัน |
len | ความยาวของข้อมูลเป็นไบต์ |
ส่งข้อความกลับไปยังไคลเอ็นต์ การโทรนี้ไม่บล็อก
โดยจะแสดงผลเป็น "จริง" หากข้อความถูกส่ง และแสดงผลเป็น "เท็จ" หากคิวข้อความเต็ม
ต้องระบุรหัสข้อความ คุณจะระบุเพย์โหลดข้อมูลหรือไม่ก็ได้
โปรดดู RenderScript.RSMessageHandler
void rsSendToClientBlocking(int cmdID);
|
|
void rsSendToClientBlocking(int cmdID, const void* data, uint len);
|
|
พารามิเตอร์
cmdID | |
ข้อมูล | ข้อมูลเฉพาะแอปพลิเคชัน |
len | ความยาวของข้อมูลเป็นไบต์ |
ส่งข้อความกลับไปยังไคลเอ็นต์ ฟังก์ชันนี้จะบล็อกจนกว่าจะมีที่ว่างสำหรับข้อความนี้ในคิวข้อความ
ฟังก์ชันนี้อาจแสดงผลก่อนที่ไคลเอ็นต์จะส่งและประมวลผลข้อความ
ต้องระบุรหัสข้อความ คุณจะระบุเพย์โหลดข้อมูลหรือไม่ก็ได้
โปรดดู RenderScript.RSMessageHandler
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-27 UTC"],[],[],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)."]]