AVPKit
com::avpkit::core::IVideoResampler Class Referenceabstract

Converts IVideoPicture objects of a given width, height and format to a new width, height or format. More...

#include <IVideoResampler.h>

Inheritance diagram for com::avpkit::core::IVideoResampler:
Collaboration diagram for com::avpkit::core::IVideoResampler:

Public Types

enum  Feature { FEATURE_IMAGERESCALING , FEATURE_COLORSPACECONVERSION }
 Features that the VideoResampler may optionally support.
 

Public Member Functions

virtual int32_t getInputWidth ()=0
 Get the width in pixels we expect on the input frame to the resampler. More...
 
virtual int32_t getInputHeight ()=0
 Get the height in pixels we expect on the input frame to the resampler. More...
 
virtual IPixelFormat::Type getInputPixelFormat ()=0
 Get the input pixel format. More...
 
virtual int32_t getOutputWidth ()=0
 Get the output width, in pixels. More...
 
virtual int32_t getOutputHeight ()=0
 Get the output height, in pixels. More...
 
virtual IPixelFormat::Type getOutputPixelFormat ()=0
 Get the output pixel format. More...
 
virtual int32_t resample (IVideoPicture *outVideoPicture, IVideoPicture *inVideoPicture)=0
 Resample in to out based on the resampler parameters. More...
 
virtual int32_t getNumProperties ()=0
 Returns the total number of settable properties on this object. More...
 
virtual IPropertygetPropertyMetaData (int32_t propertyNo)=0
 Returns the name of the numbered property. More...
 
virtual IPropertygetPropertyMetaData (const char *name)=0
 Returns the name of the numbered property. More...
 
virtual int32_t setProperty (const char *name, const char *value)=0
 Sets a property on this Object. More...
 
virtual int32_t setProperty (const char *name, double value)=0
 Looks up the property 'name' and sets the value of the property to 'value'. More...
 
virtual int32_t setProperty (const char *name, int64_t value)=0
 Looks up the property 'name' and sets the value of the property to 'value'. More...
 
virtual int32_t setProperty (const char *name, bool value)=0
 Looks up the property 'name' and sets the value of the property to 'value'. More...
 
virtual int32_t setProperty (const char *name, IRational *value)=0
 Looks up the property 'name' and sets the value of the property to 'value'. More...
 
virtual char * getPropertyAsString (const char *name)=0
 Gets a property on this Object. More...
 
virtual double getPropertyAsDouble (const char *name)=0
 Gets the value of this property, and returns as a double;. More...
 
virtual int64_t getPropertyAsLong (const char *name)=0
 Gets the value of this property, and returns as an long;. More...
 
virtual IRationalgetPropertyAsRational (const char *name)=0
 Gets the value of this property, and returns as an IRational;. More...
 
virtual bool getPropertyAsBoolean (const char *name)=0
 Gets the value of this property, and returns as a boolean. More...
 
virtual int32_t setProperty (IMetaData *valuesToSet, IMetaData *valuesNotFound)=0
 
- Public Member Functions inherited from com::avpkit::ferry::RefCounted
virtual int32_t acquire ()
 Internal Only. More...
 
virtual int32_t release ()
 Internal Only. More...
 
virtual RefCountedcopyReference ()
 Create a new Java object that refers to the same native object. More...
 
virtual int32_t getCurrentRefCount ()
 Return the current reference count on this object. More...
 
void setJavaAllocator (void *allocator)
 This method is public but not part of the standard API. More...
 
void * getJavaAllocator ()
 This method is public but not part of the standard API. More...
 

Static Public Member Functions

static IVideoResamplermake (int32_t outputWidth, int32_t outputHeight, IPixelFormat::Type outputFmt, int32_t inputWidth, int32_t inputHeight, IPixelFormat::Type inputFmt)
 Get a new video resampler. More...
 
static bool isSupported (Feature feature)
 Returns true if the asked for feature is supported. More...
 

Additional Inherited Members

- Protected Member Functions inherited from com::avpkit::ferry::RefCounted
virtual void destroy ()
 This method is called by RefCounted objects when their Ref Count reaches zero and they are about to be destroyed.
 
