Skip to content

Commit ed63052

Browse files
Update docs and release 0.9.0.
1 parent c4a2e8d commit ed63052

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>org.freedesktop.gstreamer</groupId>
66
<artifactId>gst1-java-swing</artifactId>
7-
<version>0.9.0-SNAPSHOT</version>
7+
<version>0.9.0</version>
88
<packaging>jar</packaging>
99

1010
<name>GStreamer 1.x Java Swing</name>

src/main/java/org/freedesktop/gstreamer/swing/GstVideoComponent.java

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/*
22
* Copyright (c) 2019 Neil C Smith
33
* Copyright (c) 2007 Wayne Meissner
4-
*
5-
* This file is part of gstreamer-java.
64
*
75
* This code is free software: you can redistribute it and/or modify it under
86
* the terms of the GNU Lesser General Public License version 3 only, as
@@ -52,14 +50,14 @@
5250
import org.freedesktop.gstreamer.Sample;
5351

5452
/**
55-
*
53+
* A Swing component for displaying video from a GStreamer pipeline.
5654
*/
5755
public class GstVideoComponent extends javax.swing.JComponent {
5856

5957
private final Lock bufferLock = new ReentrantLock();
6058
private final AppSink videosink;
6159
private final boolean useVolatile;
62-
60+
6361
private BufferedImage currentImage = null;
6462
private RenderComponent renderComponent = new RenderComponent();
6563
private boolean keepAspect = true;
@@ -69,14 +67,15 @@ public class GstVideoComponent extends javax.swing.JComponent {
6967
private volatile boolean updatePending = false;
7068

7169
/**
72-
* Creates a new instance of GstVideoComponent
70+
* Create a GstVideoComponent. A new AppSink element will be created that
71+
* can be accessed using {@link #getElement()} and added to a pipeline.
7372
*/
7473
public GstVideoComponent() {
7574
this(new AppSink("GstVideoComponent"));
7675
}
7776

7877
/**
79-
* Creates a new instance of GstVideoComponent
78+
* Create a GstVideoComponent wrapping the provided AppSink element.
8079
*/
8180
public GstVideoComponent(AppSink appsink) {
8281
this.videosink = appsink;
@@ -182,10 +181,21 @@ public void actionPerformed(ActionEvent arg0) {
182181
}
183182
};
184183

184+
/**
185+
* Get the wrapped AppSink element.
186+
*
187+
* @return sink element
188+
*/
185189
public Element getElement() {
186190
return videosink;
187191
}
188192

193+
/**
194+
* Set whether to respect the aspect ratio of the video when scaling.
195+
* Defaults to true.
196+
*
197+
* @param keepAspect respect aspect ratio
198+
*/
189199
public void setKeepAspect(boolean keepAspect) {
190200
this.keepAspect = keepAspect;
191201
}

0 commit comments

Comments
 (0)