文档管理中心
API参考多媒体管线服务Android-C++Struct SummaryClock

Clock

展开

Struct Info

Clock

ClockCore封装类,用于SinkNode间的同步。

Public Function Summary

展开

Qualifier and Type

Function Name and Description

static std::shared_ptr<Clock>

Create(uint32_t flag)

创建一个Clock的对象。

RetCode

Resume()

恢复时钟同步。

RetCode

Pause()

暂停时钟同步。

RetCode

Flush()

重置时钟同步。

ClockCore

ProvideClock()

提供同步时钟,用于当前SinkNode和其他SinkNode之间的时间同步。

RetCode

SetClock(const ClockCoreSP &clock)

设置同步时钟,用于当前SinkNode和其他SinkNode之间的时间同步。

void

SetAnchorTime(int64_t mediaUs, int64_t realUs, int64_t anchorMaxTime = -1)

设置锚时间。

void

UpdateMaxAnchorTime(int64_t anchorMaxTime)

更新当前锚时间所对应的最大平滑时钟。

int64_t

GetMediaLateUs(int64_t mediaTimeUs)

根据当前媒体流时间返回对应帧的延迟时间。

RetCode

GetCurrentPosition(int64_t &mediaTimeUs)

获取当前节点的媒体时间。

Public Functions

Create

展开

Function

static shared_ptr<Clock> Create(uint32_t flag)

创建一个Clock对象,用于SinkNode间的时钟同步。

Parameters

展开

Name

Description

flag

用于区别该SinkNode是提供时钟,还是接受外部的同步时钟。

Returns

展开

Type

Description

std::shared_ptr<Clock>

返回一个Clock的智能指针。

Resume

展开

Function

RetCode Resume()

恢复SinkNode间的时钟同步。

Returns

展开

Type

Description

RetCode

返回错误码。

Pause

展开

Function

RetCode Pause()

暂停SinkNode间的时钟同步。

Returns

展开

Type

Description

RetCode

返回错误码。

Flush

展开

Function

RetCode Flush()

重置SinkNode间的时钟。

Returns

展开

Type

Description

RetCode

返回错误码。

ProvideClock

展开

Function

std::shared_ptr<ClockCore> ProvideClock()

提供时钟,用于SinkNode间的时钟同步。

Returns

展开

Type

Description

std::shared_ptr<ClockCore>

返回一个Clock的智能指针。

SetClock

展开

Function

RetCode SetClock(const ClockCoreSP &clock)

创建一个ClockCore对象给当前SinkNode,用于SinkNode间的时钟同步。

Parameters

展开

Name

Description

clock

设置同步时钟。

Returns

展开

Type

Description

RetCode

返回错误码。

SetAnchorTime

展开

Function

void SetAnchorTime(int64_t mediaUs, int64_t realUs, int64_t anchorMaxTime = -1)

设置锚时间。

Parameters

展开

Name

Description

mediaUs

当前媒体流的媒体时间,单位:微秒。

realUs

当前媒体流对应的系统时间,单位:微秒。

anchorMaxTime

当前锚时间的最大平滑时间,单位:微秒。

-1表示不设置最大平滑时间。

UpdateMaxAnchorTime

展开

Function

void UpdateMaxAnchorTime(int64_t anchorMaxTime)

更新当前锚时间所对应的最大平滑时钟。

Parameters

展开

Name

Description

anchorMaxTime

设置当前锚时间所对应的最大平滑时间。

GetMediaLateUs

展开

Function

int64_t GetMediaLateUs(int64_t mediaTimeUs)

根据当前媒体流时间返回对应帧的延迟时间。

Parameters

展开

Name

Description

mediaTimeUs

当前流的媒体时间。

Returns

展开

Type

Description

int64_t

当前媒体流时间对应的延迟时间。

GetCurrentPosition

展开

Function

RetCode GetCurrentPosition(int64_t &mediaTimeUs)

获取当前节点的媒体时间。

Parameters

展开

Name

Description

mediaTimeUs

当前节点的媒体时间。

Returns

展开

Type

Description

RetCode

返回错误码。

在 API参考 中进行搜索
请输入您想要搜索的关键词