Class EncodingProfile
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.gobject.TypeInstance
org.gnome.gobject.GObject
org.freedesktop.gstreamer.pbutils.EncodingProfile
- All Implemented Interfaces:
Proxy
- Direct Known Subclasses:
EncodingAudioProfile
,EncodingContainerProfile
,EncodingVideoProfile
The opaque base class object for all encoding profiles. This contains generic
information like name, description, format and preset.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
EncodingProfile.Builder<B extends EncodingProfile.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionEncodingProfile
(MemorySegment address) Create a EncodingProfile proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected EncodingProfile
asParent()
Returns this instance as if it were its parent type.static EncodingProfile.Builder
<? extends EncodingProfile.Builder> builder()
AEncodingProfile.Builder
object constructs aEncodingProfile
with the specified properties.copy()
Makes a deep copy of this EncodingProfilestatic EncodingProfile
Find theGstEncodingProfile
with the specified name and category.static EncodingProfile
fromDiscoverer
(DiscovererInfo info) Creates aGstEncodingProfile
matching the formats from the givenGstDiscovererInfo
.boolean
Get whether the format that has been negotiated in at some point can be renegotiated later during the encoding.Computes the full output caps that this this EncodingProfile will be able to consume.getName()
int
boolean
static Type
getType()
Get the GType of the EncodingProfile classboolean
boolean
Checks whether the twoGstEncodingProfile
are equalvoid
setAllowDynamicOutput
(boolean allowDynamicOutput) Sets whether the format that has been negotiated in at some point can be renegotiated later during the encoding.void
setDescription
(@Nullable String description) Setdescription
as the given description for the this EncodingProfile.void
setElementProperties
(Structure elementProperties) This allows setting the muxing/encoding element properties.void
setEnabled
(boolean enabled) Set whether the profile should be used or not.void
Sets the media format used in the profile.void
Setname
as the given name for the this EncodingProfile.void
setPresence
(int presence) Set the number of time the profile is used in its parent container profile.void
Sets the name of theGstElement
that implements theGstPreset
interface to use for the profile.void
setPresetName
(@Nullable String presetName) Sets the name of theGstPreset
's factory to be used in the profile.void
setRestriction
(@Nullable Caps restriction) Set the restrictionGstCaps
to apply before the encoder that will be used in the profile.void
setSingleSegment
(boolean singleSegment) If using a single segment, buffers will be retimestamped and segments will be eat so as to appear as one segment.Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getMemoryLayout, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
EncodingProfile
Create a EncodingProfile proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
find
public static EncodingProfile find(String targetname, @Nullable @Nullable String profilename, @Nullable @Nullable String category) Find theGstEncodingProfile
with the specified name and category.- Parameters:
targetname
- The name of the targetprofilename
- The name of the profile, ifnull
provided, it will default to the encoding profile calleddefault
.category
- The target category. Can benull
- Returns:
- The matching
GstEncodingProfile
ornull
.
-
fromDiscoverer
Creates aGstEncodingProfile
matching the formats from the givenGstDiscovererInfo
. Streams other than audio or video (eg, subtitles), are currently ignored.- Parameters:
info
- TheGstDiscovererInfo
to read from- Returns:
- The new
GstEncodingProfile
ornull
.
-
copy
Makes a deep copy of this EncodingProfile- Returns:
- The copy of this EncodingProfile
-
getAllowDynamicOutput
public boolean getAllowDynamicOutput()Get whether the format that has been negotiated in at some point can be renegotiated later during the encoding. -
getDescription
-
getElementProperties
-
getFileExtension
-
getFormat
-
getInputCaps
Computes the full output caps that this this EncodingProfile will be able to consume.- Returns:
- The full caps the given this EncodingProfile can consume. Call gst_caps_unref() when you are done with the caps.
-
getName
-
getPresence
public int getPresence() -
getPreset
-
getPresetName
-
getRestriction
-
getSingleSegment
public boolean getSingleSegment() -
getTypeNick
-
isEnabled
public boolean isEnabled() -
isEqual
Checks whether the twoGstEncodingProfile
are equal- Parameters:
b
- aGstEncodingProfile
- Returns:
true
if this EncodingProfile andb
are equal, elsefalse
.
-
setAllowDynamicOutput
public void setAllowDynamicOutput(boolean allowDynamicOutput) Sets whether the format that has been negotiated in at some point can be renegotiated later during the encoding.- Parameters:
allowDynamicOutput
- Whether the format that has been negotiated first can be renegotiated during the encoding
-
setDescription
Setdescription
as the given description for the this EncodingProfile. A copy ofdescription
will be made internally.- Parameters:
description
- the description to set on the profile
-
setElementProperties
This allows setting the muxing/encoding element properties.**Set properties generically**
[element-properties, boolean-prop=true, string-prop="hi"]
**Mapping properties with well known element factories**
element-properties-map, map = { [openh264enc, gop-size=32, ], [x264enc, key-int-max=32, tune=zerolatency], }
- Parameters:
elementProperties
- AGstStructure
defining the properties to be set to the element the profile represents.
-
setEnabled
public void setEnabled(boolean enabled) Set whether the profile should be used or not.- Parameters:
enabled
-false
to disable this EncodingProfile,true
to enable it
-
setFormat
Sets the media format used in the profile.- Parameters:
format
- the media format to use in the profile.
-
setName
Setname
as the given name for the this EncodingProfile. A copy ofname
will be made internally.- Parameters:
name
- the name to set on the profile
-
setPresence
public void setPresence(int presence) Set the number of time the profile is used in its parent container profile. If 0, it is not a mandatory stream- Parameters:
presence
- the number of time the profile can be used
-
setPreset
Sets the name of theGstElement
that implements theGstPreset
interface to use for the profile. This is the name that has been set when saving the preset.- Parameters:
preset
- the element preset to use
-
setPresetName
Sets the name of theGstPreset
's factory to be used in the profile.- Parameters:
presetName
- The name of the preset to use in this this EncodingProfile.
-
setRestriction
Set the restrictionGstCaps
to apply before the encoder that will be used in the profile. See gst_encoding_profile_get_restriction() for more about restrictions. Does not apply toGstEncodingContainerProfile
.- Parameters:
restriction
- the restriction to apply
-
setSingleSegment
public void setSingleSegment(boolean singleSegment) If using a single segment, buffers will be retimestamped and segments will be eat so as to appear as one segment.*NOTE*: Single segment is not property supported when using
encodebin
:avoid-reencoding- Parameters:
singleSegment
-TRUE
if the stream represented by this EncodingProfile should use a single segment before the encoder,FALSE
otherwise.
-
builder
AEncodingProfile.Builder
object constructs aEncodingProfile
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withEncodingProfile.Builder.build()
.
-