MeiCam SDK For iOS  3.10.0
Instance Methods | Properties | List of all members
NvsTrack Class Reference

Track is container for video and audio clips. More...

#import <NvsTrack.h>

Inheritance diagram for NvsTrack:
NvsObject NvsAudioTrack NvsVideoTrack

Instance Methods

(int64_t) - changeInPoint:newInPoint:
 Change the in point of the clip on the timeline.If clip does not have this function authorization to return the current InPoint. If newInPoint is less than the outPoint of the previous clip, return the outPoint of the previous clip directly. If the current clip is the 0th clip, newInPoint is at least 0. This function internally calculates a new trimIn based on newInPoint and modifies the trimIn of the clip. If the new trimIn is less than 0, the corresponding Inpoint value when the trimIn is 0 will be returned; if the newInPoint is greater than trimOut, the corresponding Inpoint value of trimOut-1 will be returned. More...
 
(int64_t) - changeOutPoint:newOutPoint:
 Change the out point of the clip on the timeline.If clip does not have this function authorization to return the current outPoint.If newOutpoint is less than the outPoint of the clip, then newOutpoint will not be less than inpoint+1; if the clip is followed by nextclip, then newOutpoint will not be greater than the inpoint of nextclip. If the current clip is the last clip, the final outPoint is the duration of the timeline. If newOutpoint is greater than the outPoint of the clip, then the end of the video will be FreezeFrame. This function internally calculates a new trimOut based on newOutPoint, and removes the intermediate transition if the inPoint of the clip is not equal to the outPoint of the next clip. More...
 
(BOOL) - splitClip:splitPoint:
 Split the specified clip. More...
 
(BOOL) - removeClip:keepSpace:
 Remove the specified clip,You are not allowed to remove the opening and ending of a theme. More...
 
(BOOL) - removeRange:endTimelinePos:keepSpace:
 Remove all clips within the specified interval, and adjust the timeline in or out point if the clip only partially overlaps the interval.Failed to remove the fragment if it contains the opening and ending sections of the theme.StartTimeLinepos < 0 or endTimeLinepos <= startTimeLinepos will also remove failure. More...
 
(BOOL) - moveClip:destClipIndex:
 Move the specified clip,clipIndex and destClipIndex cannot be equal to clipCount. More...
 
(BOOL) - moveClip:targetTimelinePos:isInsertTarget:keepSpace:
 Moves the specified clip to the input position. clipIndex greater than or equal to clipCount will fail to remove, targetTimeLinePos equal to 0 will be moved to the 0 position, the theme title title will not be moved. More...
 
(BOOL) - removeAllClips
 Remove all clips. More...
 
(void) - setVolumeGain:rightVolumeGain:
 Set the volume吗,The final volume value is the track volume Multiplied by the clip volume. More...
 
(void) - getVolumeGain:rightVolumeGain:
 Get the volume, The final volume value is the track volume Multiplied by the clip volume. More...
 
- Instance Methods inherited from NvsObject
(void) - setAttachment:forKey:
 Adds an attachment to the NvsObject object to identify the object of the NvsObject or for other purposes. More...
 
(void) - setTemplateAttachment:forKey:
 Adds additional template data to the NvsObject object to identify the NvsObject template object. More...
 
(NSObject *) - getAttachment:
 Gets attached attachments. More...
 
(NSString *) - getTemplateAttachment:
 Gets an template attachment to NvsObject. More...
 

Properties

NvsTrackType type
 Track type. More...
 
unsigned int index
 Index of track. More...
 
int64_t duration
 Duration of track (in microseconds). More...
 
unsigned int clipCount
 Count of clips on the track. More...
 

Detailed Description

Track is container for video and audio clips.

A track can be thought of as a collection of clips, divided into audio track and video track. Once you have created a timeline instance, you can add or remove multiple tracks. On each track, you can add multiple video and audio clips to edit, and set the volume for the clips, as well as remove and move positions.

Warning
For NvsTrack class, all public API must be implemented within UI thread!!!

Method Documentation

◆ changeInPoint:newInPoint:

