Skip to content

Commit

Permalink
Merge branch 'esp_rtc/support_h264_opus' into 'master'
Browse files Browse the repository at this point in the history
esp_rtc: add h264 and opus support

See merge request adf/esp-adf-libs!223
  • Loading branch information
jason-mao committed Jun 9, 2023
2 parents a494f45 + c9451be commit b0e908b
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 7 deletions.
30 changes: 30 additions & 0 deletions esp_media_protocols/include/esp_rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ typedef enum {
RTC_ACODEC_NULL,
RTC_ACODEC_G711A,
RTC_ACODEC_G711U,
RTC_ACODEC_OPUS,
} rtc_payload_acodec_t;

/**
Expand All @@ -46,6 +47,7 @@ typedef enum {
typedef enum {
RTC_VCODEC_NULL,
RTC_VCODEC_MJPEG,
RTC_VCODEC_H264,
} rtc_payload_vcodec_t;

/**
Expand Down Expand Up @@ -73,6 +75,8 @@ typedef int (*__esp_rtc_receive_video)(unsigned char *data, int len, void *ctx);

/**
* @brief RTC session data callback
*
* @note When a DTMF (RFC2833) event is received, it will be returned through the audio data channel in the format of "DTMF-ID".
*/
typedef struct {
__esp_rtc_send_audio send_audio;
Expand Down Expand Up @@ -112,6 +116,8 @@ typedef struct {
int (*crt_bundle_attach)(void *conf);
/*!< Function pointer to esp_crt_bundle_attach. Enables the use of certification
bundle for server verification, must be enabled in menuconfig */
int register_interval; /*!< Registration interval in seconds (defaults is 3600s) */
const char *user_agent; /*!< Set user agent field (defaults is "ESP32 SIP/2.0") */
} esp_rtc_config_t;

/**
Expand Down Expand Up @@ -181,6 +187,30 @@ int esp_rtc_bye(esp_rtc_handle_t esp_rtc);
*/
int esp_rtc_deinit(esp_rtc_handle_t esp_rtc);

/**
* @brief Send DTMF event ( Only support out band method (RFC2833) )
*
* @param[in] esp_rtc The rtc handle
* @param[in] dtmf_event DTMF event ID (0-15)
*s
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG on wrong handle
*/
int esp_rtc_send_dtmf(esp_rtc_handle_t esp_rtc, uint8_t dtmf_event);

/**
* @brief Set private header
*
* @param[in] esp_rtc The rtc handle
* @param[in] pheader Private header data
*
* @return
* - ESP_OK on success
* - ESP_ERR_INVALID_ARG on wrong handle
*/
int esp_rtc_set_private_header(esp_rtc_handle_t esp_rtc, const char *pheader);

#ifdef __cplusplus
}
#endif
Expand Down
8 changes: 4 additions & 4 deletions esp_media_protocols/include/esp_rtc_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ extern "C" {
* - Use SIP version 2.0 (RFC3261)
* - Support real-time communication and VoIP
* - Support UDP, TCP, TLS transport
* - Support audio codecs: G711A, G711U
* - Support video codecs: MJPEG
* - Support audio codecs: G711A, G711U, OPUS
* - Support video codecs: MJPEG, H264
* - Support md5 digest authentication
* - Support Freeswitch and FreePBX, etc
*
* To be implemented:
* - To support H264, AAC
* - To support AAC
*/
#define ESP_RTC_VERSION "1.0.0"
#define ESP_RTC_VERSION "1.1.0"

#ifdef __cplusplus
}
Expand Down
1 change: 1 addition & 0 deletions esp_media_protocols/include/esp_rtsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ typedef enum {
RTSP_ACODEC_G711A,
RTSP_ACODEC_G711U,
RTSP_VCODEC_MJPEG,
RTSP_VCODEC_H264,
} rtsp_payload_codec_t;

/**
Expand Down
6 changes: 3 additions & 3 deletions esp_media_protocols/include/esp_rtsp_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@ extern "C" {
* - Use RTSP version 1.0 (RFC2326)
* - Support RTSP Pusher, RTSP Server, RTSP Client
* - Support audio codecs: G711A, G711U
* - Support video codecs: MJPEG
* - Support video codecs: MJPEG, H264
* - Support unicast (rtp over udp, rtp over tcp)
* - Support Public method : OPTIONS, DESCRIBE, SETUP, PLAY, TEARDOWN
* - Support EasyDarwin and other common RTSP server
* - Support VLC, Potplayer, FFMPEG, etc
*
* To be implemented:
* - To support H264, AAC
* - To support AAC
* - To support digest authentication
*/
#define ESP_RTSP_VERSION "1.0.0"
#define ESP_RTSP_VERSION "1.1.0"

#ifdef __cplusplus
}
Expand Down
Binary file modified esp_media_protocols/lib/esp32/libesp_media_protocols.a
Binary file not shown.
Binary file modified esp_media_protocols/lib/esp32c3/libesp_media_protocols.a
Binary file not shown.
Binary file modified esp_media_protocols/lib/esp32c6/libesp_media_protocols.a
Binary file not shown.
Binary file modified esp_media_protocols/lib/esp32s2/libesp_media_protocols.a
Binary file not shown.
Binary file modified esp_media_protocols/lib/esp32s3/libesp_media_protocols.a
Binary file not shown.

0 comments on commit b0e908b

Please sign in to comment.