com.google.android.exoplayer2.metadata.id3.TextInformationFrame Java Examples

The following examples show how to use com.google.android.exoplayer2.metadata.id3.TextInformationFrame. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MetadataUtil.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
@Nullable
private static Id3Frame parseUint8Attribute(
    int type,
    String id,
    ParsableByteArray data,
    boolean isTextInformationFrame,
    boolean isBoolean) {
  int value = parseUint8AttributeValue(data);
  if (isBoolean) {
    value = Math.min(1, value);
  }
  if (value >= 0) {
    return isTextInformationFrame
        ? new TextInformationFrame(id, /* description= */ null, Integer.toString(value))
        : new CommentFrame(LANGUAGE_UNDEFINED, id, Integer.toString(value));
  }
  Log.w(TAG, "Failed to parse uint8 attribute: " + Atom.getAtomTypeString(type));
  return null;
}
 
Example #2
Source File: MetadataUtil.java    From K-Sonic with MIT License 6 votes vote down vote up
private static TextInformationFrame parseIndexAndCountAttribute(int type, String attributeName,
    ParsableByteArray data) {
  int atomSize = data.readInt();
  int atomType = data.readInt();
  if (atomType == Atom.TYPE_data && atomSize >= 22) {
    data.skipBytes(10); // version (1), flags (3), empty (4), empty (2)
    int index = data.readUnsignedShort();
    if (index > 0) {
      String value = "" + index;
      int count = data.readUnsignedShort();
      if (count > 0) {
        value += "/" + count;
      }
      return new TextInformationFrame(attributeName, null, value);
    }
  }
  Log.w(TAG, "Failed to parse index/count attribute: " + Atom.getAtomTypeString(type));
  return null;
}
 
Example #3
Source File: MetadataUtil.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
@Nullable
private static Id3Frame parseUint8Attribute(
    int type,
    String id,
    ParsableByteArray data,
    boolean isTextInformationFrame,
    boolean isBoolean) {
  int value = parseUint8AttributeValue(data);
  if (isBoolean) {
    value = Math.min(1, value);
  }
  if (value >= 0) {
    return isTextInformationFrame
        ? new TextInformationFrame(id, /* description= */ null, Integer.toString(value))
        : new CommentFrame(LANGUAGE_UNDEFINED, id, Integer.toString(value));
  }
  Log.w(TAG, "Failed to parse uint8 attribute: " + Atom.getAtomTypeString(type));
  return null;
}
 
Example #4
Source File: MetadataUtil.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
private static @Nullable TextInformationFrame parseIndexAndCountAttribute(
    int type, String attributeName, ParsableByteArray data) {
  int atomSize = data.readInt();
  int atomType = data.readInt();
  if (atomType == Atom.TYPE_data && atomSize >= 22) {
    data.skipBytes(10); // version (1), flags (3), empty (4), empty (2)
    int index = data.readUnsignedShort();
    if (index > 0) {
      String value = "" + index;
      int count = data.readUnsignedShort();
      if (count > 0) {
        value += "/" + count;
      }
      return new TextInformationFrame(attributeName, /* description= */ null, value);
    }
  }
  Log.w(TAG, "Failed to parse index/count attribute: " + Atom.getAtomTypeString(type));
  return null;
}
 
Example #5
Source File: MetadataUtil.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
private static @Nullable Id3Frame parseUint8Attribute(
    int type,
    String id,
    ParsableByteArray data,
    boolean isTextInformationFrame,
    boolean isBoolean) {
  int value = parseUint8AttributeValue(data);
  if (isBoolean) {
    value = Math.min(1, value);
  }
  if (value >= 0) {
    return isTextInformationFrame
        ? new TextInformationFrame(id, /* description= */ null, Integer.toString(value))
        : new CommentFrame(LANGUAGE_UNDEFINED, id, Integer.toString(value));
  }
  Log.w(TAG, "Failed to parse uint8 attribute: " + Atom.getAtomTypeString(type));
  return null;
}
 
Example #6
Source File: MetadataUtil.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
@Nullable
private static TextInformationFrame parseIndexAndCountAttribute(
    int type, String attributeName, ParsableByteArray data) {
  int atomSize = data.readInt();
  int atomType = data.readInt();
  if (atomType == Atom.TYPE_data && atomSize >= 22) {
    data.skipBytes(10); // version (1), flags (3), empty (4), empty (2)
    int index = data.readUnsignedShort();
    if (index > 0) {
      String value = "" + index;
      int count = data.readUnsignedShort();
      if (count > 0) {
        value += "/" + count;
      }
      return new TextInformationFrame(attributeName, /* description= */ null, value);
    }
  }
  Log.w(TAG, "Failed to parse index/count attribute: " + Atom.getAtomTypeString(type));
  return null;
}
 
