.TH "framerate.h" 3 "Fri Apr 27 2012" "Version 0.4.4" "libltcsmpte" \" -*- nroff -*- .ad l .nh .SH NAME framerate.h \- .PP libltcsmpte - framerate conversion .SH SYNOPSIS .br .PP .SS "Data Structures" .in +1c .ti -1c .RI "struct \fBFrameRate\fP" .br .RI "\fIFrame rate data structure. \fP" .in -1c .SS "Enumerations" .in +1c .ti -1c .RI "enum \fBFRFlags\fP { \fBFRF_NONE\fP = 0, \fBFRF_DROP_FRAMES\fP = 1, \fBFRF_UNUSED\fP = 2, \fBFRF_SAMPLERATE\fP = 4, \fBFRF_OFFA\fP = 8, \fBFRF_OFFV\fP = 16, \fBFRF_LAST\fP = 32 }" .br .RI "\fIFrame-Rate-Flags and options: multiple flags/options can be added (binary OR). \fP" .ti -1c .RI "enum \fBFRSMPTE\fP { \fBSMPTE_FRAME\fP = 0, \fBSMPTE_SEC\fP, \fBSMPTE_MIN\fP, \fBSMPTE_HOUR\fP, \fBSMPTE_OVERFLOW\fP, \fBSMPTE_LAST\fP }" .br .in -1c .SS "Functions" .in +1c .ti -1c .RI "int \fBFR_toint\fP (\fBFrameRate\fP *fr)" .br .RI "\fIround framerate to the nearest integer \fP" .ti -1c .RI "double \fBFR_todbl\fP (\fBFrameRate\fP *fr)" .br .RI "\fIreturn (double) floating point representation of framerate \fP" .ti -1c .RI "\fBFrameRate\fP * \fBFR_create\fP (int num, int den, int flags)" .br .RI "\fIallocate memory for \fBFrameRate\fP struct and initialize with given values. \fP" .ti -1c .RI "void \fBFR_free\fP (\fBFrameRate\fP *f)" .br .RI "\fIfree memory allocated for \fBFrameRate\fP data structure \fP" .ti -1c .RI "void \fBFR_setsamplerate\fP (\fBFrameRate\fP *f, int samplerate)" .br .RI "\fIset audio sample rate (sps) for av,vf conversion \fP" .ti -1c .RI "long long int \fBFR_vf2af\fP (\fBFrameRate\fP *f, long int vf)" .br .RI "\fIconvert integer video-frames to audio frame. \fP" .ti -1c .RI "long int \fBFR_af2vfi\fP (\fBFrameRate\fP *f, long long int af)" .br .RI "\fIconvert audio-frame to integer video-frames round down to the prev. \fP" .ti -1c .RI "double \fBFR_af2vf\fP (\fBFrameRate\fP *f, long long int af)" .br .RI "\fIconvert audio-frame to fractional video-frames \fP" .ti -1c .RI "long int \fBFR_insert_drop_frames\fP (long int frames)" .br .RI "\fIprivate function - no need to call it when using the FR-API for smpte/bcd conversion \fP" .ti -1c .RI "long int \fBFR_drop_frames\fP (\fBFrameRate\fP *fr, int f, int s, int m, int h)" .br .RI "\fIprivate function - no need to call it when using the FR-API for smpte/bcd conversion \fP" .ti -1c .RI "void \fBFR_frame_to_bcd\fP (\fBFrameRate\fP *f, long int *bcd, long int frame)" .br .RI "\fIconverts video-frame number into binary coded decimal timecode sets: bcd[SMPTE_FRAME] . \fP" .ti -1c .RI "void \fBFR_vf2smpte\fP (\fBFrameRate\fP *fr, char *smptestring, long int frame)" .br .RI "\fIconverts video-frame into 13char SMPTE string. \fP" .ti -1c .RI "long int \fBFR_smpte2vf\fP (\fBFrameRate\fP *fr, int f, int s, int m, int h, int overflow)" .br .RI "\fIconvert smpte into video-frame number expects smpte in decimal representation as separate arguments: \fP" .ti -1c .RI "long int \fBFR_bcd2vf\fP (\fBFrameRate\fP *fr, int bcd[SMPTE_LAST])" .br .RI "\fIwrapper around FR_smpte2vf reads SMPTE as bcd array argument and returns video frame number, starting at zero \fP" .ti -1c .RI "void \fBFR_setflags\fP (\fBFrameRate\fP *fr, int flags)" .br .RI "\fIdirectly change framerate flags \fP" .ti -1c .RI "void \fBFR_setratio\fP (\fBFrameRate\fP *fr, int num, int den)" .br .RI "\fIset the framerate \fP" .ti -1c .RI "void \fBFR_setdbl\fP (\fBFrameRate\fP *fr, double fps, int mode)" .br .RI "\fIconvert double value into ratio and set framerate. \fP" .in -1c .SH "Detailed Description" .PP libltcsmpte - framerate conversion \fBAuthor:\fP .RS 4 Robin Gareus .RE .PP Copyright (C) 2006, 2007, 2008 Robin Gareus .PP This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. .PP This program 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 Lesser Public License for more details. .PP You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA .PP Definition in file \fBframerate.h\fP. .SH "Enumeration Type Documentation" .PP .SS "enum \fBFRFlags\fP" .PP Frame-Rate-Flags and options: multiple flags/options can be added (binary OR). .PP \fBEnumerator: \fP .in +1c .TP \fB\fIFRF_NONE \fP\fP .TP \fB\fIFRF_DROP_FRAMES \fP\fP use drop frame timecode .TP \fB\fIFRF_UNUSED \fP\fP .TP \fB\fIFRF_SAMPLERATE \fP\fP has sample-rate info .TP \fB\fIFRF_OFFA \fP\fP has audio frame offset .TP \fB\fIFRF_OFFV \fP\fP has video frame offset .TP \fB\fIFRF_LAST \fP\fP .PP Definition at line 31 of file framerate.h. .SS "enum \fBFRSMPTE\fP" .PP \fBEnumerator: \fP .in +1c .TP \fB\fISMPTE_FRAME \fP\fP .TP \fB\fISMPTE_SEC \fP\fP .TP \fB\fISMPTE_MIN \fP\fP .TP \fB\fISMPTE_HOUR \fP\fP .TP \fB\fISMPTE_OVERFLOW \fP\fP .TP \fB\fISMPTE_LAST \fP\fP .PP Definition at line 42 of file framerate.h. .SH "Function Documentation" .PP .SS "double FR_af2vf (\fBFrameRate\fP * f, long long int af)" .PP convert audio-frame to fractional video-frames .SS "long int FR_af2vfi (\fBFrameRate\fP * f, long long int af)" .PP convert audio-frame to integer video-frames round down to the prev. video frame. .SS "long int FR_bcd2vf (\fBFrameRate\fP * fr, int bcd[SMPTE_LAST])" .PP wrapper around FR_smpte2vf reads SMPTE as bcd array argument and returns video frame number, starting at zero .SS "\fBFrameRate\fP* FR_create (int num, int den, int flags)" .PP allocate memory for \fBFrameRate\fP struct and initialize with given values. .PP \fBExamples: \fP .in +1c \fBtests/decoder.c\fP, and \fBtests/encoder.c\fP. .SS "long int FR_drop_frames (\fBFrameRate\fP * fr, int f, int s, int m, int h)" .PP private function - no need to call it when using the FR-API for smpte/bcd conversion Drop frame numbers (not frames) 00:00 and 00:01 at the start of every minute except the tenth. returns video frame number staring at zero for 29.97fps .PP dropframes are not required or permitted when operating at 24, 25, or 30 frames per second. .SS "void FR_frame_to_bcd (\fBFrameRate\fP * f, long int * bcd, long int frame)" .PP converts video-frame number into binary coded decimal timecode sets: bcd[SMPTE_FRAME] . . bcd[SMPTE_LAST] accoding to video-frame. Note: this supports only integer framerates! use FR_vf2smpte instead. .SS "void FR_free (\fBFrameRate\fP * f)" .PP free memory allocated for \fBFrameRate\fP data structure .PP \fBExamples: \fP .in +1c \fBtests/decoder.c\fP, and \fBtests/encoder.c\fP. .SS "long int FR_insert_drop_frames (long int frames)" .PP private function - no need to call it when using the FR-API for smpte/bcd conversion Insert two frame numbers at the start of every minute except the tenth. unit: video-frames! .SS "void FR_setdbl (\fBFrameRate\fP * fr, double fps, int mode)" .PP convert double value into ratio and set framerate. if mode == 1: autodetect drop-frame timecode (set flag|=FRF_DROP_FRAMES if fps==29.97 ) .PP \fBExamples: \fP .in +1c \fBtests/decoder.c\fP, and \fBtests/encoder.c\fP. .SS "void FR_setflags (\fBFrameRate\fP * fr, int flags)" .PP directly change framerate flags .SS "void FR_setratio (\fBFrameRate\fP * fr, int num, int den)" .PP set the framerate .SS "void FR_setsamplerate (\fBFrameRate\fP * f, int samplerate)" .PP set audio sample rate (sps) for av,vf conversion .SS "long int FR_smpte2vf (\fBFrameRate\fP * fr, int f, int s, int m, int h, int overflow)" .PP convert smpte into video-frame number expects smpte in decimal representation as separate arguments: f: frame, s: second, m: minute, h: hour overflow should be set to zero (days); returns: video frame number, starting at zero .SS "double FR_todbl (\fBFrameRate\fP * fr)" .PP return (double) floating point representation of framerate .SS "int FR_toint (\fBFrameRate\fP * fr)" .PP round framerate to the nearest integer .SS "long long int FR_vf2af (\fBFrameRate\fP * f, long int vf)" .PP convert integer video-frames to audio frame. .SS "void FR_vf2smpte (\fBFrameRate\fP * fr, char * smptestring, long int frame)" .PP converts video-frame into 13char SMPTE string. smptestring needs to point to a allocated (char*) memory! .PP it does handle drop-frame formats correctly. .SH "Author" .PP Generated automatically by Doxygen for libltcsmpte from the source code.