Search in sources :

Example 1 with Media

use of serializers.avro.media.Media in project jvm-serializers by eishay.

the class AvroTransformer method forwardMedia.

private Media forwardMedia(data.media.Media media) {
    Media m = new Media();
    m.setUri(media.uri);
    m.setTitle(media.title);
    m.setWidth(media.width);
    m.setHeight(media.height);
    m.setFormat(media.format);
    m.setDuration(media.duration);
    m.setSize(media.size);
    if (media.hasBitrate) {
        m.setBitrate(media.bitrate);
    }
    GenericArray<CharSequence> persons = new GenericData.Array<CharSequence>(media.persons.size(), Avro.Media.sPersons);
    for (String s : media.persons) {
        persons.add(s);
    }
    m.setPersons(persons);
    m.setPlayer(forwardPlayer(media.player));
    m.setCopyright(media.copyright);
    return m;
}
Also used : GenericArray(org.apache.avro.generic.GenericArray) Media(serializers.avro.media.Media)

Aggregations

GenericArray (org.apache.avro.generic.GenericArray)1 Media (serializers.avro.media.Media)1