Skip to content

Commit 440a91e

Browse files
Refactor and document classes under main org.freedesktop.gstreamer package. Move event classes to event package, message classes to message package, query classes to query package, and webrtc classes to webrtc package. Delete various unused classes, and deprecate methods to be removed later.
1 parent f59a503 commit 440a91e

File tree

140 files changed

+3613
-3550
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+3613
-3550
lines changed

src/org/freedesktop/gstreamer/Bin.java

Lines changed: 161 additions & 133 deletions
Large diffs are not rendered by default.

src/org/freedesktop/gstreamer/Buffer.java

Lines changed: 130 additions & 143 deletions
Large diffs are not rendered by default.

src/org/freedesktop/gstreamer/BufferFlag.java

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
* Copyright (c) 2019 Neil C Smith
23
* Copyright (C) 2007 Wayne Meissner
34
* Copyright (C) 1999,2000 Erik Walthinsen <[email protected]>
45
* 2000 Wim Taymans <[email protected]>
@@ -20,13 +21,12 @@
2021

2122
package org.freedesktop.gstreamer;
2223

23-
import org.freedesktop.gstreamer.lowlevel.IntegerEnum;
24-
import org.freedesktop.gstreamer.lowlevel.annotations.DefaultEnumValue;
24+
import org.freedesktop.gstreamer.glib.NativeFlags;
2525

2626
/**
2727
* A set of buffer flags used to describe properties of a {@link Buffer}.
2828
*/
29-
public enum BufferFlag implements IntegerEnum {
29+
public enum BufferFlag implements NativeFlags<BufferFlag> {
3030

3131
/**
3232
* the {@link Buffer} is live data and should be discarded in the PAUSED state.
@@ -93,12 +93,21 @@ public enum BufferFlag implements IntegerEnum {
9393
*/
9494
SYNC_AFTER(MiniObjectFlags.LAST.intValue() << 11),
9595

96+
/**
97+
* This buffer is important and should not be dropped. This can be used to
98+
* mark important buffers, e.g. to flag RTP packets carrying keyframes or
99+
* codec setup data for RTP Forward Error Correction purposes, or to prevent
100+
* still video frames from being dropped by elements due to QoS. (Since
101+
* 1.14)
102+
103+
*/
104+
@Gst.Since(minor = 14)
105+
NON_DROPPABLE(MiniObjectFlags.LAST.intValue() << 12),
106+
96107
/* padding */
97-
LAST(MiniObjectFlags.LAST.intValue() << 16),
108+
LAST(MiniObjectFlags.LAST.intValue() << 16);
98109

99-
/** The value used for unknown native values */
100-
@DefaultEnumValue
101-
UNKNOWN(~0);
110+
private final int value;
102111

103112
private BufferFlag(int value) {
104113
this.value = value;
@@ -111,5 +120,4 @@ public final int intValue() {
111120
return value;
112121
}
113122

114-
private final int value;
115123
}

src/org/freedesktop/gstreamer/BufferPool.java

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
* Copyright (c) 2019 Neil C Smith
23
* Copyright (c) 2016 Christophe Lafolet
34
*
45
* This file is part of gstreamer-java.
@@ -21,30 +22,51 @@
2122

2223
import com.sun.jna.Pointer;
2324

25+
/**
26+
* A BufferPool is an object that can be used to pre-allocate and recycle
27+
* buffers of the same size and with the same properties.
28+
* <p>
29+
* See upstream documentation at
30+
* <a href="https://gstreamer.freedesktop.org/data/doc/gstreamer/stable/gstreamer/html/GstBufferPool.html"
31+
* >https://gstreamer.freedesktop.org/data/doc/gstreamer/stable/gstreamer/html/GstBufferPool.html</a>
32+
*/
2433
public class BufferPool extends GstObject {
2534

2635
public static final String GTYPE_NAME = "GstBufferPool";
2736

37+
/**
38+
* Creates a new instance of BufferPool
39+
*/
40+
public BufferPool() {
41+
this(initializer(GstBufferPoolAPI.GSTBUFFERPOOL_API.ptr_gst_buffer_pool_new()));
42+
}
43+
2844
/**
2945
* This constructor is for internal use only.
3046
* @param init initialization data.
3147
*/
32-
public BufferPool(final Initializer init) {
48+
BufferPool(final Initializer init) {
3349
super(init);
3450
}
3551

3652
/**
37-
* Creates a new instance of BufferPool
53+
* Configure the BufferPool with the given parameters.
54+
*
55+
* @param caps the {@link Caps} for the buffers
56+
* @param size the size of each buffer, not including prefix and padding
57+
* @param min_buffers the minimum amount of buffers to allocate
58+
* @param max_buffers the maximum amount of buffers to allocate or 0 for unlimited
3859
*/
39-
public BufferPool() {
40-
this(initializer(GstBufferPoolAPI.GSTBUFFERPOOL_API.ptr_gst_buffer_pool_new()));
41-
}
42-
4360
public void setParams(Caps caps, int size, int min_buffers, int max_buffers) {
4461
Structure config = GstBufferPoolAPI.GSTBUFFERPOOL_API.gst_buffer_pool_get_config(this);
4562
GstBufferPoolAPI.GSTBUFFERPOOL_API.gst_buffer_pool_config_set_params(config, caps, size, min_buffers, max_buffers);
4663
}
4764

65+
/**
66+
* Query the {@link Caps} configured on the BufferPool.
67+
*
68+
* @return Caps configured on the BufferPool
69+
*/
4870
public Caps getCaps() {
4971
Structure config = GstBufferPoolAPI.GSTBUFFERPOOL_API.gst_buffer_pool_get_config(this);
5072
Pointer[] ptr = new Pointer[1];

0 commit comments

Comments
 (0)