CURLOPT_INTERLEAVEDATA.3 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. .\" generated by cd2nroff 0.1 from CURLOPT_INTERLEAVEDATA.md
  2. .TH CURLOPT_INTERLEAVEDATA 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_INTERLEAVEDATA \- pointer passed to RTSP interleave callback
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_INTERLEAVEDATA, void *pointer);
  9. .fi
  10. .SH DESCRIPTION
  11. This is the userdata \fIpointer\fP that is passed to
  12. \fICURLOPT_INTERLEAVEFUNCTION(3)\fP when interleaved RTP data is received. If
  13. the interleave function callback is not set, this pointer is not used
  14. anywhere.
  15. .SH DEFAULT
  16. NULL
  17. .SH PROTOCOLS
  18. This functionality affects rtsp only
  19. .SH EXAMPLE
  20. .nf
  21. struct local {
  22. void *custom;
  23. };
  24. static size_t rtp_write(void *ptr, size_t size, size_t nmemb, void *userp)
  25. {
  26. struct local *l = userp;
  27. printf("my pointer: %p\\n", l->custom);
  28. /* take care of the packet in 'ptr', then return... */
  29. return size * nmemb;
  30. }
  31. int main(void)
  32. {
  33. struct local rtp_data;
  34. CURL *curl = curl_easy_init();
  35. if(curl) {
  36. curl_easy_setopt(curl, CURLOPT_INTERLEAVEFUNCTION, rtp_write);
  37. curl_easy_setopt(curl, CURLOPT_INTERLEAVEDATA, &rtp_data);
  38. curl_easy_perform(curl);
  39. }
  40. }
  41. .fi
  42. .SH AVAILABILITY
  43. Added in curl 7.20.0
  44. .SH RETURN VALUE
  45. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  46. .SH SEE ALSO
  47. .BR CURLOPT_INTERLEAVEFUNCTION (3),
  48. .BR CURLOPT_RTSP_REQUEST (3)