Ticket #2044: v4l2_mpeg.diff
File v4l2_mpeg.diff, 31.7 KB (added by , 18 years ago) |
---|
-
libs/libmythtv/mpegrecorder.cpp
old new bool MpegRecorder::OpenV4L2DeviceAsInput 319 319 return false; 320 320 } 321 321 322 struct v4l2_control ctrl; 323 ctrl.id = V4L2_CID_AUDIO_VOLUME; 324 ctrl.value = 65536 / 100 *audvolume; 325 326 if (ioctl(chanfd, VIDIOC_S_CTRL, &ctrl) < 0) 327 { 328 VERBOSE(VB_IMPORTANT, LOC_WARN + 329 "Unable to set recording volume" + ENO); 330 VERBOSE(VB_IMPORTANT, LOC_WARN + 331 "If you are using an AverMedia M179 card this is normal."); 332 } 333 if (!SetIVTVDeviceOptions(chanfd) && !SetV4L2DeviceOptions(chanfd)) 334 return false; 335 336 readfd = open(videodevice.ascii(), O_RDWR | O_NONBLOCK); 337 if (readfd < 0) 338 { 339 VERBOSE(VB_IMPORTANT, LOC_ERR + "Can't open video device." + ENO); 340 return false; 341 } 342 343 return true; 344 } 345 346 bool MpegRecorder::SetIVTVDeviceOptions(int chanfd) 347 { 322 348 struct ivtv_ioctl_codec ivtvcodec; 323 349 bzero(&ivtvcodec, sizeof(ivtvcodec)); 324 350 325 351 if (ioctl(chanfd, IVTV_IOC_G_CODEC, &ivtvcodec) < 0) 326 352 { 327 VERBOSE(VB_IMPORTANT, LOC_ERR + "Error getting codec params" + ENO); 353 //silence the warning in the case that the ioctl isn't supported, 354 //means probably that it supports the v4l2 mpeg encoder api 355 if (errno != 22) 356 VERBOSE(VB_IMPORTANT, LOC_ERR + "Error getting codec params" + ENO); 328 357 return false; 329 358 } 330 359 331 360 // only 48kHz works properly. 332 361 int audio_rate = 1; 333 362 334 363 /* … … bool MpegRecorder::OpenV4L2DeviceAsInput 385 414 if (ivtvcodec.framerate) 386 415 keyframedist = 12; 387 416 388 struct v4l2_control ctrl;389 ctrl.id = V4L2_CID_AUDIO_VOLUME;390 ctrl.value = 65536 / 100 *audvolume;391 392 if (ioctl(chanfd, VIDIOC_S_CTRL, &ctrl) < 0)393 {394 VERBOSE(VB_IMPORTANT, LOC_WARN +395 "Unable to set recording volume" + ENO);396 VERBOSE(VB_IMPORTANT, LOC_WARN +397 "If you are using an AverMedia M179 card this is normal.");398 }399 400 417 if (vbimode) 401 418 { 402 419 struct ivtv_sliced_vbi_format vbifmt; … … bool MpegRecorder::OpenV4L2DeviceAsInput 432 449 .arg(vbifmt.service_set).arg(vbifmt.packet_size) 433 450 .arg(vbifmt.io_size)); 434 451 } 452 return true; 453 } 435 454 436 readfd = open(videodevice.ascii(), O_RDWR | O_NONBLOCK); 437 if (readfd < 0) 455 static void set_v4l2_ext_control(struct v4l2_ext_control *ctrl, uint32_t id, int32_t value) 456 { 457 ctrl->id = id; 458 ctrl->value = value; 459 } 460 461 bool MpegRecorder::SetV4L2DeviceOptions(int chanfd) 462 { 463 int c = 0, noCtrls = 7; 464 struct v4l2_ext_control *ext_ctrl = NULL; 465 ext_ctrl = (struct v4l2_ext_control *)calloc(noCtrls, sizeof(struct v4l2_ext_control)); 466 467 // only 48kHz works properly. 468 set_v4l2_ext_control(&ext_ctrl[c++], V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ, V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000); 469 470 set_v4l2_ext_control(&ext_ctrl[c++], V4L2_CID_MPEG_VIDEO_ASPECT, aspectratio-1); 471 472 set_v4l2_ext_control(&ext_ctrl[c++], V4L2_CID_MPEG_AUDIO_ENCODING, audtype-1); 473 474 if (audtype == 2) 438 475 { 439 VERBOSE(VB_IMPORTANT, LOC_ERR + "Can't open video device." + ENO); 476 if (audbitratel2 < 10) 477 audbitratel2 = 10; 478 set_v4l2_ext_control(&ext_ctrl[c++], V4L2_CID_MPEG_AUDIO_L2_BITRATE, audbitratel2-1); 479 } 480 else 481 { 482 VERBOSE(VB_IMPORTANT, LOC_WARN + "MPEG Layer1 is not working properly" 483 "and will probably removed from ivtv with 0.8"); 484 if (audbitratel1 < 6) 485 audbitratel1 = 6; 486 // forcing MPEG Audio layer 2, bitrates are compatible 487 set_v4l2_ext_control(&ext_ctrl[c++], V4L2_CID_MPEG_AUDIO_L2_BITRATE, audbitratel1-1); 488 } 489 490 if (bitrate > maxbitrate) 491 bitrate = maxbitrate; 492 set_v4l2_ext_control(&ext_ctrl[c++], V4L2_CID_MPEG_VIDEO_BITRATE, bitrate * 1000); 493 set_v4l2_ext_control(&ext_ctrl[c++], V4L2_CID_MPEG_VIDEO_BITRATE_PEAK, maxbitrate * 1000); 494 495 // framerate (1 = 25fps, 0 = 30fps) 496 //ivtvcodec.framerate = (!ntsc_framerate); 497 498 // force MPEG2 program streams 499 set_v4l2_ext_control(&ext_ctrl[c++], V4L2_CID_MPEG_STREAM_TYPE, V4L2_MPEG_STREAM_TYPE_MPEG2_PS); 500 501 struct v4l2_ext_controls ctrls; 502 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG; 503 ctrls.count = c; 504 ctrls.controls = ext_ctrl; 505 if (ioctl(chanfd, VIDIOC_S_EXT_CTRLS, &ctrls) < 0) 506 { 507 if (ctrls.error_idx >= ctrls.count) 508 VERBOSE(VB_IMPORTANT, LOC_WARN + "Error setting MPEG controls" + ENO); 509 else 510 VERBOSE(VB_IMPORTANT, LOC_WARN + QString("Error setting MPEG control no. %1 to %2") 511 .arg(ctrls.error_idx).arg(ext_ctrl[ctrls.error_idx].value) + ENO); 512 513 free(ext_ctrl); 440 514 return false; 441 515 } 516 free(ext_ctrl); 517 518 struct v4l2_ext_control keyfrctrl; 519 keyfrctrl.id = V4L2_CID_MPEG_VIDEO_GOP_SIZE; 520 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG; 521 ctrls.count = 1; 522 ctrls.controls = &keyfrctrl; 523 if (ioctl(chanfd, VIDIOC_G_EXT_CTRLS, &ctrls) < 0) 524 { 525 VERBOSE(VB_IMPORTANT, LOC_WARN + 526 "Unable to get V4L2_CID_MPEG_VIDEO_GOP_SIZE, defaulting to 12" + ENO); 527 keyframedist = 12; 528 } 529 else 530 keyframedist = keyfrctrl.value; 531 532 // vbi is currently (2006-07-11) not working 533 // since ivtv trunk doesn't implement V4L2_CID_MPEG_STREAM_VBI_FMT yet 534 if (vbimode) 535 { 536 struct v4l2_format vbifmt; 537 bzero(&vbifmt, sizeof(struct v4l2_format)); 538 //struct v4l2_sliced_vbi_format vbifmt; 539 //bzero(&vbifmt, sizeof(struct v4l2_sliced_vbi_format)); 540 vbifmt.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE; 541 //vbifmt.fmt.sliced.service_set = (1==vbimode) ? VBI_TYPE_TELETEXT : VBI_TYPE_CC; 542 if (1 == vbimode) 543 vbifmt.fmt.sliced.service_set |= V4L2_SLICED_VBI_625; 544 else 545 vbifmt.fmt.sliced.service_set |= V4L2_SLICED_VBI_525; 546 547 if (ioctl(chanfd, VIDIOC_S_FMT, &vbifmt) < 0) 548 { 549 VERBOSE(VB_IMPORTANT, "Can't enable VBI recording" + ENO); 550 } 551 552 struct v4l2_ext_control vbi_fmt; 553 vbi_fmt.id = V4L2_CID_MPEG_STREAM_VBI_FMT; 554 vbi_fmt.value = V4L2_MPEG_STREAM_VBI_FMT_IVTV; 555 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG; 556 ctrls.count = 1; 557 ctrls.controls = &vbi_fmt; 558 if (ioctl(chanfd, VIDIOC_S_EXT_CTRLS, &ctrls) < 0) 559 { 560 VERBOSE(VB_IMPORTANT, LOC + "Can't enable VBI recording (2)"+ENO); 561 } 562 563 ioctl(chanfd, VIDIOC_G_FMT, &vbifmt); 564 565 VERBOSE(VB_RECORD, LOC + QString( 566 "VBI service:%1, packet size:2, io size:%3") 567 .arg(vbifmt.fmt.sliced.service_set) 568 //.arg(vbifmt.fmt.sliced.packet_size) 569 .arg(vbifmt.fmt.sliced.io_size)); 570 } 442 571 443 572 return true; 444 573 } 445 574 575 446 576 bool MpegRecorder::Open(void) 447 577 { 448 578 if (deviceIsMpegFile) -
libs/libmythtv/videodev2_myth.h
old new enum v4l2_buf_type { 90 90 V4L2_BUF_TYPE_VIDEO_OVERLAY = 3, 91 91 V4L2_BUF_TYPE_VBI_CAPTURE = 4, 92 92 V4L2_BUF_TYPE_VBI_OUTPUT = 5, 93 #if 1 93 #if 1 /*KEEP*/ 94 94 /* Experimental Sliced VBI */ 95 95 V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6, 96 96 V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7, … … enum v4l2_ctrl_type { 103 103 V4L2_CTRL_TYPE_BOOLEAN = 2, 104 104 V4L2_CTRL_TYPE_MENU = 3, 105 105 V4L2_CTRL_TYPE_BUTTON = 4, 106 V4L2_CTRL_TYPE_INTEGER64 = 5, 107 V4L2_CTRL_TYPE_CTRL_CLASS = 6, 106 108 }; 107 109 108 110 enum v4l2_tuner_type { … … struct v4l2_capability 184 186 #define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */ 185 187 #define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */ 186 188 #define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */ 187 #if 1 189 #if 1 /*KEEP*/ 188 190 #define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */ 189 191 #define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ 190 192 #endif … … struct v4l2_capability 201 203 /* 202 204 * V I D E O I M A G E F O R M A T 203 205 */ 204 205 206 struct v4l2_pix_format 206 207 { 207 208 __u32 width; … … struct v4l2_pix_format 214 215 __u32 priv; /* private data, depends on pixelformat */ 215 216 }; 216 217 217 /* Pixel format FOURCC depth Description*/218 /* Pixel format FOURCC depth Description */ 218 219 #define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R','G','B','1') /* 8 RGB-3-3-2 */ 219 220 #define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R','G','B','O') /* 16 RGB-5-5-5 */ 220 221 #define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R','G','B','P') /* 16 RGB-5-6-5 */ … … struct v4l2_pix_format 242 243 #define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y','U','1','2') /* 12 YUV 4:2:0 */ 243 244 #define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V') /* 16 YUV 4:2:2 */ 244 245 #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4') /* 8 8-bit color */ 246 #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H','M','1','2') /* 8 YUV 4:1:1 16x16 macroblocks */ 245 247 246 248 /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ 247 249 #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1') /* 8 BGBG.. GRGR.. */ … … struct v4l2_pix_format 250 252 #define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G') /* Motion-JPEG */ 251 253 #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G') /* JFIF JPEG */ 252 254 #define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d') /* 1394 */ 253 #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G') /* MPEG 255 #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G') /* MPEG-1/2/4 */ 254 256 255 257 /* Vendor-specific formats */ 256 258 #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compress */ 257 259 #define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S','9','1','0') /* SN9C10x compression */ 258 260 #define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P','W','C','1') /* pwc older webcam */ 259 261 #define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P','W','C','2') /* pwc newer webcam */ 262 #define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E','6','2','5') /* ET61X251 compression */ 260 263 261 264 /* 262 265 * F O R M A T E N U M E R A T I O N … … struct v4l2_fmtdesc 273 276 274 277 #define V4L2_FMT_FLAG_COMPRESSED 0x0001 275 278 276 277 279 /* 278 280 * T I M E C O D E 279 281 */ … … struct v4l2_timecode 303 305 #define V4L2_TC_USERBITS_8BITCHARS 0x0008 304 306 /* The above is based on SMPTE timecodes */ 305 307 306 308 #ifdef __KERNEL__ 307 309 /* 308 310 * M P E G C O M P R E S S I O N P A R A M E T E R S 309 311 * 310 * ### WARNING: this is still work-in-progress right now, most likely 311 * ### there will be some incompatible changes. 312 * ### WARNING: This experimental MPEG compression API is obsolete. 313 * ### It is replaced by the MPEG controls API. 314 * ### This old API will disappear in the near future! 312 315 * 313 316 */ 314 315 316 317 enum v4l2_bitrate_mode { 317 318 V4L2_BITRATE_NONE = 0, /* not specified */ 318 319 V4L2_BITRATE_CBR, /* constant bitrate */ … … struct v4l2_mpeg_compression { 393 394 /* I don't expect the above being perfect yet ;) */ 394 395 __u32 reserved_5[8]; 395 396 }; 397 #endif 396 398 397 399 struct v4l2_jpegcompression 398 400 { … … struct v4l2_jpegcompression 424 426 * allways use APP0 */ 425 427 }; 426 428 427 428 429 /* 429 430 * M E M O R Y - M A P P I N G B U F F E R S 430 431 */ … … struct v4l2_framebuffer 493 494 struct v4l2_clip 494 495 { 495 496 struct v4l2_rect c; 496 struct v4l2_clip *next;497 struct v4l2_clip __user *next; 497 498 }; 498 499 499 500 struct v4l2_window … … struct v4l2_window 506 507 void __user *bitmap; 507 508 }; 508 509 509 510 510 /* 511 511 * C A P T U R E P A R A M E T E R S 512 512 */ … … struct v4l2_captureparm 519 519 __u32 readbuffers; /* # of buffers for read */ 520 520 __u32 reserved[4]; 521 521 }; 522 522 523 /* Flags for 'capability' and 'capturemode' fields */ 523 524 #define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */ 524 525 #define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */ … … struct v4l2_outputparm 536 537 /* 537 538 * I N P U T I M A G E C R O P P I N G 538 539 */ 539 540 540 struct v4l2_cropcap { 541 541 enum v4l2_buf_type type; 542 542 struct v4l2_rect bounds; … … typedef __u64 v4l2_std_id; 573 573 #define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) 574 574 #define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) 575 575 #define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000) 576 #define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000) 576 577 577 578 #define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000) 578 579 #define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000) … … typedef __u64 v4l2_std_id; 587 588 #define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000) 588 589 #define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000) 589 590 591 /* some merged standards */ 592 #define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC) 593 #define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B) 594 #define V4L2_STD_GH (V4L2_STD_PAL_G|V4L2_STD_PAL_H|V4L2_STD_SECAM_G|V4L2_STD_SECAM_H) 595 #define V4L2_STD_DK (V4L2_STD_PAL_DK|V4L2_STD_SECAM_DK) 596 590 597 /* some common needed stuff */ 591 598 #define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\ 592 599 V4L2_STD_PAL_B1 |\ … … typedef __u64 v4l2_std_id; 599 606 V4L2_STD_PAL_H |\ 600 607 V4L2_STD_PAL_I) 601 608 #define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\ 602 V4L2_STD_NTSC_M_JP) 609 V4L2_STD_NTSC_M_JP |\ 610 V4L2_STD_NTSC_M_KR) 603 611 #define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\ 604 612 V4L2_STD_SECAM_K |\ 605 613 V4L2_STD_SECAM_K1) … … typedef __u64 v4l2_std_id; 607 615 V4L2_STD_SECAM_G |\ 608 616 V4L2_STD_SECAM_H |\ 609 617 V4L2_STD_SECAM_DK |\ 610 V4L2_STD_SECAM_L) 618 V4L2_STD_SECAM_L |\ 619 V4L2_STD_SECAM_LC) 611 620 612 621 #define V4L2_STD_525_60 (V4L2_STD_PAL_M |\ 613 622 V4L2_STD_PAL_60 |\ … … struct v4l2_standard 634 643 __u32 reserved[4]; 635 644 }; 636 645 637 638 646 /* 639 647 * V I D E O I N P U T S 640 648 */ … … struct v4l2_input 649 657 __u32 status; 650 658 __u32 reserved[4]; 651 659 }; 660 652 661 /* Values for the 'type' field */ 653 662 #define V4L2_INPUT_TYPE_TUNER 1 654 663 #define V4L2_INPUT_TYPE_CAMERA 2 … … struct v4l2_control 699 708 __s32 value; 700 709 }; 701 710 711 struct v4l2_ext_control 712 { 713 __u32 id; 714 __u32 reserved2[2]; 715 union { 716 __s32 value; 717 __s64 value64; 718 void *reserved; 719 }; 720 }; 721 722 struct v4l2_ext_controls 723 { 724 __u32 ctrl_class; 725 __u32 count; 726 __u32 error_idx; 727 __u32 reserved[2]; 728 struct v4l2_ext_control *controls; 729 }; 730 731 /* Values for ctrl_class field */ 732 #define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */ 733 #define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ 734 735 #define V4L2_CTRL_ID_MASK (0x0fffffff) 736 #define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) 737 #define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000) 738 702 739 /* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ 703 740 struct v4l2_queryctrl 704 741 { … … struct v4l2_querymenu 725 762 /* Control flags */ 726 763 #define V4L2_CTRL_FLAG_DISABLED 0x0001 727 764 #define V4L2_CTRL_FLAG_GRABBED 0x0002 728 729 /* Control IDs defined by V4L2 */ 730 #define V4L2_CID_BASE 0x00980900 765 #define V4L2_CTRL_FLAG_READ_ONLY 0x0004 766 #define V4L2_CTRL_FLAG_UPDATE 0x0008 767 #define V4L2_CTRL_FLAG_INACTIVE 0x0010 768 #define V4L2_CTRL_FLAG_SLIDER 0x0020 769 770 /* Query flag, to be ORed with the control ID */ 771 #define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000 772 773 /* User-class control IDs defined by V4L2 */ 774 #define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900) 775 #define V4L2_CID_USER_BASE V4L2_CID_BASE 731 776 /* IDs reserved for driver specific controls */ 732 777 #define V4L2_CID_PRIVATE_BASE 0x08000000 733 778 779 #define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1) 734 780 #define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0) 735 781 #define V4L2_CID_CONTRAST (V4L2_CID_BASE+1) 736 782 #define V4L2_CID_SATURATION (V4L2_CID_BASE+2) … … struct v4l2_querymenu 757 803 #define V4L2_CID_VCENTER (V4L2_CID_BASE+23) 758 804 #define V4L2_CID_LASTP1 (V4L2_CID_BASE+24) /* last CID + 1 */ 759 805 806 /* MPEG-class control IDs defined by V4L2 */ 807 #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) 808 #define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1) 809 810 /* MPEG streams */ 811 #define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0) 812 enum v4l2_mpeg_stream_type { 813 V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */ 814 V4L2_MPEG_STREAM_TYPE_MPEG2_TS = 1, /* MPEG-2 transport stream */ 815 V4L2_MPEG_STREAM_TYPE_MPEG1_SS = 2, /* MPEG-1 system stream */ 816 V4L2_MPEG_STREAM_TYPE_MPEG2_DVD = 3, /* MPEG-2 DVD-compatible stream */ 817 V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4, /* MPEG-1 VCD-compatible stream */ 818 V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */ 819 }; 820 #define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1) 821 #define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2) 822 #define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3) 823 #define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4) 824 #define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5) 825 #define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6) 826 #define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7) 827 enum v4l2_mpeg_stream_vbi_fmt { 828 V4L2_MPEG_STREAM_VBI_FMT_NONE = 0, /* No VBI in the MPEG stream */ 829 V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */ 830 }; 831 832 /* MPEG audio */ 833 #define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100) 834 enum v4l2_mpeg_audio_sampling_freq { 835 V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0, 836 V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1, 837 V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2, 838 }; 839 #define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101) 840 enum v4l2_mpeg_audio_encoding { 841 V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0, 842 V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1, 843 V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2, 844 }; 845 #define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102) 846 enum v4l2_mpeg_audio_l1_bitrate { 847 V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0, 848 V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1, 849 V4L2_MPEG_AUDIO_L1_BITRATE_96K = 2, 850 V4L2_MPEG_AUDIO_L1_BITRATE_128K = 3, 851 V4L2_MPEG_AUDIO_L1_BITRATE_160K = 4, 852 V4L2_MPEG_AUDIO_L1_BITRATE_192K = 5, 853 V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6, 854 V4L2_MPEG_AUDIO_L1_BITRATE_256K = 7, 855 V4L2_MPEG_AUDIO_L1_BITRATE_288K = 8, 856 V4L2_MPEG_AUDIO_L1_BITRATE_320K = 9, 857 V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10, 858 V4L2_MPEG_AUDIO_L1_BITRATE_384K = 11, 859 V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12, 860 V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13, 861 }; 862 #define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103) 863 enum v4l2_mpeg_audio_l2_bitrate { 864 V4L2_MPEG_AUDIO_L2_BITRATE_32K = 0, 865 V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1, 866 V4L2_MPEG_AUDIO_L2_BITRATE_56K = 2, 867 V4L2_MPEG_AUDIO_L2_BITRATE_64K = 3, 868 V4L2_MPEG_AUDIO_L2_BITRATE_80K = 4, 869 V4L2_MPEG_AUDIO_L2_BITRATE_96K = 5, 870 V4L2_MPEG_AUDIO_L2_BITRATE_112K = 6, 871 V4L2_MPEG_AUDIO_L2_BITRATE_128K = 7, 872 V4L2_MPEG_AUDIO_L2_BITRATE_160K = 8, 873 V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9, 874 V4L2_MPEG_AUDIO_L2_BITRATE_224K = 10, 875 V4L2_MPEG_AUDIO_L2_BITRATE_256K = 11, 876 V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12, 877 V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13, 878 }; 879 #define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104) 880 enum v4l2_mpeg_audio_l3_bitrate { 881 V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0, 882 V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1, 883 V4L2_MPEG_AUDIO_L3_BITRATE_48K = 2, 884 V4L2_MPEG_AUDIO_L3_BITRATE_56K = 3, 885 V4L2_MPEG_AUDIO_L3_BITRATE_64K = 4, 886 V4L2_MPEG_AUDIO_L3_BITRATE_80K = 5, 887 V4L2_MPEG_AUDIO_L3_BITRATE_96K = 6, 888 V4L2_MPEG_AUDIO_L3_BITRATE_112K = 7, 889 V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8, 890 V4L2_MPEG_AUDIO_L3_BITRATE_160K = 9, 891 V4L2_MPEG_AUDIO_L3_BITRATE_192K = 10, 892 V4L2_MPEG_AUDIO_L3_BITRATE_224K = 11, 893 V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12, 894 V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13, 895 }; 896 #define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105) 897 enum v4l2_mpeg_audio_mode { 898 V4L2_MPEG_AUDIO_MODE_STEREO = 0, 899 V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1, 900 V4L2_MPEG_AUDIO_MODE_DUAL = 2, 901 V4L2_MPEG_AUDIO_MODE_MONO = 3, 902 }; 903 #define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106) 904 enum v4l2_mpeg_audio_mode_extension { 905 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0, 906 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1, 907 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2, 908 V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3, 909 }; 910 #define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107) 911 enum v4l2_mpeg_audio_emphasis { 912 V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0, 913 V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1, 914 V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2, 915 }; 916 #define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108) 917 enum v4l2_mpeg_audio_crc { 918 V4L2_MPEG_AUDIO_CRC_NONE = 0, 919 V4L2_MPEG_AUDIO_CRC_CRC16 = 1, 920 }; 921 922 /* MPEG video */ 923 #define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) 924 enum v4l2_mpeg_video_encoding { 925 V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0, 926 V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1, 927 }; 928 #define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201) 929 enum v4l2_mpeg_video_aspect { 930 V4L2_MPEG_VIDEO_ASPECT_1x1 = 0, 931 V4L2_MPEG_VIDEO_ASPECT_4x3 = 1, 932 V4L2_MPEG_VIDEO_ASPECT_16x9 = 2, 933 V4L2_MPEG_VIDEO_ASPECT_221x100 = 3, 934 }; 935 #define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202) 936 #define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203) 937 #define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204) 938 #define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205) 939 #define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206) 940 enum v4l2_mpeg_video_bitrate_mode { 941 V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0, 942 V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1, 943 }; 944 #define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207) 945 #define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208) 946 #define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209) 947 948 /* MPEG-class control IDs specific to the CX2584x driver as defined by V4L2 */ 949 #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) 950 #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0) 951 enum v4l2_mpeg_cx2341x_video_spatial_filter_mode { 952 V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0, 953 V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO = 1, 954 }; 955 #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1) 956 #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2) 957 enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type { 958 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF = 0, 959 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR = 1, 960 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT = 2, 961 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE = 3, 962 V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4, 963 }; 964 #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3) 965 enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type { 966 V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF = 0, 967 V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1, 968 }; 969 #define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4) 970 enum v4l2_mpeg_cx2341x_video_temporal_filter_mode { 971 V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0, 972 V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO = 1, 973 }; 974 #define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5) 975 #define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6) 976 enum v4l2_mpeg_cx2341x_video_median_filter_type { 977 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF = 0, 978 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR = 1, 979 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT = 2, 980 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3, 981 V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG = 4, 982 }; 983 #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7) 984 #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8) 985 #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9) 986 #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10) 987 760 988 /* 761 989 * T U N I N G 762 990 */ … … struct v4l2_modulator 807 1035 #define V4L2_TUNER_MODE_LANG2 0x0002 808 1036 #define V4L2_TUNER_MODE_SAP 0x0002 809 1037 #define V4L2_TUNER_MODE_LANG1 0x0003 1038 #define V4L2_TUNER_MODE_LANG1_LANG2 0x0004 810 1039 811 1040 struct v4l2_frequency 812 1041 { … … struct v4l2_audio 827 1056 __u32 mode; 828 1057 __u32 reserved[2]; 829 1058 }; 1059 830 1060 /* Flags for the 'capability' field */ 831 1061 #define V4L2_AUDCAP_STEREO 0x00001 832 1062 #define V4L2_AUDCAP_AVL 0x00002 833 1063 834 1064 /* Flags for the 'mode' field */ 835 1065 #define V4L2_AUDMODE_AVL 0x00001 836 #define V4L2_AUDMODE_32BITS 0x00002837 1066 838 1067 struct v4l2_audioout 839 1068 { … … struct v4l2_audioout 851 1080 */ 852 1081 853 1082 /* Raw VBI */ 854 855 1083 struct v4l2_vbi_format 856 1084 { 857 1085 __u32 sampling_rate; /* in 1 Hz */ … … struct v4l2_vbi_format 868 1096 #define V4L2_VBI_UNSYNC (1<< 0) 869 1097 #define V4L2_VBI_INTERLACED (1<< 1) 870 1098 871 #if 1 1099 #if 1 /*KEEP*/ 872 1100 /* Sliced VBI 873 1101 * 874 1102 * This implements is a proposal V4L2 API to allow SLICED VBI … … struct v4l2_sliced_vbi_format 888 1116 __u32 reserved[2]; /* must be zero */ 889 1117 }; 890 1118 1119 /* Teletext World System Teletext 1120 (WST), defined on ITU-R BT.653-2 */ 891 1121 #define V4L2_SLICED_TELETEXT_B (0x0001) 1122 /* Video Program System, defined on ETS 300 231*/ 892 1123 #define V4L2_SLICED_VPS (0x0400) 1124 /* Closed Caption, defined on EIA-608 */ 893 1125 #define V4L2_SLICED_CAPTION_525 (0x1000) 1126 /* Wide Screen System, defined on ITU-R BT1119.1 */ 894 1127 #define V4L2_SLICED_WSS_625 (0x4000) 895 1128 896 1129 #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525) 897 1130 #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625) 898 1131 1132 #if 0 1133 /* FIXME: Currently unused defines, needs to be discussed further */ 1134 1135 /* Teletext World System Teletext 1136 (WST), defined on ITU-R BT.653-2 */ 1137 #define V4L2_SLICED_TELETEXT_PAL_B (0x000001) 1138 #define V4L2_SLICED_TELETEXT_PAL_C (0x000002) 1139 #define V4L2_SLICED_TELETEXT_NTSC_B (0x000010) 1140 #define V4L2_SLICED_TELETEXT_SECAM (0x000020) 1141 1142 /* Teletext North American Broadcast Teletext Specification 1143 (NABTS), defined on ITU-R BT.653-2 */ 1144 #define V4L2_SLICED_TELETEXT_NTSC_C (0x000040) 1145 #define V4L2_SLICED_TELETEXT_NTSC_D (0x000080) 1146 1147 /* Video Program System, defined on ETS 300 231*/ 1148 #define V4L2_SLICED_VPS (0x000400) 1149 1150 /* Closed Caption, defined on EIA-608 */ 1151 #define V4L2_SLICED_CAPTION_525 (0x001000) 1152 #define V4L2_SLICED_CAPTION_625 (0x002000) 1153 1154 /* Wide Screen System, defined on ITU-R BT1119.1 */ 1155 #define V4L2_SLICED_WSS_625 (0x004000) 1156 1157 /* Wide Screen System, defined on IEC 61880 */ 1158 #define V4L2_SLICED_WSS_525 (0x008000) 1159 1160 /* Vertical Interval Timecode (VITC), defined on SMPTE 12M */ 1161 #define V4l2_SLICED_VITC_625 (0x010000) 1162 #define V4l2_SLICED_VITC_525 (0x020000) 1163 1164 #define V4L2_SLICED_TELETEXT_B (V4L2_SLICED_TELETEXT_PAL_B |\ 1165 V4L2_SLICED_TELETEXT_NTSC_B) 1166 1167 #define V4L2_SLICED_TELETEXT (V4L2_SLICED_TELETEXT_PAL_B |\ 1168 V4L2_SLICED_TELETEXT_PAL_C |\ 1169 V4L2_SLICED_TELETEXT_SECAM |\ 1170 V4L2_SLICED_TELETEXT_NTSC_B |\ 1171 V4L2_SLICED_TELETEXT_NTSC_C |\ 1172 V4L2_SLICED_TELETEXT_NTSC_D) 1173 1174 #define V4L2_SLICED_CAPTION (V4L2_SLICED_CAPTION_525 |\ 1175 V4L2_SLICED_CAPTION_625) 1176 1177 #define V4L2_SLICED_WSS (V4L2_SLICED_WSS_525 |\ 1178 V4L2_SLICED_WSS_625) 1179 1180 #define V4L2_SLICED_VITC (V4L2_SLICED_VITC_525 |\ 1181 V4L2_SLICED_VITC_625) 1182 1183 #define V4L2_SLICED_VBI_525 (V4L2_SLICED_TELETEXT_NTSC_B |\ 1184 V4L2_SLICED_TELETEXT_NTSC_C |\ 1185 V4L2_SLICED_TELETEXT_NTSC_D |\ 1186 V4L2_SLICED_CAPTION_525 |\ 1187 V4L2_SLICED_WSS_525 |\ 1188 V4l2_SLICED_VITC_525) 1189 1190 #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_PAL_B |\ 1191 V4L2_SLICED_TELETEXT_PAL_C |\ 1192 V4L2_SLICED_TELETEXT_SECAM |\ 1193 V4L2_SLICED_VPS |\ 1194 V4L2_SLICED_CAPTION_625 |\ 1195 V4L2_SLICED_WSS_625 |\ 1196 V4l2_SLICED_VITC_625) 1197 #endif 1198 899 1199 struct v4l2_sliced_vbi_cap 900 1200 { 901 1201 __u16 service_set; … … struct v4l2_format 931 1231 struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE 932 1232 struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY 933 1233 struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE 934 #if 1 1234 #if 1 /*KEEP*/ 935 1235 struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE 936 1236 #endif 937 1237 __u8 raw_data[200]; // user-defined … … struct v4l2_streamparm 952 1252 } parm; 953 1253 }; 954 1254 955 956 957 1255 /* 958 1256 * I O C T L C O D E S F O R V I D E O D E V I C E S 959 1257 * … … struct v4l2_streamparm 963 1261 #define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc) 964 1262 #define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format) 965 1263 #define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format) 1264 #ifdef __KERNEL__ 966 1265 #define VIDIOC_G_MPEGCOMP _IOR ('V', 6, struct v4l2_mpeg_compression) 967 1266 #define VIDIOC_S_MPEGCOMP _IOW ('V', 7, struct v4l2_mpeg_compression) 1267 #endif 968 1268 #define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers) 969 1269 #define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer) 970 1270 #define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer) … … struct v4l2_streamparm 1010 1310 #define VIDIOC_ENUMAUDOUT _IOWR ('V', 66, struct v4l2_audioout) 1011 1311 #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) 1012 1312 #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) 1013 #if 1 1313 #if 1 /*KEEP*/ 1014 1314 #define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap) 1015 1315 #endif 1016 1316 #define VIDIOC_LOG_STATUS _IO ('V', 70) 1317 #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) 1318 #define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls) 1319 #define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls) 1017 1320 1321 #ifdef __OLD_VIDIOC_ 1018 1322 /* for compatibility, will go away some day */ 1019 1323 #define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int) 1020 1324 #define VIDIOC_S_PARM_OLD _IOW ('V', 22, struct v4l2_streamparm) … … struct v4l2_streamparm 1022 1326 #define VIDIOC_G_AUDIO_OLD _IOWR ('V', 33, struct v4l2_audio) 1023 1327 #define VIDIOC_G_AUDOUT_OLD _IOWR ('V', 49, struct v4l2_audioout) 1024 1328 #define VIDIOC_CROPCAP_OLD _IOR ('V', 58, struct v4l2_cropcap) 1329 #endif 1025 1330 1026 1331 #define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ 1027 1332 1028 1029 #ifdef __KERNEL__1030 /*1031 *1032 * V 4 L 2 D R I V E R H E L P E R A P I1033 *1034 * Some commonly needed functions for drivers (v4l2-common.o module)1035 */1036 #include <linux/fs.h>1037 1038 /* Video standard functions */1039 extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs);1040 extern int v4l2_video_std_construct(struct v4l2_standard *vs,1041 int id, char *name);1042 1043 /* prority handling */1044 struct v4l2_prio_state {1045 atomic_t prios[4];1046 };1047 int v4l2_prio_init(struct v4l2_prio_state *global);1048 int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local,1049 enum v4l2_priority new);1050 int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local);1051 int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local);1052 enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global);1053 int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local);1054 1055 /* names for fancy debug output */1056 extern char *v4l2_field_names[];1057 extern char *v4l2_type_names[];1058 extern char *v4l2_ioctl_names[];1059 1060 /* Compatibility layer interface -- v4l1-compat module */1061 typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file,1062 unsigned int cmd, void *arg);1063 int v4l_compat_translate_ioctl(struct inode *inode, struct file *file,1064 int cmd, void *arg, v4l2_kioctl driver_ioctl);1065 1066 #endif /* __KERNEL__ */1067 1333 #endif /* __LINUX_VIDEODEV2_H */ 1068 1334 1069 1335 /*