259是什么意思| 19点是什么时辰| 性早熟有什么危害| 沈字五行属什么| 女人后脑勺出汗多是什么原因| 田螺吃什么食物| 总胆红素偏高吃什么药| 淋巴净排是什么服务| 1968年属什么生肖| 10.17是什么星座| 什么是霉菌| 果可以加什么偏旁| 孙武和孙膑是什么关系| hr是什么单位| 美缝剂什么牌子的好| 子宫回声欠均匀是什么意思| agoni什么意思| 政委是什么军衔| 房间放什么可以驱蜈蚣| 皮蛋与什么食物相克| 鸡炖什么好吃又有营养| 意外是什么意思| 肠道紊乱吃什么药| 娃儿发烧用什么方法退烧快| 玮是什么意思| 儿童病毒感染吃什么药| 大便带血丝是什么原因| 女生为什么喊你男神| 挂钟挂在客厅什么位置好| 什么是沉没成本| 爱被蚊子咬是什么原因| 皮肤发痒用什么药| 尿激酶的作用及功效是什么| 屈打成招是什么意思| 行经是什么意思| 程字五行属什么| 盐酸利多卡因注射作用是什么| 阿达是什么意思| tb是什么意思| 10月31日什么星座| 乔迁送什么| 青柑是什么| 为什么老是抽筋| 地下党是什么意思| 玉米炒什么好吃| 印度人信仰什么教| 辛属什么五行| 7月7日是什么纪念日| 夏天吃什么菜好| 月老叫什么名字| hscrp高是什么感染| sb是什么元素符号| 顽疾是什么意思| 为什么叫基围虾| 肺结核的痰是什么颜色| 酸菜鱼是什么地方的菜| 小孩什么时候说话| 屈髋是什么姿势| 嚷能组什么词| 电气火灾用什么灭火器| 谷丙转氨酶偏高吃什么好| 脾肾亏虚的症状是什么| 为什么会阳痿| 75年属什么生肖| 帝加口念什么| 栀子花什么时候修剪| 子是什么属性| cp是什么意思| 阴道瘙痒是什么原因造成的| 柠檬黄配什么颜色好看| 五月十九日是什么星座| 什么样的礼物| 至加秦是什么字| 三维重建是什么意思| 脚气是什么菌| 鸡蛋和什么搭配最营养| 慢性前列腺炎有什么症状| 今年80岁属什么生肖| 淋巴结肿大是什么样子| 亭台楼阁是什么意思| 气管炎吃什么药| 蓝牙耳机什么样的好| 高血压二级是什么意思| 荷叶又什么又什么| 锦纶是什么面料优缺点| 荆芥俗名叫什么| 18k金和24k金有什么区别| 折耳猫什么颜色最贵| 上睑下垂是什么原因造成的| 喝醋有什么作用与功效| 叔叔的儿子叫什么| 咖喱是什么做的| 巨蟹座女生喜欢什么样的男生| 散光是什么原因造成的| 过山风是什么蛇| 眼花是什么原因| 水瓶座与什么星座最配| 膝盖疼是什么原因| 二刷是什么意思| 化妆的步骤是什么顺序| 胃绞疼是什么原因| 火车票改签是什么意思| 康妇炎胶囊主治什么| 口渴喝什么最解渴| 为什么今年有两个6月| 恶心反胃吃什么药| 下眼皮跳动是什么原因| 鸡和什么相冲| 21什么意思| 老鼠和什么属相相冲| 透析是什么| 荔枝肉是什么菜系| 脂肪肝吃什么中成药| 白色舌苔厚是什么原因| 什么是ct检查| 拉肚子肚子疼吃什么药| 病人化疗期间吃什么好| 叶倩文属什么生肖| 生日派对是什么意思| 熟的反义词是什么| 爱的反义词是什么| 肚子一直响是什么原因| 手指伸不直是什么原因| 斑秃是什么原因| 脚底发麻是什么原因| 什么食物含铁| 脸上脂溢性皮炎用什么药| 射手后面的星座是什么| 什么是无氧运动| 盗汗吃什么药效果最快| 什么是精索静脉曲张| 脸很黄是什么原因| 涅盘什么意思| 一直干咳是什么原因| 肾在什么位置图片| 夫妻是什么意思| 什么是重生| 中国最大的海是什么海| 慢性咽炎挂什么科| 哟西哟西什么意思| 九知道指的是什么| 献血后吃什么补血最快| 脑出血什么症状| o2o模式是什么意思| 大便潜血弱阳性是什么原因| 维生素b4又叫什么| 吃得苦中苦方为人上人是什么意思| 什么样的刘胡兰| 菠菜什么季节吃| cdc是什么| 糖宝是什么虫| 野是什么意思| 一生辛苦不得财是什么生肖| 丞字五行属什么| 为什么外阴老是长疖子| 尿常规查什么| 肌腱炎吃什么药| 结痂什么意思| 拔牙吃什么消炎药好| 蛇什么时候出来活动| 什么人不能喝绿豆汤| 什么夫妻百事哀| tc是什么意思| svc是什么意思| 五指毛桃有什么作用| 医学生规培是什么意思| 五月一日是什么节日| 出汗多吃什么| 职位是什么意思| 茯苓有什么作用和功效| 只出不进什么意思| 宝宝上颚有白点是什么| 翌日是什么意思| 消停是什么意思| 出汗是什么原因| 全身检查要挂什么科| 男人占有欲强说明什么| 月经不调吃什么| 长相厮守是什么意思| 蟾宫是什么意思| 红光对皮肤有什么作用| 舌头不舒服是什么原因引起的| 什么时候进伏| 耐药菌感染什么意思| 心脏不大是什么意思| 中午12点到1点是什么时辰| 荨麻疹有什么忌口吗| 诸葛亮属相是什么生肖| 没落是什么意思| 有两把刷子是什么意思| 常吃黑芝麻有什么好处和坏处| 生物包括什么| 呃呃是什么意思| 敕令是什么意思| 火麻是什么植物| 摆渡人什么意思| 看胸部挂什么科| 打灰是什么意思| 糖醇是什么意思| 合肥以前叫什么| 三查八对的内容是什么| 汉武帝叫什么| 近视什么意思| 嘴唇上有痣代表什么| 未来的未多一横念什么| 尿胆素1十是什么意思| 吃枸杞有什么功效| 排骨炖什么| 白带发黄是什么原因引起的| 为什么身体没力气也没有精神| o型血孩子父母是什么血型| 蜈蚣为什么不能打死| 女命劫财代表什么| 抗凝药是什么意思| 体温偏高的人说明什么| 梦见红枣树上结满红枣代表什么| 血压低吃什么东西好| 丝瓜不可以和什么一起吃| 妈妈的表妹叫什么| 14数字代表什么意思| 六月二十八是什么日子| 空腹吃荔枝有什么危害| 冤家路窄是什么生肖| 蛇吐信子是什么意思| 立夏有什么习俗| 5公里25分钟什么水平| 什么是211大学| 小孩打嗝是什么原因| 浅紫色配什么颜色好看| o型血不能和什么血型的人生孩子| 膀胱冲洗用什么药| 焯水是什么意思| 大蒜吃多了有什么坏处| 在此是什么意思| 桃对什么| mf是什么| 预测是什么意思| 孤帆远影碧空尽的尽是什么意思| 阴阳调和是什么意思| 内内是什么意思| 老巫婆是什么意思| 煮黑豆吃有什么功效| 过生日送什么礼物| 番茄酱和番茄沙司有什么区别| 什么动物不睡觉| 左肾肾盂分离什么意思| 大人积食吃什么药| 怀孕有什么感觉| 湿热吃什么中成药| 财源广进是什么生肖| 为什么会突然耳鸣| uw是什么单位| 广义货币m2是什么意思| 明年属什么生肖| 打桩是什么意思| 宝宝经常发烧是什么原因引起的| 肺结核钙化是什么意思| 蜂蜡有什么用| 浮肿是什么原因| plus什么意思| 蠼螋对人有什么危害| 大腿根内侧发黑是什么原因| 王白读什么| 条条框框是什么意思| 百度

