replace common qcom sources with samsung ones

This commit is contained in:
SaschaNes
2025-08-12 22:13:00 +02:00
parent ba24dcded9
commit 6f7753de11
5682 changed files with 2450203 additions and 103634 deletions

View File

@@ -0,0 +1,3 @@
ifneq ($(AUDIO_USE_STUB_HAL), true)
include $(call all-subdir-makefiles)
endif

180
qcom/opensource/agm/NOTICE Normal file
View File

@@ -0,0 +1,180 @@
Copyright (c) 2019, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of The Linux Foundation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
___________________________________________________________
service/inc/agm_list.h:
Copyright (C) 2008-2013 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
plugins/tinyalsa/test/agmcap.c and plugins/tinyalsa/test/agmplay.c:
Copyright 2011, The Android Open Source Project
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of The Android Open Source Project nor the names of
its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY The Android Open Source Project ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL The Android Open Source Project BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
_________________________________________________
plugins/tinyalsa/test/agmcompressplay.c:
This file is provided under a dual BSD/LGPLv2.1 license. This code is used under the BSD license.
BSD LICENSE
tinyplay command line player for compress audio offload in alsa
Copyright (c) 2011-2012, Intel Corporation
All rights reserved.
Author: Vinod Koul <vkoul@kernel.org>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
Neither the name of Intel Corporation nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
LGPL LICENSE
tinyplay command line player for compress audio offload in alsa
Copyright (c) 2011-2012, Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU Lesser General Public License,
version 2.1, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to
the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
_________________________________________________
plugins/tinyalsa/test/agmcompresscap.c:
This file is provided under a dual BSD/LGPLv2.1 license. This code is used under the BSD license.
BSD LICENSE
crecord command line recorder for compress audio record in alsa
Copyright (c) 2011-2012, Intel Corporation
Copyright (c) 2013-2014, Wolfson Microelectronic Ltd.
All rights reserved.
Author: Vinod Koul <vkoul@kernel.org>
Author: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
Neither the name of Intel Corporation nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
LGPL LICENSE
crecord command line recorder for compress audio record in alsa
Copyright (c) 2011-2012, Intel Corporation
Copyright (c) 2013-2014, Wolfson Microelectronic Ltd.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU Lesser General Public License,
version 2.1, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to
the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.

View File

@@ -0,0 +1,2 @@
# agm
Audio Graph Manager

View File

@@ -0,0 +1,8 @@
LOCAL_PATH := $(call my-dir)
MY_LOCAL_PATH := $(call my-dir)
ifeq ($(AUDIO_FEATURE_AGM_USES_SW_BINDER), true)
include $(call all-makefiles-under, $(LOCAL_PATH)/SwBinders)
else
include $(MY_LOCAL_PATH)/aidl/Android.mk
endif

View File

@@ -0,0 +1,17 @@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = agmclient.pc
EXTRA_DIST = $(pkgconfig_DATA)
AM_CPPFLAGS = -Wno-narrowing
AM_CPPFLAGS += -I ${WORKSPACE}/vendor/qcom/opensource/agm/service/inc
AM_CPPFLAGS += -D__unused=__attribute__\(\(__unused__\)\)
AM_CPPFLAGS += $(GLIB_CFLAGS) -Dstrlcpy=g_strlcpy -Dstrlcat=g_strlcat -include glib.h
AM_CPPFLAGS += $(GIO_CFLAGS)
agmclient_sources = ${top_srcdir}/src/agm_client_wrapper_dbus.cpp
lib_LTLIBRARIES = libagmclientwrapper.la
libagmclientwrapper_la_SOURCES = $(agmclient_sources)
libagmclientwrapper_la_CPPFLAGS := $(AM_CPPFLAGS) $(DBUS_CFLAGS)
libagmclientwrapper_la_LIBADD = -lglib-2.0 -lgobject-2.0 -lgio-2.0 -lar_osal
libagmclientwrapper_la_LDFLAGS = -ldl -shared -avoid-version -lpthread -lrt $(DBUS_LIBS)

View File

@@ -0,0 +1,10 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: agmclient
Description: agmclient library
Version: @VERSION@
Libs: -L${libdir}
Cflags: -I${includedir}/agm_client/

View File

@@ -0,0 +1,61 @@
# -*- Autoconf -*-
# configure.ac -- Autoconf script for halinterface
#
# Process this file with autoconf to produce a configure script.
# Requires autoconf tool later than 2.61
AC_PREREQ([2.69])
# Initialize the hal-interface package version 1.0.0
AC_INIT(halinterface,1.0.0)
# Does not strictly follow GNU Coding standards
AM_INIT_AUTOMAKE([foreign])
# Disables auto rebuilding of configure, Makefile.ins
#AM_MAINTAINER_MODE
# defines some macros variable to be included by source
AC_CONFIG_HEADERS([config.h])
# defines some macros variable to be included by source
AC_CONFIG_MACRO_DIR([m4])
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_LIBTOOL
AC_PROG_AWK
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES([GIO], [gio-2.0])
AC_SUBST([GIO_CFLAGS])
AC_SUBST([GIO_LIBS])
AC_ARG_WITH([glib],
AC_HELP_STRING([--with-glib],
[enable glib, Build against glib. Use this when building for HLOS systems which use glib]))
if (test "x${with_glib}" = "xyes"); then
PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
AC_MSG_ERROR(GThread >= 2.16 is required))
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
AC_MSG_ERROR(GLib >= 2.16 is required))
GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
fi
AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes")
AC_CONFIG_FILES([ \
Makefile\
agmclient.pc
])
AC_OUTPUT

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,31 @@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = agmserver.pc
EXTRA_DIST = $(pkgconfig_DATA)
h_sources = ${top_srcdir}/inc/agm-dbus-utils.h \
${top_srcdir}/inc/agm_server_wrapper_dbus.h
AM_CPPFLAGS = -Wno-narrowing
AM_CPPFLAGS += -I ${top_srcdir}/inc
AM_CPPFLAGS += -I ${WORKSPACE}/vendor/qcom/opensource/agm/service/inc
AM_CPPFLAGS += -D__unused=__attribute__\(\(__unused__\)\)
AM_CPPFLAGS += $(GLIB_CFLAGS) -Dstrlcpy=g_strlcpy -Dstrlcat=g_strlcat -include glib.h
library_include_HEADERS = $(h_sources)
library_includedir = $(includedir)/agm
agmserver_sources = ${top_srcdir}/src/agm-dbus-utils.cpp \
${top_srcdir}/src/agm_server_wrapper_dbus.cpp
lib_LTLIBRARIES = libagmserverwrapper.la
libagmserverwrapper_la_SOURCES = $(agmserver_sources)
libagmserverwrapper_la_CPPFLAGS := $(AM_CPPFLAGS) $(DBUS_CFLAGS)
libagmserverwrapper_la_LIBADD = -lagm -laudio_log_utils -lar_osal
libagmserverwrapper_la_LDFLAGS = -ldl -shared -avoid-version -lpthread -lar_osal $(DBUS_LIBS)
bin_PROGRAMS := agm_server
agm_server_SOURCES := ./src/agm-server-daemon.cpp
agm_server_la_CPPFLAGS := $(AM_CPPFLAGS)
agm_server_LDADD = libagmserverwrapper.la -laudio_log_utils -lar_osal -llog $(GLIB_LIBS)
agm_server_la_LDFLAGS = -ldl -shared -avoid-version

View File

@@ -0,0 +1,10 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: agmserver
Description: agmserver library
Version: @VERSION@
Libs: -L${libdir} -lagmserver
Cflags: -I${includedir}/mm-audio/qti-agm-server

View File

@@ -0,0 +1,79 @@
# -*- Autoconf -*-
# configure.ac -- Autoconf script for halinterface
#
# Process this file with autoconf to produce a configure script.
# Requires autoconf tool later than 2.61
AC_PREREQ([2.69])
# Initialize the hal-interface package version 1.0.0
AC_INIT(halinterface,1.0.0)
# Does not strictly follow GNU Coding standards
AM_INIT_AUTOMAKE([foreign])
# Disables auto rebuilding of configure, Makefile.ins
#AM_MAINTAINER_MODE
# defines some macros variable to be included by source
AC_CONFIG_HEADERS([config.h])
# defines some macros variable to be included by source
AC_CONFIG_MACRO_DIR([m4])
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_LIBTOOL
AC_PROG_AWK
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
AC_ARG_WITH([glib],
AC_HELP_STRING([--with-glib],
[enable glib, Build against glib. Use this when building for HLOS systems which use glib]))
if (test "x${with_glib}" = "xyes"); then
PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
AC_MSG_ERROR(GThread >= 2.16 is required))
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
AC_MSG_ERROR(GLib >= 2.16 is required))
GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
fi
AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes")
AC_ARG_ENABLE([dbus],
AS_HELP_STRING([--disable-dbus],[Disable optional D-Bus support]))
AS_IF([test "x$enable_dbus" != "xno"],
[PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 1.4.12 ], HAVE_DBUS=1, HAVE_DBUS=0)],
HAVE_DBUS=0)
AS_IF([test "x$enable_dbus" = "xyes" && test "x$HAVE_DBUS" = "x0"],
[AC_MSG_ERROR([*** D-Bus not available or too old version])])
AS_IF([test "x$HAVE_DBUS" = "x1"],
[
save_CFLAGS="$CFLAGS"; CFLAGS="$CFLAGS $DBUS_CFLAGS"
save_LIBS="$LIBS"; LIBS="$LIBS $DBUS_LIBS"
AC_CHECK_FUNCS(dbus_watch_get_unix_fd)
CFLAGS="$save_CFLAGS"
LIBS="$save_LIBS"
])
AC_SUBST(HAVE_DBUS)
AM_CONDITIONAL([HAVE_DBUS], [test "x$HAVE_DBUS" = x1])
AS_IF([test "x$HAVE_DBUS" = "x1"], AC_DEFINE([HAVE_DBUS], 1, [Have D-Bus.]))
AC_CONFIG_FILES([ \
Makefile \
agmserver.pc
])
AC_OUTPUT

View File

@@ -0,0 +1,103 @@
/*
** Copyright (c) 2020, The Linux Foundation. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above
** copyright notice, this list of conditions and the following
** disclaimer in the documentation and/or other materials provided
** with the distribution.
** * Neither the name of The Linux Foundation nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
** BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
** OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
** IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/
#include <dbus/dbus.h>
#include <glib.h>
#include <gio/gio.h>
typedef void (*agm_dbus_receive_cb_t)(DBusConnection *conn,
DBusMessage *msg,
void *userdata);
typedef struct {
const char *method_name;
const char *method_signature;
agm_dbus_receive_cb_t cb_func;
} agm_dbus_method;
typedef struct {
const char *method_name;
const char *method_signature;
} agm_dbus_signal;
typedef struct {
const char *name;
agm_dbus_method *methods;
int method_count;
agm_dbus_signal *signals;
int signal_count;
} agm_dbus_interface_info;
typedef struct {
DBusConnection *conn;
guint watch_id;
int watch_fd;
DBusWatch *watch;
} agm_dbus_watch_data;
typedef struct {
DBusConnection *conn;
guint timeout_id;
DBusTimeout *timeout;
} agm_dbus_timeout_data;
typedef struct {
DBusConnection *conn;
GHashTable *objects;
} agm_dbus_connection;
/* Creates a new agm_dbus_connection object and returns it */
agm_dbus_connection *agm_dbus_new_connection();
/* Frees agm_dbus_connection object */
void agm_dbus_connection_free(agm_dbus_connection *conn);
/* Registers dbus interface with the object */
int agm_dbus_add_interface(agm_dbus_connection *conn,
const char *dbus_obj_path,
agm_dbus_interface_info *interface_info,
void *userdata);
/* Removes dbus interface from the object */
int agm_dbus_remove_interface(agm_dbus_connection *conn,
const char *dbus_obj_path,
const char *interface);
/* Sends error to dbus client */
void agm_dbus_send_error(agm_dbus_connection *conn,
DBusMessage *msg,
char *dbus_error,
char *error);
/* Sends a signal to dbus client */
void agm_dbus_send_signal(agm_dbus_connection *conn, DBusMessage *msg);
/* Sets the watch and timeout functions of a DBusConnection to integrate the
connection. Returns 0 on success */
int agm_setup_dbus_with_main_loop(agm_dbus_connection *conn);

View File

