Commit 712a075f879a8790dee3941432ed65642d57189b

Authored by 王琳
1 parent 6f8847bd

修改水印图片不显示问题

.idea/misc.xml
... ... @@ -37,7 +37,7 @@
37 37 <ConfirmationsSetting value="0" id="Add" />
38 38 <ConfirmationsSetting value="0" id="Remove" />
39 39 </component>
40   - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
  40 + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
41 41 <output url="file://$PROJECT_DIR$/build/classes" />
42 42 </component>
43 43 <component name="ProjectType">
... ...
.idea/modules.xml
... ... @@ -3,10 +3,8 @@
3 3 <component name="ProjectModuleManager">
4 4 <modules>
5 5 <module fileurl="file://$PROJECT_DIR$/CNStreamDemo.iml" filepath="$PROJECT_DIR$/CNStreamDemo.iml" />
6   - <module fileurl="file://$PROJECT_DIR$/CNStreamDemo.iml" filepath="$PROJECT_DIR$/CNStreamDemo.iml" />
7 6 <module fileurl="file://$PROJECT_DIR$/StreamDemo.iml" filepath="$PROJECT_DIR$/StreamDemo.iml" />
8 7 <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
9   - <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
10 8 </modules>
11 9 </component>
12 10 </project>
13 11 \ No newline at end of file
... ...
app/build.gradle
1 1 apply plugin: 'com.android.application'
2 2  
3 3 android {
4   - compileSdkVersion 23
5   - buildToolsVersion "23.0.3"
  4 + compileSdkVersion 24
  5 + buildToolsVersion '24.0.3'
6 6  
7 7 defaultConfig {
8 8 applicationId "com.cnlive.demo.stream"
... ...
app/src/main/AndroidManifest.xml
... ... @@ -6,12 +6,14 @@
6 6 <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
7 7 <uses-permission android:name="android.permission.INTERNET" />
8 8 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  9 + <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
9 10 <uses-permission android:name="android.permission.READ_PHONE_SINTERNETWIFI_STATE" />
  11 + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
10 12 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
11 13 <uses-permission android:name="android.permission.CAMERA" />
12 14 <uses-permission android:name="android.permission.RECORD_AUDIO" />
13 15 <uses-permission android:name="android.permission.FLASHLIGHT" />
14   - <uses-permission android:name="android.permission.VIBRATE" />
  16 +
15 17 <uses-feature android:name="android.hardware.camera" />
16 18 <uses-feature android:name="android.hardware.camera.autofocus" />
17 19  
... ...
app/src/main/java/com/cnlive/demo/stream/StreamActivity.java
... ... @@ -61,8 +61,6 @@ public class StreamActivity extends Activity {
61 61 private CheckBox mMuteCheckBox;
62 62 private CheckBox mAudioOnlyCheckBox;
63 63 private CheckBox mFrontMirrorCheckBox;
64   - private TextView mUrlTextView;
65   - private TextView mDebugInfoTextView;
66 64  
67 65 private ButtonObserver mObserverButton;
68 66 private CheckBoxObserver mCheckBoxObserver;
... ... @@ -72,12 +70,10 @@ public class StreamActivity extends Activity {
72 70 private Timer mTimer;
73 71  
74 72 private boolean mIsLandscape;
75   - private boolean mPrintDebugInfo = false;
76 73 private boolean mRecording = false;
77 74 private boolean isFlashOpened = false;
78   - private String mDebugInfo = "";
79 75 private String mBgmPath = "/sdcard/test.mp3";
80   - private String mLogoPath = "file:///sdcard/test.png";
  76 + private String mLogoPath = "file:///sdcard/cnlive_logo.png";
81 77  
82 78 private String activityId;
83 79 private String channelId;
... ... @@ -132,9 +128,7 @@ public class StreamActivity extends Activity {
132 128  
133 129 mCameraHintView = (CameraHintView) findViewById(R.id.camera_hint);
134 130 mCameraPreviewView = (GLSurfaceView) findViewById(R.id.camera_preview);
135   - mUrlTextView = (TextView) findViewById(R.id.url);
136 131 mChronometer = (Chronometer) findViewById(R.id.chronometer);
137   - mDebugInfoTextView = (TextView) findViewById(R.id.debuginfo);
138 132  
139 133 mObserverButton = new ButtonObserver();
140 134 mShootingText = (TextView) findViewById(R.id.click_to_shoot);
... ... @@ -198,8 +192,6 @@ public class StreamActivity extends Activity {
198 192 setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
199 193 isHorizontalScreen = 0;
200 194 }
201   -
202   - mPrintDebugInfo = bundle.getBoolean(SHOW_DEBUGINFO, false);
203 195 }
204 196  
205 197 mStreamer.setDisplayPreview(mCameraPreviewView);
... ... @@ -290,24 +282,6 @@ public class StreamActivity extends Activity {
290 282 mRecording = false;
291 283 }
292 284  
293   - private void beginInfoUploadTimer() {
294   - if (mPrintDebugInfo && mTimer == null) {
295   - mTimer = new Timer();
296   - mTimer.schedule(new TimerTask() {
297   - @Override
298   - public void run() {
299   - runOnUiThread(new Runnable() {
300   - @Override
301   - public void run() {
302   - mDebugInfoTextView.setText(mDebugInfo);
303   - }
304   - });
305   - }
306   - }, 100, 1000);
307   - }
308   - }
309   -
310   -
311 285 private class ButtonObserver implements View.OnClickListener {
312 286 @Override
313 287 public void onClick(View view) {
... ... @@ -530,16 +504,11 @@ public class StreamActivity extends Activity {
530 504 switch (what) {
531 505 case IStreamer.cnstream_camera_init_done:
532 506 Log.d(TAG, "cnstream_camera_init_done");
533   - //TODO setCameraAntiBanding50Hz();
534   -// if (mAutoStart) {
535   -// startStream();
536   -// }
537 507 break;
538 508 case IStreamer.cnstream_open_stream_succ:
539 509 Log.d(TAG, "cnstream_open_stream_success");
540 510 mChronometer.setBase(SystemClock.elapsedRealtime());
541 511 mChronometer.start();
542   - beginInfoUploadTimer();
543 512 break;
544 513 case IStreamer.cnstream_frame_send_slow:
545 514 Log.d(TAG, "cnstream_frame_send_slow");
... ...
app/src/main/res/layout/activity_stream.xml
... ... @@ -3,7 +3,7 @@
3 3 android:id="@+id/root"
4 4 android:layout_width="match_parent"
5 5 android:layout_height="match_parent"
6   - android:background="#00000000" >
  6 + android:background="#00000000">
7 7  
8 8 <android.opengl.GLSurfaceView
9 9 android:id="@+id/camera_preview"
... ... @@ -21,34 +21,16 @@
21 21  
22 22 <include
23 23 android:id="@+id/actionbar"
  24 + layout="@layout/titlebar"
24 25 android:layout_width="match_parent"
25 26 android:layout_height="46dip"
26   - android:layout_gravity="top"
27   - layout="@layout/titlebar" />
28   -
29   - <TextView
30   - android:id="@+id/url"
31   - android:layout_width="match_parent"
32   - android:layout_height="wrap_content"
33   - android:layout_below="@id/actionbar"
34   - android:gravity="center"
35   - android:textColor="#368ca8"
36   - android:textSize="19sp" />
37   -
38   - <TextView
39   - android:id="@+id/debuginfo"
40   - android:layout_width="match_parent"
41   - android:layout_height="wrap_content"
42   - android:layout_below="@id/url"
43   - android:gravity="left"
44   - android:textColor="#ae4ce6"
45   - android:textSize="11sp" />
  27 + android:layout_gravity="top" />
46 28  
47 29 <include
48 30 android:id="@+id/bar_bottom"
  31 + layout="@layout/bottombar"
49 32 android:layout_width="match_parent"
50 33 android:layout_height="wrap_content"
51   - android:layout_alignParentBottom="true"
52   - layout="@layout/bottombar" />
  34 + android:layout_alignParentBottom="true" />
53 35  
54 36 </RelativeLayout>
55 37 \ No newline at end of file
... ...