Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions HarmonyOS_NEXT/APIExample/entry/oh-package-lock.json5

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion HarmonyOS_NEXT/APIExample/entry/oh-package.json5
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"author": "",
"license": "",
"dependencies": {
"AgoraRtcSdk": "file:./libs/AgoraRtcSdk.har",
"@shengwang/rtc-full": "file:./libs/AgoraRtcSdk.har",
"librawdataprocessing.so": "file:./src/main/cpp/types/librawdataprocessing"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ endif()
include_directories(${ROOT_PATH}
${ROOT_PATH}/include)

set(AGORA_LIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules/AgoraRtcSdk/libs)
set(AGORA_LIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules/@shengwang/rtc-full/libs)

add_library(agora_rtc_sdk SHARED IMPORTED)
set_target_properties(agora_rtc_sdk PROPERTIES IMPORTED_LOCATION ${AGORA_LIB_PATH}/${CMAKE_OHOS_ARCH_ABI}/libagora_rtc_sdk.so)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { OrientationMode, VideoDimensions } from 'AgoraRtcSdk'
import { OrientationMode, VideoDimensions } from '@shengwang/rtc-full'

export interface ExampleCategory{
title: Resource,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { OrientationMode, VideoDimensions } from 'AgoraRtcSdk'
import { OrientationMode, VideoDimensions } from '@shengwang/rtc-full'
import { ExampleCategory, ExampleItem, SettingsInfo } from '../model/DataType'

export const BASIC_ITEMS: ExampleItem[] =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { OrientationMode, RtcEngine, VideoDimensions } from 'AgoraRtcSdk'
import { OrientationMode, RtcEngine, VideoDimensions } from '@shengwang/rtc-full'
import { TitleBar } from '../common/TitleBar'
import { CommonItemSelect } from '../common/Widgets'
import { GlobalInfo } from './Data'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
EncryptionMode, RtcEngine,
RtcEngineConfig, VideoCanvas,
VideoEncoderConfiguration
} from 'AgoraRtcSdk';
} from '@shengwang/rtc-full';
import { TitleBar } from '../../common/TitleBar';
import Logger from '../../util/Logger';
import ShowToast from '../../util/ShowToast';
Expand Down Expand Up @@ -125,7 +125,7 @@ struct ChannelEncryption {
if (this.localUid != -1) {
XComponent({
id: 'preview_local',
type: 'surface',
type: XComponentType.SURFACE,
libraryname: Constants.AGORA_LIB_NAME,
}).onLoad(() => {
let localCanvas = new VideoCanvas("preview_local");
Expand All @@ -139,7 +139,7 @@ struct ChannelEncryption {
if (this.remoteUid != -1) {
XComponent({
id: 'preview_remote',
type: 'surface',
type: XComponentType.SURFACE,
libraryname: Constants.AGORA_LIB_NAME,
}).onLoad(() => {
let localCanvas = new VideoCanvas("preview_remote");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
Constants,
RtcEngine,
RtcEngineConfig
} from 'AgoraRtcSdk';
} from '@shengwang/rtc-full';
import { TitleBar } from '../../common/TitleBar';
import Logger from '../../util/Logger';
import ShowToast from '../../util/ShowToast';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AudioTrackConfig, ChannelMediaOptions, Constants, RtcEngine, RtcEngineConfig,
VideoEncoderConfiguration } from 'AgoraRtcSdk';
VideoEncoderConfiguration } from '@shengwang/rtc-full';
import { common } from '@kit.AbilityKit';
import { AppID } from '../../common/KeyCenter';
import Logger from '../../util/Logger';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
VideoEncoderConfiguration,
VideoFrame,
VideoPixelFormat
} from 'AgoraRtcSdk';
} from '@shengwang/rtc-full';
import { TitleBar } from '../../common/TitleBar';
import Logger from '../../util/Logger';
import ShowToast from '../../util/ShowToast';
Expand All @@ -27,7 +27,6 @@ struct CustomVideoSource {
private rtcEngine: RtcEngineEx | undefined = undefined;
private pushingVideoFrame = false
private intervalVideoNum = -1;
private customVideoTrack = -1;
@State message: string = 'Hello World';
@State channelName: string = ''
@State isJoin: boolean = false
Expand Down Expand Up @@ -77,7 +76,7 @@ struct CustomVideoSource {

this.rtcEngine.enableVideo()

this.customVideoTrack = this.rtcEngine.createCustomVideoTrack()
this.rtcEngine.setExternalVideoSource(true,false,Constants.ExternalVideoSourceType.VIDEO_FRAME);
}

aboutToDisappear(): void {
Expand All @@ -87,8 +86,6 @@ struct CustomVideoSource {
this.rtcEngine.leaveChannel();
}
this.stopPushVideo()
this.rtcEngine.destroyCustomVideoTrack(this.customVideoTrack)
this.customVideoTrack = -1
Logger.info(TAG, "destroy begin")
RtcEngine.destroy().then(() => {
Logger.info(TAG, "destroy done")
Expand Down Expand Up @@ -129,8 +126,8 @@ struct CustomVideoSource {
frame.yStride = width;
frame.height = height;
frame.timestamp = 0;
let ret = this.rtcEngine?.pushExternalVideoFrameById(frame, this.customVideoTrack)
if (ret != 0) {
let ret = this.rtcEngine?.pushExternalVideoFrame(frame)
if (!ret) {
Logger.error(TAG, "pushExternalVideoFrameEx failed: " + ret)
}
}, frame_interval_ms)
Expand Down Expand Up @@ -165,7 +162,7 @@ struct CustomVideoSource {
let localCanvas = new VideoCanvas("preview_local");
localCanvas.uid = this.localUid;
localCanvas.renderMode = VideoCanvas.RENDER_MODE_HIDDEN;
localCanvas.mirrorMode = 0;
localCanvas.mirrorMode = VideoCanvas.VIDEO_MIRROR_MODE_DISABLED;
// TODO set source type
localCanvas.sourceType = Constants.VideoSourceType.CUSTOM
this.rtcEngine?.setupLocalVideo(localCanvas);
Expand Down Expand Up @@ -232,7 +229,6 @@ struct CustomVideoSource {
}
let mediaOption: ChannelMediaOptions = new ChannelMediaOptions();
mediaOption.publishCustomVideoTrack = true
mediaOption.customVideoTrackId = this.customVideoTrack
mediaOption.publishMicrophoneTrack = true;
mediaOption.autoSubscribeVideo = true;
mediaOption.autoSubscribeAudio = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
RtcEngineConfig,
VideoCanvas,
VideoEncoderConfiguration
} from 'AgoraRtcSdk';
} from '@shengwang/rtc-full';
import { TitleBar } from '../../common/TitleBar';
import Logger from '../../util/Logger';
import ShowToast from '../../util/ShowToast';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
RtcEngineEx,
VideoCanvas,
VideoEncoderConfiguration
} from 'AgoraRtcSdk';
} from '@shengwang/rtc-full';
import { TitleBar } from '../../common/TitleBar';
import Logger from '../../util/Logger';
import { common } from '@kit.AbilityKit';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
RtcEngineConfig,
VideoCanvas,
VideoEncoderConfiguration
} from 'AgoraRtcSdk';
} from '@shengwang/rtc-full';
import { TitleBar } from '../../common/TitleBar';
import Logger from '../../util/Logger';
import ShowToast from '../../util/ShowToast';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
VideoCanvas,
VideoEncoderConfiguration,
ScreenCaptureParameters
} from 'AgoraRtcSdk';
} from '@shengwang/rtc-full';
import { TitleBar } from '../../common/TitleBar';
import Logger from '../../util/Logger';
import ShowToast from '../../util/ShowToast';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
RtcEngineConfig,
VideoCanvas,
VideoEncoderConfiguration
} from 'AgoraRtcSdk';
} from '@shengwang/rtc-full';
import { TitleBar } from '../../common/TitleBar';
import Logger from '../../util/Logger';
import ShowToast from '../../util/ShowToast';
Expand Down Expand Up @@ -102,7 +102,7 @@ struct MediaMetadataWrap {
if (this.localUid != 0) {
XComponent({
id: 'preview_local',
type: 'surface',
type: XComponentType.SURFACE,
libraryname: Constants.AGORA_LIB_NAME,
}).onLoad(() => {
let localCanvas = new VideoCanvas("preview_local");
Expand All @@ -116,7 +116,7 @@ struct MediaMetadataWrap {
if (this.remoteUid != 0) {
XComponent({
id: 'preview_remote',
type: 'surface',
type: XComponentType.SURFACE,
libraryname: Constants.AGORA_LIB_NAME,
}).onLoad(() => {
let localCanvas = new VideoCanvas("preview_remote");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
RtcEngineConfig,
VideoCanvas,
VideoEncoderConfiguration
} from 'AgoraRtcSdk';
} from '@shengwang/rtc-full';
import { TitleBar } from '../../common/TitleBar';
import Logger from '../../util/Logger';
import ShowToast from '../../util/ShowToast';
Expand Down Expand Up @@ -118,7 +118,7 @@ struct MediaRecorder {
Stack() {
XComponent({
id: 'preview_local',
type: 'surface',
type: XComponentType.SURFACE,
libraryname: Constants.AGORA_LIB_NAME,
}).onLoad(() => {
let localCanvas = new VideoCanvas("preview_local");
Expand Down Expand Up @@ -191,7 +191,7 @@ struct MediaRecorder {
Stack() {
XComponent({
id: 'preview_remote',
type: 'surface',
type: XComponentType.SURFACE,
libraryname: Constants.AGORA_LIB_NAME,
}).onLoad(() => {
let localCanvas = new VideoCanvas("preview_remote");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
Constants,
RtcEngine,
RtcEngineConfig
} from 'AgoraRtcSdk';
} from '@shengwang/rtc-full';
import { TitleBar } from '../../common/TitleBar';
import Logger from '../../util/Logger';
import ShowToast from '../../util/ShowToast';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
RtcEngineConfig,
VideoCanvas,
VideoEncoderConfiguration
} from 'AgoraRtcSdk';
} from '@shengwang/rtc-full';
import { TitleBar } from '../../common/TitleBar';
import Logger from '../../util/Logger';
import ShowToast from '../../util/ShowToast';
Expand Down Expand Up @@ -100,7 +100,7 @@ struct OriginVideoDataWrap {
if (this.localUid != 0) {
XComponent({
id: 'preview_local',
type: 'surface',
type: XComponentType.SURFACE,
libraryname: Constants.AGORA_LIB_NAME,
}).onLoad(() => {
let localCanvas = new VideoCanvas("preview_local");
Expand All @@ -114,7 +114,7 @@ struct OriginVideoDataWrap {
if (this.remoteUid != 0) {
XComponent({
id: 'preview_remote',
type: 'surface',
type: XComponentType.SURFACE,
libraryname: Constants.AGORA_LIB_NAME,
}).onLoad(() => {
let localCanvas = new VideoCanvas("preview_remote");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChannelMediaOptions, Constants, RtcEngine, RtcEngineConfig } from 'AgoraRtcSdk';
import { ChannelMediaOptions, Constants, RtcEngine, RtcEngineConfig } from '@shengwang/rtc-full';
import { TitleBar } from '../../common/TitleBar';
import Logger from '../../util/Logger';
import ShowToast from '../../util/ShowToast';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
RtcEngine,
RtcEngineConfig,
VideoCanvas
} from 'AgoraRtcSdk';
} from '@shengwang/rtc-full';
import { AppID } from '../../common/KeyCenter';
import Logger from '../../util/Logger';
import { common } from '@kit.AbilityKit';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
TranscodingUser,
VideoCanvas,
VideoEncoderConfiguration
} from 'AgoraRtcSdk';
} from '@shengwang/rtc-full';
import { TitleBar } from '../../common/TitleBar';
import Logger from '../../util/Logger';
import ShowToast from '../../util/ShowToast';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
ScreenCaptureParameters,
VideoCanvas,
VideoEncoderConfiguration
} from 'AgoraRtcSdk';
} from '@shengwang/rtc-full';
import { TitleBar } from '../../common/TitleBar';
import Logger from '../../util/Logger';
import ShowToast from '../../util/ShowToast';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChannelMediaOptions, Constants, RtcEngine, RtcEngineEx, RtcEngineConfig, AudioVolumeInfo } from 'AgoraRtcSdk';
import { ChannelMediaOptions, Constants, RtcEngine, RtcEngineEx, RtcEngineConfig, AudioVolumeInfo } from '@shengwang/rtc-full';
import { TitleBar } from '../../common/TitleBar';
import Logger from '../../util/Logger';
import ShowToast from '../../util/ShowToast';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ChannelMediaOptions, Constants, RtcEngine, RtcEngineConfig, VideoCanvas,
VideoEncoderConfiguration } from 'AgoraRtcSdk';
VideoEncoderConfiguration } from '@shengwang/rtc-full';
import { TitleBar } from '../../common/TitleBar';
import Logger from '../../util/Logger';
import ShowToast from '../../util/ShowToast';
Expand Down Expand Up @@ -93,7 +93,7 @@ struct JoinVideoChannel {
if (this.localUid != 0) {
XComponent({
id: 'preview_local',
type: 'surface',
type: XComponentType.SURFACE,
libraryname: Constants.AGORA_LIB_NAME,
}).onLoad(() => {
let localCanvas = new VideoCanvas("preview_local");
Expand All @@ -107,7 +107,7 @@ struct JoinVideoChannel {
if (this.remoteUid != 0) {
XComponent({
id: 'preview_remote',
type: 'surface',
type: XComponentType.SURFACE,
libraryname: Constants.AGORA_LIB_NAME,
}).onLoad(() => {
let localCanvas = new VideoCanvas("preview_remote");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
RtcEngineConfig,
VideoCanvas,
VideoEncoderConfiguration
} from 'AgoraRtcSdk';
} from '@shengwang/rtc-full';
import { TitleBar } from '../../common/TitleBar';
import Logger from '../../util/Logger';
import ShowToast from '../../util/ShowToast';
Expand Down Expand Up @@ -119,7 +119,7 @@ struct JoinVideoChannelToken {
if (this.localUid != 0) {
XComponent({
id: 'preview_local',
type: 'surface',
type: XComponentType.SURFACE,
libraryname: Constants.AGORA_LIB_NAME,
}).onLoad(() => {
let localCanvas = new VideoCanvas("preview_local");
Expand All @@ -133,7 +133,7 @@ struct JoinVideoChannelToken {
if (this.remoteUid != 0) {
XComponent({
id: 'preview_remote',
type: 'surface',
type: XComponentType.SURFACE,
libraryname: Constants.AGORA_LIB_NAME,
}).onLoad(() => {
let localCanvas = new VideoCanvas("preview_remote");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Constants } from 'AgoraRtcSdk';
import { Constants } from '@shengwang/rtc-full';

export class AudioConfigHelper {
public static readonly AUDIO_SCENARIO_DEFAULT = 'DEFAULT'
Expand Down