a little help with linkpads please

22 views
Skip to first unread message

gst...@ccc2.com

unread,
Feb 27, 2012, 6:25:21 AM2/27/12
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);
}
}

Tal Shalif

unread,
Feb 27, 2012, 8:23:14 AM2/27/12
to gstream...@googlegroups.com
Check your code. Check your Java syntax. You don't have an object named 'src', so the compiler complains.


--
You received this message because you are subscribed to the Google Groups "gstreamer-java" group.
To post to this group, send email to gstream...@googlegroups.com.
To unsubscribe from this group, send email to gstreamer-jav...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gstreamer-java?hl=en.


Reply all
Reply to author
Forward
0 new messages