Permalink
Browse files

remove mediaplayer and use it as a dependency, use git tag version

  • Loading branch information...
jpihl committed Nov 30, 2017
1 parent 04d6934 commit 9364bfa349240b4e14754aa898420d6f88f6d74c
Showing with 94 additions and 1,190 deletions.
  1. +5 −11 .gitignore
  2. +1 −3 README.rst
  3. +6 −7 app/build.gradle
  4. +0 −18 app/src/androidTest/java/com/steinwurf/petro/ApplicationTest.java
  5. +2 −10 app/src/main/java/com/steinwurf/petro/AudioActivity.java
  6. +4 −12 app/src/main/java/com/steinwurf/petro/BothActivity.java
  7. +5 −18 app/src/main/java/com/steinwurf/petro/VideoActivity.java
  8. +0 −20 app/src/test/java/com/steinwurf/petro/ExampleUnitTest.java
  9. +13 −2 build.gradle
  10. +20 −20 jni/aac_sample_extractor_jni.cpp
  11. +19 −19 jni/nalu_extractor_jni.cpp
  12. +4 −4 jni/sequence_parameter_set_jni.cpp
  13. +3 −3 jni/wscript_build
  14. +0 −17 mediaextractor/src/test/java/com/steinwurf/mediaextractor/ExampleUnitTest.java
  15. +0 −1 mediaplayer/.gitignore
  16. +0 −51 mediaplayer/build.gradle
  17. +0 −25 mediaplayer/proguard-rules.pro
  18. +0 −2 mediaplayer/src/main/AndroidManifest.xml
  19. +0 −119 mediaplayer/src/main/java/com/steinwurf/mediaplayer/AudioDecoder.java
  20. +0 −272 mediaplayer/src/main/java/com/steinwurf/mediaplayer/Decoder.java
  21. +0 −25 mediaplayer/src/main/java/com/steinwurf/mediaplayer/Sample.java
  22. +0 −16 mediaplayer/src/main/java/com/steinwurf/mediaplayer/SampleProvider.java
  23. +0 −59 mediaplayer/src/main/java/com/steinwurf/mediaplayer/SampleStorage.java
  24. +0 −148 mediaplayer/src/main/java/com/steinwurf/mediaplayer/Utils.java
  25. +0 −117 mediaplayer/src/main/java/com/steinwurf/mediaplayer/VideoDecoder.java
  26. +0 −52 mediaplayer/src/test/java/com/steinwurf/mediaplayer/SampleStorageUnitTest.java
  27. +0 −18 mediaplayer/src/test/java/com/steinwurf/mediaplayer/SampleUnitTest.java
  28. +0 −103 mediaplayer/src/test/java/com/steinwurf/mediaplayer/UtilsUnitTest.java
  29. 0 {mediaextractor → petro}/.gitignore
  30. +4 −12 {mediaextractor → petro}/build.gradle
  31. 0 {mediaextractor → petro}/proguard-rules.pro
  32. 0 {mediaextractor → petro}/src/main/AndroidManifest.xml
  33. +2 −2 ...a/com/steinwurf/mediaextractor → petro/src/main/java/com/steinwurf/petro}/AACSampleExtractor.java
  34. +1 −1 .../main/java/com/steinwurf/mediaextractor → petro/src/main/java/com/steinwurf/petro}/Extractor.java
  35. +3 −1 ...n/java/com/steinwurf/mediaextractor → petro/src/main/java/com/steinwurf/petro}/NALUExtractor.java
  36. +1 −1 ...com/steinwurf/mediaextractor → petro/src/main/java/com/steinwurf/petro}/SequenceParameterSet.java
  37. +1 −1 settings.gradle