@@ -0,0 +1,31 @@
/*
** Copyright (c) 2020, The Linux Foundation. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above
** copyright notice, this list of conditions and the following
** disclaimer in the documentation and/or other materials provided
** with the distribution.
** * Neither the name of The Linux Foundation nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
** BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
** OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
** IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/
int ipc_agm_init();
void ipc_agm_deinit();

View File

@@ -0,0 +1,677 @@
/*
** Copyright (c) 2020, The Linux Foundation. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above
** copyright notice, this list of conditions and the following
** disclaimer in the documentation and/or other materials provided
** with the distribution.
** * Neither the name of The Linux Foundation nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
** BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
** OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
** IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/
/*
** Changes from Qualcomm Innovation Center are provided under the following license:
** Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted (subject to the limitations in the
** disclaimer below) provided that the following conditions are met:
**
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
**
** * Redistributions in binary form must reproduce the above
** copyright notice, this list of conditions and the following
** disclaimer in the documentation and/or other materials provided
** with the distribution.
**
** * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
** GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
** HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
** GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
** IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
** IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/
#define LOG_TAG "agm_dbus_utils"
#include <stdio.h>
#include <errno.h>
#include <malloc.h>
#include "agm-dbus-utils.h"
#include "utils.h"
#define DISPATCH_TIMEOUT 0
typedef struct {
const char *name;
GHashTable *methods; /* Key -> method_name Value -> agm_dbus_method */
GHashTable *signals; /* Key -> method_name Value -> agm_dbus_signal */
void *userdata;
} agm_dbus_interface;
typedef struct {
const char *obj_path;
GHashTable *interfaces; /* Key -> interface name Value -> agm_dbus_interface */
} agm_dbus_object;
static DBusHandlerResult server_message_handler(DBusConnection *connection,
DBusMessage *message,
void *userdata) {
DBusHandlerResult result;
DBusMessage *reply = NULL;
DBusError err;
agm_dbus_connection *conn = (agm_dbus_connection *)userdata;
const char *dbus_obj_path = NULL;
const char *dbus_interface = NULL;
const char *dbus_method = NULL;
agm_dbus_object *object = NULL;
agm_dbus_interface *interface = NULL;
agm_dbus_method *method = NULL;
if (dbus_message_get_type(message) != DBUS_MESSAGE_TYPE_METHOD_CALL)
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
dbus_interface = dbus_message_get_interface(message);
dbus_method = dbus_message_get_member(message);
dbus_obj_path = dbus_message_get_path(message);
if ((object = (agm_dbus_object *)g_hash_table_lookup
(conn->objects, dbus_obj_path)) == NULL) {
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
} else {
if ((interface = (agm_dbus_interface *)
g_hash_table_lookup(object->interfaces, dbus_interface)) == NULL) {
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
} else {
if ((method = (agm_dbus_method *)
g_hash_table_lookup(interface->methods, dbus_method)) == NULL) {
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
} else {
method->cb_func(connection, message, interface->userdata);
return DBUS_HANDLER_RESULT_HANDLED;
}
}
}
}
static DBusObjectPathVTable vtable = {
.unregister_function = NULL,
.message_function = server_message_handler,
.dbus_internal_pad1 = NULL,
.dbus_internal_pad2 = NULL,
.dbus_internal_pad3 = NULL,
.dbus_internal_pad4 = NULL
};
static void agm_handle_dispatch_status(DBusConnection *conn,
DBusDispatchStatus status,
void *userdata) {
if (status == DBUS_DISPATCH_DATA_REMAINS) {
while (dbus_connection_get_dispatch_status(conn) ==
DBUS_DISPATCH_DATA_REMAINS)
dbus_connection_dispatch(conn);
}
}
static void dispatch_status(DBusConnection *conn,
DBusDispatchStatus status,
void *userdata)
{
if (!dbus_connection_get_is_connected(conn))
return;
agm_handle_dispatch_status(conn, status, userdata);
}
static void agm_free_dbus_watch_data(void *userdata) {
agm_dbus_watch_data *watch_data = (agm_dbus_watch_data *)userdata;
if (watch_data == NULL) {
AGM_LOGD("%s: Watch data is NULL\n", __func__);
return;
}
if (watch_data->watch_id > 0) {
g_source_remove(watch_data->watch_id);
watch_data->watch_id = 0;
}
if (watch_data->conn)
dbus_connection_unref(watch_data->conn);
if (watch_data)
free(watch_data);
}
static void agm_remove_dbus_watch_cb(DBusWatch *watch, void *userdata) {
if (dbus_watch_get_enabled(watch))
return;
/* Triggers agm_free_dbus_watch_data which is set in agm_add_dbus_watch_cb*/
dbus_watch_set_data(watch, NULL, NULL);
}
static gboolean agm_cond_watch_cb(GIOChannel *channel,
GIOCondition io_condition,
gpointer userdata) {
agm_dbus_watch_data *watch_data = (agm_dbus_watch_data *)userdata;
unsigned int flags = 0;
flags |= (io_condition & G_IO_IN ? DBUS_WATCH_READABLE : 0) |
(io_condition & G_IO_OUT ? DBUS_WATCH_WRITABLE : 0) |
(io_condition & G_IO_HUP ? DBUS_WATCH_HANGUP : 0) |
(io_condition & G_IO_ERR ? DBUS_WATCH_ERROR : 0);
/* Notifies the D-Bus library when a previously-added watch is ready for
reading or writing or has an exception */
if (dbus_watch_handle(watch_data->watch, flags) == false)
AGM_LOGE("dbus_watch_handle() failed\n");
agm_handle_dispatch_status(watch_data->conn,
dbus_connection_get_dispatch_status(watch_data->conn),
(void *)userdata);
return true;
}
static dbus_bool_t agm_add_dbus_watch_cb(DBusWatch *watch, void *userdata) {
agm_dbus_connection *conn = (agm_dbus_connection *) userdata;
agm_dbus_watch_data *watch_data = NULL;
dbus_bool_t status;
GIOChannel *channel;
int watch_fd;
unsigned int watch_flags;
GIOCondition io_condition;
if (conn->conn == NULL) {
AGM_LOGE("%s: Connection is NULL\n", __func__);
return -1;
}
status = dbus_watch_get_enabled(watch);
if (!status)
return true;
watch_data = (agm_dbus_watch_data *)calloc(1, sizeof(agm_dbus_watch_data));
if (watch_data == NULL) {
AGM_LOGE("%s: Couldn't allocate memory for watch_data\n", __func__);
return false;
}
/* Gets unix file descriptor for DBusWatch object we want to watch */
watch_data->watch_fd = dbus_watch_get_unix_fd(watch);
/* Creates a new GIOChannel given a file descriptor */
channel = g_io_channel_unix_new(watch_data->watch_fd);
watch_data->watch = watch;
watch_data->conn = dbus_connection_ref(conn->conn);
/* Sets data which can be retrieved with dbus_watch_get_data() */
dbus_watch_set_data(watch_data->watch, watch_data, agm_free_dbus_watch_data);
/* Dbus flags indicating the conditions to be monitored on the dbus watch */
watch_flags = dbus_watch_get_flags(watch_data->watch);
if (watch_flags & DBUS_WATCH_READABLE) {
io_condition = G_IO_IN;
io_condition = (GIOCondition)(io_condition | (G_IO_HUP | G_IO_ERR));
} else if (watch_flags & DBUS_WATCH_WRITABLE) {
io_condition = G_IO_OUT;
io_condition = (GIOCondition) (io_condition | (G_IO_HUP | G_IO_ERR));
} else {
io_condition = (GIOCondition) (G_IO_HUP | G_IO_ERR);
}
/* Adds IOChannel to default main loop and calls the provided function
whenever condition is satisfied */
watch_data->watch_id = g_io_add_watch_full(channel,
G_PRIORITY_DEFAULT,
io_condition,
agm_cond_watch_cb,
watch_data,
agm_free_dbus_watch_data);
g_io_channel_unref(channel);
return true;
}
static void agm_toggle_dbus_watch_cb(DBusWatch *watch, void *userdata) {
if (dbus_watch_get_enabled(watch))
agm_add_dbus_watch_cb(watch, userdata);
else
agm_remove_dbus_watch_cb(watch, userdata);
}
static void agm_free_dbus_timeout_data(void *userdata) {
agm_dbus_timeout_data *timeout_data = (agm_dbus_timeout_data *)userdata;
if (timeout_data == NULL) {
AGM_LOGE("%s: Timeout data is NULL\n", __func__);
return;
}
if (timeout_data->timeout_id > 0) {
/* Removes the source with the given ID from the default main context.*/
g_source_remove(timeout_data->timeout_id);
timeout_data->timeout_id = 0;
}
dbus_connection_unref(timeout_data->conn);
free(timeout_data);
}
static gboolean agm_timeout_dispatch_cb(gpointer userdata) {
agm_dbus_timeout_data *timeout_data = (agm_dbus_timeout_data *)userdata;
timeout_data->timeout_id = 0;
/* if not enabled should not be polled by the main loop */
if (!dbus_timeout_get_enabled(timeout_data->timeout))
return FALSE;
dbus_timeout_handle(timeout_data->timeout);
return FALSE;
}
static void agm_remove_dbus_timeout_cb(DBusTimeout *timeout, void *userdata) {
/* This will trigger agm_free_dbus_timeout_data() */
dbus_timeout_set_data(timeout, NULL, NULL);
}
static dbus_bool_t agm_add_dbus_timeout_cb(DBusTimeout *timeout,
void *userdata) {
int interval;
agm_dbus_connection *conn = (agm_dbus_connection *) userdata;
agm_dbus_timeout_data *timeout_data = NULL;
dbus_bool_t status;
if (conn->conn == NULL) {
AGM_LOGE("%s: Connection is NULL\n", __func__);
return -1;
}
status = dbus_timeout_get_enabled(timeout);
if (!status)
return true;
timeout_data = (agm_dbus_timeout_data *)
calloc(1, sizeof(agm_dbus_timeout_data));
if (timeout_data == NULL) {
AGM_LOGE("%s: Couldn't allocate memory for timeout_data\n", __func__);
return false;
}
interval = dbus_timeout_get_interval(timeout);
timeout_data->conn = dbus_connection_ref(conn->conn);
timeout_data->timeout = timeout;
/* Sets data which can be retrieved with dbus_timeout_get_data() */
dbus_timeout_set_data(timeout_data->timeout,
timeout_data,
agm_free_dbus_timeout_data);
/* Sets a function to be called at regular intervals
with the given priority */
timeout_data->timeout_id = g_timeout_add_full(G_PRIORITY_DEFAULT,
interval,
agm_timeout_dispatch_cb,
timeout_data,
agm_free_dbus_timeout_data);
return true;
}
static void agm_toggle_dbus_timeout_cb(DBusTimeout *timeout, void *userdata) {
if (dbus_timeout_get_enabled(timeout))
agm_add_dbus_timeout_cb(timeout, userdata);
else
agm_remove_dbus_timeout_cb(timeout, userdata);
}
int agm_setup_dbus_with_main_loop(agm_dbus_connection *conn) {
if (conn == NULL) {
AGM_LOGE("%s: Connection object is NULL\n", __func__);
return -1;
}
if (!dbus_connection_set_watch_functions(conn->conn,
agm_add_dbus_watch_cb,
agm_remove_dbus_watch_cb,
agm_toggle_dbus_watch_cb,
conn,
NULL)) {
AGM_LOGE("%s: dbus_connection_set_watch_functions failed\n", __func__);
return -1;
}
if (!dbus_connection_set_timeout_functions(conn->conn,
agm_add_dbus_timeout_cb,
agm_remove_dbus_timeout_cb,
agm_toggle_dbus_timeout_cb,
conn,
NULL)) {
AGM_LOGE("%s: dbus_connection_set_timeout_functions failed\n", __func__);
return -1;
}
dbus_connection_set_dispatch_status_function(conn->conn,
agm_handle_dispatch_status,
conn,
NULL);
return 0;
}
static void unregister_object(agm_dbus_connection *conn,
agm_dbus_object *object) {
dbus_connection_unregister_object_path(conn->conn, object->obj_path);
}
void agm_dbus_send_signal(agm_dbus_connection *conn, DBusMessage *signal_msg) {
DBusMessage *signal_copy;
signal_copy = dbus_message_copy(signal_msg);
dbus_connection_send(conn->conn, signal_copy, NULL);
dbus_message_unref(signal_copy);
}
void agm_dbus_send_error(agm_dbus_connection *conn,
DBusMessage *msg,
char *dbus_error,
char *error) {
DBusMessage *reply = NULL;
reply = dbus_message_new_error(msg, dbus_error, error);
dbus_connection_send(conn->conn, reply, NULL);
dbus_message_unref(reply);
return;
}
void agm_free_signal(gpointer data) {
agm_dbus_signal *signal = (agm_dbus_signal *)data;
if(signal == NULL)
return;
free(signal);
signal = NULL;
}
void agm_free_method(gpointer data) {
agm_dbus_method *method = (agm_dbus_method *)data;
if(method == NULL)
return;
free(method);
method = NULL;
}
void agm_free_interface(gpointer data) {
agm_dbus_interface *interface = (agm_dbus_interface *)data;
if(interface == NULL)
return;
g_hash_table_remove_all(interface->methods);
g_hash_table_unref(interface->methods);
g_hash_table_remove_all(interface->signals);
g_hash_table_unref(interface->signals);
free(interface);
interface = NULL;
}
void agm_free_object(gpointer data) {
agm_dbus_object *object = (agm_dbus_object *)data;
if(object == NULL)
return;
g_hash_table_remove_all(object->interfaces);
g_hash_table_unref(object->interfaces);
free(object);
object = NULL;
}
int agm_dbus_remove_interface(agm_dbus_connection *conn,
const char *dbus_obj_path,
const char *interface_path) {
agm_dbus_object *object = NULL;
agm_dbus_interface *interface = NULL;
if (conn == NULL || dbus_obj_path == NULL || interface_path == NULL)
return -1;
if ((object = (agm_dbus_object *)
g_hash_table_lookup(conn->objects, dbus_obj_path)) == NULL)
return -1;
if ((interface = (agm_dbus_interface *)
g_hash_table_lookup(object->interfaces, interface_path)) == NULL)
return -1;
g_hash_table_remove(object->interfaces,interface_path);
interface = NULL;
if (g_hash_table_size(object->interfaces) == 0) {
unregister_object(conn, object);
g_hash_table_remove(conn->objects, (void *)object->obj_path);
object = NULL;
}
return 0;
}
int agm_dbus_add_interface(agm_dbus_connection *conn,
const char *dbus_obj_path,
agm_dbus_interface_info *interface_info,
void *userdata) {
DBusError err;
int i = 0;
agm_dbus_object *object = NULL;
agm_dbus_interface *interface = NULL;
agm_dbus_method *method = NULL;
agm_dbus_signal *signal = NULL;
if ((conn == NULL) || conn->conn == NULL || conn->objects == NULL) {
AGM_LOGE("Connection not initialized\n");
return -EINVAL;
}
if (dbus_obj_path == NULL) {
AGM_LOGE("Invalid object path\n");
return -EINVAL;
}
if (interface_info == NULL) {
AGM_LOGE("Invalid interface\n");
return -EINVAL;
}
dbus_error_init(&err);
if ((object = (agm_dbus_object *)
g_hash_table_lookup(conn->objects, dbus_obj_path)) == NULL) {
object = (agm_dbus_object *)malloc(sizeof(agm_dbus_object));
object->obj_path = dbus_obj_path;
object->interfaces = g_hash_table_new_full(g_str_hash,
g_str_equal,
NULL,
agm_free_interface);
interface = (agm_dbus_interface *)malloc(sizeof(agm_dbus_interface));
interface->name = interface_info->name;
interface->methods = g_hash_table_new_full(g_str_hash,
g_str_equal,
NULL,
agm_free_method);
for (i = 0; i < interface_info->method_count; i++) {
method = (agm_dbus_method *)malloc(sizeof(agm_dbus_method));
method->method_name = interface_info->methods[i].method_name;
method->method_signature =
interface_info->methods[i].method_signature;
method->cb_func = interface_info->methods[i].cb_func;
g_hash_table_insert(interface->methods,
g_strdup(method->method_name),
method);
}
interface->signals = g_hash_table_new_full(g_str_hash,
g_str_equal,
NULL,
agm_free_signal);
for (i = 0; i < interface_info->signal_count; i++) {
signal = (agm_dbus_signal *)malloc(sizeof(agm_dbus_signal));
signal->method_name = interface_info->signals[i].method_name;
signal->method_signature =
interface_info->signals[i].method_signature;
g_hash_table_insert(interface->signals,
g_strdup(signal->method_name),
signal);
}
interface->userdata = userdata;
g_hash_table_insert(object->interfaces,
g_strdup(interface->name),
interface);
g_hash_table_insert(conn->objects, g_strdup(object->obj_path), object);
if (!dbus_connection_register_object_path(conn->conn,
dbus_obj_path,
&vtable,
conn)) {
AGM_LOGE("Failed to register a object path for agm\n");
dbus_error_free(&err);
return -EINVAL;
}
AGM_LOGE("Registered object %s", dbus_obj_path);
} else {
if ((interface = (agm_dbus_interface *)
g_hash_table_lookup(object->interfaces,
interface_info->name)) == NULL) {
interface = (agm_dbus_interface *)
malloc(sizeof(agm_dbus_interface));
interface->name = interface_info->name;
interface->signals = NULL;
interface->methods = NULL;
if (interface_info->methods != NULL) {
interface->methods = g_hash_table_new_full(g_str_hash,
g_str_equal,
NULL,
agm_free_method);
for (i = 0; i < interface_info->method_count; i++) {
method = (agm_dbus_method *)malloc(sizeof(agm_dbus_method));
method->method_name =
interface_info->methods[i].method_name;
method->method_signature =
interface_info->methods[i].method_signature;
method->cb_func = interface_info->methods[i].cb_func;
g_hash_table_insert(interface->methods,
g_strdup(method->method_name),
method);
}
}
if (interface_info->signals != NULL) {
interface->signals = g_hash_table_new_full(g_str_hash,
g_str_equal,
NULL,
agm_free_signal);
for (i = 0; i < interface_info->signal_count; i++) {
signal = (agm_dbus_signal *)malloc(sizeof(agm_dbus_signal));
signal->method_name =
interface_info->signals[i].method_name;
signal->method_signature =
interface_info->signals[i].method_signature;
g_hash_table_insert(interface->signals,
g_strdup(signal->method_name),
signal);
}
}
interface->userdata = userdata;
g_hash_table_insert(object->interfaces,
g_strdup(interface->name),
interface);
}
}
dbus_error_free(&err);
return 0;
}
void agm_dbus_connection_free(agm_dbus_connection *conn) {
if (conn == NULL) {
AGM_LOGE("Connection is NULL\n");
return;
}
g_hash_table_remove_all(conn->objects);
g_hash_table_unref(conn->objects);
free(conn);
conn = NULL;
}
agm_dbus_connection *agm_dbus_new_connection() {
int rc = 0;
DBusError err;
agm_dbus_connection *conn = NULL;
conn = (agm_dbus_connection *)malloc(sizeof(agm_dbus_connection));
conn->objects = NULL;
dbus_error_init(&err);
conn->conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
if (conn->conn == NULL) {
AGM_LOGE("Failed to request name on bus: %s\n", err.message);
free(conn);
dbus_error_free(&err);
return NULL;
}
conn->objects = g_hash_table_new_full(g_str_hash,
g_str_equal,
NULL,
agm_free_object);
dbus_error_free(&err);
return conn;
}

View File

@@ -0,0 +1,111 @@
/*
** Copyright (c) 2020, The Linux Foundation. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above
** copyright notice, this list of conditions and the following
** disclaimer in the documentation and/or other materials provided
** with the distribution.
** * Neither the name of The Linux Foundation nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
** BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
** OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
** IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/
/*
** Changes from Qualcomm Innovation Center are provided under the following license:
** Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted (subject to the limitations in the
** disclaimer below) provided that the following conditions are met:
**
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
**
** * Redistributions in binary form must reproduce the above
** copyright notice, this list of conditions and the following
** disclaimer in the documentation and/or other materials provided
** with the distribution.
**
** * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
** GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
** HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
** GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
** IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
** OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
** IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/
#define LOG_TAG "agm_server_daemon"
#include <glib.h>
#include <signal.h>
#include <stdio.h>
#include "agm_server_wrapper_dbus.h"
#include <utils.h>
GMainLoop *mainloop = NULL;
void signal_handler(int sig) {
switch (sig) {
case SIGINT:
case SIGTERM:
case SIGABRT:
case SIGQUIT:
case SIGKILL:
default:
AGM_LOGE("Terminating signal received\n");
ipc_agm_deinit();
g_main_loop_quit(mainloop);
break;
}
}
int main() {
int rc = 0;
mainloop = g_main_loop_new(NULL, false);
rc = ipc_agm_init();
if (rc != 0) {
AGM_LOGE("AGM init failed\n");
return rc;
}
AGM_LOGD("agm init done\n");
signal(SIGINT, signal_handler);
signal(SIGTERM, signal_handler);
signal(SIGQUIT, signal_handler);
signal(SIGKILL, signal_handler);
signal(SIGABRT, signal_handler);
g_main_loop_run(mainloop);
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
# IPC
IPC Binders implememtations

View File

@@ -0,0 +1,25 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := agmclient
LOCAL_SRC_FILES := agm_client_wrapper.cpp
LOCAL_SHARED_LIBRARIES := \
liblog \
libcutils \
libdl \
libbinder \
libutils \
libagmproxy
LOCAL_CFLAGS += -Wall
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DYNAMIC_LOG)), true)
LOCAL_CFLAGS += -DDYNAMIC_LOG_ENABLED
LOCAL_C_INCLUDES += $(TOP)/external/expat/lib/expat.h
LOCAL_SHARED_LIBRARIES += libaudio_log_utils
LOCAL_SHARED_LIBRARIES += libexpat
LOCAL_HEADER_LIBRARIES += libaudiologutils_headers
endif
include $(BUILD_EXECUTABLE)

View File

@@ -0,0 +1,9 @@
AM_CPPFLAGS := -I $(top_srcdir) -I $(PKG_CONFIG_SYSROOT_DIR)/usr/include/agm/
AM_CPPFLAGS += -DDYNAMIC_LOG_ENABLED
lib_LTLIBRARIES = libagmclientwrapper.la
libagmclientwrapper_ladir = $(libdir)
libagmclientwrapper_la_SOURCES = src/agm_client_wrapper.cpp
libagmclientwrapper_la_CPPFLAGS := $(AM_CPPFLAGS)
libagmclientwrapper_la_LDFLAGS = -lcutils -llog -ldl -lbinder -shared -avoid-version -lutils -lrt
libagmclientwrapper_la_LIBADD = -lagmproxy -laudio_log_utils

View File

@@ -0,0 +1,10 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: agmclient
Description: agmclient library
Version: @VERSION@
Libs: -L${libdir} -lagmproxy
Cflags: -I${includedir}/agm_client/

View File

@@ -0,0 +1,41 @@
# -*- Autoconf -*-
# configure.ac -- Autoconf script for halinterface
#
# Process this file with autoconf to produce a configure script.
# Requires autoconf tool later than 2.61
AC_PREREQ([2.69])
# Initialize the hal-interface package version 1.0.0
AC_INIT(halinterface,1.0.0)
# Does not strictly follow GNU Coding standards
AM_INIT_AUTOMAKE([foreign])
# Disables auto rebuilding of configure, Makefile.ins
#AM_MAINTAINER_MODE
# defines some macros variable to be included by source
AC_CONFIG_HEADERS([config.h])
# defines some macros variable to be included by source
AC_CONFIG_MACRO_DIR([m4])
PKG_CHECK_MODULES([AGMSERVER], [agmserver])
AC_SUBST([AGMSERVER_CFLAGS])
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_LIBTOOL
AC_PROG_AWK
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
AC_CONFIG_FILES([ \
Makefile\
agmclient.pc
])
AC_OUTPUT

View File

@@ -0,0 +1,523 @@
/*
** Copyright (c) 2019, The Linux Foundation. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above
** copyright notice, this list of conditions and the following
** disclaimer in the documentation and/or other materials provided
** with the distribution.
** * Neither the name of The Linux Foundation nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
** BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
** OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
** IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Changes from Qualcomm Innovation Center are provided under the following license:
* Copyright (c) 2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted (subject to the limitations in the
* disclaimer below) provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
* GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
* HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/
#define LOG_TAG "agm_client_wrapper"
#include <binder/ProcessState.h>
#include <binder/IServiceManager.h>
#include <binder/IInterface.h>
#include <binder/IBinder.h>
#include <log/log.h>
#include <utils/Log.h>
#ifdef FEATURE_IPQ_OPENWRT
#include <ipc_interface.h>
#include <agm_death_notifier.h>
#else
#include <qti-agm-service/ipc_interface.h>
#include <qti-agm-service/agm_death_notifier.h>
#endif
#include <agm/agm_api.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <sys/shm.h>
#include <sys/stat.h>
#include <utils/RefBase.h>
#include <binder/IPCThreadState.h>
#include <pthread.h>
#include "utils.h"
#ifdef DYNAMIC_LOG_ENABLED
#include <log_xml_parser.h>
#define LOG_MASK AGM_MOD_FILE_AGM_CLIENT_WRAPPER
#include <log_utils.h>
#endif
using namespace android;
sp<server_death_notifier> Server_death_notifier = NULL;
sp<IAgmService> agm_client = NULL;
bool agm_server_died = false;
android::sp<IAgmService> get_agm_server()
{
if (agm_client == 0) {
AGM_LOGD("Agm client initialized\n");
android:: sp<android::IBinder> binder =
android::defaultServiceManager()->getService(android::String16("AgmService"));
agm_client = android::interface_cast<IAgmService>(binder);
AGM_LOGV("got service handle\n");
if (Server_death_notifier == NULL) {
Server_death_notifier = new server_death_notifier();
binder->linkToDeath(Server_death_notifier);
AGM_LOGV("%s : server linked to death \n", __func__);
}
}
return agm_client;
}
server_death_notifier::server_death_notifier()
{
AGM_LOGV("%s\n", __func__);
sp<ProcessState> proc(ProcessState::self());
proc->startThreadPool();
}
void server_death_notifier::binderDied(const wp<IBinder>& who __attribute__((unused)))
{
agm_server_died = true;
AGM_LOGE("Agm server died !! and I am notified\n");
//add further functionality
}
int agm_register_service_crash_callback(agm_service_crash_cb cb, uint64_t cookie)
{
return 0;
}
int agm_aif_set_media_config(uint32_t audio_intf,
struct agm_media_config *media_config)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_audio_intf_set_media_config(audio_intf,
media_config);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_set_config(uint64_t handle,
struct agm_session_config *session_config,
struct agm_media_config *media_config,
struct agm_buffer_config *buffer_config)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_set_config(handle, session_config,
media_config, buffer_config);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_init(){
/*agm_init in IPC happens in context of the server*/
return 0;
}
int agm_deinit(){
/*agm_deinit in IPC happens in context of the server*/
return 0;
}
int agm_aif_set_metadata(uint32_t audio_intf, uint32_t size, uint8_t *metadata){
if(!agm_server_died)
{
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_audio_intf_set_metadata(audio_intf, size,
metadata);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_set_metadata(uint32_t session_id, uint32_t size,
uint8_t *metadata){
if(!agm_server_died)
{
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_set_metadata(session_id, size,
metadata);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_aif_set_metadata(uint32_t session_id, uint32_t audio_intf,
uint32_t size, uint8_t *metadata){
if(!agm_server_died)
{
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_audio_inf_set_metadata(session_id,
audio_intf, size, metadata);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_close(uint64_t handle)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_close(handle);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_prepare(uint64_t handle)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_prepare(handle);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_start(uint64_t handle)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_start(handle);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_stop(uint64_t handle)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_stop(handle);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_pause(uint64_t handle)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_pause(handle);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_resume(uint64_t handle)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_resume(handle);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_open(uint32_t session_id,
enum agm_session_mode sess_mode,
uint64_t *handle)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_open(session_id, sess_mode, handle);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_aif_connect(uint32_t session_id, uint32_t audio_intf,
bool state)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_audio_inf_connect(session_id,
audio_intf, state);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_read(uint64_t handle, void *buf, size_t *byte_count)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
if (!handle)
return -EINVAL;
return agm_client->ipc_agm_session_read(handle, buf, byte_count);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_write(uint64_t handle, void *buf, size_t *byte_count)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
if (!handle)
return -EINVAL;
return agm_client->ipc_agm_session_write(handle, buf, byte_count);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_set_loopback(uint32_t capture_session_id,
uint32_t playback_session_id, bool state)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_set_loopback(capture_session_id,
playback_session_id, state);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
size_t agm_get_hw_processed_buff_cnt(uint64_t handle, enum direction dir)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_get_hw_processed_buff_cnt(handle, dir);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_get_aif_info_list(struct aif_info *aif_list, size_t *num_aif_info)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_get_aif_info_list(aif_list, num_aif_info);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_aif_get_tag_module_info(uint32_t session_id, uint32_t aif_id,
void *payload, size_t *size)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_aif_get_tag_module_info(session_id,
aif_id, payload, size);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_aif_set_params(uint32_t aif_id,void *payload, size_t size)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_aif_set_params(aif_id,
payload, size);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_aif_set_params(uint32_t session_id, uint32_t aif_id,
void *payload, size_t size)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_aif_set_params(session_id, aif_id,
payload, size);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_set_params(uint32_t session_id, void *payload, size_t size)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_set_params(session_id, payload,
size);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_set_params_with_tag(uint32_t session_id, uint32_t aif_id,
struct agm_tag_config *tag_config)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_set_params_with_tag(session_id, aif_id,
tag_config);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_register_for_events(uint32_t session_id,
struct agm_event_reg_cfg *evt_reg_cfg)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_register_for_events(session_id,
evt_reg_cfg);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_register_cb(uint32_t session_id, agm_event_cb cb,
enum event_type event, void *client_data)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_register_cb(session_id, cb, event,
client_data);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_set_ec_ref(uint32_t capture_session_id, uint32_t aif_id,
bool state)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_set_ec_ref(capture_session_id,
aif_id, state);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_aif_set_cal(uint32_t session_id, uint32_t audio_intf,
struct agm_cal_config *cal_config)
{
if (!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_aif_set_cal(session_id, audio_intf,
cal_config);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_eos(uint64_t handle)
{
if(!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_eos(handle);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_get_session_time(uint64_t handle, uint64_t *timestamp)
{
if(!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_get_session_time(handle, timestamp);
}
AGM_LOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_get_params(uint32_t session_id, void *payload, size_t size)
{
if(!agm_server_died)
{
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_get_params(session_id, payload, size);
}
ALOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_get_buffer_timestamp(uint32_t session_id, uint64_t *timestamp)
{
if(!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_get_buffer_timestamp(session_id, timestamp);
}
ALOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_set_gapless_session_metadata(uint64_t handle,
enum agm_gapless_silence_type type,
uint32_t silence)
{
if(!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_set_gapless_session_metadata(handle, type,
silence);
}
ALOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}
int agm_session_get_buf_info(uint32_t session_id, struct agm_buf_info *buf_info,
uint32_t flag)
{
if(!agm_server_died) {
android::sp<IAgmService> agm_client = get_agm_server();
return agm_client->ipc_agm_session_get_buf_info(session_id, buf_info,
flag);
}
ALOGE("%s: agm service is not running\n", __func__);
return -EAGAIN;
}

View File

@@ -0,0 +1,43 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_CFLAGS += -Wall
LOCAL_SRC_FILES := ipc_proxy_server.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH)
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_SHARED_LIBRARIES := \
liblog \
libcutils \
libdl \
libbinder \
libutils
LOCAL_MODULE := libagmproxy
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := agmserver
LOCAL_SRC_FILES := \
agm_server_daemon.cpp \
agm_server_wrapper.cpp
LOCAL_SHARED_LIBRARIES := \
liblog \
libcutils \
libdl \
libbinder \
libutils \
libagmproxy
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DYNAMIC_LOG)), true)
LOCAL_CFLAGS += -DDYNAMIC_LOG_ENABLED
LOCAL_C_INCLUDES += $(TOP)/external/expat/lib/expat.h
LOCAL_SHARED_LIBRARIES += libaudio_log_utils
LOCAL_SHARED_LIBRARIES += libexpat
LOCAL_HEADER_LIBRARIES += libaudiologutils_headers
endif
include $(BUILD_EXECUTABLE)

View File

@@ -0,0 +1,36 @@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = agmserver.pc
EXTRA_DIST = $(pkgconfig_DATA)
h_sources = $(top_srcdir)/inc/ipc_interface.h
h_sources += $(top_srcdir)/inc/agm_death_notifier.h
h_sources += $(top_srcdir)/inc/agm_callback.h
AM_CPPFLAGS := -I $(top_srcdir) -I $(PKG_CONFIG_SYSROOT_DIR)/usr/include/agm/\
-I $(PKG_CONFIG_SYSROOT_DIR)/usr/include/qti-agm-service\
-I ${top_srcdir}/inc
AM_CPPFLAGS += -D__unused=__attribute__\(\(__unused__\)\)
AM_CPPFLAGS += -DDYNAMIC_LOG_ENABLED
library_include_HEADERS = $(h_sources)
library_includedir = $(includedir)/qti-agm-service/
lib_LTLIBRARIES = libagmserverwrapper.la
libagmserverwrapper_la_SOURCES = ${top_srcdir}/src/agm_death_notifier.cpp ${top_srcdir}/src/agm_server_wrapper.cpp ${top_srcdir}/src/agm_callback.cpp
libagmserverwrapper_la_CPPFLAGS := $(AM_CPPFLAGS)
libagmserverwrapper_la_LIBADD = -lagm -laudio_log_utils
libagmserverwrapper_la_LDFLAGS = -lcutils -llog -ldl -lbinder -shared -avoid-version -lutils -lpthread
lib_LTLIBRARIES += libagmproxy.la
libagmproxy_la_SOURCES = ${top_srcdir}/src/ipc_proxy_server.cpp
libagmproxy_la_CPPFLAGS := $(AM_CPPFLAGS)
libagmproxy_la_LIBADD = libagmserverwrapper.la
libagmproxy_la_LDFLAGS = -lcutils -llog -ldl -lbinder -shared -avoid-version -lutils -lpthread
bin_PROGRAMS := agm_server
agm_server_SOURCES := ${top_srcdir}/src/agm_server_daemon.cpp
agmserver_la_CPPFLAGS := $(AM_CPPFLAGS)
agm_server_LDADD := libagmproxy.la -laudio_log_utils
agmserver_la_LDFLAGS = -lcutils -llog -ldl -lbinder -shared -avoid-version -lutils

View File

@@ -0,0 +1,8 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: agmserver
Description: agmserver library
Version: @VERSION@

View File

@@ -0,0 +1,37 @@
# -*- Autoconf -*-
# configure.ac -- Autoconf script for halinterface
#
# Process this file with autoconf to produce a configure script.
# Requires autoconf tool later than 2.61
AC_PREREQ([2.69])
# Initialize the hal-interface package version 1.0.0
AC_INIT(halinterface,1.0.0)
# Does not strictly follow GNU Coding standards
AM_INIT_AUTOMAKE([foreign])
# Disables auto rebuilding of configure, Makefile.ins
#AM_MAINTAINER_MODE
# defines some macros variable to be included by source
AC_CONFIG_HEADERS([config.h])
# defines some macros variable to be included by source
AC_CONFIG_MACRO_DIR([m4])
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_LIBTOOL
AC_PROG_AWK
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
AC_CONFIG_FILES([ \
Makefile \
agmserver.pc
])
AC_OUTPUT

View File

@@ -0,0 +1,78 @@
/*
** Copyright (c) 2019, The Linux Foundation. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above
** copyright notice, this list of conditions and the following
** disclaimer in the documentation and/or other materials provided
** with the distribution.
** * Neither the name of The Linux Foundation nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
** BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
** OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
** IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/
#include <stdlib.h>
#include <utils/RefBase.h>
#include <utils/Log.h>
#include <binder/TextOutput.h>
#include <cutils/list.h>
#include <binder/IInterface.h>
#include <binder/IBinder.h>
#include <binder/ProcessState.h>
#include <binder/IServiceManager.h>
#include <binder/IPCThreadState.h>
#include <binder/IPCThreadState.h>
#include <agm/agm_api.h>
using namespace android;
class ICallback : public ::android::IInterface
{
public:
DECLARE_META_INTERFACE(Callback);
virtual int event_cb (uint32_t session_id,
struct agm_event_cb_params *event_params,
void *client_data, agm_event_cb cb_func) = 0;
};
class BnCallback : public ::android::BnInterface<ICallback>
{
public:
BnCallback(){};
~BnCallback(){};
private:
int32_t onTransact(uint32_t code,
const Parcel& data,
Parcel* reply,
uint32_t flags) override;
int event_cb (uint32_t session_id,
struct agm_event_cb_params *event_params,
void *client_data, agm_event_cb cb_func) override;
};
typedef struct {
struct listnode list;
uint32_t session_id;
sp<ICallback> cb_binder;
agm_event_cb cb_func;
void * client_data;
}clbk_data ;

View File

@@ -0,0 +1,101 @@
/*
** Copyright (c) 2019, The Linux Foundation. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above
** copyright notice, this list of conditions and the following
** disclaimer in the documentation and/or other materials provided
** with the distribution.
** * Neither the name of The Linux Foundation nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
** BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
** OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
** IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/
#include <stdlib.h>
#include <utils/RefBase.h>
#include <utils/Log.h>
#include <binder/TextOutput.h>
#include <binder/IInterface.h>
#include <binder/IBinder.h>
#include <binder/ProcessState.h>
#include <binder/IServiceManager.h>
#include <binder/IPCThreadState.h>
#include <cutils/list.h>
#include "utils.h"
using namespace android;
class IAGMClient : public ::android::IInterface
{
public:
DECLARE_META_INTERFACE(AGMClient);
};
class DummyBnClient : public ::android::BnInterface<IAGMClient>
{
public:
DummyBnClient(){
AGM_LOGV("Constructor of DummyBnClient called\n");
}
~DummyBnClient(){
AGM_LOGV("Destructor of DummyBnClient called\n");
}
private:
int32_t onTransact(uint32_t code,
const Parcel& data,
Parcel* reply,
uint32_t flags) override;
};
class server_death_notifier : public IBinder::DeathRecipient
{
public:
server_death_notifier();
// DeathRecipient
virtual void binderDied(const android::wp<IBinder>& who);
};
class client_death_notifier : public IBinder::DeathRecipient
{
public:
client_death_notifier();
// DeathRecipient
virtual void binderDied(const android::wp<IBinder>& who);
};
typedef struct {
struct listnode list;
uint64_t handle;
//bool rx;
} agm_client_session_handle;
typedef struct {
struct listnode list;
sp<IAGMClient> binder;
pid_t pid;
sp<client_death_notifier> Client_death_notifier;
struct listnode agm_client_hndl_list;
} client_info;
client_info *get_client_handle_from_list(pid_t pid);
void agm_register_client(sp<IBinder> binder);
void agm_unregister_client(sp<IBinder> binder);
void agm_add_session_obj_handle(uint64_t handle);
void agm_remove_session_obj_handle(uint64_t handle);

View File

@@ -0,0 +1,164 @@
/*
** Copyright (c) 2019, 2021 The Linux Foundation. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above
** copyright notice, this list of conditions and the following
** disclaimer in the documentation and/or other materials provided
** with the distribution.
** * Neither the name of The Linux Foundation nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
** BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
** OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
** IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Changes from Qualcomm Innovation Center are provided under the following license:
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted (subject to the limitations in the
* disclaimer below) provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
* GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
* HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/
#ifndef __Agm_SERVER_H__
#define __Agm_SERVER_H__
#include <utils/Log.h>
#include <agm/agm_api.h>
#include "ipc_interface.h"
#include "utils.h"
class AgmService : public BnAgmService
{
public:
AgmService()
{
AGM_LOGV("AGMService constructor\n");
agm_initialized = ((agm_init() == 0)?true:false);
}
virtual int ipc_agm_init();
virtual int ipc_agm_audio_intf_set_metadata(uint32_t audio_intf,
uint32_t size, uint8_t *metadata);
virtual int ipc_agm_session_set_metadata(uint32_t session_id,
uint32_t size, uint8_t *metadata);
virtual int ipc_agm_session_audio_inf_set_metadata(uint32_t session_id,
uint32_t audio_intf, uint32_t size,
uint8_t *metadata);
virtual int ipc_agm_session_close(uint64_t handle);
virtual int ipc_agm_audio_intf_set_media_config(uint32_t audio_intf,
struct agm_media_config *media_config);
virtual int ipc_agm_session_prepare(uint64_t handle);
virtual int ipc_agm_session_start(uint64_t handle);
virtual int ipc_agm_session_stop(uint64_t handle);
virtual int ipc_agm_session_pause(uint64_t handle);
virtual int ipc_agm_session_resume(uint64_t handle);
virtual int ipc_agm_session_open(uint32_t session_id,
enum agm_session_mode sess_mode,
uint64_t *handle);
virtual int ipc_agm_session_read(uint64_t handle, void *buff,
size_t *count);
virtual int ipc_agm_session_write(uint64_t handle, void *buff,
size_t *count);
virtual int ipc_agm_session_audio_inf_connect(uint32_t session_id,
uint32_t audio_intf, bool state);
virtual int ipc_agm_session_set_loopback(uint32_t capture_session_id,
uint32_t playback_session_id, bool state);
virtual size_t ipc_agm_get_hw_processed_buff_cnt(uint64_t handle,
enum direction dir);
virtual int ipc_agm_get_aif_info_list(struct aif_info *aif_list,
size_t *num_aif_info);
virtual int ipc_agm_session_aif_get_tag_module_info(uint32_t session_id,
uint32_t aif_id, void *payload,
size_t *size);
virtual int ipc_agm_get_params_from_acdb_tunnel(void *payload,
size_t *size);
virtual int ipc_agm_session_aif_set_params(uint32_t session_id,
uint32_t aif_id, void *payload,
size_t size);
virtual int ipc_agm_aif_set_params(uint32_t aif_id,
void* payload, size_t size);
virtual int ipc_agm_session_set_params(uint32_t session_id,
void *payload, size_t size);
virtual int ipc_agm_set_params_with_tag(uint32_t session_id,
uint32_t aif_id,
struct agm_tag_config *tag_config);
virtual int ipc_agm_session_register_for_events(uint32_t session_id,
struct agm_event_reg_cfg *evt_reg_cfg);
virtual int ipc_agm_session_register_cb(uint32_t session_id,
agm_event_cb cb, enum event_type event,
void *client_data) ;
virtual int ipc_agm_session_set_config(
uint64_t handle,
struct agm_session_config *session_config,
struct agm_media_config *media_config,
struct agm_buffer_config *buffer_config);
virtual int ipc_agm_session_set_ec_ref(uint32_t capture_session_id,
uint32_t aif_id, bool state);
virtual int ipc_agm_session_aif_set_cal(
uint32_t session_id,
uint32_t audio_intf,
struct agm_cal_config *cal_config);
virtual int ipc_agm_session_eos(uint64_t handle);
virtual int ipc_agm_get_session_time(uint64_t handle, uint64_t *timestamp);
virtual int ipc_agm_session_get_params(uint32_t session_id,
void *payload, size_t size);
virtual int ipc_agm_get_buffer_timestamp(uint32_t session_id, uint64_t *timestamp);
virtual int ipc_agm_set_gapless_session_metadata(uint64_t handle,
enum agm_gapless_silence_type type, uint32_t silence);
virtual int ipc_agm_session_get_buf_info(uint32_t session_id,
struct agm_buf_info *buf_info, uint32_t flag);
~AgmService()
{
AGM_LOGV("AGMService destructor");
agm_deinit();
}
int is_agm_service_initialized() {
return agm_initialized;
}
private:
bool agm_initialized = false;
};
#endif

View File

@@ -0,0 +1,163 @@
/*
** Copyright (c) 2019, 2021 The Linux Foundation. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above
** copyright notice, this list of conditions and the following
** disclaimer in the documentation and/or other materials provided
** with the distribution.
** * Neither the name of The Linux Foundation nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
** BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
** OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
** IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Changes from Qualcomm Innovation Center are provided under the following license:
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted (subject to the limitations in the
* disclaimer below) provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
* GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
* HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/
#ifndef __AGM_SERVER_INTERFACE_H__
#define __AGM_SERVER_INTERFACE_H__
#include <binder/IInterface.h>
#include <binder/IBinder.h>
#include <binder/ProcessState.h>
#include <binder/IServiceManager.h>
#include <binder/IPCThreadState.h>
#include <agm/agm_api.h>
typedef void shmem_handle_t;
// can be shared by both server and client.
class IAgmService: public ::android::IInterface
{
public:
DECLARE_META_INTERFACE(AgmService);
virtual int ipc_agm_init()= 0;
virtual int ipc_agm_audio_intf_set_metadata(uint32_t audio_intf,
uint32_t size, uint8_t *metadata)= 0;
virtual int ipc_agm_session_set_metadata(uint32_t session_id,
uint32_t size, uint8_t *metadata)= 0;
virtual int ipc_agm_session_audio_inf_set_metadata(uint32_t session_id,
uint32_t audio_intf, uint32_t size,
uint8_t *metadata)= 0;
virtual int ipc_agm_session_close(uint64_t handle)= 0;
virtual int ipc_agm_audio_intf_set_media_config(uint32_t audio_intf,
struct agm_media_config *media_config)= 0;
virtual int ipc_agm_session_prepare(uint64_t handle)= 0;
virtual int ipc_agm_session_start(uint64_t handle)= 0;
virtual int ipc_agm_session_stop(uint64_t handle)= 0;
virtual int ipc_agm_session_pause(uint64_t handle)= 0;
virtual int ipc_agm_session_resume(uint64_t handle)= 0;
virtual int ipc_agm_session_read(uint64_t handle,
void *buff, size_t *count)= 0;
virtual int ipc_agm_session_write(uint64_t handle, void *buff,
size_t *count)= 0;
virtual int ipc_agm_session_audio_inf_connect(uint32_t session_id,
uint32_t audio_intf, bool state) = 0;
virtual int ipc_agm_session_set_loopback(uint32_t capture_session_id,
uint32_t playback_session_id,
bool state) = 0;
virtual size_t ipc_agm_get_hw_processed_buff_cnt(uint64_t handle,
enum direction dir) = 0;
virtual int ipc_agm_get_aif_info_list(struct aif_info *aif_list,
size_t *num_aif_info) = 0;
virtual int ipc_agm_session_open(uint32_t session_id,
enum agm_session_mode sess_mode,
uint64_t *handle) = 0;
virtual int ipc_agm_session_register_for_events(uint32_t session_id,
struct agm_event_reg_cfg *evt_reg_cfg) = 0;
virtual int ipc_agm_session_register_cb(uint32_t session_id,
agm_event_cb cb, enum event_type event,
void *client_data) = 0;
virtual int ipc_agm_session_set_config(
uint64_t handle,
struct agm_session_config *session_config,
struct agm_media_config *media_config,
struct agm_buffer_config *buffer_config) = 0;
virtual int ipc_agm_session_aif_get_tag_module_info(uint32_t session_id,
uint32_t aif_id, void *payload,
size_t *size) = 0;
virtual int ipc_agm_get_params_with_tag_from_acdb(void *payload,
size_t *size) = 0;
virtual int ipc_agm_session_aif_set_params(uint32_t session_id,
uint32_t aif_id, void *payload,
size_t size) = 0;
virtual int ipc_agm_aif_set_params(uint32_t aif_id,
void* payload, size_t size) = 0;
virtual int ipc_agm_session_set_params(uint32_t session_id,
void *payload, size_t size) = 0;
virtual int ipc_agm_set_params_with_tag(uint32_t session_id,
uint32_t aif_id,
struct agm_tag_config *tag_config) = 0;
virtual int ipc_agm_session_set_ec_ref(uint32_t capture_session_id,
uint32_t aif_id, bool state) = 0;
virtual int ipc_agm_session_aif_set_cal(
uint32_t session_id,
uint32_t audio_intf,
struct agm_cal_config *cal_config) = 0;
virtual int ipc_agm_session_eos(uint64_t handle)= 0;
virtual int ipc_agm_get_session_time(uint64_t handle,
uint64_t *timestamp)= 0;
virtual int ipc_agm_session_get_params(uint32_t session_id,
void *payload, size_t size) = 0;
virtual int ipc_agm_get_buffer_timestamp(uint32_t session_id,
uint64_t *timestamp)= 0;
virtual int ipc_agm_set_gapless_session_metadata(uint64_t handle,
enum agm_gapless_silence_type type,
uint32_t silence) = 0;
virtual int ipc_agm_session_get_buf_info(uint32_t session_id,
struct agm_buf_info *buf_info, uint32_t flag) = 0;
};
class BnAgmService : public ::android::BnInterface<IAgmService> {
android::status_t onTransact(uint32_t code,
const android::Parcel& data,
android::Parcel* reply, uint32_t flags);
};
#endif

View File

@@ -0,0 +1,168 @@
/*
** Copyright (c) 2019, The Linux Foundation. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above
** copyright notice, this list of conditions and the following
** disclaimer in the documentation and/or other materials provided
** with the distribution.
** * Neither the name of The Linux Foundation nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
** BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
** OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
** IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/
#define LOG_TAG "agm_callback"
#include <stdlib.h>
#include <utils/RefBase.h>
#include <utils/Log.h>
#include <binder/TextOutput.h>
#include <binder/IInterface.h>
#include <binder/IBinder.h>
#include <binder/ProcessState.h>
#include <binder/IServiceManager.h>
#include <binder/IPCThreadState.h>
#include <binder/MemoryDealer.h>
#include <memory.h>
#include <pthread.h>
#include "agm_callback.h"
#include "utils.h"
#ifndef MIN
#define MIN(a,b) (((a)<(b))?(a):(b))
#endif
#ifndef memscpy
#define memscpy(dst, dst_size, src, bytes_to_copy) (void) \
memcpy(dst, src, MIN(dst_size, bytes_to_copy))
#endif
#ifdef DYNAMIC_LOG_ENABLED
#include <log_xml_parser.h>
#define LOG_MASK AGM_MOD_FILE_AGM_CALLBACK
#include <log_utils.h>
#endif
using namespace android;
const android::String16 ICallback::descriptor("ICallback");
const android::String16& ICallback::getInterfaceDescriptor() const
{
return ICallback::descriptor;
}
class BpCallback: public ::android:: BpInterface<ICallback>
{
public:
BpCallback(const sp<IBinder>& impl) : BpInterface<ICallback>(impl)
{
AGM_LOGD("BpCallback::BpCallback()\n");
}
int event_cb(uint32_t session_id, struct agm_event_cb_params *event_params,
void *client_data, agm_event_cb cb_func)
{
AGM_LOGV("%s %d\n", __func__, __LINE__);
android::Parcel data, reply;
data.writeInterfaceToken(ICallback::getInterfaceDescriptor());
data.writeUint32(session_id);
data.writeUint32(event_params->source_module_id);
data.writeUint32(event_params->event_id);
data.writeUint32(event_params->event_payload_size);
uint32_t param_size = event_params->event_payload_size;
android::Parcel::WritableBlob blob;
data.writeBlob(param_size, false, &blob);
memset(blob.data(), 0x0, param_size);
memscpy(blob.data(), param_size, event_params->event_payload, param_size);
blob.release();
data.writeInt64((long)client_data);
data.write(&cb_func, sizeof(agm_event_cb *));
return remote()->transact(event_params->event_id, data, &reply);
}
};
android::sp<ICallback> ICallback::asInterface
(const android::sp<android::IBinder>& obj)
{
AGM_LOGD("ICallback::asInterface()\n");
android::sp<ICallback> intr;
if (obj != NULL) {
intr = static_cast<ICallback*>(obj->queryLocalInterface(ICallback::descriptor).get());
AGM_LOGD("ICallback::asInterface() interface %s\n",
((intr == 0)?"zero":"non zero"));
if (intr == NULL)
intr = new BpCallback(obj);
}
return intr;
}
ICallback::ICallback()
{AGM_LOGD("ICallback::ICallback()\n"); }
ICallback::~ICallback()
{AGM_LOGD("ICallback::~ICallback()\n"); }
int32_t BnCallback::onTransact(uint32_t code,
const Parcel& data,
Parcel* reply __unused,
uint32_t flags)
{
AGM_LOGD("BnCallback::onTransact(%i) %i\n", code, flags);
data.checkInterface(this);
uint32_t session_id;
uint32_t source_module_id;
uint32_t event_id;
uint32_t event_payload_size;
void *client_data;
agm_event_cb cb_func;
struct agm_event_cb_params *event_params = NULL;
session_id = data.readUint32();
source_module_id = data.readUint32();
event_id = data.readUint32();
event_payload_size = data.readUint32();
event_params = (struct agm_event_cb_params *) calloc(1,
(sizeof(agm_event_cb_params) + event_payload_size));
if (event_params == NULL) {
AGM_LOGE("%s: Cannot allocate memory for struct \
agm_event_cb_params\n", __func__);
return -ENOMEM;
}
event_params->source_module_id = source_module_id;
event_params->event_id = (agm_event_id) event_id;
event_params->event_payload_size = event_payload_size;
android::Parcel::ReadableBlob blob;
uint32_t blob_size = event_payload_size ;
data.readBlob(blob_size, &blob);
memset(event_params->event_payload, 0x0, event_params->event_payload_size);
memscpy(event_params->event_payload,
event_params->event_payload_size , blob.data(), blob_size);
blob.release();
client_data = (void *)data.readInt64();
data.read(&cb_func, sizeof(agm_event_cb *));
return event_cb(session_id, event_params, client_data, cb_func);
}
int BnCallback::event_cb(uint32_t session_id,
struct agm_event_cb_params *event_params,
void *client_data, agm_event_cb cb_func)
{
AGM_LOGD("Calling Client Registered Callback(%x)\n", cb_func);
cb_func(session_id, event_params, client_data);
return 0;
}

View File

@@ -0,0 +1,277 @@
/*
** Copyright (c) 2019, The Linux Foundation. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above
** copyright notice, this list of conditions and the following
** disclaimer in the documentation and/or other materials provided
** with the distribution.
** * Neither the name of The Linux Foundation nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
** BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
** OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
** IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/
#define LOG_TAG "agm_death_notifier"
#include <stdlib.h>
#include <utils/RefBase.h>
#include <utils/Log.h>
#include <binder/TextOutput.h>
#include <binder/IInterface.h>
#include <binder/IBinder.h>
#include <binder/ProcessState.h>
#include <binder/IServiceManager.h>
#include <binder/IPCThreadState.h>
#include <binder/MemoryDealer.h>
#include <pthread.h>
#include <cutils/list.h>
#include <signal.h>
#include "ipc_interface.h"
#include "agm_death_notifier.h"
#include "utils.h"
#ifdef DYNAMIC_LOG_ENABLED
#include <log_xml_parser.h>
#define LOG_MASK AGM_MOD_FILE_AGM_DEATH_NOTIFIER
#include <log_utils.h>
#endif
using namespace android;
struct listnode g_client_list;
pthread_mutex_t g_client_list_lock;
bool g_client_list_init = false;
//initialize mutex
client_death_notifier::client_death_notifier(void)
{
AGM_LOGV("%s:%d\n", __func__, __LINE__);
sp<ProcessState> proc(ProcessState::self());
proc->startThreadPool();
}
sp<client_death_notifier> Client_death_notifier = NULL;
client_info *get_client_handle_from_list(pid_t pid)
{
struct listnode *node = NULL;
client_info *handle = NULL;
pthread_mutex_lock(&g_client_list_lock);
list_for_each(node, &g_client_list) {
handle = node_to_item(node, client_info, list);
if (handle->pid == pid) {
AGM_LOGV("%s: Found handle %p\n", __func__, handle);
pthread_mutex_unlock(&g_client_list_lock);
return handle;
}
}
pthread_mutex_unlock(&g_client_list_lock);
return NULL;
}
void agm_register_client(sp<IBinder> binder)
{
client_info *client_handle = NULL;
pid_t pid = IPCThreadState::self()->getCallingPid();
android::sp<IAGMClient> client_binder =
android::interface_cast<IAGMClient>(binder);
Client_death_notifier = new client_death_notifier();
IInterface::asBinder(client_binder)->linkToDeath(Client_death_notifier);
AGM_LOGD("%s: Client registered and death notifier linked to AGM\n",
__func__);
if (g_client_list_init == false) {
pthread_mutex_init(&g_client_list_lock,
(const pthread_mutexattr_t *) NULL);
list_init(&g_client_list);
g_client_list_init = true;
}
client_handle = (client_info *)calloc(1, sizeof(client_info));
if (client_handle == NULL) {
AGM_LOGE("%s: Cannot allocate memory for client handle\n",
__func__);
return;
}
pthread_mutex_lock(&g_client_list_lock);
client_handle->binder = client_binder;
client_handle->pid = pid;
client_handle->Client_death_notifier = Client_death_notifier;
list_add_tail(&g_client_list, &client_handle->list);
list_init(&client_handle->agm_client_hndl_list);
pthread_mutex_unlock(&g_client_list_lock);
}
void agm_add_session_obj_handle(uint64_t handle)
{
client_info *client_handle = NULL;
agm_client_session_handle *hndl = NULL;
client_handle =
get_client_handle_from_list(IPCThreadState::self()->getCallingPid());
if (client_handle == NULL) {
AGM_LOGE("%s: Could not find client handle\n", __func__);
goto exit;
}
pthread_mutex_lock(&g_client_list_lock);
hndl = (agm_client_session_handle *)calloc(1,
sizeof(agm_client_session_handle));
if (hndl == NULL) {
AGM_LOGE("%s: Cannot allocate memory to store agm session handle\n",
__func__);
goto exit;
}
hndl->handle = handle;
list_add_tail(&client_handle->agm_client_hndl_list, &hndl->list);
exit:
pthread_mutex_unlock(&g_client_list_lock);
}
void agm_remove_session_obj_handle(uint64_t handle)
{
client_info *client_handle = NULL;
struct listnode *node = NULL;
agm_client_session_handle *hndl = NULL;
struct listnode *tempnode = NULL;
client_handle =
get_client_handle_from_list(IPCThreadState::self()->getCallingPid());
if (client_handle == NULL) {
AGM_LOGE("%s: Could not find client handle\n", __func__);
return;
}
pthread_mutex_lock(&g_client_list_lock);
list_for_each_safe(node, tempnode, &client_handle->agm_client_hndl_list) {
hndl = node_to_item(node, agm_client_session_handle, list);
if (hndl->handle == handle) {
AGM_LOGV("%s: Removed handle 0x%llx\n", __func__, handle);
list_remove(node);
free(hndl);
break;
}
}
pthread_mutex_unlock(&g_client_list_lock);
}
void agm_unregister_client(sp<IBinder> binder)
{
android::sp<IAGMClient> client_binder =
android::interface_cast<IAGMClient>(binder);
client_info *handle = NULL;
struct listnode *tempnode = NULL;
struct listnode *node = NULL;
AGM_LOGV("%s: enter\n", __func__);
pthread_mutex_lock(&g_client_list_lock);
list_for_each_safe(node, tempnode, &g_client_list) {
handle = node_to_item(node, client_info, list);
if (handle->pid == IPCThreadState::self()->getCallingPid()) {
if (handle->Client_death_notifier != NULL) {
IInterface::asBinder(client_binder)->unlinkToDeath(handle->Client_death_notifier);
handle->Client_death_notifier.clear();
AGM_LOGV("%s: unlink to death %d\n", __func__, handle->pid);
}
list_remove(node);
free(handle);
}
}
AGM_LOGV("%s: exit\n", __func__);
pthread_mutex_unlock(&g_client_list_lock);
}
void client_death_notifier::binderDied(const wp<IBinder>& who)
{
client_info *handle = NULL;
struct listnode *node = NULL;
struct listnode *tempnode = NULL;
agm_client_session_handle *hndl = NULL;
struct listnode *sess_node = NULL;
struct listnode *sess_tempnode = NULL;
pthread_mutex_lock(&g_client_list_lock);
list_for_each_safe(node, tempnode, &g_client_list) {
handle = node_to_item(node, client_info, list);
if (IInterface::asBinder(handle->binder).get() == who.unsafe_get()) {
list_for_each_safe(sess_node, sess_tempnode,
&handle->agm_client_hndl_list) {
hndl = node_to_item(sess_node, agm_client_session_handle, list);
if (hndl->handle) {
agm_session_close(hndl->handle);
list_remove(sess_node);
free(hndl);
}
}
list_remove(node);
free(handle);
}
}
pthread_mutex_unlock(&g_client_list_lock);
AGM_LOGD("%s: exit\n", __func__);
}
const android::String16 IAGMClient::descriptor("IAGMClient");
const android::String16& IAGMClient::getInterfaceDescriptor() const {
return IAGMClient::descriptor;
}
class BpClient: public ::android:: BpInterface<IAGMClient>
{
public:
BpClient(const sp<IBinder>& impl) : BpInterface<IAGMClient>(impl) {
AGM_LOGD("BpClient::BpClient()\n");
}
};
android::sp<IAGMClient> IAGMClient::asInterface
(const android::sp<android::IBinder>& obj)
{
AGM_LOGV("IAGMClient::asInterface()\n");
android::sp<IAGMClient> intr;
if (obj != NULL) {
intr = static_cast<IAGMClient*>(obj->queryLocalInterface
(IAGMClient::descriptor).get());
AGM_LOGD("IAGMClient::asInterface() interface %s\n",
((intr == 0)?"zero":"non zero"));
if (intr == NULL)
intr = new BpClient(obj);
}
return intr;
}
IAGMClient :: IAGMClient() { AGM_LOGD("IAGMClient::IAGMClient()"); }
IAGMClient :: ~IAGMClient() { AGM_LOGD("IAGMClient::~IAGMClient()"); }
int32_t DummyBnClient::onTransact(uint32_t code,
const Parcel& data,
Parcel* reply,
uint32_t flags)
{
int status = 0;
AGM_LOGV("DummyBnClient::onTransact(%i) %i\n", code, flags);
//data.checkInterface(this); //Alternate option to check interface
CHECK_INTERFACE(IAGMClient, data, reply);
switch(code) {
default:
return BBinder::onTransact(code, data, reply, flags);
break;
}
return status;
}

View File

@@ -0,0 +1,72 @@
/*
** Copyright (c) 2019, The Linux Foundation. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above
** copyright notice, this list of conditions and the following
** disclaimer in the documentation and/or other materials provided
** with the distribution.
** * Neither the name of The Linux Foundation nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
** BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
** OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
** IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/
#define LOG_TAG "agm_server_daemon"
#include <binder/ProcessState.h>
#include <binder/IServiceManager.h>
#include <utils/Log.h>
#include "ipc_interface.h"
#include "agm_server_wrapper.h"
#include <signal.h>
#include "utils.h"
#ifdef DYNAMIC_LOG_ENABLED
#include <log_xml_parser.h>
#define LOG_MASK AGM_MOD_FILE_AGM_SERVER_DAEMON
#include <log_utils.h>
#endif
static class AgmService *agmServiceInstance = new AgmService();
static void sigint_handler(int sig __unused)
{
AGM_LOGD("AgmService received signal\n");
agmServiceInstance->~AgmService();
exit(0);
}
int main()
{
signal(SIGINT, sigint_handler);
android::defaultServiceManager()->addService(android::String16("AgmService"),
agmServiceInstance);
if (agmServiceInstance->is_agm_service_initialized()) {
AGM_LOGD("AgmService initialized \n");
android::ProcessState::self()->startThreadPool();
AGM_LOGD("AGM service is now ready\n");
android::IPCThreadState::self()->joinThreadPool();
AGM_LOGD("AGM service thread joined\n");
return 0;
} else {
AGM_LOGD("AgmService initialization failed");
return -1;
}
}

View File

@@ -0,0 +1,287 @@
/*
** Copyright (c) 2019, The Linux Foundation. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above
** copyright notice, this list of conditions and the following
** disclaimer in the documentation and/or other materials provided
** with the distribution.
** * Neither the name of The Linux Foundation nor the names of its
** contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
** BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
** OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
** IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**/
#define LOG_TAG "agm_server_wrapper"
#include <binder/Parcel.h>
#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
#include <utils/Log.h>
#include <agm/agm_api.h>
#include <pthread.h>
#include <signal.h>
#include <sys/prctl.h>
#include <system/thread_defs.h>
#include <sys/resource.h>
#include <cstring>
#include <memory.h>
#include <pthread.h>
#include <string.h>
#include <binder/IMemory.h>
#include "utils.h"
#include "agm_server_wrapper.h"
#ifdef DYNAMIC_LOG_ENABLED
#include <log_xml_parser.h>
#define LOG_MASK AGM_MOD_FILE_AGM_SERVER_WRAPPER
#include <log_utils.h>
#endif
using namespace android;
#if 0
AgmService::AgmService()
{
agm_initialized = !agm_init();
AGM_LOGV("agm_initialized %d", agm_initialized);
}
AgmService::~AgmService()
{
agm_initialized = agm_deinit();
AGM_LOGV("agm_initialized %d", agm_initialized);
}
#endif
int AgmService::ipc_agm_session_read(uint64_t handle, void *buff, size_t *count){
AGM_LOGV("%s called \n", __func__);
return agm_session_read(handle, buff, count);
};
int AgmService::ipc_agm_session_write(uint64_t handle, void *buff, size_t *count){
AGM_LOGV("%s called \n", __func__);
return agm_session_write(handle, buff, count);
};
int AgmService::ipc_agm_init(){
AGM_LOGV("%s called\n", __func__);
return 0;
};
int AgmService::ipc_agm_audio_intf_set_metadata(uint32_t audio_intf,
uint32_t size, uint8_t *metadata)
{
AGM_LOGE("%s called\n", __func__);
return agm_aif_set_metadata(audio_intf, size, metadata);
};
int AgmService::ipc_agm_session_set_metadata(uint32_t session_id,
uint32_t size, uint8_t *metadata)
{
AGM_LOGE("%s called\n", __func__);
return agm_session_set_metadata(session_id, size, metadata);
};
int AgmService::ipc_agm_session_audio_inf_set_metadata(uint32_t session_id,
uint32_t audio_intf, uint32_t size,
uint8_t *metadata)
{
AGM_LOGE("%s called\n", __func__);
return agm_session_aif_set_metadata(session_id, audio_intf, size, metadata);
};
int AgmService::ipc_agm_session_close(uint64_t handle){
ALOGV("%s called\n", __func__);
return agm_session_close(handle);
};
int AgmService::ipc_agm_session_prepare(uint64_t handle){
ALOGV("%s called\n", __func__);
return agm_session_prepare(handle);
};
int AgmService::ipc_agm_session_start(uint64_t handle){
ALOGV("%s called\n", __func__);
return agm_session_start(handle);
};
int AgmService::ipc_agm_session_stop(uint64_t handle){
ALOGV("%s called\n", __func__);
return agm_session_stop(handle);
};
int AgmService::ipc_agm_session_pause(uint64_t handle){
ALOGV("%s called\n", __func__);
return agm_session_pause(handle);
};
int AgmService::ipc_agm_session_resume(uint64_t handle){
ALOGV("%s called\n", __func__);
return agm_session_resume(handle);
};
int AgmService::ipc_agm_session_set_loopback(uint32_t capture_session_id,
uint32_t playback_session_id, bool state)
{
AGM_LOGV("%s called\n", __func__);
return agm_session_set_loopback(capture_session_id, playback_session_id,
state);
};
size_t AgmService::ipc_agm_get_hw_processed_buff_cnt(uint64_t handle,
enum direction dir) {
AGM_LOGV("%s called\n", __func__);
return agm_get_hw_processed_buff_cnt(handle, dir);
};
int AgmService::ipc_agm_get_aif_info_list(struct aif_info *aif_list,
size_t *num_aif_info)
{
AGM_LOGV("%s called\n", __func__);
return agm_get_aif_info_list(aif_list, num_aif_info);
};
int AgmService::ipc_agm_session_aif_get_tag_module_info(uint32_t session_id,
uint32_t aif_id, void *payload, size_t *size)
{
AGM_LOGV("%s called\n", __func__);
return agm_session_aif_get_tag_module_info(session_id, aif_id,
payload, size);
};
int AgmService::ipc_agm_aif_set_params(uint32_t aif_id,
void* payload, size_t size)
{
AGM_LOGV("%s called\n", __func__);
return agm_aif_set_params(aif_id, payload, size);
}
int AgmService::ipc_agm_session_aif_set_params(uint32_t session_id,
uint32_t aif_id, void *payload, size_t size)
{
AGM_LOGV("%s called\n", __func__);
return agm_session_aif_set_params(session_id, aif_id, payload, size);
};
int AgmService::ipc_agm_session_set_params(uint32_t session_id, void *payload,
size_t size)
{
AGM_LOGV("%s called\n", __func__);
return agm_session_set_params(session_id, payload, size);
};
int AgmService::ipc_agm_set_params_with_tag(uint32_t session_id,
uint32_t aif_id,
struct agm_tag_config *tag_config)
{
AGM_LOGV("%s called\n", __func__);
return agm_set_params_with_tag(session_id, aif_id, tag_config);
};
int AgmService::ipc_agm_session_open(uint32_t session_id,
enum agm_session_mode sess_mode,
uint64_t *handle){
AGM_LOGV("%s called\n", __func__);
return agm_session_open(session_id, sess_mode, handle);
};
int AgmService::ipc_agm_session_set_config(uint64_t handle,
struct agm_session_config *session_config,
struct agm_media_config *media_config,
struct agm_buffer_config *buffer_config){
AGM_LOGV("%s called\n", __func__);
return agm_session_set_config(handle, session_config,
media_config, buffer_config);
};
int AgmService::ipc_agm_session_audio_inf_connect(uint32_t session_id,
uint32_t audio_intf, bool state)
{
AGM_LOGV("%s called\n", __func__);
return agm_session_aif_connect(session_id, audio_intf, state);
};
int AgmService::ipc_agm_audio_intf_set_media_config(uint32_t audio_intf,
struct agm_media_config *media_config)
{
AGM_LOGV("%s called\n", __func__);
return agm_aif_set_media_config(audio_intf, media_config);
};
int AgmService::ipc_agm_session_register_for_events(uint32_t session_id,
struct agm_event_reg_cfg *evt_reg_cfg)
{
AGM_LOGV("%s called\n", __func__);
return agm_session_register_for_events(session_id, evt_reg_cfg);
};
int AgmService::ipc_agm_session_register_cb(uint32_t session_id,
agm_event_cb cb, enum event_type event,
void *client_data)
{
AGM_LOGV("%s called\n", __func__);
return agm_session_register_cb(session_id, cb, event, client_data);
};
int AgmService::ipc_agm_session_set_ec_ref(uint32_t capture_session_id,
uint32_t aif_id, bool state)
{
AGM_LOGV("%s called\n", __func__);
return agm_session_set_ec_ref(capture_session_id, aif_id, state);
};
int AgmService::ipc_agm_session_aif_set_cal(uint32_t session_id,
uint32_t audio_intf,
struct agm_cal_config *cal_config)
{
AGM_LOGV("%s called\n", __func__);
return agm_session_aif_set_cal(session_id, audio_intf, cal_config);
};
int AgmService::ipc_agm_session_eos(uint64_t handle) {
AGM_LOGV("%s called\n", __func__);
return agm_session_eos(handle);
};
int AgmService::ipc_agm_get_session_time(uint64_t handle, uint64_t *timestamp) {
AGM_LOGV("%s called\n", __func__);
return agm_get_session_time(handle, timestamp);
};
int AgmService::ipc_agm_session_get_params(uint32_t session_id, void *payload, size_t size){
AGM_LOGV("%s called\n", __func__);
return agm_session_get_params(session_id, payload, size);
};
int AgmService::ipc_agm_get_buffer_timestamp(uint32_t session_id, uint64_t *timestamp) {
ALOGV("%s called\n", __func__);
return agm_get_buffer_timestamp(session_id, timestamp);
};
int AgmService::ipc_agm_set_gapless_session_metadata(uint64_t handle,
enum agm_gapless_silence_type type,
uint32_t silence) {
ALOGV("%s called\n", __func__);
return agm_set_gapless_session_metadata(handle, type, silence);
};
int AgmService::ipc_agm_session_get_buf_info(uint32_t session_id,
struct agm_buf_info *buf_info, uint32_t flag) {
ALOGV("%s called\n", __func__);
return agm_session_get_buf_info(session_id, buf_info, flag);
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,30 @@
aidl_interface {
name: "vendor.qti.hardware.agm",
vendor: true,
srcs: ["vendor/qti/hardware/agm/*.aidl"],
stability: "vintf",
owner: "qti",
backend: {
cpp: {
enabled: false,
},
java: {
sdk_version: "module_current",
},
ndk: {
enabled: true,
},
},
imports: [
"android.hardware.common-V2",
],
versions_with_info: [
{
version: "1",
imports: ["android.hardware.common-V2"],
},
],
frozen: true,
}

View File

@@ -0,0 +1 @@
include $(call all-subdir-makefiles)

View File

@@ -0,0 +1 @@
efa4ab1ccef17baa301d81deca852ddc0bbafbfb

View File

@@ -0,0 +1,33 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmBuff {
long timestamp;
int flags;
int size;
int offset;
byte[] buffer;
byte[] metadata;
vendor.qti.hardware.agm.AgmExternAllocBuffInfo externalAllocInfo;
}

View File

@@ -0,0 +1,29 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmBufferConfig {
int count;
int size;
int maxMetadataSize;
}

View File

@@ -0,0 +1,27 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmCalConfig {
vendor.qti.hardware.agm.AgmKeyValue[] kv;
}

View File

@@ -0,0 +1,32 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@Backing(type="int") @VintfStability
enum AgmDataMode {
AGM_DATA_INVALID,
AGM_DATA_BLOCKING,
AGM_DATA_NON_BLOCKING,
AGM_DATA_PUSH_PULL,
AGM_DATA_EXTERN_MEM,
AGM_DATA_MODE_MAX,
}

View File

@@ -0,0 +1,29 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmDumpInfo {
int signal;
int pid;
int uid;
}

View File

@@ -0,0 +1,29 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmEventCallbackParameter {
int sourceModuleId;
int eventId;
byte[] eventPayload;
}

View File

@@ -0,0 +1,31 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@Backing(type="int") @VintfStability
enum AgmEventId {
AGMEVENTEOSRENDERED = 0x0,
AGMEVENTREADDONE = 0x1,
AGMEVENTWRITEDONE = 0x2,
AGM_EVENT_EARLY_EOS = 0x08001126,
AGMEVENTIDMAX,
}

View File

@@ -0,0 +1,30 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmEventReadWriteDonePayload {
int tag;
int status;
int metadataStatus;
vendor.qti.hardware.agm.AgmBuff buffer;
}

View File

@@ -0,0 +1,30 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmEventRegistrationConfig {
int moduleInstanceId;
int eventId;
byte registerEvent;
byte[] eventConfigPayload;
}

View File

@@ -0,0 +1,29 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmExternAllocBuffInfo {
android.hardware.common.NativeHandle allocHandle;
int allocatedSize;
int offset;
}

View File

@@ -0,0 +1,28 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@Backing(type="int") @VintfStability
enum AgmGaplessSilenceType {
INITIAL_SILENCE,
TRAILING_SILENCE,
}

View File

@@ -0,0 +1,31 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmGroupMediaConfig {
int rate;
int channels;
vendor.qti.hardware.agm.AgmMediaFormat format;
int dataFormat;
int slotMask;
}

View File

@@ -0,0 +1,28 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmKeyValue {
int key;
int value;
}

View File

@@ -0,0 +1,30 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmMediaConfig {
int rate;
int channels;
vendor.qti.hardware.agm.AgmMediaFormat format;
int dataFormat;
}

View File

@@ -0,0 +1,47 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@Backing(type="int") @VintfStability
enum AgmMediaFormat {
AGM_FORMAT_INVALID,
AGM_FORMAT_PCM_S8,
AGM_FORMAT_PCM_S16_LE,
AGM_FORMAT_PCM_S24_LE,
AGM_FORMAT_PCM_S24_3LE,
AGM_FORMAT_PCM_S32_LE,
AGM_FORMAT_MP3,
AGM_FORMAT_AAC,
AGM_FORMAT_FLAC,
AGM_FORMAT_ALAC,
AGM_FORMAT_APE,
AGM_FORMAT_WMASTD,
AGM_FORMAT_WMAPRO,
AGM_FORMAT_VORBIS,
AGM_FORMAT_AMR_NB,
AGM_FORMAT_AMR_WB,
AGM_FORMAT_AMR_WB_PLUS,
AGM_FORMAT_EVRC,
AGM_FORMAT_G711,
AGM_FORMAT_QCELP,
AGM_FORMAT_MAX,
}

View File

@@ -0,0 +1,29 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmReadWriteEventCallbackParams {
int sourceModuleId;
int eventId;
vendor.qti.hardware.agm.AgmEventReadWriteDonePayload payload;
}

View File

@@ -0,0 +1,31 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmSessionAacDec {
int formatFlag;
int objectType;
int channels;
int sizeOfPCEBits;
int sampleRate;
}

View File

@@ -0,0 +1,30 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmSessionAacEnc {
int bitRate;
int globalCutOffFrequency;
int mode;
int formatFlags;
}

View File

@@ -0,0 +1,38 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmSessionAlacDec {
int frameLength;
byte compatibleVersion;
byte bitDepth;
byte pb;
byte mb;
byte kb;
byte channels;
int maxRun;
int maxFrameBytes;
int averageBitRate;
int sampleRate;
int channelLayoutTag;
}

View File

@@ -0,0 +1,36 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmSessionApeDec {
int compatibleVersion;
int compressionLevel;
int formatFlags;
int blocksPerFrame;
int finalFrameBlocks;
int totalFrames;
int bitWidth;
int channels;
int sampleRate;
int seekTablePresent;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
union AgmSessionCodec {
vendor.qti.hardware.agm.AgmSessionAacDec aacDecoder;
vendor.qti.hardware.agm.AgmSessionFlacDec flacDecoder;
vendor.qti.hardware.agm.AgmSessionAlacDec alacDecoder;
vendor.qti.hardware.agm.AgmSessionApeDec apeDecoder;
vendor.qti.hardware.agm.AgmSessionWmaDec wmaDecoder;
vendor.qti.hardware.agm.AgmSessionWmaproDec wmaproDecoder;
vendor.qti.hardware.agm.AgmSessionOpusDec opusDecoder;
vendor.qti.hardware.agm.AgmSessionAacEnc aacEncoder;
}

View File

@@ -0,0 +1,33 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmSessionConfig {
vendor.qti.hardware.agm.Direction direction;
vendor.qti.hardware.agm.AgmSessionMode sessionMode;
int startThreshold;
int stopThreshold;
@nullable vendor.qti.hardware.agm.AgmSessionCodec codec;
vendor.qti.hardware.agm.AgmDataMode dataMode;
int flags;
}

View File

@@ -0,0 +1,33 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmSessionFlacDec {
int channels;
int sampleSize;
int minBlockSize;
int maxBlockSize;
int sampleRate;
int minFrameSize;
int maxFrameSize;
}

View File

@@ -0,0 +1,31 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@Backing(type="int") @VintfStability
enum AgmSessionMode {
AGM_SESSION_DEFAULT,
AGM_SESSION_NO_HOST,
AGM_SESSION_NON_TUNNEL,
AGM_SESSION_NO_CONFIG,
AGM_SESSION_COMPRESS,
}

View File

@@ -0,0 +1,38 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmSessionOpusDec {
int bitStreamFormat;
int type;
byte version;
byte channels;
int preSkip;
long sampleRate;
int outputGain;
byte mappingFamily;
byte streamCount;
byte coupledCount;
byte[8] channelMap;
byte[3] reserved;
}

View File

@@ -0,0 +1,35 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmSessionWmaDec {
int formatTag;
int channels;
int sampleRate;
int averageBytesPerSecond;
int blockAlign;
int bitsPerSample;
int channelMask;
int encoderOption;
int reserved;
}

View File

@@ -0,0 +1,36 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmSessionWmaproDec {
int formatTag;
int channels;
int sampleRate;
int averageBytesPerSecond;
int blockAlign;
int bitsPerSample;
int channelMask;
int encoderOption;
int advancedEncoderOption;
int advancedEncoderOption2;
}

View File

@@ -0,0 +1,28 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmTagConfig {
int tag;
vendor.qti.hardware.agm.AgmKeyValue[] kv;
}

View File

@@ -0,0 +1,28 @@
/*
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AifInfo {
String aifName;
vendor.qti.hardware.agm.Direction direction;
}

View File

@@ -0,0 +1,28 @@
/*
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@Backing(type="int") @VintfStability
enum Direction {
Rx = 1,
Tx,
}

View File

@@ -0,0 +1,28 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@Backing(type="int") @VintfStability
enum EventType {
AGM_EVENT_DATA_PATH = 1,
AGM_EVENT_MODULE,
}

View File

@@ -0,0 +1,78 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
interface IAGM {
void ipc_agm_init();
void ipc_agm_deinit();
long ipc_agm_session_open(in int sessionId, in vendor.qti.hardware.agm.AgmSessionMode sessionMode);
void ipc_agm_session_start(in long handle);
void ipc_agm_session_stop(in long handle);
void ipc_agm_session_suspend(in long handle);
void ipc_agm_session_pause(in long handle);
void ipc_agm_session_resume(in long handle);
void ipc_agm_session_prepare(in long handle);
void ipc_agm_session_eos(in long handle);
void ipc_agm_session_flush(in long handle);
void ipc_agm_session_close(in long handle);
vendor.qti.hardware.agm.MmapBufInfo ipc_agm_session_get_buf_info(in int sessionId, in int flag);
byte[] ipc_agm_session_get_params(in int sessionId, in byte[] buffer);
byte[] ipc_agm_session_read(in long handle, in int count);
vendor.qti.hardware.agm.IAGM.AgmReadWithMetadataReturn ipc_agm_session_read_with_metadata(in long handle, in vendor.qti.hardware.agm.AgmBuff buffer, in int capturedSize);
void ipc_agm_session_register_callback(in vendor.qti.hardware.agm.IAGMCallback callback, in int sessionId, in int eventType, in boolean register, in long clientData);
void ipc_agm_session_register_for_events(in int sessionId, in vendor.qti.hardware.agm.AgmEventRegistrationConfig eventConfig);
void ipc_agm_session_set_config(in long handle, in vendor.qti.hardware.agm.AgmSessionConfig sessionConfig, in vendor.qti.hardware.agm.AgmMediaConfig mediaConfig, in vendor.qti.hardware.agm.AgmBufferConfig bufferConfig);
void ipc_agm_session_set_ec_ref(in int sessionId, in int aifId, in boolean state);
void ipc_agm_session_set_loopback(in int captureSessionId, in int playbackSessionId, in boolean state);
void ipc_agm_session_set_metadata(in int sessionId, in byte[] metadata);
void ipc_agm_session_set_non_tunnel_mode_config(in long handle, in vendor.qti.hardware.agm.AgmSessionConfig sessionConfig, in vendor.qti.hardware.agm.AgmMediaConfig inMediaConfig, in vendor.qti.hardware.agm.AgmMediaConfig outMediaConfig, in vendor.qti.hardware.agm.AgmBufferConfig inBufferConfig, in vendor.qti.hardware.agm.AgmBufferConfig outBufferConfig);
void ipc_agm_session_set_params(in int sessionId, in byte[] payload);
int ipc_agm_session_write(in long handle, in byte[] buff);
void ipc_agm_session_write_datapath_params(in int sessionId, in vendor.qti.hardware.agm.AgmBuff buff);
int ipc_agm_session_write_with_metadata(in long handle, in vendor.qti.hardware.agm.AgmBuff buff);
void ipc_agm_aif_group_set_media_config(in int groupId, in vendor.qti.hardware.agm.AgmGroupMediaConfig config);
void ipc_agm_aif_set_media_config(in int aifId, in vendor.qti.hardware.agm.AgmMediaConfig config);
void ipc_agm_aif_set_metadata(in int aifId, in byte[] metadata);
void ipc_agm_aif_set_params(in int aifId, in byte[] payload);
void ipc_agm_session_aif_connect(in int sessionId, in int aifId, in boolean state);
byte[] ipc_agm_session_aif_get_tag_module_info(in int sessionId, in int aifId, in int size);
void ipc_agm_session_aif_set_cal(in int sessionId, in int aifId, in vendor.qti.hardware.agm.AgmCalConfig calConfig);
void ipc_agm_session_aif_set_metadata(in int sessionId, in int aifId, in byte[] metadata);
void ipc_agm_session_aif_set_params(in int sessionId, in int aifId, in byte[] payload);
vendor.qti.hardware.agm.AifInfo[] ipc_agm_get_aif_info_list(in int numAifInfo);
long ipc_agm_get_buffer_timestamp(in int sessiondId);
vendor.qti.hardware.agm.AifInfo[] ipc_agm_get_group_aif_info_list(in int numberOfGroups);
void ipc_agm_get_hw_processed_buff_cnt(in long handle, in vendor.qti.hardware.agm.Direction direction);
byte[] ipc_agm_get_params_from_acdb_tunnel(in byte[] payload);
long ipc_agm_get_session_time(in long handle);
void ipc_agm_sessionid_flush(in int sessiondId);
void ipc_agm_set_gapless_session_metadata(in long handle, in vendor.qti.hardware.agm.AgmGaplessSilenceType type, in int silence);
void ipc_agm_set_params_to_acdb_tunnel(in byte[] payload);
void ipc_agm_set_params_with_tag(in int sessiondId, in int aifId, in vendor.qti.hardware.agm.AgmTagConfig tagConfig);
void ipc_agm_set_params_with_tag_to_acdb(in int sessiondId, in int aifId, in byte[] payload);
void ipc_agm_dump(in vendor.qti.hardware.agm.AgmDumpInfo dumpInfo);
parcelable AgmReadWithMetadataReturn {
vendor.qti.hardware.agm.AgmBuff buffer;
int capturesSize;
}
}

View File

@@ -0,0 +1,28 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
interface IAGMCallback {
void eventCallback(in vendor.qti.hardware.agm.AgmEventCallbackParameter eventParam);
void eventCallbackReadWriteDone(in vendor.qti.hardware.agm.AgmReadWriteEventCallbackParams rwDonePayload);
}

View File

@@ -0,0 +1,30 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable MmapBufInfo {
android.hardware.common.NativeHandle dataFdHandle;
int dataSize;
android.hardware.common.NativeHandle positionFdHandle;
int posSize;
}

View File

@@ -0,0 +1,40 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@Backing(type="int") @VintfStability
enum Status {
UNKNOWN = (-1) /* -1 */,
SUCCESS = 0,
IO_ERROR,
BUSY,
NO_SPACE,
INVALID_FD,
ADVERTISE_ERROR,
PROTOCOL_NOT_AVAILABLE,
NOT_SUPPORTED,
DOWN_WITH_SSR,
NOW_INPROGRESS,
ALREADY_INPROGRESS,
CANCELLED,
NOT_RECOVERABLE,
}

View File

@@ -0,0 +1,33 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmBuff {
long timestamp;
int flags;
int size;
int offset;
byte[] buffer;
byte[] metadata;
vendor.qti.hardware.agm.AgmExternAllocBuffInfo externalAllocInfo;
}

View File

@@ -0,0 +1,29 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmBufferConfig {
int count;
int size;
int maxMetadataSize;
}

View File

@@ -0,0 +1,27 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmCalConfig {
vendor.qti.hardware.agm.AgmKeyValue[] kv;
}

View File

@@ -0,0 +1,32 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@Backing(type="int") @VintfStability
enum AgmDataMode {
AGM_DATA_INVALID,
AGM_DATA_BLOCKING,
AGM_DATA_NON_BLOCKING,
AGM_DATA_PUSH_PULL,
AGM_DATA_EXTERN_MEM,
AGM_DATA_MODE_MAX,
}

View File

@@ -0,0 +1,29 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmDumpInfo {
int signal;
int pid;
int uid;
}

View File

@@ -0,0 +1,29 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmEventCallbackParameter {
int sourceModuleId;
int eventId;
byte[] eventPayload;
}

View File

@@ -0,0 +1,31 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@Backing(type="int") @VintfStability
enum AgmEventId {
AGMEVENTEOSRENDERED = 0x0,
AGMEVENTREADDONE = 0x1,
AGMEVENTWRITEDONE = 0x2,
AGM_EVENT_EARLY_EOS = 0x08001126,
AGMEVENTIDMAX,
}

View File

@@ -0,0 +1,30 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmEventReadWriteDonePayload {
int tag;
int status;
int metadataStatus;
vendor.qti.hardware.agm.AgmBuff buffer;
}

View File

@@ -0,0 +1,30 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmEventRegistrationConfig {
int moduleInstanceId;
int eventId;
byte registerEvent;
byte[] eventConfigPayload;
}

View File

@@ -0,0 +1,29 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmExternAllocBuffInfo {
android.hardware.common.NativeHandle allocHandle;
int allocatedSize;
int offset;
}

View File

@@ -0,0 +1,28 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@Backing(type="int") @VintfStability
enum AgmGaplessSilenceType {
INITIAL_SILENCE,
TRAILING_SILENCE,
}

View File

@@ -0,0 +1,31 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmGroupMediaConfig {
int rate;
int channels;
vendor.qti.hardware.agm.AgmMediaFormat format;
int dataFormat;
int slotMask;
}

View File

@@ -0,0 +1,28 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmKeyValue {
int key;
int value;
}

View File

@@ -0,0 +1,30 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmMediaConfig {
int rate;
int channels;
vendor.qti.hardware.agm.AgmMediaFormat format;
int dataFormat;
}

View File

@@ -0,0 +1,47 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@Backing(type="int") @VintfStability
enum AgmMediaFormat {
AGM_FORMAT_INVALID,
AGM_FORMAT_PCM_S8,
AGM_FORMAT_PCM_S16_LE,
AGM_FORMAT_PCM_S24_LE,
AGM_FORMAT_PCM_S24_3LE,
AGM_FORMAT_PCM_S32_LE,
AGM_FORMAT_MP3,
AGM_FORMAT_AAC,
AGM_FORMAT_FLAC,
AGM_FORMAT_ALAC,
AGM_FORMAT_APE,
AGM_FORMAT_WMASTD,
AGM_FORMAT_WMAPRO,
AGM_FORMAT_VORBIS,
AGM_FORMAT_AMR_NB,
AGM_FORMAT_AMR_WB,
AGM_FORMAT_AMR_WB_PLUS,
AGM_FORMAT_EVRC,
AGM_FORMAT_G711,
AGM_FORMAT_QCELP,
AGM_FORMAT_MAX,
}

View File

@@ -0,0 +1,29 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmReadWriteEventCallbackParams {
int sourceModuleId;
int eventId;
vendor.qti.hardware.agm.AgmEventReadWriteDonePayload payload;
}

View File

@@ -0,0 +1,31 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmSessionAacDec {
int formatFlag;
int objectType;
int channels;
int sizeOfPCEBits;
int sampleRate;
}

View File

@@ -0,0 +1,30 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmSessionAacEnc {
int bitRate;
int globalCutOffFrequency;
int mode;
int formatFlags;
}

View File

@@ -0,0 +1,38 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmSessionAlacDec {
int frameLength;
byte compatibleVersion;
byte bitDepth;
byte pb;
byte mb;
byte kb;
byte channels;
int maxRun;
int maxFrameBytes;
int averageBitRate;
int sampleRate;
int channelLayoutTag;
}

View File

@@ -0,0 +1,36 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmSessionApeDec {
int compatibleVersion;
int compressionLevel;
int formatFlags;
int blocksPerFrame;
int finalFrameBlocks;
int totalFrames;
int bitWidth;
int channels;
int sampleRate;
int seekTablePresent;
}

View File

@@ -0,0 +1,34 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
union AgmSessionCodec {
vendor.qti.hardware.agm.AgmSessionAacDec aacDecoder;
vendor.qti.hardware.agm.AgmSessionFlacDec flacDecoder;
vendor.qti.hardware.agm.AgmSessionAlacDec alacDecoder;
vendor.qti.hardware.agm.AgmSessionApeDec apeDecoder;
vendor.qti.hardware.agm.AgmSessionWmaDec wmaDecoder;
vendor.qti.hardware.agm.AgmSessionWmaproDec wmaproDecoder;
vendor.qti.hardware.agm.AgmSessionOpusDec opusDecoder;
vendor.qti.hardware.agm.AgmSessionAacEnc aacEncoder;
}

View File

@@ -0,0 +1,33 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmSessionConfig {
vendor.qti.hardware.agm.Direction direction;
vendor.qti.hardware.agm.AgmSessionMode sessionMode;
int startThreshold;
int stopThreshold;
@nullable vendor.qti.hardware.agm.AgmSessionCodec codec;
vendor.qti.hardware.agm.AgmDataMode dataMode;
int flags;
}

View File

@@ -0,0 +1,33 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmSessionFlacDec {
int channels;
int sampleSize;
int minBlockSize;
int maxBlockSize;
int sampleRate;
int minFrameSize;
int maxFrameSize;
}

View File

@@ -0,0 +1,31 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@Backing(type="int") @VintfStability
enum AgmSessionMode {
AGM_SESSION_DEFAULT,
AGM_SESSION_NO_HOST,
AGM_SESSION_NON_TUNNEL,
AGM_SESSION_NO_CONFIG,
AGM_SESSION_COMPRESS,
}

View File

@@ -0,0 +1,38 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmSessionOpusDec {
int bitStreamFormat;
int type;
byte version;
byte channels;
int preSkip;
long sampleRate;
int outputGain;
byte mappingFamily;
byte streamCount;
byte coupledCount;
byte[8] channelMap;
byte[3] reserved;
}

View File

@@ -0,0 +1,35 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmSessionWmaDec {
int formatTag;
int channels;
int sampleRate;
int averageBytesPerSecond;
int blockAlign;
int bitsPerSample;
int channelMask;
int encoderOption;
int reserved;
}

View File

@@ -0,0 +1,36 @@
/**
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
///////////////////////////////////////////////////////////////////////////////
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
// two cases:
// 1). this is a frozen version file - do not edit this in any case.
// 2). this is a 'current' file. If you make a backwards compatible change to
// the interface (from the latest frozen version), the build system will
// prompt you to update this file with `m <name>-update-api`.
//
// You must not make a backward incompatible change to any AIDL file built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.
package vendor.qti.hardware.agm;
@VintfStability
parcelable AgmSessionWmaproDec {
int formatTag;
int channels;
int sampleRate;
int averageBytesPerSecond;
int blockAlign;
int bitsPerSample;
int channelMask;
int encoderOption;
int advancedEncoderOption;
int advancedEncoderOption2;
}

Some files were not shown because too many files have changed in this diff Show More