47pt 30pt EC Platform Cloud

22
HUAWEI TECHNOLOGIES CO., LTD. www.huawei.com Huawei Confidential Security Level: 2016/8/24 EC Platform Cloud Secondary Development Training Guide

Transcript of 47pt 30pt EC Platform Cloud

Page 1: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD.

www.huawei.com

Huawei Confidential

Security Level:

47pt

30pt

反白

:

FrutigerNext LT Medium

: Arial

47pt

黑体

28pt

反白

细黑体

2016/8/24

EC Platform Cloud Secondary Development

Training Guide

Page 2: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Page 2

To allow various products to integrate

the conference system using unified

code, the EC Platform Cloud (ECPC)

conference component separates

services from the user interface (UI) and

provides unified capability interfaces for

external products.

This course describes the architecture,

principles, functions, and development

examples of the ECPC conference

component.

Page 3: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Page 3

After learning this course, you will:

Know the application scenarios, principles, and

functions of the ECPC conference component.

Know the secondary development method using the

ECPC conference component.

Page 4: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Page 4

Chapter 1 Conference Component Application

Scenarios

Chapter 2 Conference Component Principles and

Functions

Chapter 3 Conference Component Secondary

Development Preparations

Chapter 4 Conference Component Secondary

Development Process

Chapter 5 Conference Component Secondary

Development Example

Page 5: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Typical Scenarios

By integrating the conference component, various platforms can

implement functions of the conference system, including

desktop/application sharing, document/whiteboard sharing, audio,

call, video, file transfer, and instant message (IM). The conference

component has the following application scenarios:

eSpace Meeting integrates the conference component to implement a

complete set of functions of the conference system.

eSpace VTM integrates the conference component to implement conference

functions such as multi-party video and desktop sharing.

eSpace CC integrates the conference component to implement functions such

as remote control.

Page 5

Page 6: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Page 6

Chapter 1 Conference Component Application

Scenarios

Chapter 2 Conference Component Principles and

Functions

Chapter 3 Conference Component Secondary

Development Preparations

Chapter 4 Conference Component Secondary

Development Process

Chapter 5 Conference Component Secondary

Development Example

Page 7: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Conference Component Design Principles

Separating services from the UI

The conference component focuses on the service logic of function modules. The UI is implemented by

the application layer.

Abstracting service capabilities

The conference component abstracts service capabilities. Upper-layer applications can combine services

based on capabilities.

Asynchronous programming

The conference component uses the asynchronous programming mode. Function invocation is separated

from message callback. Message callback is implemented using registered message callback functions,

as shown in the following figure.

Page 7

Page 8: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Conference Component Architecture

Conference communication protocol stack

Audio and

video

Document/

Whiteboard

sharing

Desktop/

Application

sharing

Interface layer, providing C interfaces and Java interfaces (Android)

Screen

capture

Document

formatHME

Rendering library (Windows/iOS/Mac/Android)

IM

Me

dia

sh

arin

g

Document

loading

Screen

encoding/

decoding

Conference control layer (conference, participant, and module management)

Product/ISV

Page 9: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Thread Models of the Conference

Component

Thread model 1 Thread model 2

Invoker main thread Invoker main thread Component thread

1. The component works in

the invoker main thread.

2. All callback operations are

also performed in the

invoker main thread.

3. Invocations by other

threads are synchronized

to the invoker main thread.

1. The component works in

the component thread.

2. All callback operations are

performed in the invoker

main thread.

3. All invocations are

synchronized to the

component thread.

1. The conference component supports two thread models. Thread model 1 is used on the Windows and iOS

platforms. Thread model 2 is used on the Android platform.

2. Thread security is implemented for all interfaces. The application layer can invoke interfaces in any thread.

3. All message callback operations are performed in the invoker main thread. The conference component regards

the thread that invokes the tup_conf_init() interface as the main thread.

Synchronize

invocations

Page 10: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Modules of the ECPC Conference

Component

Page 10

Module Description

Interface

Provides interfaces using the C language on the Windows and iOS

platforms.

Provides Java classes using JAR packages on the Android platform.

Conference controlProvides the conference, participant, and component management

functions.

Desktop sharingProvides the desktop sharing, application sharing, and remote control

functions.

Document sharing Provides the document sharing function.

Whiteboard Provides the whiteboard function.

Video Provides the multi-party video function.

Audio Provides the multi-party audio function.

File transfer Provide one-to-one and one-to-many file transfer functions.

IM Provides public, one-to-one, and group IM functions.

Page 11: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Public Cloud Authentication for the

Conference Component

A public cloud uses an account and a private key for

authentication. The account and private key are passed in

during initialization.

Isv_Param param;

strncpy_s(param.isv_account, TC_MAX_ISV_ACCOUNT_LEN,"TestAccount",

TC_MAX_ISV_ACCOUNT_LEN - 1);

trncpy_s(param..rsa_key, TC_MAX_RSA_KEY_LEN,"XXXXXXX",

TC_MAX_RSA_KEY_LEN - 1);

