Package net.sourceforge.jaad.mp4.boxes.impl

Examples of net.sourceforge.jaad.mp4.boxes.impl.ItemInformationEntry$Extension


  //parses children of 'ilst': iTunes
  private void parseITunesMetaData(Box ilst) {
    final List<Box> boxes = ilst.getChildren();
    long l;
    ITunesMetadataBox data;
    for(Box box : boxes) {
      l = box.getType();
      data = (ITunesMetadataBox) box.getChild(BoxTypes.ITUNES_METADATA_BOX);

      if(l==BoxTypes.ARTIST_NAME_BOX) put(Field.ARTIST, data.getText());
      else if(l==BoxTypes.TRACK_NAME_BOX) put(Field.TITLE, data.getText());
      else if(l==BoxTypes.ALBUM_ARTIST_NAME_BOX) put(Field.ALBUM_ARTIST, data.getText());
      else if(l==BoxTypes.ALBUM_NAME_BOX) put(Field.ALBUM, data.getText());
      else if(l==BoxTypes.TRACK_NUMBER_BOX) {
        byte[] b = data.getData();
        put(Field.TRACK_NUMBER, new Integer(b[3]));
        put(Field.TOTAL_TRACKS, new Integer(b[5]));
      }
      else if(l==BoxTypes.DISK_NUMBER_BOX) put(Field.DISK_NUMBER, data.getInteger());
      else if(l==BoxTypes.COMPOSER_NAME_BOX) put(Field.COMPOSER, data.getText());
      else if(l==BoxTypes.COMMENTS_BOX) put(Field.COMMENTS, data.getText());
      else if(l==BoxTypes.TEMPO_BOX) put(Field.TEMPO, data.getInteger());
      else if(l==BoxTypes.RELEASE_DATE_BOX) put(Field.RELEASE_DATE, data.getDate());
      else if(l==BoxTypes.GENRE_BOX||l==BoxTypes.CUSTOM_GENRE_BOX) {
        String s = null;
        if(data.getDataType()==ITunesMetadataBox.DataType.UTF8) s = data.getText();
        else {
          final int i = data.getInteger();
          if(i>0&&i<STANDARD_GENRES.length) s = STANDARD_GENRES[data.getInteger()];
        }
        if(s!=null) put(Field.GENRE, s);
      }
      else if(l==BoxTypes.ENCODER_NAME_BOX) put(Field.ENCODER_NAME, data.getText());
      else if(l==BoxTypes.ENCODER_TOOL_BOX) put(Field.ENCODER_TOOL, data.getText());
      else if(l==BoxTypes.COPYRIGHT_BOX) put(Field.COPYRIGHT, data.getText());
      else if(l==BoxTypes.COMPILATION_PART_BOX) put(Field.COMPILATION, data.getBoolean());
      else if(l==BoxTypes.COVER_BOX) {
        final Artwork aw = new Artwork(Artwork.Type.forDataType(data.getDataType()), data.getData());
        if(contents.containsKey(Field.COVER_ARTWORKS)) get(Field.COVER_ARTWORKS).add(aw);
        else {
          final List<Artwork> list = new ArrayList<Artwork>();
          list.add(aw);
          put(Field.COVER_ARTWORKS, list);
        }
      }
      else if(l==BoxTypes.GROUPING_BOX) put(Field.GROUPING, data.getText());
      else if(l==BoxTypes.LYRICS_BOX) put(Field.LYRICS, data.getText());
      else if(l==BoxTypes.RATING_BOX) put(Field.RATING, data.getInteger());
      else if(l==BoxTypes.PODCAST_BOX) put(Field.PODCAST, data.getInteger());
      else if(l==BoxTypes.PODCAST_URL_BOX) put(Field.PODCAST_URL, data.getText());
      else if(l==BoxTypes.CATEGORY_BOX) put(Field.CATEGORY, data.getText());
      else if(l==BoxTypes.KEYWORD_BOX) put(Field.KEYWORDS, data.getText());
      else if(l==BoxTypes.DESCRIPTION_BOX) put(Field.DESCRIPTION, data.getText());
      else if(l==BoxTypes.LONG_DESCRIPTION_BOX) put(Field.DESCRIPTION, data.getText());
      else if(l==BoxTypes.TV_SHOW_BOX) put(Field.TV_SHOW, data.getText());
      else if(l==BoxTypes.TV_NETWORK_NAME_BOX) put(Field.TV_NETWORK, data.getText());
      else if(l==BoxTypes.TV_EPISODE_BOX) put(Field.TV_EPISODE, data.getText());
      else if(l==BoxTypes.TV_EPISODE_NUMBER_BOX) put(Field.TV_EPISODE_NUMBER, data.getInteger());
      else if(l==BoxTypes.TV_SEASON_BOX) put(Field.TV_SEASON, data.getInteger());
      else if(l==BoxTypes.PURCHASE_DATE_BOX) put(Field.PURCHASE_DATE, data.getText());
      else if(l==BoxTypes.GAPLESS_PLAYBACK_BOX) put(Field.GAPLESS_PLAYBACK, data.getText());
      else if(l==BoxTypes.HD_VIDEO_BOX) put(Field.HD_VIDEO, data.getBoolean());
      else if(l==BoxTypes.ARTIST_SORT_BOX) put(Field.ARTIST_SORT_TEXT, data.getText());
      else if(l==BoxTypes.TRACK_SORT_BOX) put(Field.TITLE_SORT_TEXT, data.getText());
      else if(l==BoxTypes.ALBUM_SORT_BOX) put(Field.ALBUM_SORT_TEXT, data.getText());
            else if(l==BoxTypes.CUSTOM_ITUNES_METADATA_BOX) {
                // this is special iTunes tag that stores gapless info
                FairPlayDataBox nameBox = (FairPlayDataBox) box.getChild(BoxTypes.ITUNES_METADATA_NAME_BOX);
                String name = new String(nameBox.getData()).trim();
                if (name.equals("iTunSMPB")) {
                    put(Field.GAPLESS_PLAYBACK, data.getText());
                }
            }
    }
  }
