v1.0.0
This is the first full release of gst1-java-core v1. The bulk of the work leading up to this release has been finalising, stabilising and documenting the API outside of the lowlevel package, completing the work of porting the original 0.10 bindings.
Key changes
Changes in beta 1
- All classes have been audited, non-functional legacy methods removed or replaced, documentation updated and links added to upstream GStreamer documentation where appropriate. Any methods exposing lowlevel classes have been removed or rewritten.
- Minimum requirements have been updated to Java 8 and JNA 5.2.
- Version support has been added to
Gst.init()
. The minimum GStreamer requirement remains 1.8, although this is now enforced. If you require features that require a later version of GStreamer, you must use the version ofGst.init(...)
that takes a Version or these mappings will be disabled. eg.Gst.init(new Version(1, 14))
. There is also an annotation@Gst.Since(minor = 14)
for use on classes, methods and constants that require later versions - this annotation is included in the JavaDoc. - Non-functional legacy classes have been removed, including all of the controller package and various interface classes.
- GObject, GError and various GIO related classes have been moved into the GLib package. This is an initial step towards separating out GStreamer and GLib bindings into separate libraries in future.
- NativeObject and various other lowlevel classes have been moved out of lowlevel and into the GLib package as official API.
- Event, Message and Query, as well as related classes have been moved into their respective packages, partly to improve encapsulation.
- WebRTC classes have been moved into their own package.
- Enums have been rewritten around
NativeEnum
andNativeFlag
interfaces (in GLib package). Methods acceptingint
flags (eg.SeekFlags
) now takeEnumSet
and related int constants are now enum. - Methods accepting or returning
ClockTime
now take or return along
. This is for efficiency and consistency - GLib does not give all type information required to be consistent here. NB. the value is an unsigned 64-bit integer value in nanoseconds.ClockTime
remains as a collection of utility methods for working with these values. It still doesn't (yet) correctly handle "negative" values. - New memory handling and removal of finalization. A new
NativeObject.Handle
type wraps all native pointers, and subclasses implement all ref, unref, free, etc. Handle subclasses should be used to call different native functions in these cases. Memory handling is a cleaner-like mechanism, but using the existing weak reference cache rather than additional phantom references. In the past, onlyGObject
instances were cached to ensure the sameNativeObject
was returned for any pointer - this now applies to allNativeObject
subclasses. All garbage collection tests pass with the new code, but there may be possibility for regressions caused by slightly different behaviour. - A new
Natives
utility class provides access to methods required for translating to and from Java objects and native representations where required, including translation into aGPointer
(see below) or rawPointer
.Natives.objectFor()
methods replicate functionality previously inNativeObject
to get the Java representation of a native reference. These should be used in all cases in favour ofNativeObject.Initializer
except where the native call is a constructor. - New extension mechanism to register additional
NativeObject
subclasses (it was theoretically possible to achieve this before, but with major caveats and unsupported). SeeNativeObject.TypeRegistration
andNatives.registration(..)
. Instances ofNativeObject.TypeProvider
should be made available by the standard JavaServiceLoader
mechanism. Internal types use the same mechanism, reducing uses of reflection in the library. GPointer
and subclasses have been added to thelowlevel
package. These are subclasses of JNA'sPointerType
and will form the basis of native mapping in future. They are already required for Handle-related functionality. They may become part of the API in future. Using anything else in lowlevel will likely break from release to release. Lowlevel is no longer included in the JavaDoc.- Travis CI configuration added. All future PR's must pass before integration, and should include tests where appropriate. The current CI only covers GStreamer 1.8 (baseline), but will be extended to include testing on later GStreamer as well. Tests may need to be version aware if they target features higher than 1.8.
Additional changes from beta 2
- FIX make sure
GObject
subclasses can be GC'd after explicit call todispose()
- fixes #146 - Minor updates to
NativeObject.Handle
API and added documentation. The atomic reference and boolean fields are now correctly private (mistakenly left protected in beta-1).ownsHandle()
renamed asownsReference()
. - Move
GObject
signal andPad
probe native management intoHandle
to ensure the callbacks are removed when GC'd as before.- Behavioural change - all callbacks are now disconnected on explicit calls to
invalidate()
anddispose()
. In general make sure to keep references to objects with callbacks and dispose of them explicitly - relying on the GC for this is not recommended. - The Pad method for adding an event probe with an
int
mask has been removed from the API. - Event probe testing has been fixed.
- Behavioural change - all callbacks are now disconnected on explicit calls to
NativeObject
now implementsAutoCloseable
. Defaults to callingdispose()
.- FIX getting a
GObject
subclass from aGValue
will now return a caller-owned reference (switched tog_value_dup_object
). Iterating objects, eg. by callinggetPads()
would return and cache unowned objects whose lifecycle was not correctly tracked. This might cause regressions if code relied on the old behaviour. Bus
disposal is now linked toPipeline
lifecycle. Bus instances will be GC'd even when not explicitly closed. Test for this no longer ignored.- Added a system property to detach callback threads (workaround for #147 where JNA isn't clearing thread proxies on macOS) - use
-Dglib.detachCallbackThreads=true