Example #7
Source File: MetadataUtil.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
@Nullable
private static Id3Frame parseUint8Attribute(
    int type,
    String id,
    ParsableByteArray data,
    boolean isTextInformationFrame,
    boolean isBoolean) {
  int value = parseUint8AttributeValue(data);
  if (isBoolean) {
    value = Math.min(1, value);
  }
  if (value >= 0) {
    return isTextInformationFrame
        ? new TextInformationFrame(id, /* description= */ null, Integer.toString(value))
        : new CommentFrame(LANGUAGE_UNDEFINED, id, Integer.toString(value));
  }
  Log.w(TAG, "Failed to parse uint8 attribute: " + Atom.getAtomTypeString(type));
  return null;
}
 
Example #8
Source File: MetadataUtil.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
private static @Nullable TextInformationFrame parseIndexAndCountAttribute(
    int type, String attributeName, ParsableByteArray data) {
  int atomSize = data.readInt();
  int atomType = data.readInt();
  if (atomType == Atom.TYPE_data && atomSize >= 22) {
    data.skipBytes(10); // version (1), flags (3), empty (4), empty (2)
    int index = data.readUnsignedShort();
    if (index > 0) {
      String value = "" + index;
      int count = data.readUnsignedShort();
      if (count > 0) {
        value += "/" + count;
      }
      return new TextInformationFrame(attributeName, /* description= */ null, value);
    }
  }
  Log.w(TAG, "Failed to parse index/count attribute: " + Atom.getAtomTypeString(type));
  return null;
}
 
Example #9
Source File: MetadataUtil.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
private static @Nullable Id3Frame parseUint8Attribute(
    int type,
    String id,
    ParsableByteArray data,
    boolean isTextInformationFrame,
    boolean isBoolean) {
  int value = parseUint8AttributeValue(data);
  if (isBoolean) {
    value = Math.min(1, value);
  }
  if (value >= 0) {
    return isTextInformationFrame
        ? new TextInformationFrame(id, /* description= */ null, Integer.toString(value))
        : new CommentFrame(LANGUAGE_UNDEFINED, id, Integer.toString(value));
  }
  Log.w(TAG, "Failed to parse uint8 attribute: " + Atom.getAtomTypeString(type));
  return null;
}
 
Example #10
Source File: MetadataUtil.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
@Nullable
private static TextInformationFrame parseIndexAndCountAttribute(
    int type, String attributeName, ParsableByteArray data) {
  int atomSize = data.readInt();
  int atomType = data.readInt();
  if (atomType == Atom.TYPE_data && atomSize >= 22) {
    data.skipBytes(10); // version (1), flags (3), empty (4), empty (2)
    int index = data.readUnsignedShort();
    if (index > 0) {
      String value = "" + index;
      int count = data.readUnsignedShort();
      if (count > 0) {
        value += "/" + count;
      }
      return new TextInformationFrame(attributeName, /* description= */ null, value);
    }
  }
  Log.w(TAG, "Failed to parse index/count attribute: " + Atom.getAtomTypeString(type));
  return null;
}
 
Example #11
Source File: MetadataUtil.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
@Nullable
private static TextInformationFrame parseIndexAndCountAttribute(
    int type, String attributeName, ParsableByteArray data) {
  int atomSize = data.readInt();
  int atomType = data.readInt();
  if (atomType == Atom.TYPE_data && atomSize >= 22) {
    data.skipBytes(10); // version (1), flags (3), empty (4), empty (2)
    int index = data.readUnsignedShort();
    if (index > 0) {
      String value = "" + index;
      int count = data.readUnsignedShort();
      if (count > 0) {
        value += "/" + count;
      }
      return new TextInformationFrame(attributeName, /* description= */ null, value);
    }
  }
  Log.w(TAG, "Failed to parse index/count attribute: " + Atom.getAtomTypeString(type));
  return null;
}
 
Example #12
Source File: MetadataUtil.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@Nullable
private static TextInformationFrame parseTextAttribute(
    int type, String id, ParsableByteArray data) {
  int atomSize = data.readInt();
  int atomType = data.readInt();
  if (atomType == Atom.TYPE_data) {
    data.skipBytes(8); // version (1), flags (3), empty (4)
    String value = data.readNullTerminatedString(atomSize - 16);
    return new TextInformationFrame(id, /* description= */ null, value);
  }
  Log.w(TAG, "Failed to parse text attribute: " + Atom.getAtomTypeString(type));
  return null;
}
 
