Commit 712a075f879a8790dee3941432ed65642d57189b

Authored by 王琳
1 parent 6f8847bd

修改水印图片不显示问题

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