Class MediaConvertImpl

java.lang.Object
org.craftercms.studio.impl.v1.aws.mediaconvert.MediaConvertImpl
All Implemented Interfaces:
MediaConvert

public class MediaConvertImpl extends Object implements MediaConvert
Default implementation of MediaConvert.
Author:
joseross
  • Field Details

    • partSize

      protected int partSize
  • Constructor Details

    • MediaConvertImpl

      public MediaConvertImpl()
  • Method Details

    • setPartSize

      public void setPartSize(int partSize)
    • getS3Client

      protected com.amazonaws.services.s3.AmazonS3 getS3Client(MediaConvertProfile profile)
      Creates an instance of AmazonS3 to upload the files.
      Parameters:
      profile - AWS profile
      Returns:
      an S3 client
    • getMediaConvertClient

      protected com.amazonaws.services.mediaconvert.AWSMediaConvert getMediaConvertClient(MediaConvertProfile profile)
      Creates an instance of AWSMediaConvert to start the transcoding jobs.
      Parameters:
      profile - AWS profile
      Returns:
      a MediaConvert client
    • createMediaConverJob

      protected MediaConvertJob createMediaConverJob(com.amazonaws.services.mediaconvert.model.CreateJobResult createJobResult, String destination, String key)
      Creates an instance of MediaConvertJob with the result of the transcoding job creation.
      Parameters:
      createJobResult - result from the MediaConvert client
      destination - output destination of the job
      key - base filename for the output
      Returns:
      result of the transcoding job
    • startJob

      public MediaConvertJob startJob(String filename, InputStream content, MediaConvertProfile profile) throws AwsException
      Uploads a file to AWS S3 and starts a transcoding job in AWS MediaConvert.
      Specified by:
      startJob in interface MediaConvert
      Parameters:
      filename - name of the file to upload
      content - stream providing the content of the file to upload
      profile - profile used to create the transcoding job
      Returns:
      information of the transcoding job
      Throws:
      AwsException - if the upload or transcoding job creation fails
    • getJobDestination

      protected String getJobDestination(com.amazonaws.services.mediaconvert.model.JobTemplate jobTemplate)
      Extracts the output destination from the transcoding job template settings.
      Parameters:
      jobTemplate - the job template used
      Returns:
      the output destination