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

Commit e9fcc3a7 authored by Jennifer's avatar Jennifer
Browse files

Floss: add A2DP AAC Encoder support in MMC daemon

In this patch, the MMC daemon can accept aac_encoder_param, and
create the corresponding |A2dpAacEncoder| instance.

Bug: 294165109
Tag: #floss
Test: m - None
Change-Id: I28a0ce413a1c06efb6e44e80843e6135d738d4aa
parent 5eba25f4
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -44,6 +44,9 @@ pkg_config("target_defaults") {
  } else {
    pkg_deps += [ "protobuf-lite" ]
  }
  if (!(defined(use.bt_nonstandard_codecs) && use.bt_nonstandard_codecs)) {
    defines = [ "EXCLUDE_NONSTANDARD_CODECS" ]
  }
}

install_config("install_dbus_config") {
@@ -81,6 +84,9 @@ source_set("libmmc") {
    "//bt/system/stack/mmc/proto:mmc_service_proto",
    "//bt/system/stack/mmc/codec_server:libcodec_server_hfp_lc3",
  ]
  if (defined(use.bt_nonstandard_codecs) && use.bt_nonstandard_codecs) {
    deps += [ "//bt/system/stack/mmc/codec_server:libcodec_server_a2dp_aac" ]
  }
}

executable("mmc_service") {
+11 −1
Original line number Diff line number Diff line
@@ -40,6 +40,10 @@
#include "mmc/mmc_interface/mmc_interface.h"
#include "mmc/proto/mmc_service.pb.h"

#if !defined(EXCLUDE_NONSTANDARD_CODECS)
#include "mmc/codec_server/a2dp_aac_mmc_encoder.h"
#endif

namespace mmc {
namespace {
// Task that would run on the thread.
@@ -185,7 +189,13 @@ void Service::CodecInit(dbus::MethodCall* method_call,
    codec_server = std::make_unique<HfpLc3Decoder>();
  } else if (request.config().has_hfp_lc3_encoder_param()) {
    codec_server = std::make_unique<HfpLc3Encoder>();
  } else {
  }
#if !defined(EXCLUDE_NONSTANDARD_CODECS)
  else if (request.config().has_a2dp_aac_encoder_param()) {
    codec_server = std::make_unique<A2dpAacEncoder>();
  }
#endif
  else {
    std::move(sender).Run(dbus::ErrorResponse::FromMethodCall(
        method_call, kMmcServiceError, "Codec type must be specified"));
    return;