ogle 0.8.2

This commit is contained in:
espie 2002-01-08 11:05:53 +00:00
parent 5d48ab3bb5
commit cd05ea35ba
14 changed files with 139 additions and 662 deletions

View File

@ -1,10 +1,11 @@
# $OpenBSD: Makefile,v 1.4 2001/11/02 17:38:04 espie Exp $
# $OpenBSD: Makefile,v 1.5 2002/01/08 11:05:53 espie Exp $
CATEGORIES= x11
NEED_VERSION= 1.474
COMMENT= "DVD player"
DISTNAME= ogle-0.8.1
DISTNAME= ogle-0.8.2
HOMEPAGE= http://www.dtek.chalmers.se/groups/dvd/
# Authors can be reached at dvd@dtek.chalmers.se
MASTER_SITES= ${HOMEPAGE}dist/
MAINTAINER= Marc Espie <espie@openbsd.org>
@ -45,6 +46,7 @@ post-extract:
exit 1; }
@mkdir -p ${BINOBJ}
post-configure:
@cd ${BINOBJ} && PATH="/bin:/usr/bin:/sbin:/usr/sbin" \
sh ${BINUTILS}/configure \

3
x11/ogle/distinfo Normal file
View File

@ -0,0 +1,3 @@
MD5 (ogle-0.8.2.tar.gz) = 0b2c949e372b7e79f9106d99c5d2ba45
RMD160 (ogle-0.8.2.tar.gz) = ea68895b4d659a9380df76a427a7a633d7c7befc
SHA1 (ogle-0.8.2.tar.gz) = 84f3505eaa8f6d002f663bfe036c533a4a83f714

View File

@ -1,3 +0,0 @@
MD5 (ogle-0.8.1.tar.gz) = 0152baeeba763908044fc942117e5dcd
RMD160 (ogle-0.8.1.tar.gz) = 728a3b70bbe4b66d60b711ad804f1d15cb7a54c4
SHA1 (ogle-0.8.1.tar.gz) = bdaaca1cba3f0a9dc8594088bb447484002ca5f8

View File

@ -1,16 +1,41 @@
$OpenBSD: patch-configure,v 1.1 2002/01/08 10:51:23 espie Exp $
--- configure.orig Thu Oct 25 20:00:18 2001
+++ configure Mon Jan 7 22:41:43 2002
@@ -7645,8 +7645,11 @@ EOF
$OpenBSD: patch-configure,v 1.2 2002/01/08 11:05:53 espie Exp $
--- configure.orig Fri Dec 7 18:45:21 2001
+++ configure Tue Jan 8 11:53:37 2002
@@ -2419,7 +2419,7 @@ CCDEPMODE="depmode=$am_cv_CC_dependencie
# By default we simply use the C compiler to build assembly code.
-: ${AS='$(CC)'}
+: ${AS='$CC'}
# Set ASFLAGS if not already set.
: ${ASFLAGS='$(CFLAGS)'}
@@ -15547,6 +15547,7 @@ cat >conftest.$ac_ext <<_ACEOF
#line 15547 "configure"
#include "confdefs.h"
$ac_includes_default
+#include <X11/Xlib.h>
#include <X11/extensions/XShm.h>
_ACEOF
rm -f conftest.$ac_objext
@@ -17622,6 +17623,7 @@ cat >conftest.$ac_ext <<_ACEOF
#line 17622 "configure"
#include "confdefs.h"
$ac_includes_default
+#include <X11/Xlib.h>
#include <X11/extensions/xf86vmode.h>
_ACEOF
rm -f conftest.$ac_objext
@@ -17873,8 +17875,11 @@ _ACEOF
powerpc|ppc)
if test x"$GCC" = x"yes"; then
CFLAGS="$CFLAGS -fomit-frame-pointer -funroll-loops"
- CFLAGS="$CFLAGS -Wa,-m7400"
- XCFLAGS="-Wa,-m7400"
- USE_ALTIVEC=yes
+ echo | as -m7400 >/dev/null
+ if test $? -eq 0; then
+ CFLAGS="$CFLAGS -Wa,-m7400"
+ USE_ALTIVEC=yes
+ XCFLAGS="-Wa,-m7400"
+ USE_ALTIVEC=yes
+ fi
fi
esac