- (int64_t) changeInPoint: (unsigned int)  clipIndex
newInPoint: (int64_t)  newInPoint 

Change the in point of the clip on the timeline.If clip does not have this function authorization to return the current InPoint. If newInPoint is less than the outPoint of the previous clip, return the outPoint of the previous clip directly. If the current clip is the 0th clip, newInPoint is at least 0. This function internally calculates a new trimIn based on newInPoint and modifies the trimIn of the clip. If the new trimIn is less than 0, the corresponding Inpoint value when the trimIn is 0 will be returned; if the newInPoint is greater than trimOut, the corresponding Inpoint value of trimOut-1 will be returned.

Parameters
clipIndexIndex of clip
newInPointThe new in point on the timeline (in microseconds)
Returns
Returns the in point (in microseconds) which can be actual reachable on the timeline. Note: The range of in points on the timeline is within the open interval of the timeline out point of the previous clip and the timeline out point of this clip.
Warning
This interface will cause the streaming engine state to jump to the state of stopping engine. For details, please refer to The Topic of Changing Engine.
Since
1.6.0
See also
- changeOutPoint:newOutPoint:

◆ changeOutPoint:newOutPoint:

- (int64_t) changeOutPoint: (unsigned int)  clipIndex
newOutPoint: (int64_t)  newOutPoint 

Change the out point of the clip on the timeline.If clip does not have this function authorization to return the current outPoint.If newOutpoint is less than the outPoint of the clip, then newOutpoint will not be less than inpoint+1; if the clip is followed by nextclip, then newOutpoint will not be greater than the inpoint of nextclip. If the current clip is the last clip, the final outPoint is the duration of the timeline. If newOutpoint is greater than the outPoint of the clip, then the end of the video will be FreezeFrame. This function internally calculates a new trimOut based on newOutPoint, and removes the intermediate transition if the inPoint of the clip is not equal to the outPoint of the next clip.

Parameters
clipIndexIndex of clip
newOutPointThe new out point on the timeline (in microseconds)
Returns
Returns the out point (in microseconds) which can be actual reachable on the timeline. Note: The range of out points on the timeline is within the open interval of the timeline in point of this clip and the timeline in point of the next clip.
Warning
This interface will cause the streaming engine state to jump to the state of stopping engine. For details, please refer to The Topic of Changing Engine.
Since
1.6.0
See also
- changeInPoint:newInPoint:

◆ getVolumeGain:rightVolumeGain:

- (void) getVolumeGain: (float *)  leftVolumeGain
rightVolumeGain: (float *)  rightVolumeGain 

Get the volume, The final volume value is the track volume Multiplied by the clip volume.

Parameters
leftVolumeGainOutput the left channel of the volume, in the range [0, 4).
rightVolumeGainOutput the right channel of the volume, in the range [0, 4).
See also
- setVolumeGain:rightVolumeGain:

◆ moveClip:destClipIndex:

- (BOOL) moveClip: (unsigned int)  clipIndex
destClipIndex: (unsigned int)  destClipIndex 

Move the specified clip,clipIndex and destClipIndex cannot be equal to clipCount.

Parameters
clipIndexIndex of clip
destClipIndexTarget index for clip movement
Returns
Determine if the removal is successful. Returning YES will remove the success and NO will fail.
Warning
This interface will cause the streaming engine state to jump to the state of stopping engine. For details, please refer to The Topic of Changing Engine.

◆ moveClip:targetTimelinePos:isInsertTarget:keepSpace:

- (BOOL) moveClip: (unsigned int)  clipIndex
targetTimelinePos: (int64_t)  targetTimelinePos
isInsertTarget: (BOOL)  isInsertTarget
keepSpace: (BOOL)  keepSpace 

Moves the specified clip to the input position. clipIndex greater than or equal to clipCount will fail to remove, targetTimeLinePos equal to 0 will be moved to the 0 position, the theme title title will not be moved.

Parameters
clipIndexThe clip index that needs to be moved.
targetTimelinePosThe timeline position to which the clip is moved, in microseconds.
isInsertTargetWhether to move the clip as an insert,False means use overrided.
keepSpaceWhether to preserve space during clip movement,The reserved space is the black clip.
Returns
Returns whether the move operation was successful
Warning
This interface will cause the streaming engine state to jump to the engine stop state, refer to Engine Change Feature for details.

