Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
han1202012 committed Jun 11, 2020
1 parent 7d780b7 commit be4dbc9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions app/src/main/cpp/native-lib.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#include <jni.h>
#include <string>
#include "librtmp/rtmp.h"
#include <x264.h>

extern "C" JNIEXPORT jstring JNICALL
Java_kim_hsl_rtmp_MainActivity_stringFromJNI(
JNIEnv* env,
jobject /* this */) {
std::string hello = "Hello from C++";
RTMP_Alloc();
x264_picture_t *p = new x264_picture_t;
return env->NewStringUTF(hello.c_str());
}
1 change: 0 additions & 1 deletion app/src/main/java/kim/hsl/rtmp/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

public class MainActivity extends AppCompatActivity {

// Used to load the 'native-lib' library on application startup.
static {
System.loadLibrary("native-lib");
}
Expand Down
12 changes: 7 additions & 5 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
android:layout_height="match_parent"
tools:context=".MainActivity">

<!-- 预览 Camera 采集的图像数据 -->
<SurfaceView
android:id="@+id/surfaceView"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<TextView
android:id="@+id/sample_text"
Expand All @@ -22,4 +17,11 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<!-- 预览 Camera 采集的图像数据 -->
<SurfaceView
android:id="@+id/surfaceView"
android:layout_width="match_parent"
android:layout_height="match_parent" />


</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit be4dbc9

Please sign in to comment.