FileDocCategorySizeDatePackage
NativeDecoder.javaAPI DocFobs4JMF API 0.4.13749Wed Jan 10 11:09:18 GMT 2007com.omnividea.media.codec.video

NativeDecoder

public class NativeDecoder extends VideoCodec
FOBS Java CrossPlatform JMF PlugIn Copyright (c) 2004 Omnividea Multimedia S.L Coded by Jose San Pedro Wandelmer This file is part of FOBS. FOBS is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. FOBS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with FOBS; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Fields Summary
private static int
bMask
private static int
gMask
private static int
rMask
Constructors Summary
public NativeDecoder()



    
    supportedInputFormats = new VideoFormat[] { new VideoFormat("ffmpeg_video") };
    defaultOutputFormats = new VideoFormat[] {
        new RGBFormat()};
    PLUGIN_NAME = "NULL Fobs Video Codec";
  
Methods Summary
public voidclose()

public javax.media.Format[]getMatchingOutputFormats(javax.media.Format in)

       if (in == null)
           return new VideoFormat[] { new RGBFormat() };

       VideoFormat vf =(VideoFormat) in;
       RGBFormat f = new RGBFormat (
             new Dimension(vf.getSize()),
             vf.getSize().width*vf.getSize().height,
             int[].class,
             vf.getFrameRate(),
             32,
             rMask, gMask, bMask,
             1,vf.getSize().width,
             Format.FALSE, // flipped
             RGBFormat.BIG_ENDIAN
             );

       supportedOutputFormats = new VideoFormat[] {f};
       return supportedOutputFormats;
     
public voidopen()

public intprocess(javax.media.Buffer inputBuffer, javax.media.Buffer outputBuffer)

         if (!checkInputBuffer(inputBuffer) ) {
             return BUFFER_PROCESSED_FAILED;
         }

         if (isEOM(inputBuffer) ) {
             propagateEOM(outputBuffer);
             return BUFFER_PROCESSED_OK;
         }

         Object outData = outputBuffer.getData();
         outputBuffer.setData(inputBuffer.getData());
         inputBuffer.setData(outData);
         outputBuffer.setLength(inputBuffer.getLength());
         outputBuffer.setFormat(outputFormat);
         outputBuffer.setOffset(inputBuffer.getOffset());
         return BUFFER_PROCESSED_OK;
     
public javax.media.FormatsetInputFormat(javax.media.Format format)

         if (super.setInputFormat(format) != null)
         {
           VideoFormat ivf = (VideoFormat)format;
           int videoWidth = ivf.getSize().width;
           int videoHeight = ivf.getSize().height;

           outputFormat = new RGBFormat (
             ivf.getSize(),
             ivf.getSize().width*ivf.getSize().height,
             int[].class,
             ivf.getFrameRate(),
             32,
             rMask, gMask, bMask,
             1,ivf.getSize().width,
             Format.FALSE, // flipped
             RGBFormat.BIG_ENDIAN //NOT_SPECIFIED
          );

          return format;
        }
        else{
         return null;
       }