2 * SPDX-License-Identifier: BSD-4-Clause
4 * Copyright (c) 2003 Hidetoshi Shimokawa
5 * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the acknowledgement as bellow:
19 * This product includes software developed by K. Kobayashi and H. Shimokawa
21 * 4. The name of the author may not be used to endorse or promote products
22 * derived from this software without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
25 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
28 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
40 #define DV_BROADCAST_ON (1<<30)
47 #if BYTE_ORDER == BIG_ENDIAN
48 uint8_t eoh0:1, /* 0 */
57 #if BYTE_ORDER == BIG_ENDIAN
69 #if BYTE_ORDER == BIG_ENDIAN
70 uint8_t eoh1:1, /* 1 */
78 #define CIP_FMT_DVCR 0
79 #define CIP_FMT_MPEG (1<<5)
82 #if BYTE_ORDER == BIG_ENDIAN
83 uint8_t fs:1, /* 50/60 field system
90 fs:1; /* 50/60 field system
93 #define CIP_STYPE_SD 0
94 #define CIP_STYPE_SDL 1
95 #define CIP_STYPE_HD 2
96 uint16_t cyc:16; /* take care of byte order! */
97 } __attribute__ ((packed)) dv;
103 #if BYTE_ORDER == BIG_ENDIAN
104 uint8_t sct:3, /* Section type */
106 arb:4; /* Arbitrary bit */
108 uint8_t arb:4, /* Arbitrary bit */
110 sct:3; /* Section type */
112 #define DV_SCT_HEADER 0
113 #define DV_SCT_SUBCODE 1
114 #define DV_SCT_VAUX 2
115 #define DV_SCT_AUDIO 3
116 #define DV_SCT_VIDEO 4
117 #if BYTE_ORDER == BIG_ENDIAN
118 uint8_t dseq:4, /* DIF sequence number */
119 fsc:1, /* ID of a DIF block in each channel */
123 fsc:1, /* ID of a DIF block in each channel */
124 dseq:4; /* DIF sequence number */
126 uint8_t dbn; /* DIF block number */
128 #define DV_DSF_12 0x80 /* PAL: payload[0] in Header DIF */