Skip to content

Commit

Permalink
Update docs and release 0.9.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
neilcsmith-net committed Oct 31, 2019
1 parent c4a2e8d commit ed63052
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.freedesktop.gstreamer</groupId>
<artifactId>gst1-java-swing</artifactId>
<version>0.9.0-SNAPSHOT</version>
<version>0.9.0</version>
<packaging>jar</packaging>

<name>GStreamer 1.x Java Swing</name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/*
* Copyright (c) 2019 Neil C Smith
* Copyright (c) 2007 Wayne Meissner
*
* This file is part of gstreamer-java.
*
* This code is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 3 only, as
Expand Down Expand Up @@ -52,14 +50,14 @@
import org.freedesktop.gstreamer.Sample;

/**
*
* A Swing component for displaying video from a GStreamer pipeline.
*/
public class GstVideoComponent extends javax.swing.JComponent {

private final Lock bufferLock = new ReentrantLock();
private final AppSink videosink;
private final boolean useVolatile;

private BufferedImage currentImage = null;
private RenderComponent renderComponent = new RenderComponent();
private boolean keepAspect = true;
Expand All @@ -69,14 +67,15 @@ public class GstVideoComponent extends javax.swing.JComponent {
private volatile boolean updatePending = false;

/**
* Creates a new instance of GstVideoComponent
* Create a GstVideoComponent. A new AppSink element will be created that
* can be accessed using {@link #getElement()} and added to a pipeline.
*/
public GstVideoComponent() {
this(new AppSink("GstVideoComponent"));
}

/**
* Creates a new instance of GstVideoComponent
* Create a GstVideoComponent wrapping the provided AppSink element.
*/
public GstVideoComponent(AppSink appsink) {
this.videosink = appsink;
Expand Down Expand Up @@ -182,10 +181,21 @@ public void actionPerformed(ActionEvent arg0) {
}
};

/**
* Get the wrapped AppSink element.
*
* @return sink element
*/
public Element getElement() {
return videosink;
}

/**
* Set whether to respect the aspect ratio of the video when scaling.
* Defaults to true.
*
* @param keepAspect respect aspect ratio
*/
public void setKeepAspect(boolean keepAspect) {
this.keepAspect = keepAspect;
}
Expand Down

0 comments on commit ed63052

Please sign in to comment.