Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7734c155 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "stack/a2dp: Remove unused function A2DP_IsPeerSourceCodecSupported" into main

parents dcdd215d 9a86fced
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -266,11 +266,6 @@ bool A2DP_IsSinkCodecSupportedAac(const uint8_t* p_codec_info) {
         A2DP_SUCCESS;
}

bool A2DP_IsPeerSourceCodecSupportedAac(const uint8_t* p_codec_info) {
  return A2DP_CodecInfoMatchesCapabilityAac(&a2dp_aac_sink_caps, p_codec_info, true) ==
         A2DP_SUCCESS;
}

// Checks whether A2DP AAC codec configuration matches with a device's codec
// capabilities. |p_cap| is the AAC codec configuration. |p_codec_info| is
// the device's codec capabilities. |is_capability| is true if
+0 −20
Original line number Diff line number Diff line
@@ -1149,26 +1149,6 @@ bool A2DP_IsSinkCodecSupported(const uint8_t* p_codec_info) {
  return false;
}

bool A2DP_IsPeerSourceCodecSupported(const uint8_t* p_codec_info) {
  tA2DP_CODEC_TYPE codec_type = A2DP_GetCodecType(p_codec_info);

  switch (codec_type) {
    case A2DP_MEDIA_CT_SBC:
      return A2DP_IsPeerSourceCodecSupportedSbc(p_codec_info);
#if !defined(EXCLUDE_NONSTANDARD_CODECS)
    case A2DP_MEDIA_CT_AAC:
      return A2DP_IsPeerSourceCodecSupportedAac(p_codec_info);
    case A2DP_MEDIA_CT_NON_A2DP:
      return A2DP_IsVendorPeerSourceCodecSupported(p_codec_info);
#endif
    default:
      break;
  }

  log::error("unsupported codec type 0x{:x}", codec_type);
  return false;
}

void A2DP_InitDefaultCodec(uint8_t* p_codec_info) { A2DP_InitDefaultCodecSbc(p_codec_info); }

bool A2DP_UsesRtpHeader(bool content_protection_enabled, const uint8_t* p_codec_info) {
+0 −5
Original line number Diff line number Diff line
@@ -315,11 +315,6 @@ bool A2DP_IsSinkCodecSupportedSbc(const uint8_t* p_codec_info) {
         A2DP_SUCCESS;
}

bool A2DP_IsPeerSourceCodecSupportedSbc(const uint8_t* p_codec_info) {
  return A2DP_CodecInfoMatchesCapabilitySbc(&a2dp_sbc_sink_caps, p_codec_info, true) ==
         A2DP_SUCCESS;
}

void A2DP_InitDefaultCodecSbc(uint8_t* p_codec_info) {
  if (A2DP_BuildInfoSbc(AVDT_MEDIA_TYPE_AUDIO, &a2dp_sbc_default_config, p_codec_info) !=
      A2DP_SUCCESS) {
+0 −20
Original line number Diff line number Diff line
@@ -151,26 +151,6 @@ bool A2DP_IsVendorSinkCodecSupported(const uint8_t* p_codec_info) {
  return false;
}

bool A2DP_IsVendorPeerSourceCodecSupported(const uint8_t* p_codec_info) {
  uint32_t vendor_id = A2DP_VendorCodecGetVendorId(p_codec_info);
  uint16_t codec_id = A2DP_VendorCodecGetCodecId(p_codec_info);

  // Add checks based on <vendor_id, codec_id> and peer codec capabilities
  // NOTE: Should be done only for local Sink codecs.

  // Check for LDAC
  if (vendor_id == A2DP_LDAC_VENDOR_ID && codec_id == A2DP_LDAC_CODEC_ID) {
    return A2DP_IsPeerSourceCodecSupportedLdac(p_codec_info);
  }

  // Check for Opus
  if (vendor_id == A2DP_OPUS_VENDOR_ID && codec_id == A2DP_OPUS_CODEC_ID) {
    return A2DP_IsPeerSourceCodecSupportedOpus(p_codec_info);
  }

  return false;
}

uint32_t A2DP_VendorCodecGetVendorId(const uint8_t* p_codec_info) {
  const uint8_t* p = &p_codec_info[A2DP_VENDOR_CODEC_VENDOR_ID_START_IDX];

+0 −4
Original line number Diff line number Diff line
@@ -246,10 +246,6 @@ bool A2DP_IsVendorSinkCodecSupportedLdac(const uint8_t* p_codec_info) {
  return A2DP_CodecInfoMatchesCapabilityLdac(&a2dp_ldac_sink_caps, p_codec_info, false) ==
         A2DP_SUCCESS;
}
bool A2DP_IsPeerSourceCodecSupportedLdac(const uint8_t* p_codec_info) {
  return A2DP_CodecInfoMatchesCapabilityLdac(&a2dp_ldac_sink_caps, p_codec_info, true) ==
         A2DP_SUCCESS;
}

// Checks whether A2DP LDAC codec configuration matches with a device's codec
// capabilities. |p_cap| is the LDAC codec configuration. |p_codec_info| is
Loading