tup_conf_init_isv (TRUE,&param);

Page 11

Page 12: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Page 12

Chapter 1 Conference Component Application

Scenarios

Chapter 2 Conference Component Principles and

Functions

Chapter 3 Conference Component Secondary

Development Preparations

Chapter 4 Conference Component Secondary

Development Process

Chapter 5 Conference Component Secondary

Development Example

Page 13: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Conference Component Secondary

Development Preparations

Page 13

– Based on the Windows Operating System

1. Microsoft Visual Studio 2008

The ECPC conference component provides external interfaces in the C

language format. In this course, Microsoft Visual Studio 2008 MFC application is

used in secondary development. You can also use other IDEs or languages.

2. ECPC conference component package

ECPC conference component header files (stored in the inc directory)

ECPC conference component library file (tuo_conf_sdk.lib)

Page 14: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Page 14

Chapter 1 Conference Component Application

Scenarios

Chapter 2 Conference Component Principles and

Functions

Chapter 3 Conference Component Secondary

Development Preparations

Chapter 4 Conference Component Secondary

Development Process

Chapter 5 Conference Component Secondary

Development Example

Page 15: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Page 15

Conference Component Secondary Development– Adding Modules to the Project

1. Add the path for storing conference component header files to the

ISV project.

2. Copy conference component and third-party library files to the

output directory of the ISV project.

3. Add the dependency library tup_conf_sdk.lib to the ISV project.

Page 16: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Page 16

Conference Component Secondary Development– Invoking Component Interfaces

ISV application layer Component layer

2. Invoke tup_conf_new() to create a conference and register

the component callback message entry.

3. Invoke tup_conf_join() to join the conference.

Callback message CONF_MSG_ON_CONFERENCE_JOIN

6. Invoke module interfaces.

7. Process callback messages.

Create and

join a

conference.

8. Invoke tup_conf_leave() to exit the conference.

9. Invoke tup_conf_release() to release local conference resources.

4. Invoke tup_conf_load_component() to load a service

module.

Callback message CONF_MSG_ON_COMPONENT_LOAD

5. Invoke tup_conf_reg_component_callback() to register the

module callback message entry.

Load a

service

module.

Implement

service

functions.

Exit the

conference.

1. Invoke tup_conf_init() to initialize the SDK library.Initialize the

SDK library.Invoke tup_conf_init_isv() to initialize ISV information.

Page 17: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Page 17

Chapter 1 Conference Component Application

Scenarios

Chapter 2 Conference Component Principles and

Functions

Chapter 3 Conference Component Secondary

Development Preparations

Chapter 4 Conference Component Secondary

Development Process

Chapter 5 Conference Component Secondary

Development Example

Page 18: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Prepare to open a video.

1. Create a project named Video, add component class library files, and

configure the project.

2. Create a dialog box for playing videos.

Page 18

Conference Component Secondary

Development Example – Windows– Opening a Video

Page 19: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Initialize the SDK.

tup_conf_new(false,NULL);

Create and join a conference.

m_nHandle = tup_conf_new(OnMsgCallback, &m_confInfo, CONF_OPTION_BASE);

tup_conf_join(m_nHandle);

Load the video module and register the video module

callback function.

tup_conf_load_component(m_nHandle,IID_COMPONENT_VIDEO);

tup_conf_reg_component_callback(m_nHandle, IID_COMPONENT_VIDEO,OnMsgCallback);

Note: For details about how to use the interfaces, see the EC Platform Cloud SDK

Interface Reference.

Page 19

Conference Component Secondary

Development Example – Windows– Opening a Video

Page 20: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Process callback after the video module is loaded.

After the video module is loaded, the

CONF_MSG_ON_COMPONENT_LOAD message is sent to the ISV

application layer. When receiving this message, the ISV application layer

invokes video module interfaces to obtain device information and open a

video.

case CONF_MSG_ON_COMPONENT_LOAD: // Module loading callback message

{

int iCount = tup_conf_video_get_devicecount(m_nHandle);

TC_DEVICE_INFO* pDeviceInfo = new TC_DEVICE_INFO[iCount];

tup_conf_video_get_deviceinfo(m_nHandle, pDeviceInfo);

tup_conf_video_open(m_nHandle,pDeviceInfo[0]._DeviceID,TRUE);

break;

}

Page 20

Conference Component Secondary

Development Example – Windows– Opening a Video

Page 21: 47pt 30pt EC Platform Cloud

HUAWEI TECHNOLOGIES CO., LTD. Huawei Confidential

35pt

32pt

) :18pt

Process callback after the video is opened.

After the video is opened, the component sends the COMPT_MSG_VIDEO_ON_SWITCH

message to the ISV application layer. When receiving this message, the ISV application layer

invokes the tup_conf_video_attach() interface to play the video in the video window, as shown

in the following figure.

Page 21

Conference Component Secondary

Development Example – Windows– Opening a Video

Page 22: 47pt 30pt EC Platform Cloud

Thank youwww.huawei.com