2 * Copyright (C) 2009 David A. Schleef <ds@schleef.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 #ifndef _GST_SMPTE_TIME_CODE_H_
21 #define _GST_SMPTE_TIME_CODE_H_
27 typedef struct _GstSMPTETimeCode GstSMPTETimeCode;
31 * @GST_SMPTE_TIME_CODE_SYSTEM_30: 29.97 frame per second system (NTSC)
32 * @GST_SMPTE_TIME_CODE_SYSTEM_25: 25 frame per second system (PAL)
33 * @GST_SMPTE_TIME_CODE_SYSTEM_24: 24 frame per second system
35 * Enum value representing SMPTE Time Code system.
38 GST_SMPTE_TIME_CODE_SYSTEM_30 = 0,
39 GST_SMPTE_TIME_CODE_SYSTEM_25,
40 GST_SMPTE_TIME_CODE_SYSTEM_24
41 } GstSMPTETimeCodeSystem;
43 struct _GstSMPTETimeCode {
50 #define GST_SMPTE_TIME_CODE_SYSTEM_IS_VALID(x) \
51 ((x) >= GST_SMPTE_TIME_CODE_SYSTEM_30 && (x) <= GST_SMPTE_TIME_CODE_SYSTEM_24)
53 #define GST_SMPTE_TIME_CODE_FORMAT "02d:%02d:%02d:%02d"
54 #define GST_SMPTE_TIME_CODE_ARGS(timecode) \
55 (timecode)->hours, (timecode)->minutes, \
56 (timecode)->seconds, (timecode)->frames
58 gboolean gst_smpte_time_code_is_valid (GstSMPTETimeCodeSystem system,
59 GstSMPTETimeCode *time_code);
60 gboolean gst_smpte_time_code_from_frame_number (GstSMPTETimeCodeSystem system,
61 GstSMPTETimeCode *time_code, int frame_number);
62 gboolean gst_smpte_time_code_get_frame_number (GstSMPTETimeCodeSystem system,
63 int *frame_number, GstSMPTETimeCode *time_code);
64 GstClockTime gst_smpte_time_code_get_timestamp (GstSMPTETimeCodeSystem system,
65 GstSMPTETimeCode *time_code);