全国禁毒科普教育展览项目公示


Directory: ../../../ffmpeg/
File: src/libavformat/cinedec.c
Date: 2025-08-04 00:43:16
Exec Total Coverage
Lines: 125 204 61.3%
Functions: 5 6 83.3%
Branches: 45 120 37.5%

Line Branch Exec Source
1 /*
2 * Phantom Cine demuxer
3 * Copyright (c) 2010-2011 Peter Ross <pross@xvid.org>
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 /**
23 * @file
24 * Phantom Cine demuxer
25 * @author Peter Ross <pross@xvid.org>
26 */
27
28 #include "libavutil/intreadwrite.h"
29 #include "libavutil/mem.h"
30 #include "libavcodec/bmp.h"
31 #include "libavutil/intfloat.h"
32 #include "avformat.h"
33 #include "demux.h"
34 #include "internal.h"
35
36 typedef struct {
37 uint64_t pts;
38 uint64_t maxsize;
39 } CineDemuxContext;
40
41 /** Compression */
42 enum {
43 CC_RGB = 0, /**< Gray */
44 CC_LEAD = 1, /**< LEAD (M)JPEG */
45 CC_UNINT = 2 /**< Uninterpolated color image (CFA field indicates color ordering) */
46 };
47
48 /** Color Filter Array */
49 enum {
50 CFA_NONE = 0, /**< GRAY */
51 CFA_VRI = 1, /**< GBRG/RGGB */
52 CFA_VRIV6 = 2, /**< BGGR/GRBG */
53 CFA_BAYER = 3, /**< GB/RG */
54 CFA_BAYERFLIP = 4, /**< RG/GB */
55 CFA_BAYERFLIPB = 5, /**< GR/BG */
56 CFA_BAYERFLIPH = 6, /**< BG/GR */
57 };
58
59 #define CFA_TLGRAY 0x80000000U
60 #define CFA_TRGRAY 0x40000000U
61 #define CFA_BLGRAY 0x20000000U
62 #define CFA_BRGRAY 0x10000000U
63
64 7241 static int cine_read_probe(const AVProbeData *p)
65 {
66 int HeaderSize;
67
4/4
✓ Branch 0 taken 9 times.
✓ Branch 1 taken 7232 times.
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 8 times.
7241 if (p->buf[0] == 'C' && p->buf[1] == 'I' && // Type
68
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 (HeaderSize = AV_RL16(p->buf + 2)) >= 0x2C && // HeaderSize
69
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 AV_RL16(p->buf + 4) <= CC_UNINT && // Compression
70
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 AV_RL16(p->buf + 6) <= 1 && // Version
71
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 AV_RL32(p->buf + 20) && // ImageCount
72
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 AV_RL32(p->buf + 24) >= HeaderSize && // OffImageHeader
73
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 AV_RL32(p->buf + 28) >= HeaderSize && // OffSetup
74
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 AV_RL32(p->buf + 32) >= HeaderSize) // OffImageOffsets
75 1 return AVPROBE_SCORE_MAX;
76 7240 return 0;
77 }
78
79 13 static int set_metadata_int(AVDictionary **dict, const char *key, int value, int allow_zero)
80 {
81
3/4
✓ Branch 0 taken 8 times.
✓ Branch 1 taken 5 times.
✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
13 if (value || allow_zero) {
82 13 return av_dict_set_int(dict, key, value, 0);
83 }
84 return 0;
85 }
86
87 2 static int set_metadata_float(AVDictionary **dict, const char *key, float value, int allow_zero)
88 {
89
1/4
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
2 if (value != 0 || allow_zero) {
90 char tmp[64];
91 2 snprintf(tmp, sizeof(tmp), "%f", value);
92 2 return av_dict_set(dict, key, tmp, 0);
93 }
94 return 0;
95 }
96
97 1 static int cine_read_header(AVFormatContext *avctx)
98 {
99 1 AVIOContext *pb = avctx->pb;
100 AVStream *st;
101 unsigned int version, compression, offImageHeader, offSetup, offImageOffsets, biBitCount, length, CFA;
102 int vflip;
103 char *description;
104 uint64_t i;
105
106 1 st = avformat_new_stream(avctx, NULL);
107
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 if (!st)
108 return AVERROR(ENOMEM);
109 1 st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
110 1 st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO;
111 1 st->codecpar->codec_tag = 0;
112
113 /* CINEFILEHEADER structure */
114 1 avio_skip(pb, 4); // Type, Headersize
115
116 1 compression = avio_rl16(pb);
117 1 version = avio_rl16(pb);
118
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 if (version != 1) {
119 avpriv_request_sample(avctx, "unknown version %i", version);
120 return AVERROR_INVALIDDATA;
121 }
122
123 1 avio_skip(pb, 12); // FirstMovieImage, TotalImageCount, FirstImageNumber
124
125 1 st->duration = avio_rl32(pb);
126 1 offImageHeader = avio_rl32(pb);
127 1 offSetup = avio_rl32(pb);
128 1 offImageOffsets = avio_rl32(pb);
129
130 1 avio_skip(pb, 8); // TriggerTime
131
132 /* BITMAPINFOHEADER structure */
133 1 avio_seek(pb, offImageHeader, SEEK_SET);
134 1 avio_skip(pb, 4); //biSize
135 1 st->codecpar->width = avio_rl32(pb);
136 1 st->codecpar->height = avio_rl32(pb);
137
138
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (avio_rl16(pb) != 1) // biPlanes
139 return AVERROR_INVALIDDATA;
140
141 1 biBitCount = avio_rl16(pb);
142
1/8
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
1 if (biBitCount != 8 && biBitCount != 16 && biBitCount != 24 && biBitCount != 48) {
143 avpriv_request_sample(avctx, "unsupported biBitCount %i", biBitCount);
144 return AVERROR_INVALIDDATA;
145 }
146
147
1/3
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
1 switch (avio_rl32(pb)) {
148 1 case BMP_RGB:
149 1 vflip = 0;
150 1 break;
151 case 0x100: /* BI_PACKED */
152 st->codecpar->codec_tag = MKTAG('B', 'I', 'T', 0);
153 vflip = 1;
154 break;
155 default:
156 avpriv_request_sample(avctx, "unknown bitmap compression");
157 return AVERROR_INVALIDDATA;
158 }
159
160 1 avio_skip(pb, 4); // biSizeImage
161
162 /* parse SETUP structure */
163 1 avio_seek(pb, offSetup, SEEK_SET);
164 1 avio_skip(pb, 140); // FrameRatae16 .. descriptionOld
165
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
1 if (avio_rl16(pb) != 0x5453)
166 return AVERROR_INVALIDDATA;
167 1 length = avio_rl16(pb);
168
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 if (length < 0x163C) {
169 avpriv_request_sample(avctx, "short SETUP header");
170 return AVERROR_INVALIDDATA;
171 }
172
173 1 avio_skip(pb, 616); // Binning .. bFlipH
174
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 if (!avio_rl32(pb) ^ vflip) {
175 1 st->codecpar->extradata = av_strdup("BottomUp");
176
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 if (!st->codecpar->extradata) {
177 st->codecpar->extradata_size = 0;
178 return AVERROR(ENOMEM);
179 }
180 1 st->codecpar->extradata_size = 9;
181 }
182
183 1 avio_skip(pb, 4); // Grid
184
185 1 avpriv_set_pts_info(st, 64, 1, avio_rl32(pb));
186
187 1 avio_skip(pb, 20); // Shutter .. bEnableColor
188
189 1 set_metadata_int(&st->metadata, "camera_version", avio_rl32(pb), 0);
190 1 set_metadata_int(&st->metadata, "firmware_version", avio_rl32(pb), 0);
191 1 set_metadata_int(&st->metadata, "software_version", avio_rl32(pb), 0);
192 1 set_metadata_int(&st->metadata, "recording_timezone", avio_rl32(pb), 0);
193
194 1 CFA = avio_rl32(pb);
195
196 1 set_metadata_int(&st->metadata, "brightness", avio_rl32(pb), 1);
197 1 set_metadata_int(&st->metadata, "contrast", avio_rl32(pb), 1);
198 1 set_metadata_int(&st->metadata, "gamma", avio_rl32(pb), 1);
199
200 1 avio_skip(pb, 12 + 16); // Reserved1 .. AutoExpRect
201 1 set_metadata_float(&st->metadata, "wbgain[0].r", av_int2float(avio_rl32(pb)), 1);
202 1 set_metadata_float(&st->metadata, "wbgain[0].b", av_int2float(avio_rl32(pb)), 1);
203 1 avio_skip(pb, 36); // WBGain[1].. WBView
204
205 1 st->codecpar->bits_per_coded_sample = avio_rl32(pb);
206
207
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 if (compression == CC_RGB) {
208 if (biBitCount == 8) {
209 st->codecpar->format = AV_PIX_FMT_GRAY8;
210 } else if (biBitCount == 16) {
211 st->codecpar->format = AV_PIX_FMT_GRAY16LE;
212 } else if (biBitCount == 24) {
213 st->codecpar->format = AV_PIX_FMT_BGR24;
214 } else if (biBitCount == 48) {
215 st->codecpar->format = AV_PIX_FMT_BGR48LE;
216 } else {
217 avpriv_request_sample(avctx, "unsupported biBitCount %i", biBitCount);
218 return AVERROR_INVALIDDATA;
219 }
220
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 } else if (compression == CC_UNINT) {
221
1/5
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
1 switch (CFA & 0xFFFFFF) {
222 1 case CFA_BAYER:
223
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 if (biBitCount == 8) {
224 1 st->codecpar->format = AV_PIX_FMT_BAYER_GBRG8;
225 } else if (biBitCount == 16) {
226 st->codecpar->format = AV_PIX_FMT_BAYER_GBRG16LE;
227 } else {
228 avpriv_request_sample(avctx, "unsupported biBitCount %i", biBitCount);
229 return AVERROR_INVALIDDATA;
230 }
231 1 break;
232 case CFA_BAYERFLIP:
233 if (biBitCount == 8) {
234 st->codecpar->format = AV_PIX_FMT_BAYER_RGGB8;
235 } else if (biBitCount == 16) {
236 st->codecpar->format = AV_PIX_FMT_BAYER_RGGB16LE;
237 } else {
238 avpriv_request_sample(avctx, "unsupported biBitCount %i", biBitCount);
239 return AVERROR_INVALIDDATA;
240 }
241 break;
242 case CFA_BAYERFLIPB:
243 if (biBitCount == 8) {
244 st->codecpar->format = AV_PIX_FMT_BAYER_GRBG8;
245 } else if (biBitCount == 16) {
246 st->codecpar->format = AV_PIX_FMT_BAYER_GRBG16LE;
247 } else {
248 avpriv_request_sample(avctx, "unsupported biBitCount %i", biBitCount);
249 return AVERROR_INVALIDDATA;
250 }
251 break;
252 case CFA_BAYERFLIPH:
253 if (biBitCount == 8) {
254 st->codecpar->format = AV_PIX_FMT_BAYER_BGGR8;
255 } else if (biBitCount == 16) {
256 st->codecpar->format = AV_PIX_FMT_BAYER_BGGR16LE;
257 } else {
258 avpriv_request_sample(avctx, "unsupported biBitCount %i", biBitCount);
259 return AVERROR_INVALIDDATA;
260 }
261 break;
262 default:
263 avpriv_request_sample(avctx, "unsupported Color Field Array (CFA) %i", CFA & 0xFFFFFF);
264 return AVERROR_INVALIDDATA;
265 }
266 } else { //CC_LEAD
267 avpriv_request_sample(avctx, "unsupported compression %i", compression);
268 return AVERROR_INVALIDDATA;
269 }
270
271 1 avio_skip(pb, 668); // Conv8Min ... Sensor
272
273 1 set_metadata_int(&st->metadata, "shutter_ns", avio_rl32(pb), 0);
274
275 1 avio_skip(pb, 24); // EDRShutterNs ... ImHeightAcq
276
277 #define DESCRIPTION_SIZE 4096
278 1 description = av_malloc(DESCRIPTION_SIZE + 1);
279
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 if (!description)
280 return AVERROR(ENOMEM);
281 1 i = avio_get_str(pb, DESCRIPTION_SIZE, description, DESCRIPTION_SIZE + 1);
282
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 if (i < DESCRIPTION_SIZE)
283 1 avio_skip(pb, DESCRIPTION_SIZE - i);
284
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
1 if (description[0])
285 av_dict_set(&st->metadata, "description", description, AV_DICT_DONT_STRDUP_VAL);
286 else
287 1 av_free(description);
288
289 1 avio_skip(pb, 1176); // RisingEdge ... cmUser
290
291 1 set_metadata_int(&st->metadata, "enable_crop", avio_rl32(pb), 1);
292 1 set_metadata_int(&st->metadata, "crop_left", avio_rl32(pb), 1);
293 1 set_metadata_int(&st->metadata, "crop_top", avio_rl32(pb), 1);
294 1 set_metadata_int(&st->metadata, "crop_right", avio_rl32(pb), 1);
295 1 set_metadata_int(&st->metadata, "crop_bottom", avio_rl32(pb), 1);
296
297 /* parse image offsets */
298 1 avio_seek(pb, offImageOffsets, SEEK_SET);
299
2/2
✓ Branch 0 taken 100 times.
✓ Branch 1 taken 1 times.
101 for (i = 0; i < st->duration; i++) {
300 100 int64_t pos = avio_rl64(pb);
301
2/4
✓ Branch 1 taken 100 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 100 times.
100 if (avio_feof(pb) || pos < 0)
302 return AVERROR_INVALIDDATA;
303
304 100 av_add_index_entry(st, pos, i, 0, 0, AVINDEX_KEYFRAME);
305 }
306
307 1 return 0;
308 }
309
310 4 static int cine_read_packet(AVFormatContext *avctx, AVPacket *pkt)
311 {
312 4 CineDemuxContext *cine = avctx->priv_data;
313 4 AVStream *st = avctx->streams[0];
314 4 FFStream *const sti = ffstream(st);
315 4 AVIOContext *pb = avctx->pb;
316 int n, size, ret;
317 int64_t ret64;
318
319
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
4 if (cine->pts >= sti->nb_index_entries)
320 return AVERROR_EOF;
321
322 4 ret64 = avio_seek(pb, sti->index_entries[cine->pts].pos, SEEK_SET);
323
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
4 if (ret64 < 0)
324 return ret64;
325 4 n = avio_rl32(pb);
326
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 2 times.
4 if (n < 8)
327 2 return AVERROR_INVALIDDATA;
328 2 avio_skip(pb, n - 8);
329 2 size = avio_rl32(pb);
330
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
2 if (avio_feof(pb) || size < 0)
331 return AVERROR_INVALIDDATA;
332
333
1/4
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
2 if (cine->maxsize && (uint64_t)sti->index_entries[cine->pts].pos + size + n > cine->maxsize)
334 size = cine->maxsize - sti->index_entries[cine->pts].pos - n;
335
336 2 ret = av_get_packet(pb, pkt, size);
337
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 if (ret < 0)
338 return ret;
339
340
2/2
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 1 times.
2 if (ret != size)
341 1 cine->maxsize = (uint64_t)sti->index_entries[cine->pts].pos + n + ret;
342
343 2 pkt->pts = cine->pts++;
344 2 pkt->stream_index = 0;
345 2 pkt->flags |= AV_PKT_FLAG_KEY;
346 2 return 0;
347 }
348
349 static int cine_read_seek(AVFormatContext *avctx, int stream_index, int64_t timestamp, int flags)
350 {
351 CineDemuxContext *cine = avctx->priv_data;
352
353 if ((flags & AVSEEK_FLAG_FRAME) || (flags & AVSEEK_FLAG_BYTE))
354 return AVERROR(ENOSYS);
355
356 if (!(avctx->pb->seekable & AVIO_SEEKABLE_NORMAL))
357 return AVERROR(EIO);
358
359 cine->pts = timestamp;
360 return 0;
361 }
362
363 const FFInputFormat ff_cine_demuxer = {
364 .p.name = "cine",
365 .p.long_name = NULL_IF_CONFIG_SMALL("Phantom Cine"),
366 .priv_data_size = sizeof(CineDemuxContext),
367 .read_probe = cine_read_probe,
368 .read_header = cine_read_header,
369 .read_packet = cine_read_packet,
370 .read_seek = cine_read_seek,
371 };
372

