mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-01-31 06:40:58 +03:00
airplay artwork and CSpot leak fix (temporary)
This commit is contained in:
@@ -7,8 +7,6 @@ option(BELL_DISABLE_CODECS "Disable libhelix AAC and MP3 codecs" OFF)
|
||||
#set(BELL_EXTERNAL_CJSON "" CACHE STRING "External cJSON library target name, optional")
|
||||
#set(BELL_EXTERNAL_TREMOR "" CACHE STRING "External tremor library target name, optional")
|
||||
|
||||
add_definitions(-DPB_ENABLE_MALLOC)
|
||||
|
||||
# Include nanoPB library
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/nanopb/extra)
|
||||
find_package(Nanopb REQUIRED)
|
||||
@@ -98,3 +96,4 @@ message(${NANOPB_INCLUDE_DIRS})
|
||||
# PUBLIC to propagate esp-idf includes to bell dependents
|
||||
target_link_libraries(bell PUBLIC ${EXTRA_LIBS})
|
||||
target_include_directories(bell PUBLIC "include" ${EXTRA_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR})
|
||||
target_compile_definitions(bell PUBLIC PB_ENABLE_MALLOC)
|
||||
|
||||
@@ -42,6 +42,10 @@ void pbDecode(T &result, const pb_msgdesc_t *fields, std::vector<uint8_t> &data)
|
||||
}
|
||||
}
|
||||
|
||||
void pbPutString(const std::string &stringToPack, char* dst);
|
||||
void pbPutCharArray(const char * stringToPack, char* dst);
|
||||
void pbPutBytes(const std::vector<uint8_t> &data, pb_bytes_array_t &dst);
|
||||
|
||||
const char* pb_encode_to_string(const pb_msgdesc_t *fields, const void *data);
|
||||
pb_istream_t pb_istream_from_http(bell::HTTPClient::HTTPResponse *response, size_t length = 0);
|
||||
|
||||
|
||||
@@ -47,6 +47,22 @@ pb_bytes_array_t* vectorToPbArray(const std::vector<uint8_t>& vectorToPack)
|
||||
return result;
|
||||
}
|
||||
|
||||
void pbPutString(const std::string &stringToPack, char* dst) {
|
||||
stringToPack.copy(dst, stringToPack.size());
|
||||
dst[stringToPack.size()] = '\0';
|
||||
}
|
||||
|
||||
void pbPutCharArray(const char * stringToPack, char* dst) {
|
||||
// copy stringToPack into dst
|
||||
strcpy(dst, stringToPack);
|
||||
//dst[sizeof(stringToPack)-1] = '\0';
|
||||
}
|
||||
|
||||
void pbPutBytes(const std::vector<uint8_t> &data, pb_bytes_array_t &dst) {
|
||||
dst.size = data.size();
|
||||
std::copy(data.begin(), data.end(), dst.bytes);
|
||||
}
|
||||
|
||||
std::vector<uint8_t> pbArrayToVector(pb_bytes_array_t* pbArray) {
|
||||
return std::vector<uint8_t>(pbArray->bytes, pbArray->bytes + pbArray->size);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user