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 ofMediaConvert
.- Author:
- joseross
-
-
Field Summary
Fields Modifier and Type Field Description protected int
partSize
-
Constructor Summary
Constructors Constructor Description MediaConvertImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MediaConvertJob
createMediaConverJob(com.amazonaws.services.mediaconvert.model.CreateJobResult createJobResult, String destination, String key)
Creates an instance ofMediaConvertJob
with the result of the transcoding job creation.protected String
getJobDestination(com.amazonaws.services.mediaconvert.model.JobTemplate jobTemplate)
Extracts the output destination from the transcoding job template settings.protected com.amazonaws.services.mediaconvert.AWSMediaConvert
getMediaConvertClient(MediaConvertProfile profile)
Creates an instance ofAWSMediaConvert
to start the transcoding jobs.protected com.amazonaws.services.s3.AmazonS3
getS3Client(MediaConvertProfile profile)
Creates an instance ofAmazonS3
to upload the files.void
setPartSize(int partSize)
MediaConvertJob
startJob(String filename, InputStream content, MediaConvertProfile profile)
Uploads a file to AWS S3 and starts a transcoding job in AWS MediaConvert.
-
-
-
Method Detail
-
setPartSize
public void setPartSize(int partSize)
-
getS3Client
protected com.amazonaws.services.s3.AmazonS3 getS3Client(MediaConvertProfile profile)
Creates an instance ofAmazonS3
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 ofAWSMediaConvert
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 ofMediaConvertJob
with 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:
startJob
in 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
-
-