◆ removeAllClips

- (BOOL) removeAllClips

Remove all clips.

Returns
Determine if the removal is successful. Returning YES will remove the success and NO will fail.
Warning
This interface will cause the streaming engine state to jump to the state of stopping engine. For details, please refer to The Topic of Changing Engine.
See also
- removeClip:keepSpace:

◆ removeClip:keepSpace:

- (BOOL) removeClip: (unsigned int)  clipIndex
keepSpace: (BOOL)  keepSpace 

Remove the specified clip,You are not allowed to remove the opening and ending of a theme.

Parameters
clipIndexIndex of clip
keepSpaceWhether the clip's space on the track is preserved after the clip is removed. A value of true is reserved, and a value of false is not retained.
Returns
Determine if the removal is successful. Returning YES will remove the success and NO will fail.
Warning
This interface will cause the streaming engine state to jump to the state of stopping engine. For details, please refer to The Topic of Changing Engine.
See also
- removeAllClips

◆ removeRange:endTimelinePos:keepSpace:

- (BOOL) removeRange: (int64_t)  startTimelinePos
endTimelinePos: (int64_t)  endTimelinePos
keepSpace: (BOOL)  keepSpace 

Remove all clips within the specified interval, and adjust the timeline in or out point if the clip only partially overlaps the interval.Failed to remove the fragment if it contains the opening and ending sections of the theme.StartTimeLinepos < 0 or endTimeLinepos <= startTimeLinepos will also remove failure.

Parameters
startTimelinePosThe starting timeline position of the interval (in microseconds)
endTimelinePosThe ending timeline position of the interval (in microseconds)
keepSpaceAfter the segment in the interval is removed, whether the space on the track occupied by the interval is reserved. A value of true is reserved, and a value of false is not retained.
Returns
Determine if the removal is successful. Returning YES will remove the success and NO will fail.
Warning
This interface will cause the streaming engine state to jump to the state of stopping engine. For details, please refer to The Topic of Changing Engine.

◆ setVolumeGain:rightVolumeGain:

- (void) setVolumeGain: (float)  leftVolumeGain
rightVolumeGain: (float)  rightVolumeGain 

Set the volume吗,The final volume value is the track volume Multiplied by the clip volume.

Parameters
leftVolumeGainSet the left channel of the volume, in the range [0, 4).
rightVolumeGainSet the right channel of the volume, in the range [0, 4).
See also
- getVolumeGain:rightVolumeGain:

◆ splitClip:splitPoint:

- (BOOL) splitClip: (unsigned int)  clipIndex
splitPoint: (int64_t)  splitPoint 

Split the specified clip.

Parameters
clipIndexIndex of clip
splitPointSplit point (in microseconds))The value range is (clip.inpoint, clip.outpoint),Exceeding the value range will cause the cut to fail.
Returns
Determine whether the split is successful, YES is successful for splitting,NO is unsuccessful.

Splitting a clip, that is, an operation of dividing a clip of a specified index value into two clips, the index value of the clip on the corresponding track is also changed accordingly.

An example is as follows:

In the above figure, there are three video clips C1, C2, and C3 on the track, and the clip C2 is splited, and the spilted clips are named C2 and C4, respectively. It's determined whether the segmentation is successful by obtaining the current count of clips on the track. If the segmentation is successful, the C2 and C4 index values correspond to 1 and 2.

The results are as follows:

Warning
This interface will cause the streaming engine state to jump to the state of stopping engine. For details, please refer to The Topic of Changing Engine.
See also
removeClip

Property Documentation

◆ clipCount

- (unsigned int) clipCount
readatomicassign

Count of clips on the track.

◆ duration

- (int64_t) duration
readatomicassign

Duration of track (in microseconds).

◆ index

- (unsigned int) index
readatomicassign

Index of track.

◆ type

- (NvsTrackType) type
readatomicassign

Track type.


The documentation for this class was generated from the following file: