gst...@ccc2.com
unread,Feb 27, 2012, 6:25:21 AM2/27/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gstreamer-java
hi All,
Can you give me some advice on linkpads and how to write them.
In the below code if I leave the src/sink with or without quotes
Element.linkPads(decoder, src, ffcs, sink);
or
Element.linkPads(decoder, "src", ffcs, "sink");
I get the error
Exception in thread "main" java.lang.Error: Unresolved compilation
problems:
src cannot be resolved to a variable
sink cannot be resolved to a variable
at gst.VideoTest.main(VideoTest.java:33)
any advice on what I am missing?
thx
Art
package gst;
import org.gstreamer.Caps;
import org.gstreamer.Element;
import org.gstreamer.ElementFactory;
import org.gstreamer.Gst;
import org.gstreamer.Pipeline;
import org.gstreamer.State;
import com.sun.jna.Library;
public class VideoTest {
public VideoTest() {
}
private static Pipeline pipe;
public static void main(String[] args) {
args = Gst.init("VideoTest", args);
pipe = new Pipeline("VideoTest");
final Element source = ElementFactory.make("filesrc",
"source");
final Element decoder = ElementFactory.make("decodebin2",
"decoder");
final Element ffcs = ElementFactory.make("ffmpegcolorspace",
"ffcs");
final Element vidsc = ElementFactory.make("videoscale",
"vidsc");
final Element videofilter = ElementFactory.make("capsfilter",
"filter");
videofilter.setCaps(Caps.fromString("video/x-raw-yuv,
format=I420, width=640, height=352"
+ ", bpp=32, depth=32, framerate=25/1"));
final Element sinky = ElementFactory.make("filesink",
"sinky");
source.set("location", "/home/fifo/mpegpipe1.yuv");
sinky.set("location", "/home/fifo/mpegpipe99.yuv");
pipe.addMany(source, decoder, ffcs, vidsc, videofilter,
sinky);
Element.linkMany(source, decoder);
Element.linkPads(decoder, "src", ffcs, "sink");
Element.linkMany(ffcs, vidsc, videofilter, sinky);
pipe.setState(State.PLAYING);
Gst.main();
pipe.setState(State.NULL);
}
}