.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "ivtv 3pm" .TH ivtv 3pm "2020-11-09" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Video::ivtv \- Perl extension for using V4l2 in the ivtv perl scripts .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Video::ivtv; \& \& open(my $tuner, "new(); \& \& # get the current resolution \& my ($width, $height) = $ivtvObj\->getResolution($tunerFD); \& \& # set the new resolution \& $ivtvObj\->setResolution($tunerFD, 640, 480); \& \& close($tuner); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The Video::ivtv module will provide helper methods for working with videodev2.h structures and making ioctl calls that have proven to be too difficult to create pack strings for in perl itself. .PP This is not supposed to be an equivalent of the Video::Capture::V4l module which was created for videodev.h. .SS "\s-1EXPORT\s0" .IX Subsection "EXPORT" All functions and the variables section. .SH "VARIABLES" .IX Header "VARIABLES" .ie n .IP "%codecIndexes" 4 .el .IP "\f(CW%codecIndexes\fR" 4 .IX Item "%codecIndexes" .Vb 3 \& This contains the index names and their position in the \& ivtv_ioctl_codec structure as returned by getCodecInfo() \& and as expected by setCodecInfo(). .Ve .ie n .IP "%capIndexes" 4 .el .IP "\f(CW%capIndexes\fR" 4 .IX Item "%capIndexes" .Vb 2 \& This contains the index names and their position in the \& v4l2_capability structure as returned by getCapabilities(). .Ve .SH "FUNCTIONS" .IX Header "FUNCTIONS" .IP "@(driver, card, bus_info, version, capabilities) getCapabilities(fd)" 4 .IX Item "@(driver, card, bus_info, version, capabilities) getCapabilities(fd)" .Vb 2 \& Returns the contents of the v4l2_capability structure. \& If the ioctl fails, then an empty list is returned. .Ve .IP "@(width,height) getResolution(fd)" 4 .IX Item "@(width,height) getResolution(fd)" .Vb 2 \& Pass in the file handle number using fileno($fd) and the \& width and height are returned in an array ref. \& \& If an error is encountered in the ioctl call, then width \& and height will = \-1. .Ve .IP "int setResolution(fd, width, height)" 4 .IX Item "int setResolution(fd, width, height)" .Vb 3 \& Specify the new width, height to set the capture to. \& Returns undef if invalid resolution is specified. \& Returns a 1 if sucess, 0 if error from the actual code. .Ve .IP "int getStandard(fd)" 4 .IX Item "int getStandard(fd)" .Vb 1 \& Returns the current video standard the card is using. .Ve .IP "int setStandard(fd, standard)" 4 .IX Item "int setStandard(fd, standard)" .Vb 2 \& Sets the video standard to what is specified (hex value). \& Returns 1 on success, 0 on error. .Ve .IP "@(index, id, name, frameperiod_numerator, frameperiod_denominator, framelines) enumerateStandard(fd, index)" 4 .IX Item "@(index, id, name, frameperiod_numerator, frameperiod_denominator, framelines) enumerateStandard(fd, index)" .Vb 2 \& Returns the contents of the v4l2_standard structure for \& the specified index. If the ioctl fails then index = \-1. .Ve .IP "int getFrequency(fd, tuner)" 4 .IX Item "int getFrequency(fd, tuner)" .Vb 3 \& Returns the current frequency for the specified tuner \& or \-1 if an ioctl error occured. Returns undef on invalid \& parameters. .Ve .IP "int setFrequency(fd, tuner, freq)" 4 .IX Item "int setFrequency(fd, tuner, freq)" .Vb 2 \& Sets the specified frequency on the specified tuner. \& Returns 1 on success, 0 on error. .Ve .IP "int getInput(fd)" 4 .IX Item "int getInput(fd)" .Vb 2 \& Returns the current input number starting from 0. \& Returns \-1 if an error occured. .Ve .IP "int setInput(fd, input)" 4 .IX Item "int setInput(fd, input)" .Vb 2 \& Sets the input to the specified value. input is a 0 \& indexed value. Returns 1 on success, 0 on error. .Ve .IP "@(index, name, type, audioset, tuner, std, status) enumerateInput(fd, index)" 4 .IX Item "@(index, name, type, audioset, tuner, std, status) enumerateInput(fd, index)" .Vb 2 \& Returns the contents of the v4l2_input structure for \& the specified index. If the ioctl fails then index = \-1. .Ve .IP "@(aspect, audio_bitmask, bframes, bitrate, bitrate_peak, dnr_mode, dnr_spatial, dnr_temporal, dnr_type, framerate, framespergop, gop_closure, pulldown, stream_type) getCodecInfo(fd)" 4 .IX Item "@(aspect, audio_bitmask, bframes, bitrate, bitrate_peak, dnr_mode, dnr_spatial, dnr_temporal, dnr_type, framerate, framespergop, gop_closure, pulldown, stream_type) getCodecInfo(fd)" .Vb 2 \& Returns the contents of the ivtv_ioctl_codec structure. \& If the ioctl fails then an empty list is returned. \& \& audio_bitmask is what audio used to be. .Ve .IP "int setCodecInfo(fd, aspect, audio_bitmask, bframes, bitrate, bitrate_peak, dnr_mode, dnr_spatial, dnr_temporal, dnr_type, framerate, framespergop, gop_closure, pulldown, stream_type)" 4 .IX Item "int setCodecInfo(fd, aspect, audio_bitmask, bframes, bitrate, bitrate_peak, dnr_mode, dnr_spatial, dnr_temporal, dnr_type, framerate, framespergop, gop_closure, pulldown, stream_type)" .Vb 2 \& Sets the card to the specified codec related stuff. \& Returns 1 on success, 0 on error. \& \& audio_bitmask is what audio used to be. .Ve .IP "int setEndGOP(fd, end_gop)" 4 .IX Item "int setEndGOP(fd, end_gop)" .Vb 3 \& Sets the GOP_END flag to the specified value (1 or 0) \& to instruct the driver to finish a recording with a \& closed GOP. \& \& Returns undef if end_gop < 0 or > 1. \& Returns 1 on success, 0 on error. .Ve .IP "int stopEncoding(fd)" 4 .IX Item "int stopEncoding(fd)" .Vb 2 \& Calls the VIDIOC_STREAMOFF ioctl to signal we want \& to stop encoding (reading from the driver). \& \& Returns 1 on success, 0 on error. .Ve .SH "AUTHOR" .IX Header "AUTHOR" James A. Pattie .SH "SEE ALSO" .IX Header "SEE ALSO" perl.