ObjectAttribute objectAttribute) throws XDIMEException {
MarinerPageContext pageContext = ContextInternals.
getMarinerPageContext(context.getInitialRequestContext());
InternalDevice device = pageContext.getDevice();
Map inputParameters = new HashMap();
int maxSize = device
.getIntegerPolicyValue(DOWNLOADABLE_VIDEO_MAXSIZE_POLICY, 0);
if (maxSize != 0) {
inputParameters.put(MAP_MAX_VIDEO_SIZE,
Integer.toString(maxSize));
}
List params = device
.getCommaSeparatedPolicyValues(
DOWNLOADABLE_VIDEO_PREFERENCE_ORDER_POLICY);
if (!params.isEmpty()) {
String param = (String) params.get(0);
Object[] formatParams = new Object[]{param};
String visualCodec = device
.getPolicyValue(MessageFormat.format(
DOWNLOADABLE_VIDEO_X_VISUAL_CODEC_POLICY,
formatParams));
if (visualCodec != null) {
inputParameters.put(MAP_VIDEO_VISUAL_CODEC,
visualCodec);
}
String audioCodec = device
.getPolicyValue(MessageFormat.format(
DOWNLOADABLE_VIDEO_X_AUDIO_CODEC_POLICY,
formatParams));
if (audioCodec != null) {
inputParameters.put(MAP_VIDEO_AUDIO_CODEC,
audioCodec);
}
}
int frameRate = device
.getIntegerPolicyValue(DOWNLOADABLE_VIDEO_VISUAL_FRAMERATE_POLICY, 0);
if (frameRate != 0) {
inputParameters.put(MAP_VIDEO_FRAME_RATE,
Integer.toString(frameRate));
}
int width = device
.getIntegerPolicyValue(DOWNLOADABLE_VIDEO_PIXELSX_POLICY,
device.getPixelsX());
if (width != 0) {
inputParameters.put(MAP_VIDEO_WIDTH,
Integer.toString(width));
}
int height = device
.getIntegerPolicyValue(DOWNLOADABLE_VIDEO_PIXELSY_POLICY,
device.getPixelsY());
if (height != 0) {
inputParameters.put(MAP_VIDEO_HEIGHT,
Integer.toString(height));
}
int maxVisualBitRate = device
.getIntegerPolicyValue(DOWNLOADABLE_VIDEO_VISUAL_MAXBITRATE_POLICY, 0);
if (maxVisualBitRate != 0) {
inputParameters.put(MAP_MAX_VIDEO_VISUAL_BIT_RATE,
Integer.toString(maxVisualBitRate));
}
int maxAudioBitRate = device
.getIntegerPolicyValue(DOWNLOADABLE_VIDEO_AUDIO_MAXBITRATE_POLICY, 0);
if (maxAudioBitRate != 0) {
inputParameters.put(MAP_MAX_VIDEO_AUDIO_BIT_RATE,
Integer.toString(maxAudioBitRate));
}