Example #13
Source File: MetadataUtil.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@Nullable
private static TextInformationFrame parseStandardGenreAttribute(ParsableByteArray data) {
  int genreCode = parseUint8AttributeValue(data);
  String genreString = (0 < genreCode && genreCode <= STANDARD_GENRES.length)
      ? STANDARD_GENRES[genreCode - 1] : null;
  if (genreString != null) {
    return new TextInformationFrame("TCON", /* description= */ null, genreString);
  }
  Log.w(TAG, "Failed to parse standard genre code");
  return null;
}
 
Example #14
Source File: MetadataUtil.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
@Nullable
private static TextInformationFrame parseTextAttribute(
    int type, String id, ParsableByteArray data) {
  int atomSize = data.readInt();
  int atomType = data.readInt();
  if (atomType == Atom.TYPE_data) {
    data.skipBytes(8); // version (1), flags (3), empty (4)
    String value = data.readNullTerminatedString(atomSize - 16);
    return new TextInformationFrame(id, /* description= */ null, value);
  }
  Log.w(TAG, "Failed to parse text attribute: " + Atom.getAtomTypeString(type));
  return null;
}
 
Example #15
Source File: MetadataUtil.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@Nullable
private static TextInformationFrame parseTextAttribute(
    int type, String id, ParsableByteArray data) {
  int atomSize = data.readInt();
  int atomType = data.readInt();
  if (atomType == Atom.TYPE_data) {
    data.skipBytes(8); // version (1), flags (3), empty (4)
    String value = data.readNullTerminatedString(atomSize - 16);
    return new TextInformationFrame(id, /* description= */ null, value);
  }
  Log.w(TAG, "Failed to parse text attribute: " + Atom.getAtomTypeString(type));
  return null;
}
 
Example #16
Source File: EventLogger.java    From evercam-android with GNU Affero General Public License v3.0 5 votes vote down vote up
private void printMetadata(Metadata metadata, String prefix) {
  for (int i = 0; i < metadata.length(); i++) {
    Metadata.Entry entry = metadata.get(i);
    if (entry instanceof TextInformationFrame) {
      TextInformationFrame textInformationFrame = (TextInformationFrame) entry;
      Log.d(TAG, prefix + String.format("%s: value=%s", textInformationFrame.id,
              textInformationFrame.value));
    } else if (entry instanceof UrlLinkFrame) {
      UrlLinkFrame urlLinkFrame = (UrlLinkFrame) entry;
      Log.d(TAG, prefix + String.format("%s: url=%s", urlLinkFrame.id, urlLinkFrame.url));
    } else if (entry instanceof PrivFrame) {
      PrivFrame privFrame = (PrivFrame) entry;
      Log.d(TAG, prefix + String.format("%s: owner=%s", privFrame.id, privFrame.owner));
    } else if (entry instanceof GeobFrame) {
      GeobFrame geobFrame = (GeobFrame) entry;
      Log.d(TAG, prefix + String.format("%s: mimeType=%s, filename=%s, description=%s",
              geobFrame.id, geobFrame.mimeType, geobFrame.filename, geobFrame.description));
    } else if (entry instanceof ApicFrame) {
      ApicFrame apicFrame = (ApicFrame) entry;
      Log.d(TAG, prefix + String.format("%s: mimeType=%s, description=%s",
              apicFrame.id, apicFrame.mimeType, apicFrame.description));
    } else if (entry instanceof CommentFrame) {
      CommentFrame commentFrame = (CommentFrame) entry;
      Log.d(TAG, prefix + String.format("%s: language=%s, description=%s", commentFrame.id,
              commentFrame.language, commentFrame.description));
    } else if (entry instanceof Id3Frame) {
      Id3Frame id3Frame = (Id3Frame) entry;
      Log.d(TAG, prefix + String.format("%s", id3Frame.id));
    } else if (entry instanceof EventMessage) {
      EventMessage eventMessage = (EventMessage) entry;
      Log.d(TAG, prefix + String.format("EMSG: scheme=%s, id=%d, value=%s",
              eventMessage.schemeIdUri, eventMessage.id, eventMessage.value));
    }
  }
}
 
