Skip to content

Commit 19e9d73

Browse files
committed
update library
1 parent 0f69538 commit 19e9d73

File tree

18 files changed

+64
-50
lines changed

18 files changed

+64
-50
lines changed

README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ allprojects {
2727
2828
// module build.gradle
2929
dependencies {
30-
compile 'com.github.ChillingVan:AndroidInstantVideo:v1.0.2.0'
30+
compile 'com.github.ChillingVan:AndroidInstantVideo:v1.0.2.1'
3131
}
3232
```
3333

@@ -169,11 +169,3 @@ public class TestCameraPublisherActivity extends AppCompatActivity {
169169
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
170170
See the License for the specific language governing permissions and
171171
limitations under the License.
172-
173-
174-
### 打赏
175-
感谢您的支持!!
176-
支付宝
177-
![alipay](http://upload-images.jianshu.io/upload_images/3587192-1cc20071ce4a042a.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
178-
微信
179-
![wechat pay](http://upload-images.jianshu.io/upload_images/3587192-3289f8237d98b2c4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

README_EN.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ allprojects {
2929
3030
// module build.gradle
3131
dependencies {
32-
compile 'com.github.ChillingVan:AndroidInstantVideo:v1.0.2.0'
32+
compile 'com.github.ChillingVan:AndroidInstantVideo:v1.0.2.1'
3333
}
3434
```
3535

@@ -166,11 +166,3 @@ Please add sample code to sample module. Add your license comment.
166166
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
167167
See the License for the specific language governing permissions and
168168
limitations under the License.
169-
170-
171-
### Donate
172-
Thanks for your support !!!
173-
alipay
174-
![alipay](http://upload-images.jianshu.io/upload_images/3587192-1cc20071ce4a042a.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
175-
wechat pay
176-
![wechat pay](http://upload-images.jianshu.io/upload_images/3587192-3289f8237d98b2c4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

app/build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ apply plugin: 'com.android.application'
2222

2323
android {
2424
compileSdkVersion 27
25-
buildToolsVersion "27.0.2"
25+
buildToolsVersion '27.0.3'
2626
defaultConfig {
2727
applicationId "com.chillingvan.instantvideo.sample"
2828
minSdkVersion 18
@@ -45,13 +45,13 @@ android {
4545
}
4646

4747
dependencies {
48-
compile fileTree(include: ['*.jar'], dir: 'libs')
49-
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
48+
implementation fileTree(include: ['*.jar'], dir: 'libs')
49+
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
5050
exclude group: 'com.android.support', module: 'support-annotations'
5151
})
52-
compile project(':applibs')
53-
compile 'com.github.tajchert:nammu:1.2.0'
54-
compile 'com.android.support:appcompat-v7:27.0.2'
55-
compile 'com.android.support.constraint:constraint-layout:1.0.2'
56-
testCompile 'junit:junit:4.12'
52+
api project(':applibs')
53+
implementation 'com.github.tajchert:nammu:1.2.0'
54+
implementation 'com.android.support:appcompat-v7:27.0.2'
55+
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
56+
testImplementation 'junit:junit:4.12'
5757
}

app/src/main/java/com/chillingvan/instantvideo/sample/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import android.widget.SimpleAdapter;
3232
import android.widget.Toast;
3333

34-
import com.chillingvan.canvasgl.Loggers;
34+
import com.chillingvan.canvasgl.util.Loggers;
3535

3636
import java.text.Collator;
3737
import java.util.ArrayList;

app/src/main/java/com/chillingvan/instantvideo/sample/test/audio/TestAudioEncoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import android.content.Context;
2424
import android.media.MediaCodec;
2525

26-
import com.chillingvan.canvasgl.Loggers;
26+
import com.chillingvan.canvasgl.util.Loggers;
2727
import com.chillingvan.lib.encoder.MediaCodecInputStream;
2828
import com.chillingvan.lib.encoder.audio.AACEncoder;
2929
import com.chillingvan.lib.publisher.StreamPublisher;

app/src/main/java/com/chillingvan/instantvideo/sample/test/camera/CameraPreviewTextureView.java

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
package com.chillingvan.instantvideo.sample.test.camera;
22

33
import android.content.Context;
4+
import android.graphics.Bitmap;
5+
import android.graphics.Canvas;
6+
import android.graphics.Color;
7+
import android.graphics.Paint;
8+
import android.graphics.PorterDuff;
49
import android.graphics.SurfaceTexture;
510
import android.support.annotation.Nullable;
611
import android.util.AttributeSet;
712

813
import com.chillingvan.canvasgl.ICanvasGL;
14+
import com.chillingvan.canvasgl.androidCanvas.IAndroidCanvasHelper;
915
import com.chillingvan.canvasgl.glcanvas.BasicTexture;
1016
import com.chillingvan.canvasgl.glcanvas.RawTexture;
1117
import com.chillingvan.canvasgl.glview.texture.GLSurfaceTextureProducerView;
@@ -18,6 +24,8 @@
1824
public class CameraPreviewTextureView extends GLSurfaceTextureProducerView {
1925

2026
private H264Encoder.OnDrawListener onDrawListener;
27+
private IAndroidCanvasHelper drawTextHelper = IAndroidCanvasHelper.Factory.createAndroidCanvasHelper(IAndroidCanvasHelper.MODE.MODE_ASYNC);
28+
private Paint textPaint;
2129

2230
public CameraPreviewTextureView(Context context) {
2331
super(context);
@@ -31,10 +39,32 @@ public CameraPreviewTextureView(Context context, AttributeSet attrs, int defStyl
3139
super(context, attrs, defStyleAttr);
3240
}
3341

42+
@Override
43+
public void onSurfaceChanged(int width, int height) {
44+
super.onSurfaceChanged(width, height);
45+
drawTextHelper.init(width, height);
46+
textPaint = new Paint();
47+
textPaint.setColor(Color.WHITE);
48+
textPaint.setTextSize(dp2px(15));
49+
}
50+
51+
private float dp2px(int dp) {
52+
return dp * getContext().getResources().getDisplayMetrics().density;
53+
}
3454

3555
@Override
36-
protected void onGLDraw(ICanvasGL canvas, SurfaceTexture producedSurfaceTexture, RawTexture producedRawTexture, @Nullable SurfaceTexture sharedSurfaceTexture, @Nullable BasicTexture sharedTexture) {
56+
protected void onGLDraw(final ICanvasGL canvas, SurfaceTexture producedSurfaceTexture, RawTexture producedRawTexture, @Nullable SurfaceTexture sharedSurfaceTexture, @Nullable BasicTexture sharedTexture) {
3757
onDrawListener.onGLDraw(canvas, producedSurfaceTexture, producedRawTexture, sharedSurfaceTexture, sharedTexture);
58+
drawTextHelper.draw(new IAndroidCanvasHelper.CanvasPainter() {
59+
@Override
60+
public void draw(Canvas androidCanvas) {
61+
androidCanvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
62+
androidCanvas.drawText("白色, White", 100, 100, textPaint);
63+
}
64+
});
65+
Bitmap outputBitmap = drawTextHelper.getOutputBitmap();
66+
canvas.invalidateTextureContent(outputBitmap);
67+
canvas.drawBitmap(outputBitmap, 0, 0);
3868
}
3969

4070
public void setOnDrawListener(H264Encoder.OnDrawListener l) {

app/src/main/java/com/chillingvan/instantvideo/sample/test/publisher/TestCameraPublisherActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333
import android.widget.TextView;
3434

3535
import com.chillingvan.canvasgl.ICanvasGL;
36-
import com.chillingvan.canvasgl.Loggers;
3736
import com.chillingvan.canvasgl.glcanvas.BasicTexture;
3837
import com.chillingvan.canvasgl.glcanvas.RawTexture;
3938
import com.chillingvan.canvasgl.textureFilter.BasicTextureFilter;
4039
import com.chillingvan.canvasgl.textureFilter.HueFilter;
4140
import com.chillingvan.canvasgl.textureFilter.TextureFilter;
41+
import com.chillingvan.canvasgl.util.Loggers;
4242
import com.chillingvan.instantvideo.sample.R;
4343
import com.chillingvan.instantvideo.sample.test.camera.CameraPreviewTextureView;
4444
import com.chillingvan.lib.camera.InstantVideoCamera;

app/src/main/java/com/chillingvan/instantvideo/sample/test/publisher/TestMp4MuxerActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
import android.widget.TextView;
3333

3434
import com.chillingvan.canvasgl.ICanvasGL;
35-
import com.chillingvan.canvasgl.Loggers;
3635
import com.chillingvan.canvasgl.glcanvas.BasicTexture;
3736
import com.chillingvan.canvasgl.glcanvas.RawTexture;
3837
import com.chillingvan.canvasgl.textureFilter.BasicTextureFilter;
3938
import com.chillingvan.canvasgl.textureFilter.HueFilter;
4039
import com.chillingvan.canvasgl.textureFilter.TextureFilter;
40+
import com.chillingvan.canvasgl.util.Loggers;
4141
import com.chillingvan.instantvideo.sample.R;
4242
import com.chillingvan.instantvideo.sample.test.camera.CameraPreviewTextureView;
4343
import com.chillingvan.lib.camera.InstantVideoCamera;

app/src/main/java/com/chillingvan/instantvideo/sample/test/video/TestVideoEncoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
import android.util.Log;
2929

3030
import com.chillingvan.canvasgl.ICanvasGL;
31-
import com.chillingvan.canvasgl.Loggers;
3231
import com.chillingvan.canvasgl.glcanvas.BasicTexture;
3332
import com.chillingvan.canvasgl.glcanvas.GLPaint;
3433
import com.chillingvan.canvasgl.glview.texture.gles.EglContextWrapper;
34+
import com.chillingvan.canvasgl.util.Loggers;
3535
import com.chillingvan.lib.encoder.MediaCodecInputStream;
3636
import com.chillingvan.lib.encoder.video.H264Encoder;
3737
import com.chillingvan.lib.publisher.StreamPublisher;

applibs/build.gradle

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ group='com.github.ChillingVan'
2424

2525
android {
2626
compileSdkVersion 27
27-
buildToolsVersion "26.0.2"
27+
buildToolsVersion '27.0.3'
2828

2929
defaultConfig {
3030
minSdkVersion 18
3131
targetSdkVersion 27
32-
versionCode 100020
33-
versionName "1.0.2.0"
32+
versionCode 100021
33+
versionName "1.0.2.1"
3434

3535
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
3636

@@ -44,15 +44,15 @@ android {
4444
}
4545

4646
dependencies {
47-
compile fileTree(dir: 'libs', include: ['*.jar'])
48-
compile 'com.github.ChillingVan:android-openGL-canvas:v1.2.2.1'
49-
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
47+
implementation fileTree(dir: 'libs', include: ['*.jar'])
48+
api 'com.github.ChillingVan:android-openGL-canvas:v1.3.0.0'
49+
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
5050
exclude group: 'com.android.support', module: 'support-annotations'
5151
})
52-
testCompile 'junit:junit:4.12'
53-
compile 'net.butterflytv.utils:rtmp-client:0.2.6'
52+
testImplementation 'junit:junit:4.12'
53+
implementation 'net.butterflytv.utils:rtmp-client:0.2.6'
5454

55-
compile 'com.android.support:support-annotations:27.0.2'
55+
implementation 'com.android.support:support-annotations:27.0.2'
5656
}
5757

5858

0 commit comments

Comments
 (0)