Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libdvbpsi
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
libdvbpsi
Commits
0778a214
Commit
0778a214
authored
Oct 11, 2015
by
Daniel Kamil Kozar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove dr-api-rename.pl, it's of no use now
parent
9c0989fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
144 deletions
+0
-144
dr-api-rename.pl
dr-api-rename.pl
+0
-144
No files found.
dr-api-rename.pl
deleted
100755 → 0
View file @
9c0989fa
#!/usr/bin/perl
use
strict
;
use
warnings
;
use
File::
Find
;
use
Tie::
File
;
use
Data::
Dumper
;
use
File::
Basename
;
my
@dr_headers
;
sub
wanted_dr_h
{
push
@dr_headers
,
$
File::Find::
name
if
/^dr_[0-f]{2}\.h$/
;
}
find
(
\&
wanted_dr_h
,
'
src/descriptors
');
for
(
@dr_headers
)
{
my
$hdrinfo
=
parse_header
(
$_
);
if
(
not
defined
$hdrinfo
)
{
if
(
/dr_a1\.h$/
)
{
$hdrinfo
=
{
old
=>
{
stru
=>
'
dvbpsi_service_location_dr
',
gen
=>
'
dvbpsi_GenServiceLocationDr
',
decode
=>
'
dvbpsi_DecodeServiceLocationDr
'
},
new
=>
{
stru
=>
'
dvbpsi_atsc_service_location_dr
',
gen
=>
'
dvbpsi_gen_atsc_service_location_dr
',
decode
=>
'
dvbpsi_decode_atsc_service_location_dr
'
}
}
}
elsif
(
/dr_49\.h$/
)
{
$hdrinfo
=
{
old
=>
{
stru
=>
'
dvbpsi_country_availability_dr
',
gen
=>
'
dvbpsi_GenCountryAvailabilityDr
',
decode
=>
'
dvbpsi_DecodeCountryAvailability
'
},
new
=>
{
stru
=>
'
dvbpsi_dvb_country_availability_dr
',
gen
=>
'
dvbpsi_gen_dvb_country_availability_dr
',
decode
=>
'
dvbpsi_decode_dvb_country_availability_dr
'
}
}
}
else
{
print
STDERR
"
Failed to process
$_
\n
";
next
;
}
}
replace_names
(
$hdrinfo
);
}
exit
0
;
sub
parse_header
{
my
$dr_h
=
shift
;
my
$sname
;
my
$fname
;
my
@decode_decl
;
my
@file
;
my
$rv
;
tie
@file
,
'
Tie::File
',
$dr_h
or
die
"
Can't open
$dr_h
";
for
(
@file
)
{
if
(
/^typedef struct dvbpsi_(.*?)_dr_(?:t|s)$/
)
{
$sname
=
$1
;
last
;
}
}
goto
end
if
not
defined
$sname
;
for
(
my
$i
=
0
;
$i
<
scalar
(
@file
)
;
++
$i
)
{
if
(
$file
[
$i
]
=~
/^dvbpsi_${sname}_dr_t *?\* *?dvbpsi_Decode(.*?)Dr/
)
{
$fname
=
$1
;
push
@decode_decl
,
$file
[
$i
];
last
if
(
$file
[
$i
]
=~
/.*;.*/
);
$i
++
;
while
(
1
)
{
push
@decode_decl
,
$file
[
$i
];
if
(
$file
[
$i
]
=~
/.*;.*/
)
{
last
;
}
else
{
$i
++
;
}
}
}
}
goto
end
if
not
defined
$fname
;
$dr_h
=~
/dr_([0-9a-f]{2})\.h$/
;
my
$drnum
=
hex
(
$1
);
my
$oldinfo
=
{
stru
=>
"
dvbpsi_
${sname}
_dr
",
gen
=>
"
dvbpsi_Gen
${fname}
Dr
",
decode
=>
"
dvbpsi_Decode
${fname}
Dr
"
};
$rv
=
{
old
=>
$oldinfo
,
new
=>
get_new_hdrinfo
(
$sname
,
get_dr_system
(
$drnum
))
};
end:
untie
@file
;
return
$rv
;
}
sub
get_dr_system
{
my
$drnum
=
shift
;
return
"
mpeg
"
if
$drnum
>=
2
&&
$drnum
<=
63
;
return
"
dvb
"
if
$drnum
>=
64
&&
$drnum
<=
127
;
return
"
atsc
"
if
$drnum
==
0xa0
||
$drnum
==
0x86
||
$drnum
==
0x81
;
return
"
eacem
"
if
$drnum
==
0x83
;
return
"
scte
"
if
$drnum
==
0x8a
;
return
"
custom
"
if
$drnum
>=
128
&&
$drnum
<=
254
;
die
"
Forbidden descriptor
$drnum
";
}
sub
get_new_hdrinfo
{
(
my
$sname
,
my
$sys
)
=
@_
;
return
{
stru
=>
"
dvbpsi_
${sys}
_
${sname}
_dr
",
gen
=>
"
dvbpsi_gen_
${sys}
_
${sname}
_dr
",
decode
=>
"
dvbpsi_decode_
${sys}
_
${sname}
_dr
"
}
}
my
$replacer
;
sub
wanted_global_c_or_h
{
return
unless
/\.(c|h)$/
;
my
@file
;
my
$old
=
$replacer
->
{
old
};
my
$new
=
$replacer
->
{
new
};
tie
@file
,
'
Tie::File
',
$_
or
die
"
Cannot open
$_
";
for
(
@file
)
{
s/$old->{stru}/$new->{stru}/g
;
s/$old->{gen}/$new->{gen}/g
;
s/$old->{decode}/$new->{decode}/g
;
}
untie
@file
;
}
sub
replace_names
{
$replacer
=
shift
;
find
(
\&
wanted_global_c_or_h
,
'
.
');
}
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