山根有痣代表什么 哮喘吃什么食物好 宫颈管短有什么症状 硬核是什么意思 嘴唇起泡是什么原因引起的
农历六月初四是什么日子 jimmychoo是什么牌子 激素吃多了对身体有什么副作用 主见是什么意思 咳嗽痰多是什么原因
花非花雾非雾什么意思 长方形脸适合什么发型 essence什么意思 尿液浑浊是什么原因 打嗝和嗳气有什么区别
什么是格言 结膜出血用什么眼药水 褐色分泌物是什么原因引起的 反乌托邦是什么意思 在家无聊可以干什么
对象是什么意思dajiketang.com 手脚抽筋是什么原因引起的bjhyzcsm.com 宫颈炎是什么hcv8jop0ns3r.cn 福瑞祥和是什么意思hcv7jop9ns9r.cn 目翳是什么意思hcv9jop8ns1r.cn
心脏早搏吃什么药效果好hcv7jop9ns6r.cn 牛黄是什么hcv9jop0ns0r.cn 禅师是什么意思naasee.com 子宫肌瘤是什么原因引起的shenchushe.com 什么叫cdhcv8jop6ns1r.cn
南瓜什么人不能吃chuanglingweilai.com 为什么不能天天做有氧运动sanhestory.com 白带黄绿是什么原因hcv9jop0ns3r.cn 什么是皮肤病hcv9jop1ns9r.cn b细胞是什么hcv9jop4ns4r.cn
漏尿是什么原因造成的0735v.com 地图舌是什么原因引起的xinjiangjialails.com 肝火胃火旺盛吃什么药hcv9jop1ns7r.cn 什么教导hcv7jop9ns7r.cn 宝宝尿少是什么原因hcv9jop4ns8r.cn
百度