Class IVideoResampler

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  IVideoResampler.Feature
      Features that the VideoResampler may optionally support.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected IVideoResampler​(long cPtr, boolean cMemoryOwn)
      Internal Only.
      protected IVideoResampler​(long cPtr, boolean cMemoryOwn, java.util.concurrent.atomic.AtomicLong ref)
      Internal Only.
    • Constructor Detail

      • IVideoResampler

        protected IVideoResampler​(long cPtr,
                                  boolean cMemoryOwn)
        Internal Only.
      • IVideoResampler

        protected IVideoResampler​(long cPtr,
                                  boolean cMemoryOwn,
                                  java.util.concurrent.atomic.AtomicLong ref)
        Internal Only.
    • Method Detail

      • getCPtr

        public static long getCPtr​(IVideoResampler obj)
        Internal Only. Not part of public API. Get the raw value of the native object that obj is proxying for.
        Parameters:
        obj - The java proxy object for a native object.
        Returns:
        The raw pointer obj is proxying for.
      • getMyCPtr

        public long getMyCPtr()
        Internal Only. Not part of public API. Get the raw value of the native object that we're proxying for.
        Overrides:
        getMyCPtr in class RefCounted
        Returns:
        The raw pointer we're proxying for.
      • equals

        public boolean equals​(java.lang.Object obj)
        Compares two values, returning true if the underlying objects in native code are the same object. That means you can have two different Java objects, but when you do a comparison, you'll find out they are the EXACT same object.
        Overrides:
        equals in class java.lang.Object
        Returns:
        True if the underlying native object is the same. False otherwise.
      • hashCode

        public int hashCode()
        Get a hashable value for this object.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hashable value.
      • getInputWidth

        public int getInputWidth()
        Get the width in pixels we expect on the input frame to the resampler.
        Returns:
        The width we expect on the input frame to the resampler.
      • getInputHeight

        public int getInputHeight()
        Get the height in pixels we expect on the input frame to the resampler.
        Returns:
        The height we expect on the input frame to the resampler.
      • getOutputWidth

        public int getOutputWidth()
        Get the output width, in pixels.
        Returns:
        The width we will resample the output frame to
      • getOutputHeight

        public int getOutputHeight()
        Get the output height, in pixels.
        Returns:
        The height we will resample the output frame to
      • resample

        public int resample​(IVideoPicture outVideoPicture,
                            IVideoPicture inVideoPicture)
        Resample in to out based on the resampler parameters.

        Resamples the in picture based on the parameters set when
        this resampler was constructed.

        Parameters:
        outVideoPicture - The picture we'll resample to. Check
        {IVideoPicture#isComplete()} after the call.
        inVideoPicture - The picture we'll resample from.

        Returns:
        >= 0 on success; <0 on error.
      • getNumProperties

        public int getNumProperties()
        Returns the total number of settable properties on this object

        Specified by:
        getNumProperties in interface IConfigurable
        Returns:
        total number of options (not including constant definitions)
      • getPropertyMetaData

        public IProperty getPropertyMetaData​(int propertyNo)
        Returns the name of the numbered property.

        Specified by:
        getPropertyMetaData in interface IConfigurable
        Parameters:
        propertyNo - The property number in the options list.

        Returns:
        an IProperty value for this properties meta-data
      • setProperty

        public int setProperty​(java.lang.String name,
                               java.lang.String value)
        Sets a property on this Object.

        All AVOptions supported by the underlying AVClass are supported.

        Specified by:
        setProperty in interface IConfigurable
        Parameters:
        name - The property name. For example "b" for bit-rate.
        value - The value of the property.

        Returns:
        >= 0 if the property was successfully set; <0 on error
      • setProperty

        public int setProperty​(java.lang.String name,
                               double value)
        Looks up the property 'name' and sets the
        value of the property to 'value'.

        Specified by:
        setProperty in interface IConfigurable
        Parameters:
        name - name of option
        value - Value of option

        Returns:
        >= 0 on success; <0 on error.
      • setProperty

        public int setProperty​(java.lang.String name,
                               long value)
        Looks up the property 'name' and sets the
        value of the property to 'value'.

        Specified by:
        setProperty in interface IConfigurable
        Parameters:
        name - name of option
        value - Value of option

        Returns:
        >= 0 on success; <0 on error.
      • setProperty

        public int setProperty​(java.lang.String name,
                               boolean value)
        Looks up the property 'name' and sets the
        value of the property to 'value'.

        Specified by:
        setProperty in interface IConfigurable
        Parameters:
        name - name of option
        value - Value of option

        Returns:
        >= 0 on success; <0 on error.
      • setProperty

        public int setProperty​(java.lang.String name,
                               IRational value)
        Looks up the property 'name' and sets the
        value of the property to 'value'.

        Specified by:
        setProperty in interface IConfigurable
        Parameters:
        name - name of option
        value - Value of option

        Returns:
        >= 0 on success; <0 on error.
      • getPropertyAsString

        public java.lang.String getPropertyAsString​(java.lang.String name)
        Gets a property on this Object.

        Note for C++ callers; you must free the returned array with
        delete[] in order to avoid a memory leak. Other language
        folks need not worry.

        Specified by:
        getPropertyAsString in interface IConfigurable
        Parameters:
        name - property name

        Returns:
        an string copy of the option value, or null if the option doesn't exist.
      • getPropertyAsDouble

        public double getPropertyAsDouble​(java.lang.String name)
        Gets the value of this property, and returns as a double;

        Specified by:
        getPropertyAsDouble in interface IConfigurable
        Parameters:
        name - name of option

        Returns:
        double value of property, or 0 on error.
      • getPropertyAsLong

        public long getPropertyAsLong​(java.lang.String name)
        Gets the value of this property, and returns as an long;

        Specified by:
        getPropertyAsLong in interface IConfigurable
        Parameters:
        name - name of option

        Returns:
        long value of property, or 0 on error.
      • getPropertyAsBoolean

        public boolean getPropertyAsBoolean​(java.lang.String name)
        Gets the value of this property, and returns as a boolean

        Specified by:
        getPropertyAsBoolean in interface IConfigurable
        Parameters:
        name - name of option

        Returns:
        boolean value of property, or false on error.
      • make

        public static IVideoResampler make​(int outputWidth,
                                           int outputHeight,
                                           IPixelFormat.Type outputFmt,
                                           int inputWidth,
                                           int inputHeight,
                                           IPixelFormat.Type inputFmt)
        Get a new video resampler. Returns null if {#isSupported(Feature)} returns false.

        Parameters:
        outputWidth - The width in pixels you want to output frame to have.
        outputHeight - The height in pixels you want to output frame to have.
        outputFmt - The pixel format of the output frame.
        inputWidth - The width in pixels the input frame will be in.
        inputHeight - The height in pixels the input frame will be in.
        inputFmt - The pixel format of the input frame.
        Returns:
        a new object, or null if we cannot allocate one.
      • isSupported

        public static boolean isSupported​(IVideoResampler.Feature feature)
        Returns true if the asked for feature is supported.

        Parameters:
        feature - The feature you want to find out is supported.
        Returns:
        true if the IVideoResampler supports this feature; false otherwise.
      • setProperty

        public int setProperty​(IMetaData valuesToSet,
                               IMetaData valuesNotFound)
        {
        Specified by:
        setProperty in interface IConfigurable
        Parameters:
        valuesToSet - The set of key-value pairs to try to set
        valuesNotFound - If non null will contain all key-values pairs in valuesToSet that were not found in context.
        Returns:
        0 on success; <0 on failure