Commit fd2149c2e00fa8461ea5e981a1bfbc501f75f3c3

Authored by 朱显松
1 parent fd2b1ae2

更新jar 添加标注

app/libs/libcnlivestream.jar
No preview for this file type
app/libs/libcnliveutil.jar
No preview for this file type
app/src/main/java/com/cnlive/demo/stream/StreamActivity.java
@@ -522,91 +522,85 @@ public class StreamActivity extends Activity { @@ -522,91 +522,85 @@ public class StreamActivity extends Activity {
522 private IStreamer.OnErrorListener mOnErrorListener = new IStreamer.OnErrorListener() { 522 private IStreamer.OnErrorListener mOnErrorListener = new IStreamer.OnErrorListener() {
523 @Override 523 @Override
524 public void onError(int what, int msg1, int msg2) { 524 public void onError(int what, int msg1, int msg2) {
525 - Log.e("demoview", " " + what); 525 +
  526 + if (what < 0) {
  527 + mRecording = false;
  528 + mShootingText.setText(START_STRING);
  529 + mShootingText.postInvalidate();
  530 + }
  531 +
526 switch (what) { 532 switch (what) {
  533 + case IStreamer.cnstream_error_start_stream_server:
  534 + //开始直播时请求服务器失败
  535 + break;
  536 + case IStreamer.cnstream_error_start_stream_network:
  537 + //开始直播时网络连接失败
  538 + break;
  539 + case IStreamer.cnstream_error_start_stream_other:
  540 + //开始直播活动失败
  541 + break;
  542 + case IStreamer.cnstream_error_create_stream_server:
  543 + //创建直播活动请求服务器失败
  544 + break;
  545 + case IStreamer.cnstream_error_create_stream_network:
  546 + //创建直播活动时网络连接失败
  547 + break;
  548 + case IStreamer.cnstream_error_create_stream_other:
  549 + //创建直播活动时失败
  550 + break;
  551 + case IStreamer.cnstream_record_error:
  552 + //直播录制失败
  553 + break;
  554 + case IStreamer.cnstream_error_stop_stream:
  555 + //停止直播活动失败
  556 + break;
  557 + case IStreamer.cnstream_socket_disconnect:
  558 + //推流Socket异常断开
  559 + break;
  560 + case IStreamer.cnstream_init_error_instop:
  561 + //初始化失败 正在停止推流
  562 + break;
527 case IStreamer.cnstream_error_dns_parse_failed: 563 case IStreamer.cnstream_error_dns_parse_failed:
528 Log.d(TAG, "cnstream_error_dns_parse_failed"); 564 Log.d(TAG, "cnstream_error_dns_parse_failed");
529 - mRecording = false;  
530 - mShootingText.setText(START_STRING);  
531 - mShootingText.postInvalidate();  
532 break; 565 break;
533 case IStreamer.cnstream_error_connect_failed: 566 case IStreamer.cnstream_error_connect_failed:
534 Log.d(TAG, "cnstream_error_connect_failed"); 567 Log.d(TAG, "cnstream_error_connect_failed");
535 - mRecording = false;  
536 - mShootingText.setText(START_STRING);  
537 - mShootingText.postInvalidate();  
538 break; 568 break;
539 case IStreamer.cnstream_error_publish_failed: 569 case IStreamer.cnstream_error_publish_failed:
540 Log.d(TAG, "cnstream_error_publish_failed"); 570 Log.d(TAG, "cnstream_error_publish_failed");
541 - mRecording = false;  
542 - mShootingText.setText(START_STRING);  
543 - mShootingText.postInvalidate();  
544 break; 571 break;
545 case IStreamer.cnstream_error_connect_breaked: 572 case IStreamer.cnstream_error_connect_breaked:
546 Log.d(TAG, "cnstream_error_connect_breaked"); 573 Log.d(TAG, "cnstream_error_connect_breaked");
547 - mRecording = false;  
548 - mShootingText.setText(START_STRING);  
549 - mShootingText.postInvalidate();  
550 break; 574 break;
551 case IStreamer.cnstream_error_av_async: 575 case IStreamer.cnstream_error_av_async:
552 Log.d(TAG, "cnstream_error_av_async " + msg1 + " ms"); 576 Log.d(TAG, "cnstream_error_av_async " + msg1 + " ms");
553 - mRecording = false;  
554 - mShootingText.setText(START_STRING);  
555 - mShootingText.postInvalidate();  
556 break; 577 break;
557 case IStreamer.cnstream_video_encoder_error_unsupported: 578 case IStreamer.cnstream_video_encoder_error_unsupported:
558 Log.d(TAG, "cnstream_video_encoder_error_unsupported"); 579 Log.d(TAG, "cnstream_video_encoder_error_unsupported");
559 - mRecording = false;  
560 - mShootingText.setText(START_STRING);  
561 - mShootingText.postInvalidate();  
562 break; 580 break;
563 case IStreamer.cnstream_video_encoder_error_unknown: 581 case IStreamer.cnstream_video_encoder_error_unknown:
564 Log.d(TAG, "cnstream_video_encoder_error_unknown"); 582 Log.d(TAG, "cnstream_video_encoder_error_unknown");
565 - mRecording = false;  
566 - mShootingText.setText(START_STRING);  
567 - mShootingText.postInvalidate();  
568 break; 583 break;
569 case IStreamer.cnstream_audio_encoder_error_unsupported: 584 case IStreamer.cnstream_audio_encoder_error_unsupported:
570 Log.d(TAG, "cnstream_audio_encoder_error_unsupported"); 585 Log.d(TAG, "cnstream_audio_encoder_error_unsupported");
571 - mRecording = false;  
572 - mShootingText.setText(START_STRING);  
573 - mShootingText.postInvalidate();  
574 break; 586 break;
575 case IStreamer.cnstream_audio_encoder_error_unknown: 587 case IStreamer.cnstream_audio_encoder_error_unknown:
576 Log.d(TAG, "cnstream_audio_encoder_error_unknown"); 588 Log.d(TAG, "cnstream_audio_encoder_error_unknown");
577 - mRecording = false;  
578 - mShootingText.setText(START_STRING);  
579 - mShootingText.postInvalidate();  
580 break; 589 break;
581 case IStreamer.cnstream_audio_recorder_error_start_failed: 590 case IStreamer.cnstream_audio_recorder_error_start_failed:
582 Log.d(TAG, "cnstream_audio_recorder_error_start_failed"); 591 Log.d(TAG, "cnstream_audio_recorder_error_start_failed");
583 - mRecording = false;  
584 - mShootingText.setText(START_STRING);  
585 - mShootingText.postInvalidate();  
586 break; 592 break;
587 case IStreamer.cnstream_audio_recorder_error_unknown: 593 case IStreamer.cnstream_audio_recorder_error_unknown:
588 Log.d(TAG, "cnstream_audio_recorder_error_unknown"); 594 Log.d(TAG, "cnstream_audio_recorder_error_unknown");
589 - mRecording = false;  
590 - mShootingText.setText(START_STRING);  
591 - mShootingText.postInvalidate();  
592 break; 595 break;
593 case IStreamer.cnstream_camera_error_unknown: 596 case IStreamer.cnstream_camera_error_unknown:
594 Log.d(TAG, "cnstream_camera_error_unknown"); 597 Log.d(TAG, "cnstream_camera_error_unknown");
595 - mRecording = false;  
596 - mShootingText.setText(START_STRING);  
597 - mShootingText.postInvalidate();  
598 break; 598 break;
599 case IStreamer.cnstream_camera_error_start_failed: 599 case IStreamer.cnstream_camera_error_start_failed:
600 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();  
604 break; 601 break;
605 case IStreamer.cnstream_camera_error_server_died: 602 case IStreamer.cnstream_camera_error_server_died:
606 Log.d(TAG, "cnstream_camera_error_server_died"); 603 Log.d(TAG, "cnstream_camera_error_server_died");
607 - mRecording = false;  
608 - mShootingText.setText(START_STRING);  
609 - mShootingText.postInvalidate();  
610 break; 604 break;
611 default: 605 default:
612 Log.d(TAG, "what= " + what + " msg1= " + msg1 + " msg2= " + msg2); 606 Log.d(TAG, "what= " + what + " msg1= " + msg1 + " msg2= " + msg2);
@@ -692,10 +686,5 @@ public class StreamActivity extends Activity { @@ -692,10 +686,5 @@ public class StreamActivity extends Activity {
692 public String getCallbackAcitvityStatushttpPostUrl() { 686 public String getCallbackAcitvityStatushttpPostUrl() {
693 return ""; 687 return "";
694 } 688 }
695 -  
696 - @Override  
697 - public String getRemark() {  
698 - return "";  
699 - }  
700 }; 689 };
701 } 690 }