View Full Code Here


  //parses specific children of 'udta': 3GPP
  //TODO: handle language codes
  private void parse3GPPData(Box udta) {
    if(udta.hasChild(BoxTypes.THREE_GPP_ALBUM_BOX)) {
      ThreeGPPAlbumBox albm = (ThreeGPPAlbumBox) udta.getChild(BoxTypes.THREE_GPP_ALBUM_BOX);
      put(Field.ALBUM, albm.getData());
      put(Field.TRACK_NUMBER, albm.getTrackNumber());
    }
    //if(udta.hasChild(BoxTypes.THREE_GPP_AUTHOR_BOX));
    //if(udta.hasChild(BoxTypes.THREE_GPP_CLASSIFICATION_BOX));
    if(udta.hasChild(BoxTypes.THREE_GPP_DESCRIPTION_BOX)) put(Field.DESCRIPTION, ((ThreeGPPMetadataBox) udta.getChild(BoxTypes.THREE_GPP_DESCRIPTION_BOX)).getData());
    if(udta.hasChild(BoxTypes.THREE_GPP_KEYWORDS_BOX)) put(Field.KEYWORDS, ((ThreeGPPMetadataBox) udta.getChild(BoxTypes.THREE_GPP_KEYWORDS_BOX)).getData());
View Full Code Here

  @Override
  public void decode(MP4InputStream in) throws IOException {
    super.decode(in);

    ipmpDescriptors = new ArrayList</*IPMP*/Descriptor>();
    /*IPMP*/Descriptor desc;
    while(getLeft(in)>0) {
      desc = (/*IPMP*/Descriptor) ObjectDescriptor.createDescriptor(in);
      ipmpDescriptors.add(desc);
    }
  }
View Full Code Here

        }
    }

    //TODO: implement other entry descriptors
  protected void findDecoderSpecificInfo(ESDBox esds) {
    final Descriptor ed = esds.getEntryDescriptor();
    final List<Descriptor> children = ed.getChildren();
    List<Descriptor> children2;

    for(Descriptor e : children) {
      children2 = e.getChildren();
      for(Descriptor e2 : children2) {
View Full Code Here

        boolean[] issuerUniqueID  = new boolean[]
                    {true, false, true, false, true, false, true, false};
        boolean[] subjectUniqueID = new boolean[]
                    {false, true, false, true, false, true, false, true};

        Extension extension = new Extension("2.5.29.17",
                                            true, subjectAltNames.getEncoded());
        Extensions extensions = new Extensions();
        extensions.addExtension(extension);
      
        TBSCertificate tbsCertificate = new TBSCertificate(version,
View Full Code Here

     */
    public byte[] getExtensionValue(String oid) {
        if (extensions == null) {
            return null;
        }
        Extension ext = extensions.getExtensionByOID(oid);
        return (ext == null) ? null : ext.getRawExtnValue();
    }
View Full Code Here

    public byte[] getExtensionValue(String oid) {
        if (extensions == null) {
            return null;
        }
        // retrieve the info from the cached extensions object
        Extension ext = extensions.getExtensionByOID(oid);
        return (ext == null) ? null : ext.getRawExtnValue();
    }
View Full Code Here

            new GeneralName(6, "http://Resource.Id"),
            new GeneralName(new byte[] {1, 1, 1, 1}),
            new GeneralName(8, "1.2.3.4444.55555")
        };
        GeneralNames sans = new GeneralNames(Arrays.asList(san));
        Extension extension = new Extension("2.5.29.17", true, sans.getEncoded());
        Extensions extensions = new Extensions();
        extensions.addExtension(extension);
       
        byte[] encoding = extensions.getEncoded();
        Extensions.ASN1.decode(encoding);
View Full Code Here

        // crl entry extensions
        Extensions crlEntryExtensions = new Extensions();
        // add reason code extension which OID is 2.5.29.21
        // see RFC 3280 http://www.ietf.org/rfc/rfc3280.txt
        crlEntryExtensions.addExtension(
                new Extension("2.5.29.21", Extension.NON_CRITICAL,
                    new ReasonCode(ReasonCode.KEY_COMPROMISE)));
        // crl entry
        X509CRLEntryImpl crlEntry = new X509CRLEntryImpl(
                new TBSCertList.RevokedCertificate(
                        serialNumber,
View Full Code Here

        GeneralName tsa = new GeneralName(new Name("CN=AnAuthority"));
        Extensions exts = new Extensions();
        // Time-Stamping extension OID: as defined in RFC 3161
        int[] timeStampingExtOID = new int[] { 1, 3, 6, 1, 5, 5, 7, 3, 8 };
        byte[] timeStampingExtValue = new byte[] { (byte) 1, (byte) 2, (byte) 3 };
        Extension ext = new Extension(timeStampingExtOID, true,
                timeStampingExtValue);
        exts.addExtension(ext);

        TSTInfo tSTInfo = new TSTInfo(1, policy, msgImprint, BigInteger.TEN,
                genTime, accuracy, Boolean.FALSE, nonce, tsa, exts);
View Full Code Here

TOP

Related Classes of net.sourceforge.jaad.mp4.boxes.impl.ItemInformationEntry$Extension

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.