aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_av.c
diff options
context:
space:
mode:
authorMark Purcell <msp@debian.org>2008-06-22 11:00:40 +1000
committeretobi <git@e-tobi.net>2013-09-03 09:48:42 +0200
commit891c51ff368ed700dec6025eeb47ce4d96f76418 (patch)
tree3729664829e4faa691d403274f38eb10890b533c /test/test_av.c
parent1c6e1f28f54ec2606c23936c1d8689f2be55a86c (diff)
parentab959d7b4194715870128e616b8e29d4a101e488 (diff)
downloadlinux-dvb-apps-a966623153d5c69ef156542.tar.gz
Imported Debian patch 1.1.1+rev1207-1debian/1.1.1+rev1207-1
Diffstat (limited to '')
-rw-r--r--test/test_av.c100
1 files changed, 50 insertions, 50 deletions
diff --git a/test/test_av.c b/test/test_av.c
index 5d77000..6c32848 100644
--- a/test/test_av.c
+++ b/test/test_av.c
@@ -1,4 +1,4 @@
-/*
+/*
* test_av.c - Test for audio and video MPEG decoder API.
*
* Copyright (C) 2000 - 2002 convergence GmbH
@@ -30,6 +30,7 @@
#include <time.h>
#include <unistd.h>
+#include <linux/types.h>
#include <linux/dvb/audio.h>
#include <linux/dvb/video.h>
@@ -94,11 +95,11 @@ int audioSetMute(int fd, char *arg)
int audioSetAVSync(int fd, char *arg)
{
- int sync;
+ int _sync;
if (!arg)
return -1;
- sync = atoi(arg);
- if (ioctl(fd, AUDIO_SET_AV_SYNC, sync) == -1)
+ _sync = atoi(arg);
+ if (ioctl(fd, AUDIO_SET_AV_SYNC, _sync) == -1)
perror("AUDIO_SET_AV_SYNC");
return 0;
}
@@ -127,66 +128,66 @@ int audioChannelSelect(int fd, char *arg)
int audioGetStatus(int fd, char *arg)
{
- struct audio_status stat;
+ struct audio_status _stat;
if (arg)
return -1;
- if (ioctl(fd, AUDIO_GET_STATUS, &stat) == -1) {
+ if (ioctl(fd, AUDIO_GET_STATUS, &_stat) == -1) {
perror("AUDIO_GET_STATUS");
return 0;
}
printf("Audio Status:\n");
printf(" Sync State : %s\n",
- (stat.AV_sync_state ? "SYNC" : "NO SYNC"));
+ (_stat.AV_sync_state ? "SYNC" : "NO SYNC"));
printf(" Mute State : %s\n",
- (stat.mute_state ? "muted" : "not muted"));
+ (_stat.mute_state ? "muted" : "not muted"));
printf(" Play State : ");
- switch ((int)stat.play_state){
+ switch ((int)_stat.play_state){
case AUDIO_STOPPED:
- printf("STOPPED (%d)\n",stat.play_state);
+ printf("STOPPED (%d)\n",_stat.play_state);
break;
case AUDIO_PLAYING:
- printf("PLAYING (%d)\n",stat.play_state);
+ printf("PLAYING (%d)\n",_stat.play_state);
break;
case AUDIO_PAUSED:
- printf("PAUSED (%d)\n",stat.play_state);
+ printf("PAUSED (%d)\n",_stat.play_state);
break;
default:
- printf("unknown (%d)\n",stat.play_state);
+ printf("unknown (%d)\n",_stat.play_state);
break;
}
printf(" Stream Source : ");
- switch((int)stat.stream_source){
+ switch((int)_stat.stream_source){
case AUDIO_SOURCE_DEMUX:
- printf("DEMUX (%d)\n",stat.stream_source);
+ printf("DEMUX (%d)\n",_stat.stream_source);
break;
case AUDIO_SOURCE_MEMORY:
- printf("MEMORY (%d)\n",stat.stream_source);
+ printf("MEMORY (%d)\n",_stat.stream_source);
break;
default:
- printf("unknown (%d)\n",stat.stream_source);
+ printf("unknown (%d)\n",_stat.stream_source);
break;
}
printf(" Channel Select : ");
- switch((int)stat.channel_select){
+ switch((int)_stat.channel_select){
case AUDIO_STEREO:
- printf("Stereo (%d)\n",stat.channel_select);
+ printf("Stereo (%d)\n",_stat.channel_select);
break;
case AUDIO_MONO_LEFT:
- printf("Mono left(%d)\n",stat.channel_select);
+ printf("Mono left(%d)\n",_stat.channel_select);
break;
case AUDIO_MONO_RIGHT:
- printf("Mono right (%d)\n",stat.channel_select);
+ printf("Mono right (%d)\n",_stat.channel_select);
break;
default:
- printf("unknown (%d)\n",stat.channel_select);
+ printf("unknown (%d)\n",_stat.channel_select);
break;
}
printf(" Bypass Mode : %s\n",
- (stat.bypass_mode ? "ON" : "OFF"));
+ (_stat.bypass_mode ? "ON" : "OFF"));
return 0;
@@ -300,76 +301,76 @@ int videoSlowMotion(int fd, char *arg)
int videoGetStatus(int fd, char *arg)
{
- struct video_status stat;
+ struct video_status _stat;
if (arg)
return -1;
- if (ioctl(fd, VIDEO_GET_STATUS, &stat) == -1){
+ if (ioctl(fd, VIDEO_GET_STATUS, &_stat) == -1){
perror("VIDEO_GET_STATUS");
return 0;
}
printf("Video Status:\n");
printf(" Blank State : %s\n",
- (stat.video_blank ? "BLANK" : "STILL"));
+ (_stat.video_blank ? "BLANK" : "STILL"));
printf(" Play State : ");
- switch ((int)stat.play_state){
+ switch ((int)_stat.play_state){
case VIDEO_STOPPED:
- printf("STOPPED (%d)\n",stat.play_state);
+ printf("STOPPED (%d)\n",_stat.play_state);
break;
case VIDEO_PLAYING:
- printf("PLAYING (%d)\n",stat.play_state);
+ printf("PLAYING (%d)\n",_stat.play_state);
break;
case VIDEO_FREEZED:
- printf("FREEZED (%d)\n",stat.play_state);
+ printf("FREEZED (%d)\n",_stat.play_state);
break;
default:
- printf("unknown (%d)\n",stat.play_state);
+ printf("unknown (%d)\n",_stat.play_state);
break;
}
printf(" Stream Source : ");
- switch((int)stat.stream_source){
+ switch((int)_stat.stream_source){
case VIDEO_SOURCE_DEMUX:
- printf("DEMUX (%d)\n",stat.stream_source);
+ printf("DEMUX (%d)\n",_stat.stream_source);
break;
case VIDEO_SOURCE_MEMORY:
- printf("MEMORY (%d)\n",stat.stream_source);
+ printf("MEMORY (%d)\n",_stat.stream_source);
break;
default:
- printf("unknown (%d)\n",stat.stream_source);
+ printf("unknown (%d)\n",_stat.stream_source);
break;
}
printf(" Format (Aspect Ratio): ");
- switch((int)stat.video_format){
+ switch((int)_stat.video_format){
case VIDEO_FORMAT_4_3:
- printf("4:3 (%d)\n",stat.video_format);
+ printf("4:3 (%d)\n",_stat.video_format);
break;
case VIDEO_FORMAT_16_9:
- printf("16:9 (%d)\n",stat.video_format);
+ printf("16:9 (%d)\n",_stat.video_format);
break;
case VIDEO_FORMAT_221_1:
- printf("2.21:1 (%d)\n",stat.video_format);
+ printf("2.21:1 (%d)\n",_stat.video_format);
break;
default:
- printf("unknown (%d)\n",stat.video_format);
+ printf("unknown (%d)\n",_stat.video_format);
break;
}
printf(" Display Format : ");
- switch((int)stat.display_format){
+ switch((int)_stat.display_format){
case VIDEO_PAN_SCAN:
- printf("Pan&Scan (%d)\n",stat.display_format);
+ printf("Pan&Scan (%d)\n",_stat.display_format);
break;
case VIDEO_LETTER_BOX:
- printf("Letterbox (%d)\n",stat.display_format);
+ printf("Letterbox (%d)\n",_stat.display_format);
break;
case VIDEO_CENTER_CUT_OUT:
- printf("Center cutout (%d)\n",stat.display_format);
+ printf("Center cutout (%d)\n",_stat.display_format);
break;
default:
- printf("unknown (%d)\n",stat.display_format);
+ printf("unknown (%d)\n",_stat.display_format);
break;
}
return 0;
@@ -424,12 +425,12 @@ int videoStillPicture(int fd, char *arg)
sp.size = st.st_size;
printf("I-frame size: %d\n", sp.size);
- if(!sp.iFrame) {
+ if (!sp.iFrame) {
printf("No memory for I-Frame\n");
return 0;
}
- printf("read: %d bytes\n",read(sifd,sp.iFrame,sp.size));
+ printf("read: %d bytes\n", (int) read(sifd,sp.iFrame,sp.size));
if (ioctl(fd, VIDEO_STILLPICTURE, &sp) == -1)
perror("VIDEO_STILLPICTURE");
return 0;
@@ -555,11 +556,11 @@ int main(void)
printf("using audio device '%s'\n", audiodev);
printf("enter command or h + enter for help\n");
- if((vfd = open(videodev, O_RDWR | O_NONBLOCK)) < 0) {
+ if ((vfd = open(videodev, O_RDWR | O_NONBLOCK)) < 0) {
perror("open video device");
return 1;
}
- if((afd = open(audiodev, O_RDWR | O_NONBLOCK)) < 0) {
+ if ((afd = open(audiodev, O_RDWR | O_NONBLOCK)) < 0) {
perror("open audio device");
return 1;
}
@@ -571,4 +572,3 @@ int main(void)
close(afd);
return 0;
}
-