Commit fd2b1ae2b8f9b6401bec1a97967f01e1d76a68f2

Authored by 王琳
1 parent 337e8d83

更新推流SDK,在错误回调中添加修改按钮状态

.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_7" 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_8" 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">
app/libs/libcnlivestream.jar
No preview for this file type
app/src/main/java/com/cnlive/demo/stream/StreamActivity.java
@@ -526,45 +526,87 @@ public class StreamActivity extends Activity { @@ -526,45 +526,87 @@ public class StreamActivity extends Activity {
526 switch (what) { 526 switch (what) {
527 case IStreamer.cnstream_error_dns_parse_failed: 527 case IStreamer.cnstream_error_dns_parse_failed:
528 Log.d(TAG, "cnstream_error_dns_parse_failed"); 528 Log.d(TAG, "cnstream_error_dns_parse_failed");
  529 + mRecording = false;
  530 + mShootingText.setText(START_STRING);
  531 + mShootingText.postInvalidate();
529 break; 532 break;
530 case IStreamer.cnstream_error_connect_failed: 533 case IStreamer.cnstream_error_connect_failed:
531 Log.d(TAG, "cnstream_error_connect_failed"); 534 Log.d(TAG, "cnstream_error_connect_failed");
  535 + mRecording = false;
  536 + mShootingText.setText(START_STRING);
  537 + mShootingText.postInvalidate();
532 break; 538 break;
533 case IStreamer.cnstream_error_publish_failed: 539 case IStreamer.cnstream_error_publish_failed:
534 Log.d(TAG, "cnstream_error_publish_failed"); 540 Log.d(TAG, "cnstream_error_publish_failed");
  541 + mRecording = false;
  542 + mShootingText.setText(START_STRING);
  543 + mShootingText.postInvalidate();
535 break; 544 break;
536 case IStreamer.cnstream_error_connect_breaked: 545 case IStreamer.cnstream_error_connect_breaked:
537 Log.d(TAG, "cnstream_error_connect_breaked"); 546 Log.d(TAG, "cnstream_error_connect_breaked");
  547 + mRecording = false;
  548 + mShootingText.setText(START_STRING);
  549 + mShootingText.postInvalidate();
538 break; 550 break;
539 case IStreamer.cnstream_error_av_async: 551 case IStreamer.cnstream_error_av_async:
540 Log.d(TAG, "cnstream_error_av_async " + msg1 + " ms"); 552 Log.d(TAG, "cnstream_error_av_async " + msg1 + " ms");
  553 + mRecording = false;
  554 + mShootingText.setText(START_STRING);
  555 + mShootingText.postInvalidate();
541 break; 556 break;
542 case IStreamer.cnstream_video_encoder_error_unsupported: 557 case IStreamer.cnstream_video_encoder_error_unsupported:
543 Log.d(TAG, "cnstream_video_encoder_error_unsupported"); 558 Log.d(TAG, "cnstream_video_encoder_error_unsupported");
  559 + mRecording = false;
  560 + mShootingText.setText(START_STRING);
  561 + mShootingText.postInvalidate();
544 break; 562 break;
545 case IStreamer.cnstream_video_encoder_error_unknown: 563 case IStreamer.cnstream_video_encoder_error_unknown:
546 Log.d(TAG, "cnstream_video_encoder_error_unknown"); 564 Log.d(TAG, "cnstream_video_encoder_error_unknown");
  565 + mRecording = false;
  566 + mShootingText.setText(START_STRING);
  567 + mShootingText.postInvalidate();
547 break; 568 break;
548 case IStreamer.cnstream_audio_encoder_error_unsupported: 569 case IStreamer.cnstream_audio_encoder_error_unsupported:
549 Log.d(TAG, "cnstream_audio_encoder_error_unsupported"); 570 Log.d(TAG, "cnstream_audio_encoder_error_unsupported");
  571 + mRecording = false;
  572 + mShootingText.setText(START_STRING);
  573 + mShootingText.postInvalidate();
550 break; 574 break;
551 case IStreamer.cnstream_audio_encoder_error_unknown: 575 case IStreamer.cnstream_audio_encoder_error_unknown:
552 Log.d(TAG, "cnstream_audio_encoder_error_unknown"); 576 Log.d(TAG, "cnstream_audio_encoder_error_unknown");
  577 + mRecording = false;
  578 + mShootingText.setText(START_STRING);
  579 + mShootingText.postInvalidate();
553 break; 580 break;
554 case IStreamer.cnstream_audio_recorder_error_start_failed: 581 case IStreamer.cnstream_audio_recorder_error_start_failed:
555 Log.d(TAG, "cnstream_audio_recorder_error_start_failed"); 582 Log.d(TAG, "cnstream_audio_recorder_error_start_failed");
  583 + mRecording = false;
  584 + mShootingText.setText(START_STRING);
  585 + mShootingText.postInvalidate();
556 break; 586 break;
557 case IStreamer.cnstream_audio_recorder_error_unknown: 587 case IStreamer.cnstream_audio_recorder_error_unknown:
558 Log.d(TAG, "cnstream_audio_recorder_error_unknown"); 588 Log.d(TAG, "cnstream_audio_recorder_error_unknown");
  589 + mRecording = false;
  590 + mShootingText.setText(START_STRING);
  591 + mShootingText.postInvalidate();
559 break; 592 break;
560 case IStreamer.cnstream_camera_error_unknown: 593 case IStreamer.cnstream_camera_error_unknown:
561 Log.d(TAG, "cnstream_camera_error_unknown"); 594 Log.d(TAG, "cnstream_camera_error_unknown");
  595 + mRecording = false;
  596 + mShootingText.setText(START_STRING);
  597 + mShootingText.postInvalidate();
562 break; 598 break;
563 case IStreamer.cnstream_camera_error_start_failed: 599 case IStreamer.cnstream_camera_error_start_failed:
564 Log.d(TAG, "cnstream_camera_error_start_failed"); 600 Log.d(TAG, "cnstream_camera_error_start_failed");
  601 + mRecording = false;
  602 + mShootingText.setText(START_STRING);
  603 + mShootingText.postInvalidate();
565 break; 604 break;
566 case IStreamer.cnstream_camera_error_server_died: 605 case IStreamer.cnstream_camera_error_server_died:
567 Log.d(TAG, "cnstream_camera_error_server_died"); 606 Log.d(TAG, "cnstream_camera_error_server_died");
  607 + mRecording = false;
  608 + mShootingText.setText(START_STRING);
  609 + mShootingText.postInvalidate();
568 break; 610 break;
569 default: 611 default:
570 Log.d(TAG, "what= " + what + " msg1= " + msg1 + " msg2= " + msg2); 612 Log.d(TAG, "what= " + what + " msg1= " + msg1 + " msg2= " + msg2);