|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MediaHandler
API for performing operations on media items.
This is the main API Matte uses for processing media items. It serves primarily to allow Matte to:
createNewMediaItem(File)
method.handleMediaRequest(MediaItem, MediaRequest, MediaResponse)
method.
Method Summary | |
---|---|
MediaItem |
createNewMediaItem(java.io.File inputFile)
Create a new instance of MediaItem from a File. |
MediaEffect |
getEffect(java.lang.String key,
java.util.Map<java.lang.String,?> effectParameters)
Get a MediaEffect instance for a specific key. |
java.lang.String |
getFileExtension(MediaItem item,
MediaRequest request)
Get the preferred file extension for this handler. |
void |
handleMediaRequest(MediaItem item,
MediaRequest request,
MediaResponse response)
Handle a media request by processing the specified media item and writing the result to MediaResponse.getOutputStream() . |
Method Detail |
---|
MediaItem createNewMediaItem(java.io.File inputFile)
This method will be called when a new media item is to be
added into Matte. This method should populate as much information
as it can extract from the file into a MediaItem
instance,
including populating any Metadata
it can extract from the file.
This method does not need to persist the MediaItem
instance,
just populate it and return it.
inputFile
- the file to create the media item from
java.lang.String getFileExtension(MediaItem item, MediaRequest request)
Some handlers might return a different file extension for a given request then the default file extension for their type (for example a PNG image handler that returns JPEG images when resizing the images.
item
- the media item to processrequest
- the request
MediaEffect getEffect(java.lang.String key, java.util.Map<java.lang.String,?> effectParameters)
Implementaions must define the keys they support, and define the parameters that go with it.
key
- the key of the desired effecteffectParameters
- a Map of parameters (optional)
void handleMediaRequest(MediaItem item, MediaRequest request, MediaResponse response)
MediaResponse.getOutputStream()
.
item
- the media item to processrequest
- the requestresponse
- the response
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |