X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Documentation%2FDocBook%2Fvideobook.tmpl;h=b629da33951d3945f619bf900862c163c43e849e;hb=refs%2Fheads%2Fvserver;hp=b942a25a47536a38ad01fc1b92da619427db606f;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/Documentation/DocBook/videobook.tmpl b/Documentation/DocBook/videobook.tmpl index b942a25a4..b629da339 100644 --- a/Documentation/DocBook/videobook.tmpl +++ b/Documentation/DocBook/videobook.tmpl @@ -1,4 +1,6 @@ - + + @@ -180,23 +182,23 @@ int __init myradio_init(struct video_init *v) - VFL_TYPE_RADIO/dev/radio{n} + VFL_TYPE_RADIO/dev/radio{n} Radio devices are assigned in this block. As with all of these selections the actual number assignment is done by the video layer accordijng to what is free. - VFL_TYPE_GRABBER/dev/video{n} + VFL_TYPE_GRABBER/dev/video{n} Video capture devices and also -- counter-intuitively for the name -- hardware video playback devices such as MPEG2 cards. - VFL_TYPE_VBI/dev/vbi{n} + VFL_TYPE_VBI/dev/vbi{n} The VBI devices capture the hidden lines on a television picture that carry further information like closed caption data, teletext (primarily in Europe) and now Intercast and the ATVEC internet television encodings. - VFL_TYPE_VTX/dev/vtx[n} + VFL_TYPE_VTX/dev/vtx[n} VTX is 'Videotext' also known as 'Teletext'. This is a system for sending numbered, 40x25, mostly textual page images over the hidden lines. Unlike the /dev/vbi interfaces, this is for 'smart' decoder @@ -227,12 +229,11 @@ int __init myradio_init(struct video_init *v) static int users = 0; -static int radio_open(stuct video_device *dev, int flags) +static int radio_open(struct video_device *dev, int flags) { if(users) return -EBUSY; users++; - MOD_INC_USE_COUNT; return 0; } @@ -248,7 +249,6 @@ static int radio_open(stuct video_device *dev, int flags) static int radio_close(struct video_device *dev) { users--; - MOD_DEC_USE_COUNT; } @@ -303,25 +303,25 @@ static int radio_ioctl(struct video_device *dev, unsigned int cmd, void *arg) - nameThe device text name. This is intended for the user. + nameThe device text name. This is intended for the user. - channelsThe number of different channels you can tune on + channelsThe number of different channels you can tune on this card. It could even by zero for a card that has no tuning capability. For our simple FM radio it is 1. An AM/FM radio would report 2. - audiosThe number of audio inputs on this device. For our + audiosThe number of audio inputs on this device. For our radio there is only one audio input. - minwidth,minheightThe smallest size the card is capable of capturing + minwidth,minheightThe smallest size the card is capable of capturing images in. We set these to zero. Radios do not capture pictures - maxwidth,maxheightThe largest image size the card is capable of + maxwidth,maxheightThe largest image size the card is capable of capturing. For our radio we report 0. - typeThis reports the capabilities of the device, and + typeThis reports the capabilities of the device, and matches the field we filled in in the struct video_device when registering. @@ -377,26 +377,26 @@ static int radio_ioctl(struct video_device *dev, unsigned int cmd, void *arg) - int tunerThe number of the tuner in question + int tunerThe number of the tuner in question - char name[32]A text description of this tuner. "FM" will do fine. + char name[32]A text description of this tuner. "FM" will do fine. This is intended for the application. - u32 flags + u32 flags Tuner capability flags - u16 modeThe current reception mode + u16 modeThe current reception mode - u16 signalThe signal strength scaled between 0 and 65535. If + u16 signalThe signal strength scaled between 0 and 65535. If a device cannot tell the signal strength it should report 65535. Many simple cards contain only a signal/no signal bit. Such cards will report either 0 or 65535. - u32 rangelow, rangehigh + u32 rangelow, rangehigh The range of frequencies supported by the radio or TV. It is scaled according to the VIDEO_TUNER_LOW flag. @@ -410,20 +410,20 @@ static int radio_ioctl(struct video_device *dev, unsigned int cmd, void *arg) - VIDEO_TUNER_PALA PAL TV tuner + VIDEO_TUNER_PALA PAL TV tuner - VIDEO_TUNER_NTSCAn NTSC (US) TV tuner + VIDEO_TUNER_NTSCAn NTSC (US) TV tuner - VIDEO_TUNER_SECAMA SECAM (French) TV tuner + VIDEO_TUNER_SECAMA SECAM (French) TV tuner - VIDEO_TUNER_LOW + VIDEO_TUNER_LOW The tuner frequency is scaled in 1/16th of a KHz steps. If not it is in 1/16th of a MHz steps - VIDEO_TUNER_NORMThe tuner can set its format + VIDEO_TUNER_NORMThe tuner can set its format - VIDEO_TUNER_STEREO_ONThe tuner is currently receiving a stereo signal + VIDEO_TUNER_STEREO_ONThe tuner is currently receiving a stereo signal @@ -433,13 +433,13 @@ static int radio_ioctl(struct video_device *dev, unsigned int cmd, void *arg) - VIDEO_MODE_PALPAL Format + VIDEO_MODE_PALPAL Format - VIDEO_MODE_NTSCNTSC Format (USA) + VIDEO_MODE_NTSCNTSC Format (USA) - VIDEO_MODE_SECAMFrench Format + VIDEO_MODE_SECAMFrench Format - VIDEO_MODE_AUTOA device that does not need to do + VIDEO_MODE_AUTOA device that does not need to do TV format switching @@ -523,7 +523,7 @@ static unsigned long current_freq; if(copy_from_user(arg, &freq, sizeof(unsigned long))!=0) return -EFAULT; - if(hardware_set_freq(freq)<0) + if(hardware_set_freq(freq)<0) return -EINVAL; current_freq = freq; return 0; @@ -584,32 +584,32 @@ static int current_volume=0; - audioThe input the user wishes to query + audioThe input the user wishes to query - volumeThe volume setting on a scale of 0-65535 + volumeThe volume setting on a scale of 0-65535 - baseThe base level on a scale of 0-65535 + baseThe base level on a scale of 0-65535 - trebleThe treble level on a scale of 0-65535 + trebleThe treble level on a scale of 0-65535 - flagsThe features this audio device supports + flagsThe features this audio device supports - nameA text name to display to the user. We picked - "Radio" as it explains things quite nicely. + nameA text name to display to the user. We picked + "Radio" as it explains things quite nicely. - modeThe current reception mode for the audio + modeThe current reception mode for the audio We report MONO because our card is too stupid to know if it is in mono or stereo. - balanceThe stereo balance on a scale of 0-65535, 32768 is - middle. + balanceThe stereo balance on a scale of 0-65535, 32768 is + middle. - stepThe step by which the volume control jumps. This is + stepThe step by which the volume control jumps. This is used to help make it easy for applications to set - slider behaviour. + slider behaviour. @@ -619,15 +619,15 @@ static int current_volume=0; - VIDEO_AUDIO_MUTEThe audio is currently muted. We + VIDEO_AUDIO_MUTEThe audio is currently muted. We could fake this in our driver but we choose not to bother. - VIDEO_AUDIO_MUTABLEThe input has a mute option + VIDEO_AUDIO_MUTABLEThe input has a mute option - VIDEO_AUDIO_TREBLEThe input has a treble control + VIDEO_AUDIO_TREBLEThe input has a treble control - VIDEO_AUDIO_BASSThe input has a base control + VIDEO_AUDIO_BASSThe input has a base control @@ -637,13 +637,13 @@ static int current_volume=0; - VIDEO_SOUND_MONOMono sound + VIDEO_SOUND_MONOMono sound - VIDEO_SOUND_STEREOStereo sound + VIDEO_SOUND_STEREOStereo sound - VIDEO_SOUND_LANG1Alternative language 1 (TV specific) + VIDEO_SOUND_LANG1Alternative language 1 (TV specific) - VIDEO_SOUND_LANG2Alternative language 2 (TV specific) + VIDEO_SOUND_LANG2Alternative language 2 (TV specific) @@ -733,13 +733,14 @@ static int io = 0x300; static int io = -1; +#endif MODULE_AUTHOR("Alan Cox"); MODULE_DESCRIPTION("A driver for an imaginary radio card."); -MODULE_PARM(io, "i"); +module_param(io, int, 0444); MODULE_PARM_DESC(io, "I/O address of the card."); -int init_module(void) +static int __init init(void) { if(io==-1) { @@ -750,25 +751,26 @@ int init_module(void) return myradio_init(NULL); } -void cleanup_module(void) +static void __exit cleanup(void) { video_unregister_device(&my_radio); release_region(io, MY_IO_SIZE); } -#endif +module_init(init); +module_exit(cleanup); In this example we set the IO base by default if the driver is compiled into - the kernel where you cannot pass a parameter. For the module we require the + the kernel: you can still set it using "my_radio.irq" if this file is called my_radio.c. For the module we require the user sets the parameter. We set io to a nonsense port (-1) so that we can tell if the user supplied an io parameter or not. We use MODULE_ defines to give an author for the card driver and a description. We also use them to declare that io is an integer and it is the - address of the card. + address of the card, and can be read by anyone from sysfs. The clean-up routine unregisters the video_device we registered, and frees @@ -866,37 +868,37 @@ static struct video_device my_camera -VID_TYPE_CAPTUREWe support image capture +VID_TYPE_CAPTUREWe support image capture -VID_TYPE_TELETEXTA teletext capture device (vbi{n]) +VID_TYPE_TELETEXTA teletext capture device (vbi{n]) -VID_TYPE_OVERLAYThe image can be directly overlaid onto the - frame buffer +VID_TYPE_OVERLAYThe image can be directly overlaid onto the + frame buffer -VID_TYPE_CHROMAKEYChromakey can be used to select which parts - of the image to display +VID_TYPE_CHROMAKEYChromakey can be used to select which parts + of the image to display -VID_TYPE_CLIPPINGIt is possible to give the board a list of - rectangles to draw around. +VID_TYPE_CLIPPINGIt is possible to give the board a list of + rectangles to draw around. -VID_TYPE_FRAMERAMThe video capture goes into the video memory +VID_TYPE_FRAMERAMThe video capture goes into the video memory and actually changes it. Applications need to know this so they can clean up after the - card + card -VID_TYPE_SCALESThe image can be scaled to various sizes, - rather than being a single fixed size. +VID_TYPE_SCALESThe image can be scaled to various sizes, + rather than being a single fixed size. -VID_TYPE_MONOCHROMEThe capture will be monochrome. This isn't a +VID_TYPE_MONOCHROMEThe capture will be monochrome. This isn't a complete answer to the question since a mono camera on a colour capture card will still - produce mono output. + produce mono output. -VID_TYPE_SUBCAPTUREThe card allows only part of its field of +VID_TYPE_SUBCAPTUREThe card allows only part of its field of view to be captured. This enables applications to avoid copying all of a large image into memory when only some section is - relevant. + relevant. @@ -947,14 +949,13 @@ int __init mycamera_init(struct video_init *v) static int users = 0; -static int camera_open(stuct video_device *dev, int flags) +static int camera_open(struct video_device *dev, int flags) { if(users) return -EBUSY; if(request_irq(irq, camera_irq, 0, "camera", dev)<0) return -EBUSY; users++; - MOD_INC_USE_COUNT; return 0; } @@ -963,7 +964,6 @@ static int camera_close(struct video_device *dev) { users--; free_irq(irq, dev); - MOD_DEC_USE_COUNT; } @@ -976,7 +976,7 @@ static int camera_close(struct video_device *dev) Interrupt Handling Our example handler is for an ISA bus device. If it was PCI you would be - able to share the interrupt and would have set SA_SHIRQ to indicate a + able to share the interrupt and would have set IRQF_SHARED to indicate a shared IRQ. We pass the device pointer as the interrupt routine argument. We don't need to since we only support one card but doing this will make it easier to upgrade the driver for multiple devices in the future. @@ -1209,18 +1209,18 @@ static int camera_ioctl(struct video_device *dev, unsigned int cmd, void *arg) - channelThe channel number we are selecting + channelThe channel number we are selecting - nameThe name for this channel. This is intended + nameThe name for this channel. This is intended to describe the port to the user. Appropriate names are therefore things like "Camera" "SCART input" - flagsChannel properties + flagsChannel properties - typeInput type + typeInput type - normThe current television encoding being used + normThe current television encoding being used if relevant for this channel. @@ -1231,9 +1231,9 @@ static int camera_ioctl(struct video_device *dev, unsigned int cmd, void *arg) - VIDEO_VC_TUNERChannel has a tuner. + VIDEO_VC_TUNERChannel has a tuner. - VIDEO_VC_AUDIOChannel has audio. + VIDEO_VC_AUDIOChannel has audio. @@ -1242,11 +1242,11 @@ static int camera_ioctl(struct video_device *dev, unsigned int cmd, void *arg) - VIDEO_TYPE_TVTelevision input. + VIDEO_TYPE_TVTelevision input. - VIDEO_TYPE_CAMERAFixed camera input. + VIDEO_TYPE_CAMERAFixed camera input. - 0Type is unknown. + 0Type is unknown. @@ -1255,13 +1255,13 @@ static int camera_ioctl(struct video_device *dev, unsigned int cmd, void *arg) - VIDEO_MODE_PALPAL encoded Television + VIDEO_MODE_PALPAL encoded Television - VIDEO_MODE_NTSCNTSC (US) encoded Television + VIDEO_MODE_NTSCNTSC (US) encoded Television - VIDEO_MODE_SECAMSECAM (French) Television + VIDEO_MODE_SECAMSECAM (French) Television - VIDEO_MODE_AUTOAutomatic switching, or format does not + VIDEO_MODE_AUTOAutomatic switching, or format does not matter @@ -1341,14 +1341,14 @@ static int camera_ioctl(struct video_device *dev, unsigned int cmd, void *arg) - GREYLinear greyscale. This is for simple cameras and the - like + GREYLinear greyscale. This is for simple cameras and the + like - RGB565The top 5 bits hold 32 red levels, the next six bits - hold green and the low 5 bits hold blue. + RGB565The top 5 bits hold 32 red levels, the next six bits + hold green and the low 5 bits hold blue. - RGB555The top bit is clear. The red green and blue levels - each occupy five bits. + RGB555The top bit is clear. The red green and blue levels + each occupy five bits. @@ -1479,32 +1479,32 @@ static struct video_buffer capture_fb; - widthThe width in pixels of the desired image. The card - may use a smaller size if this size is not available + widthThe width in pixels of the desired image. The card + may use a smaller size if this size is not available - heightThe height of the image. The card may use a smaller - size if this size is not available. + heightThe height of the image. The card may use a smaller + size if this size is not available. - x The X position of the top left of the window. This + x The X position of the top left of the window. This is in pixels relative to the left hand edge of the picture. Not all cards can display images aligned on any pixel boundary. If the position is unsuitable the card adjusts the image right and reduces the - width. + width. - y The Y position of the top left of the window. This + y The Y position of the top left of the window. This is counted in pixels relative to the top edge of the picture. As with the width if the card cannot display starting on this line it will adjust the - values. + values. - chromakeyThe colour (expressed in RGB32 format) for the - chromakey colour if chroma keying is being used. + chromakeyThe colour (expressed in RGB32 format) for the + chromakey colour if chroma keying is being used. - clipsAn array of rectangles that must not be drawn - over. + clipsAn array of rectangles that must not be drawn + over. - clipcountThe number of clips in this array. + clipcountThe number of clips in this array. @@ -1516,11 +1516,11 @@ static struct video_buffer capture_fb; - x, yCo-ordinates relative to the display + x, yCo-ordinates relative to the display - width, heightWidth and height in pixels + width, heightWidth and height in pixels - nextA spare field for the application to use + nextA spare field for the application to use @@ -1552,9 +1552,9 @@ static struct video_buffer capture_fb; struct video_window v; if(copy_from_user(&v, arg, sizeof(v))) return -EFAULT; - if(v.width > 640 || v.height > 480) + if(v.width > 640 || v.height > 480) return -EINVAL; - if(v.width < 16 || v.height < 16) + if(v.width < 16 || v.height < 16) return -EINVAL; hardware_set_key(v.chromakey); hardware_set_window(v);