Skip to content

Commit 8d5cb95

Browse files
committed
Add support for IDFv6.0
1 parent d5621d9 commit 8d5cb95

File tree

27 files changed

+952
-13
lines changed

27 files changed

+952
-13
lines changed

components/codec_board/lcd_init.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ static int _init_spi_lcd(lcd_cfg_t *cfg)
187187
};
188188
#if SOC_SPI_SUPPORT_OCT
189189
if (cfg->spi_cfg.d[6] >= 0) {
190+
#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(6, 0, 0)
190191
io_config.flags.octal_mode = 1;
192+
#endif
191193
io_config.spi_mode = 3;
192194
}
193195
#endif
@@ -196,7 +198,9 @@ static int _init_spi_lcd(lcd_cfg_t *cfg)
196198
RETURN_ON_ERR(ret);
197199
esp_lcd_panel_dev_config_t panel_config = {
198200
.reset_gpio_num = get_hw_gpio(cfg->reset_pin),
199-
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
201+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0)
202+
.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR,
203+
#elif ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
200204
.rgb_ele_order = ESP_LCD_COLOR_SPACE_BGR,
201205
#else
202206
.rgb_endian = LCD_RGB_ENDIAN_BGR,

components/esp_capture/src/impl/capture_video_src/capture_video_dvp_src.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ static int dvp_src_get_support_codecs(esp_capture_video_src_if_t *src, const esp
7575
{
7676
static esp_capture_codec_type_t dvp_codecs[] = {
7777
ESP_CAPTURE_CODEC_TYPE_MJPEG,
78-
ESP_CAPTURE_CODEC_TYPE_YUV422P,
78+
ESP_CAPTURE_CODEC_TYPE_YUV422,
7979
ESP_CAPTURE_CODEC_TYPE_YUV420,
80+
ESP_CAPTURE_CODEC_TYPE_RGB565,
8081
};
8182
*codecs = dvp_codecs;
8283
*num = sizeof(dvp_codecs) / sizeof(dvp_codecs[0]);
@@ -142,7 +143,7 @@ static int dvp_src_negotiate_caps(esp_capture_video_src_if_t *src, esp_capture_v
142143
}
143144
if (in_cap->codec == ESP_CAPTURE_CODEC_TYPE_MJPEG) {
144145
camera_config.pixel_format = PIXFORMAT_JPEG;
145-
} else if (in_cap->codec == ESP_CAPTURE_CODEC_TYPE_YUV422P || in_cap->codec == ESP_CAPTURE_CODEC_TYPE_YUV420) {
146+
} else if (in_cap->codec == ESP_CAPTURE_CODEC_TYPE_YUV422 || in_cap->codec == ESP_CAPTURE_CODEC_TYPE_YUV420) {
146147
camera_config.pixel_format = PIXFORMAT_YUV422;
147148
if (in_cap->codec == ESP_CAPTURE_CODEC_TYPE_YUV420) {
148149
dvp_src->need_convert_420 = true;

components/esp_capture/src/impl/capture_video_src/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies:
55
- if: "target in [esp32p4]"
66

77
espressif/esp32-camera:
8-
version: "~2.0.15"
8+
version: "~2.1"
99
rules:
1010
- if: "target in [esp32s3,esp32s2,esp32]"
1111
esp_capture:

components/esp_peer/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## v1.2.3
4+
5+
### Features
6+
7+
- Added support for IDFv6.0
8+
- Added API `esp_peer_pre_generate_cert` for pre-generate DTLS key
9+
10+
### Bug Fixes
11+
12+
- Fixed build error on IDFv6.0
13+
- Make DTLS module to be open source
14+
- Fixed data channel role not follow DTLS role
15+
316
## v1.2.2
417

518
### Bug Fixes

components/esp_peer/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
idf_component_register(INCLUDE_DIRS ./include SRC_DIRS "src")
1+
idf_component_register(INCLUDE_DIRS ./include
2+
SRC_DIRS "src"
3+
PRIV_REQUIRES mbedtls)
24

35
get_filename_component(BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR} NAME)
46
add_prebuilt_library(${BASE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/libs/${IDF_TARGET}/libpeer_default.a"
5-
PRIV_REQUIRES ${BASE_DIR} esp_timer mbedtls)
7+
PRIV_REQUIRES ${BASE_DIR} esp_timer)
68
target_link_libraries(${COMPONENT_LIB} PRIVATE "-L ${CMAKE_CURRENT_SOURCE_DIR}/libs/${IDF_TARGET}")
79
target_link_libraries(${COMPONENT_LIB} PRIVATE ${BASE_DIR})

components/esp_peer/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ Ensure these config options are enabled:
199199
```ini
200200
CONFIG_MBEDTLS_SSL_PROTO_DTLS=y
201201
CONFIG_MBEDTLS_SSL_DTLS_SRTP=y
202+
For IDFv6.0 need turn on following option also
203+
CONFIG_MBEDTLS_X509_CREATE_C=y
202204
```
203205

204206
---

components/esp_peer/examples/peer_demo/sdkconfig.defaults

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ CONFIG_FREERTOS_HZ=1000
44
# Enable DTLS SRTP
55
CONFIG_MBEDTLS_SSL_PROTO_DTLS=y
66
CONFIG_MBEDTLS_SSL_DTLS_SRTP=y
7+
CONFIG_MBEDTLS_X509_CREATE_C=y
78

89
# Enable experimental features
910
CONFIG_IDF_EXPERIMENTAL_FEATURES=y

components/esp_peer/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
description: Espressif PeerConnection Library
2-
version: 1.2.2
2+
version: 1.2.3
33
url: "https://github.com/espressif/esp-webrtc-solution/tree/main/components/esp_peer"
44
documentation: "https://github.com/espressif/esp-webrtc-solution/tree/main/components/esp_peer/README.md"
55
issues: "https://github.com/espressif/esp-webrtc-solution/issues"

components/esp_peer/include/esp_peer.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,25 @@ int esp_peer_query(esp_peer_handle_t peer);
567567
*/
568568
int esp_peer_close(esp_peer_handle_t peer);
569569

570+
/**
571+
* @brief Pre-generates cryptographic materials for DTLS handshake to optimize connection establishment
572+
*
573+
* @note This function generates and caches X.509 certificates and associated private keys
574+
* that will be used for subsequent DTLS handshakes. Pre-generation is recommended
575+
* because:
576+
* - Cryptographic operations during runtime can significantly delay connection establishment
577+
* - Certificate generation is computationally intensive
578+
* - Reusing pre-generated materials maintains security while improving performance
579+
* Important considerations:
580+
* - Generated materials are stored in internal memory and persist until reset
581+
* - Each call overwrites any previously generated materials
582+
*
583+
* @return
584+
* - ESP_PEER_ERR_NONE On success
585+
* - Others Failed to generate
586+
*/
587+
int esp_peer_pre_generate_cert(void);
588+
570589
#ifdef __cplusplus
571590
}
572591
#endif
-97.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)