SOURCES: xvidcap-xt.patch (NEW) - (try to) unbreak Xt GUI

qboosh qboosh at pld-linux.org
Tue Nov 1 23:09:12 CET 2005


Author: qboosh                       Date: Tue Nov  1 22:09:12 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- (try to) unbreak Xt GUI

---- Files affected:
SOURCES:
   xvidcap-xt.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/xvidcap-xt.patch
diff -u /dev/null SOURCES/xvidcap-xt.patch:1.1
--- /dev/null	Tue Nov  1 23:09:12 2005
+++ SOURCES/xvidcap-xt.patch	Tue Nov  1 23:09:07 2005
@@ -0,0 +1,243 @@
+--- xvidcap-1.1.4/src/job.c.orig	2004-12-30 17:07:20.000000000 +0100
++++ xvidcap-1.1.4/src/job.c	2005-11-01 22:18:56.001553568 +0100
+@@ -55,13 +55,6 @@
+ #include "colors.h"
+ #include "codecs.h"
+ 
+-#include <gdk/gdkkeysyms.h>
+-#include <gtk/gtk.h>
+-#include <gdk/gdkx.h>
+-#include <pango/pango-layout.h>
+-#include <gdk-pixbuf/gdk-pixdata.h>
+-
+-
+ static Job *job;
+ //extern GtkWidget window1;
+ extern xvCodec tCodecs[NUMCODECS];
+--- xvidcap-1.1.4/src/xt_control.c.orig	2004-04-05 13:58:31.000000000 +0200
++++ xvidcap-1.1.4/src/xt_control.c	2005-11-01 22:10:46.072034176 +0100
+@@ -55,6 +55,7 @@
+ #include "xt_options.h"
+ #include "xtoxwd.h"
+ #include "xtopnm.h"
++#include "codecs.h"
+ /* #include "sound.h" */
+ #ifdef HAVE_LIBPNG
+ #include "xtopng.h"
+@@ -106,25 +107,26 @@
+ };
+ 
+ #	define offset(x) XtOffsetOf(AppData, x)
++#	define offsetc(x) XtOffsetOf(CapTypeOptions, x)
+ static XtResource resources [] = {
+-    {XtNfps, XtCFps, XtRFloat, sizeof(int), offset(fps), XtRImmediate, NULL},
+-    {XtNfile, XtCFile, XtRString, sizeof(String), offset(file), XtRImmediate, NULL},
++    {XtNfps, XtCFps, XtRFloat, sizeof(int), offsetc(fps), XtRImmediate, NULL},
++    {XtNfile, XtCFile, XtRString, sizeof(String), offsetc(file), XtRImmediate, NULL},
+     {XtNverbose, XtCVerbose, XtRInt, sizeof(int), offset(verbose), XtRImmediate, NULL},
+     {XtNcapWidth, XtCCapWidth, XtRInt, sizeof(int), offset(cap_width), XtRInt, 0},
+     {XtNcapHeight, XtCCapHeight, XtRInt, sizeof(int), offset(cap_height), XtRInt, 0},
+-    {XtNtime, XtCTime, XtRFloat, sizeof(int), offset(time), XtRImmediate, NULL},
+-    {XtNframes, XtCFrames, XtRInt, sizeof(int), offset(frames), XtRImmediate, NULL},
+-    {XtNstartNo, XtCStartNo, XtRInt, sizeof(int), offset(start_no), XtRImmediate, NULL},
+-    {XtNcomp, XtCComp, XtRInt, sizeof(int), offset(compress), XtRImmediate, NULL},
+-    {XtNquality, XtCQuality, XtRInt, sizeof(int), offset(quality), XtRImmediate, NULL},
+-    {XtNbpp, XtCBpp, XtRInt, sizeof(int), offset(bpp), XtRImmediate, NULL},
++    {XtNtime, XtCTime, XtRFloat, sizeof(int), offsetc(time), XtRImmediate, NULL},
++    {XtNframes, XtCFrames, XtRInt, sizeof(int), offsetc(frames), XtRImmediate, NULL},
++    {XtNstartNo, XtCStartNo, XtRInt, sizeof(int), offsetc(start_no), XtRImmediate, NULL},
++    {XtNcomp, XtCComp, XtRInt, sizeof(int), offsetc(compress), XtRImmediate, NULL},
++    {XtNquality, XtCQuality, XtRInt, sizeof(int), offsetc(quality), XtRImmediate, NULL},
++    {XtNbpp, XtCBpp, XtRInt, sizeof(int), offsetc(bpp), XtRImmediate, NULL},
+     {XtNsource, XtCSource, XtRString, sizeof(String), offset(source), XtRImmediate, NULL},
+     {XtNsndDev, XtCSndDev, XtRString, sizeof(String), offset(snddev), XtRImmediate, NULL},
+-    {XtNsndRate, XtCSndRate, XtRInt, sizeof(int), offset(sndrate), XtRImmediate, NULL},
+-    {XtNsndSize, XtCSndSize, XtRInt, sizeof(int), offset(sndsize), XtRImmediate, NULL},
+-    {XtNanimate, XtCAnimate, XtRString, sizeof(String), offset(play_cmd), XtRString, ""},
+-    {XtNmkVideo, XtCMkVideo, XtRString, sizeof(String), offset(video_cmd), XtRString, ""},
+-    {XtNedit, XtCEdit, XtRString, sizeof(String), offset(edit_cmd), XtRImmediate, NULL},
++    {XtNsndRate, XtCSndRate, XtRInt, sizeof(int), offsetc(sndrate), XtRImmediate, NULL},
++    {XtNsndSize, XtCSndSize, XtRInt, sizeof(int), offsetc(sndsize), XtRImmediate, NULL},
++    {XtNanimate, XtCAnimate, XtRString, sizeof(String), offsetc(play_cmd), XtRString, ""},
++    {XtNmkVideo, XtCMkVideo, XtRString, sizeof(String), offsetc(video_cmd), XtRString, ""},
++    {XtNedit, XtCEdit, XtRString, sizeof(String), offsetc(edit_cmd), XtRImmediate, NULL},
+     {XtNhelp, XtCHelp, XtRString, sizeof(String), offset(help_cmd), XtRImmediate, NULL},
+ };
+ 
+@@ -908,7 +910,7 @@
+     if (jobp->flags & FLG_RUN_VERBOSE) {
+         fprintf(stderr, "color_table first entry: 0x%.8X\n", *(u_int32_t*)jobp->color_table);
+     }
+-    job_set_save_function(jobp->win_attr.visual, jobp->target, jobp);
++    job_set_save_function(jobp->win_attr.visual, jobp->target);
+     #ifdef DEBUG
+     printf("new visual: %d\n", jobp->win_attr.visual->class);
+     #endif
+@@ -961,18 +963,19 @@
+     int flags, bpp;
+     char *animate_cmd, *mkvideo_cmd, *edit_cmd, *help_cmd;
+     
+-    file = app->file;
++    file = app->single_frame.file;
+     flags = app->flags;
+-    bpp = app->bpp;
+-    animate_cmd = app->play_cmd;
+-    mkvideo_cmd = app->video_cmd;
+-    edit_cmd = app->edit_cmd;
++    bpp = app->single_frame.bpp;
++    animate_cmd = app->single_frame.play_cmd;
++    mkvideo_cmd = app->single_frame.video_cmd;
++    edit_cmd = app->single_frame.edit_cmd;
+     help_cmd = app->help_cmd;
+     
+     display = XtDisplay(toplevel);
+     root = RootWindow(display, DefaultScreen(display));
+     
+-    jobp = job_init(flags);
++    jobp = job_new();
++    jobp->flags = flags;
+     
+     jobp->area = GetArea();
+     jobp->bpp = bpp;
+@@ -1115,21 +1118,21 @@
+     int rate, size, channels;
+     extern int XVC_frame_lock;
+     
+-    file = app->file;
+-    codec = app->targetCodec;
+-    compress = app->compress;
+-    fps = app->fps;
+-    max_time = app->time;
+-    max_frames = app->frames;
+-    start_at_no = app->start_no;
+-    step = app->step;
+-    quality = app->quality;
++    file = app->single_frame.file;
++    codec = app->single_frame.targetCodec;
++    compress = app->single_frame.compress;
++    fps = app->single_frame.fps;
++    max_time = app->single_frame.time;
++    max_frames = app->single_frame.frames;
++    start_at_no = app->single_frame.start_no;
++    step = app->single_frame.step;
++    quality = app->single_frame.quality;
+     mouseWanted = app->mouseWanted;
+     dev = app->device;
+     snd = app->snddev;
+-    rate = app->sndrate;
+-    size = app->sndsize;
+-    channels = app->sndchannels;
++    rate = app->single_frame.sndrate;
++    size = app->single_frame.sndsize;
++    channels = app->single_frame.sndchannels;
+     
+     if ( app->cap_pos_x >= 0 || app->cap_pos_y >=0 ) {
+         XtVaSetValues(move, XtNstate, False, NULL);
+@@ -1171,7 +1174,7 @@
+     if (jobp->get_colors)
+         jobp->color_table = (*jobp->get_colors)(jobp->colors, jobp->ncolors);
+     
+-    job_set_save_function(jobp->win_attr.visual, jobp->target, jobp);
++    job_set_save_function(jobp->win_attr.visual, jobp->target);
+     ChangeLabel(jobp->pic_no);
+     
+     #ifdef HAVE_LIBAVCODEC
+--- xvidcap-1.1.4/src/xt_options.c.orig	2004-03-15 18:34:43.000000000 +0100
++++ xvidcap-1.1.4/src/xt_options.c	2005-11-01 22:21:23.474134328 +0100
+@@ -42,6 +42,7 @@
+ #include "xutil.h"
+ #include "app_data.h"
+ #include "control.h"
++#include "codecs.h"
+ 
+ #define DLG_CANCEL	0
+ #define DLG_OK		1
+@@ -58,6 +59,7 @@
+ static void CbCancel (Widget w, XtPointer client_data, XtPointer call_data);
+ static void CbActivate (Widget w, XtPointer client_data, XtPointer call_data);
+ 
++extern xvCodec tCodecs[NUMCODECS];
+ 
+ /*
+  * read the new values and close the window
+@@ -75,7 +77,7 @@
+ 	str = XwFieldGetString (wQuality);
+ 	if ( str ) {
+ 		if ( *str ) {
+-			val_int = job_quality ();
++			val_int = job_ptr()->quality;
+ 			sscanf (str, "%d", &val_int);
+ 			job_set_quality (val_int);
+ 		}
+@@ -85,7 +87,7 @@
+ 	str = XwFieldGetString (wCompress);
+ 	if ( str ) {
+ 		if ( *str ) {
+-			val_int = job_compression ();
++			val_int = job_ptr()->compress;
+ 			sscanf (str, "%d", &val_int);
+ 			job_set_compression (val_int);
+ 		}
+@@ -95,7 +97,7 @@
+ 	str = XwFieldGetString (wFps);
+ 	if (str) {
+ 		if (*str) {
+-			val_float = job_fps ();
++			val_float = job_ptr()->fps;
+ 			sscanf (str, "%f", &val_float);
+ 			job_set_fps (val_float);
+ 		}
+@@ -131,7 +133,7 @@
+ //			Boolean found = FALSE;
+ 
+ 			for  (i = 0; i < NUMCODECS; i ++) {
+-				if (strcmp(tCodecNames[i], str) == 0) a = i;
++				if (strcmp(tCodecs[i].longname, str) == 0) a = i;
+ 			}
+ 			if (a < CODEC_MPEG1) {
+ 				a = CODEC_MPEG1;
+@@ -211,7 +213,7 @@
+ 	str = XwFieldGetString (wQuality);
+ 	if ( str ) {
+ 		if ( *str ) {
+-			val_int = job_quality ();
++			val_int = job_ptr()->quality;
+ 			sscanf (str, "%d", &val_int);
+ 			job_set_quality (val_int);
+ 		}
+@@ -221,7 +223,7 @@
+ 	str = XwFieldGetString (wCompress);
+ 	if ( str ) {
+ 		if ( *str ) {
+-			val_int = job_compression ();
++			val_int = job_ptr()->compress;
+ 			sscanf (str, "%d", &val_int);
+ 			job_set_compression (val_int);
+ 		}
+@@ -231,7 +233,7 @@
+ 	str = XwFieldGetString (wFps);
+ 	if (str) {
+ 		if (*str) {
+-			val_float = job_fps ();
++			val_float = job_ptr()->fps;
+ 			sscanf (str, "%f", &val_float);
+ 			job_set_fps (val_float);
+ 		}
+@@ -267,7 +269,7 @@
+ //			Boolean found = FALSE;
+ 
+ 			for  (i = 0; i < NUMCODECS; i ++) {
+-				if (strcmp(tCodecNames[i], str) == 0) a = i;
++				if (strcmp(tCodecs[i].longname, str) == 0) a = i;
+ 			}
+ 			if (a < CODEC_MPEG1) {
+ 				a = CODEC_MPEG1;
+@@ -407,7 +409,7 @@
+ 	compress_lbl = XtVaCreateManagedWidget ("compress", xwLabelWidgetClass,
+ 					box, NULL);
+ 
+-	sprintf (str, "%s", tCodecNames[(job->targetCodec)]);
++	sprintf (str, "%s", tCodecs[(job->targetCodec)].longname);
+ 	box = XtVaCreateManagedWidget ("box", xwBoxWidgetClass, frame,
+ 			XtNorientation, XtorientHorizontal, NULL);
+ 	wCodec = XtVaCreateManagedWidget ("codec_val", xwFieldWidgetClass,
================================================================



More information about the pld-cvs-commit mailing list