Libltcsmpte - en+decode linear smpte timecode
#include <sys/types.h>
#include <ltcsmpte/framerate.h>
struct SMPTEFrame
Raw 80 bit SMPTE frame. struct SMPTETime
Human readable time representation. struct SMPTEFrameExt
Extended SMPTE frame The maximum error for startpos is 1/80 of a frame.
#define FPRNT_TIME '%lf'
#define TIME_DELIM '\t'
#define WRITE_DECODER_BIPHASE_DIAGNOSTICS(A, B, C, D, E)
#define WRITE_DECODER_BITS_DIAGNOSTICS(A, B, C, D, E)
#define USE8BIT
#define SAMPLE_AND_CURVE_ARE_DIFFERENT_TYPE
#define SAMPLE_CENTER 128
#define CURVE_MIN -127
#define CURVE_MAX 127
#define SAMPLE_IS_UNSIGNED
#define SAMPLE_IS_INTEGER
#define LTC_FRAME_BIT_COUNT 80
typedef double timeu
typedef unsigned char sample_t
typedef short curve_sample_t
typedef int diagnostics_t
typedef struct SMPTEFrame SMPTEFrame
Raw 80 bit SMPTE frame. typedef struct SMPTETime SMPTETime
Human readable time representation. typedef struct SMPTEFrameExt SMPTEFrameExt
Extended SMPTE frame The maximum error for startpos is 1/80 of a frame. typedef struct SMPTEDecoder SMPTEDecoder
opaque structure. typedef struct SMPTEEncoder SMPTEEncoder
opaque structure see: SMPTEEncoderCreate, SMPTEFreeEncoder
int SMPTEFrameToTime (SMPTEFrame *frame, SMPTETime *stime)
convert binary SMPTEFrame into SMPTETime struct int SMPTETimeToFrame (SMPTETime *stime, SMPTEFrame *frame)
convert SMPTETime struct into it's binary SMPTE representation. int SMPTEFrameReset (SMPTEFrame *frame)
set all values of a SMPTE FRAME to zero except for the sync-word (0x3FFD) at the end. int SMPTEFrameIncrease (SMPTEFrame *frame, int framesPerSec)
increments the SMPTE by one SMPTE-Frame (1/framerate seconds) SMPTEDecoder * SMPTEDecoderCreate (int sampleRate, FrameRate *fps, int queueSize, int correctJitter)
Create a new decoder. int SMPTEFreeDecoder (SMPTEDecoder *d)
release memory of Decoder structure. int SMPTEDecoderErrorReset (SMPTEDecoder *decoder)
Reset the decoder error tracking internals. int SMPTEDecoderWrite (SMPTEDecoder *decoder, sample_t *buf, int size, long int posinfo)
Feed the SMPTE decoder with new samples. int SMPTEDecoderRead (SMPTEDecoder *decoder, SMPTEFrameExt *frame)
All decoded SMPTE frames are placed in a queue. int SMPTEDecoderReadLast (SMPTEDecoder *decoder, SMPTEFrameExt *frame)
flush unread LTCs in queue and return the last timestamp. int SMPTEDecoderFrameToMillisecs (SMPTEDecoder *decoder, SMPTEFrameExt *frame, int *timems)
Convert the frame to time in milliseconds. timeu SMPTEDecoderSamplesToSeconds (SMPTEDecoder *d, long int sampleCount)
Convert the index or position of a sample to its position in time (seconds) relative to the first sample. int SMPTEDecoderErrors (SMPTEDecoder *decoder, int *errors)
get accumulated error count since last reset. SMPTEEncoder * SMPTEEncoderCreate (int sampleRate, FrameRate *fps)
Allocate and initialize LTC encoder sampleRate: audio sample rate (eg. int SMPTEFreeEncoder (SMPTEEncoder *e)
release encoder data structure int SMPTESetNsamples (SMPTEEncoder *e, int val)
set internal Audio-sample counter. int SMPTEGetNsamples (SMPTEEncoder *e)
returns the current values of the Audio-sample counter. int SMPTEEncIncrease (SMPTEEncoder *e)
moves the SMPTE to the next frame. int SMPTESetTime (SMPTEEncoder *e, SMPTETime *t)
sets the current encoder SMPTE frame to SMPTETime. int SMPTEGetTime (SMPTEEncoder *e, SMPTETime *t)
set t from current Encoder timecode long int SMPTEGetVideoFrameNumber (SMPTEEncoder *e)
returns the current value of the encoder's SMPTE frame converted to video-frames int SMPTEGetTimeInMillisecs (SMPTEEncoder *e)
returns the current value of the encoder's SMPTE frame converted to ms int SMPTEGetBuffer (SMPTEEncoder *e, sample_t *buf)
returns and flushes the accumulated Encoded Audio. size_t SMPTEGetBuffersize (SMPTEEncoder *e)
returns the size of the accumulated encoded Audio in bytes. int SMPTEEncode (SMPTEEncoder *e, int byteCnt)
Generate LTC audio for byte 'byteCnt' of the current frame into the buffer of Encoder e.
libltcsmpte - en+decode linear SMPTE timecode
Author:
Robin Gareus <[email protected]>
Copyright (C) 2006 Robin Gareus <[email protected]> Copyright (C) 2008-2009 Jan <[email protected]>
inspired by SMPTE Decoder - Maarten de Boer <[email protected]>
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.
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.
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
Definition in file ltcsmpte.h.
Definition at line 90 of file ltcsmpte.h.
Definition at line 89 of file ltcsmpte.h.
Examples: tests/decoder.c.
Definition at line 51 of file ltcsmpte.h.
Definition at line 98 of file ltcsmpte.h.
Definition at line 87 of file ltcsmpte.h.
Definition at line 88 of file ltcsmpte.h.
Definition at line 92 of file ltcsmpte.h.
Definition at line 91 of file ltcsmpte.h.
Examples: tests/decoder.c.
Definition at line 52 of file ltcsmpte.h.
Definition at line 84 of file ltcsmpte.h.
Definition at line 58 of file ltcsmpte.h.
Definition at line 59 of file ltcsmpte.h.
Definition at line 86 of file ltcsmpte.h.
Definition at line 93 of file ltcsmpte.h.
Definition at line 85 of file ltcsmpte.h.
opaque structure. see: SMPTEDecoderCreate, SMPTEFreeDecoder
Definition at line 211 of file ltcsmpte.h.
opaque structure see: SMPTEEncoderCreate, SMPTEFreeEncoder
Definition at line 217 of file ltcsmpte.h.
Raw 80 bit SMPTE frame.
Extended SMPTE frame The maximum error for startpos is 1/80 of a frame. Usually it is 0;
Human readable time representation.
Definition at line 50 of file ltcsmpte.h.
Create a new decoder. Pass sample rate, number of smpte frames per seconds, and the size of the internal queue where decoded frames are stored. Set correctJitter flag, to correct jitter resulting from audio fragment size when decoding from a realtime audiostream. This works only correctly when buffers of exactly fragment size are passed to SMPTEDecoderWrite. (as discussed on LAD [msgID])
Examples: tests/decoder.c.
Reset the decoder error tracking internals.
get accumulated error count since last reset.
Examples: tests/decoder.c.
Convert the frame to time in milliseconds. This uses the position of the end of the frame related to the sample-time to compensate for jitter.
Examples: tests/decoder.c.
All decoded SMPTE frames are placed in a queue. This function gets a frame from the queue, and stores it in SMPTEFrameExt* frame. Returns 1 on success, 0 when no frames where on the queue, and and errorcode otherwise.
Examples: tests/decoder.c.
flush unread LTCs in queue and return the last timestamp. (note that the last timestamp may not be the latest if the queue has overflown!)
Convert the index or position of a sample to its position in time (seconds) relative to the first sample.
Examples: tests/decoder.c.
Feed the SMPTE decoder with new samples. parse raw audio for LTC timestamps. If found, store them in the Decoder queue (see SMPTEDecoderRead) always returns 1 ;-) d: the decoder buf: pointer to sample_t (defaults to unsigned 8 bit) mono audio data size: number of bytes to parse posinfo: (optional) byte offset in stream to set LTC location offset
Examples: tests/decoder.c.
moves the SMPTE to the next frame. it uses SMPTEFrameIncrease().
Examples: tests/encoder.c.
Generate LTC audio for byte 'byteCnt' of the current frame into the buffer of Encoder e. LTC has 10 bytes per frame: 0 <= bytecnt < 10 use SMPTESetTime(..) to set the current frame before Encoding. see tests/encoder.c for an example.
Examples: tests/encoder.c.
Allocate and initialize LTC encoder sampleRate: audio sample rate (eg. 48000) fps: framerate
Examples: tests/encoder.c.
increments the SMPTE by one SMPTE-Frame (1/framerate seconds)
set all values of a SMPTE FRAME to zero except for the sync-word (0x3FFD) at the end. This will also clear the dfbit.
convert binary SMPTEFrame into SMPTETime struct
Examples: tests/decoder.c.
release memory of Decoder structure.
Examples: tests/decoder.c.
release encoder data structure
Examples: tests/encoder.c.
returns and flushes the accumulated Encoded Audio. returns the number of bytes written to the memory area pointed to by buf.
no overflow check is perfomed! use DTMFGetBuffersize().
Examples: tests/encoder.c.
returns the size of the accumulated encoded Audio in bytes.
Examples: tests/encoder.c.
returns the current values of the Audio-sample counter. ie. the number of encoded samples.
Examples: tests/encoder.c.
set t from current Encoder timecode
returns the current value of the encoder's SMPTE frame converted to ms
Examples: tests/encoder.c.
returns the current value of the encoder's SMPTE frame converted to video-frames
set internal Audio-sample counter. SMPTEEncode() increments this counter when it encodes samples.
Examples: tests/encoder.c.
sets the current encoder SMPTE frame to SMPTETime.
Examples: tests/encoder.c.
convert SMPTETime struct into it's binary SMPTE representation.
Generated automatically by Doxygen for libltcsmpte from the source code.