Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/modify git ignore #100

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ gen/
local.properties
custom_rules.xml
ant.properties
*~
*~
.gradle/
.idea/
build/
*.iml
50 changes: 50 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apply plugin: 'com.android.library'
apply plugin: 'maven'


group = 'net.majorkernelpanic'
version = '3.0'

description = """libstreaming"""

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
}

android {
compileSdkVersion 21
buildToolsVersion "21.1.1"

defaultConfig {
minSdkVersion 16
targetSdkVersion 21
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}

repositories {
mavenCentral()
}


dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}

uploadArchives {
repositories {
mavenDeployer {
repository url: 'file://' + new File(System.getProperty('user.home'), '.m3/repository').absolutePath
}
}
}
task install(dependsOn: uploadArchives)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -525,14 +525,22 @@ private void convertToNV21(int k) {
* Instantiates and starts the encoder.
*/
private void configureEncoder() {
mEncoder = MediaCodec.createByCodecName(mEncoderName);
MediaFormat mediaFormat = MediaFormat.createVideoFormat(MIME_TYPE, mWidth, mHeight);
mediaFormat.setInteger(MediaFormat.KEY_BIT_RATE, BITRATE);
mediaFormat.setInteger(MediaFormat.KEY_FRAME_RATE, FRAMERATE);
mediaFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, mEncoderColorFormat);
mediaFormat.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 1);
mEncoder.configure(mediaFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
mEncoder.start();

try{
mEncoder = MediaCodec.createByCodecName(mEncoderName);
MediaFormat mediaFormat = MediaFormat.createVideoFormat(MIME_TYPE, mWidth, mHeight);
mediaFormat.setInteger(MediaFormat.KEY_BIT_RATE, BITRATE);
mediaFormat.setInteger(MediaFormat.KEY_FRAME_RATE, FRAMERATE);
mediaFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, mEncoderColorFormat);
mediaFormat.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 1);
mEncoder.configure(mediaFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
mEncoder.start();
}
catch (Exception e) {
Log.e(getClass().getSimpleName(),"configureEncoder");
Log.e(getClass().getSimpleName(), e.getStackTrace().toString());
}

}

private void releaseEncoder() {
Expand All @@ -558,12 +566,18 @@ private void configureDecoder() {
csd0.put(new byte[] {0x00,0x00,0x00,0x01});
csd0.put(mPPS);

mDecoder = MediaCodec.createByCodecName(mDecoderName);
MediaFormat mediaFormat = MediaFormat.createVideoFormat(MIME_TYPE, mWidth, mHeight);
mediaFormat.setByteBuffer("csd-0", csd0);
mediaFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, mDecoderColorFormat);
mDecoder.configure(mediaFormat, null, null, 0);
mDecoder.start();
try{
mDecoder = MediaCodec.createByCodecName(mDecoderName);
MediaFormat mediaFormat = MediaFormat.createVideoFormat(MIME_TYPE, mWidth, mHeight);
mediaFormat.setByteBuffer("csd-0", csd0);
mediaFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, mDecoderColorFormat);
mDecoder.configure(mediaFormat, null, null, 0);
mDecoder.start();
}
catch (Exception e) {
Log.e(getClass().getSimpleName(),"configureDecoder");
Log.e(getClass().getSimpleName(), e.getStackTrace().toString());
}

ByteBuffer[] decInputBuffers = mDecoder.getInputBuffers();

Expand Down