iec68113.h revision 114215
1259701Sdim/* 2259701Sdim * Copyright (c) 2003 Hidetoshi Shimokawa 3259701Sdim * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa 4259701Sdim * All rights reserved. 5259701Sdim * 6259701Sdim * Redistribution and use in source and binary forms, with or without 7259701Sdim * modification, are permitted provided that the following conditions 8259701Sdim * are met: 9259701Sdim * 1. Redistributions of source code must retain the above copyright 10259701Sdim * notice, this list of conditions and the following disclaimer. 11259701Sdim * 2. Redistributions in binary form must reproduce the above copyright 12259701Sdim * notice, this list of conditions and the following disclaimer in the 13259701Sdim * documentation and/or other materials provided with the distribution. 14259701Sdim * 3. All advertising materials mentioning features or use of this software 15259701Sdim * must display the acknowledgement as bellow: 16259701Sdim * 17259701Sdim * This product includes software developed by K. Kobayashi and H. Shimokawa 18259701Sdim * 19259701Sdim * 4. The name of the author may not be used to endorse or promote products 20259701Sdim * derived from this software without specific prior written permission. 21259701Sdim * 22259701Sdim * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 23259701Sdim * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24259701Sdim * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25259701Sdim * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 26259701Sdim * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 27259701Sdim * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28259701Sdim * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29259701Sdim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 30259701Sdim * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31259701Sdim * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32259701Sdim * POSSIBILITY OF SUCH DAMAGE. 33259701Sdim * 34259701Sdim * $FreeBSD: head/sys/dev/firewire/iec68113.h 114215 2003-04-29 13:27:13Z simokawa $ 35259701Sdim * 36259701Sdim */ 37259701Sdim 38259701Sdim#define DV_BROADCAST_ON (1<<30) 39259701Sdim#define oMPR 0x900 40259701Sdim#define oPCR 0x904 41259701Sdim#define iMPR 0x980 42259701Sdim#define iPCR 0x984 43259701Sdim 44259701Sdimstruct ciphdr { 45259701Sdim#if BYTE_ORDER == BIG_ENDIAN 46259701Sdim u_int8_t eoh0:1, /* 0 */ 47259701Sdim form0:1, /* 0 */ 48259701Sdim src:6; 49259701Sdim#else 50259701Sdim u_int8_t src:6, 51259701Sdim form0:1, /* 0 */ 52259701Sdim eoh0:1; /* 0 */ 53259701Sdim#endif 54259701Sdim u_int8_t len; 55259701Sdim#if BYTE_ORDER == BIG_ENDIAN 56259701Sdim u_int8_t fn:2, 57259701Sdim qpc:3, 58259701Sdim sph:1, 59259701Sdim :2; 60259701Sdim#else 61259701Sdim u_int8_t :2, 62259701Sdim sph:1, 63259701Sdim qpc:3, 64259701Sdim fn:2; 65259701Sdim#endif 66259701Sdim u_int8_t dbc; 67259701Sdim#if BYTE_ORDER == BIG_ENDIAN 68259701Sdim u_int8_t eoh1:1, /* 1 */ 69259701Sdim form1:1, /* 0 */ 70259701Sdim fmt:6; 71259701Sdim#else 72259701Sdim u_int8_t fmt:6, 73259701Sdim form1:1, /* 0 */ 74259701Sdim eoh1:1; /* 1 */ 75259701Sdim#endif 76259701Sdim#define CIP_FMT_DVCR 0 77259701Sdim#define CIP_FMT_MPEG (1<<5) 78259701Sdim union { 79259701Sdim struct { 80259701Sdim#if BYTE_ORDER == BIG_ENDIAN 81259701Sdim u_int8_t fs:1, /* 50/60 field system 82259701Sdim NTSC/PAL */ 83259701Sdim stype:5, 84259701Sdim :2; 85259701Sdim#else 86259701Sdim u_int8_t :2, 87259701Sdim stype:5, 88259701Sdim fs:1; /* 50/60 field system 89259701Sdim NTSC/PAL */ 90259701Sdim#endif 91259701Sdim#define CIP_STYPE_SD 0 92259701Sdim#define CIP_STYPE_SDL 1 93259701Sdim#define CIP_STYPE_HD 2 94259701Sdim u_int16_t cyc:16; /* take care of byte order! */ 95259701Sdim } __attribute__ ((packed)) dv; 96259701Sdim u_int8_t bytes[3]; 97259701Sdim } fdf; 98259701Sdim 99259701Sdim}; 100259701Sdimstruct dvdbc{ 101259701Sdim#if BYTE_ORDER == BIG_ENDIAN 102259701Sdim u_int8_t sct:3, /* Section type */ 103259701Sdim :1, /* Reserved */ 104259701Sdim arb:4; /* Arbitrary bit */ 105259701Sdim#else 106 u_int8_t arb:4, /* Arbitrary bit */ 107 :1, /* Reserved */ 108 sct:3; /* Section type */ 109#endif 110#define DV_SCT_HEADER 0 111#define DV_SCT_SUBCODE 1 112#define DV_SCT_VAUX 2 113#define DV_SCT_AUDIO 3 114#define DV_SCT_VIDEO 4 115#if BYTE_ORDER == BIG_ENDIAN 116 u_int8_t dseq:4, /* DIF sequence number */ 117 fsc:1, /* ID of a DIF block in each channel */ 118 :3; 119#else 120 u_int8_t :3, 121 fsc:1, /* ID of a DIF block in each channel */ 122 dseq:4; /* DIF sequence number */ 123#endif 124 u_int8_t dbn; /* DIF block number */ 125 u_int8_t payload[77]; 126#define DV_DSF_12 0x80 /* PAL: payload[0] in Header DIF */ 127}; 128