com.aliyun.svideosdk.crop

## Interface AliyunICrop

-     public interface AliyunICrop

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cancel()` Cancels cropping.
    `void` | `dispose()` Releases resources.
    `long` | `getVideoDuration(java.lang.String videoPath)` Gets the duration of a video.
    `void` | `setCropCallback(CropCallback callback)` Sets the callback of cropping.
    `int` | `setCropParam(CropParam param)` Sets cropping parameters.
    `void` | `setUseHW(boolean hwDecoder)` Enables or disables hardware decoding.
    `int` | `startCrop()` Starts cropping.
    `int` | `startCropAudio(java.lang.String inputPath, java.lang.String outputPath, long startTimeUs, long endTimeUs)` Crops an audio file.
    `int` | `startCropAudio(java.lang.String inputPath, java.lang.String outputPath, long startTime, long endTime, java.util.concurrent.TimeUnit timeUnit)` Crops an audio file.
    `java.lang.String` | `version()` Gets the SDK version.

- - ### Method Detail

    - #### startCrop

          int startCrop()

      Starts cropping.
      Returns:
        0 if the invocation is successful or an error code if the invocation fails. A successful invocation does not indicate that the cropping process is successful.
      See Also:
        `CropCallback`

    - #### startCropAudio

          int startCropAudio(java.lang.String inputPath,
                             java.lang.String outputPath,
                             long startTimeUs,
                             long endTimeUs)

      Crops an audio file.
      Parameters:
        `startTimeUs` - The start time of the audio in microseconds.
        `endTimeUs` - The end time of the audio in microseconds.
      Returns:
        0 if the invocation is successful or an error code if the invocation fails. A successful invocation does not indicate that the cropping process is successful.
      See Also:
        `CropCallback`

    - #### startCropAudio

          int startCropAudio(java.lang.String inputPath,
                             java.lang.String outputPath,
                             long startTime,
                             long endTime,
                             java.util.concurrent.TimeUnit timeUnit)

      Crops an audio file.

      Added in v3.27.0

      Parameters:
        `startTime` - The start time of the audio.
        `endTime` - The end time of the audio .
        `timeUnit` - The time unit
      Returns:
        0 if the invocation is successful or an error code if the invocation fails. A successful invocation does not indicate that the cropping process is successful.
      See Also:
        `CropCallback`

    - #### setCropParam

          int setCropParam(CropParam param)

      Sets cropping parameters.
      Parameters:
        `param` -
      See Also:
        `CropParam`

    - #### setUseHW

          void setUseHW(boolean hwDecoder)

      Enables or disables hardware decoding. Default is to enable hardware decoding.
      Parameters:
        `hwDecoder` - A value of true indicates enable hardware decoding.

    - #### setCropCallback

          void setCropCallback(CropCallback callback)

      Sets the callback of cropping.
      Parameters:
        `callback` -
      See Also:
        `CropCallback`

    - #### cancel

          void cancel()

      Cancels cropping.

    - #### dispose

          void dispose()

      Releases resources.

    - #### getVideoDuration

          long getVideoDuration(java.lang.String videoPath)
                         throws java.lang.Exception

      Gets the duration of a video.
      Parameters:
        `videoPath` -
      Returns:
        The video duration.
      Throws:
        `java.lang.Exception`

    - #### version

          java.lang.String version()

      Gets the SDK version.
      Returns:
        The SDK version.