Project

General

Profile

feature request #9009

Add structure to store media metadata

Added by Andreas Kohlbecker 2 months ago. Updated 10 days ago.

Status:
Closed
Priority:
Highest
Category:
cdm
Target version:
Start date:
05/11/2020
Due date:
% Done:

100%

Severity:
normal

Description

Media files can contain metadata (Exif, IPCT, PhotoshopMetadata, etc). The Cdm needs to be able to store data extracted from a media file to avoid fetching and analyzingthe file each time it's metadata is requested.

The data structure will be a cache for


ImageInfo info = new ImageInfo(URI imageUri);
info.getMetaData();
info.getWidth();
info.getHeight();
// etc ...

Since the ImageInfo is fetched for each media URI individually the metadata cache should also extend the MediaRepresentationPart.

Structure of the metadata could be a flat key/value pair list like a Map<String,String>.

Now that ImageInfo and MediaInfo are returning also typed information like width, height, etc it could beneficial to use typed keys and predefined keys with specific types for e.g. with, length, etc ...:

public class MetaDataMap extends HashMap<MetaDataType<T>, T>{

    public static class MetaDataType<T extends Object> {

        public static final MetaDataType<String> stringType = new MetaDataType<String>(String.class);
        public static final MetaDataType<Integer> integerType = new MetaDataType<Integer>(Integer.class);
        public static final MetaDataType<Double> doubleType = new MetaDataType<Double>(Double.class);

        Class<T> type;
        T value;

        private MetaDataType(Class<T> type) {
            this.type = type;
        }

        public void setValue(T value) {
            this.value = value;
        }

        public T getValue() {
            return value;
        }

        public Class<T> getType(){
            return type;
        }

        public boolean hasType(Class otherType) {
            return type.equals(otherType);
        }

    }

    enum MetaDataKey {

        WIDTH(MetaDataMap.MetaDataType.stringType),
        HEIGHT(MetaDataMap.MetaDataType.integerType),
        DURATION(MetaDataMap.MetaDataType.doubleType);

        MetaDataType<?> type;

        private MetaDataKey(MetaDataMap.MetaDataType<?> type){
            this.type = type;
        }
    }
}

Associated revisions

Revision 72032e83 (diff)
Added by Andreas Müller about 1 month ago

fix #9009 add MediaMetaData

Revision 8147e611 (diff)
Added by Andreas Müller about 1 month ago

fix #9009 add MediaMetaData (cont.)

Revision 66f2a16f (diff)
Added by Andreas Müller about 1 month ago

fix #9009 fixing test schemas for MediaMetaData

Revision e59aa8bb (diff)
Added by Andreas Kohlbecker 10 days ago

ref #9009 updating class doc regarding auditing

History

#1 Updated by Andreas Müller 2 months ago

  • Target version changed from CDM UML 5.5 to CDM UML 5.15

#2 Updated by Andreas Müller 2 months ago

  • Priority changed from New to Highest

#3 Updated by Andreas Müller about 2 months ago

as size information like width and height is already stored in MediaRepresentationPart it is not necessary to store such data in the new class. A pure String based key-value implementation extending CdmBase should be enought. Also versioning is not necessary as the data should be available from the external files if necessary.

#4 Updated by Andreas Müller about 1 month ago

  • Status changed from New to In Progress

#5 Updated by Andreas Müller about 1 month ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 50

#6 Updated by Andreas Müller 27 days ago

  • Assignee changed from Andreas Müller to Andreas Kohlbecker
  • % Done changed from 50 to 0

Please review

#7 Updated by Andreas Kohlbecker 10 days ago

  • Status changed from Resolved to Closed
  • Assignee changed from Andreas Kohlbecker to Andreas Müller
  • % Done changed from 0 to 100

The type level java doc regarding auditing was not up to date. I changed this and the ticket can be closed.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)