AliVCSDK 6.17.0
阿里云音视频SDK,为视频开发者提供一站式接入服务
 
Loading...
Searching...
No Matches
AlivcLivePusher.java
1package com.alivc.live.pusher;
2
3import android.content.Context;
4import android.graphics.Bitmap;
5import android.view.SurfaceView;
6import android.widget.FrameLayout;
7
8import com.alivc.component.custom.AlivcLivePushCustomAudioFilter;
9import com.alivc.component.custom.AlivcLivePushCustomDetect;
10import com.alivc.component.custom.AlivcLivePushCustomFilter;
11import com.alivc.live.annotations.AlivcLiveAudioEffectBeautifyMode;
12import com.alivc.live.annotations.AlivcLiveAudioEffectEqualizationBandFrequency;
13import com.alivc.live.annotations.AlivcLiveAudioEffectReverbParamType;
14import com.alivc.live.annotations.AlivcLiveAudioProfileQualityMode;
15import com.alivc.live.annotations.AlivcLiveAudioSource;
16import com.alivc.live.annotations.AlivcLiveChannelProfile;
17import com.alivc.live.annotations.AlivcLiveMode;
18import com.alivc.live.annotations.AlivcLiveMuteLocalAudioMode;
19import com.alivc.live.annotations.AlivcLiveNetworkQuality;
20import com.alivc.live.annotations.AlivcLiveRecordMediaEvent;
21import com.alivc.live.annotations.AlivcLiveVideoCodecManufacturer;
22import com.alivc.live.annotations.AlivcLiveVideoMirrorMode;
23import com.alivc.live.biz.api.ILivePusher;
24import com.alivc.live.biz.utils.AlivcLiveURLTools;
25import com.alivc.live.biz.utils.ReflectUtil;
26import com.alivc.live.player.annotations.AlivcLivePlayVideoStreamType;
27
28
29
41@CalledByNative
42public class AlivcLivePusher implements ILivePusher {
43 private ILivePusher mImpl = null;
44
45 private static final String BASIC_PUSHER_IMPL_CLASS = "com.alivc.live.pusher.basic.AlivcBasicLivePusherImpl";
46 private static final String INTERACTIVE_PUSHER_IMPL_CLASS = "com.alivc.live.pusher.rtc.AlivcRTCLivePusherImpl";
47
57 @Override
58 public void init(Context context, AlivcLivePushConfig config) throws IllegalArgumentException, IllegalStateException {
60
61 if (config == null) {
62 throw new IllegalArgumentException("Invalid parameter, config is null.");
63 }
64
65 reflectInitPusher(config.getLivePushMode());
67
68 if (mImpl == null) {
69 return;
70 }
71 mImpl.init(context, config);
72 }
73
74 private void reflectInitPusher(AlivcLiveMode mode) {
75 Object playerInstance = null;
76
78 playerInstance = ReflectUtil.reflectInit(INTERACTIVE_PUSHER_IMPL_CLASS, null, null);
79 } else {
80 playerInstance = ReflectUtil.reflectInit(BASIC_PUSHER_IMPL_CLASS, null, null);
81 }
82
83 if (playerInstance == null) {
84 throw new RuntimeException("init live pusher error! now not support mode: " + mode);
85 }
86
87 mImpl = (ILivePusher) playerInstance;
88 }
89
96 @Override
97 public void destroy() throws IllegalStateException {
98 if (mImpl == null) {
99 return;
100 }
101 mImpl.destroy();
103 }
104
110 @Override
111 public void setLivePusherReference(AlivcLivePusher livePusher) {
112 if (mImpl == null) {
113 return;
114 }
115 mImpl.setLivePusherReference(livePusher);
116 }
117
130 @Override
131 public void startPreview(SurfaceView surfaceView) throws IllegalArgumentException, IllegalStateException {
132 if (mImpl == null) {
133 return;
134 }
135 mImpl.startPreview(surfaceView);
136 }
137
150 @Override
151 public void startPreviewAsync(SurfaceView surfaceView) throws IllegalArgumentException, IllegalStateException {
152 if (mImpl == null) {
153 return;
154 }
155 mImpl.startPreviewAsync(surfaceView);
156 }
157
174 @Override
175 public void startPreview(Context context, FrameLayout frameLayout, boolean isFullScreen) throws IllegalArgumentException, IllegalStateException {
176 if (mImpl == null) {
177 return;
178 }
179 mImpl.startPreview(context, frameLayout, isFullScreen);
180 }
181
191 @Override
192 public void updatePreview(Context context, FrameLayout frameLayout, boolean isFullScreen) {
193 if (mImpl == null) {
194 return;
195 }
196 mImpl.updatePreview(context, frameLayout, isFullScreen);
197 }
198
205 @Override
206 public void stopPreview() throws IllegalStateException {
207 if (mImpl == null) {
208 return;
209 }
210 mImpl.stopPreview();
211 }
212
225 @Override
226 public void startPush(String url) throws IllegalArgumentException, IllegalStateException {
227 if (mImpl == null) {
228 return;
229 }
230 mImpl.startPush(AlivcLiveURLTools.trimUrl(url));
231 }
232
243 @Override
244 public void startPushAsync(String url) throws IllegalArgumentException, IllegalStateException {
245 if (mImpl == null) {
246 return;
247 }
248 mImpl.startPushAsync(AlivcLiveURLTools.trimUrl(url));
249 }
250
259 @Override
260 public void restartPush() throws IllegalStateException {
261 if (mImpl == null) {
262 return;
263 }
264 mImpl.restartPush();
265 }
266
275 @Override
276 public void restartPushAsync() throws IllegalStateException {
277 if (mImpl == null) {
278 return;
279 }
280 mImpl.restartPushAsync();
281 }
282
290 @Override
291 public void reconnectPushAsync(String url) throws IllegalStateException {
292 if (mImpl == null) {
293 return;
294 }
295 mImpl.reconnectPushAsync(AlivcLiveURLTools.trimUrl(url));
296 }
297
303 @Override
304 public void stopPush() throws IllegalStateException {
305 if (mImpl == null) {
306 return;
307 }
308 mImpl.stopPush();
309 }
310
320 @Override
321 public void pause() throws IllegalStateException {
322 if (mImpl == null) {
323 return;
324 }
325 mImpl.pause();
326 }
327
335 @Override
336 public void resume() throws IllegalStateException {
337 if (mImpl == null) {
338 return;
339 }
340 mImpl.resume();
341 }
342
350 @Override
351 public void resumeAsync() throws IllegalStateException {
352 if (mImpl == null) {
353 return;
354 }
355 mImpl.resumeAsync();
356 }
357
363 @Override
364 public void switchCamera() throws IllegalStateException {
365 if (mImpl == null) {
366 return;
367 }
368 mImpl.switchCamera();
369 }
370
377 @Override
378 public void setAutoFocus(boolean autoFocus) throws IllegalStateException {
379 if (mImpl == null) {
380 return;
381 }
382 mImpl.setAutoFocus(autoFocus);
383 }
384
393 @Override
394 public void focusCameraAtAdjustedPoint(float x, float y, boolean autoFocus) throws IllegalArgumentException, IllegalStateException {
395 if (mImpl == null) {
396 return;
397 }
398 mImpl.focusCameraAtAdjustedPoint(x, y, autoFocus);
399 }
400
407 @Override
408 public void setZoom(int zoom) throws IllegalArgumentException, IllegalStateException {
409 if (mImpl == null) {
410 return;
411 }
412 mImpl.setZoom(zoom);
413 }
414
421 @Override
422 public int getMaxZoom() throws IllegalStateException {
423 if (mImpl == null) {
424 return -1;
425 }
426 return mImpl.getMaxZoom();
427 }
428
435 @Override
436 public int getCurrentZoom() throws IllegalStateException {
437 if (mImpl == null) {
438 return -1;
439 }
440 return mImpl.getCurrentZoom();
441 }
442
452 @Override
453 public void setMute(boolean mute) throws IllegalStateException {
454 if (mImpl == null) {
455 return;
456 }
457 mImpl.setMute(mute);
458 }
459
470 @Override
471 public void setMute(boolean mute, AlivcLiveMuteLocalAudioMode muteLocalAudioMode) {
472 if (mImpl == null) {
473 return;
474 }
475 mImpl.setMute(mute, muteLocalAudioMode);
476 }
477
484 @Override
485 public void setFlash(boolean flash) throws IllegalStateException {
486 if (mImpl == null) {
487 return;
488 }
489 mImpl.setFlash(flash);
490 }
491
498 @Override
499 public void setPushMirror(boolean mirror) throws IllegalStateException {
500 if (mImpl == null) {
501 return;
502 }
503 mImpl.setPushMirror(mirror);
504 }
505
512 @Override
513 public void setPreviewMirror(boolean mirror) throws IllegalStateException {
514 if (mImpl == null) {
515 return;
516 }
517 mImpl.setPreviewMirror(mirror);
518 }
519
528 @Override
530 if (mImpl == null) {
531 return -1;
532 }
533 return mImpl.setVideoMirrorMode(mirrorMode);
534 }
535
542 @Override
543 public void setVideoConfig(AlivcLivePushVideoConfig videoConfig) {
544 if (mImpl != null) {
545 mImpl.setVideoConfig(videoConfig);
546 }
547 }
548
555 @Override
557 if (mImpl == null) {
558 return null;
559 }
560 return mImpl.getVideoConfig();
561 }
562
570 @Override
571 public void setTargetVideoBitrate(int targetVideoBitrate) throws IllegalArgumentException, IllegalStateException {
572 if (mImpl == null) {
573 return;
574 }
575 mImpl.setTargetVideoBitrate(targetVideoBitrate);
576 }
577
585 @Override
586 public void setMinVideoBitrate(int minVideoBitrate) throws IllegalArgumentException, IllegalStateException {
587 if (mImpl == null) {
588 return;
589 }
590 mImpl.setMinVideoBitrate(minVideoBitrate);
591 }
592
604 @Override
605 public void refreshPushURLToken(String url) {
606 if (mImpl == null) {
607 return;
608 }
609 mImpl.refreshPushURLToken(url);
610 }
611
617 @Override
618 public boolean isCameraSupportAutoFocus() {
619 if (mImpl == null) {
620 return false;
621 }
622 return mImpl.isCameraSupportAutoFocus();
623 }
624
630 @Override
631 public boolean isCameraSupportFlash() {
632 if (mImpl == null) {
633 return false;
634 }
635 return mImpl.isCameraSupportFlash();
636 }
637
644 @Override
645 public boolean isPushing() throws IllegalStateException {
646 if (mImpl == null) {
647 return false;
648 }
649 return mImpl.isPushing();
650 }
651
658 @Override
659 public boolean isNetworkPushing() throws IllegalStateException {
660 if (mImpl == null) {
661 return false;
662 }
663 return mImpl.isNetworkPushing();
664 }
665
671 @Override
672 public void setCustomDetect(AlivcLivePushCustomDetect customVideoDetect) {
673 if (mImpl == null) {
674 return;
675 }
676 mImpl.setCustomDetect(customVideoDetect);
677 }
678
684 @Override
685 public void setCustomFilter(AlivcLivePushCustomFilter customVideoFilter) {
686 if (mImpl == null) {
687 return;
688 }
689 mImpl.setCustomFilter(customVideoFilter);
690 }
691
697 @Override
699 if (mImpl == null) {
700 return;
701 }
702 mImpl.setCustomAudioFilter(customAudioFilter);
703 }
704
711 @Override
713 if (mImpl == null) {
715 }
716 return mImpl.getCurrentStatus();
717 }
718
727 @Override
729 if (mImpl == null) {
730 return;
731 }
732 mImpl.setLivePushErrorListener(errorListener);
733 }
734
741 @Override
743 if (mImpl == null) {
744 return;
745 }
746 mImpl.setLivePushInfoListener(infoListener);
747 }
748
755 @Override
757 if (mImpl == null) {
758 return;
759 }
760 mImpl.setLivePushNetworkListener(networkListener);
761 }
762
769 @Override
771 if (mImpl == null) {
772 return;
773 }
774 mImpl.setLivePushBGMListener(pushBGMListener);
775 }
776
783 @Override
785 if (mImpl == null) {
786 return;
787 }
788 mImpl.setLivePushAudioFrameListener(pushAudioFrameListener);
789 }
790
796 @Override
797 public void setLivePushRenderContextListener(AlivcLivePusherRenderContextListener renderCtxListener) {
798 if (mImpl == null) {
799 return;
800 }
801 mImpl.setLivePushRenderContextListener(renderCtxListener);
802 }
803
810 @Override
811 public AlivcLivePushStatsInfo getLivePushStatsInfo() throws IllegalStateException {
812 if (mImpl == null) {
813 return null;
814 }
815 return mImpl.getLivePushStatsInfo();
816 }
817
823 @Override
824 public String getPushUrl() {
825 if (mImpl == null) {
826 return "";
827 }
828 return mImpl.getPushUrl();
829 }
830
838 @Override
839 public int setParameter(String parameter) {
840 if (mImpl == null) {
841 return -1;
842 }
843 return mImpl.setParameter(parameter);
844 }
845
853 @Override
854 public String getParameter(String parameter) {
855 if (mImpl == null) {
856 return "";
857 }
858 return mImpl.getParameter(parameter);
859 }
860
866 @Override
868 if (mImpl == null) {
869 return;
870 }
871 mImpl.setPreviewOrientation(orientation);
872 }
873
882 @Deprecated
883 @Override
884 public int startBGMAsync(String path) throws IllegalStateException {
885 if (mImpl == null) {
886 return -1;
887 }
888 return mImpl.startBGMAsync(path);
889 }
890
900 @Override
901 public int startBGMAsync(String path, AlivcLiveBGMConfig bgmConfig) {
902 if (mImpl == null) {
903 return -1;
904 }
905 return mImpl.startBGMAsync(path, bgmConfig);
906 }
907
913 @Override
914 public void stopBGMAsync() throws IllegalStateException {
915 if (mImpl == null) {
916 return;
917 }
918 mImpl.stopBGMAsync();
919 }
920
928 @Override
929 public int getBGMDuration() {
930 if (mImpl == null) {
931 return -1;
932 }
933 return mImpl.getBGMDuration();
934 }
935
943 @Override
945 if (mImpl == null) {
946 return -1;
947 }
948 return mImpl.getBGMCurrentPosition();
949 }
950
956 @Override
957 public void pauseBGM() throws IllegalStateException {
958 if (mImpl == null) {
959 return;
960 }
961 mImpl.pauseBGM();
962 }
963
969 @Override
970 public void resumeBGM() throws IllegalStateException {
971 if (mImpl == null) {
972 return;
973 }
974 mImpl.resumeBGM();
975 }
976
983 @Override
984 public void setBGMLoop(boolean isLoop) throws IllegalStateException {
985 if (mImpl == null) {
986 return;
987 }
988 mImpl.setBGMLoop(isLoop);
989 }
990
997 @Override
998 public void setBGMEarsBack(boolean isOpen) throws IllegalStateException {
999 if (mImpl == null) {
1000 return;
1001 }
1002 mImpl.setBGMEarsBack(isOpen);
1003 }
1004
1012 @Override
1013 public void setBGMVolume(int volume) throws IllegalStateException, IllegalArgumentException {
1014 if (mImpl == null) {
1015 return;
1016 }
1017 mImpl.setBGMVolume(volume);
1018 }
1019
1027 @Override
1028 public void setCaptureVolume(int volume) throws IllegalStateException, IllegalArgumentException {
1029 if (mImpl == null) {
1030 return;
1031 }
1032 mImpl.setCaptureVolume(volume);
1033 }
1034
1043 @Override
1044 public void setAudioDenoise(boolean enable) {
1045 if (mImpl == null) {
1046 return;
1047 }
1048 mImpl.setAudioDenoise(enable);
1049 }
1050
1066 @Override
1068 if (mImpl == null) {
1069 return -1;
1070 }
1071 return mImpl.startIntelligentDenoise();
1072 }
1073
1080 @Override
1082 if (mImpl == null) {
1083 return -1;
1084 }
1085 return mImpl.stopIntelligentDenoise();
1086 }
1087
1094 @Override
1095 public void setQualityMode(AlivcQualityModeEnum mode) throws IllegalStateException {
1096 if (mImpl == null) {
1097 return;
1098 }
1099 mImpl.setQualityMode(mode);
1100 }
1101
1108 @Override
1109 public void setPreviewMode(AlivcPreviewDisplayMode mode) throws IllegalStateException {
1110 if (mImpl == null) {
1111 return;
1112 }
1113 mImpl.setPreviewMode(mode);
1114 }
1115
1121 @Override
1122 public void pauseScreenCapture() throws IllegalStateException {
1123 if (mImpl == null) {
1124 return;
1125 }
1126 mImpl.pauseScreenCapture();
1127 }
1128
1134 @Override
1135 public void resumeScreenCapture() throws IllegalStateException {
1136 if (mImpl == null) {
1137 return;
1138 }
1139 mImpl.resumeScreenCapture();
1140 }
1141
1148 @Override
1150 if (mImpl == null) {
1151 return null;
1152 }
1153 return mImpl.getVideoCodecType();
1154 }
1155
1161 @Override
1163 if (mImpl == null) {
1164 return AlivcLivePushError.ALIVC_COMMON_RETURN_SUCCESS;
1165 }
1166 return mImpl.getLastError();
1167 }
1168
1180 @Override
1181 public void changeResolution(AlivcResolutionEnum resolution) {
1182 if (mImpl == null) {
1183 return;
1184 }
1185 mImpl.changeResolution(resolution);
1186 }
1187
1198 @Override
1199 public void addWaterMark(String path, float x, float y, float width) {
1200 if (mImpl == null) {
1201 return;
1202 }
1203 mImpl.addWaterMark(path, x, y, width);
1204 }
1205
1217 @Override
1218 public void addWaterMark(Bitmap bitmap, float x, float y, float width) {
1219 if (mImpl == null) {
1220 return;
1221 }
1222 mImpl.addWaterMark(bitmap, x, y, width);
1223 }
1224
1230 @Override
1231 public void setWatermarkVisible(boolean visible) {
1232 if (mImpl == null) {
1233 return;
1234 }
1235 mImpl.setWatermarkVisible(visible);
1236 }
1237
1245 @Override
1246 public int startCamera(SurfaceView surfaceView) throws IllegalStateException {
1247 if (mImpl == null) {
1248 return -1;
1249 }
1250 return mImpl.startCamera(surfaceView);
1251 }
1252
1256 @Override
1257 public void stopCamera() {
1258 if (mImpl == null) {
1259 return;
1260 }
1261 mImpl.stopCamera();
1262 }
1263
1269 @Override
1270 public void setScreenOrientation(int orientation) {
1271 if (mImpl == null) {
1272 return;
1273 }
1274 mImpl.setScreenOrientation(orientation);
1275 }
1276
1286 @Override
1287 public int startCameraMix(float x, float y, float w, float h) {
1288 if (mImpl == null) {
1289 return -1;
1290 }
1291 return mImpl.startCameraMix(x, y, w, h);
1292 }
1293
1297 @Override
1298 public void stopCameraMix() {
1299 if (mImpl == null) {
1300 return;
1301 }
1302 mImpl.stopCameraMix();
1303 }
1304
1315 @Override
1316 public boolean startLocalRecord(AlivcLiveLocalRecordConfig localRecordConfig) {
1317 if (mImpl == null) {
1318 return false;
1319 }
1320 return mImpl.startLocalRecord(localRecordConfig);
1321 }
1322
1331 @Override
1332 public void stopLocalRecord() {
1333 if (mImpl == null) {
1334 return;
1335 }
1336 mImpl.stopLocalRecord();
1337 }
1338
1346 @Override
1347 public int startScreenShare() {
1348 if (mImpl == null) {
1349 return -1;
1350 }
1351 return mImpl.startScreenShare();
1352 }
1353
1360 @Override
1361 public int stopScreenShare() {
1362 if (mImpl == null) {
1363 return -1;
1364 }
1365 return mImpl.stopScreenShare();
1366 }
1367
1378 @Override
1380 if (mImpl == null) {
1381 return -1;
1382 }
1383 return mImpl.startLocalDualAudioStream();
1384 }
1385
1393 @Override
1395 if (mImpl == null) {
1396 return -1;
1397 }
1398 return mImpl.stopLocalDualAudioStream();
1399 }
1400
1408 @Override
1409 public void snapshot(int count, int interval, AlivcSnapshotListener listener) {
1410 if (mImpl == null) {
1411 return;
1412 }
1413 mImpl.snapshot(count, interval, listener);
1414 }
1415
1425 @Override
1426 public void setExternalVideoSource(boolean enable, boolean useTexture, AlivcLivePlayVideoStreamType videoStreamType, AlivcPreviewDisplayMode previewDisplayMode) {
1427 if (mImpl == null) {
1428 return;
1429 }
1430 mImpl.setExternalVideoSource(enable, useTexture, videoStreamType, previewDisplayMode);
1431 }
1432
1442 @Override
1444 if (mImpl == null) {
1445 return -1;
1446 }
1447 return mImpl.pushExternalVideoFrame(rawDataSample, videoStreamType);
1448 }
1449
1457 @Override
1458 public int setMixedWithMic(boolean mixed) {
1459 if (mImpl == null) {
1460 return -1;
1461 }
1462 return mImpl.setMixedWithMic(mixed);
1463 }
1464
1472 @Override
1474 if (mImpl == null) {
1475 return -1;
1476 }
1477 return mImpl.addExternalAudioStream(externalAudioStreamConfig);
1478 }
1479
1489 @Override
1490 public int pushExternalAudioStream(int streamId, AlivcLivePushAudioFrame audioFrame) {
1491 if (mImpl == null) {
1492 return -1;
1493 }
1494 return mImpl.pushExternalAudioStream(streamId, audioFrame);
1495 }
1496
1505 @Override
1506 public int setExternalAudioStreamPlayoutVolume(int streamId, int playoutVolume) {
1507 if (mImpl == null) {
1508 return -1;
1509 }
1510 return mImpl.setExternalAudioStreamPlayoutVolume(streamId, playoutVolume);
1511 }
1512
1521 @Override
1522 public int setExternalAudioStreamPublishVolume(int streamId, int publishVolume) {
1523 if (mImpl == null) {
1524 return -1;
1525 }
1526 return mImpl.setExternalAudioStreamPublishVolume(streamId, publishVolume);
1527 }
1528
1536 @Override
1537 public int removeExternalAudioStream(int streamId) {
1538 if (mImpl == null) {
1539 return -1;
1540 }
1541 return mImpl.removeExternalAudioStream(streamId);
1542 }
1543
1557 @Deprecated
1558 @Override
1559 public void inputStreamVideoPtr(long dataPtr, int width, int height, int stride, int size, long pts, int rotation) {
1560 if (mImpl == null) {
1561 return;
1562 }
1563 mImpl.inputStreamVideoPtr(dataPtr, width, height, stride, size, pts, rotation);
1564 }
1565
1578 @Override
1579 public void inputStreamVideoData(byte[] data, int width, int height, int stride, int size, long pts, int rotation) {
1580 if (mImpl == null) {
1581 return;
1582 }
1583 mImpl.inputStreamVideoData(data, width, height, stride, size, pts, rotation);
1584 }
1585
1597 @Deprecated
1598 @Override
1599 public void inputStreamAudioPtr(long dataPtr, int size, int sampleRate, int channels, long pts) {
1600 if (mImpl == null) {
1601 return;
1602 }
1603 mImpl.inputStreamAudioPtr(dataPtr, size, sampleRate, channels, pts);
1604 }
1605
1616 @Override
1617 public void inputStreamAudioData(byte[] data, int size, int sampleRate, int channels, long pts) {
1618 if (mImpl == null) {
1619 return;
1620 }
1621 mImpl.inputStreamAudioData(data, size, sampleRate, channels, pts);
1622 }
1623
1635 @Override
1636 public int addDynamicsAddons(String path, float x, float y, float w, float h) {
1637 if (mImpl == null) {
1638 return -1;
1639 }
1640 return mImpl.addDynamicsAddons(path, x, y, w, h);
1641 }
1642
1648 @Override
1649 public void removeDynamicsAddons(int id) {
1650 if (mImpl == null) {
1651 return;
1652 }
1653 mImpl.removeDynamicsAddons(id);
1654 }
1655
1661 @Override
1662 public void setExposure(int exposure) {
1663 if (mImpl == null) {
1664 return;
1665 }
1666 mImpl.setExposure(exposure);
1667 }
1668
1674 @Override
1675 public int getCurrentExposure() {
1676 if (mImpl == null) {
1677 return -1;
1678 }
1679 return mImpl.getCurrentExposure();
1680 }
1681
1687 @Override
1689 if (mImpl == null) {
1690 return -1;
1691 }
1692 return mImpl.getSupportedMinExposure();
1693 }
1694
1700 @Override
1702 if (mImpl == null) {
1703 return -1;
1704 }
1705 return mImpl.getSupportedMaxExposure();
1706 }
1707
1718 @Override
1719 public int enableSEIVideoStream(boolean enable) {
1720 if (mImpl == null) {
1721 return -1;
1722 }
1723 return mImpl.enableSEIVideoStream(enable);
1724 }
1725
1741 @Override
1742 public void sendMessage(String info, int repeat, int delay, boolean isKeyFrame) {
1743 if (mImpl == null) {
1744 return;
1745 }
1746 mImpl.sendMessage(info, repeat, delay, isKeyFrame);
1747 }
1748
1766 @Override
1767 public void sendMessage(String info, int repeat, int delay, boolean isKeyFrame, int payloadType) {
1768 if (mImpl == null) {
1769 return;
1770 }
1771 mImpl.sendMessage(info, repeat, delay, isKeyFrame, payloadType);
1772 }
1773
1783 @Override
1784 public int sendDataChannelMessage(String message) {
1785 if (mImpl == null) {
1786 return -1;
1787 }
1788 return mImpl.sendDataChannelMessage(message);
1789 }
1790
1809 @Override
1811 if (mImpl == null) {
1812 return -1;
1813 }
1814 return mImpl.setLiveMixTranscodingConfig(config);
1815 }
1816
1829 @Override
1830 public int muteLocalCamera(boolean mute) {
1831 if (mImpl == null) {
1832 return -1;
1833 }
1834 return mImpl.muteLocalCamera(mute);
1835 }
1836
1847 @Override
1848 public int enableLocalCamera(boolean enable) {
1849 if (mImpl == null) {
1850 return -1;
1851 }
1852 return mImpl.enableLocalCamera(enable);
1853 }
1854
1865 @Override
1866 public int startAudioCapture(boolean keepAlive) {
1867 if (mImpl == null) {
1868 return -1;
1869 }
1870 return mImpl.startAudioCapture(keepAlive);
1871 }
1872
1883 @Override
1884 public int stopAudioCapture() {
1885 if (mImpl == null) {
1886 return -1;
1887 }
1888 return mImpl.stopAudioCapture();
1889 }
1890
1898 @Override
1899 public int enableSpeakerphone(boolean enable) {
1900 if (mImpl == null) {
1901 return -1;
1902 }
1903 return mImpl.enableSpeakerphone(enable);
1904 }
1905
1912 @Override
1913 public boolean isSpeakerphoneOn() {
1914 if (mImpl == null) {
1915 return false;
1916 }
1917 return mImpl.isSpeakerphoneOn();
1918 }
1919
1928 @Override
1929 public int setChannelProfile(AlivcLiveChannelProfile channelProfile) {
1930 if (mImpl == null) {
1931 return -1;
1932 }
1933 return mImpl.setChannelProfile(channelProfile);
1934 }
1935
1943 @Override
1944 public int setAudioProfile(AlivcLiveAudioProfileQualityMode audioProfileQualityMode) {
1945 if (mImpl == null) {
1946 return -1;
1947 }
1948 return mImpl.setAudioProfile(audioProfileQualityMode);
1949 }
1950
1959 @Override
1961 if (mImpl == null) {
1962 return -1;
1963 }
1964 return mImpl.setAudioEffectVoiceChangeMode(mode);
1965 }
1966
1975 @Override
1977 if (mImpl == null) {
1978 return -1;
1979 }
1980 return mImpl.setAudioEffectReverbMode(mode);
1981 }
1982
1991 @Override
1992 public int setAudioEffectPitchValue(double value) {
1993 if (mImpl == null) {
1994 return -1;
1995 }
1996 return mImpl.setAudioEffectPitchValue(value);
1997 }
1998
2007 @Override
2009 if (mImpl == null) {
2010 return -1;
2011 }
2012 return mImpl.setAudioEffectBeautifyMode(audioEffectBeautifyMode);
2013 }
2014
2024 @Override
2025 public int setAudioEffectReverbParamType(AlivcLiveAudioEffectReverbParamType audioEffectReverbParamType, float value) {
2026 if (mImpl == null) {
2027 return -1;
2028 }
2029 return mImpl.setAudioEffectReverbParamType(audioEffectReverbParamType, value);
2030 }
2031
2042 @Override
2043 public int setAudioEffectEqualizationParam(AlivcLiveAudioEffectEqualizationBandFrequency audioEffectEqualizationBandFrequency, float gain) {
2044 if (mImpl == null) {
2045 return -1;
2046 }
2047 return mImpl.setAudioEffectEqualizationParam(audioEffectEqualizationBandFrequency, gain);
2048 }
2049
2062 @Override
2063 public int enableAudioVolumeIndication(int interval, int smooth, int reportVad) {
2064 if (mImpl == null) {
2065 return -1;
2066 }
2067 return mImpl.enableAudioVolumeIndication(interval, smooth, reportVad);
2068 }
2069
2082 @Override
2084 if (mImpl == null) {
2085 return -1;
2086 }
2087 return mImpl.enableAudioFrameObserver(enable, audioSource, config);
2088 }
2089
2099 @Override
2100 public int preloadAudioEffect(int soundId, String filePath) {
2101 if (mImpl == null) {
2102 return -1;
2103 }
2104 return mImpl.preloadAudioEffect(soundId, filePath);
2105 }
2106
2114 @Override
2115 public int unloadAudioEffect(int soundId) {
2116 if (mImpl == null) {
2117 return -1;
2118 }
2119 return mImpl.unloadAudioEffect(soundId);
2120 }
2121
2132 @Override
2133 public int playAudioEffect(int soundId, String filePath, AlivcLiveAudioEffectConfig config) {
2134 if (mImpl == null) {
2135 return -1;
2136 }
2137 return mImpl.playAudioEffect(soundId, filePath, config);
2138 }
2139
2147 @Override
2148 public int stopAudioEffect(int soundId) {
2149 if (mImpl == null) {
2150 return -1;
2151 }
2152 return mImpl.stopAudioEffect(soundId);
2153 }
2154
2161 @Override
2162 public int stopAllAudioEffects() {
2163 if (mImpl == null) {
2164 return -1;
2165 }
2166 return mImpl.stopAllAudioEffects();
2167 }
2168
2177 @Override
2178 public int setAudioEffectPublishVolume(int soundId, int volume) {
2179 if (mImpl == null) {
2180 return -1;
2181 }
2182 return mImpl.setAudioEffectPublishVolume(soundId, volume);
2183 }
2184
2192 @Override
2193 public int getAudioEffectPublishVolume(int soundId) {
2194 if (mImpl == null) {
2195 return -1;
2196 }
2197 return mImpl.getAudioEffectPublishVolume(soundId);
2198 }
2199
2208 @Override
2209 public int setAudioEffectPlayoutVolume(int soundId, int volume) {
2210 if (mImpl == null) {
2211 return -1;
2212 }
2213 return mImpl.setAudioEffectPlayoutVolume(soundId, volume);
2214 }
2215
2223 @Override
2224 public int getAudioEffectPlayoutVolume(int soundId) {
2225 if (mImpl == null) {
2226 return -1;
2227 }
2228 return mImpl.getAudioEffectPlayoutVolume(soundId);
2229 }
2230
2238 @Override
2239 public int setAllAudioEffectsPublishVolume(int volume) {
2240 if (mImpl == null) {
2241 return -1;
2242 }
2243 return mImpl.setAllAudioEffectsPublishVolume(volume);
2244 }
2245
2253 @Override
2254 public int setAllAudioEffectsPlayoutVolume(int volume) {
2255 if (mImpl == null) {
2256 return -1;
2257 }
2258 return mImpl.setAllAudioEffectsPlayoutVolume(volume);
2259 }
2260
2268 @Override
2269 public int pauseAudioEffect(int soundId) {
2270 if (mImpl == null) {
2271 return -1;
2272 }
2273 return mImpl.pauseAudioEffect(soundId);
2274 }
2275
2282 @Override
2284 if (mImpl == null) {
2285 return -1;
2286 }
2287 return mImpl.pauseAllAudioEffects();
2288 }
2289
2297 @Override
2298 public int resumeAudioEffect(int soundId) {
2299 if (mImpl == null) {
2300 return -1;
2301 }
2302 return mImpl.resumeAudioEffect(soundId);
2303 }
2304
2311 @Override
2313 if (mImpl == null) {
2314 return -1;
2315 }
2316 return mImpl.resumeAllAudioEffects();
2317 }
2318
2329 @Override
2330 public int startLastMileDetect(AlivcLiveNetworkQualityProbeConfig networkQualityProbeConfig) {
2331 if (mImpl == null) {
2332 return -1;
2333 }
2334 return mImpl.startLastMileDetect(networkQualityProbeConfig);
2335 }
2336
2343 @Override
2344 public int stopLastMileDetect() {
2345 if (mImpl == null) {
2346 return -1;
2347 }
2348 return mImpl.stopLastMileDetect();
2349 }
2350
2358 @Override
2360 if (mImpl == null) {
2362 }
2363 return mImpl.getCurrentEncoderManufacturer(isCameraStream);
2364 }
2365
2372 @Override
2373 public String getLiveTraceId() {
2374 if (mImpl == null) {
2375 return "";
2376 }
2377 return mImpl.getLiveTraceId();
2378 }
2379}
2380
Set BGM background music configuration.
「Main API」 Live pusher abstract class
int setLiveMixTranscodingConfig(AlivcLiveTranscodingConfig config)
void startPreview(SurfaceView surfaceView)
int startBGMAsync(String path, AlivcLiveBGMConfig bgmConfig)
int setVideoMirrorMode(AlivcLiveVideoMirrorMode mirrorMode)
int setAudioEffectVoiceChangeMode(AlivcLivePushAudioEffectVoiceChangeMode mode)
void addWaterMark(Bitmap bitmap, float x, float y, float width)
int enableAudioVolumeIndication(int interval, int smooth, int reportVad)
void setQualityMode(AlivcQualityModeEnum mode)
int setExternalAudioStreamPlayoutVolume(int streamId, int playoutVolume)
int setAudioEffectReverbParamType(AlivcLiveAudioEffectReverbParamType audioEffectReverbParamType, float value)
int addExternalAudioStream(AlivcLivePushExternalAudioStreamConfig externalAudioStreamConfig)
int startCamera(SurfaceView surfaceView)
void setLivePushInfoListener(AlivcLivePushInfoListener infoListener)
int setChannelProfile(AlivcLiveChannelProfile channelProfile)
int addDynamicsAddons(String path, float x, float y, float w, float h)
void setCustomFilter(AlivcLivePushCustomFilter customVideoFilter)
void changeResolution(AlivcResolutionEnum resolution)
int pushExternalVideoFrame(AlivcLivePusherRawDataSample rawDataSample, AlivcLivePlayVideoStreamType videoStreamType)
int startLastMileDetect(AlivcLiveNetworkQualityProbeConfig networkQualityProbeConfig)
void snapshot(int count, int interval, AlivcSnapshotListener listener)
void setPreviewOrientation(AlivcPreviewOrientationEnum orientation)
void setMinVideoBitrate(int minVideoBitrate)
void setLivePushRenderContextListener(AlivcLivePusherRenderContextListener renderCtxListener)
void setPreviewMode(AlivcPreviewDisplayMode mode)
AlivcLivePushVideoConfig getVideoConfig()
void inputStreamVideoData(byte[] data, int width, int height, int stride, int size, long pts, int rotation)
void setTargetVideoBitrate(int targetVideoBitrate)
int enableAudioFrameObserver(boolean enable, AlivcLiveAudioSource audioSource, AlivcLiveAudioFrameObserverConfig config)
void inputStreamAudioData(byte[] data, int size, int sampleRate, int channels, long pts)
int setExternalAudioStreamPublishVolume(int streamId, int publishVolume)
void addWaterMark(String path, float x, float y, float width)
int setAudioEffectBeautifyMode(AlivcLiveAudioEffectBeautifyMode audioEffectBeautifyMode)
int startCameraMix(float x, float y, float w, float h)
void inputStreamVideoPtr(long dataPtr, int width, int height, int stride, int size, long pts, int rotation)
int setAudioEffectPlayoutVolume(int soundId, int volume)
boolean startLocalRecord(AlivcLiveLocalRecordConfig localRecordConfig)
void setMute(boolean mute, AlivcLiveMuteLocalAudioMode muteLocalAudioMode)
void updatePreview(Context context, FrameLayout frameLayout, boolean isFullScreen)
void sendMessage(String info, int repeat, int delay, boolean isKeyFrame, int payloadType)
int setAudioEffectReverbMode(AlivcLivePushAudioEffectReverbMode mode)
int setAudioEffectEqualizationParam(AlivcLiveAudioEffectEqualizationBandFrequency audioEffectEqualizationBandFrequency, float gain)
int preloadAudioEffect(int soundId, String filePath)
void startPreviewAsync(SurfaceView surfaceView)
void init(Context context, AlivcLivePushConfig config)
void setLivePushAudioFrameListener(AlivcLivePushAudioFrameListener pushAudioFrameListener)
void startPreview(Context context, FrameLayout frameLayout, boolean isFullScreen)
void focusCameraAtAdjustedPoint(float x, float y, boolean autoFocus)
AlivcLiveVideoCodecManufacturer getCurrentEncoderManufacturer(boolean isCameraStream)
void setLivePushBGMListener(AlivcLivePushBGMListener pushBGMListener)
void sendMessage(String info, int repeat, int delay, boolean isKeyFrame)
void inputStreamAudioPtr(long dataPtr, int size, int sampleRate, int channels, long pts)
void setLivePusherReference(AlivcLivePusher livePusher)
int pushExternalAudioStream(int streamId, AlivcLivePushAudioFrame audioFrame)
void setLivePushNetworkListener(AlivcLivePushNetworkListener networkListener)
void setVideoConfig(AlivcLivePushVideoConfig videoConfig)
void setExternalVideoSource(boolean enable, boolean useTexture, AlivcLivePlayVideoStreamType videoStreamType, AlivcPreviewDisplayMode previewDisplayMode)
int playAudioEffect(int soundId, String filePath, AlivcLiveAudioEffectConfig config)
void setCustomDetect(AlivcLivePushCustomDetect customVideoDetect)
int setAudioProfile(AlivcLiveAudioProfileQualityMode audioProfileQualityMode)
int setAudioEffectPublishVolume(int soundId, int volume)
void setLivePushErrorListener(AlivcLivePushErrorListener errorListener)
AlivcLivePushStatsInfo getLivePushStatsInfo()
void setCustomAudioFilter(AlivcLivePushCustomAudioFilter customAudioFilter)
Enumeration of streaming encode type.
Customizing the filter interface (Video Pre-Processing Callback)