Package org.freedesktop.gstreamer.video
Class VideoInfo
java.lang.Object
org.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
ConstructorsConstructorDescriptionAllocate a newGstVideoInfothat 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 TypeMethodDescriptionbooleanalign(VideoAlignment align) Adjust the offset and stride fields in this VideoInfo so that the padding and stride alignment inalignis respected.booleanalignFull(VideoAlignment align, @Nullable Out<Long> planeSize) Extra padding will be added to the right side when stride alignment padding is required andalignwill be updated with the new padding values.booleanConverts among variousGstFormattypes.copy()Copy a GstVideoInfo structure.voidfree()Free a GstVideoInfo structure previously allocated with gst_video_info_new() or gst_video_info_copy().static VideoInfoParsecapsto generate aGstVideoInfo.static MemoryLayoutThe memory layout of the native struct.static @Nullable TypegetType()Get the GType of the VideoInfo classstatic voidInitializeinfowith default values.booleanCompares twoGstVideoInfoand returns whether they are equal or notRead the value of the fieldchroma_site.@Nullable VideoColorimetryRead the value of the fieldcolorimetry.Read the value of the fieldfinfo.Read the value of the fieldflags.intreadFpsD()Read the value of the fieldfps_d.intreadFpsN()Read the value of the fieldfps_n.intRead the value of the fieldheight.Read the value of the fieldinterlace_mode.@org.jspecify.annotations.Nullable long @Nullable []Read the value of the fieldoffset.intreadParD()Read the value of the fieldpar_d.intreadParN()Read the value of the fieldpar_n.longreadSize()Read the value of the fieldsize.@org.jspecify.annotations.Nullable int @Nullable []Read the value of the fieldstride.intRead the value of the fieldviews.intRead the value of the fieldwidth.booleansetFormat(VideoFormat format, int width, int height) Set the default info for a video frame offormatandwidthandheight.booleansetInterlacedFormat(VideoFormat format, VideoInterlaceMode mode, int width, int height) Same asgst_video_info_set_formatbut also allowing to set the interlaced mode.toCaps()Convert the values of this VideoInfo into aGstCaps.static booleanParsecapsand updateinfo.voidwriteChromaSite(Set<VideoChromaSite> chromaSite) Write a value in the fieldchroma_site.voidwriteColorimetry(@Nullable VideoColorimetry colorimetry) Write a value in the fieldcolorimetry.voidwriteFinfo(VideoFormatInfo finfo) Write a value in the fieldfinfo.voidwriteFlags(Set<VideoFlags> flags) Write a value in the fieldflags.voidwriteFpsD(int fpsD) Write a value in the fieldfps_d.voidwriteFpsN(int fpsN) Write a value in the fieldfps_n.voidwriteHeight(int height) Write a value in the fieldheight.voidwriteInterlaceMode(VideoInterlaceMode interlaceMode) Write a value in the fieldinterlace_mode.voidwriteOffset(@org.jspecify.annotations.Nullable long @Nullable [] offset, Arena _arena) Write a value in the fieldoffset.voidwriteParD(int parD) Write a value in the fieldpar_d.voidwriteParN(int parN) Write a value in the fieldpar_n.voidwriteSize(long size) Write a value in the fieldsize.voidwriteStride(@org.jspecify.annotations.Nullable int @Nullable [] stride, Arena _arena) Write a value in the fieldstride.voidwriteViews(int views) Write a value in the fieldviews.voidwriteWidth(int width) Write a value in the fieldwidth.Methods inherited from class org.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 newGstVideoInfothat is also initialized with gst_video_info_init().- Since:
- 1.6
-
-
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 @org.jspecify.annotations.Nullable long @Nullable [] 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
-
readStride
public @org.jspecify.annotations.Nullable int @Nullable [] 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
-
fromCaps
-
withCaps
-
init
Initializeinfowith default values.- Parameters:
info- aGstVideoInfo
-
align
Adjust the offset and stride fields in this VideoInfo so that the padding and stride alignment inalignis respected.Extra padding will be added to the right side when stride alignment padding is required and
alignwill be updated with the new padding values.- Parameters:
align- alignment parameters- Returns:
falseif 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 andalignwill 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:
falseif alignment could not be applied, e.g. because the size of a frame can't be represented as a 32 bit integer- Since:
- 1.18
-
convert
Converts among variousGstFormattypes. 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-GstFormatof thesrcValuesrcValue- value to convertdestFormat-GstFormatof thedestValuedestValue- 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. - Since:
- 1.6
-
free
public void free()Free a GstVideoInfo structure previously allocated with gst_video_info_new() or gst_video_info_copy().- Since:
- 1.6
-
isEqual
Compares twoGstVideoInfoand returns whether they are equal or not- Parameters:
other- aGstVideoInfo- Returns:
trueif this VideoInfo andotherare equal, elsefalse.
-
setFormat
Set the default info for a video frame offormatandwidthandheight.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:
falseif 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_formatbut also allowing to set the interlaced mode.- Parameters:
format- the formatmode- aGstVideoInterlaceModewidth- a widthheight- a height- Returns:
falseif 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.16
-
toCaps
Convert the values of this VideoInfo into aGstCaps.- Returns:
- a new
GstCapscontaining the info ofinfo.
-