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