- Protected Attributes inherited from com::avpkit::ferry::RefCounted
AtomicIntegermRefCount
 This is the internal reference count, represented as an AtomicInteger to make sure it is thread safe.
 
void * mAllocator
 Not part of public API.
 

Detailed Description

Converts IVideoPicture objects of a given width, height and format to a new width, height or format.

Definition at line 36 of file IVideoResampler.h.

Member Function Documentation

◆ getInputHeight()

virtual int32_t com::avpkit::core::IVideoResampler::getInputHeight ( )
pure virtual

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.

Implemented in com::avpkit::core::VideoResampler.

◆ getInputPixelFormat()

virtual IPixelFormat::Type com::avpkit::core::IVideoResampler::getInputPixelFormat ( )
pure virtual

Get the input pixel format.

Returns
The pixel format we expect on the input frame to the resampler.

Implemented in com::avpkit::core::VideoResampler.

◆ getInputWidth()

virtual int32_t com::avpkit::core::IVideoResampler::getInputWidth ( )
pure virtual

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.

Implemented in com::avpkit::core::VideoResampler.

◆ getNumProperties()

virtual int32_t com::avpkit::core::IVideoResampler::getNumProperties ( )
pure virtual

Returns the total number of settable properties on this object.

Returns
total number of options (not including constant definitions)

Implemented in com::avpkit::core::VideoResampler.

◆ getOutputHeight()

virtual int32_t com::avpkit::core::IVideoResampler::getOutputHeight ( )
pure virtual

Get the output height, in pixels.

Returns
The height we will resample the output frame to

Implemented in com::avpkit::core::VideoResampler.

◆ getOutputPixelFormat()

virtual IPixelFormat::Type com::avpkit::core::IVideoResampler::getOutputPixelFormat ( )
pure virtual

Get the output pixel format.

Returns
The pixel format we will resample the output frame to

Implemented in com::avpkit::core::VideoResampler.

◆ getOutputWidth()

virtual int32_t com::avpkit::core::IVideoResampler::getOutputWidth ( )
pure virtual

Get the output width, in pixels.

Returns
The width we will resample the output frame to

Implemented in com::avpkit::core::VideoResampler.

◆ getPropertyAsBoolean()

virtual bool com::avpkit::core::IVideoResampler::getPropertyAsBoolean ( const char *  name)
pure virtual

Gets the value of this property, and returns as a boolean.

Parameters
namename of option
Returns
boolean value of property, or false on error.

Implemented in com::avpkit::core::VideoResampler.

◆ getPropertyAsDouble()

virtual double com::avpkit::core::IVideoResampler::getPropertyAsDouble ( const char *  name)
pure virtual

Gets the value of this property, and returns as a double;.

Parameters
namename of option
Returns
double value of property, or 0 on error.

Implemented in com::avpkit::core::VideoResampler.

◆ getPropertyAsLong()

virtual int64_t com::avpkit::core::IVideoResampler::getPropertyAsLong ( const char *  name)
pure virtual

Gets the value of this property, and returns as an long;.

Parameters
namename of option
Returns
long value of property, or 0 on error.

Implemented in com::avpkit::core::VideoResampler.

◆ getPropertyAsRational()

virtual IRational* com::avpkit::core::IVideoResampler::getPropertyAsRational ( const char *  name)
pure virtual

Gets the value of this property, and returns as an IRational;.

Parameters
namename of option
Returns
long value of property, or 0 on error.

Implemented in com::avpkit::core::VideoResampler.

◆ getPropertyAsString()

virtual char* com::avpkit::core::IVideoResampler::getPropertyAsString ( const char *  name)
pure virtual

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.

Parameters
nameproperty name
Returns
an string copy of the option value, or null if the option doesn't exist.

Implemented in com::avpkit::core::VideoResampler.

◆ getPropertyMetaData() [1/2]

virtual IProperty* com::avpkit::core::IVideoResampler::getPropertyMetaData ( const char *  name)
pure virtual

Returns the name of the numbered property.

Parameters
nameThe property name.
Returns
an IProperty value for this properties meta-data

Implemented in com::avpkit::core::VideoResampler.

◆ getPropertyMetaData() [2/2]

virtual IProperty* com::avpkit::core::IVideoResampler::getPropertyMetaData ( int32_t  propertyNo)
pure virtual

