Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
450
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
223d4246
Commit
223d4246
authored
14 years ago
by
Rémi Denis-Courmont
Browse files
Options
Downloads
Patches
Plain Diff
DTV: represent guard intervals as ints rather than strings internally
parent
40913091
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/access/dtv/access.c
+26
-2
26 additions, 2 deletions
modules/access/dtv/access.c
modules/access/dtv/dtv.h
+4
-1
4 additions, 1 deletion
modules/access/dtv/dtv.h
modules/access/dtv/linux.c
+17
-17
17 additions, 17 deletions
modules/access/dtv/linux.c
with
47 additions
and
20 deletions
modules/access/dtv/access.c
+
26
−
2
View file @
223d4246
...
...
@@ -583,6 +583,31 @@ static char *var_InheritModulation (vlc_object_t *obj)
return
strdup
(
str
);
}
static
unsigned
var_InheritGuardInterval
(
vlc_object_t
*
obj
)
{
char
*
guard
=
var_InheritString
(
obj
,
"dvb-guard"
);
if
(
guard
==
NULL
)
return
VLC_GUARD_AUTO
;
uint16_t
a
,
b
;
int
v
=
sscanf
(
guard
,
"%"
SCNu16
"/%"
SCNu16
,
&
a
,
&
b
);
free
(
guard
);
switch
(
v
)
{
case
1
:
/* Backward compatibility with VLC < 1.2 */
if
(
a
==
0
)
break
;
msg_Warn
(
obj
,
"
\"
guard=%"
PRIu16
"
\"
option is obsolete. "
"Use
\"
guard=1/%"
PRIu16
" instead."
,
a
,
a
);
b
=
a
;
a
=
1
;
case
2
:
return
VLC_GUARD
(
a
,
b
);
}
return
VLC_GUARD_AUTO
;
}
/*** ATSC ***/
static
int
atsc_setup
(
vlc_object_t
*
obj
,
dvb_device_t
*
dev
,
unsigned
freq
)
...
...
@@ -700,13 +725,12 @@ static int dvbt_setup (vlc_object_t *obj, dvb_device_t *dev, unsigned freq)
char
*
mod
=
var_InheritModulation
(
obj
);
char
*
fec_hp
=
var_InheritString
(
obj
,
"dvb-code-rate-hp"
);
char
*
fec_lp
=
var_InheritString
(
obj
,
"dvb-code-rate-lp"
);
char
*
guard
=
var_Inherit
String
(
obj
,
"dvb-guard"
);
uint32_t
guard
=
var_Inherit
GuardInterval
(
obj
);
uint32_t
bw
=
var_InheritInteger
(
obj
,
"dvb-bandwidth"
);
int
tx
=
var_InheritInteger
(
obj
,
"dvb-transmission"
);
int
h
=
var_InheritInteger
(
obj
,
"dvb-hierarchy"
);
int
ret
=
dvb_set_dvbt
(
dev
,
freq
,
mod
,
fec_hp
,
fec_lp
,
bw
,
tx
,
guard
,
h
);
free
(
guard
);
free
(
fec_lp
);
free
(
fec_hp
);
free
(
mod
);
...
...
This diff is collapsed.
Click to expand it.
modules/access/dtv/dtv.h
+
4
−
1
View file @
223d4246
...
...
@@ -40,6 +40,9 @@ float dvb_get_snr (dvb_device_t *);
int
dvb_set_inversion
(
dvb_device_t
*
,
int
);
int
dvb_tune
(
dvb_device_t
*
);
#define VLC_GUARD(a,b) (((a) << 16u) | (b))
#define VLC_GUARD_AUTO 0xFFFFFFFF
/* DVB-C */
int
dvb_set_dvbc
(
dvb_device_t
*
,
uint32_t
freq
,
const
char
*
mod
,
uint32_t
srate
,
const
char
*
fec
);
...
...
@@ -55,7 +58,7 @@ int dvb_set_sec (dvb_device_t *, uint32_t freq, char pol,
/* DVB-T */
int
dvb_set_dvbt
(
dvb_device_t
*
,
uint32_t
freq
,
const
char
*
mod
,
const
char
*
fec_hp
,
const
char
*
fec_lp
,
uint32_t
bandwidth
,
int
transmission
,
const
char
*
guard
,
int
hierarchy
);
int
transmission
,
uint32_t
guard
,
int
hierarchy
);
/* ATSC */
int
dvb_set_atsc
(
dvb_device_t
*
,
uint32_t
freq
,
const
char
*
mod
);
...
...
This diff is collapsed.
Click to expand it.
modules/access/dtv/linux.c
+
17
−
17
View file @
223d4246
...
...
@@ -712,19 +712,19 @@ static int dvb_parse_transmit_mode (int i)
TRANSMISSION_MODE_AUTO
);
}
static
int
dvb_parse_guard
(
const
char
*
str
)
{
static
const
dvb_
str
_map_t
tab
[]
=
{
{
""
,
GUARD_INTERVAL_
AUTO
},
/*{ "1/128",
GUARD_INTERVAL_1_1
28
},
*/
{
"1/16"
,
GUARD_INTERVAL_1_
16
},
{
"1/32"
,
GUARD_INTERVAL_1_
32
},
{
"1/4"
,
GUARD_INTERVAL_1_
4
},
{
"1/8"
,
GUARD_INTERVAL_1
_
8
},
/*{
"19/128",
GUARD_INTERVAL_
1
9_
128
},*/
/*{ "9/256",
GUARD_INTERVAL_
9_256
},
*/
static
int
dvb_parse_guard
(
uint32_t
guard
)
{
static
const
dvb_
int
_map_t
tab
[]
=
{
/*{ VLC_GUARD(1,128),
GUARD_INTERVAL_
1_128
},
*/
{
VLC_GUARD
(
1
,
16
),
GUARD_INTERVAL_1_1
6
},
{
VLC_GUARD
(
1
,
32
)
,
GUARD_INTERVAL_1_
32
},
{
VLC_GUARD
(
1
,
4
),
GUARD_INTERVAL_1_
4
},
{
VLC_GUARD
(
1
,
8
)
,
GUARD_INTERVAL_1_
8
},
/*{ VLC_GUARD(19,128),
GUARD_INTERVAL_1
9_12
8 },
*/
/*{
VLC_GUARD(9,256),
GUARD_INTERVAL_9_
256
},*/
{
VLC_GUARD_AUTO
,
GUARD_INTERVAL_
AUTO
},
};
return
dvb_parse_
str
(
str
,
tab
,
sizeof
(
tab
)
/
sizeof
(
*
tab
),
return
dvb_parse_
int
(
guard
,
tab
,
sizeof
(
tab
)
/
sizeof
(
*
tab
),
GUARD_INTERVAL_AUTO
);
}
...
...
@@ -743,22 +743,22 @@ static int dvb_parse_hierarchy (int i)
int
dvb_set_dvbt
(
dvb_device_t
*
d
,
uint32_t
freq
,
const
char
*
modstr
,
const
char
*
fechstr
,
const
char
*
feclstr
,
uint32_t
bandwidth
,
int
transmit_
val
,
const
char
*
guard
str
,
int
hierarchy
_val
)
int
transmit_
mode
,
uint32_t
guard
,
int
hierarchy
)
{
uint32_t
mod
=
dvb_parse_modulation
(
modstr
,
QAM_AUTO
);
uint32_t
fec_hp
=
dvb_parse_fec
(
fechstr
);
uint32_t
fec_lp
=
dvb_parse_fec
(
feclstr
);
bandwidth
*=
1000000
;
uint32_t
transmit_mode
=
dvb_parse_transmit_mode
(
transmit_
val
);
uint32_t
guard
_it
=
dvb_parse_guard
(
guard
str
);
uint32_t
hierarchy
=
dvb_parse_hierarchy
(
hierarchy
_val
);
transmit_mode
=
dvb_parse_transmit_mode
(
transmit_
mode
);
guard
=
dvb_parse_guard
(
guard
);
hierarchy
=
dvb_parse_hierarchy
(
hierarchy
);
return
dvb_set_props
(
d
,
10
,
DTV_CLEAR
,
0
,
DTV_DELIVERY_SYSTEM
,
SYS_DVBT
,
DTV_FREQUENCY
,
freq
*
1000
,
DTV_MODULATION
,
mod
,
DTV_CODE_RATE_HP
,
fec_hp
,
DTV_CODE_RATE_LP
,
fec_lp
,
DTV_BANDWIDTH_HZ
,
bandwidth
,
DTV_TRANSMISSION_MODE
,
transmit_mode
,
DTV_GUARD_INTERVAL
,
guard
_it
,
DTV_GUARD_INTERVAL
,
guard
,
DTV_HIERARCHY
,
hierarchy
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment