aml_audio_hal: hal audio player for audio HAL.[1/1]

PD#SWPL-20153

Problem:
This is a task to have a generic audio player based
on Linux audio hal/service. Previously the audio
HAL tests have two separate sample code for PCM and
Dolby AC3 format. We need a more generic player for
testing purpose.

Solution:
A generic audio player (halplayer) is provided so a
source file and format can be specified.

Verify:
Local on AB311 platform with PCM, Dolby and MAT PCM
input verified.

Change-Id: I0f3e5f3d29cda93393dd6feae949524dca8a6882
diff --git a/Makefile b/Makefile
index 5473319..46f1346 100644
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,7 @@
 
 TEST_PCM_OBJS=src/test.o
 TEST_DOLBY_OBJS=src/test_ac3.o
+TEST_HALPLAY_OBJS=src/halplay.o
 
 PROTOC=$(HOST_DIR)/bin/protoc
 PROTOC_INC=$(HOST_DIR)/include
@@ -35,7 +36,7 @@
 %.o: %.c
 	$(CC) -c $(CFLAGS) -o $@ $<
 
-all: audio_server libaudio_client.so audio_client_test audio_client_test_ac3
+all: audio_server libaudio_client.so audio_client_test audio_client_test_ac3 halplay
 
 audio_server: $(SERVER_OBJS)
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
@@ -49,11 +50,15 @@
 audio_client_test_ac3: $(TEST_DOLBY_OBJS) libaudio_client.so
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
 
+halplay: $(TEST_HALPLAY_OBJS) libaudio_client.so
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
 .PHONY: install
 install:
 	install -m 755 -D audio_server -t $(TARGET_DIR)/usr/bin/
 	install -m 755 -D audio_client_test -t $(TARGET_DIR)/usr/bin/
 	install -m 755 -D audio_client_test_ac3 $(TARGET_DIR)/usr/bin/
+	install -m 755 -D halplay $(TARGET_DIR)/usr/bin/
 	install -m 644 -D libaudio_client.so -t $(TARGET_DIR)/usr/lib/
 	install -m 644 -D libaudio_client.so -t $(STAGING_DIR)/usr/lib/
 	install -m 644 -D include/audio_if_client.h -t $(STAGING_DIR)/usr/include
@@ -70,12 +75,14 @@
 	rm -f audio_server
 	rm -f audio_client_test
 	rm -f audio_client_test_ac3
+	rm -f halplay
 	rm -rf $(STAGING_DIR)/usr/include/hardware
 	rm -rf $(STAGING_DIR)/usr/include/system
 	rm -f libaudio_client.so
 	rm -f $(TARGET_DIR)/usr/bin/audio_server
 	rm -f $(TARGET_DIR)/usr/bin/audio_client_test
 	rm -f $(TARGET_DIR)/usr/bin/audio_client_test_ac3
+	rm -f $(TARGET_DIR)/usr/bin/halplay
 	rm -f $(TARGET_DIR)/usr/lib/libaudio_client.so
 	rm -f $(STAGING_DIR)/usr/lib/libaudio_client.so
 	rm -f $(STAGING_DIR)/usr/include/audio_if_client.h