VLC  4.0.0-dev
vlc_epg.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * vlc_epg.h: Electronic Program Guide
3  *****************************************************************************
4  * Copyright (C) 2007 VLC authors and VideoLAN
5  *
6  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
7  *
8  * This program is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation; either version 2.1 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21  *****************************************************************************/
22 
23 #ifndef VLC_EPG_H
24 #define VLC_EPG_H 1
25 
26 /**
27  * \file
28  * This file defines functions and structures for storing dvb epg information
29  */
30 
31 typedef struct
32 {
33  int64_t i_start; /* Interpreted as a value return by time() */
34  uint32_t i_duration; /* Duration of the event in second */
35  uint16_t i_id; /* Unique event id withing the event set */
36 
37  char *psz_name;
38  char *psz_short_description;
39  char *psz_description;
40  struct /* Description items in tranmission order */
41  {
42  char *psz_key;
43  char *psz_value;
44  } * description_items;
45  int i_description_items;
46 
47  uint8_t i_rating; /* Parental control, set to 0 when undefined */
49 
50 typedef struct
51 {
52  char *psz_name;
53  uint32_t i_id; /* Unique identifier for this table / events (partial sets) */
54  uint16_t i_source_id;/* Channel / Program reference id this epg relates to */
55  size_t i_event;
56  vlc_epg_event_t **pp_event;
57  bool b_present; /* Contains present/following or similar, and sets below */
58  const vlc_epg_event_t *p_current; /* NULL, or equal to one of the entries in pp_event */
60 
61 /**
62  * Creates a new vlc_epg_event_t*
63  *
64  * You must call vlc_epg_event_Delete to release the associated resources.
65  *
66  * \p i_id is the event unique id
67  * \p i_start start in epoch time
68  * \p i_duration event duration in seconds
69  */
71  int64_t i_start, uint32_t i_duration);
72 
73 /**
74  * Releases a vlc_epg_event_t*.
75  */
77 
78 /**
79  * Returns a vlc_epg_event_t * duplicated from \p p_src.
80  *
81  */
83 
84 /**
85  * It creates a new vlc_epg_t*
86  *
87  * You must call vlc_epg_Delete to release the associated resource.
88  *
89  * \p i_id is computed unique id depending on standard (table id, eit number)
90  * \p i_source_id is the associated program number
91  */
92 VLC_API vlc_epg_t * vlc_epg_New(uint32_t i_id, uint16_t i_source_id);
93 
94 /**
95  * It releases a vlc_epg_t*.
96  */
97 VLC_API void vlc_epg_Delete(vlc_epg_t *p_epg);
98 
99 /**
100  * It appends a new vlc_epg_event_t to a vlc_epg_t.
101  * Takes ownership of \p p_evt or returns false
102  *
103  * \p p_evt a vlc_epg_event_t * created with vlc_epg_event_New.
104  */
106 
107 /**
108  * It set the current event of a vlc_epg_t given a start time
109  */
110 VLC_API void vlc_epg_SetCurrent(vlc_epg_t *p_epg, int64_t i_start);
111 
112 /**
113  * Returns a duplicated \p p_src and its associated events.
114  *
115  */
117 
118 #endif
119 
vlc_epg_New
VLC_EXPORT vlc_epg_t * vlc_epg_New(uint32_t i_id, uint16_t i_source_id)
It creates a new vlc_epg_t*.
Definition: epg.c:190
vlc_epg_event_t::i_id
uint16_t i_id
Definition: vlc_epg.h:36
VLC_API
#define VLC_API
Definition: fourcc_gen.c:31
vlc_epg_AddEvent
VLC_EXPORT bool vlc_epg_AddEvent(vlc_epg_t *p_epg, vlc_epg_event_t *p_evt)
It appends a new vlc_epg_event_t to a vlc_epg_t.
Definition: epg.c:133
vlc_epg_Duplicate
VLC_EXPORT vlc_epg_t * vlc_epg_Duplicate(const vlc_epg_t *p_src)
Returns a duplicated p_src and its associated events.
Definition: epg.c:221
vlc_epg_t::psz_name
char * psz_name
Definition: vlc_epg.h:53
psz_name
const char * psz_name
Definition: text_style.c:53
vlc_epg_event_t
Definition: vlc_epg.h:32
vlc_common.h
vlc_epg_t::i_event
size_t i_event
Definition: vlc_epg.h:56
vlc_epg_event_t::psz_key
char * psz_key
Definition: vlc_epg.h:43
vlc_epg_event_New
VLC_EXPORT vlc_epg_event_t * vlc_epg_event_New(uint16_t i_id, int64_t i_start, uint32_t i_duration)
Creates a new vlc_epg_event_t*.
Definition: epg.c:64
vlc_epg_t::i_id
uint32_t i_id
Definition: vlc_epg.h:54
vlc_epg_Delete
VLC_EXPORT void vlc_epg_Delete(vlc_epg_t *p_epg)
It releases a vlc_epg_t*.
Definition: epg.c:198
vlc_epg_event_t::i_duration
uint32_t i_duration
Definition: vlc_epg.h:35
vlc_epg_event_t::psz_value
char * psz_value
Definition: vlc_epg.h:44
vlc_epg_event_t::i_start
int64_t i_start
Definition: vlc_epg.h:34
vlc_epg_t::pp_event
vlc_epg_event_t ** pp_event
Definition: vlc_epg.h:57
vlc_epg_event_t::i_rating
uint8_t i_rating
Definition: vlc_epg.h:48
vlc_epg_event_t::psz_description
char * psz_description
Definition: vlc_epg.h:40
vlc_epg_t
Definition: vlc_epg.h:51
vlc_epg_event_t::psz_short_description
char * psz_short_description
Definition: vlc_epg.h:39
vlc_epg_event_t::i_description_items
int i_description_items
Definition: vlc_epg.h:46
vlc_epg_event_t::psz_name
char * psz_name
Definition: vlc_epg.h:38
vlc_epg_t::b_present
bool b_present
Definition: vlc_epg.h:58
psz_value
char psz_value[8]
Definition: vout_intf.c:99
vlc_epg_t::i_source_id
uint16_t i_source_id
Definition: vlc_epg.h:55
vlc_epg_event_Delete
VLC_EXPORT void vlc_epg_event_Delete(vlc_epg_event_t *p_event)
Releases a vlc_epg_event_t*.
Definition: epg.c:47
vlc_epg_t::p_current
const vlc_epg_event_t * p_current
Definition: vlc_epg.h:59
vlc_epg_SetCurrent
VLC_EXPORT void vlc_epg_SetCurrent(vlc_epg_t *p_epg, int64_t i_start)
It set the current event of a vlc_epg_t given a start time.
Definition: epg.c:204
vlc_epg_event_Duplicate
VLC_EXPORT vlc_epg_event_t * vlc_epg_event_Duplicate(const vlc_epg_event_t *p_src)
Returns a vlc_epg_event_t * duplicated from p_src.
Definition: epg.c:74