פונקציות קלט/פלט של RenderScript
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
סקירה כללית
הפונקציות האלה משמשות כדי:
- שולחים מידע ללקוח Java, וגם
- שולחים את ההקצאה שעברה עיבוד או מקבלים את ההקצאה הבאה לעיבוד.
סיכום
פונקציות
rsAllocationIoReceive
: קבלת תוכן חדש מהתור
קבלת קבוצה חדשה של תכנים מהתור.
אסור להפעיל את הפונקציה הזו מתוך ליבה, או מכל פונקציה שעשויה להפעיל אותה ישירות או בעקיפין מליבה. הפעולה הזו תגרום לשגיאה בזמן הריצה.
rsAllocationIoSend
: שליחת תוכן חדש לתור
שולחים את התוכן של ההקצאה לתור.
אסור להפעיל את הפונקציה הזו מתוך ליבה, או מכל פונקציה שעשויה להפעיל אותה ישירות או בעקיפין מליבה. הפעולה הזו תגרום לשגיאה בזמן הריצה.
bool rsSendToClient(int cmdID);
|
|
bool rsSendToClient(int cmdID, const void* data, uint len);
|
|
פרמטרים
cmdID | |
נתונים | נתונים ספציפיים לאפליקציה. |
len | אורך הנתונים, בבייטים. |
שליחת הודעה חזרה ללקוח. השיחה הזו לא חסומה.
הפונקציה מחזירה את הערך true אם ההודעה נשלחה, ו-false אם תור ההודעות מלא.
חובה להזין מזהה הודעה. עומס הנתונים הוא אופציונלי.
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)."]]