Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
e9adc2be
Commit
e9adc2be
authored
Mar 12, 2013
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlc_epg: add parental rating from ts streams.
parent
f1a9cf16
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
5 deletions
+29
-5
include/vlc_epg.h
include/vlc_epg.h
+2
-1
modules/demux/ts.c
modules/demux/ts.c
+20
-1
modules/demux/ty.c
modules/demux/ty.c
+1
-1
src/input/es_out_timeshift.c
src/input/es_out_timeshift.c
+2
-1
src/misc/epg.c
src/misc/epg.c
+4
-1
No files found.
include/vlc_epg.h
View file @
e9adc2be
...
...
@@ -38,6 +38,7 @@ typedef struct
char
*
psz_short_description
;
char
*
psz_description
;
uint8_t
i_rating
;
/* Parental control, set to 0 when undefined */
}
vlc_epg_event_t
;
typedef
struct
...
...
@@ -66,7 +67,7 @@ VLC_API void vlc_epg_Clean(vlc_epg_t *p_epg);
*
* \see vlc_epg_t for the definitions of the parameters.
*/
VLC_API
void
vlc_epg_AddEvent
(
vlc_epg_t
*
p_epg
,
int64_t
i_start
,
int
i_duration
,
const
char
*
psz_name
,
const
char
*
psz_short_description
,
const
char
*
psz_description
);
VLC_API
void
vlc_epg_AddEvent
(
vlc_epg_t
*
p_epg
,
int64_t
i_start
,
int
i_duration
,
const
char
*
psz_name
,
const
char
*
psz_short_description
,
const
char
*
psz_description
,
uint8_t
i_rating
);
/**
* It creates a new vlc_epg_t*
...
...
modules/demux/ts.c
View file @
e9adc2be
...
...
@@ -2837,6 +2837,7 @@ static void EITCallBack( demux_t *p_demux,
char
*
psz_extra
=
strdup
(
""
);
int64_t
i_start
;
int
i_duration
;
int
i_min_age
=
0
;
i_start
=
EITConvertStartTime
(
p_evt
->
i_start_time
);
i_duration
=
EITConvertDuration
(
p_evt
->
i_duration
);
...
...
@@ -2915,6 +2916,24 @@ static void EITCallBack( demux_t *p_demux,
}
}
}
else
if
(
p_dr
->
i_tag
==
0x55
)
{
dvbpsi_parental_rating_dr_t
*
pR
=
dvbpsi_DecodeParentalRatingDr
(
p_dr
);
if
(
pR
)
{
for
(
int
i
=
0
;
i
<
pR
->
i_ratings_number
;
i
++
)
{
const
dvbpsi_parental_rating_t
*
p_rating
=
&
pR
->
p_parental_rating
[
i
];
if
(
p_rating
->
i_rating
>
0x00
&&
p_rating
->
i_rating
<=
0x0F
)
{
if
(
p_rating
->
i_rating
+
3
>
i_min_age
)
i_min_age
=
p_rating
->
i_rating
+
3
;
msg_Dbg
(
p_demux
,
"..* event parental control set to %d years"
,
i_min_age
);
}
}
}
}
else
{
msg_Dbg
(
p_demux
,
" - tag=0x%x(%d)"
,
p_dr
->
i_tag
,
p_dr
->
i_tag
);
...
...
@@ -2924,7 +2943,7 @@ static void EITCallBack( demux_t *p_demux,
/* */
if
(
i_start
>
0
)
vlc_epg_AddEvent
(
p_epg
,
i_start
,
i_duration
,
psz_name
,
psz_text
,
*
psz_extra
?
psz_extra
:
NULL
);
*
psz_extra
?
psz_extra
:
NULL
,
i_min_age
);
/* Update "now playing" field */
if
(
p_evt
->
i_running_status
==
0x04
&&
i_start
>
0
)
...
...
modules/demux/ty.c
View file @
e9adc2be
...
...
@@ -1443,7 +1443,7 @@ static void DemuxDecodeXds( demux_t *p_demux, uint8_t d1, uint8_t d2 )
p_epg
=
vlc_epg_New
(
NULL
);
if
(
m
->
current
.
psz_name
)
{
vlc_epg_AddEvent
(
p_epg
,
0
,
0
,
m
->
current
.
psz_name
,
NULL
,
NULL
);
vlc_epg_AddEvent
(
p_epg
,
0
,
0
,
m
->
current
.
psz_name
,
NULL
,
NULL
,
0
);
//if( m->current.psz_rating )
// TODO but VLC cannot yet handle rating per epg event
vlc_epg_SetCurrent
(
p_epg
,
0
);
...
...
src/input/es_out_timeshift.c
View file @
e9adc2be
...
...
@@ -1371,7 +1371,8 @@ static int CmdInitControl( ts_cmd_t *p_cmd, int i_query, va_list args, bool b_co
vlc_epg_AddEvent
(
p_cmd
->
u
.
control
.
u
.
int_epg
.
p_epg
,
p_evt
->
i_start
,
p_evt
->
i_duration
,
p_evt
->
psz_name
,
p_evt
->
psz_short_description
,
p_evt
->
psz_description
);
p_evt
->
psz_short_description
,
p_evt
->
psz_description
,
0
);
}
vlc_epg_SetCurrent
(
p_cmd
->
u
.
control
.
u
.
int_epg
.
p_epg
,
p_epg
->
p_current
?
p_epg
->
p_current
->
i_start
:
-
1
);
...
...
src/misc/epg.c
View file @
e9adc2be
...
...
@@ -55,7 +55,8 @@ void vlc_epg_Clean( vlc_epg_t *p_epg )
}
void
vlc_epg_AddEvent
(
vlc_epg_t
*
p_epg
,
int64_t
i_start
,
int
i_duration
,
const
char
*
psz_name
,
const
char
*
psz_short_description
,
const
char
*
psz_description
)
const
char
*
psz_name
,
const
char
*
psz_short_description
,
const
char
*
psz_description
,
uint8_t
i_rating
)
{
vlc_epg_event_t
*
p_evt
=
malloc
(
sizeof
(
*
p_evt
)
);
if
(
!
p_evt
)
...
...
@@ -65,6 +66,7 @@ void vlc_epg_AddEvent( vlc_epg_t *p_epg, int64_t i_start, int i_duration,
p_evt
->
psz_name
=
psz_name
?
strdup
(
psz_name
)
:
NULL
;
p_evt
->
psz_short_description
=
psz_short_description
?
strdup
(
psz_short_description
)
:
NULL
;
p_evt
->
psz_description
=
psz_description
?
strdup
(
psz_description
)
:
NULL
;
p_evt
->
i_rating
=
i_rating
;
TAB_APPEND
(
p_epg
->
i_event
,
p_epg
->
pp_event
,
p_evt
);
}
...
...
@@ -130,6 +132,7 @@ void vlc_epg_Merge( vlc_epg_t *p_dst, const vlc_epg_t *p_src )
p_copy
->
psz_name
=
p_evt
->
psz_name
?
strdup
(
p_evt
->
psz_name
)
:
NULL
;
p_copy
->
psz_short_description
=
p_evt
->
psz_short_description
?
strdup
(
p_evt
->
psz_short_description
)
:
NULL
;
p_copy
->
psz_description
=
p_evt
->
psz_description
?
strdup
(
p_evt
->
psz_description
)
:
NULL
;
p_copy
->
i_rating
=
p_evt
->
i_rating
;
TAB_INSERT
(
p_dst
->
i_event
,
p_dst
->
pp_event
,
p_copy
,
j
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment