diff --git a/README.md b/README.md index f1937df..91ee73f 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,8 @@ Always make sure you have one of the latest versions of **Arduino core for ESP32 Most DLNA media servers I tested the library with showed some oddities. However, all compatibility issues I ran across have been fixed. Please note the following: -- As of V1.4.0 struct *soapObject_t* has a new string member *protInfo*. If neither url nor id of a media item come with an extension like ".mp3" (e.g. on Denon-HEOS media servers) and therefore the items media type is unclear then this member comes to your rescue. Here an example for a typical protocol info: "http-get:*:audio/mpeg:DLNA.ORG_PN=**MP3**;DLNA.ORG_FLAGS=01700000000000000000000000000000". +- As of V1.4.0 struct *soapObject_t* by default has a new string member *protInfo*. If neither url nor id of a media item come with an extension like ".mp3" (e.g. on Denon-HEOS media servers) and therefore the media items video/audio format is unclear then this member might come handy. Here an example for a typical protocol info: "http-get:*:audio/mpeg:DLNA.ORG_PN=**MP3**;DLNA.ORG_FLAGS=01700000000000000000000000000000". +If *protInfo* is not needed and memory is limited then use build option `NO_PROTOCOL_INFO`. - As of V1.3.0 a new function _searchServer()_ is available. The function sends UPnP content search requests to media servers asking for a list of objects that match certain criterias, e.g. the objects property _title_ must contain the string "xyz" or the files property _album_ must contain the string "abc", etc. Not all media servers support UPnP content search requests though. More info below. diff --git a/build_opt.h b/build_opt.h index ae665ee..3afb281 100644 --- a/build_opt.h +++ b/build_opt.h @@ -1,2 +1,3 @@ -DUSE_ETHERNET --DSHOW_ESP32_MEMORY_STATISTICS \ No newline at end of file +-DSHOW_ESP32_MEMORY_STATISTICS +-DNO_PROTOCOL_INFO diff --git a/platformio.ini b/platformio.ini index 9c15bc8..40192f1 100644 --- a/platformio.ini +++ b/platformio.ini @@ -46,6 +46,8 @@ build_flags = ; -DSHOW_EMPTY_FILES ; when using Ethernet shield/board instead of builtin WiFi ; -DUSE_ETHERNET +; if 'protInfo' in struct soapObject_t is not needed +; -DNO_PROTOCOL_INFO ; ; try different partition setting: ;board_build.partitions = min_spiffs.csv @@ -80,4 +82,4 @@ build_flags = -DSHOW_ESP32_MEMORY_STATISTICS ; picking only a single server for testing ; -DTHIS_IP_ONLY=192,168,1,42 -; \ No newline at end of file +; diff --git a/src/SoapESP32.cpp b/src/SoapESP32.cpp index 529869f..544ff4c 100644 --- a/src/SoapESP32.cpp +++ b/src/SoapESP32.cpp @@ -942,8 +942,8 @@ bool SoapESP32::soapScanItem(const String *parentId, log_d("sampleFrequency=%d", info.sampleFrequency); } } - - // media protocol info, gets important when extension e.g. ".mp3" is missing in id and url +#if !defined(NO_PROTOCOL_INFO) + // info about media format, gets important when extension e.g. ".mp3" is missing in id and url if (soapScanAttribute(&strAttr, &str, DIDL_ATTR_PROT_INFO)) { info.protInfo = str; if (info.protInfo.length() == 0) { @@ -953,7 +953,7 @@ bool SoapESP32::soapScanItem(const String *parentId, log_d("protocolInfo=\"%s\"", info.protInfo.c_str()); } } - +#endif gotRes = true; } i++; diff --git a/src/SoapESP32.h b/src/SoapESP32.h index 823ece1..a6e0ff8 100644 --- a/src/SoapESP32.h +++ b/src/SoapESP32.h @@ -183,7 +183,9 @@ struct soapObject_t String artist; // for music files String album; // for music files (sometimes folder name when picture file) String genre; // for audio/video files - String protInfo; // for audio/video files, determines the media type (mp3, mp4, etc.) +#if !defined(NO_PROTOCOL_INFO) + String protInfo; // for audio/video files, holds info about media format (mp3, aac, etc.) +#endif String uri; // item URI on server, needed for download with readStart() IPAddress downloadIp; // download IP can differ from server IP uint16_t downloadPort; // download port can differ from server control port