Package org.freedesktop.gstreamer.video
Class VideoInfo
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.freedesktop.gstreamer.video.VideoInfo
- All Implemented Interfaces:
Proxy
Information describing image properties. This information can be filled
in from GstCaps with gst_video_info_from_caps(). The information is also used
to store the specific video info when mapping a video frame with
gst_video_frame_map().
Use the provided macros to access the info in this structure.
-
Constructor Summary
ConstructorDescriptionAllocate a newGstVideoInfo
that is also initialized with gst_video_info_init().VideoInfo
(MemorySegment address) Create a VideoInfo proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionboolean
align
(VideoAlignment align) Adjust the offset and stride fields in this VideoInfo so that the padding and stride alignment inalign
is respected.boolean
alignFull
(VideoAlignment align, @Nullable Out<Long> planeSize) Extra padding will be added to the right side when stride alignment padding is required andalign
will be updated with the new padding values.boolean
Converts among variousGstFormat
types.copy()
Copy a GstVideoInfo structure.void
free()
Free a GstVideoInfo structure previously allocated with gst_video_info_new() or gst_video_info_copy().static VideoInfo
Parsecaps
to generate aGstVideoInfo
.static MemoryLayout
The memory layout of the native struct.static Type
getType()
Get the GType of the VideoInfo classstatic void
Initializeinfo
with default values.boolean
Compares twoGstVideoInfo
and returns whether they are equal or notRead the value of the fieldchroma_site
.Read the value of the fieldcolorimetry
.Read the value of the fieldfinfo
.Read the value of the fieldflags
.int
readFpsD()
Read the value of the fieldfps_d
.int
readFpsN()
Read the value of the fieldfps_n
.int
Read the value of the fieldheight
.Read the value of the fieldinterlace_mode
.long[]
Read the value of the fieldoffset
.int
readParD()
Read the value of the fieldpar_d
.int
readParN()
Read the value of the fieldpar_n
.long
readSize()
Read the value of the fieldsize
.int[]
Read the value of the fieldstride
.int
Read the value of the fieldviews
.int
Read the value of the fieldwidth
.boolean
setFormat
(VideoFormat format, int width, int height) Set the default info for a video frame offormat
andwidth
andheight
.boolean
setInterlacedFormat
(VideoFormat format, VideoInterlaceMode mode, int width, int height) Same asgst_video_info_set_format
but also allowing to set the interlaced mode.toCaps()
Convert the values of this VideoInfo into aGstCaps
.static boolean
Parsecaps
and updateinfo
.void
writeChromaSite
(Set<VideoChromaSite> chromaSite) Write a value in the fieldchroma_site
.void
writeColorimetry
(VideoColorimetry colorimetry) Write a value in the fieldcolorimetry
.void
writeFinfo
(VideoFormatInfo finfo) Write a value in the fieldfinfo
.void
writeFlags
(Set<VideoFlags> flags) Write a value in the fieldflags
.void
writeFpsD
(int fpsD) Write a value in the fieldfps_d
.void
writeFpsN
(int fpsN) Write a value in the fieldfps_n
.void
writeHeight
(int height) Write a value in the fieldheight
.void
writeInterlaceMode
(VideoInterlaceMode interlaceMode) Write a value in the fieldinterlace_mode
.void
writeOffset
(long[] offset, Arena _arena) Write a value in the fieldoffset
.void
writeParD
(int parD) Write a value in the fieldpar_d
.void
writeParN
(int parN) Write a value in the fieldpar_n
.void
writeSize
(long size) Write a value in the fieldsize
.void
writeStride
(int[] stride, Arena _arena) Write a value in the fieldstride
.void
writeViews
(int views) Write a value in the fieldviews
.void
writeWidth
(int width) Write a value in the fieldwidth
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
VideoInfo
Create a VideoInfo proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
VideoInfo
public VideoInfo()Allocate a newGstVideoInfo
that is also initialized with gst_video_info_init().
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readFinfo
Read the value of the fieldfinfo
.- Returns:
- The value of the field
finfo
-
writeFinfo
Write a value in the fieldfinfo
.- Parameters:
finfo
- The new value for the fieldfinfo
-
readInterlaceMode
Read the value of the fieldinterlace_mode
.- Returns:
- The value of the field
interlace_mode
-
writeInterlaceMode
Write a value in the fieldinterlace_mode
.- Parameters:
interlaceMode
- The new value for the fieldinterlace_mode
-
readFlags
Read the value of the fieldflags
.- Returns:
- The value of the field
flags
-
writeFlags
Write a value in the fieldflags
.- Parameters:
flags
- The new value for the fieldflags
-
readWidth
public int readWidth()Read the value of the fieldwidth
.- Returns:
- The value of the field
width
-
writeWidth
public void writeWidth(int width) Write a value in the fieldwidth
.- Parameters:
width
- The new value for the fieldwidth
-
readHeight
public int readHeight()Read the value of the fieldheight
.- Returns:
- The value of the field
height
-
writeHeight
public void writeHeight(int height) Write a value in the fieldheight
.- Parameters:
height
- The new value for the fieldheight
-
readSize
public long readSize()Read the value of the fieldsize
.- Returns:
- The value of the field
size
-
writeSize
public void writeSize(long size) Write a value in the fieldsize
.- Parameters:
size
- The new value for the fieldsize
-
readViews
public int readViews()Read the value of the fieldviews
.- Returns:
- The value of the field
views
-
writeViews
public void writeViews(int views) Write a value in the fieldviews
.- Parameters:
views
- The new value for the fieldviews
-
readChromaSite
Read the value of the fieldchroma_site
.- Returns:
- The value of the field
chroma_site
-
writeChromaSite
Write a value in the fieldchroma_site
.- Parameters:
chromaSite
- The new value for the fieldchroma_site
-
readColorimetry
Read the value of the fieldcolorimetry
.- Returns:
- The value of the field
colorimetry
-
writeColorimetry
Write a value in the fieldcolorimetry
.- Parameters:
colorimetry
- The new value for the fieldcolorimetry
-
readParN
public int readParN()Read the value of the fieldpar_n
.- Returns:
- The value of the field
par_n
-
writeParN
public void writeParN(int parN) Write a value in the fieldpar_n
.- Parameters:
parN
- The new value for the fieldpar_n
-
readParD
public int readParD()Read the value of the fieldpar_d
.- Returns:
- The value of the field
par_d
-
writeParD
public void writeParD(int parD) Write a value in the fieldpar_d
.- Parameters:
parD
- The new value for the fieldpar_d
-
readFpsN
public int readFpsN()Read the value of the fieldfps_n
.- Returns:
- The value of the field
fps_n
-
writeFpsN
public void writeFpsN(int fpsN) Write a value in the fieldfps_n
.- Parameters:
fpsN
- The new value for the fieldfps_n
-
readFpsD
public int readFpsD()Read the value of the fieldfps_d
.- Returns:
- The value of the field
fps_d
-
writeFpsD
public void writeFpsD(int fpsD) Write a value in the fieldfps_d
.- Parameters:
fpsD
- The new value for the fieldfps_d
-
readOffset
public long[] readOffset()Read the value of the fieldoffset
.- Returns:
- The value of the field
offset
-
writeOffset
Write a value in the fieldoffset
.- Parameters:
offset
- The new value for the fieldoffset
_arena
- to control the memory allocation scope
-
readStride
public int[] readStride()Read the value of the fieldstride
.- Returns:
- The value of the field
stride
-
writeStride
Write a value in the fieldstride
.- Parameters:
stride
- The new value for the fieldstride
_arena
- to control the memory allocation scope
-
fromCaps
-
withCaps
-
init
Initializeinfo
with default values.- Parameters:
info
- aGstVideoInfo
-
align
Adjust the offset and stride fields in this VideoInfo so that the padding and stride alignment inalign
is respected.Extra padding will be added to the right side when stride alignment padding is required and
align
will be updated with the new padding values.- Parameters:
align
- alignment parameters- Returns:
false
if alignment could not be applied, e.g. because the size of a frame can't be represented as a 32 bit integer (Since: 1.12)
-
alignFull
Extra padding will be added to the right side when stride alignment padding is required andalign
will be updated with the new padding values.This variant of gst_video_info_align() provides the updated size, in bytes, of each video plane after the alignment, including all horizontal and vertical paddings.
In case of GST_VIDEO_INTERLACE_MODE_ALTERNATE info, the returned sizes are the ones used to hold a single field, not the full frame.
- Parameters:
align
- alignment parametersplaneSize
- array used to store the plane sizes- Returns:
false
if alignment could not be applied, e.g. because the size of a frame can't be represented as a 32 bit integer
-
convert
Converts among variousGstFormat
types. This function handles GST_FORMAT_BYTES, GST_FORMAT_TIME, and GST_FORMAT_DEFAULT. For raw video, GST_FORMAT_DEFAULT corresponds to video frames. This function can be used to handle pad queries of the type GST_QUERY_CONVERT.- Parameters:
srcFormat
-GstFormat
of thesrcValue
srcValue
- value to convertdestFormat
-GstFormat
of thedestValue
destValue
- pointer to destination value- Returns:
- TRUE if the conversion was successful.
-
copy
Copy a GstVideoInfo structure.- Returns:
- a new
GstVideoInfo
. free with gst_video_info_free.
-
free
public void free()Free a GstVideoInfo structure previously allocated with gst_video_info_new() or gst_video_info_copy(). -
isEqual
Compares twoGstVideoInfo
and returns whether they are equal or not- Parameters:
other
- aGstVideoInfo
- Returns:
true
if this VideoInfo andother
are equal, elsefalse
.
-
setFormat
Set the default info for a video frame offormat
andwidth
andheight
.Note: This initializes this VideoInfo first, no values are preserved. This function does not set the offsets correctly for interlaced vertically subsampled formats.
- Parameters:
format
- the formatwidth
- a widthheight
- a height- Returns:
false
if the returned video info is invalid, e.g. because the size of a frame can't be represented as a 32 bit integer (Since: 1.12)
-
setInterlacedFormat
public boolean setInterlacedFormat(VideoFormat format, VideoInterlaceMode mode, int width, int height) Same asgst_video_info_set_format
but also allowing to set the interlaced mode.- Parameters:
format
- the formatmode
- aGstVideoInterlaceMode
width
- a widthheight
- a height- Returns:
false
if the returned video info is invalid, e.g. because the size of a frame can't be represented as a 32 bit integer.
-
toCaps
Convert the values of this VideoInfo into aGstCaps
.- Returns:
- a new
GstCaps
containing the info of this VideoInfo.
-