Permalink
Browse files

[droid] add new internal player for amlogic based SoCs

  • Loading branch information...
1 parent e2f6742 commit f4ebf9862489138670b5b9d28b4eda2649097838 @davilla davilla committed Jul 20, 2012
Showing with 4,095 additions and 10 deletions.
  1. +1 −0 .gitignore
  2. +4 −0 Makefile.in
  3. +10 −1 configure.in
  4. +3 −3 system/playercorefactory.xml
  5. +2 −1 tools/android/depends/Makefile.in
  6. +14 −0 tools/android/depends/libamplayer/Makefile
  7. +89 −0 tools/android/depends/libamplayer/libamplayer/include/amports/aformat.h
  8. +148 −0 tools/android/depends/libamplayer/libamplayer/include/amports/amstream.h
  9. +111 −0 tools/android/depends/libamplayer/libamplayer/include/amports/vformat.h
  10. +40 −0 tools/android/depends/libamplayer/libamplayer/include/log_print.h
  11. +90 −0 tools/android/depends/libamplayer/libamplayer/include/message.h
  12. +80 −0 tools/android/depends/libamplayer/libamplayer/include/player.h
  13. +63 −0 tools/android/depends/libamplayer/libamplayer/include/player_error.h
  14. +14 −0 tools/android/depends/libamplayer/libamplayer/include/player_id.h
  15. +80 −0 tools/android/depends/libamplayer/libamplayer/include/player_set_sys.h
  16. +27 −0 tools/android/depends/libamplayer/libamplayer/include/player_thumbnail.h
  17. +271 −0 tools/android/depends/libamplayer/libamplayer/include/player_type.h
  18. +43 −0 tools/android/depends/libamplayer/libamplayer/include/stream_format.h
  19. +58 −0 xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
  20. +2,250 −0 xbmc/cores/amlplayer/AMLPlayer.cpp
  21. +256 −0 xbmc/cores/amlplayer/AMLPlayer.h
  22. +163 −0 xbmc/cores/amlplayer/DllLibamplayer.h
  23. +131 −0 xbmc/cores/amlplayer/FileURLProtocol.cpp
  24. +81 −0 xbmc/cores/amlplayer/FileURLProtocol.h
  25. +15 −0 xbmc/cores/amlplayer/Makefile.in
  26. +6 −0 xbmc/cores/amlplayer/amlplayer_advancedsettings.xml
  27. +6 −0 xbmc/cores/playercorefactory/PlayerCoreConfig.h
  28. +7 −0 xbmc/cores/playercorefactory/PlayerCoreFactory.cpp
  29. +10 −4 xbmc/cores/playercorefactory/PlayerCoreFactory.h
  30. +17 −0 xbmc/input/linux/LinuxInputDevices.cpp
  31. +5 −1 xbmc/video/windows/GUIWindowFullScreen.cpp
