RenderScript 入出力関数
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
概要
これらの関数は、以下の目的で使用します。
- Java クライアントに情報を送信する。
- 処理された割り当てを送信するか、処理する次の割り当てを受信します。
まとめ
関数
rsAllocationIoReceive
: キューから新しいコンテンツを受け取る
キューから新しいコンテンツ セットを受け取ります。
この関数は、カーネル内から呼び出すことや、カーネルから直接的または間接的に呼び出される関数から呼び出すことはできません。そのようにすると、ランタイム エラーが発生します。
rsAllocationIoSend
: 新しいコンテンツをキューに送信する
割り当ての内容をキューに送信します。
この関数は、カーネル内から呼び出すことや、カーネルから直接的または間接的に呼び出される関数から呼び出すことはできません。そのようにすると、ランタイム エラーが発生します。
bool rsSendToClient(int cmdID);
|
|
bool rsSendToClient(int cmdID, const void* data, uint len);
|
|
パラメータ
コマンド ID | |
data | アプリケーション固有のデータ。 |
長尺 | データの長さ(バイト単位)。 |
クライアントにメッセージを送信します。この呼び出しはブロックを実行しません。
メッセージが送信された場合は true が返され、メッセージ キューがいっぱいの場合は false が返されます。
メッセージ ID は必須です。データ ペイロードは省略可能です。
RenderScript.RSMessageHandler をご覧ください。
void rsSendToClientBlocking(int cmdID);
|
|
void rsSendToClientBlocking(int cmdID, const void* data, uint len);
|
|
パラメータ
コマンド ID | |
data | アプリケーション固有のデータ。 |
長尺 | データの長さ(バイト単位)。 |
クライアントにメッセージを送信します。この関数は、メッセージ キューにこのメッセージ用の空きがあるまでブロックします。
この関数は、メッセージが配信され、クライアントによって処理される前に返される場合があります。
メッセージ ID は必須です。データ ペイロードは省略可能です。
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)."]]