├── COPYING ├── OpenMXPlayer ├── .classpath ├── .project ├── AndroidManifest.xml ├── bin │ ├── AndroidManifest.xml │ ├── classes │ │ └── net │ │ │ └── pocketmagic │ │ │ └── android │ │ │ └── openmxplayer │ │ │ ├── BuildConfig.class │ │ │ ├── OpenMXPlayer$1.class │ │ │ ├── OpenMXPlayer$2.class │ │ │ ├── OpenMXPlayer$3.class │ │ │ ├── OpenMXPlayer$4.class │ │ │ ├── OpenMXPlayer$5.class │ │ │ ├── OpenMXPlayer$6.class │ │ │ ├── OpenMXPlayer$7.class │ │ │ ├── OpenMXPlayer.class │ │ │ ├── PlayerEvents.class │ │ │ └── PlayerStates.class │ └── openmxplayer.jar ├── gen │ └── net │ │ └── pocketmagic │ │ └── android │ │ └── openmxplayer │ │ └── BuildConfig.java ├── proguard-project.txt ├── project.properties └── src │ └── net │ └── pocketmagic │ └── android │ └── openmxplayer │ ├── OpenMXPlayer.java │ ├── PlayerEvents.java │ └── PlayerStates.java ├── OpenMXPlayerDemo.apk ├── OpenMXPlayerDemo ├── .classpath ├── .project ├── AndroidManifest.xml ├── bin │ ├── AndroidManifest.xml │ ├── OpenMXPlayerDemo.apk │ ├── R.txt │ ├── classes.dex │ ├── classes │ │ └── net │ │ │ └── pocketmagic │ │ │ └── android │ │ │ └── openmxplayerdemo │ │ │ ├── BuildConfig.class │ │ │ ├── MainActivity$PlaceholderFragment$1.class │ │ │ ├── MainActivity$PlaceholderFragment$2.class │ │ │ ├── MainActivity$PlaceholderFragment.class │ │ │ ├── MainActivity.class │ │ │ ├── R$attr.class │ │ │ ├── R$dimen.class │ │ │ ├── R$drawable.class │ │ │ ├── R$id.class │ │ │ ├── R$layout.class │ │ │ ├── R$menu.class │ │ │ ├── R$raw.class │ │ │ ├── R$string.class │ │ │ ├── R$style.class │ │ │ └── R.class │ ├── dexedLibs │ │ ├── android-support-v4-d2288f9be4d7eeb1cfde5d29c291a70b.jar │ │ └── openmxplayer-7c02c975c582cd20ade32ed2a244043c.jar │ ├── jarlist.cache │ ├── res │ │ └── crunch │ │ │ └── drawable-xhdpi │ │ │ └── ic_launcher.png │ └── resources.ap_ ├── gen │ └── net │ │ └── pocketmagic │ │ └── android │ │ └── openmxplayerdemo │ │ ├── BuildConfig.java │ │ └── R.java ├── libs │ └── android-support-v4.jar ├── proguard-project.txt ├── project.properties ├── res │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ ├── layout │ │ ├── activity_main.xml │ │ └── fragment_main.xml │ ├── menu │ │ └── main.xml │ ├── raw │ │ ├── sampleaac.m4p │ │ ├── samplemp3.mp3 │ │ └── samplewma.wma │ ├── values-v11 │ │ └── styles.xml │ ├── values-v14 │ │ └── styles.xml │ ├── values-w820dp │ │ └── dimens.xml │ └── values │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml └── src │ └── net │ └── pocketmagic │ └── android │ └── openmxplayerdemo │ └── MainActivity.java ├── README └── lgpl.txt /COPYING: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /OpenMXPlayer/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /OpenMXPlayer/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | OpenMXPlayer 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /OpenMXPlayer/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /OpenMXPlayer/bin/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/BuildConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/BuildConfig.class -------------------------------------------------------------------------------- /OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/OpenMXPlayer$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/OpenMXPlayer$1.class -------------------------------------------------------------------------------- /OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/OpenMXPlayer$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/OpenMXPlayer$2.class -------------------------------------------------------------------------------- /OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/OpenMXPlayer$3.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/OpenMXPlayer$3.class -------------------------------------------------------------------------------- /OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/OpenMXPlayer$4.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/OpenMXPlayer$4.class -------------------------------------------------------------------------------- /OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/OpenMXPlayer$5.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/OpenMXPlayer$5.class -------------------------------------------------------------------------------- /OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/OpenMXPlayer$6.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/OpenMXPlayer$6.class -------------------------------------------------------------------------------- /OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/OpenMXPlayer$7.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/OpenMXPlayer$7.class -------------------------------------------------------------------------------- /OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/OpenMXPlayer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/OpenMXPlayer.class -------------------------------------------------------------------------------- /OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/PlayerEvents.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/PlayerEvents.class -------------------------------------------------------------------------------- /OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/PlayerStates.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayer/bin/classes/net/pocketmagic/android/openmxplayer/PlayerStates.class -------------------------------------------------------------------------------- /OpenMXPlayer/bin/openmxplayer.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayer/bin/openmxplayer.jar -------------------------------------------------------------------------------- /OpenMXPlayer/gen/net/pocketmagic/android/openmxplayer/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /** Automatically generated file. DO NOT MODIFY */ 2 | package net.pocketmagic.android.openmxplayer; 3 | 4 | public final class BuildConfig { 5 | public final static boolean DEBUG = true; 6 | } -------------------------------------------------------------------------------- /OpenMXPlayer/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /OpenMXPlayer/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-16 15 | android.library=true 16 | -------------------------------------------------------------------------------- /OpenMXPlayer/src/net/pocketmagic/android/openmxplayer/OpenMXPlayer.java: -------------------------------------------------------------------------------- 1 | package net.pocketmagic.android.openmxplayer; 2 | /* 3 | ** OpenMXPlayer - Freeware audio player library for Android 4 | ** Copyright (C) 2009 - 2014 Radu Motisan, radu.motisan@gmail.com 5 | ** 6 | ** This file is a part of "OpenMXPlayer" open source library. 7 | ** 8 | ** OpenMXPlayer is free software; you can redistribute it and/or modify 9 | ** it under the terms of the GNU Lesser General Public License as published 10 | ** by the Free Software Foundation; either version 3 of the License, 11 | ** or (at your option) any later version. 12 | ** 13 | ** This program is distributed in the hope that it will be useful, 14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ** GNU Lesser General Public License for more details. 17 | ** 18 | ** You should have received a copy of the GNU Lesser General Public License 19 | ** along with this program. If not, see . 20 | */ 21 | import java.io.FileDescriptor; 22 | import java.nio.ByteBuffer; 23 | 24 | import android.content.Context; 25 | import android.content.res.AssetFileDescriptor; 26 | import android.media.AudioFormat; 27 | import android.media.AudioManager; 28 | import android.media.AudioTrack; 29 | import android.media.MediaCodec; 30 | import android.media.MediaCodecInfo; 31 | import android.media.MediaCodecList; 32 | import android.media.MediaExtractor; 33 | import android.media.MediaFormat; 34 | import android.os.Handler; 35 | import android.util.Log; 36 | 37 | public class OpenMXPlayer implements Runnable { 38 | public final String LOG_TAG = "OpenMXPlayer"; 39 | 40 | private MediaExtractor extractor; 41 | private MediaCodec codec; 42 | private AudioTrack audioTrack; 43 | 44 | private PlayerEvents events = null; 45 | private PlayerStates state = new PlayerStates(); 46 | private String sourcePath = null; 47 | private int sourceRawResId = -1; 48 | private Context mContext; 49 | private boolean stop = false; 50 | 51 | Handler handler = new Handler(); 52 | 53 | String mime = null; 54 | int sampleRate = 0, channels = 0, bitrate = 0; 55 | long presentationTimeUs = 0, duration = 0; 56 | 57 | public void setEventsListener(PlayerEvents events) { 58 | this.events = events; 59 | } 60 | 61 | public OpenMXPlayer() { 62 | 63 | } 64 | public OpenMXPlayer(PlayerEvents events) { 65 | setEventsListener(events); 66 | } 67 | 68 | /** 69 | * For live streams, duration is 0 70 | * @return 71 | */ 72 | public boolean isLive() { 73 | return (duration == 0); 74 | } 75 | 76 | /** 77 | * set the data source, a file path or an url, or a file descriptor, to play encoded audio from 78 | * @param src 79 | */ 80 | public void setDataSource(String src) { 81 | sourcePath = src; 82 | } 83 | 84 | public void setDataSource(Context context, int resid) { 85 | mContext = context; 86 | sourceRawResId = resid; 87 | } 88 | 89 | public void play() { 90 | if (state.get() == PlayerStates.STOPPED) { 91 | stop = false; 92 | new Thread(this).start(); 93 | } 94 | if (state.get() == PlayerStates.READY_TO_PLAY) { 95 | state.set(PlayerStates.PLAYING); 96 | syncNotify(); 97 | } 98 | } 99 | 100 | /** 101 | * Call notify to control the PAUSE (waiting) state, when the state is changed 102 | */ 103 | public synchronized void syncNotify() { 104 | notify(); 105 | } 106 | public void stop() { 107 | stop = true; 108 | } 109 | 110 | public void pause() { 111 | state.set(PlayerStates.READY_TO_PLAY); 112 | } 113 | 114 | public void seek(long pos) { 115 | extractor.seekTo(pos, MediaExtractor.SEEK_TO_CLOSEST_SYNC); 116 | } 117 | 118 | public void seek(int percent) { 119 | long pos = percent * duration / 100; 120 | seek(pos); 121 | } 122 | 123 | 124 | /** 125 | * A pause mechanism that would block current thread when pause flag is set (READY_TO_PLAY) 126 | */ 127 | public synchronized void waitPlay(){ 128 | // if (duration == 0) return; 129 | while(state.get() == PlayerStates.READY_TO_PLAY) { 130 | try { 131 | wait(); 132 | } catch (InterruptedException e) { 133 | e.printStackTrace(); 134 | } 135 | } 136 | } 137 | 138 | @Override 139 | public void run() { 140 | android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO); 141 | 142 | // extractor gets information about the stream 143 | extractor = new MediaExtractor(); 144 | // try to set the source, this might fail 145 | try { 146 | if (sourcePath != null) extractor.setDataSource(this.sourcePath); 147 | if (sourceRawResId != -1) { 148 | AssetFileDescriptor fd = mContext.getResources().openRawResourceFd(sourceRawResId); 149 | extractor.setDataSource(fd.getFileDescriptor(), fd.getStartOffset(), fd.getDeclaredLength()); 150 | fd.close(); 151 | } 152 | } catch (Exception e) { 153 | Log.e(LOG_TAG, "exception:"+e.getMessage()); 154 | if (events != null) handler.post(new Runnable() { @Override public void run() { events.onError(); } }); 155 | return; 156 | } 157 | 158 | // Read track header 159 | MediaFormat format = null; 160 | try { 161 | format = extractor.getTrackFormat(0); 162 | mime = format.getString(MediaFormat.KEY_MIME); 163 | sampleRate = format.getInteger(MediaFormat.KEY_SAMPLE_RATE); 164 | channels = format.getInteger(MediaFormat.KEY_CHANNEL_COUNT); 165 | // if duration is 0, we are probably playing a live stream 166 | duration = format.getLong(MediaFormat.KEY_DURATION); 167 | bitrate = format.getInteger(MediaFormat.KEY_BIT_RATE); 168 | } catch (Exception e) { 169 | Log.e(LOG_TAG, "Reading format parameters exception:"+e.getMessage()); 170 | // don't exit, tolerate this error, we'll fail later if this is critical 171 | } 172 | Log.d(LOG_TAG, "Track info: mime:" + mime + " sampleRate:" + sampleRate + " channels:" + channels + " bitrate:" + bitrate + " duration:" + duration); 173 | 174 | // check we have audio content we know 175 | if (format == null || !mime.startsWith("audio/")) { 176 | if (events != null) handler.post(new Runnable() { @Override public void run() { events.onError(); } }); 177 | return; 178 | } 179 | // create the actual decoder, using the mime to select 180 | codec = MediaCodec.createDecoderByType(mime); 181 | // check we have a valid codec instance 182 | if (codec == null) { 183 | if (events != null) handler.post(new Runnable() { @Override public void run() { events.onError(); } }); 184 | return; 185 | } 186 | 187 | //state.set(PlayerStates.READY_TO_PLAY); 188 | if (events != null) handler.post(new Runnable() { @Override public void run() { events.onStart(mime, sampleRate, channels, duration); } }); 189 | 190 | codec.configure(format, null, null, 0); 191 | codec.start(); 192 | ByteBuffer[] codecInputBuffers = codec.getInputBuffers(); 193 | ByteBuffer[] codecOutputBuffers = codec.getOutputBuffers(); 194 | 195 | // configure AudioTrack 196 | int channelConfiguration = channels == 1 ? AudioFormat.CHANNEL_OUT_MONO : AudioFormat.CHANNEL_OUT_STEREO; 197 | int minSize = AudioTrack.getMinBufferSize( sampleRate, channelConfiguration, AudioFormat.ENCODING_PCM_16BIT); 198 | audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, sampleRate, channelConfiguration, 199 | AudioFormat.ENCODING_PCM_16BIT, minSize, AudioTrack.MODE_STREAM); 200 | 201 | // start playing, we will feed the AudioTrack later 202 | audioTrack.play(); 203 | extractor.selectTrack(0); 204 | 205 | // start decoding 206 | final long kTimeOutUs = 1000; 207 | MediaCodec.BufferInfo info = new MediaCodec.BufferInfo(); 208 | boolean sawInputEOS = false; 209 | boolean sawOutputEOS = false; 210 | int noOutputCounter = 0; 211 | int noOutputCounterLimit = 10; 212 | 213 | state.set(PlayerStates.PLAYING); 214 | while (!sawOutputEOS && noOutputCounter < noOutputCounterLimit && !stop) { 215 | 216 | // pause implementation 217 | waitPlay(); 218 | 219 | noOutputCounter++; 220 | // read a buffer before feeding it to the decoder 221 | if (!sawInputEOS) { 222 | int inputBufIndex = codec.dequeueInputBuffer(kTimeOutUs); 223 | if (inputBufIndex >= 0) { 224 | ByteBuffer dstBuf = codecInputBuffers[inputBufIndex]; 225 | int sampleSize = extractor.readSampleData(dstBuf, 0); 226 | if (sampleSize < 0) { 227 | Log.d(LOG_TAG, "saw input EOS. Stopping playback"); 228 | sawInputEOS = true; 229 | sampleSize = 0; 230 | } else { 231 | presentationTimeUs = extractor.getSampleTime(); 232 | final int percent = (duration == 0)? 0 : (int) (100 * presentationTimeUs / duration); 233 | if (events != null) handler.post(new Runnable() { @Override public void run() { events.onPlayUpdate(percent, presentationTimeUs / 1000, duration / 1000); } }); 234 | } 235 | 236 | codec.queueInputBuffer(inputBufIndex, 0, sampleSize, presentationTimeUs, sawInputEOS ? MediaCodec.BUFFER_FLAG_END_OF_STREAM : 0); 237 | 238 | if (!sawInputEOS) extractor.advance(); 239 | 240 | } else { 241 | Log.e(LOG_TAG, "inputBufIndex " +inputBufIndex); 242 | } 243 | } // !sawInputEOS 244 | 245 | // decode to PCM and push it to the AudioTrack player 246 | int res = codec.dequeueOutputBuffer(info, kTimeOutUs); 247 | 248 | if (res >= 0) { 249 | if (info.size > 0) noOutputCounter = 0; 250 | 251 | int outputBufIndex = res; 252 | ByteBuffer buf = codecOutputBuffers[outputBufIndex]; 253 | 254 | final byte[] chunk = new byte[info.size]; 255 | buf.get(chunk); 256 | buf.clear(); 257 | if(chunk.length > 0){ 258 | audioTrack.write(chunk,0,chunk.length); 259 | /*if(this.state.get() != PlayerStates.PLAYING) { 260 | if (events != null) handler.post(new Runnable() { @Override public void run() { events.onPlay(); } }); 261 | state.set(PlayerStates.PLAYING); 262 | }*/ 263 | 264 | } 265 | codec.releaseOutputBuffer(outputBufIndex, false); 266 | if ((info.flags & MediaCodec.BUFFER_FLAG_END_OF_STREAM) != 0) { 267 | Log.d(LOG_TAG, "saw output EOS."); 268 | sawOutputEOS = true; 269 | } 270 | } else if (res == MediaCodec.INFO_OUTPUT_BUFFERS_CHANGED) { 271 | codecOutputBuffers = codec.getOutputBuffers(); 272 | Log.d(LOG_TAG, "output buffers have changed."); 273 | } else if (res == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED) { 274 | MediaFormat oformat = codec.getOutputFormat(); 275 | Log.d(LOG_TAG, "output format has changed to " + oformat); 276 | } else { 277 | Log.d(LOG_TAG, "dequeueOutputBuffer returned " + res); 278 | } 279 | } 280 | 281 | Log.d(LOG_TAG, "stopping..."); 282 | 283 | if(codec != null) { 284 | codec.stop(); 285 | codec.release(); 286 | codec = null; 287 | } 288 | if(audioTrack != null) { 289 | audioTrack.flush(); 290 | audioTrack.release(); 291 | audioTrack = null; 292 | } 293 | 294 | // clear source and the other globals 295 | sourcePath = null; 296 | sourceRawResId = -1; 297 | duration = 0; 298 | mime = null; 299 | sampleRate = 0; channels = 0; bitrate = 0; 300 | presentationTimeUs = 0; duration = 0; 301 | 302 | 303 | state.set(PlayerStates.STOPPED); 304 | stop = true; 305 | 306 | if(noOutputCounter >= noOutputCounterLimit) { 307 | if (events != null) handler.post(new Runnable() { @Override public void run() { events.onError(); } }); 308 | } else { 309 | if (events != null) handler.post(new Runnable() { @Override public void run() { events.onStop(); } }); 310 | } 311 | } 312 | 313 | public static String listCodecs() { 314 | String results = ""; 315 | int numCodecs = MediaCodecList.getCodecCount(); 316 | for (int i = 0; i < numCodecs; i++) { 317 | MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i); 318 | 319 | // grab results and put them in a list 320 | String name = codecInfo.getName(); 321 | boolean isEncoder = codecInfo.isEncoder(); 322 | String[] types = codecInfo.getSupportedTypes(); 323 | String typeList = ""; 324 | for (String s:types) typeList += s + " "; 325 | results += (i+1) + ". " + name+ " " + typeList + "\n\n"; 326 | } 327 | return results; 328 | } 329 | 330 | 331 | } 332 | -------------------------------------------------------------------------------- /OpenMXPlayer/src/net/pocketmagic/android/openmxplayer/PlayerEvents.java: -------------------------------------------------------------------------------- 1 | package net.pocketmagic.android.openmxplayer; 2 | 3 | 4 | public interface PlayerEvents { 5 | public void onStart(String mime, int sampleRate,int channels, long duration); 6 | public void onPlay(); 7 | public void onPlayUpdate(int percent, long currentms, long totalms); 8 | public void onStop(); 9 | public void onError(); 10 | } 11 | -------------------------------------------------------------------------------- /OpenMXPlayer/src/net/pocketmagic/android/openmxplayer/PlayerStates.java: -------------------------------------------------------------------------------- 1 | package net.pocketmagic.android.openmxplayer; 2 | /* 3 | ** OpenMXPlayer - Freeware audio player library for Android 4 | ** Copyright (C) 2009 - 2014 Radu Motisan, radu.motisan@gmail.com 5 | ** 6 | ** This file is a part of "OpenMXPlayer" open source library. 7 | ** 8 | ** OpenMXPlayer is free software; you can redistribute it and/or modify 9 | ** it under the terms of the GNU Lesser General Public License as published 10 | ** by the Free Software Foundation; either version 3 of the License, 11 | ** or (at your option) any later version. 12 | ** 13 | ** This program is distributed in the hope that it will be useful, 14 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | ** GNU Lesser General Public License for more details. 17 | ** 18 | ** You should have received a copy of the GNU Lesser General Public License 19 | ** along with this program. If not, see . 20 | */ 21 | public class PlayerStates { 22 | /** 23 | * Playing state which can either be stopped, playing, or reading the header before playing 24 | */ 25 | public static final int READY_TO_PLAY = 2; 26 | public static final int PLAYING = 3; 27 | public static final int STOPPED = 4; 28 | public int playerState = STOPPED; 29 | 30 | public int get() { 31 | return playerState; 32 | } 33 | 34 | public void set(int state) { 35 | playerState = state; 36 | } 37 | 38 | 39 | /** 40 | * Checks whether the player is ready to play, this is the state used also for Pause (phase 2) 41 | * 42 | * @return true if ready, false otherwise 43 | */ 44 | public synchronized boolean isReadyToPlay() { 45 | return playerState == PlayerStates.READY_TO_PLAY; 46 | } 47 | 48 | 49 | /** 50 | * Checks whether the player is currently playing (phase 3) 51 | * 52 | * @return true if playing, false otherwise 53 | */ 54 | public synchronized boolean isPlaying() { 55 | return playerState == PlayerStates.PLAYING; 56 | } 57 | 58 | 59 | /** 60 | * Checks whether the player is currently stopped (not playing) 61 | * 62 | * @return true if playing, false otherwise 63 | */ 64 | public synchronized boolean isStopped() { 65 | return playerState == PlayerStates.STOPPED; 66 | } 67 | 68 | 69 | 70 | 71 | } 72 | -------------------------------------------------------------------------------- /OpenMXPlayerDemo.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo.apk -------------------------------------------------------------------------------- /OpenMXPlayerDemo/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /OpenMXPlayerDemo/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | OpenMXPlayerDemo 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /OpenMXPlayerDemo/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 19 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 19 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/OpenMXPlayerDemo.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/OpenMXPlayerDemo.apk -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/R.txt: -------------------------------------------------------------------------------- 1 | int dimen activity_horizontal_margin 0x7f050000 2 | int dimen activity_vertical_margin 0x7f050001 3 | int drawable ic_launcher 0x7f020000 4 | int id action_settings 0x7f09000c 5 | int id container 0x7f090000 6 | int id idbut1 0x7f090001 7 | int id idbut2a 0x7f090002 8 | int id idbut2b 0x7f090003 9 | int id idbut2c 0x7f090004 10 | int id idbut3 0x7f090006 11 | int id idbut4 0x7f090009 12 | int id idbut5 0x7f09000a 13 | int id idbut6 0x7f09000b 14 | int id idet1 0x7f090005 15 | int id idtv1 0x7f090007 16 | int id seekbar 0x7f090008 17 | int layout activity_main 0x7f030000 18 | int layout fragment_main 0x7f030001 19 | int menu main 0x7f080000 20 | int raw sampleaac 0x7f040000 21 | int raw samplemp3 0x7f040001 22 | int raw samplewma 0x7f040002 23 | int string action_settings 0x7f060002 24 | int string app_about 0x7f060003 25 | int string app_name 0x7f060000 26 | int string but1 0x7f060004 27 | int string but2a 0x7f060005 28 | int string but2b 0x7f060006 29 | int string but2c 0x7f060007 30 | int string but3 0x7f060008 31 | int string but4 0x7f060009 32 | int string but5 0x7f06000a 33 | int string but6 0x7f06000b 34 | int string hello_world 0x7f060001 35 | int string seek_instr 0x7f06000c 36 | int style AppBaseTheme 0x7f070000 37 | int style AppTheme 0x7f070001 38 | -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/classes.dex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/classes.dex -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/BuildConfig.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/BuildConfig.class -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/MainActivity$PlaceholderFragment$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/MainActivity$PlaceholderFragment$1.class -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/MainActivity$PlaceholderFragment$2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/MainActivity$PlaceholderFragment$2.class -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/MainActivity$PlaceholderFragment.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/MainActivity$PlaceholderFragment.class -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/MainActivity.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/MainActivity.class -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R$attr.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R$attr.class -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R$dimen.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R$dimen.class -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R$drawable.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R$drawable.class -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R$id.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R$id.class -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R$layout.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R$layout.class -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R$menu.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R$menu.class -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R$raw.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R$raw.class -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R$string.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R$string.class -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R$style.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R$style.class -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/classes/net/pocketmagic/android/openmxplayerdemo/R.class -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/dexedLibs/android-support-v4-d2288f9be4d7eeb1cfde5d29c291a70b.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/dexedLibs/android-support-v4-d2288f9be4d7eeb1cfde5d29c291a70b.jar -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/dexedLibs/openmxplayer-7c02c975c582cd20ade32ed2a244043c.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/dexedLibs/openmxplayer-7c02c975c582cd20ade32ed2a244043c.jar -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/jarlist.cache: -------------------------------------------------------------------------------- 1 | # cache for current jar dependency. DO NOT EDIT. 2 | # format is 3 | # Encoding is UTF-8 4 | -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/res/crunch/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/res/crunch/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /OpenMXPlayerDemo/bin/resources.ap_: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/bin/resources.ap_ -------------------------------------------------------------------------------- /OpenMXPlayerDemo/gen/net/pocketmagic/android/openmxplayerdemo/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /** Automatically generated file. DO NOT MODIFY */ 2 | package net.pocketmagic.android.openmxplayerdemo; 3 | 4 | public final class BuildConfig { 5 | public final static boolean DEBUG = true; 6 | } -------------------------------------------------------------------------------- /OpenMXPlayerDemo/gen/net/pocketmagic/android/openmxplayerdemo/R.java: -------------------------------------------------------------------------------- 1 | /* AUTO-GENERATED FILE. DO NOT MODIFY. 2 | * 3 | * This class was automatically generated by the 4 | * aapt tool from the resource data it found. It 5 | * should not be modified by hand. 6 | */ 7 | 8 | package net.pocketmagic.android.openmxplayerdemo; 9 | 10 | public final class R { 11 | public static final class attr { 12 | } 13 | public static final class dimen { 14 | /** Default screen margins, per the Android Design guidelines. 15 | 16 | Example customization of dimensions originally defined in res/values/dimens.xml 17 | (such as screen margins) for screens with more than 820dp of available width. This 18 | would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). 19 | 20 | */ 21 | public static final int activity_horizontal_margin=0x7f050000; 22 | public static final int activity_vertical_margin=0x7f050001; 23 | } 24 | public static final class drawable { 25 | public static final int ic_launcher=0x7f020000; 26 | } 27 | public static final class id { 28 | public static final int action_settings=0x7f09000c; 29 | public static final int container=0x7f090000; 30 | public static final int idbut1=0x7f090001; 31 | public static final int idbut2a=0x7f090002; 32 | public static final int idbut2b=0x7f090003; 33 | public static final int idbut2c=0x7f090004; 34 | public static final int idbut3=0x7f090006; 35 | public static final int idbut4=0x7f090009; 36 | public static final int idbut5=0x7f09000a; 37 | public static final int idbut6=0x7f09000b; 38 | public static final int idet1=0x7f090005; 39 | public static final int idtv1=0x7f090007; 40 | public static final int seekbar=0x7f090008; 41 | } 42 | public static final class layout { 43 | public static final int activity_main=0x7f030000; 44 | public static final int fragment_main=0x7f030001; 45 | } 46 | public static final class menu { 47 | public static final int main=0x7f080000; 48 | } 49 | public static final class raw { 50 | public static final int sampleaac=0x7f040000; 51 | public static final int samplemp3=0x7f040001; 52 | public static final int samplewma=0x7f040002; 53 | } 54 | public static final class string { 55 | public static final int action_settings=0x7f060002; 56 | public static final int app_about=0x7f060003; 57 | public static final int app_name=0x7f060000; 58 | public static final int but1=0x7f060004; 59 | public static final int but2a=0x7f060005; 60 | public static final int but2b=0x7f060006; 61 | public static final int but2c=0x7f060007; 62 | public static final int but3=0x7f060008; 63 | public static final int but4=0x7f060009; 64 | public static final int but5=0x7f06000a; 65 | public static final int but6=0x7f06000b; 66 | public static final int hello_world=0x7f060001; 67 | public static final int seek_instr=0x7f06000c; 68 | } 69 | public static final class style { 70 | /** 71 | Base application theme, dependent on API level. This theme is replaced 72 | by AppBaseTheme from res/values-vXX/styles.xml on newer devices. 73 | 74 | 75 | Theme customizations available in newer API levels can go in 76 | res/values-vXX/styles.xml, while customizations related to 77 | backward-compatibility can go here. 78 | 79 | 80 | Base application theme for API 11+. This theme completely replaces 81 | AppBaseTheme from res/values/styles.xml on API 11+ devices. 82 | 83 | API 11 theme customizations can go here. 84 | 85 | Base application theme for API 14+. This theme completely replaces 86 | AppBaseTheme from BOTH res/values/styles.xml and 87 | res/values-v11/styles.xml on API 14+ devices. 88 | 89 | API 14 theme customizations can go here. 90 | */ 91 | public static final int AppBaseTheme=0x7f070000; 92 | /** Application theme. 93 | All customizations that are NOT specific to a particular API-level can go here. 94 | */ 95 | public static final int AppTheme=0x7f070001; 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /OpenMXPlayerDemo/libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/libs/android-support-v4.jar -------------------------------------------------------------------------------- /OpenMXPlayerDemo/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /OpenMXPlayerDemo/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-16 15 | android.library.reference.1=../OpenMXPlayer 16 | -------------------------------------------------------------------------------- /OpenMXPlayerDemo/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/radhoo/android-openmxplayer/e3593beb5d111281ce894ac8b8c03c46e5b2d1d4/OpenMXPlayerDemo/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /OpenMXPlayerDemo/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /OpenMXPlayerDemo/res/layout/fragment_main.xml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 16 | 20 |