Examples of ContentDescriptor


Examples of entagged.audioformats.asf.data.ContentDescriptor

         * Now search for a content descriptor whose id is not one of
         * ignoreDescriptors. These descriptors cannot be modified by entagged
         * and will be preserved
         */
        while (it.hasNext() && !found) {
            ContentDescriptor current = (ContentDescriptor) it.next();
            found = !ignoreDescriptors.contains(current.getName());
        }
        return !found && !isExtendedContentDescriptionMandatory(tag);
    }
View Full Code Here

Examples of entagged.audioformats.asf.data.ContentDescriptor

            result = new ExtendedContentDescription(chunkStart, chunkLen);

            for (long i = 0; i < descriptorCount; i++) {
                String tagElement = Utils.readUTF16LEStr(raf);
                int type = Utils.readUINT16(raf);
                ContentDescriptor prop = new ContentDescriptor(tagElement, type);
                switch (type) {
                case ContentDescriptor.TYPE_STRING:
                    prop.setStringValue(Utils.readUTF16LEStr(raf));
                    break;
                case ContentDescriptor.TYPE_BINARY:
                    prop.setBinaryValue(readBinaryData(raf));
                    break;
                case ContentDescriptor.TYPE_BOOLEAN:
                    prop.setBooleanValue(readBoolean(raf));
                    break;
                case ContentDescriptor.TYPE_DWORD:
                    raf.skipBytes(2);
                    prop.setDWordValue(Utils.readUINT32(raf));
                    break;
                case ContentDescriptor.TYPE_WORD:
                    raf.skipBytes(2);
                    prop.setWordValue(Utils.readUINT16(raf));
                    break;
                case ContentDescriptor.TYPE_QWORD:
                    raf.skipBytes(2);
                    prop.setQWordValue(Utils.readUINT64(raf));
                    break;
                default:
                    // Unknown, hopefully the convention for the size of the
                    // value
                    // is given, so we could read it binary
                    prop.setStringValue("Invalid datatype: "
                            + new String(readBinaryData(raf)));
                }
                result.addDescriptor(prop);
            }
        }
View Full Code Here

Examples of entagged.audioformats.asf.data.ContentDescriptor

            int errors = testContentDescription(header, okString);
            assertTrue(errors == 0);
            errors = testContentDescription(header, errorString);
            assertTrue(errors == 5);
        }
        ContentDescriptor desc;
        try {
            desc = new ContentDescriptor(errorString,
                    ContentDescriptor.TYPE_STRING);
            Assert
                    .fail("Construction shouldn't be possible with such a large name");
        } catch (Exception e) {
            // Here is all OK
        }
        desc = new ContentDescriptor(okString, ContentDescriptor.TYPE_STRING);
        try {
            desc.setStringValue(errorString);
            Assert.fail("Value is too long but accepted");
        } catch (Exception e) {
            // Here is all OK
        }
        desc.setStringValue(okString);

        assertTrue(header.getFileHeader().getFileSize().equals(
                BigInteger.valueOf(this.file.length())));
    }
View Full Code Here