View
@@ -536,6 +536,7 @@ lib/cmyth/Makefile
/xbmc/cores/VideoRenderers/Makefile
/xbmc/cores/dvdplayer/Makefile
+/xbmc/cores/amlplayer/Makefile
# /lib/ffmpeg/
/lib/ffmpeg/config.h
View
4 Makefile.in 100755 → 100644
@@ -139,6 +139,10 @@ DIRECTORY_ARCHIVES += xbmc/windowing/android/windowing_android.a
DIRECTORY_ARCHIVES += xbmc/android/activity/activity.a
endif
+ifeq (@USE_AMLPLAYER@,1)
+DIRECTORY_ARCHIVES += xbmc/cores/amlplayer/amlplayer.a
+endif
+
PAPCODECS_DIRS= \
lib/xbadpcm \
lib/nosefart \
View
@@ -475,7 +475,7 @@ AC_ARG_ENABLE([libcap],
AC_ARG_ENABLE([player],
[AS_HELP_STRING([--enable-player],
- [enable additional players from a list of comma separated names, (default is none)])],
+ [enable additional players from a list of comma separated names, (default is none, choices are amlplayer)])],
[add_players=$enableval],
[add_players=no])
@@ -1647,6 +1647,14 @@ AC_CHECK_HEADERS([yajl/yajl_version.h], [], [
AC_DEFINE(YAJL_MAJOR, 1, [yajl version 1])
], [])
+# additional internal players
+case $add_players in
+ *amlplayer*)
+ AC_CHECK_HEADER([amlplayer/amports/amstream.h],, AC_MSG_ERROR($missing_headers))
+ XB_ADD_PLAYER([AMLPLAYER], [amlplayer])
+ ;;
+esac
+
# platform specific bin utilities
if test "$host_vendor" != "apple" ; then
AC_CHECK_PROG(HAVE_GAWK,gawk,"yes","no",)
@@ -2113,6 +2121,7 @@ OUTPUT_FILES="Makefile \
xbmc/cores/dvdplayer/DVDSubtitles/Makefile \
xbmc/cores/AudioEngine/Makefile \
xbmc/cores/paplayer/Makefile \
+ xbmc/cores/amlplayer/Makefile \
lib/timidity/Makefile \
lib/xbadpcm/Makefile \
lib/asap/Makefile \
@@ -24,9 +24,9 @@
</rule>
<!-- DVDs -->
- <rule name="dvd" dvd="true" player="videodefaultdvdplayer" />
- <rule name="dvdfile" dvdfile="true" player="videodefaultdvdplayer" />
- <rule name="dvdimage" dvdimage="true" player="videodefaultdvdplayer" />
+ <rule name="dvd" dvd="true" player="DVDPlayer" />
+ <rule name="dvdfile" dvdfile="true" player="DVDPlayer" />
+ <rule name="dvdimage" dvdimage="true" player="DVDPlayer" />
<!-- Only dvdplayer can handle these normally -->
<rule name="sdp/asf" filetypes="sdp|asf" player="DVDPlayer" />
@@ -12,7 +12,8 @@ SUBDIRS = \
libmodplug librtmp libxml2 yajl libmicrohttpd mysql libffi \
python26-native python26 samba alsa-lib libcdio afpfs-ng libshairport \
libplist libcec libbluray boost tinyxml dummy-libxbmc libsdl \
- liblzo2-native libjpeg-turbo-native libpng-native tiff-native libsdl_image rpl
+ liblzo2-native libjpeg-turbo-native libpng-native tiff-native libsdl_image rpl \
+ libamplayer
.PHONY: buildtools $(BUILDTOOLS) subdirs $(SUBDIRS) arm
@@ -0,0 +1,14 @@
+include ../Makefile.include
+DEPS= ../Makefile.include Makefile
+
+all: .installed-$(PLATFORM)
+
+.installed-$(PLATFORM): $(DEPS)
+ mkdir -p $(PREFIX)/include/amlplayer
+ cp -rf libamplayer/include/* $(PREFIX)/include/amlplayer
+ touch $@
+
+clean:
+ rm -f .installed-$(PLATFORM)
+
+distclean:: clean
@@ -0,0 +1,89 @@
+/**
+* @file aformat.h
+* @brief Porting from decoder driver for audio format
+* @author Tim Yao <timyao@amlogic.com>
+* @version 1.0.0
+* @date 2011-02-24
+*/
+/* Copyright (C) 2007-2011, Amlogic Inc.
+* All right reserved
+*
+*/
+
+/*
+ * AMLOGIC Audio/Video streaming port driver.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the named License,
+ * or any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+ *
+ * Author: Tim Yao <timyao@amlogic.com>
+ *
+ */
+
+#ifndef AFORMAT_H
+#define AFORMAT_H
+
+typedef enum {
+ AFORMAT_UNKNOWN = -1,
+ AFORMAT_MPEG = 0,
+ AFORMAT_PCM_S16LE = 1,
+ AFORMAT_AAC = 2,
+ AFORMAT_AC3 = 3,
+ AFORMAT_ALAW = 4,
+ AFORMAT_MULAW = 5,
+ AFORMAT_DTS = 6,
+ AFORMAT_PCM_S16BE = 7,
+ AFORMAT_FLAC = 8,
+ AFORMAT_COOK = 9,
+ AFORMAT_PCM_U8 = 10,
+ AFORMAT_ADPCM = 11,
+ AFORMAT_AMR = 12,
+ AFORMAT_RAAC = 13,
+ AFORMAT_WMA = 14,
+ AFORMAT_WMAPRO = 15,
+ AFORMAT_PCM_BLURAY = 16,
+ AFORMAT_ALAC = 17,
+ AFORMAT_VORBIS = 18,
+ AFORMAT_AAC_LATM = 19,
+ AFORMAT_APE = 20,
+ AFORMAT_UNSUPPORT ,
+ AFORMAT_MAX
+
+} aformat_t;
+
+#define AUDIO_EXTRA_DATA_SIZE (4096)
+#define IS_AFMT_VALID(afmt) ((afmt > AFORMAT_UNKNOWN) && (afmt < AFORMAT_MAX))
+
+#define IS_AUIDO_NEED_EXT_INFO(afmt) ((afmt == AFORMAT_ADPCM) \
+ ||(afmt == AFORMAT_WMA) \
+ ||(afmt == AFORMAT_WMAPRO) \
+ ||(afmt == AFORMAT_PCM_S16BE) \
+ ||(afmt == AFORMAT_PCM_S16LE) \
+ ||(afmt == AFORMAT_PCM_U8) \
+ ||(afmt == AFORMAT_PCM_BLURAY) \
+ ||(afmt == AFORMAT_AMR)\
+ ||(afmt == AFORMAT_ALAC)\
+ ||(afmt == AFORMAT_AC3) \
+ ||(afmt == AFORMAT_APE) \
+ ||(afmt == AFORMAT_FLAC) )
+
+
+#define IS_AUDIO_NOT_SUPPORT_EXCEED_2CH(afmt) ((afmt == AFORMAT_RAAC) \
+ ||(afmt == AFORMAT_COOK) \
+ ||(afmt == AFORMAT_FLAC))
+
+#define IS_AUIDO_NEED_PREFEED_HEADER(afmt) ((afmt == AFORMAT_VORBIS) )
+
+#endif /* AFORMAT_H */
+
@@ -0,0 +1,148 @@
+/**
+* @file amstream.h
+* @brief Porting from decoder driver for codec ioctl commands
+* @author Tim Yao <timyao@amlogic.com>
+* @version 1.0.0
+* @date 2011-02-24
+*/
+/* Copyright (C) 2007-2011, Amlogic Inc.
+* All right reserved
+*
+*/
+
+/*
+ * AMLOGIC Audio/Video streaming port driver.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the named License,
+ * or any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+ *
+ * Author: Tim Yao <timyao@amlogic.com>
+ *
+ */
+
+#ifndef AMSTREAM_H
+#define AMSTREAM_H
+
+#define PORT_FLAG_IN_USE 0x0001
+#define PORT_FLAG_VFORMAT 0x0002
+#define PORT_FLAG_AFORMAT 0x0004
+#define PORT_FLAG_FORMAT (PORT_FLAG_VFORMAT | PORT_FLAG_AFORMAT)
+#define PORT_FLAG_VID 0x0008
+#define PORT_FLAG_AID 0x0010
+#define PORT_FLAG_ID (PORT_FLAG_VID | PORT_FLAG_AID)
+#define PORT_FLAG_INITED 0x100
+
+#define PORT_TYPE_VIDEO 0x01
+#define PORT_TYPE_AUDIO 0x02
+#define PORT_TYPE_MPTS 0x04
+#define PORT_TYPE_MPPS 0x08
+#define PORT_TYPE_ES 0x10
+#define PORT_TYPE_RM 0x20
+
+#define AMSTREAM_IOC_MAGIC 'S'
+
+#define AMSTREAM_IOC_VB_START _IOW(AMSTREAM_IOC_MAGIC, 0x00, int)
+#define AMSTREAM_IOC_VB_SIZE _IOW(AMSTREAM_IOC_MAGIC, 0x01, int)
+#define AMSTREAM_IOC_AB_START _IOW(AMSTREAM_IOC_MAGIC, 0x02, int)
+#define AMSTREAM_IOC_AB_SIZE _IOW(AMSTREAM_IOC_MAGIC, 0x03, int)
+#define AMSTREAM_IOC_VFORMAT _IOW(AMSTREAM_IOC_MAGIC, 0x04, int)
+#define AMSTREAM_IOC_AFORMAT _IOW(AMSTREAM_IOC_MAGIC, 0x05, int)
+#define AMSTREAM_IOC_VID _IOW(AMSTREAM_IOC_MAGIC, 0x06, int)
+#define AMSTREAM_IOC_AID _IOW(AMSTREAM_IOC_MAGIC, 0x07, int)
+#define AMSTREAM_IOC_VB_STATUS _IOR(AMSTREAM_IOC_MAGIC, 0x08, unsigned long)
+#define AMSTREAM_IOC_AB_STATUS _IOR(AMSTREAM_IOC_MAGIC, 0x09, unsigned long)
+#define AMSTREAM_IOC_SYSINFO _IOW(AMSTREAM_IOC_MAGIC, 0x0a, int)
+#define AMSTREAM_IOC_ACHANNEL _IOW(AMSTREAM_IOC_MAGIC, 0x0b, int)
+#define AMSTREAM_IOC_SAMPLERATE _IOW(AMSTREAM_IOC_MAGIC, 0x0c, int)
+#define AMSTREAM_IOC_DATAWIDTH _IOW(AMSTREAM_IOC_MAGIC, 0x0d, int)
+#define AMSTREAM_IOC_TSTAMP _IOW(AMSTREAM_IOC_MAGIC, 0x0e, unsigned long)
+#define AMSTREAM_IOC_VDECSTAT _IOR(AMSTREAM_IOC_MAGIC, 0x0f, unsigned long)
+#define AMSTREAM_IOC_ADECSTAT _IOR(AMSTREAM_IOC_MAGIC, 0x10, unsigned long)
+#define AMSTREAM_IOC_PORT_INIT _IO(AMSTREAM_IOC_MAGIC, 0x11)
+#define AMSTREAM_IOC_TRICKMODE _IOW(AMSTREAM_IOC_MAGIC, 0x12, unsigned long)
+#define AMSTREAM_IOC_AUDIO_INFO _IOW(AMSTREAM_IOC_MAGIC, 0x13, unsigned long)
+#define AMSTREAM_IOC_TRICK_STAT _IOR(AMSTREAM_IOC_MAGIC, 0x14, unsigned long)
+#define AMSTREAM_IOC_AUDIO_RESET _IO(AMSTREAM_IOC_MAGIC, 0x15)
+#define AMSTREAM_IOC_SID _IOW(AMSTREAM_IOC_MAGIC, 0x16, int)
+#define AMSTREAM_IOC_VPAUSE _IOW(AMSTREAM_IOC_MAGIC, 0x17, int)
+#define AMSTREAM_IOC_AVTHRESH _IOW(AMSTREAM_IOC_MAGIC, 0x18, int)
+#define AMSTREAM_IOC_SYNCTHRESH _IOW(AMSTREAM_IOC_MAGIC, 0x19, int)
+#define AMSTREAM_IOC_SUB_RESET _IOW(AMSTREAM_IOC_MAGIC, 0x1a, int)
+#define AMSTREAM_IOC_SUB_LENGTH _IOR(AMSTREAM_IOC_MAGIC, 0x1b, unsigned long)
+#define AMSTREAM_IOC_SET_DEC_RESET _IOW(AMSTREAM_IOC_MAGIC, 0x1c, int)
+#define AMSTREAM_IOC_TS_SKIPBYTE _IOW(AMSTREAM_IOC_MAGIC, 0x1d, int)
+#define AMSTREAM_IOC_SUB_TYPE _IOW(AMSTREAM_IOC_MAGIC, 0x1e, int)
+#define AMSTREAM_IOC_APTS _IOR(AMSTREAM_IOC_MAGIC, 0x40, unsigned long)
+#define AMSTREAM_IOC_VPTS _IOR(AMSTREAM_IOC_MAGIC, 0x41, unsigned long)
+#define AMSTREAM_IOC_PCRSCR _IOR(AMSTREAM_IOC_MAGIC, 0x42, unsigned long)
+#define AMSTREAM_IOC_SYNCENABLE _IOW(AMSTREAM_IOC_MAGIC, 0x43, unsigned long)
+#define AMSTREAM_IOC_GET_SYNC_ADISCON _IOR(AMSTREAM_IOC_MAGIC, 0x44, unsigned long)
+#define AMSTREAM_IOC_SET_SYNC_ADISCON _IOW(AMSTREAM_IOC_MAGIC, 0x45, unsigned long)
+#define AMSTREAM_IOC_GET_SYNC_VDISCON _IOR(AMSTREAM_IOC_MAGIC, 0x46, unsigned long)
+#define AMSTREAM_IOC_SET_SYNC_VDISCON _IOW(AMSTREAM_IOC_MAGIC, 0x47, unsigned long)
+#define AMSTREAM_IOC_GET_VIDEO_DISABLE _IOR(AMSTREAM_IOC_MAGIC, 0x48, unsigned long)
+#define AMSTREAM_IOC_SET_VIDEO_DISABLE _IOW(AMSTREAM_IOC_MAGIC, 0x49, unsigned long)
+#define AMSTREAM_IOC_SET_PCRSCR _IOW(AMSTREAM_IOC_MAGIC, 0x4a, unsigned long)
+#define AMSTREAM_IOC_GET_VIDEO_AXIS _IOR(AMSTREAM_IOC_MAGIC, 0x4b, unsigned long)
+#define AMSTREAM_IOC_SET_VIDEO_AXIS _IOW(AMSTREAM_IOC_MAGIC, 0x4c, unsigned long)
+#define AMSTREAM_IOC_SUB_NUM _IOR(AMSTREAM_IOC_MAGIC, 0x50, unsigned long)
+#define AMSTREAM_IOC_SUB_INFO _IOR(AMSTREAM_IOC_MAGIC, 0x51, unsigned long)
+
+#define AMSTREAM_IOC_SET_DEMUX _IOW(AMSTREAM_IOC_MAGIC, 0x90, unsigned long)
+
+struct buf_status {
+ int size;
+ int data_len;
+ int free_len;
+ unsigned int read_pointer;
+ unsigned int write_pointer;
+};
+
+
+struct vdec_status {
+ unsigned int width;
+ unsigned int height;
+ unsigned int fps;
+ unsigned int error_count;
+ unsigned int status;
+};
+
+struct adec_status {
+ unsigned int channels;
+ unsigned int sample_rate;
+ unsigned int resolution;
+ unsigned int error_count;
+ unsigned int status;
+};
+
+struct am_io_param {
+ union {
+ int data;
+ int id;//get bufstatus? //or others
+ };
+
+ int len; //buffer size;
+
+ union {
+ char buf[1];
+ struct buf_status status;
+ struct vdec_status vstatus;
+ struct adec_status astatus;
+ };
+};
+void set_vdec_func(int (*vdec_func)(struct vdec_status *));
+void set_adec_func(int (*adec_func)(struct adec_status *));
+
+#endif /* AMSTREAM_H */
+
Oops, something went wrong.

0 comments on commit f4ebf98

Please sign in to comment.