1/* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at: 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17/* 18 * proto files are used for Structure Aware fuzzing so that fuzzing can be 19 * made more effective. 20 * timedtext_fuzz.proto is used to declare structures, which are used 21 * purely inside timedtext_fuzzer. 22 */ 23 24syntax = "proto3"; 25 26enum Flag { 27 flag3gppglobal = 0; 28 flag3gpplocal = 1; 29 flagsrtlocal = 2; 30} 31 32enum ChunkType { 33 default = 0; 34 tx3g = 1954034535; 35 styl = 1937013100; 36 krok = 1802661739; 37 hlit = 1751935348; 38 hclr = 1751346290; 39 dlay = 1684824441; 40 href = 1752327526; 41 tbox = 1952608120; 42 blnk = 1651273323; 43 txrp = 1953985136; 44} 45 46message FontRecord { 47 uint32 fontId = 1; 48 repeated uint32 font = 2; 49} 50 51message SRTLocal { 52 repeated uint32 data = 1; 53} 54 55message GPPGlobal { 56 uint64 reservedBytes = 1; 57 uint32 displayFlags = 2; 58 int32 horizontal_vertical_justification = 3; 59 uint32 rgba = 4; 60 int32 textBox = 5; 61 uint32 styleRecordStart = 6; 62 uint32 fontId = 7; 63 uint32 fontStyle = 8; 64 uint32 entryCount = 9; 65 repeated FontRecord fontEntry = 10; 66 uint32 defaultDisparity = 11; 67} 68 69message StyleRecord { 70 uint32 startchar = 1; 71 uint32 font = 2; 72 uint32 rgba = 3; 73} 74 75message TextStyleBox { 76 uint32 count = 1; 77 repeated StyleRecord record = 2; 78} 79 80message HighlightBox { 81 uint32 start = 1; 82 uint32 end = 2; 83} 84 85message HighlightColor { 86 uint32 rgba = 1; 87} 88 89message TextKaraokeBox { 90 uint32 highlightStartTime = 1; 91 uint32 entryCount = 2; 92 repeated uint64 highlightData = 3; 93} 94 95message BoxRecord { 96 uint32 topleft = 1; 97 uint32 bottomright = 2; 98} 99 100message BlinkBox { 101 uint32 charoffset = 1; 102} 103 104message HyperTextBox { 105 uint32 charoffset = 1; 106 uint32 urlLength = 2; 107 repeated uint32 url = 3; 108 uint32 altLength = 4; 109 repeated uint32 altString = 5; 110} 111 112message GPPLocalText { 113 string text = 1; 114} 115 116message GPPLocalFormat { 117 uint64 reservedBytes = 1; 118 oneof formatStyle { 119 TextStyleBox textbox = 2; 120 HighlightBox hltbox = 3; 121 HighlightColor hltcolor = 4; 122 TextKaraokeBox krokbox = 5; 123 uint32 scrollDelay = 6; 124 HyperTextBox hrefBox = 7; 125 BoxRecord boxrecord = 8; 126 BlinkBox blinkBox = 9; 127 uint32 wrapFlag = 10; 128 } 129} 130 131message GPPLocal { 132 GPPLocalText localtext = 1; 133 GPPLocalFormat format = 2; 134} 135 136message TimedText { 137 Flag handle = 1; 138 int32 timeMs = 2; 139 SRTLocal srt = 3; 140 GPPGlobal global = 4; 141 GPPLocal local = 5; 142} 143