Examples of entagged.audioformats.asf.data.ContentDescriptor

   *            values. <br>
   *            <b>Warning: </b> the common values will be replaced.
   */
  public static void assignCommonTagValues(Tag tag,
      ExtendedContentDescription description) {
    ContentDescriptor tmp = null;
    if (tag.getFirstAlbum() != null && tag.getFirstAlbum().length() > 0) {
      tmp = new ContentDescriptor(ContentDescriptor.ID_ALBUM,
          ContentDescriptor.TYPE_STRING);
      tmp.setStringValue(tag.getFirstAlbum());
      description.addOrReplace(tmp);
    } else {
      description.remove(ContentDescriptor.ID_ALBUM);
    }
    if (tag.getFirstTrack() != null && tag.getFirstTrack().length() > 0) {
      tmp = new ContentDescriptor(ContentDescriptor.ID_TRACKNUMBER,
          ContentDescriptor.TYPE_STRING);
      tmp.setStringValue(tag.getFirstTrack());
      description.addOrReplace(tmp);
    } else {
      description.remove(ContentDescriptor.ID_TRACKNUMBER);
    }
    if (tag.getFirstYear() != null && tag.getFirstYear().length() > 0) {
      tmp = new ContentDescriptor(ContentDescriptor.ID_YEAR,
          ContentDescriptor.TYPE_STRING);
      tmp.setStringValue(tag.getFirstYear());
      description.addOrReplace(tmp);
    } else {
      description.remove(ContentDescriptor.ID_YEAR);
    }
    if (tag.getFirstGenre() != null && tag.getFirstGenre().length() > 0) {
      tmp = new ContentDescriptor(ContentDescriptor.ID_GENRE,
          ContentDescriptor.TYPE_STRING);
      tmp.setStringValue(tag.getFirstGenre());
      description.addOrReplace(tmp);
      int index = Arrays.asList(Tag.DEFAULT_GENRES).indexOf(
          tag.getFirstGenre());
      if (index != -1) {
        tmp = new ContentDescriptor(ContentDescriptor.ID_GENREID,
            ContentDescriptor.TYPE_STRING);
        tmp.setStringValue("(" + index + ")");
        description.addOrReplace(tmp);
      } else {
        description.remove(ContentDescriptor.ID_GENREID);
      }
    } else {
View Full Code Here

Examples of entagged.audioformats.asf.data.ContentDescriptor

   *            the extended content description.
   */
  public static void assignOptionalTagValues(Tag tag,
      ExtendedContentDescription descriptor) {
    Iterator it = tag.getFields();
    ContentDescriptor tmp = null;
    while (it.hasNext()) {
      try {
        TagField currentField = (TagField) it.next();
        if (!currentField.isCommon()) {
          tmp = new ContentDescriptor(currentField.getId(),
              ContentDescriptor.TYPE_STRING);
          if (currentField.isBinary()) {
            tmp.setBinaryValue(currentField.getRawContent());
          } else {
            tmp.setStringValue(currentField.toString());
          }
          descriptor.addOrReplace(tmp);
        }
      } catch (UnsupportedEncodingException uee) {
        uee.printStackTrace();
View Full Code Here

Examples of entagged.audioformats.asf.data.ContentDescriptor

       */
      ExtendedContentDescription extDesc = source
          .getExtendedContentDescription();
      Iterator it = extDesc.getDescriptors().iterator();
      while (it.hasNext()) {
        ContentDescriptor current = (ContentDescriptor) it.next();
        // If common, it has been added to the result some lines upward.
        if (!current.isCommon()) {
          result.add(new ContentDescriptorTagField(current));
        }
      }
    }
    return result;
View Full Code Here

Examples of javax.media.protocol.ContentDescriptor

    public FTPSourceStream(InputStream in)
    {
       this.dataIn = in;
       eofMarker = false;
       cd = new ContentDescriptor("unknown");
    }
View Full Code Here

Examples of javax.media.protocol.ContentDescriptor

      String mimeType = null;
      // we look for an encoder with same name and add mime_type of this
      AVOutputFormat avOutputFormat = AVFORMAT.guess_format(avInputFormat.name, null,null);
      if (avOutputFormat != null && avOutputFormat.mime_type != null && avOutputFormat.mime_type.length() > 0) {
        mimeType = avOutputFormat.mime_type;
        mimeTypes.put(mimeType, new ContentDescriptor(ContentDescriptor.mimeTypeToPackageName(mimeType)));
        logger.log(Level.FINEST, i + ". " + avInputFormat.long_name + " : " + mimeType);
      }
      String[] additionalMimeTypes = (String[])additionalFormatMimeTypes.get(avInputFormat.name);
      if (additionalMimeTypes != null) {
        if (additionalMimeTypes == NOT_SUPPORTED_FORMAT) {
          logger.log(Level.FINE, "Ignoring input format: " + avInputFormat.name + " (" + avInputFormat.long_name + ")");
        } else {
          for (int j = 0; j < additionalMimeTypes.length; j++) {
            mimeType = additionalMimeTypes[j];
            mimeTypes.put(mimeType, new ContentDescriptor(ContentDescriptor.mimeTypeToPackageName(mimeType)));
            logger.log(Level.FINEST, i + ". " + avInputFormat.long_name + " : " + additionalMimeTypes[j]);
          }
        }
      }
      if (mimeType == null && additionalMimeTypes == null){
        mimeType = "ffmpeg/"+avInputFormat.name;
        mimeTypes.put(mimeType, new ContentDescriptor(ContentDescriptor.mimeTypeToPackageName(mimeType)));
      }
      i++;
      if (avInputFormat.next != null /*&& avInputFormat.next.isValid()*/) {
        avInputFormat = new AVInputFormat(avInputFormat.next);
      }else{
View Full Code Here

Examples of javax.media.protocol.ContentDescriptor

public class RTPTransmitWizardConfig extends ProcessorWizardConfig
{

  public RTPTransmitWizardConfig()
  {
    contentDescriptor = new ContentDescriptor(ContentDescriptor.RAW_RTP);
  }
View Full Code Here

Examples of javax.media.protocol.ContentDescriptor

      return false;
    }

    public ContentDescriptor getContentDescriptor()
    {
      return new ContentDescriptor(ContentDescriptor.RAW)// It confuses me that we provide both this, and the correct format below (getFormat)
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.