View File

@ -1,335 +0,0 @@
$OpenBSD: patch-ctrl_ctrl_c,v 1.1 2001/10/24 12:54:33 espie Exp $
--- ctrl/ctrl.c.orig Mon Oct 22 15:16:00 2001
+++ ctrl/ctrl.c Mon Oct 22 15:26:03 2001
@@ -175,21 +175,29 @@ int search_capabilities(int caps, MsgEve
if(client != NULL) {
*client = CLIENT_NONE;
}
+#if DEBUG
fprintf(stderr, "searching cap: %d\n", caps);
+#endif
for(n = 0; n < nr_caps; n++) {
if((caps_array[n].caps & caps) == caps) {
nr++;
if(client != NULL) {
*client = caps_array[n].client;
+#if DEBUG
fprintf(stderr, "found capclient: %ld\n", *client);
+#endif
}
if(ret_caps != NULL) {
*ret_caps = caps_array[n].caps;
+#if DEBUG
fprintf(stderr, "found cap: %x\n", *ret_caps);
+#endif
}
+#if DEBUG
fprintf(stderr, "state cap: %d\n", caps_array[n].state);
+#endif
if(ret_state != NULL) {
*ret_state = caps_array[n].state;
@@ -308,7 +316,9 @@ static char *capability_to_decoderstr(in
static void cleanup(void)
{
+#if DEBUG
fprintf(stderr, "ctrl: waiting for children to really die\n");
+#endif
while(sleep(2)); // Continue sleeping if interupted
@@ -324,7 +334,9 @@ int request_capability(MsgEventQ_t *q, i
MsgEvent_t r_ev;
char *decodername;
cap_state_t state = 0;
+#if DEBUG
fprintf(stderr, "ctrl: _MsgEventQReqCapability\n");
+#endif
if(!search_capabilities(cap, capclient, retcaps, &state)) {
@@ -337,9 +349,11 @@ int request_capability(MsgEventQ_t *q, i
fullcap,
CAP_started);
+#if DEBUG
fprintf(stderr, "ctrl: starting decoder %d %s\n",
fullcap,
decodername);
+#endif
init_decoder(msgqid_str, decodername);
}
@@ -361,7 +375,9 @@ int request_capability(MsgEventQ_t *q, i
}
if(state == CAP_running) {
+#if DEBUG
fprintf(stderr, "ctrl: sending ctrldata\n");
+#endif
r_ev.type = MsgEventQCtrlData;
r_ev.ctrldata.shmid = ctrl_data_shmid;
@@ -369,7 +385,7 @@ int request_capability(MsgEventQ_t *q, i
return 1;
} else {
- fprintf(stderr, "ctrl: didn't find capability\n");
+ fprintf(stderr, "ctrl: didn't find capability %d\n", cap);
return 0;
}
}
@@ -385,13 +401,17 @@ static void handle_events(MsgEventQ_t *q
switch(ev->type) {
case MsgEventQInitReq:
+#if DEBUG
fprintf(stderr, "ctrl: _MsgEventQInitReq, new_id: %d\n", next_client_id);
+#endif
ev->type = MsgEventQInitGnt;
ev->initgnt.newclientid = next_client_id++;
MsgSendEvent(q, CLIENT_UNINITIALIZED, ev, 0);
break;
case MsgEventQRegister:
+#if DEBUG
fprintf(stderr, "ctrl: _MsgEventQRegister\n");
+#endif
register_capabilities(ev->registercaps.client,
ev->registercaps.capabilities,
CAP_running);
@@ -416,8 +436,10 @@ static void handle_events(MsgEventQ_t *q
{
shm_bufinfo_t bufinfo;
+#if DEBUG
fprintf(stderr, "ctrl: _got request for buffer size %d\n",
ev->reqbuf.size);
+#endif
if(get_buffer(ev->reqbuf.size, &bufinfo) == -1) {
bufinfo.shmid = -1;
}
@@ -432,9 +454,11 @@ static void handle_events(MsgEventQ_t *q
{
int shmid;
cap_state_t state = 0;
+#if DEBUG
fprintf(stderr, "ctrl: _new stream %x, %x\n",
ev->reqstreambuf.stream_id,
ev->reqstreambuf.subtype);
+#endif
if(register_stream(ev->reqstreambuf.stream_id,
ev->reqstreambuf.subtype)) {
@@ -456,9 +480,11 @@ static void handle_events(MsgEventQ_t *q
decodername = streamid_to_decoderstr(ev->reqstreambuf.stream_id,
ev->reqstreambuf.subtype);
+#if DEBUG
if((capability & VIDEO_OUTPUT) || (capability & DECODE_DVD_SPU)) {
fprintf(stderr, "****ctrl: registered VO or SPU started\n");
}
+#endif
if(capability == DECODE_DVD_SPU) {
register_capabilities(0,
DECODE_DVD_SPU | VIDEO_OUTPUT,
@@ -468,11 +494,14 @@ static void handle_events(MsgEventQ_t *q
capability,
CAP_started);
}
+#if DEBUG
fprintf(stderr, "ctrl: starting decoder %d %s\n", capability,
decodername);
+#endif
init_decoder(msgqid_str, decodername);
+#if DEBUG
fprintf(stderr, "ctrl: started decoder %d\n", capability);
-
+#endif
}
while(!search_capabilities(capability, &rcpt, NULL, &state) ||
@@ -494,7 +523,9 @@ static void handle_events(MsgEventQ_t *q
// send ctrl_data shm: let client know where the timebase
// data is
+#if DEBUG
fprintf(stderr, "ctrl: sending ctrldata\n");
+#endif
s_ev.type = MsgEventQCtrlData;
s_ev.ctrldata.shmid = ctrl_data_shmid;
@@ -551,7 +582,9 @@ static void handle_events(MsgEventQ_t *q
{
int shmid;
cap_state_t state;
+#if DEBUG
fprintf(stderr, "ctrl: _new pic q\n");
+#endif
// check if we have a decoder
@@ -563,13 +596,17 @@ static void handle_events(MsgEventQ_t *q
//
if(!search_capabilities(VIDEO_OUTPUT, &rcpt, NULL, NULL)) {
+#if DEBUG
fprintf(stderr, "****ctrl: registered VO|SPU started\n");
+#endif
register_capabilities(0,
VIDEO_OUTPUT | DECODE_DVD_SPU,
CAP_started);
init_decoder(msgqid_str, getenv("DVDP_VIDEO_OUT"));
+#if DEBUG
fprintf(stderr, "ctrl: started video_out\n");
+#endif
}
while(!search_capabilities(VIDEO_OUTPUT, &rcpt, NULL, &state) ||
(state != CAP_running)) {
@@ -585,13 +622,17 @@ static void handle_events(MsgEventQ_t *q
}
handle_events(q, &r_ev);
}
+#if DEBUG
fprintf(stderr, "ctrl: got capability video_out\n");
+#endif
// we now have a decoder running ready to decode the stream
// send ctrl_data shm: let client know where the timebase
// data is
+#if DEBUG
fprintf(stderr, "ctrl: sending ctrldata\n");
+#endif
s_ev.type = MsgEventQCtrlData;
s_ev.ctrldata.shmid = ctrl_data_shmid;
@@ -612,8 +653,10 @@ static void handle_events(MsgEventQ_t *q
s_ev.type = MsgEventQGntPicBuf;
s_ev.gntpicbuf.q_shmid = shmid;
+#if DEBUG
fprintf(stderr, "ctrl: create_q, q_shmid: %d picture_buf_shmid: %d\n",
shmid, ev->reqpicbuf.data_buf_shmid);
+#endif
MsgSendEvent(q, ev->reqpicbuf.client, &s_ev, 0);
@@ -631,8 +674,10 @@ static void handle_events(MsgEventQ_t *q
clocktime_t rt;
clocktime_get(&rt);
+#if DEBUG
fprintf(stderr, "ctrl: _MsgEventQSpeed\n");
fprintf(stderr, "ctrl: speed: %.2f\n", ev->speed.speed);
+#endif
ctrl_data->speed = ev->speed.speed;
@@ -641,7 +686,9 @@ static void handle_events(MsgEventQ_t *q
// send speed event to syncmasters
{
+#if DEBUG
fprintf(stderr, "ctrl: new speed\n");
+#endif
// TODO get decoders that do sync...
@@ -767,14 +814,18 @@ int main(int argc, char *argv[])
sprintf(msgqid_str, "%d", msgqid);
+#if DEBUG
fprintf(stderr, "msgid: %d\n", msgqid);
+#endif
{
struct msqid_ds msgqinfo;
msgctl(msgqid, IPC_STAT, &msgqinfo);
+#if DEBUG
fprintf(stderr, "max_bytes: %ld\n", (long)msgqinfo.msg_qbytes);
+#endif
}
@@ -845,7 +896,9 @@ int init_decoder(char *msgqid_str, char
return -1;
}
+#if DEBUG
fprintf(stderr, "ctrl: init_decoder(): %s\n", decode_name);
+#endif
//starting_decoder = 1;
@@ -900,7 +953,9 @@ int init_decoder(char *msgqid_str, char
}
+#if DEBUG
fprintf(stderr, "Started %s with pid %ld\n", decoderstr, (long)pid);
+#endif
// starting_decoder = 0;
return pid;
@@ -1078,7 +1133,7 @@ int create_msgq()
if((msgqid = msgget(IPC_PRIVATE, IPC_CREAT | 0600)) == -1) {
perror("msgget msgqid");
- exit(-1);
+ exit(1);
}
return 0;
@@ -1126,8 +1181,10 @@ int create_q(int nr_of_elems, int buf_sh
q_elem_t *q_elems;
int n;
+#if DEBUG
fprintf(stderr, "create_q\n");
fprintf(stderr, "shmget\n");
+#endif
if((shmid = shmget(IPC_PRIVATE,
sizeof(q_head_t) + nr_of_elems*sizeof(q_elem_t),
IPC_CREAT | 0600)) == -1) {
@@ -1136,7 +1193,9 @@ int create_q(int nr_of_elems, int buf_sh
}
+#if DEBUG
fprintf(stderr, "shmat\n");
+#endif
if((shmaddr = shmat(shmid, NULL, SHM_SHARE_MMU)) == (void *)-1) {
perror("create_q(), shmat()");
@@ -1241,7 +1300,9 @@ void remove_q_shm()
int n;
for(n = 0; n < nr_shmids; n++) {
+#if DEBUG
fprintf(stderr, "removing shmid: %d\n", shm_ids[n]);
+#endif
if(shmctl(shm_ids[n], IPC_RMID, NULL) == -1) {
perror("ipc_rmid");
}
@@ -1254,10 +1315,14 @@ void remove_q_shm()
void cleanup_and_exit(void)
{
+#if DEBUG
fprintf(stderr, "ctrl: cleaning up\n");
+#endif
remove_q_shm();
destroy_msgq();
+#if DEBUG
fprintf(stderr, "ctrl: exiting\n");
+#endif
exit(0);
}

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-ltmain_sh,v 1.1 2002/01/08 11:05:53 espie Exp $
--- ltmain.sh.orig Tue Dec 11 10:38:20 2001
+++ ltmain.sh Tue Dec 11 10:38:29 2001
@@ -2075,7 +2075,7 @@ EOF
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
if test "$installed" = no; then
notinst_deplibs="$notinst_deplibs $lib"
- need_relink=yes
+ need_relink=no
fi
# This is a shared library
if test "$linkmode" = lib &&

View File

@ -1,21 +1,11 @@
$OpenBSD: patch-mpeg2_video_Makefile_in,v 1.1.1.1 2001/10/14 15:35:04 espie Exp $
--- mpeg2_video/Makefile.in.orig Sat Oct 13 18:23:13 2001
+++ mpeg2_video/Makefile.in Sat Oct 13 18:23:35 2001
@@ -310,7 +310,7 @@ uninstall-pkglibPROGRAMS:
done
--- mpeg2_video/Makefile.in.orig Fri Dec 7 18:45:26 2001
+++ mpeg2_video/Makefile.in Mon Dec 10 01:53:49 2001
@@ -548,7 +548,7 @@ distclean-depend:
.c.o:
- $(COMPILE) -c $<
+ PATH=${WRKDIR}:$$PATH $(COMPILE) -c $<
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@AMDEP_TRUE@ PATH=${WRKDIR}:$$PATH $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$<
# FIXME: We should only use cygpath when building on Windows,
# and only if it is available.
@@ -321,7 +321,7 @@ uninstall-pkglibPROGRAMS:
$(COMPILE) -c $<
.S.o:
- $(COMPILE) -c $<
+ PATH=${WRKDIR}:$$PATH $(COMPILE) -c $<
mostlyclean-compile:
-rm -f *.o core *.core
.c.obj:

View File

@ -1,30 +0,0 @@
$OpenBSD: patch-mpeg2_video_c_mlib_c,v 1.1 2002/01/08 10:51:23 espie Exp $
--- mpeg2_video/c_mlib.c.orig Wed Nov 21 18:26:10 2001
+++ mpeg2_video/c_mlib.c Wed Nov 21 18:26:25 2001
@@ -510,7 +510,7 @@ mlib_VideoInterpXY_U8_U8_8x4(uint8_t *cu
* c[1..7] = 128*sqrt(2)
*/
-INLINE static void
+inline static void
idct_row(int16_t *blk, int16_t *coeffs)
{
int x0, x1, x2, x3, x4, x5, x6, x7, x8;
@@ -585,7 +585,7 @@ idct_row(int16_t *blk, int16_t *coeffs)
/* FIXME something odd is going on with inlining this
* procedure. Things break if it isn't inlined */
-INLINE static void
+inline static void
idct_col(int16_t *blk, int16_t *coeffs)
{
int x0, x1, x2, x3, x4, x5, x6, x7, x8;
@@ -649,7 +649,7 @@ idct_col(int16_t *blk, int16_t *coeffs)
blk[8*7] = (x7-x1)>>14;
}
-INLINE static void
+inline static void
idct_col_u8(uint8_t *blk, int16_t *coeffs, int stride)
{
int x0, x1, x2, x3, x4, x5, x6, x7, x8;

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-mpeg2_video_screenshot_c,v 1.1 2002/01/08 11:05:53 espie Exp $
--- mpeg2_video/screenshot.c.orig Mon Dec 10 19:20:37 2001
+++ mpeg2_video/screenshot.c Mon Dec 10 19:20:46 2001
@@ -194,7 +194,7 @@ void screenshot_yuv_jpg(yuv_image_t *yuv
static char *new_file(void) {
char *pre = "shot";
- int i = 0;
+ static int i = 0;
int fd;
static char full_name[20];

View File

@ -0,0 +1,29 @@
$OpenBSD: patch-mpeg2_video_spu_mixer_c,v 1.1 2002/01/08 11:05:53 espie Exp $
--- mpeg2_video/spu_mixer.c.orig Sun Dec 2 22:38:00 2001
+++ mpeg2_video/spu_mixer.c Thu Dec 13 00:32:25 2001
@@ -43,6 +43,8 @@
+int subtitle_pos[50];
+int subtitle_index = 0;
#ifdef DEBUG
#define GETBYTES(a,b) getbytes(a,b)
@@ -912,6 +914,7 @@ static void decode_display_data(spu_t *s
y = 0;
DPRINTF(5, "vlc decoding\n");
+ subtitle_index = spu_info->y_start / 64;
while((fieldoffset[1] < spu_info->DCSQT_offset) && (y < spu_info->height)) {
unsigned int vlc;
unsigned int length;
@@ -987,7 +990,7 @@ static void decode_display_data(spu_t *s
unsigned int line_y;
char *addr;
- line_y = (y + spu_info->y_start) * line_stride;
+ line_y = (y + spu_info->y_start+subtitle_pos[subtitle_index]) * line_stride;
// (width * bpp) == line_stride (for rgb or yuv)
addr = data + line_y + (x + spu_info->x_start) * pixel_stride;

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-mpeg2_video_spu_mixer_h,v 1.1 2002/01/08 11:05:53 espie Exp $
--- mpeg2_video/spu_mixer.h.orig Thu Aug 30 22:23:45 2001
+++ mpeg2_video/spu_mixer.h Thu Dec 13 00:30:34 2001
@@ -24,6 +24,9 @@
void mix_subpicture_rgb(char *data, int width, int height, int pixel_stride);
int mix_subpicture_yuv(yuv_image_t *img, yuv_image_t *reserv);
+extern int subtitle_pos[150];
+extern int subtitle_index;
+
int init_spu(void);
void flush_subpicture(int scr_nr);

View File

@ -1,262 +1,16 @@
$OpenBSD: patch-mpeg2_video_video_output_x11_c,v 1.2 2001/11/02 17:38:04 espie Exp $
--- mpeg2_video/video_output_x11.c.orig Tue Oct 9 01:10:59 2001
+++ mpeg2_video/video_output_x11.c Mon Oct 22 16:44:44 2001
@@ -291,6 +291,7 @@ static void display_init_xv(yuv_image_t
#ifdef HAVE_XV
int i, j;
int result;
+ int best;
xv_port = 0; /* We have no port yet. */
@@ -299,17 +300,19 @@ static void display_init_xv(yuv_image_t
&xv_request_base, &xv_event_base,
&xv_error_base);
if(result != Success) {
- fprintf(stderr, "Xv not found\n");
+ fprintf(stderr, "vo: Xv extension not found\n");
return;
}
- fprintf(stderr, "Found Xv extension, checking for suitable adaptors\n");
/* Check for available adaptors */
result = XvQueryAdaptors(mydisplay, DefaultRootWindow (mydisplay),
&xv_num_adaptors, &xv_adaptor_info);
- if(result != Success)
+ if(result != Success) {
+ fprintf(stderr,"vo: no Xv adaptors found\n");
return;
+ }
+ best = 0;
/* Check adaptors */
for(i = 0; i < xv_num_adaptors; i++) {
@@ -319,18 +322,16 @@ static void display_init_xv(yuv_image_t
!(xv_adaptor_info[i].type & XvImageMask))
continue;
+ best = 1;
xv_port = xv_adaptor_info[i].base_id;
- fprintf(stderr, "Found adaptor \"%s\" checking for suitable formats\n",
- xv_adaptor_info[i].name);
/* Check image formats of adaptor */
xv_formats = XvListImageFormats(mydisplay, xv_port, &xv_num_formats);
for(j = 0; j < xv_num_formats; j++) {
if(xv_formats[j].id == 0x32315659) { /* YV12 */
//if(xv_formats[j].id == 0x30323449) { /* I420 */
- fprintf(stderr, "Found image format \"%s\", using it\n",
- xv_formats[j].guid);
xv_id = xv_formats[j].id;
+ best = 2;
break;
}
}
@@ -338,8 +339,6 @@ static void display_init_xv(yuv_image_t
if(j == xv_num_formats)
continue;
- fprintf(stderr, "Using Xvideo port %li for hw scaling\n", xv_port);
-
/* Allocate XvImages */
xv_image = XvShmCreateImage(mydisplay, xv_port, xv_id, NULL,
picture_data->info->picture.padded_width,
@@ -350,6 +349,7 @@ static void display_init_xv(yuv_image_t
if(xv_image == NULL)
continue;
+ best = 3;
/* Test and see if we really got padded_width x padded_height */
if(xv_image->width != picture_data->info->picture.padded_width ||
xv_image->height != picture_data->info->picture.padded_height) {
@@ -394,6 +394,19 @@ static void display_init_xv(yuv_image_t
/* All set up! */
break;
}
+ switch(best) {
+ case 0:
+ fprintf(stderr, "vo: no Xv adaptors suitable for display\n");
+ break;
+ case 1:
+ fprintf(stderr, "vo: no YV12 Xv adaptors\n");
+ break;
+ case 2:
+ fprintf(stderr, "vo: can't create YV12 XvImage\n");
+ break;
+ case 3:
+ break;
+ }
#endif /* HAVE_XV */
}
@@ -435,8 +448,8 @@ static void display_init_xshm()
window.ximage->height,
IPC_CREAT | 0777);
- if(shm_info.shmid < 0) {
- fprintf(stderr, "vo: shmget failed\n");
+ if(shm_info.shmid == -1) {
+ perror("vo: shmget failed");
exit(1);
}
@@ -444,7 +457,7 @@ static void display_init_xshm()
shm_info.shmaddr = (char *) shmat(shm_info.shmid, 0, 0);
if(shm_info.shmaddr == ((char *) -1)) {
- fprintf(stderr, "vo: shmat failed\n");
+ perror("vo: shmat failed");
exit(1);
}
@@ -479,7 +492,9 @@ static void display_init_xshm()
pixel_stride = window.ximage->bits_per_pixel;
+#if DEBUG
fprintf(stderr, "vo: pixel_stride: %d\n", pixel_stride);
+#endif
// If we have blue in the lowest bit then obviously RGB
@@ -541,6 +556,7 @@ void display_init(yuv_image_t *picture_d
dpy_sar_frac_n = dpy_size.height * dpy_size.horizontal_pixels;
dpy_sar_frac_d = dpy_size.width * dpy_size.vertical_pixels;
+#if DEBUG
fprintf(stderr, "*d* h: %d, w: %d, hp: %d, wp: %d\n",
dpy_size.height, dpy_size.width,
dpy_size.vertical_pixels, dpy_size.horizontal_pixels);
@@ -548,6 +564,7 @@ void display_init(yuv_image_t *picture_d
XHeightMMOfScreen(scr), XWidthMMOfScreen(scr),
XHeightOfScreen(scr), XWidthOfScreen(scr));
fprintf(stderr, "*** display_sar: %d/%d\n", dpy_sar_frac_n, dpy_sar_frac_d);
+#endif
/* Assume (for now) that the window will be the same size as the source. */
@@ -560,12 +577,14 @@ void display_init(yuv_image_t *picture_d
color_depth = attribs.depth;
if(color_depth != 15 && color_depth != 16 &&
color_depth != 24 && color_depth != 32) {
- fprintf(stderr,"Only 15, 16, 24, and 32bpp supported. Trying 24bpp!\n");
+ fprintf(stderr,"vo: color_depth %d not supported (not 15, 16, 24, 32). Trying 24bpp!\n", color_depth);
color_depth = 24;
}
XMatchVisualInfo(mydisplay, screen, color_depth, TrueColor, &vinfo);
+#if DEBUG
fprintf(stderr, "vo: X11 visual id is %lx\n", vinfo.visualid);
+#endif
hint.x = 0;
hint.y = 0;
@@ -651,7 +670,9 @@ void display_init(yuv_image_t *picture_d
xshmeventbase = XShmGetEventBase(mydisplay);
+#if DEBUG
fprintf(stderr, "xshmeventbase: %d\n", xshmeventbase);
+#endif
/* Try to use XFree86 Xv (X video) extension for display.
Sets use_xv to true on success. */
@@ -670,15 +691,15 @@ void display_init(yuv_image_t *picture_d
yuyv_fb = (unsigned int *)mmap(NULL, 4*1024*1024, PROT_READ | PROT_WRITE,
MAP_SHARED, fb_fd, 0x0701a000);
if(yuyv_fb == MAP_FAILED) {
- perror("mmap");
- exit(-1);
+ perror("vo: mmap failed");
+ exit(1);
}
rgb_fb = (uint8_t *)mmap(NULL, 4*2048*1024, PROT_READ | PROT_WRITE,
MAP_SHARED, fb_fd, 0x05004000);
if(rgb_fb == MAP_FAILED) {
- perror("mmap");
- exit(-1);
+ perror("vo: mmap failed");
+ exit(1);
}
}
/*** end sun ffb2 ***/
@@ -701,7 +722,9 @@ static void display_change_size(yuv_imag
int padded_height = img->info->picture.padded_height;
//int alloc_width, alloc_height;
int alloc_size;
+#if DEBUG
fprintf(stderr, "vo resize: %d, %d\n", new_width, new_height);
+#endif
/* If we cant scale (i.e no Xv or mediaLib) exit give up now. */
@@ -730,12 +753,12 @@ static void display_change_size(yuv_imag
XShmDetach(mydisplay, &shm_info);
XDestroyImage(window.ximage);
shmdt(shm_info.shmaddr);
- if(shm_info.shmaddr == ((char *) -1)) {
- fprintf(stderr, "vo: Shared memory: Couldn't detach segment\n");
+ if(shmdt(shm_info.shmaddr) != 0) {
+ perror("vo: Shared memory: shmdt failed");
exit(1);
}
if(shmctl(shm_info.shmid, IPC_RMID, 0) == -1) {
- perror("vo: shmctl ipc_rmid");
+ perror("vo: shmctl ipc_rmid failed");
exit(1);
}
@@ -769,15 +792,15 @@ static void display_change_size(yuv_imag
IPC_CREAT | 0777);
- if(shm_info.shmid < 0) {
- fprintf(stderr, "vo: Shared memory: Couldn't get segment\n");
+ if(shm_info.shmid == -1) {
+ perror("vo: Shared memory: shmget failed");
exit(1);
}
/* Attach shared memory segment */
shm_info.shmaddr = (char *) shmat(shm_info.shmid, 0, 0);
if(shm_info.shmaddr == ((char *) -1)) {
- fprintf(stderr, "vo: Shared memory: Couldn't attach segment\n");
+ perror("vo: Shared memory: shmat failed");
exit(1);
}
@@ -825,10 +848,12 @@ static void display_adjust_size(yuv_imag
scale_frac_n = (int64_t)dpy_sar_frac_n * (int64_t)sar_frac_d;
scale_frac_d = (int64_t)dpy_sar_frac_d * (int64_t)sar_frac_n;
+#if DEBUG
fprintf(stderr, "vo: sar: %d/%d, dpy_sar %d/%d, scale: %lld, %lld\n",
sar_frac_n, sar_frac_d,
dpy_sar_frac_n, dpy_sar_frac_d,
scale_frac_n, scale_frac_d);
+#endif
/* Keep either the height or the width constant. */
if(scale_frac_n > scale_frac_d) {
@@ -867,7 +892,9 @@ static void display_adjust_size(yuv_imag
new_width = max_width;
new_height = (base_height * max_width) / base_width;
} else {
+#if DEBUG
fprintf(stderr, "vo: using zoom %d / %d\n", scale.zoom_n, scale.zoom_d);
+#endif
/* Use the provided zoom value. */
new_width = (base_width * scale.zoom_n) / scale.zoom_d;
new_height = (base_height * scale.zoom_n) / scale.zoom_d;
@@ -895,7 +922,9 @@ static void display_adjust_size(yuv_imag
scale.zoom_n = new_height;
scale.zoom_d = base_height;
}
+#if DEBUG
fprintf(stderr, "vo: zoom2 %d / %d\n", scale.zoom_n, scale.zoom_d);
+#endif
}
/* Don't care about aspect and can't change the window size, use it all. */
$OpenBSD: patch-mpeg2_video_video_output_x11_c,v 1.3 2002/01/08 11:05:53 espie Exp $
--- mpeg2_video/video_output_x11.c.orig Sun Dec 2 22:38:00 2001
+++ mpeg2_video/video_output_x11.c Thu Dec 13 00:30:10 2001
@@ -1135,6 +1135,12 @@ void check_x_events(yuv_image_t *current
if(keysym == XK_I) {
screenshot_spu = 1;
}
+ if (keysym == XK_1) {
+ subtitle_pos[subtitle_index]++;
+ }
+ if (keysym == XK_2) {
+ subtitle_pos[subtitle_index]--;
+ }
}
break;
case ButtonPress:

View File

@ -1,3 +1,8 @@
@comment $OpenBSD: PFRAG.shared,v 1.3 2001/11/02 17:38:04 espie Exp $
lib/ogle/libdvdcontrol.so.4.0
lib/ogle/libmsgevents.so.3.1
@comment $OpenBSD: PFRAG.shared,v 1.4 2002/01/08 11:05:53 espie Exp $
lib/ogle/libdvdcontrol.so.5.0
@exec ln -s %D/%F %D/lib # link libdvdcontrol
@unexec rm %D/lib/%f # unlink libdvdcontrol
lib/ogle/libmsgevents.so.4.0
@exec ln -s %D/%F %D/lib # link libmsgevents
@unexec rm %D/lib/%f # unlink libmsgevents
DYNLIBDIR(%D/lib)

View File

@ -1,4 +1,4 @@
@comment $OpenBSD: PLIST,v 1.2 2001/11/02 17:38:04 espie Exp $
@comment $OpenBSD: PLIST,v 1.3 2002/01/08 11:05:53 espie Exp $
bin/ifo_dump
bin/ogle
include/ogle/dvd.h