mirror of
https://github.com/mpv-player/mpv
synced 2025-03-11 04:44:32 +01:00
Merge svn changes up to r30848
This commit is contained in:
commit
240550bbb9
@ -3114,13 +3114,16 @@ Fixes fullscreen switching on OpenBox 1.x.
|
||||
.PD 1
|
||||
.
|
||||
.TP
|
||||
.B \-geometry x[%][:y[%]] or [WxH][+x+y]
|
||||
.B \-geometry x[%][:y[%]] or [WxH][+-x+-y]
|
||||
Adjust where the output is on the screen initially.
|
||||
The x and y specifications are in pixels measured from the top-left of the
|
||||
screen to the top-left of the image being displayed, however if a percentage
|
||||
sign is given after the argument it turns the value into a percentage of the
|
||||
screen size in that direction.
|
||||
It also supports the standard X11 \-geometry option format.
|
||||
It also supports the standard X11 \-geometry option format, in which e.g.
|
||||
+10-50 means "place 10 pixels from the left border and 50 pixels from the lower
|
||||
border" and "--20+-10" means "place 20 pixels beyond the right and 10 pixels
|
||||
beyond the top border".
|
||||
If an external window is specified using the \-wid option, then the x and
|
||||
y coordinates are relative to the top-left corner of the window rather
|
||||
than the screen.
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" sync with en/mplayer.1 rev. 30677
|
||||
.\" sync with en/mplayer.1 rev. 30822
|
||||
.\" Encoding: UTF-8
|
||||
.\" Reminder of hard terms which need better/final solution later:
|
||||
.\" /capture; playtree in parent list; colorkey; retrace; desync; downmix;
|
||||
@ -2676,11 +2676,11 @@ OS/2 KAI 音频输出驱动
|
||||
.PD 0
|
||||
.RSs
|
||||
.IPs uniaud
|
||||
强制使用 UNIAUD 模式
|
||||
强制使用 UNIAUD 模式。
|
||||
.IPs dart
|
||||
强制使用 DART 模式
|
||||
强制使用 DART 模式。
|
||||
.IPs (no)share
|
||||
以共享或独占模式打开音频
|
||||
以共享或独占模式打开音频。
|
||||
.IPs bufsize=<size>
|
||||
设置缓冲大小为 <size>,以采样数为单位(默认值:2048)。
|
||||
.RE
|
||||
@ -2946,13 +2946,14 @@ VESA 帧缓冲不支持改变模式。
|
||||
.PD 1
|
||||
.
|
||||
.TP
|
||||
.B \-geometry x[%][:y[%]] or [WxH][+x+y]
|
||||
.B \-geometry x[%][:y[%]] 或 [WxH][+-x+-y]
|
||||
调整屏幕输出的初始位置。
|
||||
x 和 y 代表从屏幕左上角到显示图像左上角的距离(以像素为单位)。
|
||||
不过如果在参数值后有百分号记号, 参数值就变为该方向上的屏幕尺寸的百分数。
|
||||
它也支持标准 X11 的 \-geometry 选项格式。
|
||||
如果使用 \-wid 选项指定了外部窗口,
|
||||
那么 x 和 y 坐标是相对于窗口而不是屏幕的左上角。
|
||||
它也支持标准 X11 的 \-geometry 选项格式。在这种方式下,例如,‘+10-50’表示“放在距左
|
||||
边界 10 个像素,距下边界 50 个像素的地方”,而‘--20+-10’表示“放在越出右边界 20 个像
|
||||
素,越出上边界 10 个像素的地方。”
|
||||
如果使用 \-wid 选项指定了外部窗口,那么 x 和 y 坐标是相对于窗口而不是屏幕的左上角。
|
||||
坐标是相对于 \-xineramascreen 选项给出的屏幕,该屏幕用于完全支持 \-xineramascreen 的
|
||||
视频输出的驱动(direct3d、gl、gl2、vdpau、x11、xv、xvmc、corevideo)。
|
||||
The coordinates are relative to the screen given with \-xineramascreen for
|
||||
@ -5427,6 +5428,10 @@ Completely empties the filter list.
|
||||
计数值,用以决定多少帧后 cropdetect 将重置先前侦测到的最大视频区域,并重
|
||||
新侦测当前的最优切割区域。该选项在电视台台标影响了视频区域时可能有用。0
|
||||
表示从不重置而是返回播放过程中遇到的最大区域。(默认值:0)。
|
||||
计数值,用以决定多少帧后 cropdetect 将重置先前侦测到的最大视频区域,并
|
||||
重新开始侦测当前的最优切割区域(默认值:0)。
|
||||
该选项在频道台标破坏了视频区域的情况下很有效。
|
||||
0 代表从不重置并返回整个播放过程中遇到的最大视频区域。
|
||||
.RE
|
||||
.PD 1
|
||||
.
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
# MPlayer mirroring script
|
||||
# $Id$
|
||||
|
||||
@ -10,7 +10,7 @@ MAILADR=<report_mail_to_adr>
|
||||
#TMPDIR = /tmp
|
||||
#export TMPDIR
|
||||
|
||||
TMPFILE=`mktemp -t mplayer.XXXXXXXXXXX`
|
||||
TMPFILE=$(mktemp -t mplayer.XXXXXXXXXXX)
|
||||
|
||||
# Check to see if another sync is in progress
|
||||
if lockfile -! -l 43200 -r 0 "$LOCK"; then
|
||||
@ -30,9 +30,8 @@ rsync -pxlrHtWv --delete --delete-after --exclude '/benchmark' \
|
||||
--exclude '/old_stuff' --exclude '/tests' rsync.mplayerhq.hu::ftp/ \
|
||||
MPlayer >> $TMPFILE 2>&1
|
||||
|
||||
x=`wc -l $TMPFILE | awk '{print $1}'`
|
||||
if [ "$x" -ne "10" ]
|
||||
then
|
||||
x=$(wc -l $TMPFILE | awk '{print $1}')
|
||||
if [ "$x" -ne "10" ]; then
|
||||
mailx -s "MPlayer mirror" $MAILADR < $TMPFILE
|
||||
fi
|
||||
rm -f $TMPFILE
|
||||
|
@ -1,6 +0,0 @@
|
||||
The NUT specification has been moved to another Subversion repository.
|
||||
You can find it at:
|
||||
http://svn.mplayerhq.hu/nut/docs/nut.txt?view=markup
|
||||
|
||||
Its future location will be in a git repository. This file will be
|
||||
updated when its location changes again.
|
@ -1,6 +0,0 @@
|
||||
oggless-xiph-codecs.txt has been moved to another Subversion repository.
|
||||
You can find it at:
|
||||
http://svn.mplayerhq.hu/nut/docs/oggless-xiph-codecs.txt?view=markup
|
||||
|
||||
Its future location will be in a git repository. This file will be
|
||||
updated when its location changes again.
|
@ -21,10 +21,14 @@ http://svnbook.org/
|
||||
|
||||
For more information about the Subversion project, visit
|
||||
|
||||
http://subversion.tigris.org/
|
||||
http://subversion.apache.org/
|
||||
|
||||
Consult these resources whenever you have problems, they are quite exhaustive.
|
||||
|
||||
You do not need a special checkout that works through ssh or similar in order
|
||||
to be able to commit changes. All you need is the username and password pair
|
||||
that you received from the MPlayer Subversion server admin.
|
||||
|
||||
What follows now is a basic introduction to Subversion and some MPlayer-specific
|
||||
guidelines. Read it at least once, if you are granted commit privileges to the
|
||||
MPlayer project you are expected to be familiar with these rules.
|
||||
|
@ -1754,10 +1754,6 @@ If you want to do software transcoding you should have at least a 1GHz CPU.
|
||||
<para>
|
||||
Configure should detect your DVB card. If it did not, force detection with
|
||||
<screen>./configure --enable-dvb</screen>
|
||||
If you have ost headers at a non-standard path, set the path with
|
||||
<screen>
|
||||
./configure --with-extraincdir=<replaceable>DVB source directory</replaceable>/ost/include
|
||||
</screen>
|
||||
Then compile and install as usual.</para>
|
||||
|
||||
<formalpara><title>USAGE</title>
|
||||
|
73
configure
vendored
73
configure
vendored
@ -353,7 +353,6 @@ Video output:
|
||||
--enable-ivtv enable IVTV TV-Out video output [autodetect]
|
||||
--enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
|
||||
--enable-dvb enable DVB video output [autodetect]
|
||||
--enable-dvbhead enable DVB video output (HEAD version) [autodetect]
|
||||
--enable-mga enable mga_vid video output [autodetect]
|
||||
--enable-xmga enable mga_vid X11 video output [autodetect]
|
||||
--enable-xv enable Xv video output [autodetect]
|
||||
@ -551,7 +550,6 @@ _svga=auto
|
||||
_vesa=auto
|
||||
_fbdev=auto
|
||||
_dvb=auto
|
||||
_dvbhead=auto
|
||||
_dxr2=auto
|
||||
_dxr3=auto
|
||||
_ivtv=auto
|
||||
@ -921,8 +919,6 @@ for ac_option do
|
||||
--disable-fbdev) _fbdev=no ;;
|
||||
--enable-dvb) _dvb=yes ;;
|
||||
--disable-dvb) _dvb=no ;;
|
||||
--enable-dvbhead) _dvbhead=yes ;;
|
||||
--disable-dvbhead) _dvbhead=no ;;
|
||||
--enable-dxr2) _dxr2=yes ;;
|
||||
--disable-dxr2) _dxr2=no ;;
|
||||
--enable-dxr3) _dxr3=yes ;;
|
||||
@ -3827,6 +3823,17 @@ fi
|
||||
echores "$_setenv"
|
||||
|
||||
|
||||
echocheck "setmode()"
|
||||
_setmode=no
|
||||
def_setmode='#define HAVE_SETMODE 0'
|
||||
cat > $TMPC << EOF
|
||||
#include <io.h>
|
||||
int main(void) { setmode(0, 0); return 0; }
|
||||
EOF
|
||||
cc_check && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
|
||||
echores "$_setmode"
|
||||
|
||||
|
||||
if sunos; then
|
||||
echocheck "sysi86()"
|
||||
cat > $TMPC << EOF
|
||||
@ -4707,36 +4714,6 @@ cat >$TMPC << EOF
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <ost/dmx.h>
|
||||
#include <ost/frontend.h>
|
||||
#include <ost/sec.h>
|
||||
#include <ost/video.h>
|
||||
#include <ost/audio.h>
|
||||
int main(void) {return 0;}
|
||||
EOF
|
||||
for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
|
||||
cc_check $_inc_tmp && _dvb=yes && \
|
||||
extra_cflags="$extra_cflags $_inc_tmp" && break
|
||||
done
|
||||
fi
|
||||
echores "$_dvb"
|
||||
if test "$_dvb" = yes ; then
|
||||
def_dvb='#define CONFIG_DVB 1'
|
||||
def_dvbin='#define CONFIG_DVBIN 1'
|
||||
_aomodules="mpegpes(dvb) $_aomodules"
|
||||
_vomodules="mpegpes(dvb) $_vomodules"
|
||||
fi
|
||||
|
||||
echocheck "DVB HEAD"
|
||||
if test "$_dvbhead" = auto ; then
|
||||
_dvbhead=no
|
||||
|
||||
cat >$TMPC << EOF
|
||||
#include <poll.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <linux/dvb/dmx.h>
|
||||
#include <linux/dvb/frontend.h>
|
||||
#include <linux/dvb/video.h>
|
||||
@ -4744,35 +4721,27 @@ cat >$TMPC << EOF
|
||||
int main(void) {return 0;}
|
||||
EOF
|
||||
for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
|
||||
cc_check $_inc_tmp && _dvbhead=yes && \
|
||||
cc_check $_inc_tmp && _dvb=yes && \
|
||||
extra_cflags="$extra_cflags $_inc_tmp" && break
|
||||
done
|
||||
fi
|
||||
echores "$_dvbhead"
|
||||
if test "$_dvbhead" = yes ; then
|
||||
echores "$_dvb"
|
||||
if test "$_dvb" = yes ; then
|
||||
_dvbin=yes
|
||||
_inputmodules="dvb $_inputmodules"
|
||||
def_dvb='#define CONFIG_DVB 1'
|
||||
def_dvb_head='#define CONFIG_DVB_HEAD 1'
|
||||
def_dvbin='#define CONFIG_DVBIN 1'
|
||||
_aomodules="mpegpes(dvb) $_aomodules"
|
||||
_vomodules="mpegpes(dvb) $_vomodules"
|
||||
fi
|
||||
|
||||
if test "$_dvbhead" = no && test "$_dvb" = no ; then
|
||||
else
|
||||
_dvbin=no
|
||||
_noinputmodules="dvb $_noinputmodules"
|
||||
def_dvb='#undef CONFIG_DVB'
|
||||
def_dvb_head='#undef CONFIG_DVB_HEAD'
|
||||
def_dvbin='#undef CONFIG_DVBIN '
|
||||
_aomodules="mpegpes(file) $_aomodules"
|
||||
_vomodules="mpegpes(file) $_vomodules"
|
||||
fi
|
||||
|
||||
if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
|
||||
_dvbin=yes
|
||||
_inputmodules="dvb $_inputmodules"
|
||||
else
|
||||
_dvbin=no
|
||||
_noinputmodules="dvb $_noinputmodules"
|
||||
fi
|
||||
|
||||
|
||||
if darwin; then
|
||||
|
||||
@ -5884,7 +5853,7 @@ fi
|
||||
echocheck "VCD support"
|
||||
if test "$_vcd" = auto; then
|
||||
_vcd=no
|
||||
if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos; then
|
||||
if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos || os2; then
|
||||
_vcd=yes
|
||||
elif mingw32; then
|
||||
cat > $TMPC << EOF
|
||||
@ -8241,6 +8210,7 @@ $def_nanosleep
|
||||
$def_posix_select
|
||||
$def_select
|
||||
$def_setenv
|
||||
$def_setmode
|
||||
$def_shm
|
||||
$def_strsep
|
||||
$def_swab
|
||||
@ -8445,7 +8415,6 @@ $def_directfb
|
||||
$def_directfb_version
|
||||
$def_directx
|
||||
$def_dvb
|
||||
$def_dvb_head
|
||||
$def_dvbin
|
||||
$def_dxr2
|
||||
$def_dxr3
|
||||
|
@ -30,11 +30,6 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef CONFIG_DVB
|
||||
#include <poll.h>
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
#include "audio_out.h"
|
||||
#include "audio_out_internal.h"
|
||||
|
||||
@ -46,14 +41,11 @@
|
||||
#include "help_mp.h"
|
||||
|
||||
#ifdef CONFIG_DVB
|
||||
#ifndef CONFIG_DVB_HEAD
|
||||
#include <ost/audio.h>
|
||||
audioMixer_t dvb_mixer={255,255};
|
||||
#else
|
||||
#include <poll.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/dvb/audio.h>
|
||||
audio_mixer_t dvb_mixer={255,255};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define true 1
|
||||
#define false 0
|
||||
@ -116,13 +108,8 @@ static int freq_id=0;
|
||||
static int init_device(int card)
|
||||
{
|
||||
char ao_file[30];
|
||||
#ifndef CONFIG_DVB_HEAD
|
||||
mp_msg(MSGT_VO,MSGL_INFO, "Opening /dev/ost/audio\n");
|
||||
sprintf(ao_file, "/dev/ost/audio");
|
||||
#else
|
||||
mp_msg(MSGT_VO,MSGL_INFO, "Opening /dev/dvb/adapter%d/audio0\n", card);
|
||||
sprintf(ao_file, "/dev/dvb/adapter%d/audio0", card);
|
||||
#endif
|
||||
if((vo_mpegpes_fd2 = open(ao_file,O_RDWR|O_NONBLOCK)) < 0)
|
||||
{
|
||||
mp_msg(MSGT_VO, MSGL_ERR, "DVB AUDIO DEVICE: %s\n", strerror(errno));
|
||||
|
@ -55,7 +55,7 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){
|
||||
|
||||
// init driver
|
||||
static int init(sh_video_t *sh){
|
||||
unsigned int out_fmt=sh->codec->outfmt[sh->outfmtidx];
|
||||
unsigned int out_fmt=sh->codec->outfmt[0];
|
||||
struct context *ctx;
|
||||
void *decoder;
|
||||
if(!(decoder=DMO_VideoDecoder_Open(sh->codec->dll,&sh->codec->guid, sh->bih, 0, 0))){
|
||||
@ -64,6 +64,8 @@ static int init(sh_video_t *sh){
|
||||
return 0;
|
||||
}
|
||||
if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,out_fmt)) return 0;
|
||||
// mpcodecs_config_vo can change the format
|
||||
out_fmt=sh->codec->outfmt[sh->outfmtidx];
|
||||
sh->context = ctx = calloc(1, sizeof(*ctx));
|
||||
ctx->decoder = decoder;
|
||||
switch(out_fmt){
|
||||
|
@ -66,7 +66,7 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){
|
||||
|
||||
// init driver
|
||||
static int init(sh_video_t *sh){
|
||||
unsigned int out_fmt=sh->codec->outfmt[sh->outfmtidx];
|
||||
unsigned int out_fmt=sh->codec->outfmt[0];
|
||||
|
||||
/* Hack for VSSH codec: new dll can't decode old files
|
||||
* In my samples old files have no extradata, so use that info
|
||||
@ -81,6 +81,8 @@ static int init(sh_video_t *sh){
|
||||
return 0;
|
||||
}
|
||||
if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,out_fmt)) return 0;
|
||||
// mpcodecs_config_vo can change the format
|
||||
out_fmt=sh->codec->outfmt[sh->outfmtidx];
|
||||
switch(out_fmt){
|
||||
case IMGFMT_YUY2:
|
||||
case IMGFMT_UYVY:
|
||||
|
@ -30,76 +30,77 @@ char *vo_geometry;
|
||||
int geometry_wh_changed;
|
||||
int geometry_xy_changed;
|
||||
|
||||
#define RESET_GEOMETRY width = height = xoff = yoff = xper = yper = INT_MIN;
|
||||
|
||||
// xpos,ypos: position of the left upper corner
|
||||
// widw,widh: width and height of the window
|
||||
// scrw,scrh: width and height of the current screen
|
||||
int geometry(int *xpos, int *ypos, int *widw, int *widh, int scrw, int scrh)
|
||||
{
|
||||
int width, height, xoff, yoff, xper, yper;
|
||||
|
||||
RESET_GEOMETRY
|
||||
|
||||
if(vo_geometry != NULL) {
|
||||
if(sscanf(vo_geometry, "%ix%i+%i+%i", &width, &height, &xoff, &yoff) != 4 )
|
||||
{
|
||||
RESET_GEOMETRY
|
||||
if(sscanf(vo_geometry, "%ix%i", &width, &height) != 2)
|
||||
{
|
||||
RESET_GEOMETRY
|
||||
if(sscanf(vo_geometry, "+%i+%i", &xoff, &yoff) != 2)
|
||||
{
|
||||
char percent[2];
|
||||
RESET_GEOMETRY
|
||||
if(sscanf(vo_geometry, "%i%%:%i%1[%]", &xper, &yper, percent) != 3)
|
||||
{
|
||||
RESET_GEOMETRY
|
||||
if(sscanf(vo_geometry, "%i:%i%1[%]", &xoff, &yper, percent) != 3)
|
||||
{
|
||||
RESET_GEOMETRY
|
||||
if(sscanf(vo_geometry, "%i%%:%i", &xper, &yoff) != 2)
|
||||
{
|
||||
RESET_GEOMETRY
|
||||
if(sscanf(vo_geometry, "%i:%i", &xoff, &yoff) != 2)
|
||||
{
|
||||
RESET_GEOMETRY
|
||||
if(sscanf(vo_geometry, "%i%1[%]", &xper, percent) != 2)
|
||||
{
|
||||
char xsign[2], ysign[2];
|
||||
int width, height, xoff, yoff, xper, yper;
|
||||
int i;
|
||||
int ok = 0;
|
||||
for (i = 0; !ok && i < 8; i++) {
|
||||
width = height = xoff = yoff = xper = yper = INT_MIN;
|
||||
strcpy(xsign, "+");
|
||||
strcpy(ysign, "+");
|
||||
switch (i) {
|
||||
case 0:
|
||||
ok = sscanf(vo_geometry, "%ix%i%1[+-]%i%1[+-]%i", &width, &height, xsign, &xoff, ysign, &yoff) == 6;
|
||||
break;
|
||||
case 1:
|
||||
ok = sscanf(vo_geometry, "%ix%i", &width, &height) == 2;
|
||||
break;
|
||||
case 2:
|
||||
ok = sscanf(vo_geometry, "%1[+-]%i%1[+-]%i", xsign, &xoff, ysign, &yoff) == 4;
|
||||
break;
|
||||
case 3:
|
||||
ok = sscanf(vo_geometry, "%i%%:%i%%", &xper, &yper) == 2;
|
||||
break;
|
||||
case 4:
|
||||
ok = sscanf(vo_geometry, "%i:%i%%", &xoff, &yper) == 2;
|
||||
break;
|
||||
case 5:
|
||||
ok = sscanf(vo_geometry, "%i%%:%i", &xper, &yoff) == 2;
|
||||
break;
|
||||
case 6:
|
||||
ok = sscanf(vo_geometry, "%i:%i", &xoff, &yoff) == 2;
|
||||
break;
|
||||
case 7:
|
||||
ok = sscanf(vo_geometry, "%i%%", &xper) == 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!ok) {
|
||||
mp_msg(MSGT_VO, MSGL_ERR,
|
||||
"-geometry must be in [WxH][+X+Y] | [X[%%]:[Y[%%]]] format, incorrect (%s)\n", vo_geometry);
|
||||
"-geometry must be in [WxH][[+-]X[+-]Y] | [X[%%]:[Y[%%]]] format, incorrect (%s)\n", vo_geometry);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mp_msg(MSGT_VO, MSGL_V,"geometry window parameter: widw: %i,"
|
||||
" widh: %i, scrw: %i, scrh: %i\n",*widw, *widh, scrw, scrh);
|
||||
|
||||
mp_msg(MSGT_VO, MSGL_V,"geometry set to width: %i,"
|
||||
"height: %i, xoff: %i, yoff: %i, xper: %i, yper: %i\n",
|
||||
width, height, xoff, yoff, xper, yper);
|
||||
"height: %i, xoff: %s%i, yoff: %s%i, xper: %i, yper: %i\n",
|
||||
width, height, xsign, xoff, ysign, yoff, xper, yper);
|
||||
|
||||
if (width > 0 && widw) *widw = width;
|
||||
if (height > 0 && widh) *widh = height;
|
||||
|
||||
if(xoff != INT_MIN && xsign[0] == '-') xoff = scrw - *widw - xoff;
|
||||
if(yoff != INT_MIN && ysign[0] == '-') yoff = scrh - *widh - yoff;
|
||||
if(xper >= 0 && xper <= 100) xoff = (scrw - *widw) * ((float)xper / 100.0);
|
||||
if(yper >= 0 && yper <= 100) yoff = (scrh - *widh) * ((float)yper / 100.0);
|
||||
|
||||
mp_msg(MSGT_VO, MSGL_V,"geometry set to width: %i,"
|
||||
"height: %i, xoff: %i, yoff: %i, xper: %i, yper: %i\n",
|
||||
width, height, xoff, yoff, xper, yper);
|
||||
mp_msg(MSGT_VO, MSGL_V,"geometry window parameter: widw: %i,"
|
||||
" widh: %i, scrw: %i, scrh: %i\n",*widw, *widh, scrw, scrh);
|
||||
|
||||
if (xoff != INT_MIN && xpos) *xpos = xoff;
|
||||
if (yoff != INT_MIN && ypos) *ypos = yoff;
|
||||
if (width > 0 && widw) *widw = width;
|
||||
if (height > 0 && widh) *widh = height;
|
||||
|
||||
geometry_wh_changed = width > 0 || height > 0;
|
||||
geometry_xy_changed = xoff != INT_MIN || yoff != INT_MIN;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
#undef RESET_GEOMETRY
|
||||
|
@ -554,9 +554,6 @@ char *fb_mode_name = NULL;
|
||||
|
||||
static fb_mode_t *fb_mode = NULL;
|
||||
|
||||
/* vt related variables */
|
||||
static FILE *vt_fp = NULL;
|
||||
|
||||
/* vo_fbdev related variables */
|
||||
static int fb_dev_fd;
|
||||
static int fb_tty_fd = -1;
|
||||
@ -736,9 +733,11 @@ static void vt_set_textarea(int u, int l)
|
||||
int lrow = l / 16;
|
||||
|
||||
mp_msg(MSGT_VO, MSGL_DBG2, "vt_set_textarea(%d,%d): %d,%d\n", u, l, urow, lrow);
|
||||
if (vt_fp) {
|
||||
fprintf(vt_fp, "\33[%d;%dr\33[%d;%dH", urow, lrow, lrow, 0);
|
||||
fflush(vt_fp);
|
||||
if (fb_tty_fd >= 0) {
|
||||
char modestring[100];
|
||||
snprintf(modestring, sizeof(modestring), "\33[%d;%dr\33[%d;%dH", urow, lrow, lrow, 0);
|
||||
write(fb_tty_fd, modestring, strlen(modestring));
|
||||
fsync(fb_tty_fd);
|
||||
}
|
||||
}
|
||||
|
||||
@ -973,9 +972,6 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
|
||||
if (fs || vm)
|
||||
memset(frame_buffer, '\0', fb_line_len * fb_yres);
|
||||
}
|
||||
if (!(vt_fp = fopen("/dev/tty", "w"))) {
|
||||
mp_msg(MSGT_VO, MSGL_ERR, "can't fopen /dev/tty: %s\n", strerror(errno));
|
||||
}
|
||||
|
||||
vt_set_textarea(last_row, fb_yres);
|
||||
|
||||
@ -1056,8 +1052,6 @@ static void uninit(void)
|
||||
mp_msg(MSGT_VO, MSGL_WARN, "Can't restore text mode: %s\n", strerror(errno));
|
||||
}
|
||||
vt_set_textarea(0, fb_orig_vinfo.yres);
|
||||
if (vt_fp)
|
||||
fclose(vt_fp);
|
||||
close(fb_tty_fd);
|
||||
close(fb_dev_fd);
|
||||
if (frame_buffer)
|
||||
|
@ -38,20 +38,6 @@
|
||||
#include "mp_msg.h"
|
||||
|
||||
#ifdef CONFIG_DVB
|
||||
#ifndef CONFIG_DVB_HEAD
|
||||
#include <poll.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <ost/dmx.h>
|
||||
#include <ost/frontend.h>
|
||||
#include <ost/sec.h>
|
||||
#include <ost/video.h>
|
||||
#include <ost/audio.h>
|
||||
|
||||
#else
|
||||
#define true 1
|
||||
#define false 0
|
||||
#include <poll.h>
|
||||
@ -65,7 +51,6 @@
|
||||
#include <linux/dvb/video.h>
|
||||
#include <linux/dvb/audio.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
#include "video_out.h"
|
||||
@ -141,15 +126,9 @@ static int preinit(const char *arg){
|
||||
mp_msg(MSGT_VO,MSGL_INFO, "Couldn't find a usable dvb video device, exiting\n");
|
||||
return -1;
|
||||
}
|
||||
#ifndef CONFIG_DVB_HEAD
|
||||
mp_msg(MSGT_VO,MSGL_INFO, "Opening /dev/ost/video+audio\n");
|
||||
sprintf(vo_file, "/dev/ost/video");
|
||||
sprintf(ao_file, "/dev/ost/audio");
|
||||
#else
|
||||
mp_msg(MSGT_VO,MSGL_INFO, "Opening /dev/dvb/adapter%d/video0+audio0\n", card);
|
||||
sprintf(vo_file, "/dev/dvb/adapter%d/video0", card);
|
||||
sprintf(ao_file, "/dev/dvb/adapter%d/audio0", card);
|
||||
#endif
|
||||
if((vo_mpegpes_fd = open(vo_file,O_RDWR)) < 0){
|
||||
perror("DVB VIDEO DEVICE: ");
|
||||
return -1;
|
||||
|
@ -350,7 +350,8 @@ struct CRITSECT
|
||||
{
|
||||
pthread_t id;
|
||||
pthread_mutex_t mutex;
|
||||
int locked;
|
||||
pthread_cond_t unlocked;
|
||||
int lock_count;
|
||||
long deadbeef;
|
||||
};
|
||||
|
||||
@ -568,16 +569,30 @@ static HMODULE WINAPI expGetDriverModuleHandle(DRVR* pdrv)
|
||||
#define MODULE_HANDLE_winmm ((HMODULE)0x128)
|
||||
#define MODULE_HANDLE_psapi ((HMODULE)0x129)
|
||||
|
||||
// Fake PE header, since some software (and the Microsoft CRT v8 and newer)
|
||||
// assume GetModuleHandle(NULL) returns a pointer to a PE header.
|
||||
// We simulate a very simple header with only one section.
|
||||
//
|
||||
// NOTE: If you have a section called .mixcrt, the Microsoft CRT will assume
|
||||
// it's running in a POSIX binary, and stop using EncodePointer/DecodePointer.
|
||||
static const struct {
|
||||
IMAGE_DOS_HEADER doshdr;
|
||||
IMAGE_NT_HEADERS nthdr;
|
||||
IMAGE_SECTION_HEADER opthdr;
|
||||
} __attribute__((__packed__)) mp_exe = {
|
||||
.doshdr.e_lfanew = sizeof(IMAGE_DOS_HEADER),
|
||||
.nthdr.FileHeader.NumberOfSections = 1,
|
||||
.nthdr.FileHeader.SizeOfOptionalHeader =
|
||||
sizeof(IMAGE_NT_HEADERS) - FIELD_OFFSET(IMAGE_NT_HEADERS, OptionalHeader), /* 0xe0 */
|
||||
.opthdr.Name = ".text"
|
||||
};
|
||||
|
||||
static HMODULE WINAPI expGetModuleHandleA(const char* name)
|
||||
{
|
||||
WINE_MODREF* wm;
|
||||
HMODULE result;
|
||||
if(!name)
|
||||
#ifdef CONFIG_QTX_CODECS
|
||||
result=1;
|
||||
#else
|
||||
result=0;
|
||||
#endif
|
||||
result=(HMODULE)&mp_exe.doshdr;
|
||||
else
|
||||
{
|
||||
wm=MODULE_FindModule(name);
|
||||
@ -736,7 +751,7 @@ static void* WINAPI expCreateEventA(void* pSecAttr, char bManualReset,
|
||||
mlist->pm=pm;
|
||||
mlist->pc=pc;
|
||||
mlist->state=bInitialState;
|
||||
mlist->reset=bManualReset;
|
||||
mlist->reset=!bManualReset;
|
||||
if(name)
|
||||
strncpy(mlist->name, name, 127);
|
||||
else
|
||||
@ -786,6 +801,7 @@ static void* WINAPI expWaitForSingleObject(void* object, int duration)
|
||||
// FIXME FIXME FIXME - this value is sometime unititialize !!!
|
||||
int ret = WAIT_FAILED;
|
||||
mutex_list* pp=mlist;
|
||||
th_list* tp=list;
|
||||
if(object == (void*)0xcfcf9898)
|
||||
{
|
||||
/**
|
||||
@ -801,6 +817,17 @@ static void* WINAPI expWaitForSingleObject(void* object, int duration)
|
||||
}
|
||||
dbgprintf("WaitForSingleObject(0x%x, duration %d) =>\n",object, duration);
|
||||
|
||||
// See if this is a thread.
|
||||
while (tp && (tp->thread != object))
|
||||
tp = tp->prev;
|
||||
if (tp) {
|
||||
if (pthread_join(*(pthread_t*)object, NULL) == 0) {
|
||||
return (void*)WAIT_OBJECT_0;
|
||||
} else {
|
||||
return (void*)WAIT_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
// loop below was slightly fixed - its used just for checking if
|
||||
// this object really exists in our list
|
||||
if (!ml)
|
||||
@ -817,8 +844,8 @@ static void* WINAPI expWaitForSingleObject(void* object, int duration)
|
||||
switch(ml->type) {
|
||||
case 0: /* Event */
|
||||
if (duration == 0) { /* Check Only */
|
||||
if (ml->state == 1) ret = WAIT_FAILED;
|
||||
else ret = WAIT_OBJECT_0;
|
||||
if (ml->state == 1) ret = WAIT_OBJECT_0;
|
||||
else ret = WAIT_FAILED;
|
||||
}
|
||||
if (duration == -1) { /* INFINITE */
|
||||
if (ml->state == 0)
|
||||
@ -1331,7 +1358,8 @@ static void WINAPI expInitializeCriticalSection(CRITICAL_SECTION* c)
|
||||
return;
|
||||
}
|
||||
pthread_mutex_init(&cs->mutex, NULL);
|
||||
cs->locked = 0;
|
||||
pthread_cond_init(&cs->unlocked, NULL);
|
||||
cs->lock_count = 0;
|
||||
critsecs_list[i].cs_win = c;
|
||||
critsecs_list[i].cs_unix = cs;
|
||||
dbgprintf("InitializeCriticalSection -> itemno=%d, cs_win=%p, cs_unix=%p\n",
|
||||
@ -1342,7 +1370,8 @@ static void WINAPI expInitializeCriticalSection(CRITICAL_SECTION* c)
|
||||
struct CRITSECT* cs = mreq_private(sizeof(struct CRITSECT) + sizeof(CRITICAL_SECTION),
|
||||
0, AREATYPE_CRITSECT);
|
||||
pthread_mutex_init(&cs->mutex, NULL);
|
||||
cs->locked=0;
|
||||
pthread_cond_init(&cs->unlocked, NULL);
|
||||
cs->lock_count = 0;
|
||||
cs->deadbeef = 0xdeadbeef;
|
||||
*(void**)c = cs;
|
||||
}
|
||||
@ -1374,12 +1403,17 @@ static void WINAPI expEnterCriticalSection(CRITICAL_SECTION* c)
|
||||
#endif
|
||||
dbgprintf("Win32 Warning: Accessed uninitialized Critical Section (%p)!\n", c);
|
||||
}
|
||||
if(cs->locked)
|
||||
if(cs->id==pthread_self())
|
||||
return;
|
||||
pthread_mutex_lock(&(cs->mutex));
|
||||
cs->locked=1;
|
||||
cs->id=pthread_self();
|
||||
if (cs->lock_count > 0 && cs->id == pthread_self()) {
|
||||
cs->lock_count++;
|
||||
} else {
|
||||
while (cs->lock_count != 0) {
|
||||
pthread_cond_wait(&(cs->unlocked), &(cs->mutex));
|
||||
}
|
||||
cs->lock_count = 1;
|
||||
cs->id = pthread_self();
|
||||
}
|
||||
pthread_mutex_unlock(&(cs->mutex));
|
||||
return;
|
||||
}
|
||||
static void WINAPI expLeaveCriticalSection(CRITICAL_SECTION* c)
|
||||
@ -1396,13 +1430,16 @@ static void WINAPI expLeaveCriticalSection(CRITICAL_SECTION* c)
|
||||
dbgprintf("Win32 Warning: Leaving uninitialized Critical Section %p!!\n", c);
|
||||
return;
|
||||
}
|
||||
if (cs->locked)
|
||||
{
|
||||
cs->locked=0;
|
||||
pthread_mutex_unlock(&(cs->mutex));
|
||||
pthread_mutex_lock(&(cs->mutex));
|
||||
if (cs->lock_count == 0) {
|
||||
dbgprintf("Win32 Warning: Unlocking unlocked Critical Section %p!!\n", c);
|
||||
} else {
|
||||
cs->lock_count--;
|
||||
}
|
||||
else
|
||||
dbgprintf("Win32 Warning: Unlocking unlocked Critical Section %p!!\n", c);
|
||||
if (cs->lock_count == 0) {
|
||||
pthread_cond_signal(&(cs->unlocked));
|
||||
}
|
||||
pthread_mutex_unlock(&(cs->mutex));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1424,14 +1461,16 @@ static void WINAPI expDeleteCriticalSection(CRITICAL_SECTION *c)
|
||||
return;
|
||||
}
|
||||
|
||||
if (cs->locked)
|
||||
pthread_mutex_lock(&(cs->mutex));
|
||||
if (cs->lock_count > 0)
|
||||
{
|
||||
dbgprintf("Win32 Warning: Deleting unlocked Critical Section %p!!\n", c);
|
||||
pthread_mutex_unlock(&(cs->mutex));
|
||||
dbgprintf("Win32 Warning: Deleting locked Critical Section %p!!\n", c);
|
||||
}
|
||||
pthread_mutex_unlock(&(cs->mutex));
|
||||
|
||||
#ifndef GARBAGE
|
||||
pthread_mutex_destroy(&(cs->mutex));
|
||||
pthread_cond_destroy(&(cs->unlocked));
|
||||
// released by GarbageCollector in my_relase otherwise
|
||||
#endif
|
||||
my_release(cs);
|
||||
@ -4701,10 +4740,9 @@ typedef struct tagPALETTEENTRY {
|
||||
BYTE peFlags;
|
||||
} PALETTEENTRY;
|
||||
|
||||
/* reversed the first 2 entries */
|
||||
typedef struct tagLOGPALETTE {
|
||||
WORD palNumEntries;
|
||||
WORD palVersion;
|
||||
WORD palNumEntries;
|
||||
PALETTEENTRY palPalEntry[1];
|
||||
} LOGPALETTE;
|
||||
|
||||
|
@ -27,7 +27,24 @@
|
||||
#define INCL_DOS
|
||||
#define INCL_DOSDEVIOCTL
|
||||
#include <os2.h>
|
||||
#endif
|
||||
|
||||
#include <process.h> /* getpid() */
|
||||
|
||||
#define REALTIME_PRIORITY_CLASS MAKESHORT(0, PRTYC_TIMECRITICAL)
|
||||
#define HIGH_PRIORITY_CLASS MAKESHORT(PRTYD_MAXIMUM, PRTYC_REGULAR)
|
||||
#define ABOVE_NORMAL_PRIORITY_CLASS MAKESHORT(PRTYD_MAXIMUM / 2, PRTYC_REGULAR)
|
||||
#define NORMAL_PRIORITY_CLASS MAKESHORT(0, PRTYC_REGULAR)
|
||||
#define BELOW_NORMAL_PRIORITY_CLASS MAKESHORT(PRTYD_MAXIMUM, PRTYC_IDLETIME)
|
||||
#define IDLE_PRIORITY_CLASS MAKESHORT(0, PRTYC_IDLETIME)
|
||||
|
||||
#define SetPriorityClass(pid, prio) \
|
||||
DosSetPriority(PRTYS_PROCESS, \
|
||||
HIBYTE(prio), \
|
||||
LOBYTE(prio), \
|
||||
pid)
|
||||
|
||||
#define GetCurrentProcess() getpid()
|
||||
#endif /* __OS2__ */
|
||||
|
||||
#endif /* MPLAYER_OSDEP_H */
|
||||
|
||||
|
@ -20,23 +20,11 @@
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifdef __OS2__
|
||||
|
||||
#define INCL_DOS
|
||||
#include <os2.h>
|
||||
|
||||
#define REALTIME_PRIORITY_CLASS MAKESHORT(0, PRTYC_TIMECRITICAL)
|
||||
#define HIGH_PRIORITY_CLASS MAKESHORT(PRTYD_MAXIMUM, PRTYC_REGULAR)
|
||||
#define ABOVE_NORMAL_PRIORITY_CLASS MAKESHORT(PRTYD_MAXIMUM / 2, PRTYC_REGULAR)
|
||||
#define NORMAL_PRIORITY_CLASS MAKESHORT(0, PRTYC_REGULAR)
|
||||
#define BELOW_NORMAL_PRIORITY_CLASS MAKESHORT(PRTYD_MAXIMUM, PRTYC_IDLETIME)
|
||||
#define IDLE_PRIORITY_CLASS MAKESHORT(0, PRTYC_IDLETIME)
|
||||
|
||||
#else
|
||||
#include "osdep.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
|
||||
#endif /* __OS2__ */
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@ -76,13 +64,6 @@ void set_priority(void)
|
||||
mp_tmsg(MSGT_CPLAYER, MSGL_STATUS, "Setting process priority: %s\n",
|
||||
priority_presets_defs[i].name);
|
||||
|
||||
#ifdef __OS2__
|
||||
DosSetPriority(PRTYS_PROCESS,
|
||||
HIBYTE(priority_presets_defs[i].prio),
|
||||
LOBYTE(priority_presets_defs[i].prio),
|
||||
0);
|
||||
#else
|
||||
SetPriorityClass(GetCurrentProcess(), priority_presets_defs[i].prio);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -32,17 +32,9 @@
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include <linux/dvb/dmx.h>
|
||||
#include <linux/dvb/frontend.h>
|
||||
#include "config.h"
|
||||
|
||||
#ifdef CONFIG_DVB_HEAD
|
||||
#include <linux/dvb/dmx.h>
|
||||
#include <linux/dvb/frontend.h>
|
||||
#else
|
||||
#include <ost/dmx.h>
|
||||
#include <ost/sec.h>
|
||||
#include <ost/frontend.h>
|
||||
#endif
|
||||
|
||||
#include "dvbin.h"
|
||||
#include "dvb_tune.h"
|
||||
#include "mp_msg.h"
|
||||
@ -51,11 +43,7 @@
|
||||
|
||||
int dvb_get_tuner_type(int fe_fd)
|
||||
{
|
||||
#ifdef CONFIG_DVB_HEAD
|
||||
struct dvb_frontend_info fe_info;
|
||||
#else
|
||||
FrontendInfo fe_info;
|
||||
#endif
|
||||
|
||||
int res;
|
||||
|
||||
@ -96,35 +84,16 @@ int dvb_open_devices(dvb_priv_t *priv, int n, int demux_cnt)
|
||||
{
|
||||
int i;
|
||||
char frontend_dev[32], dvr_dev[32], demux_dev[32];
|
||||
#ifndef CONFIG_DVB_HEAD
|
||||
char sec_dev[32];
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DVB_HEAD
|
||||
sprintf(frontend_dev, "/dev/dvb/adapter%d/frontend0", n);
|
||||
sprintf(dvr_dev, "/dev/dvb/adapter%d/dvr0", n);
|
||||
sprintf(demux_dev, "/dev/dvb/adapter%d/demux0", n);
|
||||
#else
|
||||
sprintf(frontend_dev, "/dev/ost/frontend%d", n);
|
||||
sprintf(dvr_dev, "/dev/ost/dvr%d", n);
|
||||
sprintf(demux_dev, "/dev/ost/demux%d", n);
|
||||
sprintf(sec_dev, "/dev/ost/sec%d", n);
|
||||
#endif
|
||||
priv->fe_fd = open(frontend_dev, O_RDWR | O_NONBLOCK);
|
||||
if(priv->fe_fd < 0)
|
||||
{
|
||||
mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR OPENING FRONTEND DEVICE %s: ERRNO %d\n", frontend_dev, errno);
|
||||
return 0;
|
||||
}
|
||||
#ifndef CONFIG_DVB_HEAD
|
||||
priv->sec_fd = open(sec_dev, O_RDWR);
|
||||
if(priv->sec_fd < 0)
|
||||
{
|
||||
mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR OPENING SEC DEVICE %s: ERRNO %d\n", sec_dev, errno);
|
||||
close(priv->fe_fd);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
priv->demux_fds_cnt = 0;
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "DVB_OPEN_DEVICES(%d)\n", demux_cnt);
|
||||
for(i = 0; i < demux_cnt; i++)
|
||||
@ -159,12 +128,7 @@ int dvb_fix_demuxes(dvb_priv_t *priv, int cnt)
|
||||
int i;
|
||||
char demux_dev[32];
|
||||
|
||||
#ifdef CONFIG_DVB_HEAD
|
||||
sprintf(demux_dev, "/dev/dvb/adapter%d/demux0", priv->card);
|
||||
#else
|
||||
sprintf(demux_dev, "/dev/ost/demux%d", priv->card);
|
||||
#endif
|
||||
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "FIX %d -> %d\n", priv->demux_fds_cnt, cnt);
|
||||
if(priv->demux_fds_cnt >= cnt)
|
||||
{
|
||||
@ -202,12 +166,7 @@ int dvb_set_ts_filt(int fd, uint16_t pid, dmx_pes_type_t pestype)
|
||||
pesFilterParams.pid = pid;
|
||||
pesFilterParams.input = DMX_IN_FRONTEND;
|
||||
pesFilterParams.output = DMX_OUT_TS_TAP;
|
||||
#ifdef CONFIG_DVB_HEAD
|
||||
pesFilterParams.pes_type = pestype;
|
||||
#else
|
||||
pesFilterParams.pesType = pestype;
|
||||
#endif
|
||||
|
||||
pesFilterParams.flags = DMX_IMMEDIATE_START;
|
||||
|
||||
errno = 0;
|
||||
@ -248,13 +207,7 @@ static void print_status(fe_status_t festatus)
|
||||
{
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "FE_STATUS:");
|
||||
if (festatus & FE_HAS_SIGNAL) mp_msg(MSGT_DEMUX, MSGL_V," FE_HAS_SIGNAL");
|
||||
#ifdef CONFIG_DVB_HEAD
|
||||
if (festatus & FE_TIMEDOUT) mp_msg(MSGT_DEMUX, MSGL_V, " FE_TIMEDOUT");
|
||||
#else
|
||||
if (festatus & FE_HAS_POWER) mp_msg(MSGT_DEMUX, MSGL_V, " FE_HAS_POWER");
|
||||
if (festatus & FE_SPECTRUM_INV) mp_msg(MSGT_DEMUX, MSGL_V, " FE_SPECTRUM_INV");
|
||||
if (festatus & FE_TUNER_HAS_LOCK) mp_msg(MSGT_DEMUX, MSGL_V, " FE_TUNER_HAS_LOCK");
|
||||
#endif
|
||||
if (festatus & FE_HAS_LOCK) mp_msg(MSGT_DEMUX, MSGL_V, " FE_HAS_LOCK");
|
||||
if (festatus & FE_HAS_CARRIER) mp_msg(MSGT_DEMUX, MSGL_V, " FE_HAS_CARRIER");
|
||||
if (festatus & FE_HAS_VITERBI) mp_msg(MSGT_DEMUX, MSGL_V, " FE_HAS_VITERBI");
|
||||
@ -263,7 +216,6 @@ static void print_status(fe_status_t festatus)
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_DVB_HEAD
|
||||
static int check_status(int fd_frontend, int tmout)
|
||||
{
|
||||
int32_t strength;
|
||||
@ -368,202 +320,14 @@ static int do_diseqc(int secfd, int sat_no, int polv, int hi_lo)
|
||||
(sat_no / 4) % 2 ? SEC_MINI_B : SEC_MINI_A);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static int SecGetStatus (int fd, struct secStatus *state)
|
||||
{
|
||||
if(ioctl(fd, SEC_GET_STATUS, state) < 0)
|
||||
{
|
||||
mp_msg(MSGT_DEMUX, MSGL_ERR, ("SEC GET STATUS: "));
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (state->busMode)
|
||||
{
|
||||
case SEC_BUS_IDLE:
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "SEC BUS MODE: IDLE (%d)\n",state->busMode);
|
||||
break;
|
||||
case SEC_BUS_BUSY:
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "SEC BUS MODE: BUSY (%d)\n",state->busMode);
|
||||
break;
|
||||
case SEC_BUS_OFF:
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "SEC BUS MODE: OFF (%d)\n",state->busMode);
|
||||
break;
|
||||
case SEC_BUS_OVERLOAD:
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "SEC BUS MODE: OVERLOAD (%d)\n",state->busMode);
|
||||
break;
|
||||
default:
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "SEC BUS MODE: unknown (%d)\n",state->busMode);
|
||||
break;
|
||||
}
|
||||
|
||||
switch (state->selVolt)
|
||||
{
|
||||
case SEC_VOLTAGE_OFF:
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "SEC VOLTAGE: OFF (%d)\n",state->selVolt);
|
||||
break;
|
||||
case SEC_VOLTAGE_LT:
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "SEC VOLTAGE: LT (%d)\n",state->selVolt);
|
||||
break;
|
||||
case SEC_VOLTAGE_13:
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "SEC VOLTAGE: 13 (%d)\n",state->selVolt);
|
||||
break;
|
||||
case SEC_VOLTAGE_13_5:
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "SEC VOLTAGE: 13.5 (%d)\n",state->selVolt);
|
||||
break;
|
||||
case SEC_VOLTAGE_18:
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "SEC VOLTAGE: 18 (%d)\n",state->selVolt);
|
||||
break;
|
||||
case SEC_VOLTAGE_18_5:
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "SEC VOLTAGE: 18.5 (%d)\n",state->selVolt);
|
||||
break;
|
||||
default:
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "SEC VOLTAGE: unknown (%d)\n",state->selVolt);
|
||||
break;
|
||||
}
|
||||
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "SEC CONT TONE: %s\n", (state->contTone == SEC_TONE_ON ? "ON" : "OFF"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int check_status(int fd_frontend, int tmout)
|
||||
{
|
||||
int i,res;
|
||||
int32_t strength;
|
||||
fe_status_t festatus;
|
||||
FrontendEvent event;
|
||||
|
||||
struct pollfd pfd[1];
|
||||
|
||||
i = 0; res = -1;
|
||||
while ((i < 3) && (res < 0))
|
||||
{
|
||||
pfd[0].fd = fd_frontend;
|
||||
pfd[0].events = POLLIN | POLLPRI;
|
||||
|
||||
if(poll(pfd,1,tmout*1000) > 0)
|
||||
{
|
||||
if (pfd[0].revents & POLLPRI)
|
||||
{
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "Getting frontend event\n");
|
||||
if ( ioctl(fd_frontend, FE_GET_EVENT, &event) < 0)
|
||||
{
|
||||
mp_msg(MSGT_DEMUX, MSGL_ERR, "FE_GET_EVENT");
|
||||
return -1;
|
||||
}
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "Received ");
|
||||
switch(event.type)
|
||||
{
|
||||
case FE_UNEXPECTED_EV:
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "unexpected event\n");
|
||||
res = -1;
|
||||
break;
|
||||
|
||||
case FE_FAILURE_EV:
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "failure event\n");
|
||||
res = -1;
|
||||
break;
|
||||
|
||||
case FE_COMPLETION_EV:
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "completion event\n");
|
||||
res = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
if (res > 0)
|
||||
switch (event.type)
|
||||
{
|
||||
case FE_UNEXPECTED_EV: mp_msg(MSGT_DEMUX, MSGL_V, "FE_UNEXPECTED_EV\n");
|
||||
break;
|
||||
case FE_COMPLETION_EV: mp_msg(MSGT_DEMUX, MSGL_V, "FE_COMPLETION_EV\n");
|
||||
break;
|
||||
case FE_FAILURE_EV: mp_msg(MSGT_DEMUX, MSGL_V, "FE_FAILURE_EV\n");
|
||||
break;
|
||||
}
|
||||
|
||||
if (event.type == FE_COMPLETION_EV)
|
||||
{
|
||||
strength=0;
|
||||
if(ioctl(fd_frontend,FE_READ_BER,&strength) >= 0)
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "Bit error rate: %d\n",strength);
|
||||
|
||||
strength=0;
|
||||
if(ioctl(fd_frontend,FE_READ_SIGNAL_STRENGTH,&strength) >= 0)
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "Signal strength: %d\n",strength);
|
||||
|
||||
strength=0;
|
||||
if(ioctl(fd_frontend,FE_READ_SNR,&strength) >= 0)
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "SNR: %d\n",strength);
|
||||
|
||||
festatus=0;
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "FE_STATUS:");
|
||||
|
||||
if(ioctl(fd_frontend,FE_READ_STATUS,&festatus) >= 0)
|
||||
print_status(festatus);
|
||||
else
|
||||
mp_msg(MSGT_DEMUX, MSGL_ERR, " ERROR, UNABLE TO READ_STATUS");
|
||||
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "Not able to lock to the signal on the given frequency\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int do_diseqc(int secfd, int sat_no, int polv, int hi_lo)
|
||||
{
|
||||
struct secCommand scmd;
|
||||
struct secCmdSequence scmds;
|
||||
|
||||
scmds.continuousTone = (hi_lo ? SEC_TONE_ON : SEC_TONE_OFF);
|
||||
scmds.voltage = (polv ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18);
|
||||
scmds.miniCommand = SEC_MINI_NONE;
|
||||
|
||||
scmd.type = SEC_CMDTYPE_DISEQC;
|
||||
scmds.numCommands = 1;
|
||||
scmds.commands = &scmd;
|
||||
|
||||
scmd.u.diseqc.addr = 0x10;
|
||||
scmd.u.diseqc.cmd = 0x38;
|
||||
scmd.u.diseqc.numParams = 1;
|
||||
scmd.u.diseqc.params[0] = 0xf0 |
|
||||
(((sat_no) << 2) & 0x0F) |
|
||||
(hi_lo ? 1 : 0) |
|
||||
(polv ? 0 : 2);
|
||||
|
||||
if (ioctl(secfd,SEC_SEND_SEQUENCE,&scmds) < 0)
|
||||
{
|
||||
mp_msg(MSGT_DEMUX, MSGL_ERR, "Error sending DisEqC");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int tune_it(int fd_frontend, int fd_sec, unsigned int freq, unsigned int srate, char pol, int tone,
|
||||
fe_spectral_inversion_t specInv, unsigned int diseqc, fe_modulation_t modulation, fe_code_rate_t HP_CodeRate,
|
||||
fe_transmit_mode_t TransmissionMode, fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth,
|
||||
fe_code_rate_t LP_CodeRate, fe_hierarchy_t hier, int timeout)
|
||||
{
|
||||
int res, hi_lo, dfd;
|
||||
#ifdef CONFIG_DVB_HEAD
|
||||
struct dvb_frontend_parameters feparams;
|
||||
struct dvb_frontend_info fe_info;
|
||||
#else
|
||||
FrontendParameters feparams;
|
||||
FrontendInfo fe_info;
|
||||
FrontendEvent event;
|
||||
struct secStatus sec_state;
|
||||
#endif
|
||||
|
||||
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "TUNE_IT, fd_frontend %d, fd_sec %d\nfreq %lu, srate %lu, pol %c, tone %i, specInv, diseqc %u, fe_modulation_t modulation,fe_code_rate_t HP_CodeRate, fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth\n",
|
||||
fd_frontend, fd_sec, (long unsigned int)freq, (long unsigned int)srate, pol, tone, diseqc);
|
||||
@ -576,15 +340,11 @@ static int tune_it(int fd_frontend, int fd_sec, unsigned int freq, unsigned int
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_DVB_HEAD
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "Using DVB card \"%s\"\n", fe_info.name);
|
||||
#endif
|
||||
|
||||
switch(fe_info.type)
|
||||
{
|
||||
case FE_OFDM:
|
||||
#ifdef CONFIG_DVB_HEAD
|
||||
if (freq < 1000000) freq*=1000UL;
|
||||
feparams.frequency=freq;
|
||||
feparams.inversion=specInv;
|
||||
@ -595,18 +355,6 @@ static int tune_it(int fd_frontend, int fd_sec, unsigned int freq, unsigned int
|
||||
feparams.u.ofdm.transmission_mode=TransmissionMode;
|
||||
feparams.u.ofdm.guard_interval=guardInterval;
|
||||
feparams.u.ofdm.hierarchy_information=hier;
|
||||
#else
|
||||
if (freq < 1000000) freq*=1000UL;
|
||||
feparams.Frequency=freq;
|
||||
feparams.Inversion=specInv;
|
||||
feparams.u.ofdm.bandWidth=bandwidth;
|
||||
feparams.u.ofdm.HP_CodeRate=HP_CodeRate;
|
||||
feparams.u.ofdm.LP_CodeRate=LP_CodeRate;
|
||||
feparams.u.ofdm.Constellation=modulation;
|
||||
feparams.u.ofdm.TransmissionMode=TransmissionMode;
|
||||
feparams.u.ofdm.guardInterval=guardInterval;
|
||||
feparams.u.ofdm.HierarchyInformation=hier;
|
||||
#endif
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "tuning DVB-T to %d Hz, bandwidth: %d\n",freq, bandwidth);
|
||||
break;
|
||||
case FE_QPSK:
|
||||
@ -615,44 +363,25 @@ static int tune_it(int fd_frontend, int fd_sec, unsigned int freq, unsigned int
|
||||
// this must be an absolute frequency
|
||||
if (freq < SLOF)
|
||||
{
|
||||
#ifdef CONFIG_DVB_HEAD
|
||||
freq = feparams.frequency=(freq-LOF1);
|
||||
#else
|
||||
freq = feparams.Frequency=(freq-LOF1);
|
||||
#endif
|
||||
hi_lo = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef CONFIG_DVB_HEAD
|
||||
freq = feparams.frequency=(freq-LOF2);
|
||||
#else
|
||||
freq = feparams.Frequency=(freq-LOF2);
|
||||
#endif
|
||||
hi_lo = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// this is an L-Band frequency
|
||||
#ifdef CONFIG_DVB_HEAD
|
||||
feparams.frequency=freq;
|
||||
#else
|
||||
feparams.Frequency=freq;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DVB_HEAD
|
||||
feparams.inversion=specInv;
|
||||
feparams.u.qpsk.symbol_rate=srate;
|
||||
feparams.u.qpsk.fec_inner=HP_CodeRate;
|
||||
dfd = fd_frontend;
|
||||
#else
|
||||
feparams.Inversion=specInv;
|
||||
feparams.u.qpsk.SymbolRate=srate;
|
||||
feparams.u.qpsk.FEC_inner=HP_CodeRate;
|
||||
dfd = fd_sec;
|
||||
#endif
|
||||
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "tuning DVB-S to Freq: %u, Pol: %c Srate: %d, 22kHz: %s, LNB: %d\n",freq,pol,srate,hi_lo ? "on" : "off", diseqc);
|
||||
|
||||
@ -666,19 +395,11 @@ static int tune_it(int fd_frontend, int fd_sec, unsigned int freq, unsigned int
|
||||
break;
|
||||
case FE_QAM:
|
||||
mp_msg(MSGT_DEMUX, MSGL_V, "tuning DVB-C to %d, srate=%d\n",freq,srate);
|
||||
#ifdef CONFIG_DVB_HEAD
|
||||
feparams.frequency=freq;
|
||||
feparams.inversion=specInv;
|
||||
feparams.u.qam.symbol_rate = srate;
|
||||
feparams.u.qam.fec_inner = HP_CodeRate;
|
||||
feparams.u.qam.modulation = modulation;
|
||||
#else
|
||||
feparams.Frequency=freq;
|
||||
feparams.Inversion=specInv;
|
||||
feparams.u.qam.SymbolRate = srate;
|
||||
feparams.u.qam.FEC_inner = HP_CodeRate;
|
||||
feparams.u.qam.QAM = modulation;
|
||||
#endif
|
||||
break;
|
||||
#ifdef DVB_ATSC
|
||||
case FE_ATSC:
|
||||
@ -693,15 +414,6 @@ static int tune_it(int fd_frontend, int fd_sec, unsigned int freq, unsigned int
|
||||
}
|
||||
usleep(100000);
|
||||
|
||||
#ifndef CONFIG_DVB_HEAD
|
||||
if (fd_sec) SecGetStatus(fd_sec, &sec_state);
|
||||
while(1)
|
||||
{
|
||||
if(ioctl(fd_frontend, FE_GET_EVENT, &event) == -1)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
if(ioctl(fd_frontend,FE_SET_FRONTEND,&feparams) < 0)
|
||||
{
|
||||
mp_msg(MSGT_DEMUX, MSGL_ERR, "ERROR tuning channel\n");
|
||||
|
@ -15,27 +15,9 @@
|
||||
#define LOF1 (9750*1000UL)
|
||||
#define LOF2 (10600*1000UL)
|
||||
|
||||
#ifdef CONFIG_DVB_HEAD
|
||||
#include <linux/dvb/dmx.h>
|
||||
#include <linux/dvb/frontend.h>
|
||||
#include <linux/dvb/version.h>
|
||||
#else
|
||||
#include <ost/dmx.h>
|
||||
#include <ost/sec.h>
|
||||
#include <ost/frontend.h>
|
||||
#define fe_status_t FrontendStatus
|
||||
#define fe_spectral_inversion_t SpectralInversion
|
||||
#define fe_modulation_t Modulation
|
||||
#define fe_code_rate_t CodeRate
|
||||
#define fe_transmit_mode_t TransmitMode
|
||||
#define fe_guard_interval_t GuardInterval
|
||||
#define fe_bandwidth_t BandWidth
|
||||
#define fe_hierarchy_t Hierarchy
|
||||
#define fe_sec_voltage_t SecVoltage
|
||||
#define dmx_pes_filter_params dmxPesFilterParams
|
||||
#define dmx_sct_filter_params dmxSctFilterParams
|
||||
#define dmx_pes_type_t dmxPesType_t
|
||||
#endif
|
||||
#include <linux/dvb/dmx.h>
|
||||
#include <linux/dvb/frontend.h>
|
||||
#include <linux/dvb/version.h>
|
||||
|
||||
#undef DVB_ATSC
|
||||
#if defined(DVB_API_VERSION_MINOR)
|
||||
|
@ -288,14 +288,12 @@ static dvb_channels_list *dvb_get_channels(char *filename, int type)
|
||||
ptr->cr =FEC_2_3;
|
||||
else if(! strcmp(cr, "FEC_3_4"))
|
||||
ptr->cr =FEC_3_4;
|
||||
#ifdef CONFIG_DVB_HEAD
|
||||
else if(! strcmp(cr, "FEC_4_5"))
|
||||
ptr->cr =FEC_4_5;
|
||||
else if(! strcmp(cr, "FEC_6_7"))
|
||||
ptr->cr =FEC_6_7;
|
||||
else if(! strcmp(cr, "FEC_8_9"))
|
||||
ptr->cr =FEC_8_9;
|
||||
#endif
|
||||
else if(! strcmp(cr, "FEC_5_6"))
|
||||
ptr->cr =FEC_5_6;
|
||||
else if(! strcmp(cr, "FEC_7_8"))
|
||||
@ -362,14 +360,12 @@ static dvb_channels_list *dvb_get_channels(char *filename, int type)
|
||||
ptr->cr_lp =FEC_2_3;
|
||||
else if(! strcmp(tmp_lcr, "FEC_3_4"))
|
||||
ptr->cr_lp =FEC_3_4;
|
||||
#ifdef CONFIG_DVB_HEAD
|
||||
else if(! strcmp(tmp_lcr, "FEC_4_5"))
|
||||
ptr->cr_lp =FEC_4_5;
|
||||
else if(! strcmp(tmp_lcr, "FEC_6_7"))
|
||||
ptr->cr_lp =FEC_6_7;
|
||||
else if(! strcmp(tmp_lcr, "FEC_8_9"))
|
||||
ptr->cr_lp =FEC_8_9;
|
||||
#endif
|
||||
else if(! strcmp(tmp_lcr, "FEC_5_6"))
|
||||
ptr->cr_lp =FEC_5_6;
|
||||
else if(! strcmp(tmp_lcr, "FEC_7_8"))
|
||||
@ -385,10 +381,8 @@ static dvb_channels_list *dvb_get_channels(char *filename, int type)
|
||||
ptr->hier = HIERARCHY_2;
|
||||
else if(! strcmp(tmp_hier, "HIERARCHY_4"))
|
||||
ptr->hier = HIERARCHY_4;
|
||||
#ifdef CONFIG_DVB_HEAD
|
||||
else if(! strcmp(tmp_hier, "HIERARCHY_AUTO"))
|
||||
ptr->hier = HIERARCHY_AUTO;
|
||||
#endif
|
||||
else ptr->hier = HIERARCHY_NONE;
|
||||
}
|
||||
|
||||
@ -615,9 +609,6 @@ static void dvbin_close(stream_t *stream)
|
||||
close(priv->dvr_fd);
|
||||
|
||||
close(priv->fe_fd);
|
||||
#ifndef CONFIG_DVB_HEAD
|
||||
close(priv->sec_fd);
|
||||
#endif
|
||||
priv->fe_fd = priv->sec_fd = priv->dvr_fd = -1;
|
||||
|
||||
priv->is_on = 0;
|
||||
|
@ -145,14 +145,14 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) {
|
||||
// read from stdin
|
||||
mp_tmsg(MSGT_OPEN,MSGL_INFO,"Reading from stdin...\n");
|
||||
f=0; // 0=stdin
|
||||
#if defined(__MINGW32__) || defined(__OS2__)
|
||||
setmode(fileno(stdin),O_BINARY);
|
||||
#if HAVE_SETMODE
|
||||
setmode(fileno(stdin),O_BINARY);
|
||||
#endif
|
||||
} else {
|
||||
mp_msg(MSGT_OPEN,MSGL_INFO,"Writing to stdout\n");
|
||||
f=1;
|
||||
#if defined(__MINGW32__) || defined(__OS2__)
|
||||
setmode(fileno(stdout),O_BINARY);
|
||||
#if HAVE_SETMODE
|
||||
setmode(fileno(stdout),O_BINARY);
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "osdep/osdep.h"
|
||||
|
||||
#include "mp_msg.h"
|
||||
#include "stream.h"
|
||||
#include "help_mp.h"
|
||||
@ -42,6 +44,8 @@
|
||||
#include "vcd_read_darwin.h"
|
||||
#elif defined(__MINGW32__) || defined(__CYGWIN__)
|
||||
#include "vcd_read_win32.h"
|
||||
#elif defined(__OS2__)
|
||||
#include "vcd_read_os2.h"
|
||||
#else
|
||||
#include "vcd_read.h"
|
||||
#endif
|
||||
@ -102,6 +106,12 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
|
||||
HANDLE hd;
|
||||
char device[] = "\\\\.\\?:";
|
||||
#endif
|
||||
#if defined(__OS2__)
|
||||
char device[] = "X:";
|
||||
HFILE hcd;
|
||||
ULONG ulAction;
|
||||
ULONG rc;
|
||||
#endif
|
||||
|
||||
if(mode != STREAM_READ
|
||||
#if defined(__MINGW32__) || defined(__CYGWIN__)
|
||||
@ -125,6 +135,13 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
|
||||
hd = CreateFile(device, GENERIC_READ, FILE_SHARE_READ, NULL,
|
||||
OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
|
||||
f = _open_osfhandle((long)hd, _O_RDONLY);
|
||||
#elif defined(__OS2__)
|
||||
device[0] = p->device[0];
|
||||
rc = DosOpen(device, &hcd, &ulAction, 0, FILE_NORMAL,
|
||||
OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW,
|
||||
OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE | OPEN_FLAGS_DASD,
|
||||
NULL);
|
||||
f = rc ? -1 : hcd;
|
||||
#else
|
||||
f=open(p->device,O_RDONLY);
|
||||
#endif
|
||||
|
237
stream/vcd_read_os2.h
Normal file
237
stream/vcd_read_os2.h
Normal file
@ -0,0 +1,237 @@
|
||||
/*
|
||||
* implementation of VCD IO for OS/2
|
||||
*
|
||||
* Copyright (c) 2009 KO Myung-Hun (komh@chollian.net)
|
||||
*
|
||||
* This file is part of MPlayer.
|
||||
*
|
||||
* MPlayer is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* MPlayer is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef MPLAYER_VCD_READ_OS2_H
|
||||
#define MPLAYER_VCD_READ_OS2_H
|
||||
|
||||
#include "mp_msg.h"
|
||||
|
||||
struct __attribute__((packed)) msf {
|
||||
BYTE bFrame;
|
||||
BYTE bSecond;
|
||||
BYTE bMinute;
|
||||
BYTE bReserved;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
HFILE hcd;
|
||||
struct msf msfCurrent;
|
||||
int iFirstTrack;
|
||||
int iLastTrack;
|
||||
struct msf msfLeadOut;
|
||||
BYTE abVCDSector[VCD_SECTOR_SIZE];
|
||||
} mp_vcd_priv_t;
|
||||
|
||||
static inline void vcd_set_msf(mp_vcd_priv_t *vcd, unsigned sect)
|
||||
{
|
||||
sect += 150;
|
||||
vcd->msfCurrent.bFrame = sect % 75;
|
||||
sect = sect / 75;
|
||||
vcd->msfCurrent.bSecond = sect % 60;
|
||||
sect = sect / 60;
|
||||
vcd->msfCurrent.bMinute = sect;
|
||||
}
|
||||
|
||||
static inline unsigned vcd_get_msf(mp_vcd_priv_t *vcd)
|
||||
{
|
||||
return vcd->msfCurrent.bFrame +
|
||||
(vcd->msfCurrent.bSecond + vcd->msfCurrent.bMinute * 60) * 75 - 150;
|
||||
}
|
||||
|
||||
int vcd_seek_to_track(mp_vcd_priv_t *vcd, int track)
|
||||
{
|
||||
struct {
|
||||
UCHAR auchSign[4];
|
||||
BYTE bTrack;
|
||||
} __attribute__((packed)) sParam = {{'C', 'D', '0', '1'},};
|
||||
|
||||
struct {
|
||||
struct msf msfStart;
|
||||
BYTE bControlInfo;
|
||||
} __attribute__((packed)) sData;
|
||||
|
||||
ULONG ulParamLen;
|
||||
ULONG ulDataLen;
|
||||
ULONG rc;
|
||||
|
||||
sParam.bTrack = track;
|
||||
rc = DosDevIOCtl(vcd->hcd, IOCTL_CDROMAUDIO, CDROMAUDIO_GETAUDIOTRACK,
|
||||
&sParam, sizeof(sParam), &ulParamLen,
|
||||
&sData, sizeof(sData), &ulDataLen);
|
||||
if (rc) {
|
||||
mp_msg(MSGT_STREAM, MSGL_ERR, "DosDevIOCtl(GETAUDIOTRACK) = 0x%lx\n", rc);
|
||||
return -1;
|
||||
}
|
||||
|
||||
vcd->msfCurrent = sData.msfStart;
|
||||
|
||||
return VCD_SECTOR_DATA * vcd_get_msf(vcd);
|
||||
}
|
||||
|
||||
static int vcd_get_track_end(mp_vcd_priv_t *vcd, int track)
|
||||
{
|
||||
if (track < vcd->iLastTrack)
|
||||
return vcd_seek_to_track(vcd, track + 1);
|
||||
|
||||
vcd->msfCurrent = vcd->msfLeadOut;
|
||||
|
||||
return VCD_SECTOR_DATA * vcd_get_msf(vcd);
|
||||
}
|
||||
|
||||
static mp_vcd_priv_t *vcd_read_toc(int fd)
|
||||
{
|
||||
mp_vcd_priv_t *vcd;
|
||||
|
||||
UCHAR auchParamDisk[4] = {'C', 'D', '0', '1'};
|
||||
|
||||
struct {
|
||||
BYTE bFirstTrack;
|
||||
BYTE bLastTrack;
|
||||
struct msf msfLeadOut;
|
||||
} __attribute__((packed)) sDataDisk;
|
||||
|
||||
struct {
|
||||
UCHAR auchSign[4];
|
||||
BYTE bTrack;
|
||||
} __attribute__((packed)) sParamTrack = {{'C', 'D', '0', '1'},};
|
||||
|
||||
struct {
|
||||
struct msf msfStart;
|
||||
BYTE bControlInfo;
|
||||
} __attribute__((packed)) sDataTrack;
|
||||
|
||||
ULONG ulParamLen;
|
||||
ULONG ulDataLen;
|
||||
ULONG rc;
|
||||
int i, iMinute = 0, iSecond = 0, iFrame = 0;
|
||||
|
||||
rc = DosDevIOCtl(fd, IOCTL_CDROMAUDIO, CDROMAUDIO_GETAUDIODISK,
|
||||
auchParamDisk, sizeof(auchParamDisk), &ulParamLen,
|
||||
&sDataDisk, sizeof(sDataDisk), &ulDataLen);
|
||||
if (rc) {
|
||||
mp_msg(MSGT_OPEN, MSGL_ERR, "DosDevIOCtl(GETAUDIODISK) = 0x%lx\n", rc);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VCD_START_TRACK=%d\n", sDataDisk.bFirstTrack);
|
||||
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VCD_END_TRACK=%d\n", sDataDisk.bLastTrack);
|
||||
|
||||
for (i = sDataDisk.bFirstTrack; i <= sDataDisk.bLastTrack + 1; i++) {
|
||||
if (i <= sDataDisk.bLastTrack) {
|
||||
sParamTrack.bTrack = i;
|
||||
rc = DosDevIOCtl(fd, IOCTL_CDROMAUDIO, CDROMAUDIO_GETAUDIOTRACK,
|
||||
&sParamTrack, sizeof(sParamTrack), &ulParamLen,
|
||||
&sDataTrack, sizeof(sDataTrack), &ulDataLen);
|
||||
if (rc) {
|
||||
mp_msg(MSGT_OPEN, MSGL_ERR, "DosDevIOCtl(GETAUDIOTRACK) = 0x%lx\n", rc);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mp_msg(MSGT_OPEN, MSGL_INFO, "track %02d: adr=%d ctrl=%d %02d:%02d:%02d\n",
|
||||
i,
|
||||
sDataTrack.bControlInfo & 0x0F,
|
||||
sDataTrack.bControlInfo >> 4,
|
||||
sDataTrack.msfStart.bMinute,
|
||||
sDataTrack.msfStart.bSecond,
|
||||
sDataTrack.msfStart.bFrame);
|
||||
} else
|
||||
sDataTrack.msfStart = sDataDisk.msfLeadOut;
|
||||
|
||||
if (mp_msg_test(MSGT_IDENTIFY, MSGL_INFO)) {
|
||||
if (i > sDataDisk.bFirstTrack) {
|
||||
iMinute = sDataTrack.msfStart.bMinute - iMinute;
|
||||
iSecond = sDataTrack.msfStart.bSecond - iSecond;
|
||||
iFrame = sDataTrack.msfStart.bFrame - iFrame;
|
||||
if (iFrame < 0) {
|
||||
iFrame += 75;
|
||||
iSecond--;
|
||||
}
|
||||
if (iSecond < 0) {
|
||||
iSecond += 60;
|
||||
iMinute--;
|
||||
}
|
||||
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VCD_TRACK_%d_MSF=%02d:%02d:%02d\n",
|
||||
i - 1, iMinute, iSecond, iFrame);
|
||||
}
|
||||
|
||||
iMinute = sDataTrack.msfStart.bMinute;
|
||||
iSecond = sDataTrack.msfStart.bSecond;
|
||||
iFrame = sDataTrack.msfStart.bFrame;
|
||||
}
|
||||
}
|
||||
|
||||
vcd = calloc(1, sizeof(mp_vcd_priv_t));
|
||||
vcd->hcd = fd;
|
||||
vcd->iFirstTrack = sDataDisk.bFirstTrack;
|
||||
vcd->iLastTrack = sDataDisk.bLastTrack;
|
||||
vcd->msfLeadOut = sDataDisk.msfLeadOut;
|
||||
|
||||
return vcd;
|
||||
}
|
||||
|
||||
static int vcd_read(mp_vcd_priv_t *vcd, char *mem)
|
||||
{
|
||||
struct {
|
||||
UCHAR auchSign[4];
|
||||
BYTE bAddrMode;
|
||||
USHORT usSectors;
|
||||
struct msf msfStart;
|
||||
BYTE bReserved;
|
||||
BYTE bInterleavedSize;
|
||||
} __attribute__((packed)) sParam = {{'C', 'D', '0', '1'}, 1, 1,};
|
||||
|
||||
ULONG ulParamLen;
|
||||
ULONG ulDataLen;
|
||||
ULONG rc;
|
||||
|
||||
/* lead-out ? */
|
||||
if (vcd->msfCurrent.bMinute == vcd->msfLeadOut.bMinute &&
|
||||
vcd->msfCurrent.bSecond == vcd->msfLeadOut.bSecond &&
|
||||
vcd->msfCurrent.bFrame == vcd->msfLeadOut.bFrame)
|
||||
return 0;
|
||||
|
||||
sParam.msfStart = vcd->msfCurrent;
|
||||
rc = DosDevIOCtl(vcd->hcd, IOCTL_CDROMDISK, CDROMDISK_READLONG,
|
||||
&sParam, sizeof(sParam), &ulParamLen,
|
||||
vcd->abVCDSector, sizeof(vcd->abVCDSector), &ulDataLen);
|
||||
if (rc) {
|
||||
mp_msg(MSGT_STREAM, MSGL_ERR, "DosDevIOCtl(READLONG) = 0x%lx\n", rc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
memcpy(mem, &vcd->abVCDSector[VCD_SECTOR_OFFS], VCD_SECTOR_DATA);
|
||||
|
||||
vcd->msfCurrent.bFrame++;
|
||||
if (vcd->msfCurrent.bFrame == 75) {
|
||||
vcd->msfCurrent.bFrame = 0;
|
||||
vcd->msfCurrent.bSecond++;
|
||||
if (vcd->msfCurrent.bSecond == 60) {
|
||||
vcd->msfCurrent.bSecond = 0;
|
||||
vcd->msfCurrent.bMinute++;
|
||||
}
|
||||
}
|
||||
|
||||
return VCD_SECTOR_DATA;
|
||||
}
|
||||
|
||||
#endif /* MPLAYER_VCD_READ_OS2_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user