Changeset 4126

Show
Ignore:
Timestamp:
05/25/08 15:03:47 (8 months ago)
Author:
hverkuil
Message:

Fix v4l2-dbg include.
Add support to set playback mute/stereo/bilingual modes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ivtv/trunk/utils/ivtv-ctl.c

    r4122 r4126  
    4040#include <linux/videodev2.h> 
    4141#include <linux/dvb/video.h> 
     42#include <linux/dvb/audio.h> 
    4243 
    4344/* copied from ivtv-driver.h */ 
     
    8586        OptSetYuvMode, 
    8687        OptGetYuvMode, 
     88        OptSetAudioMute, 
     89        OptSetStereoMode, 
     90        OptSetBilingualMode, 
    8791        OptLast = 256 
    8892}; 
    8993 
    9094static char options[OptLast]; 
     95 
     96static int app_result; 
    9197 
    9298static struct option long_options[] = { 
     
    105111        {"get-yuv-mode", no_argument, 0, OptGetYuvMode}, 
    106112        {"set-yuv-mode", required_argument, 0, OptSetYuvMode}, 
     113        {"set-audio-mute", required_argument, 0, OptSetAudioMute}, 
     114        {"set-stereo-mode", required_argument, 0, OptSetStereoMode}, 
     115        {"set-bilingual-mode", required_argument, 0, OptSetBilingualMode}, 
    107116        {0, 0, 0, 0} 
    108117}; 
     
    122131        printf("                     mode 2: progressive\n"); 
    123132        printf("                     mode 3: auto\n"); 
     133        printf("  --set-audio-mute <mute>\n"); 
     134        printf("                     0=enable audio during 1.5x and 0.5x playback\n"); 
     135        printf("                     1=mute audio during 1.5x and 0.5x playback\n"); 
     136        printf("  --set-stereo-mode <mode>\n"); 
     137        printf("                     mode 0: playback stereo as stereo\n"); 
     138        printf("                     mode 1: playback left stereo channel as mono\n"); 
     139        printf("                     mode 2: playback right stereo channel as mono\n"); 
     140        printf("                     mode 3: playback stereo as mono\n"); 
     141        printf("                     mode 4: playback stereo as swapped stereo\n"); 
     142        printf("  --set-bilingual-mode <mode>\n"); 
     143        printf("                     mode 0: playback bilingual as stereo\n"); 
     144        printf("                     mode 1: playback left bilingual channel as mono\n"); 
     145        printf("                     mode 2: playback right bilingual channel as mono\n"); 
     146        printf("                     mode 3: playback bilingual as mono\n"); 
     147        printf("                     mode 4: playback bilingual as swapped stereo\n"); 
    124148        printf("  --reset <mask>     reset the infrared receiver (1) or digitizer (2) [VIDIOC_INT_RESET]\n"); 
    125149        printf("\n"); 
     
    286310        printf("ioctl %s ", name); 
    287311        retVal = ioctl(fd, request, parm); 
    288         if (retVal < 0) 
     312        if (retVal < 0) { 
     313                app_result = -1; 
    289314                printf("failed: %s\n", strerror(errno)); 
     315        } 
    290316        else 
    291317                printf("ok\n"); 
     
    326352        int gpio_set_dir = 0; 
    327353        int passthrough = 0; 
     354        int audio_mute = 0; 
     355        int stereo_mode = 0; 
     356        int bilingual_mode = 0; 
    328357        int debug_level = 0; 
    329358        __u32 reset = 0; 
     
    427456                case OptPassThrough: 
    428457                        passthrough = strtol(optarg, 0L, 0); 
     458                        break; 
     459                case OptSetAudioMute: 
     460                        audio_mute = strtol(optarg, 0L, 0); 
     461                        break; 
     462                case OptSetStereoMode: 
     463                        stereo_mode = strtol(optarg, 0L, 0); 
     464                        break; 
     465                case OptSetBilingualMode: 
     466                        bilingual_mode = strtol(optarg, 0L, 0); 
    429467                        break; 
    430468                case OptSetGPIO: 
     
    589627        } 
    590628 
     629        if (options[OptSetAudioMute]) { 
     630                doioctl(fd, AUDIO_SET_MUTE, (void *)audio_mute, "AUDIO_SET_MUTE"); 
     631        } 
     632 
     633        if (options[OptSetStereoMode]) { 
     634                doioctl(fd, AUDIO_CHANNEL_SELECT, 
     635                        (void *)stereo_mode, "AUDIO_CHANNEL_SELECT"); 
     636        } 
     637 
     638        if (options[OptSetBilingualMode]) { 
     639                doioctl(fd, AUDIO_BILINGUAL_CHANNEL_SELECT, 
     640                        (void *)bilingual_mode, "AUDIO_BILINGUAL_CHANNEL_SELECT"); 
     641        } 
     642 
    591643        if (options[OptReset]) 
    592644                doioctl(fd, VIDIOC_INT_RESET, &reset, "VIDIOC_INT_RESET"); 
     
    632684 
    633685        close(fd); 
    634         exit(0); 
    635 } 
     686        exit(app_result); 
     687} 
  • ivtv/trunk/utils/v4l2-dbg.cpp

    r3967 r4126  
    3434#include <sys/klog.h> 
    3535 
    36 #include "videodev2.h" 
     36#include <linux/videodev2.h> 
    3737 
    3838#include <list>