On Thursday 23 January 2003 09:24, hy0 wrote:
> > On Die, 2003-01-21 at 23:19, Hans Korneder wrote:
> > > > > An xvideo picture (actually an video stream) of the size 1920x1080
> > > > > should be shown in a window of the size 1024x576 (the monitor size is
> > > > > 1280x1024). What actually being displayed is the right hand side of the
> > > > > image, about 80% of the picture, and on the left hand side of the window
> > > > > a pink bar is being displayed.
> > > >
> > > > IIRC, the radeon driver advertises a larger maximum Xv image size
> > > > than the hardware can actually handle. Vladimir?
> > >
> > > Any way to find out the actual image size the hardware can handle?
> > > Is there something like a table of proven capabilities of the cards?
> >
> > Here's an excerpt from an old post I have on this topic. I don't think
> > the radeon driver has code to skip pixels, and its offscreen images code
> > sets the limit at 1024x1024.
>
> All Radeon chips support 2Kx2K hardware overlay surface which should be
> able to handle this case. Not sure if the problem is related to offscreen
> images code, is v4l driver involved here? It could also be some hidden bug
> in overlay down-scaling code.
>
> Hui

There's no v4l driver involved here, at least not that I'm aware of.
Do you have a sample piece of code which can verify the 2Kx2K capabilities?

The problem can be reproduced here with the code attached.

Hans

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


/*
**
** t1.c
**
** Test xv-extention with image scaling
**
** 16.01.2003 �H. Korneder �initial version
**
** compile with:
** cc t1.c -L/usr/X11/lib -lXv -lXext -lX11 -o t1
**
** reach the author at:
** � �[EMAIL PROTECTED]
**
*/

#include <errno.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/Xv.h>
#include <X11/extensions/Xvlib.h>
#include <X11/extensions/XShm.h>

Display � � � � � � *disp;
Window � � � � � � � rootwin;
Window � � � � � � � window;
GC � � � � � � � � � gc;
XGCValues � � � � � �xgcv;
XSizeHints � � � � � hint;
XVisualInfo � � � � �vinfo;
int � � � � � � � � �depth = 24;
int � � � � � � � � �screen = 1;
int � � � � � � � � �xv_port = 75; /* xvinfo | fgrep 'port base' */
int � � � � � � � � �xv_format= 0x32315659; /* vinfo | fgrep '(YV12) YUV planar' */
char � � � � � � � �*disp_name = ":0.1";
XSetWindowAttributes xswa;
unsigned long � � � �xswamask;
XvImage � � � � � � *xvimage;
int � � � � � � � � �image_width �= 1920;
int � � � � � � � � �image_height = 1080;
int � � � � � � � � �win_width � �= 1024;
int � � � � � � � � �win_height � = �576;
XShmSegmentInfo � � �ShmInfo;
int � � � � � � � � �ShmFlag;
char � � � � � � � � buf[512];

main(int argc, char *argv[])
� � � � {
� � � � disp = XOpenDisplay(disp_name);
� � � � if ( ! disp ) perror("Display"), exit(1);
� � � � rootwin = DefaultRootWindow(disp);
� � � � if ( ! rootwin ) perror("RootWin"), exit(1);
� � � � if ( ! XMatchVisualInfo(disp, 1, depth, TrueColor, &vinfo) ) 
perror("VisualInfo"), exit(1);
� � � � printf("VisualId=0x%0x\n", vinfo.visualid);
� � � � xswa.background_pixel = 0;
� � � � xswa.border_pixel � � = 0;
� � � � xswamask = CWBackPixel | CWBorderPixel;
� � � � window = XCreateWindow(disp, rootwin, 10,10,win_width,win_height,
� � � � � 0, depth,InputOutput,vinfo.visual, xswamask,&xswa);
� � � � if ( ! window ) perror("Window"), exit(1);
� � � � XMapWindow(disp, window);
� � � � gc = XCreateGC(disp, window, 0L, &xgcv);
� � � � if ( ! gc ) perror("gc"), exit(1);
� � � � XFlush(disp);
� � � � XSync(disp, False);
� � � � puts("window should be mapped..."); gets(buf);
� � � � xvimage = XvShmCreateImage(disp, xv_port, xv_format, (char *)0, image_width, 
image_height, &ShmInfo);
� � � � if ( ! xvimage ) perror("XvShmCreateImage"), exit(1);
� � � � printf("XvShmCreateImage returned xvimage->data_size=%d\n", 
xvimage->data_size);
� � � � ShmInfo.shmid � �= shmget(IPC_PRIVATE, xvimage->data_size, IPC_CREAT | 0777);
� � � � ShmInfo.shmaddr �= (char *) shmat(ShmInfo.shmid, 0, 0);
� � � � ShmInfo.readOnly = False;
� � � � xvimage->data = ShmInfo.shmaddr;
� � � � XShmAttach(disp, &ShmInfo);
� � � � XSync(disp, False);
� � � � // shmctl(ShmInfo.shmid, IPC_RMID, 0);
� � � � memset(xvimage->data,128,xvimage->data_size); /* gray image */
� � � � puts("before putimage..."); gets(buf);
� � � � XvShmPutImage(disp, xv_port, window, gc, xvimage,
� � � � � � � � �0, 0, �image_width, image_height,
� � � � � � � � �0, 0, �win_width �, win_height �,
� � � � � � � � �False);
� � � � XSync(disp, False);
� � � � puts("after putimage/sync..."); gets(buf);
}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

_______________________________________________
XFree86 mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xfree86

Reply via email to