Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dvblast
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
dvblast
Commits
99554e95
Commit
99554e95
authored
Aug 31, 2011
by
Georgi Chorbadzhiyski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dvblastctl: Add XML output support for fe_status command.
parent
0c40683f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
16 deletions
+54
-16
dvblastctl.c
dvblastctl.c
+54
-16
No files found.
dvblastctl.c
View file @
99554e95
...
@@ -477,6 +477,7 @@ int main( int i_argc, char **ppsz_argv )
...
@@ -477,6 +477,7 @@ int main( int i_argc, char **ppsz_argv )
case
RET_FRONTEND_STATUS
:
case
RET_FRONTEND_STATUS
:
{
{
int
ret
=
1
;
struct
ret_frontend_status
*
p_ret
=
struct
ret_frontend_status
*
p_ret
=
(
struct
ret_frontend_status
*
)
&
p_buffer
[
COMM_HEADER_SIZE
];
(
struct
ret_frontend_status
*
)
&
p_buffer
[
COMM_HEADER_SIZE
];
if
(
i_size
!=
COMM_HEADER_SIZE
+
sizeof
(
struct
ret_frontend_status
)
)
if
(
i_size
!=
COMM_HEADER_SIZE
+
sizeof
(
struct
ret_frontend_status
)
)
...
@@ -485,9 +486,15 @@ int main( int i_argc, char **ppsz_argv )
...
@@ -485,9 +486,15 @@ int main( int i_argc, char **ppsz_argv )
exit
(
255
);
exit
(
255
);
}
}
if
(
i_print_type
==
PRINT_XML
)
printf
(
"<FRONTEND>
\n
"
);
#define PRINT_TYPE( x ) \
#define PRINT_TYPE( x ) \
do { \
do { \
printf("type: %s\n", STRINGIFY(x) ); \
if ( i_print_type == PRINT_XML ) \
printf( " <TYPE type=\"%s\"/>\n", STRINGIFY(x) ); \
else \
printf( "type: %s\n", STRINGIFY(x) ); \
} while(0)
} while(0)
switch
(
p_ret
->
info
.
type
)
switch
(
p_ret
->
info
.
type
)
{
{
...
@@ -500,7 +507,12 @@ int main( int i_argc, char **ppsz_argv )
...
@@ -500,7 +507,12 @@ int main( int i_argc, char **ppsz_argv )
#undef PRINT_TYPE
#undef PRINT_TYPE
#define PRINT_INFO( x ) \
#define PRINT_INFO( x ) \
printf( STRINGIFY(x) ": %u\n", p_ret->info.x );
do { \
if ( i_print_type == PRINT_XML ) \
printf( " <SETTING %s=\"%u\"/>\n", STRINGIFY(x), p_ret->info.x ); \
else \
printf( "%s: %u\n", STRINGIFY(x), p_ret->info.x ); \
} while(0)
PRINT_INFO
(
frequency_min
);
PRINT_INFO
(
frequency_min
);
PRINT_INFO
(
frequency_max
);
PRINT_INFO
(
frequency_max
);
PRINT_INFO
(
frequency_stepsize
);
PRINT_INFO
(
frequency_stepsize
);
...
@@ -511,11 +523,19 @@ int main( int i_argc, char **ppsz_argv )
...
@@ -511,11 +523,19 @@ int main( int i_argc, char **ppsz_argv )
PRINT_INFO
(
notifier_delay
);
PRINT_INFO
(
notifier_delay
);
#undef PRINT_INFO
#undef PRINT_INFO
if
(
i_print_type
==
PRINT_TEXT
)
printf
(
"
\n
capability list:
\n
"
);
printf
(
"
\n
capability list:
\n
"
);
#define PRINT_CAPS( x ) \
#define PRINT_CAPS( x ) \
if ( p_ret->info.caps & (FE_##x) ) \
do { \
printf( STRINGIFY(x) "\n" );
if ( p_ret->info.caps & (FE_##x) ) { \
if ( i_print_type == PRINT_XML ) { \
printf( " <CAPABILITY %s=\"1\"/>\n", STRINGIFY(x) ); \
} else { \
printf( "%s\n", STRINGIFY(x) ); \
} \
} \
} while(0)
PRINT_CAPS
(
IS_STUPID
);
PRINT_CAPS
(
IS_STUPID
);
PRINT_CAPS
(
CAN_INVERSION_AUTO
);
PRINT_CAPS
(
CAN_INVERSION_AUTO
);
PRINT_CAPS
(
CAN_FEC_1_2
);
PRINT_CAPS
(
CAN_FEC_1_2
);
...
@@ -556,11 +576,19 @@ int main( int i_argc, char **ppsz_argv )
...
@@ -556,11 +576,19 @@ int main( int i_argc, char **ppsz_argv )
#endif
#endif
#undef PRINT_CAPS
#undef PRINT_CAPS
if
(
i_print_type
==
PRINT_TEXT
)
printf
(
"
\n
status:
\n
"
);
printf
(
"
\n
status:
\n
"
);
#define PRINT_STATUS( x ) \
#define PRINT_STATUS( x ) \
if ( p_ret->i_status & (FE_##x) ) \
do { \
printf( STRINGIFY(x) "\n" );
if ( p_ret->i_status & (FE_##x) ) { \
if ( i_print_type == PRINT_XML ) { \
printf( " <STATUS status=\"%s\"/>\n", STRINGIFY(x) ); \
} else { \
printf( "%s\n", STRINGIFY(x) ); \
} \
} \
} while(0)
PRINT_STATUS
(
HAS_SIGNAL
);
PRINT_STATUS
(
HAS_SIGNAL
);
PRINT_STATUS
(
HAS_CARRIER
);
PRINT_STATUS
(
HAS_CARRIER
);
PRINT_STATUS
(
HAS_VITERBI
);
PRINT_STATUS
(
HAS_VITERBI
);
...
@@ -571,13 +599,23 @@ int main( int i_argc, char **ppsz_argv )
...
@@ -571,13 +599,23 @@ int main( int i_argc, char **ppsz_argv )
if
(
p_ret
->
i_status
&
FE_HAS_LOCK
)
if
(
p_ret
->
i_status
&
FE_HAS_LOCK
)
{
{
if
(
i_print_type
==
PRINT_XML
)
{
printf
(
" <VALUE bit_error_rate=
\"
%d
\"
/>
\n
"
,
p_ret
->
i_ber
);
printf
(
" <VALUE signal_strength=
\"
%d
\"
/>
\n
"
,
p_ret
->
i_strength
);
printf
(
" <VALUE SNR=
\"
%d
\"
/>
\n
"
,
p_ret
->
i_snr
);
}
else
{
printf
(
"
\n
Bit error rate: %d
\n
"
,
p_ret
->
i_ber
);
printf
(
"
\n
Bit error rate: %d
\n
"
,
p_ret
->
i_ber
);
printf
(
"Signal strength: %d
\n
"
,
p_ret
->
i_strength
);
printf
(
"Signal strength: %d
\n
"
,
p_ret
->
i_strength
);
printf
(
"SNR: %d
\n
"
,
p_ret
->
i_snr
);
printf
(
"SNR: %d
\n
"
,
p_ret
->
i_snr
);
exit
(
0
);
}
ret
=
0
;
}
}
exit
(
1
);
if
(
i_print_type
==
PRINT_XML
)
printf
(
"</FRONTEND>
\n
"
);
exit
(
ret
);
break
;
break
;
}
}
...
...
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