player: Add image handle support property
authorFrédéric Danis <frederic.danis@collabora.com>
Mon, 16 Sep 2024 13:28:07 +0000 (15:28 +0200)
committerWootak Jung <wootak.jung@samsung.com>
Thu, 20 Feb 2025 07:43:22 +0000 (16:43 +0900)
This is part of the metadata when the AVRCP target supports covert
art download and a OBEX BIP session is connected.
The image handle references the cover art associated to the track,
and is valid only during OBEX BIP session.

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
doc/org.bluez.MediaPlayer.rst
monitor/avctp.c
profiles/audio/avrcp.c
profiles/audio/avrcp.h
tools/parser/avrcp.c

index 858344b30a66d5f86cba9acce5a50e7ca26857ad..94f5b8472b24901b5f0d50c569e081215f5a9790 100644 (file)
@@ -237,6 +237,11 @@ dict Track [readonly]
 
                Track duration in milliseconds
 
+       :string ImgHandle: [experimental]
+
+               Track image handle, available and valid only during the lifetime of an
+               OBEX BIP connection to the ObexPort.
+
 object Device [readonly]
 ````````````````````````
 
index 0f75800e70769b9700e63fe36f5e4b29640eb5c4..d5e219e1200b7442b659b0f74b999843ada81396 100755 (executable)
 #define AVRCP_MEDIA_ATTRIBUTE_TOTAL    0x05
 #define AVRCP_MEDIA_ATTRIBUTE_GENRE    0x06
 #define AVRCP_MEDIA_ATTRIBUTE_DURATION 0x07
+#define AVRCP_MEDIA_ATTRIBUTE_IMG_HANDLE       0x08
 
 /* play status */
 #define AVRCP_PLAY_STATUS_STOPPED      0x00
@@ -582,6 +583,8 @@ static const char *mediattr2str(uint32_t attr)
                return "Genre";
        case AVRCP_MEDIA_ATTRIBUTE_DURATION:
                return "Track duration";
+       case AVRCP_MEDIA_ATTRIBUTE_IMG_HANDLE:
+               return "Imaging handle";
        default:
                return "Reserved";
        }
index a9a40f4583910fdb2ee1774c7e1934e592de6ee8..9d3163053e0c47d36f707cba78178c51c506943c 100644 (file)
@@ -452,7 +452,8 @@ static sdp_record_t *avrcp_ct_record(bool browsing)
        uint16_t feat = (AVRCP_FEATURE_CATEGORY_1 |
                                                AVRCP_FEATURE_CATEGORY_2 |
                                                AVRCP_FEATURE_CATEGORY_3 |
-                                               AVRCP_FEATURE_CATEGORY_4);
+                                               AVRCP_FEATURE_CATEGORY_4 |
+                                               AVRCP_FEATURE_CT_GET_THUMBNAIL);
 #endif
 
        record = sdp_record_alloc();
@@ -985,6 +986,8 @@ static const char *metadata_to_str(uint32_t id)
                return "NumberOfTracks";
        case AVRCP_MEDIA_ATTRIBUTE_DURATION:
                return "Duration";
+       case AVRCP_MEDIA_ATTRIBUTE_IMG_HANDLE:
+               return "ImgHandle";
        }
 
        return NULL;
@@ -1303,6 +1306,8 @@ static uint32_t str_to_metadata(const char *str)
                return AVRCP_MEDIA_ATTRIBUTE_N_TRACKS;
        else if (strcasecmp(str, "Duration") == 0)
                return AVRCP_MEDIA_ATTRIBUTE_DURATION;
+       else if (strcasecmp(str, "ImgHandle") == 0)
+               return AVRCP_MEDIA_ATTRIBUTE_IMG_HANDLE;
 
        return 0;
 }
index da06c07f152da0ff70858fe9fffe879ba4de0336..fd0765fec4fd6992e5e9af85ff464fddcb2986ba 100644 (file)
@@ -46,7 +46,8 @@
 #define AVRCP_MEDIA_ATTRIBUTE_N_TRACKS 0x05
 #define AVRCP_MEDIA_ATTRIBUTE_GENRE    0x06
 #define AVRCP_MEDIA_ATTRIBUTE_DURATION 0x07
-#define AVRCP_MEDIA_ATTRIBUTE_LAST     AVRCP_MEDIA_ATTRIBUTE_DURATION
+#define AVRCP_MEDIA_ATTRIBUTE_IMG_HANDLE       0x08
+#define AVRCP_MEDIA_ATTRIBUTE_LAST     AVRCP_MEDIA_ATTRIBUTE_IMG_HANDLE
 
 /* play status */
 #define AVRCP_PLAY_STATUS_STOPPED      0x00
index 0685491b8b4e595806edf0884a82355c1f40148f..031252fc395d7e3c18593af67b5b3481b34852d9 100755 (executable)
 #define AVRCP_MEDIA_ATTRIBUTE_TOTAL    0x5
 #define AVRCP_MEDIA_ATTRIBUTE_GENRE    0x6
 #define AVRCP_MEDIA_ATTRIBUTE_DURATION 0x7
+#define AVRCP_MEDIA_ATTRIBUTE_IMG_HANDLE       0x08
 
 /* play status */
 #define AVRCP_PLAY_STATUS_STOPPED      0x00
@@ -932,6 +933,8 @@ static const char *mediattr2str(uint32_t attr)
                return "Genre";
        case AVRCP_MEDIA_ATTRIBUTE_DURATION:
                return "Track duration";
+       case AVRCP_MEDIA_ATTRIBUTE_IMG_HANDLE:
+               return "Imaging handle";
        default:
                return "Reserved";
        }