GNOME Bugzilla – Bug 796974
IllegalArgumentException while streaming video over ethernet (MPEG-TS )
Last modified: 2018-08-16 15:01:06 UTC
Hi everyone, I am getting this exception each time I try to stream video over ethernet by MPEG-TS in my software.Do you have solution ? JNA: Callback org.freedesktop.gstreamer.Bus$15@1871a69 threw the following exception: java.lang.IllegalArgumentException: No known Enum mapping for org.freedesktop.gstreamer.MessageType value=-2147483644 at org.freedesktop.gstreamer.lowlevel.EnumMapper.valueOf(EnumMapper.java:75) at org.freedesktop.gstreamer.lowlevel.GTypeMapper$4.fromNative(GTypeMapper.java:147) at com.sun.jna.Structure.readField(Structure.java:723) at com.sun.jna.Structure.readField(Structure.java:614) at org.freedesktop.gstreamer.lowlevel.SubtypeMapper$MessageMapper$MapHolder.subtypeFor(SubtypeMapper.java:135) at org.freedesktop.gstreamer.lowlevel.SubtypeMapper$MessageMapper.subtypeFor(SubtypeMapper.java:141) at org.freedesktop.gstreamer.lowlevel.SubtypeMapper.subtypeFor(SubtypeMapper.java:75) at org.freedesktop.gstreamer.lowlevel.NativeObject.classFor(NativeObject.java:221) at org.freedesktop.gstreamer.lowlevel.NativeObject.objectFor(NativeObject.java:193) at org.freedesktop.gstreamer.lowlevel.GTypeMapper$3.fromNative(GTypeMapper.java:129) at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:510) at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:551) Here is my code. public class SWTVideoTest { private static List<VideoComponent> components; private static void createControl(Composite parent) { Composite controlComposite = new Composite(parent, SWT.NONE); controlComposite.setLayout(new GridLayout(3, false)); controlComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); final Composite componentComposite = new Composite(parent, SWT.NONE); componentComposite.setLayout(new GridLayout(1, false)); componentComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); final Spinner num = new Spinner(controlComposite, SWT.NONE); num.setMinimum(1); num.setMaximum(20); Button add = new Button(controlComposite, SWT.NONE); add.setText("Add"); add.addListener(SWT.Selection, new Listener() { public void handleEvent(Event arg0) { List<VideoComponent> temp = new ArrayList<VideoComponent>(); if (components.size() == 0 && num.getSelection() == 1) componentComposite.setLayout(new GridLayout(1, false)); else componentComposite.setLayout(new GridLayout((components .size() + num.getSelection()) / 2, false)); for (int i = 0; i < num.getSelection(); i++) { temp.add(createComponenet(componentComposite)); } componentComposite.layout(); List<Thread> threads = new ArrayList<Thread>(); for (VideoComponent videoComponent : temp) { final Pipeline pipeline = (Pipeline) videoComponent .getData(); Thread thread = new Thread(new Runnable() { public void run() { pipeline.play(); System.out.println("PipeLine Start !"); // pipeline.getState(); // pipeline.debugToDotFile(Bin.DEBUG_GRAPH_SHOW_ALL, // "swt_video_test_pipeline"); } }, "pipeline"); threads.add(thread); } for (Thread thread : threads) { thread.start(); } } }); Button delete = new Button(controlComposite, SWT.NONE); delete.setText("Delete"); delete.addListener(SWT.Selection, new Listener() { public void handleEvent(Event arg0) { for (int i = 0; i < num.getSelection(); i++) { if (components.size() > 0) { VideoComponent component = components.get(components .size() - 1); deleteElement(component); } } componentComposite.layout(); } }); } private static void deleteElement(VideoComponent component) { Pipeline pipeline = (Pipeline) component.getData(); pipeline.stop(); pipeline.getState().equals(State.NULL); component.dispose(); components.remove(component); } private static VideoComponent createComponenet(final Composite parent) { Pipeline pipe = new Pipeline("SWT Overlay Test"); Element udpsrc = ElementFactory.make("udpsrc", "videotest"); udpsrc.set("port", 8000); Element queue = ElementFactory.make("queue", "queue"); Element caps = ElementFactory.make("capsfilter", "caps"); caps.setCaps(new Caps("video/mpegts")); Element tsdemux = ElementFactory.make("tsdemux","tsdemux"); Element h264parse = ElementFactory.make("h264parse","h264parse"); Element queue2 = ElementFactory.make("queue2","queue2"); Element avdec_h264 = ElementFactory.make("avdec_h264","avdec_h264"); Element videoconvert = ElementFactory.make("videoconvert","videoconvert"); VideoComponent component = new VideoComponent(parent, SWT.NONE); component.getElement().setName("video"); component.setKeepAspect(true); component.setLayoutData(new GridData(GridData.FILL_BOTH)); //sync false component.set("sync", "false"); Element sink = component.getElement(); component.setData(pipe); components.add(component); pipe.addMany(udpsrc,caps,queue,tsdemux,h264parse,queue2,avdec_h264,videoconvert,sink); Element.linkMany(udpsrc,caps,queue,tsdemux,h264parse,queue2,avdec_h264,videoconvert,sink); return component; } public static void main(String[] args) { args = Gst.init("SWTVideoTest", args); components = new ArrayList<VideoComponent>(); try { Display display = new Display(); Shell shell = new Shell(display); shell.setMaximized(true); shell.setLayout(new GridLayout(1, false)); shell.setText("SWT Video Test"); createControl(shell); shell.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent arg0) { List<VideoComponent> temp = new ArrayList<VideoComponent>(); temp.addAll(components); for (VideoComponent component : temp) { deleteElement(component); } } }); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } catch (Exception e) { e.printStackTrace(); } } }
I think the problem caused by the "tsdemux" but I am not sure.
This is a bug in the GStreamer Java bindings and them not properly mapping the message type C enum values to the Java enum values. You'll have to report that against the GStreamer Java bindings.
Thanks for your reply Sebastian, I am new member in bugzilla. I cant find Gstreamer Java Bindings issue. How can I report this issue to Gstreamer Java Bindings?
They are externally maintained here: https://github.com/gstreamer-java/gst1-java-core
*** Bug 796976 has been marked as a duplicate of this bug. ***
Are they fixed this issue in this repo ?
I don't know, maybe. But that's where the code lives, where you would report bugs and where it's maintained.