1 /*****************************************************************************
2  * atsc_a65.h : ATSC A65 decoding helpers
3  *****************************************************************************
4  * Copyright (C) 2016 - VideoLAN Authors
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  *****************************************************************************/
19 #ifndef VLC_ATSC_A65_H
20 #define VLC_ATSC_A65_H
21 
22 #define GPS_UTC_EPOCH_OFFSET 315964800
23 
24 typedef struct atsc_a65_handle_t atsc_a65_handle_t;
25 
26 atsc_a65_handle_t *atsc_a65_handle_New( const char *psz_lang );
27 void atsc_a65_handle_Release( atsc_a65_handle_t * );
28 
29 char * atsc_a65_Decode_multiple_string( atsc_a65_handle_t *, const uint8_t *, size_t );
30 char * atsc_a65_Decode_simple_UTF16_string( atsc_a65_handle_t *, const uint8_t *, size_t );
31 
atsc_a65_GPSTimeToEpoch(time_t i_seconds,time_t i_gpstoepoch_leaptime_offset)32 static inline time_t atsc_a65_GPSTimeToEpoch( time_t i_seconds, time_t i_gpstoepoch_leaptime_offset )
33 {
34     return i_seconds + GPS_UTC_EPOCH_OFFSET - i_gpstoepoch_leaptime_offset;
35 }
36 
37 #endif
38