MeiCam SDK For Android  3.10.0
Public Member Functions | List of all members
com.meicam.sdk.NvsTrack Class Reference

Track,the container of Clips. More...

Inheritance diagram for com.meicam.sdk.NvsTrack:
com.meicam.sdk.NvsObject com.meicam.sdk.NvsAudioTrack com.meicam.sdk.NvsVideoTrack

Public Member Functions

int getType ()
 Get track type. More...
 
int getIndex ()
 Gets track index. More...
 
long getDuration ()
 Gets track length. More...
 
int getClipCount ()
 Gets the number of clips on the track. More...
 
long changeInPoint (int clipIndex, long newInPoint)
 Modifies the clip's in-point on 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...
 
long changeOutPoint (int clipIndex, long newOutPoint)
 Modifies the clip's out-point on 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...
 
boolean splitClip (int clipIndex, long splitPoint)
 Splits the specified clip. More...
 
boolean removeClip (int clipIndex, boolean keepSpace)
 Removes the specified clip.You are not allowed to remove the opening and ending of a theme. More...
 
boolean removeRange (long startTimelinePos, long endTimelinePos, boolean keepSpace)
 Removes all clips within the specified interval, and adjust the timeline in-point or out-point if the clip only partially overlaps the 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...
 
boolean moveClip (int clipIndex, int destClipIndex)
 Moving the specified clip, swapping the two positions of the input, affects the arrangement of the clip on the timeline.,clipIndex and destClipIndex cannot be equal to clipCount. More...
 
