Package org.freedesktop.gstreamer.gst
Class Sample
java.lang.Object
org.javagi.base.ProxyInstance
org.freedesktop.gstreamer.gst.Sample
- All Implemented Interfaces:
Proxy
A
GstSample is a small object containing data, a type, timing and
extra arbitrary information.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Create a copy of the given sample.@Nullable BufferGet the buffer associated with this Sample@Nullable BufferListGet the buffer list associated with this Sample@Nullable CapsgetCaps()Get the caps associated with this Sample@Nullable StructuregetInfo()Get extra information associated withsample.Get the segment associated with this Samplestatic @Nullable TypegetType()Get the GType of the Sample classref()Increases the refcount of the given sample by one.voidSet the buffer associated withsample.this Sample must be writable.voidsetBufferList(BufferList bufferList) Set the buffer list associated withsample.this Sample must be writable.voidSet the caps associated withsample.this Sample must be writable.booleanSet the info structure associated withsample.this Sample must be writable, andinfomust not have a parent set already.voidsetSegment(Segment segment) Set the segment associated withsample.this Sample must be writable.voidunref()Decreases the refcount of the sample.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Sample
Create a Sample proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
Sample
public Sample(@Nullable Buffer buffer, @Nullable Caps caps, @Nullable Segment segment, @Nullable Structure info) Create a newGstSamplewith the provided details.Free-function: gst_sample_unref
- Parameters:
buffer- aGstBuffer, ornullcaps- aGstCaps, ornullsegment- aGstSegment, ornullinfo- aGstStructure, ornull
-
-
Method Details
-
getType
-
copy
Create a copy of the given sample. This will also make a newly allocated copy of the data the source sample contains.- Returns:
- a new copy of
sample. - Since:
- 1.2
-
getBuffer
Get the buffer associated with this Sample- Returns:
- the buffer of this Sample or
nullwhen there is no buffer. The buffer remains valid as long as this Sample is valid. If you need to hold on to it for longer than that, take a ref to the buffer with gst_buffer_ref().
-
getBufferList
Get the buffer list associated with this Sample- Returns:
- the buffer list of this Sample or
nullwhen there is no buffer list. The buffer list remains valid as long as this Sample is valid. If you need to hold on to it for longer than that, take a ref to the buffer list with gst_mini_object_ref (). - Since:
- 1.6
-
getCaps
Get the caps associated with this Sample- Returns:
- the caps of this Sample or
nullwhen there is no caps. The caps remain valid as long as this Sample is valid. If you need to hold on to the caps for longer than that, take a ref to the caps with gst_caps_ref().
-
getInfo
Get extra information associated withsample.- Returns:
- the extra info of
sample.The info remains valid as long as this Sample is valid.
-
getSegment
Get the segment associated with this Sample- Returns:
- the segment of
sample.The segment remains valid as long as this Sample is valid.
-
ref
-
setBuffer
Set the buffer associated withsample.this Sample must be writable.- Parameters:
buffer- AGstBuffer- Since:
- 1.16
-
setBufferList
Set the buffer list associated withsample.this Sample must be writable.- Parameters:
bufferList- aGstBufferList- Since:
- 1.6
-
setCaps
Set the caps associated withsample.this Sample must be writable.- Parameters:
caps- AGstCaps- Since:
- 1.16
-
setInfo
Set the info structure associated withsample.this Sample must be writable, andinfomust not have a parent set already.- Parameters:
info- AGstStructure- Since:
- 1.16
-
setSegment
Set the segment associated withsample.this Sample must be writable.- Parameters:
segment- AGstSegment- Since:
- 1.16
-
unref
public void unref()Decreases the refcount of the sample. If the refcount reaches 0, the sample will be freed.
-