Fungsi Input/Output RenderScript
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Ringkasan
Fungsi-fungsi ini digunakan untuk:
- Mengirim informasi ke klien Java, dan
- Kirim alokasi yang diproses atau terima alokasi berikutnya untuk diproses.
Ringkasan
Fungsi
rsAllocationIoReceive
: Menerima konten baru dari antrean
Parameter
CANNOT TRANSLATE | Alokasi untuk mengerjakan. |
Menerima kumpulan konten baru dari antrean.
Fungsi ini tidak boleh dipanggil dari dalam kernel, atau dari fungsi apa pun
yang dapat dipanggil langsung atau tidak langsung dari kernel. Tindakan ini akan menyebabkan
error runtime.
rsAllocationIoSend
: Mengirim konten baru ke antrean
Parameter
CANNOT TRANSLATE | Alokasi untuk mengerjakan. |
Kirim konten Alokasi ke antrean.
Fungsi ini tidak boleh dipanggil dari dalam kernel, atau dari fungsi apa pun
yang dapat dipanggil langsung atau tidak langsung dari kernel. Tindakan ini akan menyebabkan
error runtime.
{i>bool rsSendToClient<i}(int cmdID);
|
|
bool rsSendToClient(int cmdID, const void* data, uint len);
|
|
Parameter
{i>cmdID<i} | |
data | Data khusus aplikasi. |
len | Panjang data, dalam byte. |
Mengirim pesan kembali ke klien. Panggilan ini tidak diblokir.
Atribut ini menampilkan nilai true (benar) jika pesan telah dikirim dan false (salah) jika antrean pesan penuh.
ID pesan wajib diisi. Payload data bersifat opsional.
Lihat RenderScript.RSMessageHandler.
void rsSendToClientBlocking(int cmdID);
|
|
void rsSendToClientBlocking(int cmdID, const void* data, uint len);
|
|
Parameter
{i>cmdID<i} | |
data | Data khusus aplikasi. |
len | Panjang data, dalam byte. |
Mengirim pesan kembali ke klien. Fungsi ini akan melakukan pemblokiran hingga ada ruang pada antrean pesan untuk pesan ini.
Fungsi ini dapat ditampilkan sebelum pesan dikirim dan diproses oleh klien.
ID pesan wajib diisi. Payload data bersifat opsional.
Lihat RenderScript.RSMessageHandler.
Konten dan contoh kode di halaman ini tunduk kepada lisensi yang dijelaskan dalam Lisensi Konten. Java dan OpenJDK adalah merek dagang atau merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-27 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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)."]]