You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
3.1KB

  1. #ifndef _rtmp_netconnection_h_
  2. #define _rtmp_netconnection_h_
  3. #include <stdint.h>
  4. #include <stddef.h>
  5. enum rtmp_audio_codec_t
  6. {
  7. SUPPORT_SND_NONE = 0x0001, // Raw sound, no compression
  8. SUPPORT_SND_ADPCM = 0x0002, // ADPCM compression
  9. SUPPORT_SND_MP3 = 0x0004, // mp3 compression
  10. SUPPORT_SND_INTEL = 0x0008, // Not used
  11. SUPPORT_SND_UNUSED = 0x0010, // Not used
  12. SUPPORT_SND_NELLY8 = 0x0020, // NellyMoser at 8-kHz compression
  13. SUPPORT_SND_NELLY = 0x0040, // NellyMoser compression (5, 11, 22, and 44 kHz)
  14. SUPPORT_SND_G711A = 0x0080, // G711A sound compression (Flash Media Server only)
  15. SUPPORT_SND_G711U = 0x0100, // G711U sound compression (Flash Media Server only)
  16. SUPPORT_SND_NELLY16 = 0x0200, // NellyMouser at 16-kHz compression
  17. SUPPORT_SND_AAC = 0x0400, // Advanced audio coding
  18. SUPPORT_SND_SPEEX = 0x0800, // Speex Audio
  19. SUPPORT_SND_ALL = 0x0FFF, // All RTMP-supported audio codecs
  20. };
  21. enum rtmp_video_codec_t
  22. {
  23. SUPPORT_VID_UNUSED = 0x0001, // Obsolete value
  24. SUPPORT_VID_JPEG = 0x0002, // Obsolete value
  25. SUPPORT_VID_SORENSON = 0x0004, // Sorenson Flash video
  26. SUPPORT_VID_HOMEBREW = 0x0008, // V1 screen sharing
  27. SUPPORT_VID_VP6 = 0x0010, // On2 video (Flash 8+)
  28. SUPPORT_VID_VP6ALPHA = 0x0020, // On2 video with alpha channel
  29. SUPPORT_VID_HOMEBREWV = 0x0040, // Screen sharing version 2 (Flash 8+)
  30. SUPPORT_VID_H264 = 0x0080, // H264 video
  31. SUPPORT_VID_ALL = 0x00FF, // All RTMP-supported video codecs
  32. };
  33. enum rtmp_video_function_t
  34. {
  35. SUPPORT_VID_CLIENT_SEEK = 1, // Indicates that the client can perform frame-accurate seeks.
  36. };
  37. enum rtmp_encoding_amf_t
  38. {
  39. RTMP_ENCODING_AMF_0 = 0,
  40. RTMP_ENCODING_AMF_3 = 3,
  41. };
  42. struct rtmp_connect_t
  43. {
  44. char app[128]; // Server application name, e.g.: testapp
  45. char flashver[32]; // Flash Player version, FMSc/1.0
  46. char swfUrl[256]; // URL of the source SWF file
  47. char tcUrl[256]; // URL of the Server, rtmp://host:1935/testapp/instance1
  48. uint8_t fpad; // boolean: True if proxy is being used.
  49. double capabilities; // double default: 15
  50. double audioCodecs; // double default: 4071
  51. double videoCodecs; // double default: 252
  52. double videoFunction; // double default: 1
  53. double encoding;
  54. char pageUrl[256]; // http://host/sample.html
  55. };
  56. uint8_t* rtmp_netconnection_connect(uint8_t* out, size_t bytes, double transactionId, const struct rtmp_connect_t* connect);
  57. uint8_t* rtmp_netconnection_create_stream(uint8_t* out, size_t bytes, double transactionId);
  58. uint8_t* rtmp_netconnection_get_stream_length(uint8_t* out, size_t bytes, double transactionId, const char* stream_name);
  59. uint8_t* rtmp_netconnection_connect_reply(uint8_t* out, size_t bytes, double transactionId, const char* fmsver, double capabilities, const char* code, const char* level, const char* description, double encoding);
  60. uint8_t* rtmp_netconnection_create_stream_reply(uint8_t* out, size_t bytes, double transactionId, double stream_id);
  61. uint8_t* rtmp_netconnection_get_stream_length_reply(uint8_t* out, size_t bytes, double transactionId, double duration);
  62. uint8_t* rtmp_netconnection_error(uint8_t* out, size_t bytes, double transactionId, const char* code, const char* level, const char* description);
  63. #endif /* !_rtmp_netconnection_h_ */