Commit fd2b1ae2b8f9b6401bec1a97967f01e1d76a68f2
1 parent
337e8d83
更新推流SDK,在错误回调中添加修改按钮状态
Showing
3 changed files
with
43 additions
and
1 deletions
.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_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 | 41 | <output url="file://$PROJECT_DIR$/build/classes" /> |
| 42 | 42 | </component> |
| 43 | 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 | 526 | switch (what) { |
| 527 | 527 | case IStreamer.cnstream_error_dns_parse_failed: |
| 528 | 528 | Log.d(TAG, "cnstream_error_dns_parse_failed"); |
| 529 | + mRecording = false; | |
| 530 | + mShootingText.setText(START_STRING); | |
| 531 | + mShootingText.postInvalidate(); | |
| 529 | 532 | break; |
| 530 | 533 | case IStreamer.cnstream_error_connect_failed: |
| 531 | 534 | Log.d(TAG, "cnstream_error_connect_failed"); |
| 535 | + mRecording = false; | |
| 536 | + mShootingText.setText(START_STRING); | |
| 537 | + mShootingText.postInvalidate(); | |
| 532 | 538 | break; |
| 533 | 539 | case IStreamer.cnstream_error_publish_failed: |
| 534 | 540 | Log.d(TAG, "cnstream_error_publish_failed"); |
| 541 | + mRecording = false; | |
| 542 | + mShootingText.setText(START_STRING); | |
| 543 | + mShootingText.postInvalidate(); | |
| 535 | 544 | break; |
| 536 | 545 | case IStreamer.cnstream_error_connect_breaked: |
| 537 | 546 | Log.d(TAG, "cnstream_error_connect_breaked"); |
| 547 | + mRecording = false; | |
| 548 | + mShootingText.setText(START_STRING); | |
| 549 | + mShootingText.postInvalidate(); | |
| 538 | 550 | break; |
| 539 | 551 | case IStreamer.cnstream_error_av_async: |
| 540 | 552 | Log.d(TAG, "cnstream_error_av_async " + msg1 + " ms"); |
| 553 | + mRecording = false; | |
| 554 | + mShootingText.setText(START_STRING); | |
| 555 | + mShootingText.postInvalidate(); | |
| 541 | 556 | break; |
| 542 | 557 | case IStreamer.cnstream_video_encoder_error_unsupported: |
| 543 | 558 | Log.d(TAG, "cnstream_video_encoder_error_unsupported"); |
| 559 | + mRecording = false; | |
| 560 | + mShootingText.setText(START_STRING); | |
| 561 | + mShootingText.postInvalidate(); | |
| 544 | 562 | break; |
| 545 | 563 | case IStreamer.cnstream_video_encoder_error_unknown: |
| 546 | 564 | Log.d(TAG, "cnstream_video_encoder_error_unknown"); |
| 565 | + mRecording = false; | |
| 566 | + mShootingText.setText(START_STRING); | |
| 567 | + mShootingText.postInvalidate(); | |
| 547 | 568 | break; |
| 548 | 569 | case IStreamer.cnstream_audio_encoder_error_unsupported: |
| 549 | 570 | Log.d(TAG, "cnstream_audio_encoder_error_unsupported"); |
| 571 | + mRecording = false; | |
| 572 | + mShootingText.setText(START_STRING); | |
| 573 | + mShootingText.postInvalidate(); | |
| 550 | 574 | break; |
| 551 | 575 | case IStreamer.cnstream_audio_encoder_error_unknown: |
| 552 | 576 | Log.d(TAG, "cnstream_audio_encoder_error_unknown"); |
| 577 | + mRecording = false; | |
| 578 | + mShootingText.setText(START_STRING); | |
| 579 | + mShootingText.postInvalidate(); | |
| 553 | 580 | break; |
| 554 | 581 | case IStreamer.cnstream_audio_recorder_error_start_failed: |
| 555 | 582 | Log.d(TAG, "cnstream_audio_recorder_error_start_failed"); |
| 583 | + mRecording = false; | |
| 584 | + mShootingText.setText(START_STRING); | |
| 585 | + mShootingText.postInvalidate(); | |
| 556 | 586 | break; |
| 557 | 587 | case IStreamer.cnstream_audio_recorder_error_unknown: |
| 558 | 588 | Log.d(TAG, "cnstream_audio_recorder_error_unknown"); |
| 589 | + mRecording = false; | |
| 590 | + mShootingText.setText(START_STRING); | |
| 591 | + mShootingText.postInvalidate(); | |
| 559 | 592 | break; |
| 560 | 593 | case IStreamer.cnstream_camera_error_unknown: |
| 561 | 594 | Log.d(TAG, "cnstream_camera_error_unknown"); |
| 595 | + mRecording = false; | |
| 596 | + mShootingText.setText(START_STRING); | |
| 597 | + mShootingText.postInvalidate(); | |
| 562 | 598 | break; |
| 563 | 599 | case IStreamer.cnstream_camera_error_start_failed: |
| 564 | 600 | Log.d(TAG, "cnstream_camera_error_start_failed"); |
| 601 | + mRecording = false; | |
| 602 | + mShootingText.setText(START_STRING); | |
| 603 | + mShootingText.postInvalidate(); | |
| 565 | 604 | break; |
| 566 | 605 | case IStreamer.cnstream_camera_error_server_died: |
| 567 | 606 | Log.d(TAG, "cnstream_camera_error_server_died"); |
| 607 | + mRecording = false; | |
| 608 | + mShootingText.setText(START_STRING); | |
| 609 | + mShootingText.postInvalidate(); | |
| 568 | 610 | break; |
| 569 | 611 | default: |
| 570 | 612 | Log.d(TAG, "what= " + what + " msg1= " + msg1 + " msg2= " + msg2); | ... | ... |