gst_event_new_step

114 views
Skip to first unread message

DHoyt

unread,
Apr 13, 2010, 3:44:46 AM4/13/10
to gstreamer-java
I added the following to my code and I'm getting an exception in a
callback:

private static class StepEvent extends Event {
private static interface API extends com.sun.jna.Library {
Pointer gst_event_new_step(Format format, long amount, double
rate, boolean flush, boolean intermediate);
}
private static final API gst = GstNative.load(API.class);

public StepEvent(Initializer init) {
super(init);
}

public StepEvent(Format format, long amount, double rate, boolean
flush, boolean intermediate) {
super(initializer(gst.gst_event_new_step(format, amount, rate,
flush, intermediate)));
}
}

------

Here's the stack trace:

JNA: Callback org.gstreamer.Bus$15@6c2896 threw the following
exception:
java.lang.IllegalArgumentException: No known Enum mapping for
org.gstreamer.MessageType value=8388608
at org.gstreamer.lowlevel.EnumMapper.valueOf(EnumMapper.java:
74)
at org.gstreamer.lowlevel.GTypeMapper
$4.fromNative(GTypeMapper.java:147)
at com.sun.jna.Structure.readField(Structure.java:494)
at com.sun.jna.Structure.readField(Structure.java:413)
at org.gstreamer.lowlevel.SubtypeMapper$MessageMapper
$MapHolder.subtypeFor(SubtypeMapper.java:126)
at org.gstreamer.lowlevel.SubtypeMapper
$MessageMapper.subtypeFor(SubtypeMapper.java:132)
at
org.gstreamer.lowlevel.SubtypeMapper.subtypeFor(SubtypeMapper.java:70)
at
org.gstreamer.lowlevel.NativeObject.classFor(NativeObject.java:207)
at
org.gstreamer.lowlevel.NativeObject.objectFor(NativeObject.java:182)
at org.gstreamer.lowlevel.GTypeMapper
$3.fromNative(GTypeMapper.java:129)
at com.sun.jna.CallbackReference
$DefaultCallbackProxy.invokeCallback(CallbackReference.java:373)
at com.sun.jna.CallbackReference
$DefaultCallbackProxy.callback(CallbackReference.java:414)
at com.sun.jna.Function.invokeInt(Native Method)
at com.sun.jna.Function.invoke(Function.java:344)
at com.sun.jna.Function.invoke(Function.java:276)
at com.sun.jna.Library$Handler.invoke(Library.java:216)
at org.gstreamer.lowlevel.GNative$Handler.invoke(GNative.java:
213)
at $Proxy9.gst_element_send_event(Unknown Source)
at org.gstreamer.Element.sendEvent(Element.java:385)
at simple.swt.Main$MediaComponent.stepForward(Main.java:855)
at simple.swt.Main$9.widgetSelected(Main.java:293)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown
Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown
Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown
Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown
Source)
at simple.swt.Main.main(Main.java:334)

DHoyt

unread,
Apr 19, 2010, 5:33:15 PM4/19/10
to gstreamer-java
I fixed this by changing org.gstreamer.MessageType and adding the
following enum values:

ASYNC_DONE(1 << 21),

/* Added by me */
REQUEST_STATE(1 << 22),
STEP_START(1 << 23),
QOS(1 << 24),

ANY(~0);
--
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.

Tal Shalif

unread,
Apr 19, 2010, 8:55:03 PM4/19/10
to gstream...@googlegroups.com
Thanks. Here is the patch - if it makes it any easier:

Index: gstreamer-java/src/org/gstreamer/MessageType.java
===================================================================
--- gstreamer-java/src/org/gstreamer/MessageType.java    (revision 334)
+++ gstreamer-java/src/org/gstreamer/MessageType.java    (working copy)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009 Levente Farkas
+ * Copyright (C) 2009 Levente Farkas
  * Copyright (C) 2008 Wayne Meissner
  * Copyright (C) 2004 Wim Taymans <w...@fluendo.com>
  *
@@ -123,6 +123,22 @@
      * will only receive this message from the toplevel pipeline. Since: 0.10.13
      */
     ASYNC_DONE(1 << 21),
+    /**
+     * Posted by elements when they want the pipeline to change state. This message
+     * is a suggestion to the application which can decide to perform the
+     * state change on (part of) the pipeline. Since: 0.10.23.
+     */
+    REQUEST_STATE(1 << 22),
+    /**
+     * A stepping operation was started.
+     */
+    STEP_START(1 << 23),
+    /**
+     * A buffer was dropped or an element changed its processing strategy for
+     * Quality of Service reasons.
+     */
+    QOS(1 << 24),
+
     ANY(~0);
    
     MessageType(int type) {

Farkas Levente

unread,
Apr 20, 2010, 5:00:35 AM4/20/10
to gstream...@googlegroups.com, Tal Shalif
would you checkin this patch or send as an attachment?

On 04/20/2010 02:55 AM, Tal Shalif wrote:
> Thanks. Here is the patch - if it makes it any easier:
>
> Index: gstreamer-java/src/org/gstreamer/MessageType.java
> ===================================================================
> --- gstreamer-java/src/org/gstreamer/MessageType.java (revision 334)
> +++ gstreamer-java/src/org/gstreamer/MessageType.java (working copy)
> @@ -1,5 +1,5 @@
> /*
> - * Copyright (c) 2009 Levente Farkas
> + * Copyright (C) 2009 Levente Farkas
> * Copyright (C) 2008 Wayne Meissner
> * Copyright (C) 2004 Wim Taymans <w...@fluendo.com
> <mailto:w...@fluendo.com>>
> <mailto:david....@gmail.com>> wrote:
>
> I fixed this by changing org.gstreamer.MessageType and adding the
> following enum values:
>
> ASYNC_DONE(1 << 21),
>
> /* Added by me */
> REQUEST_STATE(1 << 22),
> STEP_START(1 << 23),
> QOS(1 << 24),
>
> ANY(~0);
>
> On Apr 13, 12:44 am, DHoyt <david.g.h...@gmail.com
> <mailto:gstream...@googlegroups.com>.
> To unsubscribe from this group, send email to
> gstreamer-jav...@googlegroups.com
> <mailto:gstreamer-java%2Bunsu...@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/group/gstreamer-java?hl=en.
>
>
> --
> 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.


--
Levente "Si vis pacem para bellum!"
Reply all
Reply to author
Forward
0 new messages