Sortix nightly manual
This manual documents Sortix nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.
CURLOPT_INTERLEAVEFUNCTION(3) | Library Functions Manual | CURLOPT_INTERLEAVEFUNCTION(3) |
NAME
CURLOPT_INTERLEAVEFUNCTION - callback for RTSP interleaved dataSYNOPSIS
#include <curl/curl.h>
size_t interleave_callback(void *ptr, size_t size, size_t nmemb,
void *userdata);
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_INTERLEAVEFUNCTION,
interleave_callback);
DESCRIPTION
Pass a pointer to your callback function, which should match the prototype shown above.DEFAULT
NULL, the interleave data is then passed to the regular write function: CURLOPT_WRITEFUNCTION(3).PROTOCOLS
This functionality affects rtsp onlyEXAMPLE
struct local {
void *custom;
};
static size_t rtp_write(void *ptr, size_t size, size_t nmemb, void *userp)
{
struct local *l = userp;
printf("our ptr: %p\n", l->custom);
/* take care of the packet in 'ptr', then return... */
return size * nmemb;
}
int main(void)
{
struct local rtp_data;
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_INTERLEAVEFUNCTION, rtp_write);
curl_easy_setopt(curl, CURLOPT_INTERLEAVEDATA, &rtp_data);
}
}
AVAILABILITY
Added in curl 7.20.0RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.SEE ALSO
CURLOPT_INTERLEAVEDATA(3), CURLOPT_RTSP_REQUEST(3)2024-11-21 | libcurl |