Example #17
Source File: EventLogger.java    From K-Sonic with MIT License 5 votes vote down vote up
private void printMetadata(Metadata metadata, String prefix) {
  for (int i = 0; i < metadata.length(); i++) {
    Metadata.Entry entry = metadata.get(i);
    if (entry instanceof TextInformationFrame) {
      TextInformationFrame textInformationFrame = (TextInformationFrame) entry;
      Log.d(TAG, prefix + String.format("%s: value=%s", textInformationFrame.id,
              textInformationFrame.value));
    } else if (entry instanceof UrlLinkFrame) {
      UrlLinkFrame urlLinkFrame = (UrlLinkFrame) entry;
      Log.d(TAG, prefix + String.format("%s: url=%s", urlLinkFrame.id, urlLinkFrame.url));
    } else if (entry instanceof PrivFrame) {
      PrivFrame privFrame = (PrivFrame) entry;
      Log.d(TAG, prefix + String.format("%s: owner=%s", privFrame.id, privFrame.owner));
    } else if (entry instanceof GeobFrame) {
      GeobFrame geobFrame = (GeobFrame) entry;
      Log.d(TAG, prefix + String.format("%s: mimeType=%s, filename=%s, description=%s",
              geobFrame.id, geobFrame.mimeType, geobFrame.filename, geobFrame.description));
    } else if (entry instanceof ApicFrame) {
      ApicFrame apicFrame = (ApicFrame) entry;
      Log.d(TAG, prefix + String.format("%s: mimeType=%s, description=%s",
              apicFrame.id, apicFrame.mimeType, apicFrame.description));
    } else if (entry instanceof CommentFrame) {
      CommentFrame commentFrame = (CommentFrame) entry;
      Log.d(TAG, prefix + String.format("%s: language=%s, description=%s", commentFrame.id,
              commentFrame.language, commentFrame.description));
    } else if (entry instanceof Id3Frame) {
      Id3Frame id3Frame = (Id3Frame) entry;
      Log.d(TAG, prefix + String.format("%s", id3Frame.id));
    } else if (entry instanceof EventMessage) {
      EventMessage eventMessage = (EventMessage) entry;
      Log.d(TAG, prefix + String.format("EMSG: scheme=%s, id=%d, value=%s",
              eventMessage.schemeIdUri, eventMessage.id, eventMessage.value));
    }
  }
}
 
Example #18
Source File: MetadataUtil.java    From K-Sonic with MIT License 5 votes vote down vote up
private static TextInformationFrame parseStandardGenreAttribute(ParsableByteArray data) {
  int genreCode = parseUint8AttributeValue(data);
  String genreString = (0 < genreCode && genreCode <= STANDARD_GENRES.length)
      ? STANDARD_GENRES[genreCode - 1] : null;
  if (genreString != null) {
    return new TextInformationFrame("TCON", null, genreString);
  }
  Log.w(TAG, "Failed to parse standard genre code");
  return null;
}
 
Example #19
Source File: MetadataUtil.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@Nullable
private static TextInformationFrame parseStandardGenreAttribute(ParsableByteArray data) {
  int genreCode = parseUint8AttributeValue(data);
  String genreString = (0 < genreCode && genreCode <= STANDARD_GENRES.length)
      ? STANDARD_GENRES[genreCode - 1] : null;
  if (genreString != null) {
    return new TextInformationFrame("TCON", /* description= */ null, genreString);
  }
  Log.w(TAG, "Failed to parse standard genre code");
  return null;
}
 
Example #20
Source File: MetadataUtil.java    From K-Sonic with MIT License 5 votes vote down vote up
private static Id3Frame parseUint8Attribute(int type, String id, ParsableByteArray data,
    boolean isTextInformationFrame, boolean isBoolean) {
  int value = parseUint8AttributeValue(data);
  if (isBoolean) {
    value = Math.min(1, value);
  }
  if (value >= 0) {
    return isTextInformationFrame ? new TextInformationFrame(id, null, Integer.toString(value))
        : new CommentFrame(LANGUAGE_UNDEFINED, id, Integer.toString(value));
  }
  Log.w(TAG, "Failed to parse uint8 attribute: " + Atom.getAtomTypeString(type));
  return null;
}
 
Example #21
Source File: MetadataUtil.java    From K-Sonic with MIT License 5 votes vote down vote up
private static TextInformationFrame parseTextAttribute(int type, String id,
    ParsableByteArray data) {
  int atomSize = data.readInt();
  int atomType = data.readInt();
  if (atomType == Atom.TYPE_data) {
    data.skipBytes(8); // version (1), flags (3), empty (4)
    String value = data.readNullTerminatedString(atomSize - 16);
    return new TextInformationFrame(id, null, value);
  }
  Log.w(TAG, "Failed to parse text attribute: " + Atom.getAtomTypeString(type));
  return null;
}
 
