version 1.9, 2001/03/14 01:43:11
|
version 1.10, 2001/03/15 15:58:16
|
Line 518 int DecoderWriteBlock(struct cvdv_cards
|
Line 518 int DecoderWriteBlock(struct cvdv_cards
|
// printk(KERN_DEBUG LOGNAME |
// printk(KERN_DEBUG LOGNAME |
// ": DecoderWriteBlock - buffers only filled with %d instead of %d bytes\n", |
// ": DecoderWriteBlock - buffers only filled with %d instead of %d bytes\n", |
// res, size); |
// res, size); |
if (card->DMAABusy) |
if (card->DMAABusy){ |
interruptible_sleep_on(&card->wqA); |
interruptible_sleep_on(&card->wqA); |
|
} |
} |
} |
|
|
if (card->startingDVDV) { |
if (card->startingDVDV) { |
Line 556 static long margi_write(struct video_dev
|
Line 557 static long margi_write(struct video_dev
|
// int B3=0, B5=0, C0=0, E0=0, BD=0, BF=0; |
// int B3=0, B5=0, C0=0, E0=0, BD=0, BF=0; |
int res; |
int res; |
int channel=0; |
int channel=0; |
|
long int out=0; |
|
|
|
card->nonblock = nonblock; |
|
|
if (card != NULL) { |
if (card != NULL) { |
if (count > 0) { // Do we have data? |
if (count > 0) { // Do we have data? |
Line 571 static long margi_write(struct video_dev
|
Line 575 static long margi_write(struct video_dev
|
if (!card->use_ring) |
if (!card->use_ring) |
MargiSetBuffers(card, NBBUF* |
MargiSetBuffers(card, NBBUF* |
CHANNELBUFFERSIZE); |
CHANNELBUFFERSIZE); |
if (!(count = MargiPush(card, count, data))){ |
|
if (card->DMAABusy) |
while (!card->nonblock && out < count){ |
interruptible_sleep_on( |
out += MargiPush(card, count, data); |
&card->wqA); |
if (out < count || card->DMAABusy){ |
|
interruptible_sleep_on(&card->wqA); |
|
} |
|
} |
|
if (card->nonblock) { |
|
out = MargiPush(card, count, data); |
|
if (card->DMAABusy){ |
|
interruptible_sleep_on(&card->wqA); |
|
} |
|
|
} |
} |
break; |
break; |
|
|
Line 585 static long margi_write(struct video_dev
|
Line 598 static long margi_write(struct video_dev
|
break; |
break; |
} |
} |
} |
} |
return count; |
return out; |
} else { |
} else { |
printk(KERN_ERR LOGNAME |
printk(KERN_ERR LOGNAME |
": Video Decoder Prepare failed: device with this minor number not found\n"); |
": Video Decoder Prepare failed: device with this minor number not found\n"); |
Line 609 static unsigned int PSpoll(struct file *
|
Line 622 static unsigned int PSpoll(struct file *
|
minorlist[MINOR(file->f_dentry->d_inode->i_rdev) % MAXDEV]; // minor number modulo 16 |
minorlist[MINOR(file->f_dentry->d_inode->i_rdev) % MAXDEV]; // minor number modulo 16 |
if (card != NULL) { |
if (card != NULL) { |
poll_wait(file, &card->wqA , table); |
poll_wait(file, &card->wqA , table); |
if (ring_read_rest(&(card->rbuf)) && |
if ( ring_write_rest(&(card->rbuf)) && |
card->videostate.playState==VIDEO_PLAYING) |
card->videostate.playState==VIDEO_PLAYING) |
return POLLOUT | POLLWRNORM; |
return POLLOUT | POLLWRNORM; |
else return 0; |
else return 0; |
Line 632 static int PSioctl(struct inode *inode,
|
Line 645 static int PSioctl(struct inode *inode,
|
struct drawcmd *dc; |
struct drawcmd *dc; |
struct decodercmd *command; |
struct decodercmd *command; |
u16 attr; |
u16 attr; |
|
|
if (card != NULL) { |
if (card != NULL) { |
if (_IOC_TYPE(cmd) == CVDV_IOCTL_MAGIC) |
if (_IOC_TYPE(cmd) == CVDV_IOCTL_MAGIC) |
switch (_IOC_NR(cmd)) { |
switch (_IOC_NR(cmd)) { |
Line 717 static int PSioctl(struct inode *inode,
|
Line 731 static int PSioctl(struct inode *inode,
|
} |
} |
case IOCTL_DECODER: |
case IOCTL_DECODER: |
command = (struct decodercmd *) arg; |
command = (struct decodercmd *) arg; |
|
printk(KERN_DEBUG LOGNAME ":IOCTL: _IOC_TYPE:%d IOC_NR:%d cmd:%d\n", |
|
_IOC_TYPE(cmd),_IOC_NR(cmd),command->cmd); |
switch (command->cmd) { |
switch (command->cmd) { |
/* |
|
case Decoder_CSS: |
case Decoder_CSS: |
|
/* |
return DecoderCSS(card, |
return DecoderCSS(card, |
command->param1, |
command->param1, |
command->data1); |
command->data1); |
*/ |
*/ |
|
break; |
|
|
case Decoder_Set_Videosystem: |
case Decoder_Set_Videosystem: |
printk(KERN_DEBUG LOGNAME |
printk(KERN_DEBUG LOGNAME |
": -- Decoder_Set_Videosystem\n"); |
": -- Decoder_Set_Videosystem\n"); |
Line 731 static int PSioctl(struct inode *inode,
|
Line 750 static int PSioctl(struct inode *inode,
|
(videosystem) command->param1; |
(videosystem) command->param1; |
SetVideoSystem(card); |
SetVideoSystem(card); |
return 0; |
return 0; |
|
break; |
|
|
case Decoder_Set_Streamtype: |
case Decoder_Set_Streamtype: |
printk(KERN_DEBUG LOGNAME |
printk(KERN_DEBUG LOGNAME |
": -- Decoder_Set_Streamtype\n"); |
": -- Decoder_Set_Streamtype\n"); |
card->setup.streamtype = |
card->setup.streamtype = |
(stream_type) command->param1; |
(stream_type) command->param1; |
return 0; |
return 0; |
|
break; |
|
|
case Decoder_Set_Audiotype: |
case Decoder_Set_Audiotype: |
printk(KERN_DEBUG LOGNAME |
printk(KERN_DEBUG LOGNAME |
": -- Decoder_Set_Audiotype\n"); |
": -- Decoder_Set_Audiotype\n"); |
Line 744 static int PSioctl(struct inode *inode,
|
Line 767 static int PSioctl(struct inode *inode,
|
(audio_type) command->param1; |
(audio_type) command->param1; |
DecoderPrepareAudio(card); |
DecoderPrepareAudio(card); |
return 0; |
return 0; |
|
break; |
|
|
case Decoder_Set_VideoStreamID: |
case Decoder_Set_VideoStreamID: |
printk(KERN_DEBUG LOGNAME |
printk(KERN_DEBUG LOGNAME |
": -- Decoder_Set_VideoStreamID\n"); |
": -- Decoder_Set_VideoStreamID\n"); |
Line 751 static int PSioctl(struct inode *inode,
|
Line 776 static int PSioctl(struct inode *inode,
|
command->param1; |
command->param1; |
DecoderPrepareVideo(card); |
DecoderPrepareVideo(card); |
return 0; |
return 0; |
|
break; |
|
|
case Decoder_Set_AudioStreamID: |
case Decoder_Set_AudioStreamID: |
printk(KERN_DEBUG LOGNAME |
printk(KERN_DEBUG LOGNAME |
": -- Decoder_Set_AudioStreamID 0x%02X 0x%02X\n",command->param1,command->param2); |
": -- Decoder_Set_AudioStreamID 0x%02X 0x%02X\n",command->param1,command->param2); |
Line 762 static int PSioctl(struct inode *inode,
|
Line 789 static int PSioctl(struct inode *inode,
|
DecoderSelectAudioID(card); |
DecoderSelectAudioID(card); |
card->lastaattr = attr; |
card->lastaattr = attr; |
return 0; |
return 0; |
|
break; |
|
|
case Decoder_Still_Put: |
case Decoder_Still_Put: |
return DecoderShowStill(card, |
return DecoderShowStill(card, |
command-> |
command-> |
Line 772 static int PSioctl(struct inode *inode,
|
Line 801 static int PSioctl(struct inode *inode,
|
data1, |
data1, |
command-> |
command-> |
data2); |
data2); |
|
break; |
|
|
case Decoder_Still_Get: |
case Decoder_Still_Get: |
return DecoderGetStill(card, |
return DecoderGetStill(card, |
&command-> |
&command-> |
Line 782 static int PSioctl(struct inode *inode,
|
Line 813 static int PSioctl(struct inode *inode,
|
data1, |
data1, |
command-> |
command-> |
data2); |
data2); |
|
break; |
|
|
case Decoder_Pause: // pause{param1} 0=run 1=pause 2=toggle |
case Decoder_Pause: // pause{param1} 0=run 1=pause 2=toggle |
if (command->param1 == 2) { |
if (command->param1 == 2) { |
if (card->paused) |
if (card->paused) |
Line 797 static int PSioctl(struct inode *inode,
|
Line 830 static int PSioctl(struct inode *inode,
|
DecoderPause(card); |
DecoderPause(card); |
} |
} |
return 0; |
return 0; |
|
|
|
/* Too buggy |
|
case Decoder_FFWD: // pause{param1} =normal 1=ffwd 2=toggle |
|
if (command->param1 == 2) { |
|
if (card->videoffwd) |
|
card->videoffwd = 0; |
|
else |
|
card->videoffwd = 2; |
|
} else { |
|
if (!command->param1) |
|
card->videoffwd = 0; |
|
else |
|
card->videoffwd = 2; |
|
} |
|
return 0; |
|
|
|
case Decoder_Slow: // pause{param1} =normal 1=slow 2=toggle |
|
if (command->param1 == 2) { |
|
if (card->videoslow) |
|
card->videoslow = 0; |
|
else |
|
card->videoslow = 4; |
|
} else { |
|
if (!command->param1) |
|
card->videoslow = 0; |
|
else |
|
card->videoslow = 4; |
|
} |
|
return 0; |
|
*/ |
case Decoder_Highlight: // active{param1}, color information(SL_COLI or AC_COLI){data1[4]}, button position(BTN_POSI){data2[6]} |
case Decoder_Highlight: // active{param1}, color information(SL_COLI or AC_COLI){data1[4]}, button position(BTN_POSI){data2[6]} |
return DecoderHighlight(card, |
return DecoderHighlight(card, |
command-> |
command-> |
Line 898 static int margi_open(struct video_devic
|
Line 961 static int margi_open(struct video_devic
|
|
|
int closed; |
int closed; |
if (card != NULL) { |
if (card != NULL) { |
printk(KERN_DEBUG LOGNAME ": -- PSopen \n"); |
printk(KERN_DEBUG LOGNAME ": -- open \n"); |
CloseCard(card); |
CloseCard(card); |
OSDClose(card); |
OSDClose(card); |
#ifdef NOINT |
#ifdef NOINT |
Line 933 static int margi_open(struct video_devic
|
Line 996 static int margi_open(struct video_devic
|
static int PSopen(struct inode *inode, struct file *file) |
static int PSopen(struct inode *inode, struct file *file) |
{ |
{ |
struct cvdv_cards *card = minorlist[MINOR(inode->i_rdev) % MAXDEV]; // minor number modulo 16 |
struct cvdv_cards *card = minorlist[MINOR(inode->i_rdev) % MAXDEV]; // minor number modulo 16 |
return margi_open((struct video_device *) card,0); |
return margi_open((struct video_device *) card,1); |
} |
} |
|
|
|
|
Line 1193 dvbdev_ioctl(struct dvb_device *dvbdev,
|
Line 1256 dvbdev_ioctl(struct dvb_device *dvbdev,
|
case VIDEO_STOP: |
case VIDEO_STOP: |
DecoderPause(card); |
DecoderPause(card); |
card->videostate.playState = VIDEO_STOPPED; |
card->videostate.playState = VIDEO_STOPPED; |
VideoSetBackground(card, 1, 0, 0, 0); |
if (card->videostate.videoBlank) |
|
VideoSetBackground(card, 1, 0, 0, 0); |
|
|
|
|
return 0; |
return 0; |
|
|
case VIDEO_PLAY: |
case VIDEO_PLAY: |
Line 1274 dvbdev_ioctl(struct dvb_device *dvbdev,
|
Line 1339 dvbdev_ioctl(struct dvb_device *dvbdev,
|
} |
} |
|
|
case VIDEO_FAST_FORWARD: |
case VIDEO_FAST_FORWARD: |
if (card->videostate.streamSource!=VIDEO_SOURCE_MEMORY) |
if (card->videostate.streamSource != |
return -EPERM; |
VIDEO_SOURCE_MEMORY) |
|
return -EPERM; |
|
card->videoffwd = 2; |
break; |
break; |
|
|
case VIDEO_SLOWMOTION: |
case VIDEO_SLOWMOTION: |
if (card->videostate.streamSource!=VIDEO_SOURCE_MEMORY) |
if (card->videostate.streamSource!=VIDEO_SOURCE_MEMORY) |
return -EPERM; |
return -EPERM; |
|
card->videoslow = arg; |
|
|
break; |
break; |
|
|