boolean moveClip (int clipIndex, long targetTimelinePos, boolean isInsertTarget, boolean 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...
 
boolean removeAllClips ()
 Removes all the clips. More...
 
void setVolumeGain (float leftVolumeGain, float rightVolumeGain)
 Sets the volume. The final volume value is the track volume Multiplied by the clip volume. More...
 
NvsVolume getVolumeGain ()
 Get the volume information. The final volume value is the track volume Multiplied by the clip volume. More...
 
- Public Member Functions inherited from com.meicam.sdk.NvsObject
void setAttachment (String key, Object value)
 Adds additional data to the NvsObject object to identify the NvsObject object or for other purpose. More...
 
void setTemplateAttachment (String key, String value)
 Adds additional template data to the NvsObject object to identify the NvsObject template object. More...
 
Object getAttachment (String key)
 Gets an attachment to NvsObject. More...
 
String getTemplateAttachment (String key)
 Gets an template attachment to NvsObject. More...
 

Static Public Attributes

Track type

static final int TRACK_TYPE_VIDEO = 0
 Video track. More...
 
static final int TRACK_TYPE_AUDIO = 1
 Audio track. More...
 
- Static Public Attributes inherited from com.meicam.sdk.NvsObject
static final String TEMPLATE_KEY_REPLACE_ID = "MSTemplate-ReplaceId"
 
static final String TEMPLATE_KEY_FOOTAGE_CAN_REPLACE = "MSTemplate-FootageCanReplace"
 
static final String TEMPLATE_KEY_FOOTAGE_ID = "MSTemplate-FootageId"
 
static final String TEMPLATE_KEY_FOOTAGE_NAME = "MSTemplate-FootageName"
 
static final String TEMPLATE_KEY_FOOTAGE_M3U8_NAME = "MSTemplate-FootageM3U8Name"
 
static final String TEMPLATE_KEY_FOOTAGE_TAGS = "MSTemplate-FootageTags"
 
static final String TEMPLATE_KEY_FOOTAGE_TYPE = "MSTemplate-FootageType"
 
static final String TEMPLATE_KEY_FOOTAGE_NEED_REVERSE = "MSTemplate-FootageNeedReverse"
 
static final String TEMPLATE_KEY_CLIP_RAW_WIDTH = "MSTemplate-ClipRawWidth"
 
static final String TEMPLATE_KEY_CLIP_RAW_HEIGHT = "MSTemplate-ClipRawHeight"
 
static final String TEMPLATE_KEY_VOLUME_TYPE = "MSTemplate-VolumeType"
 
static final String TEMPLATE_KEY_FX_GROUP = "MSTemplate-FxGroup"
 
static final String TEMPLATE_KEY_BEST_SEEK_TIME = "MSTemplate-BestSeekTime"
 
static final String TEMPLATE_KEY_MASK_TYPE = "MSTemplate-MaskType"
 
static final String TEMPLATE_VALUE_MASK_TYPE_LINE = "MSTemplate-MaskType-Line"
 
static final String TEMPLATE_VALUE_MASK_TYPE_MIRROR = "MSTemplate-MaskType-Mirror"
 
static final String TEMPLATE_VALUE_MASK_TYPE_CIRCLE = "MSTemplate-MaskType-Circle"
 
static final String TEMPLATE_VALUE_MASK_TYPE_RECT = "MSTemplate-MaskType-Rect"
 
static final String TEMPLATE_VALUE_MASK_TYPE_HEART = "MSTemplate-MaskType-Heart"
 
static final String TEMPLATE_VALUE_MASK_TYPE_STAR = "MSTemplate-MaskType-Star"
 
static final String TEMPLATE_KEY_TRANS_TYPE_CUT = "MSTemplate-TransType-Cut"
 
static final String TEMPLATE_KEY_CURVE_SPEED_TYPE = "MSTemplate-CurveSpeedType"
 
static final String TEMPLATE_VALUE_CURVE_SPEED_TYPE_CUSTOM = "MSTemplate-CurveSpeedType-Custom"
 
static final String TEMPLATE_VALUE_CURVE_SPEED_TYPE_MONTAGE = "MSTemplate-CurveSpeedType-Montage"
 
static final String TEMPLATE_VALUE_CURVE_SPEED_TYPE_HERO = "MSTemplate-CurveSpeedType-Hero"
 
static final String TEMPLATE_VALUE_CURVE_SPEED_TYPE_BULLET = "MSTemplate-CurveSpeedType-bullet"
 
static final String TEMPLATE_VALUE_CURVE_SPEED_TYPE_PLUS = "MSTemplate-CurveSpeedType-Plus"
 
static final String TEMPLATE_VALUE_CURVE_SPEED_TYPE_IN = "MSTemplate-CurveSpeedType-In"
 
static final String TEMPLATE_VALUE_CURVE_SPEED_TYPE_OUT = "MSTemplate-CurveSpeedType-Out"
 

Additional Inherited Members

- Protected Member Functions inherited from com.meicam.sdk.NvsObject
void setInternalObject (long internalObject)
 
long getInternalObject ()
 
- Protected Attributes inherited from com.meicam.sdk.NvsObject
long m_internalObject = 0
 

Detailed Description

Track,the container of Clips.

A track can be thought of as a collection of clips, divided into an audio track (Audio Track) and a video track (Video Track). After creating a timeline instance, you can add or remove multiple tracks. On each track, you can add multiple video/audio clips to edit, set the volume to the clip,remove the clip and move clip's position.

Warning
In the NvsTrack class, all public APIs are used in the UI thread! ! !

Member Function Documentation

◆ changeInPoint()

long com.meicam.sdk.NvsTrack.changeInPoint ( int  clipIndex,
long  newInPoint 
)
inline

Modifies the clip's in-point on 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
clipIndexClip Index.
newInPointThe new in-point value on the timeline (in microseconds).
Returns
Returns the in-point (in microseconds) on the actual reachable timeline. Note: The in-point range on the actual achievable timeline is within the open interval of the timeline out-point of the previous clip and the timeline out-point of the clip.
Warning
This interface will cause the streaming engine state to jump to the engine stop state, refer to Engine Change Feature for details.
Since
1.6.0
See also
changeOutPoint

◆ changeOutPoint()

long com.meicam.sdk.NvsTrack.changeOutPoint ( int  clipIndex,
long  newOutPoint 
)
inline

Modifies the clip's out-point on 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
clipIndexClip Index.
newOutPointThe new out-point on the timeline (in microseconds).
Returns
Returns the out-point (in microseconds) on the actual reachable timeline. Note: The out-point range on the actual achievable timeline is within the open interval of the timeline in-point of the clip and the next out-point of the clip.
Warning
This interface will cause the streaming engine state to jump to the engine stop state, refer to Engine Change Feature for details.
Since
1.6.0
See also
changeOutPoint

◆ getClipCount()

int com.meicam.sdk.NvsTrack.getClipCount ( )
inline

Gets the number of clips on the track.

Returns
Returns the number of clips on the track.

◆ getDuration()

long com.meicam.sdk.NvsTrack.getDuration ( )
inline

Gets track length.

Returns
Returns the length of the track (in microseconds).

◆ getIndex()

int com.meicam.sdk.NvsTrack.getIndex ( )
inline

Gets track index.

Returns
Returns track index.

◆ getType()

int com.meicam.sdk.NvsTrack.getType ( )
inline

Get track type.

Returns
Returns track type.

◆ getVolumeGain()

NvsVolume com.meicam.sdk.NvsTrack.getVolumeGain ( )
inline

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

Returns
Returns the volume object.
See also
setVolumeGain

◆ moveClip() [1/2]

boolean com.meicam.sdk.NvsTrack.moveClip ( int  clipIndex,
int  destClipIndex 
)
inline

Moving the specified clip, swapping the two positions of the input, affects the arrangement of the clip on the timeline.,clipIndex and destClipIndex cannot be equal to clipCount.

Parameters
clipIndexThe clip index that needs to be moved
destClipIndexTarget index of th clip move to.
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.

◆ moveClip() [2/2]

boolean com.meicam.sdk.NvsTrack.moveClip ( int  clipIndex,
long  targetTimelinePos,
boolean  isInsertTarget,
boolean  keepSpace 
)
inline

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()

boolean com.meicam.sdk.NvsTrack.removeAllClips ( )
inline

Removes all the clips.

Returns
Determine if the removal is successful. True means the removal is successful and false the opposite.
Warning
This interface will cause the streaming engine state to jump to the engine stop state, refer to Engine Change Feature for details.
See also
removeClip

◆ removeClip()

boolean com.meicam.sdk.NvsTrack.removeClip ( int  clipIndex,
boolean  keepSpace 
)
inline

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

Parameters
clipIndexClip index.
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. True means the removal is successful and false the opposite.
Warning
This interface will cause the streaming engine state to jump to the engine stop state, refer to Engine Change Feature for details.
See also
removeAllClips

◆ removeRange()

boolean com.meicam.sdk.NvsTrack.removeRange ( long  startTimelinePos,
long  endTimelinePos,
boolean  keepSpace 
)
inline

Removes all clips within the specified interval, and adjust the timeline in-point or out-point if the clip only partially overlaps the 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
startTimelinePosStart timeline position of the interval (in microseconds).
endTimelinePosEnd timeline position of the interval (in microseconds).
keepSpaceAfter the clip 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
Whether the removal was successful or not. True means the removal is successful and false the opposite.
Warning
This interface will cause the streaming engine state to jump to the engine stop state, refer to Engine Change Feature for details.

◆ setVolumeGain()

void com.meicam.sdk.NvsTrack.setVolumeGain ( float  leftVolumeGain,
float  rightVolumeGain 
)
inline

Sets the volume. The final volume value is the track volume Multiplied by the clip volume.

Parameters
leftVolumeGainLeft volume value, value ranges from [0, 8).
rightVolumeGainRight volume value, value ranges from [0, 8).
See also
getVolumeGain

◆ splitClip()

boolean com.meicam.sdk.NvsTrack.splitClip ( int  clipIndex,
long  splitPoint 
)
inline

Splits the specified clip.

Parameters
clipIndexClip index.
splitPointSpliting point (in microseconds).The value range is (clip.inpoint, clip.outpoint),Exceeding the value range will cause the cut to fail. 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.

Examples are 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 splited clips are named C2 and C4, respectively. Determine whether the split is successful by obtaining the current number of clips on the track. If the split is successful, the C2 and C4 index values correspond to 1 and 2.

The result is as follows:

Warning
This interface will cause the streaming engine state to jump to the engine stop state, refer to Engine Change Feature for details.
See also
removeClip

Member Data Documentation

◆ TRACK_TYPE_AUDIO

final int com.meicam.sdk.NvsTrack.TRACK_TYPE_AUDIO = 1
static

Audio track.

◆ TRACK_TYPE_VIDEO

final int com.meicam.sdk.NvsTrack.TRACK_TYPE_VIDEO = 0
static

Video track.


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