FFmpeg  1.2.12
timecode.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006 Smartjog S.A.S, Baptiste Coudurier <baptiste.coudurier@gmail.com>
3  * Copyright (C) 2011 Smartjog S.A.S, Clément Bœsch <clement.boesch@smartjog.com>
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
28 #ifndef AVCODEC_TIMECODE_H
29 #define AVCODEC_TIMECODE_H
30 
31 #include "version.h"
32 
33 #if FF_API_OLD_TIMECODE
34 
35 #include <stdint.h>
36 #include "avcodec.h"
37 #include "libavutil/rational.h"
38 
39 #define TIMECODE_OPT(ctx, flags) \
40  "timecode", "set timecode value following hh:mm:ss[:;.]ff format, " \
41  "use ';' or '.' before frame number for drop frame", \
42  offsetof(ctx, tc.str), \
43  AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, flags
44 
45 struct ff_timecode {
46  char *str;
47  int start;
48  int drop;
49  AVRational rate;
50 };
51 
58 int avpriv_framenum_to_drop_timecode(int frame_num);
59 
67 uint32_t avpriv_framenum_to_smpte_timecode(unsigned frame, int fps, int drop);
68 
80 char *avpriv_timecode_to_string(char *buf, const struct ff_timecode *tc, unsigned frame);
81 
87 int avpriv_check_timecode_rate(void *avcl, AVRational rate, int drop);
88 
99 int avpriv_init_smpte_timecode(void *avcl, struct ff_timecode *tc);
100 
101 attribute_deprecated int ff_framenum_to_drop_timecode(int frame_num);
102 attribute_deprecated uint32_t ff_framenum_to_smtpe_timecode(unsigned frame, int fps, int drop);
103 attribute_deprecated int ff_init_smtpe_timecode(void *avcl, struct ff_timecode *tc);
104 #endif
105 
106 #endif /* AVCODEC_TIMECODE_H */