Example #22
Source File: EventLogger.java    From TigerVideo with Apache License 2.0 5 votes vote down vote up
private void printMetadata(Metadata metadata, String prefix) {
    for (int i = 0; i < metadata.length(); i++) {
        Metadata.Entry entry = metadata.get(i);
        if (entry instanceof TextInformationFrame) {
            TextInformationFrame textInformationFrame = (TextInformationFrame) entry;
            Log.d(TAG, prefix + String.format("%s: value=%s", textInformationFrame.id,
                    textInformationFrame.value));
        } else if (entry instanceof UrlLinkFrame) {
            UrlLinkFrame urlLinkFrame = (UrlLinkFrame) entry;
            Log.d(TAG, prefix + String.format("%s: url=%s", urlLinkFrame.id, urlLinkFrame.url));
        } else if (entry instanceof PrivFrame) {
            PrivFrame privFrame = (PrivFrame) entry;
            Log.d(TAG, prefix + String.format("%s: owner=%s", privFrame.id, privFrame.owner));
        } else if (entry instanceof GeobFrame) {
            GeobFrame geobFrame = (GeobFrame) entry;
            Log.d(TAG, prefix + String.format("%s: mimeType=%s, filename=%s, description=%s",
                    geobFrame.id, geobFrame.mimeType, geobFrame.filename, geobFrame.description));
        } else if (entry instanceof ApicFrame) {
            ApicFrame apicFrame = (ApicFrame) entry;
            Log.d(TAG, prefix + String.format("%s: mimeType=%s, description=%s",
                    apicFrame.id, apicFrame.mimeType, apicFrame.description));
        } else if (entry instanceof CommentFrame) {
            CommentFrame commentFrame = (CommentFrame) entry;
            Log.d(TAG, prefix + String.format("%s: language=%s, description=%s", commentFrame.id,
                    commentFrame.language, commentFrame.description));
        } else if (entry instanceof Id3Frame) {
            Id3Frame id3Frame = (Id3Frame) entry;
            Log.d(TAG, prefix + String.format("%s", id3Frame.id));
        } else if (entry instanceof EventMessage) {
            EventMessage eventMessage = (EventMessage) entry;
            Log.d(TAG, prefix + String.format("EMSG: scheme=%s, id=%d, value=%s",
                    eventMessage.schemeIdUri, eventMessage.id, eventMessage.value));
        }
    }
}
 
Example #23
Source File: EventLogger.java    From GSYVideoPlayer with Apache License 2.0 5 votes vote down vote up
private void printMetadata(Metadata metadata, String prefix) {
    for (int i = 0; i < metadata.length(); i++) {
        Metadata.Entry entry = metadata.get(i);
        if (entry instanceof TextInformationFrame) {
            TextInformationFrame textInformationFrame = (TextInformationFrame) entry;
            Log.d(TAG, prefix + String.format("%s: value=%s", textInformationFrame.id,
                    textInformationFrame.value));
        } else if (entry instanceof UrlLinkFrame) {
            UrlLinkFrame urlLinkFrame = (UrlLinkFrame) entry;
            Log.d(TAG, prefix + String.format("%s: url=%s", urlLinkFrame.id, urlLinkFrame.url));
        } else if (entry instanceof PrivFrame) {
            PrivFrame privFrame = (PrivFrame) entry;
            Log.d(TAG, prefix + String.format("%s: owner=%s", privFrame.id, privFrame.owner));
        } else if (entry instanceof GeobFrame) {
            GeobFrame geobFrame = (GeobFrame) entry;
            Log.d(TAG, prefix + String.format("%s: mimeType=%s, filename=%s, description=%s",
                    geobFrame.id, geobFrame.mimeType, geobFrame.filename, geobFrame.description));
        } else if (entry instanceof ApicFrame) {
            ApicFrame apicFrame = (ApicFrame) entry;
            Log.d(TAG, prefix + String.format("%s: mimeType=%s, description=%s",
                    apicFrame.id, apicFrame.mimeType, apicFrame.description));
        } else if (entry instanceof CommentFrame) {
            CommentFrame commentFrame = (CommentFrame) entry;
            Log.d(TAG, prefix + String.format("%s: language=%s, description=%s", commentFrame.id,
                    commentFrame.language, commentFrame.description));
        } else if (entry instanceof Id3Frame) {
            Id3Frame id3Frame = (Id3Frame) entry;
            Log.d(TAG, prefix + String.format("%s", id3Frame.id));
        } else if (entry instanceof EventMessage) {
            EventMessage eventMessage = (EventMessage) entry;
            Log.d(TAG, prefix + String.format("EMSG: scheme=%s, id=%d, value=%s",
                    eventMessage.schemeIdUri, eventMessage.id, eventMessage.value));
        }
    }
}
 
