XVideo extension causes program abort - Xwindows

This is a discussion on XVideo extension causes program abort - Xwindows ; I need a reference for REAL online documentation of the Xvideo extension. But, the real problem is here...Consider this. void update() { unsigned int bwidth, tdepth; int dx1, dy1; Window rootwindow; unsigned int _w, _h; XGetGeometry(theDisplay, window, &rootwindow, &dx1, &dy1, ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: XVideo extension causes program abort

  1. XVideo extension causes program abort

    I need a reference for REAL online documentation of the Xvideo extension.

    But, the real problem is here...Consider this.

    void update() {
    unsigned int bwidth, tdepth;
    int dx1, dy1;
    Window rootwindow;
    unsigned int _w, _h;
    XGetGeometry(theDisplay, window, &rootwindow,
    &dx1, &dy1, &_w, &_h,
    &bwidth, &tdepth);
    XvShmPutImage(theDisplay, xv_port, window,
    gc, yuv_image,
    ulx, uly, brx-ulx, bry-uly,
    0, 0, _w, _h,true);
    }; // put cropped image in the (possibly resized) window


    The update() method runs thru the first iteration but fails on the second
    time thru at the XGetGeometry() call. The error is

    X Error of failed request: BadMatch (invalid parameter attributes)
    Major opcode of failed request: 140 (XVideo)
    Minor opcode of failed request: 19 ()
    Serial number of failed request: 22
    Current serial number in output stream: 23

    Why would Xvideo throw a BadMatch on a simple GetGeometry call? If my
    xv_port, Display, or window variables are wrong I would have expected the
    program to abort on the first iteration, instead of seeing the window
    mapped, then it going thru the first iteration of update() correctly.

    ....using "xorg-x11-server-Xorg-1.1.1-47.6.fc6" and nvidia driver
    "1.0-9746".



    -Rob Prowel

  2. Re: XVideo extension causes program abort

    Me writes:

    > I need a reference for REAL online documentation of the Xvideo extension.
    >
    > But, the real problem is here...Consider this.
    >
    > void update() {
    > unsigned int bwidth, tdepth;
    > int dx1, dy1;
    > Window rootwindow;
    > unsigned int _w, _h;
    > XGetGeometry(theDisplay, window, &rootwindow,
    > &dx1, &dy1, &_w, &_h,
    > &bwidth, &tdepth);
    > XvShmPutImage(theDisplay, xv_port, window,
    > gc, yuv_image,
    > ulx, uly, brx-ulx, bry-uly,
    > 0, 0, _w, _h,true);
    > }; // put cropped image in the (possibly resized) window
    >
    > The update() method runs thru the first iteration but fails on the second
    > time thru at the XGetGeometry() call. The error is
    >
    > X Error of failed request: BadMatch (invalid parameter attributes)
    > Major opcode of failed request: 140 (XVideo)
    > Minor opcode of failed request: 19 ()
    > Serial number of failed request: 22
    > Current serial number in output stream: 23
    >
    > Why would Xvideo throw a BadMatch on a simple GetGeometry call?


    It's not the XGetGeometry call that is failing. The error message
    tells you that it is the XvShmPutImage call that generates the error.

    I suggest printing all the values you are passing to XvShmPutImage.
    I'm guessing some with or height is zero or negative.

    --
    Måns Rullgård
    mans@mansr.com

  3. Re: XVideo extension causes program abort

    On Sun, 18 Mar 2007 19:32:45 +0000, Noone wrote:

    > It's not the XGetGeometry call that is failing. The error message tells
    > you that it is the XvShmPutImage call that generates the error.
    >
    > I suggest printing all the values you are passing to XvShmPutImage. I'm
    > guessing some with or height is zero or negative.
    >


    The debug output below...and my stepping thru with a debugger would seem
    to indicate that it is in fact the XGetGeometry() call that crashes. I've
    used (ddd) debugger to look at the parameters and they look OK. Of course
    most of the params to XGetGeometry are output params...The params to
    XShmPutImage() look fine as well.

    Other than querying the system to make sure that the XShm versions of
    Xvideo extensions are available, is there any initialization required to
    use an xv_port number? The window was created and mapped normally.


    c++ -g -O0 play.cc Xvideo.cc -lX11 -lXext -lXv

    ../a.out

    xv_port=277
    before XGetGeometry()
    after XGetGeometry() x=0 y=0 width=352 height=240 border_width=0
    visual_depth=32
    before XvShmPutImage()
    after XvShmPutImage()

    xv_port=277
    before XGetGeometry()
    X Error of failed request: BadMatch (invalid parameter attributes)
    Major opcode of failed request: 140 (XVideo)
    Minor opcode of failed request: 19 ()
    Serial number of failed request: 22
    Current serial number in output stream: 23



  4. Re: XVideo extension causes program abort

    In article , Me wrote:
    >On Sun, 18 Mar 2007 19:32:45 +0000, Noone wrote:
    >
    >The debug output below...and my stepping thru with a debugger would seem
    >to indicate that it is in fact the XGetGeometry() call that crashes.


    That doesn't mean anything. Xlib is asynchronous. It sends requests and
    returns as quickly as possible, without waiting for a reply. Eventually the
    error arrives, sometimes much later than the request that caused it. That's
    why you have to read what the error tells you:

    >X Error of failed request: BadMatch (invalid parameter attributes)
    > Major opcode of failed request: 140 (XVideo)
    > Minor opcode of failed request: 19 ()
    > Serial number of failed request: 22
    > Current serial number in output stream: 23


    The XGetGeometry was the 23rd request. The 22nd request was the one that
    failed. It was an XVideo request, minor 19, which is:

    X11/extensions/Xvproto.h:#define xv_ShmPutImage 19

    If you use XSync() after your XvShmPutImage, you'll find that it dies there.

    --
    Alan Curry
    pacman@world.std.com

  5. Re: XVideo extension causes program abort

    Rob wrote:
    > I need a reference for REAL online documentation of the Xvideo extension.
    >


    I suggest you look at this test program that I wrote:
    http://www.xmission.com/~georgeps/en...type-8.tar.bz2

    The little documentation on Xv that I could find, was inadequate. I
    hacked together that prototype from various sources, and studying actual
    drivers.

    I've written a widget that uses Xv, that prototype above, and most
    recently I'm writing a new window system that also has an Xv driver for
    running on top of X. The window system driver runs as a separate
    process that mmap()s a window's file (in /nexx a tmpfs/mfs), so it's
    pretty easy to understand. It also has a test mode. ./nx_xv_driver -t
    -m 1 or ./nx_xv_driver -t -m 2 (if you want 1024x768). no arguments
    lists the modes.

    One important thing I later learned that is lacking from the
    Xv_prototype is XV_SET_DEFAULTS. Some programs and/or video drivers are
    buggy, so they leave the Xv port in a bad state. XV_SET_DEFAULTS seems
    to fix this.

    This is the latest tarball of my new window system (NetBSD-only at the
    moment, because it uses the wscons subsystem).

    http://www.xmission.com/~georgeps/im...xX-173.tar.bz2

    It's nice to have X11 drivers around for me to get design ideas from so
    that I can build new drivers for NexX. One of my goals is to modify
    Xvfb so that it will allow running some X11 apps in a window within
    NexX. That may be weeks, months, or years from now.


    -George

  6. Re: XVideo extension causes program abort

    On Sat, 24 Mar 2007 13:19:02 +0000, Noone wrote:

    > Rob wrote:
    >> I need a reference for REAL online documentation of the Xvideo
    >> extension.
    >>
    >>

    > I suggest you look at this test program that I wrote:
    > http://www.xmission.com/~georgeps/en...ing/prototype/

    Xv_prototype-8.tar.bz2
    >
    > The little documentation on Xv that I could find, was inadequate. I
    > hacked together that prototype from various sources, and studying actual
    > drivers.


    Hey. Thanks for the followup. Based on other responses I double checked
    my code and found that I was trying to use a 32bpp depth that wasn't
    supported. It created the window just fine but the putimage would fail.

    Yes, the available documentation for the Xvideo extension is woefully
    inadequate. I pulled an example from a link on wikipedia and merged it
    with the xvid_decraw example from the xvid mpeg4 codec with good results.

+ Reply to Thread