org.mmbase.streams.transcoders
Class AnalyzerUtils

java.lang.Object
  extended by org.mmbase.streams.transcoders.AnalyzerUtils
All Implemented Interfaces:
Serializable

public final class AnalyzerUtils
extends Object
implements Serializable

Utility methods common for the analyzers that look for several media audio, video and images, that try to extract information, convert nodetypes to the matching kind etc.

Version:
$Id: AnalyzerUtils.java 42575 2010-06-15 12:11:26Z andre $
Author:
Michiel Meeuwissen, André van Toly
See Also:
Serialized Form

Field Summary
static String AUDIO
           
static String AUDIOC
           
static String IMAGE
           
static String IMAGEC
           
static String MEDIA
           
static String MEDIAC
           
static String VIDEO
           
static String VIDEOC
           
 
Constructor Summary
AnalyzerUtils(Logger... loggers)
           
 
Method Summary
 boolean audio(String l, Node source, Node dest)
          Looks for audio channel(s).
 boolean dimensions(String l, Node source, Node dest)
          Looks for width and height when it finds a match for Video, and looks for bitrate after that.
 boolean duration(String l, Node source, Node dest)
          Matches duration, records that and tries to match bitrate and start on that same line.
protected  void fixMimeType(String type, Node node)
          This fixes the first part (f.e.
 long getLength(String l)
           
 long getStart(String s)
           
 boolean getUpdateSource()
           
 boolean image2(String l, Node source, Node dest)
          Matches on Input and looks for the 'image2' format which indicates that the input is an image.
static Codec libtoCodec(String str)
           
 boolean output(String l, Node source, Node dest)
           
 void setUpdateDestination(boolean b)
           
 void setUpdateSource(boolean b)
           
 void toAudio(Node source, Node dest)
           
 void toImage(Node source, Node dest)
           
 void toVideo(Node source, Node dest)
           
 boolean unsupported(String l, Node source, Node dest)
           
 boolean video(String l, Node source, Node dest)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VIDEO

public static final String VIDEO
See Also:
Constant Field Values

AUDIO

public static final String AUDIO
See Also:
Constant Field Values

IMAGE

public static final String IMAGE
See Also:
Constant Field Values

MEDIA

public static final String MEDIA
See Also:
Constant Field Values

VIDEOC

public static final String VIDEOC
See Also:
Constant Field Values

AUDIOC

public static final String AUDIOC
See Also:
Constant Field Values

IMAGEC

public static final String IMAGEC
See Also:
Constant Field Values

MEDIAC

public static final String MEDIAC
See Also:
Constant Field Values
Constructor Detail

AnalyzerUtils

AnalyzerUtils(Logger... loggers)
Method Detail

setUpdateSource

public void setUpdateSource(boolean b)

getUpdateSource

public boolean getUpdateSource()

setUpdateDestination

public void setUpdateDestination(boolean b)

fixMimeType

protected void fixMimeType(String type,
                           Node node)
This fixes the first part (f.e. audio/*) when needed, not the complete MimeType.

To Do:
Should this perhaps be arranged in the respective builders themselves. It seems a requirement of videosources to have a video/* mimetype

toVideo

public void toVideo(Node source,
                    Node dest)

toAudio

public void toAudio(Node source,
                    Node dest)

toImage

public void toImage(Node source,
                    Node dest)

getLength

public long getLength(String l)

getStart

public long getStart(String s)

unsupported

public boolean unsupported(String l,
                           Node source,
                           Node dest)

output

public boolean output(String l,
                      Node source,
                      Node dest)

duration

public boolean duration(String l,
                        Node source,
                        Node dest)
Matches duration, records that and tries to match bitrate and start on that same line.


video

public boolean video(String l,
                     Node source,
                     Node dest)

image2

public boolean image2(String l,
                      Node source,
                      Node dest)
Matches on Input and looks for the 'image2' format which indicates that the input is an image.


dimensions

public boolean dimensions(String l,
                          Node source,
                          Node dest)
Looks for width and height when it finds a match for Video, and looks for bitrate after that. Works also for images.


audio

public boolean audio(String l,
                     Node source,
                     Node dest)
Looks for audio channel(s).


libtoCodec

public static Codec libtoCodec(String str)


MMBase 2.0-SNAPSHOT - null