Example #24
Source File: EventLogger.java    From mimi-reader with Apache License 2.0 5 votes vote down vote up
private void printMetadata(Metadata metadata, String prefix) {
    for (int i = 0; i < metadata.length(); i++) {
        Metadata.Entry entry = metadata.get(i);
        if (entry instanceof TextInformationFrame) {
            TextInformationFrame textInformationFrame = (TextInformationFrame) entry;
            Log.d(TAG, prefix + String.format("%s: value=%s", textInformationFrame.id,
                    textInformationFrame.value));
        } else if (entry instanceof UrlLinkFrame) {
            UrlLinkFrame urlLinkFrame = (UrlLinkFrame) entry;
            Log.d(TAG, prefix + String.format("%s: url=%s", urlLinkFrame.id, urlLinkFrame.url));
        } else if (entry instanceof PrivFrame) {
            PrivFrame privFrame = (PrivFrame) entry;
            Log.d(TAG, prefix + String.format("%s: owner=%s", privFrame.id, privFrame.owner));
        } else if (entry instanceof GeobFrame) {
            GeobFrame geobFrame = (GeobFrame) entry;
            Log.d(TAG, prefix + String.format("%s: mimeType=%s, filename=%s, description=%s",
                    geobFrame.id, geobFrame.mimeType, geobFrame.filename, geobFrame.description));
        } else if (entry instanceof ApicFrame) {
            ApicFrame apicFrame = (ApicFrame) entry;
            Log.d(TAG, prefix + String.format("%s: mimeType=%s, description=%s",
                    apicFrame.id, apicFrame.mimeType, apicFrame.description));
        } else if (entry instanceof CommentFrame) {
            CommentFrame commentFrame = (CommentFrame) entry;
            Log.d(TAG, prefix + String.format("%s: language=%s, description=%s", commentFrame.id,
                    commentFrame.language, commentFrame.description));
        } else if (entry instanceof Id3Frame) {
            Id3Frame id3Frame = (Id3Frame) entry;
            Log.d(TAG, prefix + String.format("%s", id3Frame.id));
        } else if (entry instanceof EventMessage) {
            EventMessage eventMessage = (EventMessage) entry;
            Log.d(TAG, prefix + String.format("EMSG: scheme=%s, id=%d, value=%s",
                    eventMessage.schemeIdUri, eventMessage.id, eventMessage.value));
        }
    }
}
 
Example #25
Source File: EventLogger.java    From LiveVideoBroadcaster with Apache License 2.0 5 votes vote down vote up
private void printMetadata(Metadata metadata, String prefix) {
  for (int i = 0; i < metadata.length(); i++) {
    Metadata.Entry entry = metadata.get(i);
    if (entry instanceof TextInformationFrame) {
      TextInformationFrame textInformationFrame = (TextInformationFrame) entry;
      Log.d(TAG, prefix + String.format("%s: value=%s", textInformationFrame.id,
          textInformationFrame.value));
    } else if (entry instanceof UrlLinkFrame) {
      UrlLinkFrame urlLinkFrame = (UrlLinkFrame) entry;
      Log.d(TAG, prefix + String.format("%s: url=%s", urlLinkFrame.id, urlLinkFrame.url));
    } else if (entry instanceof PrivFrame) {
      PrivFrame privFrame = (PrivFrame) entry;
      Log.d(TAG, prefix + String.format("%s: owner=%s", privFrame.id, privFrame.owner));
    } else if (entry instanceof GeobFrame) {
      GeobFrame geobFrame = (GeobFrame) entry;
      Log.d(TAG, prefix + String.format("%s: mimeType=%s, filename=%s, description=%s",
          geobFrame.id, geobFrame.mimeType, geobFrame.filename, geobFrame.description));
    } else if (entry instanceof ApicFrame) {
      ApicFrame apicFrame = (ApicFrame) entry;
      Log.d(TAG, prefix + String.format("%s: mimeType=%s, description=%s",
          apicFrame.id, apicFrame.mimeType, apicFrame.description));
    } else if (entry instanceof CommentFrame) {
      CommentFrame commentFrame = (CommentFrame) entry;
      Log.d(TAG, prefix + String.format("%s: language=%s, description=%s", commentFrame.id,
          commentFrame.language, commentFrame.description));
    } else if (entry instanceof Id3Frame) {
      Id3Frame id3Frame = (Id3Frame) entry;
      Log.d(TAG, prefix + String.format("%s", id3Frame.id));
    } else if (entry instanceof EventMessage) {
      EventMessage eventMessage = (EventMessage) entry;
      Log.d(TAG, prefix + String.format("EMSG: scheme=%s, id=%d, value=%s",
          eventMessage.schemeIdUri, eventMessage.id, eventMessage.value));
    }
  }
}
 
