Skip to content

Commit

Permalink
scan engine improved and a fix for a Denon-HEOS media server
Browse files Browse the repository at this point in the history
  • Loading branch information
yellobyte committed Nov 23, 2024
1 parent 1ad850c commit 6eab926
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion build_opt.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
-DUSE_ETHERNET
-DSHOW_ESP32_MEMORY_STATISTICS
-DSHOW_ESP32_MEMORY_STATISTICS
-DNO_PROTOCOL_INFO
4 changes: 3 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -80,4 +82,4 @@ build_flags =
-DSHOW_ESP32_MEMORY_STATISTICS
; picking only a single server for testing
; -DTHIS_IP_ONLY=192,168,1,42
;
;
6 changes: 3 additions & 3 deletions src/SoapESP32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -953,7 +953,7 @@ bool SoapESP32::soapScanItem(const String *parentId,
log_d("protocolInfo=\"%s\"", info.protInfo.c_str());
}
}

#endif
gotRes = true;
}
i++;
Expand Down
4 changes: 3 additions & 1 deletion src/SoapESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6eab926

Please sign in to comment.