Class MediaConvertImpl
java.lang.Object
org.craftercms.studio.impl.v1.aws.mediaconvert.MediaConvertImpl
- All Implemented Interfaces:
MediaConvert
Default implementation of
MediaConvert.- Author:
- joseross
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected MediaConvertJobcreateMediaConverJob(com.amazonaws.services.mediaconvert.model.CreateJobResult createJobResult, String destination, String key) Creates an instance ofMediaConvertJobwith the result of the transcoding job creation.protected StringgetJobDestination(com.amazonaws.services.mediaconvert.model.JobTemplate jobTemplate) Extracts the output destination from the transcoding job template settings.protected com.amazonaws.services.mediaconvert.AWSMediaConvertgetMediaConvertClient(MediaConvertProfile profile) Creates an instance ofAWSMediaConvertto start the transcoding jobs.protected com.amazonaws.services.s3.AmazonS3getS3Client(MediaConvertProfile profile) Creates an instance ofAmazonS3to upload the files.voidsetPartSize(int partSize) startJob(String filename, InputStream content, MediaConvertProfile profile) Uploads a file to AWS S3 and starts a transcoding job in AWS MediaConvert.
-
Field Details
-
partSize
protected int partSize
-
-
Constructor Details
-
MediaConvertImpl
public MediaConvertImpl()
-
-
Method Details
-
setPartSize
public void setPartSize(int partSize) -
getS3Client
Creates an instance ofAmazonS3to upload the files.- Parameters:
profile- AWS profile- Returns:
- an S3 client
-
getMediaConvertClient
protected com.amazonaws.services.mediaconvert.AWSMediaConvert getMediaConvertClient(MediaConvertProfile profile) Creates an instance ofAWSMediaConvertto 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 ofMediaConvertJobwith the result of the transcoding job creation.- Parameters:
createJobResult- result from the MediaConvert clientdestination- output destination of the jobkey- 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:
startJobin interfaceMediaConvert- Parameters:
filename- name of the file to uploadcontent- stream providing the content of the file to uploadprofile- 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
-