AVPKit
IProperty.h
1 /*******************************************************************************
2  * Copyright (c) 2024, 2026, Olivier Ayache. All rights reserved.
3  *
4  * This file is part of AVPKit.
5  *
6  * AVPKit is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * AVPKit is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with AVPKit. If not, see <http://www.gnu.org/licenses/>.
18  *******************************************************************************/
19 
20 #ifndef IPROPERTY_H_
21 #define IPROPERTY_H_
22 
23 #include <com/avpkit/core/AVPKit.h>
24 #include <com/avpkit/ferry/RefCounted.h>
25 #include <com/avpkit/core/IMetaData.h>
26 namespace com { namespace avpkit { namespace core {
36  class VS_API_AVPKIT IProperty : public com::avpkit::ferry::RefCounted
37  {
38  public:
44  typedef enum {
45  PROPERTY_FLAGS,
46  PROPERTY_INT,
47  PROPERTY_INT64,
48  PROPERTY_DOUBLE,
49  PROPERTY_FLOAT,
50  PROPERTY_STRING,
51  PROPERTY_RATIONAL,
53  PROPERTY_DICT,
54  PROPERTY_UINT64,
55  PROPERTY_CONST,
57  PROPERTY_PIXEL_FMT,
58  PROPERTY_SAMPLE_FMT,
60  PROPERTY_DURATION,
61  PROPERTY_COLOR,
62  PROPERTY_CHANNEL_LAYOUT,
63  PROPERTY_BOOL,
64  PROPERTY_UNKNOWN=-1,
65  } Type;
66 
67  typedef enum {
68  FLAG_ENCODING_PARAM=1,
69  FLAG_DECODING_PARAM=2,
70  FLAG_METADATA=4,
71  FLAG_AUDIO_PARAM=8,
72  FLAG_VIDEO_PARAM=16,
73  FLAG_SUBTITLE_PARAM=32,
74  FLAG_EXPORT=64,
75  FLAG_READONLY=128,
76  FLAG_FILTERING_PARAM=(1<<16)
77  } Flags;
78 
82  typedef enum {
84  PROPERTY_SEARCH_DEFAULT=0x0000,
86  PROPERTY_SEARCH_CHILDREN=0x0001,
87  } Search;
88 
94  virtual const char *getName()=0;
95 
101  virtual const char *getHelp()=0;
102 
108  virtual const char *getUnit()=0;
109 
115  virtual Type getType()=0;
116 
122  virtual int32_t getFlags()=0;
123 
129  virtual int64_t getDefault()=0;
130 
136  virtual double getDefaultAsDouble()=0;
137 
144  virtual int32_t getNumFlagSettings()=0;
145 
154  virtual IProperty *getFlagConstant(int32_t position)=0;
155 
164  virtual IProperty *getFlagConstant(const char *name)=0;
165 
166  protected:
167  IProperty();
168  virtual ~IProperty();
169 
170  };
171 
172 }}}
173 #endif /* IPROPERTY_H_ */
Represents settable properties that effect how AVPKit objects operate.
Definition: IProperty.h:37
virtual const char * getHelp()=0
Get the (English) help string for this property.
virtual int32_t getFlags()=0
Get any set flags (a bitmask) for this option.
virtual IProperty * getFlagConstant(int32_t position)=0
If this IProperty is of the type Type#PROPERTY_FLAGS, this method will give you another IProperty rep...
Type
The different type of options that are supported by AVPKit.
Definition: IProperty.h:44
@ PROPERTY_IMAGE_SIZE
offset must point to two consecutive integers
Definition: IProperty.h:56
@ PROPERTY_BINARY
offset must point to a pointer immediately followed by an int for the length
Definition: IProperty.h:52
@ PROPERTY_VIDEO_RATE
offset must point to AVRational
Definition: IProperty.h:59
virtual const char * getName()=0
Get the name for this property.
virtual Type getType()=0
Get the underlying native type of this property.
virtual const char * getUnit()=0
Get any sub-unit this option or constant belongs to.
virtual int64_t getDefault()=0
Get the default setting this flag would have it not set.
virtual double getDefaultAsDouble()=0
Get the default setting this flag would have it not set.
virtual int32_t getNumFlagSettings()=0
If this IProperty is of the type Type#PROPERTY_FLAGS, this method will tell you how many different fl...
virtual IProperty * getFlagConstant(const char *name)=0
If this IProperty is of the type Type#PROPERTY_FLAGS, this method will give you another IProperty rep...
Parent of all Ferry objects – it mains reference counts in native code.
Definition: RefCounted.h:85
WARNING: Do not use logging in this class, and do not set any static file variables to values other t...