Class Transcoder

Description

A Transcoder applies transcoding actions (see TranscodingAction) to content, based on the capabilities of the device that requested the content.

Although the class is pretty generic, the goal of the transcoder within the transcoding library is to transform content that is not suitable for requesting device to content that will provide at least a functional user experience on that device.

The capabilities of the requesting device are retrieved from a device description repository (DDR), accessed through the DDR Simple API. The transcoder provides a Service and an Evidence to the underlying transcoding actions so that they may react consequently.

Located in /common/transcoding/transcoder.php (line 46)


	
			
Method Summary
A __construct (Service $service)
string apply (string $content, Evidence $evidence)
TranscodingAction newTranscodingAction (string $actionName)
Methods
Constructor __construct (line 69)

Creates an empty transcoder associated with a DDR service.

The transcoding actions that the transcoder needs to apply to content should be added through one or more calls to addTranscodingAction().

  • return: new empty transcoder.
  • exception: SystemException The given service is invalid.
  • access: public
A __construct (Service $service)
  • Service $service: The DDR service to use to retrieve the capabilities of the requesting device.
addTranscodingAction (line 127)

Adds a transcoding action to the set.

  • exception: SystemException The transcoding action is not valid.
  • access: public
void addTranscodingAction (TranscodingAction $action)
apply (line 151)

Applies all the transcoding actions to the given content, one at a turn, in the order in which they were added to the transcoder.

  • return: The transcoded content.
  • exception: SystemException The evidence is not valid.
  • access: public
string apply (string $content, Evidence $evidence)
  • string $content: The content to be modified.
  • Evidence $evidence: The evidence that identifies the requesting device.
newTranscodingAction (line 102)

Factory method that creates a transcoding action from the given name that will use the transcoder's DDR service to resolve the requesting device's capabilities.

Please note that the created transcoding action is not automatically added to the transcoder. A subsequent call to addTranscodingAction() is required for that to happen.

  • return: A new instance of the requested transcoding action.
  • exception: SystemException The transcoding action could not be created.
  • access: public
TranscodingAction newTranscodingAction (string $actionName)
  • string $actionName: The name of the transcoding action class. The method will try to include the file 'transcodingaction' + $actionName + '.php' but will not fail if it does not exist.

Documentation generated on Tue, 17 Nov 2009 19:00:40 +0100 by phpDocumentor 1.4.2