Example #26
Source File: EventLogger.java    From ExoPlayer-Offline with Apache License 2.0 5 votes vote down vote up
private void printMetadata(Metadata metadata, String prefix) {
  for (int i = 0; i < metadata.length(); i++) {
    Metadata.Entry entry = metadata.get(i);
    if (entry instanceof TextInformationFrame) {
      TextInformationFrame textInformationFrame = (TextInformationFrame) entry;
      Log.d(TAG, prefix + String.format("%s: value=%s", textInformationFrame.id,
          textInformationFrame.value));
    } else if (entry instanceof UrlLinkFrame) {
      UrlLinkFrame urlLinkFrame = (UrlLinkFrame) entry;
      Log.d(TAG, prefix + String.format("%s: url=%s", urlLinkFrame.id, urlLinkFrame.url));
    } else if (entry instanceof PrivFrame) {
      PrivFrame privFrame = (PrivFrame) entry;
      Log.d(TAG, prefix + String.format("%s: owner=%s", privFrame.id, privFrame.owner));
    } else if (entry instanceof GeobFrame) {
      GeobFrame geobFrame = (GeobFrame) entry;
      Log.d(TAG, prefix + String.format("%s: mimeType=%s, filename=%s, description=%s",
          geobFrame.id, geobFrame.mimeType, geobFrame.filename, geobFrame.description));
    } else if (entry instanceof ApicFrame) {
      ApicFrame apicFrame = (ApicFrame) entry;
      Log.d(TAG, prefix + String.format("%s: mimeType=%s, description=%s",
          apicFrame.id, apicFrame.mimeType, apicFrame.description));
    } else if (entry instanceof CommentFrame) {
      CommentFrame commentFrame = (CommentFrame) entry;
      Log.d(TAG, prefix + String.format("%s: language=%s, description=%s", commentFrame.id,
          commentFrame.language, commentFrame.description));
    } else if (entry instanceof Id3Frame) {
      Id3Frame id3Frame = (Id3Frame) entry;
      Log.d(TAG, prefix + String.format("%s", id3Frame.id));
    } else if (entry instanceof EventMessage) {
      EventMessage eventMessage = (EventMessage) entry;
      Log.d(TAG, prefix + String.format("EMSG: scheme=%s, id=%d, value=%s",
          eventMessage.schemeIdUri, eventMessage.id, eventMessage.value));
    }
  }
}
 
Example #27
Source File: EventLogger.java    From TubiPlayer with MIT License 5 votes vote down vote up
private void printMetadata(Metadata metadata, String prefix) {
    for (int i = 0; i < metadata.length(); i++) {
        Metadata.Entry entry = metadata.get(i);
        if (entry instanceof TextInformationFrame) {
            TextInformationFrame textInformationFrame = (TextInformationFrame) entry;
            Log.d(TAG, prefix + String.format("%s: value=%s", textInformationFrame.id,
                    textInformationFrame.value));
        } else if (entry instanceof UrlLinkFrame) {
            UrlLinkFrame urlLinkFrame = (UrlLinkFrame) entry;
            Log.d(TAG, prefix + String.format("%s: url=%s", urlLinkFrame.id, urlLinkFrame.url));
        } else if (entry instanceof PrivFrame) {
            PrivFrame privFrame = (PrivFrame) entry;
            Log.d(TAG, prefix + String.format("%s: owner=%s", privFrame.id, privFrame.owner));
        } else if (entry instanceof GeobFrame) {
            GeobFrame geobFrame = (GeobFrame) entry;
            Log.d(TAG, prefix + String.format("%s: mimeType=%s, filename=%s, description=%s",
                    geobFrame.id, geobFrame.mimeType, geobFrame.filename, geobFrame.description));
        } else if (entry instanceof ApicFrame) {
            ApicFrame apicFrame = (ApicFrame) entry;
            Log.d(TAG, prefix + String.format("%s: mimeType=%s, description=%s",
                    apicFrame.id, apicFrame.mimeType, apicFrame.description));
        } else if (entry instanceof CommentFrame) {
            CommentFrame commentFrame = (CommentFrame) entry;
            Log.d(TAG, prefix + String.format("%s: language=%s, description=%s", commentFrame.id,
                    commentFrame.language, commentFrame.description));
        } else if (entry instanceof Id3Frame) {
            Id3Frame id3Frame = (Id3Frame) entry;
            Log.d(TAG, prefix + String.format("%s", id3Frame.id));
        } else if (entry instanceof EventMessage) {
            EventMessage eventMessage = (EventMessage) entry;
            Log.d(TAG, prefix + String.format("EMSG: scheme=%s, id=%d, value=%s",
                    eventMessage.schemeIdUri, eventMessage.id, eventMessage.value));
        }
    }
}
 
Example #28
Source File: MetadataUtil.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
private static @Nullable TextInformationFrame parseStandardGenreAttribute(
    ParsableByteArray data) {
  int genreCode = parseUint8AttributeValue(data);
  String genreString = (0 < genreCode && genreCode <= STANDARD_GENRES.length)
      ? STANDARD_GENRES[genreCode - 1] : null;
  if (genreString != null) {
    return new TextInformationFrame("TCON", /* description= */ null, genreString);
  }
  Log.w(TAG, "Failed to parse standard genre code");
  return null;
}
 
Example #29
Source File: MetadataUtil.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
private static @Nullable TextInformationFrame parseTextAttribute(
    int type, String id, ParsableByteArray data) {
  int atomSize = data.readInt();
  int atomType = data.readInt();
  if (atomType == Atom.TYPE_data) {
    data.skipBytes(8); // version (1), flags (3), empty (4)
    String value = data.readNullTerminatedString(atomSize - 16);
    return new TextInformationFrame(id, /* description= */ null, value);
  }
  Log.w(TAG, "Failed to parse text attribute: " + Atom.getAtomTypeString(type));
  return null;
}
 
Example #30
Source File: EventLogger.java    From PowerFileExplorer with GNU General Public License v3.0 5 votes vote down vote up
private void printMetadata(Metadata metadata, String prefix) {
  for (int i = 0; i < metadata.length(); i++) {
    Metadata.Entry entry = metadata.get(i);
    if (entry instanceof TextInformationFrame) {
      TextInformationFrame textInformationFrame = (TextInformationFrame) entry;
      Log.d(TAG, prefix + String.format("%s: value=%s", textInformationFrame.id,
          textInformationFrame.value));
    } else if (entry instanceof UrlLinkFrame) {
      UrlLinkFrame urlLinkFrame = (UrlLinkFrame) entry;
      Log.d(TAG, prefix + String.format("%s: url=%s", urlLinkFrame.id, urlLinkFrame.url));
    } else if (entry instanceof PrivFrame) {
      PrivFrame privFrame = (PrivFrame) entry;
      Log.d(TAG, prefix + String.format("%s: owner=%s", privFrame.id, privFrame.owner));
    } else if (entry instanceof GeobFrame) {
      GeobFrame geobFrame = (GeobFrame) entry;
      Log.d(TAG, prefix + String.format("%s: mimeType=%s, filename=%s, description=%s",
          geobFrame.id, geobFrame.mimeType, geobFrame.filename, geobFrame.description));
    } else if (entry instanceof ApicFrame) {
      ApicFrame apicFrame = (ApicFrame) entry;
      Log.d(TAG, prefix + String.format("%s: mimeType=%s, description=%s",
          apicFrame.id, apicFrame.mimeType, apicFrame.description));
    } else if (entry instanceof CommentFrame) {
      CommentFrame commentFrame = (CommentFrame) entry;
      Log.d(TAG, prefix + String.format("%s: language=%s, description=%s", commentFrame.id,
          commentFrame.language, commentFrame.description));
    } else if (entry instanceof Id3Frame) {
      Id3Frame id3Frame = (Id3Frame) entry;
      Log.d(TAG, prefix + String.format("%s", id3Frame.id));
    } else if (entry instanceof EventMessage) {
      EventMessage eventMessage = (EventMessage) entry;
      Log.d(TAG, prefix + String.format("EMSG: scheme=%s, id=%d, value=%s",
          eventMessage.schemeIdUri, eventMessage.id, eventMessage.value));
    }
  }
}