@@ -22,17 +22,11 @@ app/src/main/java/org/freedesktop
app/src/main/assets/fontconfig/
app/src/main/assets/ssl/certs/ca-certificates.crt
mediaextractor/libs/armeabi/
mediaextractor/src/main/jniLibs/
mediaextractor/src/main/java/org/freedesktop
mediaextractor/src/main/assets/fontconfig/
mediaextractor/src/main/assets/ssl/certs/ca-certificates.crt
mediaplayer/libs/armeabi/
mediaplayer/src/main/jniLibs/
mediaplayer/src/main/java/org/freedesktop
mediaplayer/src/main/assets/fontconfig/
mediaplayer/src/main/assets/ssl/certs/ca-certificates.crt
petro/libs/armeabi/
petro/src/main/jniLibs/
petro/src/main/java/org/freedesktop
petro/src/main/assets/fontconfig/
petro/src/main/assets/ssl/certs/ca-certificates.crt
# Proguard folder generated by Eclipse
proguard/
@@ -6,7 +6,6 @@ for audio and video playback with the Android `MediaCodec API <https://developer
Activities
----------
Each Activity implements a different solution, either using the Android
MediaExtractor component or Steinwurf's `petro library <https://github.com/steinwurf/petro>`_
to extract AAC and H264 samples from a local mp4 file.
@@ -32,7 +31,7 @@ as a basis for a streaming application.
Building
--------
First, the native C++ library (``libpetro_android.so``) should be configured
First, the native C++ libraries should be configured
and built with waf. This should be done outside Android Studio.
See our detailed description for configuring and using the Android SDK and the
@@ -58,4 +57,3 @@ the native library is always up-to-date.
If you clean (or rebuild) the project in Android Studio, then you have to
repeat the waf configure step, because the build folder is removed when the
project is cleaned.
@@ -2,14 +2,13 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion project.ext.compileSdkVersion
buildToolsVersion project.ext.buildToolsVersion
defaultConfig {
applicationId "com.steinwurf.petro"
minSdkVersion 16
targetSdkVersion project.ext.targetSdkVersion
versionCode 1
versionName "1.0"
versionCode androidGitVersion.code()
versionName androidGitVersion.name()
}
buildTypes {
release {
@@ -21,8 +20,8 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation project(path: ':mediaextractor')
implementation project(path: ':mediaplayer')
implementation 'com.android.support:appcompat-v7:27.0.1'
implementation 'com.steinwurf.mediaplayer:mediaplayer:7.0.0'
implementation project(path: ':petro')
}

This file was deleted.

Oops, something went wrong.
@@ -9,22 +9,18 @@
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.steinwurf.mediaextractor.AACSampleExtractor;
import com.steinwurf.mediaextractor.Extractor;
import com.steinwurf.mediaplayer.AudioDecoder;
import com.steinwurf.mediaplayer.Sample;
import com.steinwurf.mediaplayer.SampleProvider;
import java.io.IOException;
public class AudioActivity extends AppCompatActivity
{
private static final String TAG = "AudioActivity";
public static class AACSampleExtractorSampleProvider implements SampleProvider {
private final AACSampleExtractor extractor;
public AACSampleExtractorSampleProvider(AACSampleExtractor extractor) {
AACSampleExtractorSampleProvider(AACSampleExtractor extractor) {
this.extractor = extractor;
}
@@ -86,11 +82,7 @@ protected void onCreate(Bundle savedInstanceState)
@Override
protected void onStart() {
super.onStart();
try {
mAudioDecoder.start();
} catch (IOException e) {
e.printStackTrace();
}
mAudioDecoder.start();
}
@Override
@@ -13,10 +13,6 @@
import android.view.Surface;
import android.view.TextureView;
import com.steinwurf.mediaextractor.AACSampleExtractor;
import com.steinwurf.mediaextractor.Extractor;
import com.steinwurf.mediaextractor.NALUExtractor;
import com.steinwurf.mediaextractor.SequenceParameterSet;
import com.steinwurf.mediaplayer.AudioDecoder;
import com.steinwurf.mediaplayer.Utils;
import com.steinwurf.mediaplayer.VideoDecoder;
@@ -78,9 +74,9 @@ protected void onCreate(Bundle savedInstanceState) {
}
try {
spsBuffer.write(VideoDecoder.NALU_HEADER);
spsBuffer.write(Utils.NALU_HEADER);
spsBuffer.write(sps);
ppsBuffer.write(VideoDecoder.NALU_HEADER);
ppsBuffer.write(Utils.NALU_HEADER);
ppsBuffer.write(pps);
} catch (IOException e) {
e.printStackTrace();
@@ -123,12 +119,8 @@ public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int hei
mSurface = new Surface(surface);
mVideoDecoder.setSurface(mSurface);
try {
mVideoDecoder.start();
mAudioDecoder.start();
} catch (IOException e) {
e.printStackTrace();
}
mVideoDecoder.start();
mAudioDecoder.start();
}
@Override
@@ -14,9 +14,6 @@
import android.view.Surface;
import android.view.TextureView;
import com.steinwurf.mediaextractor.Extractor;
import com.steinwurf.mediaextractor.NALUExtractor;
import com.steinwurf.mediaextractor.SequenceParameterSet;
import com.steinwurf.mediaplayer.Sample;
import com.steinwurf.mediaplayer.SampleProvider;
import com.steinwurf.mediaplayer.Utils;
@@ -34,7 +31,7 @@
{
private final NALUExtractor extractor;
public NaluExtractorSampleProvider(NALUExtractor extractor)
NaluExtractorSampleProvider(NALUExtractor extractor)
{
this.extractor = extractor;
}
@@ -54,7 +51,7 @@ public Sample getSample() {
try
{
do {
data.write(VideoDecoder.NALU_HEADER);
data.write(Utils.NALU_HEADER);
data.write(extractor.getNalu());
extractor.advance();
} while (!extractor.atEnd() && !extractor.isBeginningOfAVCSample());
@@ -104,9 +101,9 @@ protected void onCreate(Bundle savedInstanceState) {
}
try {
spsBuffer.write(VideoDecoder.NALU_HEADER);
spsBuffer.write(Utils.NALU_HEADER);
spsBuffer.write(sps);
ppsBuffer.write(VideoDecoder.NALU_HEADER);
ppsBuffer.write(Utils.NALU_HEADER);
ppsBuffer.write(pps);
} catch (IOException e) {
e.printStackTrace();
@@ -119,12 +116,6 @@ protected void onCreate(Bundle savedInstanceState) {
ppsBuffer.toByteArray(),
new NaluExtractorSampleProvider(mNALUExtractor));
if (mVideoDecoder == null)
{
finish();
return;
}
TextureView textureView = findViewById(R.id.textureView);
Point displayMetrics = Utils.getRealMetrics(this);
@@ -150,11 +141,7 @@ public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int hei
mSurface = new Surface(surface);
mVideoDecoder.setSurface(mSurface);
try {
mVideoDecoder.start();
} catch (IOException e) {
e.printStackTrace();
}
mVideoDecoder.start();
}
@Override

This file was deleted.

Oops, something went wrong.
@@ -6,22 +6,33 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.4.13"
}
}
plugins {
id "com.gladed.androidgitversion" version "0.4.3"
}
allprojects {
apply plugin: "com.gladed.androidgitversion"
repositories {
jcenter()
google()
maven {
url "http://artifactory.steinwurf.com/artifactory/libs-release-local"
}
}
project.ext {
compileSdkVersion = 26
buildToolsVersion = '26.0.2'
targetSdkVersion = 26
}
buildDir = 'gradle_build'
androidGitVersion {
format '%tag%%-commit%%-dirty%'
}
}
task clean(type: Delete) {
Oops, something went wrong.

0 comments on commit 9364bfa

Please sign in to comment.