Search in sources :

Example 1 with HypotheticalResult

use of net.pms.dlna.DLNAImageProfile.HypotheticalResult in project UniversalMediaServer by UniversalMediaServer.

the class DLNAResource method getDlnaContentFeatures.

public String getDlnaContentFeatures(DLNAImageProfile profile, boolean thumbnailRequest) {
    StringBuilder sb = new StringBuilder();
    if (profile != null) {
        sb.append("DLNA.ORG_PN=").append(profile);
    }
    ImageInfo thumbnailImageInfo = this.thumbnailImageInfo != null ? this.thumbnailImageInfo : getMedia() != null && getMedia().getThumb() != null ? getMedia().getThumb().getImageInfo() : null;
    ImageInfo imageInfo = thumbnailRequest ? thumbnailImageInfo : media != null ? media.getImageInfo() : null;
    if (profile != null && !thumbnailRequest && thumbnailImageInfo != null && profile.useThumbnailSource(imageInfo, thumbnailImageInfo)) {
        imageInfo = thumbnailImageInfo;
    }
    if (profile != null && imageInfo != null) {
        HypotheticalResult hypotheticalResult = profile.calculateHypotheticalProperties(imageInfo);
        if (sb.length() > 0) {
            sb.append(';');
        }
        sb.append("DLNA.ORG_CI=").append(hypotheticalResult.conversionNeeded ? "1" : "0");
    }
    if (sb.length() > 0) {
        sb.append(';');
    }
    sb.append("DLNA.ORG_FLAGS=00900000000000000000000000000000");
    return sb.toString();
}
Also used : HypotheticalResult(net.pms.dlna.DLNAImageProfile.HypotheticalResult) ImageInfo(net.pms.image.ImageInfo)

Aggregations

HypotheticalResult (net.pms.dlna.DLNAImageProfile.HypotheticalResult)1 ImageInfo (net.pms.image.ImageInfo)1