* use ASO bindings for the multi-stream objects to make it easier to use

This commit is contained in:
Reinhard Pointner 2013-07-13 17:13:07 +00:00
parent ccd96ae5be
commit 483d5d3e76
1 changed files with 15 additions and 6 deletions

View File

@ -578,20 +578,20 @@ public class MediaBindingBean {
@Define("videos") @Define("videos")
public List<Map<String, String>> getVideoInfoList() { public List<AssociativeScriptObject> getVideoInfoList() {
return getMediaInfo().snapshot().get(StreamKind.Video); return createMapBindingsList(getMediaInfo().snapshot().get(StreamKind.Video));
} }
@Define("audios") @Define("audios")
public List<Map<String, String>> getAudioInfoList() { public List<AssociativeScriptObject> getAudioInfoList() {
return getMediaInfo().snapshot().get(StreamKind.Audio); return createMapBindingsList(getMediaInfo().snapshot().get(StreamKind.Audio));
} }
@Define("texts") @Define("texts")
public List<Map<String, String>> getTextInfoList() { public List<AssociativeScriptObject> getTextInfoList() {
return getMediaInfo().snapshot().get(StreamKind.Text); return createMapBindingsList(getMediaInfo().snapshot().get(StreamKind.Text));
} }
@ -834,6 +834,15 @@ public class MediaBindingBean {
} }
private List<AssociativeScriptObject> createMapBindingsList(List<Map<String, String>> mapList) {
List<AssociativeScriptObject> bindings = new ArrayList<AssociativeScriptObject>();
for (Map<?, ?> it : mapList) {
bindings.add(createMapBindings(it));
}
return bindings;
}
private String crc32(File file) throws IOException, InterruptedException { private String crc32(File file) throws IOException, InterruptedException {
// try to get checksum from cache // try to get checksum from cache
Cache cache = Cache.getCache("checksum"); Cache cache = Cache.getCache("checksum");