#define AVDTP_PSM 25
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+#ifdef TIZEN_FEATURE_SSC_ENCODER
+/* Vendor and Codec ID for Samsung Scalable codec */
+#define PREFRED_VENDOR_ID 0x00000075
+#define PREFRED_CODEC_ID 0x0103
+#endif
+#endif
+
struct a2dp_sep {
struct a2dp_server *server;
struct a2dp_endpoint *endpoint;
auto_config(setup);
}
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+#ifdef TIZEN_FEATURE_SSC_ENCODER
+static gboolean endpoint_match_codec_preference(struct avdtp *session,
+ struct avdtp_media_codec_capability *codec,
+ void *user_data)
+{
+ struct a2dp_sep *sep = user_data;
+ uint8_t *capabilities;
+ a2dp_vendor_codec_t *local_codec;
+ size_t length;
+
+ length = sep->endpoint->get_capabilities(sep, &capabilities,
+ sep->user_data);
+ if (length < sizeof(a2dp_vendor_codec_t))
+ return FALSE;
+
+ local_codec = (a2dp_vendor_codec_t *) capabilities;
+ DBG("vendor 0x%08x codec 0x%04x", btohl(local_codec->vendor_id),
+ btohs(local_codec->codec_id));
+ if (btohl(local_codec->vendor_id) == PREFRED_VENDOR_ID &&
+ btohs(local_codec->codec_id) == PREFRED_CODEC_ID) {
+ DBG("Samsung Scalable Codec Selected");
+ return TRUE;
+ }
+ return FALSE;
+}
+#endif
+#endif
+
static gboolean endpoint_match_codec_ind(struct avdtp *session,
struct avdtp_media_codec_capability *codec,
void *user_data)
if (cap->media_codec_type != A2DP_CODEC_VENDOR) {
selected_sep = sep;
continue;
+#ifdef TIZEN_FEATURE_SSC_ENCODER
+ } else {
+ /* This is vendor codec */
+ selected_sep = sep;
+ if (endpoint_match_codec_preference(session, cap, sep))
+ return selected_sep;
+ continue;
+#endif
}
#else
if (avdtp_find_remote_sep(session, sep->lsep) == NULL)