libavcodec/timecode.c File Reference

Timecode helpers This *private* API is deprecated, please use the one available in libavutil instead. More...

#include "version.h"
#include <stdio.h>
#include "timecode.h"
#include "libavutil/log.h"

Go to the source code of this file.

Functions

int avpriv_framenum_to_drop_timecode (int frame_num)
 Adjust frame number for NTSC drop frame time code.
uint32_t avpriv_framenum_to_smpte_timecode (unsigned frame, int fps, int drop)
 Convert frame id (timecode) to SMPTE 12M binary representation.
int avpriv_check_timecode_rate (void *avcl, AVRational rate, int drop)
 Check if timecode rate is valid and consistent with the drop flag.
char * avpriv_timecode_to_string (char *buf, const struct ff_timecode *tc, unsigned frame)
 Load timecode string in buf.
int avpriv_init_smpte_timecode (void *avcl, struct ff_timecode *tc)
 Parse SMTPE 12M time representation (hh:mm:ss[:;.
int ff_framenum_to_drop_timecode (int frame_num)
uint32_t ff_framenum_to_smtpe_timecode (unsigned frame, int fps, int drop)
int ff_init_smtpe_timecode (void *avcl, struct ff_timecode *tc)


Detailed Description

Timecode helpers This *private* API is deprecated, please use the one available in libavutil instead.

Definition in file timecode.c.


Function Documentation

int avpriv_check_timecode_rate ( void *  avcl,
AVRational  rate,
int  drop 
)

Check if timecode rate is valid and consistent with the drop flag.

Returns:
0 on success, negative value on failure

Definition at line 63 of file timecode.c.

Referenced by avpriv_init_smpte_timecode().

int avpriv_framenum_to_drop_timecode ( int  frame_num  ) 

Adjust frame number for NTSC drop frame time code.

Parameters:
frame_num Actual frame number to adjust
Returns:
Adjusted frame number
Warning:
Adjustment is only valid in NTSC 29.97

Definition at line 36 of file timecode.c.

Referenced by avpriv_timecode_to_string(), and ff_framenum_to_drop_timecode().

uint32_t avpriv_framenum_to_smpte_timecode ( unsigned  frame,
int  fps,
int  drop 
)

Convert frame id (timecode) to SMPTE 12M binary representation.

Parameters:
frame Frame number
fps Frame rate
drop Drop flag
Returns:
The actual binary representation

Definition at line 45 of file timecode.c.

Referenced by ff_framenum_to_smtpe_timecode().

int avpriv_init_smpte_timecode ( void *  avcl,
struct ff_timecode tc 
)

Parse SMTPE 12M time representation (hh:mm:ss[:;.

]ff). str and rate fields from tc struct must be set.

Parameters:
avcl A pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct (used for av_log).
tc Timecode struct pointer
Returns:
0 on success, negative value on failure
Warning:
Adjustement is only valid in NTSC 29.97

Definition at line 109 of file timecode.c.

Referenced by ff_init_smtpe_timecode().

char* avpriv_timecode_to_string ( char *  buf,
const struct ff_timecode tc,
unsigned  frame 
)

Load timecode string in buf.

Parameters:
buf Destination buffer
tc Timecode struct pointer
frame Frame id (timecode frame is computed with tc->start+frame)
Returns:
a pointer to the buf parameter
Note:
timecode representation can be a negative timecode and have more than 24 hours.

buf must have enough space to store the timecode representation: 16 bytes is the minimum required size.

Definition at line 87 of file timecode.c.

int ff_framenum_to_drop_timecode ( int  frame_num  ) 

Definition at line 136 of file timecode.c.

uint32_t ff_framenum_to_smtpe_timecode ( unsigned  frame,
int  fps,
int  drop 
)

Definition at line 141 of file timecode.c.

int ff_init_smtpe_timecode ( void *  avcl,
struct ff_timecode tc 
)

Definition at line 146 of file timecode.c.


Generated on Fri Oct 26 02:50:07 2012 for FFmpeg by  doxygen 1.5.8