Returns the name of the numbered property.

Parameters
propertyNoThe property number in the options list.
Returns
an IProperty value for this properties meta-data

Implemented in com::avpkit::core::VideoResampler.

◆ isSupported()

bool com::avpkit::core::IVideoResampler::isSupported ( Feature  feature)
static

Returns true if the asked for feature is supported.

Parameters
featureThe feature you want to find out is supported.
Returns
true if the IVideoResampler supports this feature; false otherwise.

Definition at line 48 of file IVideoResampler.cpp.

49  {
50  (void)aFeature; // ignored for now, but might change
51  return true;
52  }

◆ make()

IVideoResampler * com::avpkit::core::IVideoResampler::make ( int32_t  outputWidth,
int32_t  outputHeight,
IPixelFormat::Type  outputFmt,
int32_t  inputWidth,
int32_t  inputHeight,
IPixelFormat::Type  inputFmt 
)
static

Get a new video resampler.

Returns null if isSupported(Feature) returns false.

Parameters
outputWidthThe width in pixels you want to output frame to have.
outputHeightThe height in pixels you want to output frame to have.
outputFmtThe pixel format of the output frame.
inputWidthThe width in pixels the input frame will be in.
inputHeightThe height in pixels the input frame will be in.
inputFmtThe pixel format of the input frame.
Returns
a new object, or null if we cannot allocate one.

Definition at line 36 of file IVideoResampler.cpp.

41  {
42  Global::init();
43  return VideoResampler::make(outputWidth, outputHeight, outputFmt,
44  inputWidth, inputHeight, inputFmt);
45  }
static void init()
Internal Only.
Definition: Global.cpp:157

References com::avpkit::core::Global::init().

◆ resample()

virtual int32_t com::avpkit::core::IVideoResampler::resample ( IVideoPicture outVideoPicture,
IVideoPicture inVideoPicture 
)
pure virtual

Resample in to out based on the resampler parameters.

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

Parameters
outVideoPictureThe picture we'll resample to. Check IVideoPicture#isComplete() after the call.
inVideoPictureThe picture we'll resample from.
Returns
>= 0 on success; <0 on error.

Implemented in com::avpkit::core::VideoResampler.

◆ setProperty() [1/5]

virtual int32_t com::avpkit::core::IVideoResampler::setProperty ( const char *  name,
bool  value 
)
pure virtual

Looks up the property 'name' and sets the value of the property to 'value'.

Parameters
namename of option
valueValue of option
Returns
>= 0 on success; <0 on error.

Implemented in com::avpkit::core::VideoResampler.

◆ setProperty() [2/5]

virtual int32_t com::avpkit::core::IVideoResampler::setProperty ( const char *  name,
const char *  value 
)
pure virtual

Sets a property on this Object.

All AVOptions supported by the underlying AVClass are supported.

Parameters
nameThe property name. For example "b" for bit-rate.
valueThe value of the property.
Returns
>= 0 if the property was successfully set; <0 on error

Implemented in com::avpkit::core::VideoResampler.

◆ setProperty() [3/5]

virtual int32_t com::avpkit::core::IVideoResampler::setProperty ( const char *  name,
double  value 
)
pure virtual

Looks up the property 'name' and sets the value of the property to 'value'.

Parameters
namename of option
valueValue of option
Returns
>= 0 on success; <0 on error.

Implemented in com::avpkit::core::VideoResampler.

◆ setProperty() [4/5]

virtual int32_t com::avpkit::core::IVideoResampler::setProperty ( const char *  name,
int64_t  value 
)
pure virtual

Looks up the property 'name' and sets the value of the property to 'value'.

Parameters
namename of option
valueValue of option
Returns
>= 0 on success; <0 on error.

Implemented in com::avpkit::core::VideoResampler.

◆ setProperty() [5/5]

virtual int32_t com::avpkit::core::IVideoResampler::setProperty ( const char *  name,
IRational value 
)
pure virtual

Looks up the property 'name' and sets the value of the property to 'value'.

Parameters
namename of option
valueValue of option
Returns
>= 0 on success; <0 on error.

Implemented in com::avpkit::core::VideoResampler.


The documentation for this class was generated from the following files: