dv.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  1. /*
  2. * General DV muxer/demuxer
  3. * Copyright (c) 2003 Roman Shaposhnik
  4. *
  5. * Many thanks to Dan Dennedy <dan@dennedy.org> for providing wealth
  6. * of DV technical info.
  7. *
  8. * Raw DV format
  9. * Copyright (c) 2002 Fabrice Bellard
  10. *
  11. * 50 Mbps (DVCPRO50) and 100 Mbps (DVCPRO HD) support
  12. * Copyright (c) 2006 Daniel Maas <dmaas@maasdigital.com>
  13. * Funded by BBC Research & Development
  14. *
  15. * This file is part of FFmpeg.
  16. *
  17. * FFmpeg is free software; you can redistribute it and/or
  18. * modify it under the terms of the GNU Lesser General Public
  19. * License as published by the Free Software Foundation; either
  20. * version 2.1 of the License, or (at your option) any later version.
  21. *
  22. * FFmpeg is distributed in the hope that it will be useful,
  23. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  25. * Lesser General Public License for more details.
  26. *
  27. * You should have received a copy of the GNU Lesser General Public
  28. * License along with FFmpeg; if not, write to the Free Software
  29. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  30. */
  31. #include <time.h>
  32. #include "avformat.h"
  33. #include "internal.h"
  34. #include "libavcodec/dv_profile.h"
  35. #include "libavcodec/dvdata.h"
  36. #include "libavutil/intreadwrite.h"
  37. #include "libavutil/mathematics.h"
  38. #include "libavutil/timecode.h"
  39. #include "dv.h"
  40. #include "libavutil/avassert.h"
  41. struct DVDemuxContext {
  42. const DVprofile* sys; /* Current DV profile. E.g.: 525/60, 625/50 */
  43. AVFormatContext* fctx;
  44. AVStream* vst;
  45. AVStream* ast[4];
  46. AVPacket audio_pkt[4];
  47. uint8_t audio_buf[4][8192];
  48. int ach;
  49. int frames;
  50. uint64_t abytes;
  51. };
  52. static inline uint16_t dv_audio_12to16(uint16_t sample)
  53. {
  54. uint16_t shift, result;
  55. sample = (sample < 0x800) ? sample : sample | 0xf000;
  56. shift = (sample & 0xf00) >> 8;
  57. if (shift < 0x2 || shift > 0xd) {
  58. result = sample;
  59. } else if (shift < 0x8) {
  60. shift--;
  61. result = (sample - (256 * shift)) << shift;
  62. } else {
  63. shift = 0xe - shift;
  64. result = ((sample + ((256 * shift) + 1)) << shift) - 1;
  65. }
  66. return result;
  67. }
  68. /*
  69. * This is the dumbest implementation of all -- it simply looks at
  70. * a fixed offset and if pack isn't there -- fails. We might want
  71. * to have a fallback mechanism for complete search of missing packs.
  72. */
  73. static const uint8_t* dv_extract_pack(uint8_t* frame, enum dv_pack_type t)
  74. {
  75. int offs;
  76. switch (t) {
  77. case dv_audio_source:
  78. offs = (80*6 + 80*16*3 + 3);
  79. break;
  80. case dv_audio_control:
  81. offs = (80*6 + 80*16*4 + 3);
  82. break;
  83. case dv_video_control:
  84. offs = (80*5 + 48 + 5);
  85. break;
  86. case dv_timecode:
  87. offs = (80*1 + 3 + 3);
  88. break;
  89. default:
  90. return NULL;
  91. }
  92. return frame[offs] == t ? &frame[offs] : NULL;
  93. }
  94. static const int dv_audio_frequency[3] = {
  95. 48000, 44100, 32000,
  96. };
  97. /*
  98. * There's a couple of assumptions being made here:
  99. * 1. By default we silence erroneous (0x8000/16bit 0x800/12bit) audio samples.
  100. * We can pass them upwards when libavcodec will be ready to deal with them.
  101. * 2. We don't do software emphasis.
  102. * 3. Audio is always returned as 16bit linear samples: 12bit nonlinear samples
  103. * are converted into 16bit linear ones.
  104. */
  105. static int dv_extract_audio(uint8_t* frame, uint8_t* ppcm[4],
  106. const DVprofile *sys)
  107. {
  108. int size, chan, i, j, d, of, smpls, freq, quant, half_ch;
  109. uint16_t lc, rc;
  110. const uint8_t* as_pack;
  111. uint8_t *pcm, ipcm;
  112. as_pack = dv_extract_pack(frame, dv_audio_source);
  113. if (!as_pack) /* No audio ? */
  114. return 0;
  115. smpls = as_pack[1] & 0x3f; /* samples in this frame - min. samples */
  116. freq = (as_pack[4] >> 3) & 0x07; /* 0 - 48kHz, 1 - 44,1kHz, 2 - 32kHz */
  117. quant = as_pack[4] & 0x07; /* 0 - 16bit linear, 1 - 12bit nonlinear */
  118. if (quant > 1)
  119. return -1; /* unsupported quantization */
  120. if (freq >= FF_ARRAY_ELEMS(dv_audio_frequency))
  121. return AVERROR_INVALIDDATA;
  122. size = (sys->audio_min_samples[freq] + smpls) * 4; /* 2ch, 2bytes */
  123. half_ch = sys->difseg_size / 2;
  124. /* We work with 720p frames split in half, thus even frames have
  125. * channels 0,1 and odd 2,3. */
  126. ipcm = (sys->height == 720 && !(frame[1] & 0x0C)) ? 2 : 0;
  127. /* for each DIF channel */
  128. for (chan = 0; chan < sys->n_difchan; chan++) {
  129. av_assert0(ipcm<4);
  130. pcm = ppcm[ipcm++];
  131. if (!pcm)
  132. break;
  133. /* for each DIF segment */
  134. for (i = 0; i < sys->difseg_size; i++) {
  135. frame += 6 * 80; /* skip DIF segment header */
  136. if (quant == 1 && i == half_ch) {
  137. /* next stereo channel (12bit mode only) */
  138. av_assert0(ipcm<4);
  139. pcm = ppcm[ipcm++];
  140. if (!pcm)
  141. break;
  142. }
  143. /* for each AV sequence */
  144. for (j = 0; j < 9; j++) {
  145. for (d = 8; d < 80; d += 2) {
  146. if (quant == 0) { /* 16bit quantization */
  147. of = sys->audio_shuffle[i][j] + (d - 8) / 2 * sys->audio_stride;
  148. if (of*2 >= size)
  149. continue;
  150. pcm[of*2] = frame[d+1]; // FIXME: maybe we have to admit
  151. pcm[of*2+1] = frame[d]; // that DV is a big-endian PCM
  152. if (pcm[of*2+1] == 0x80 && pcm[of*2] == 0x00)
  153. pcm[of*2+1] = 0;
  154. } else { /* 12bit quantization */
  155. lc = ((uint16_t)frame[d] << 4) |
  156. ((uint16_t)frame[d+2] >> 4);
  157. rc = ((uint16_t)frame[d+1] << 4) |
  158. ((uint16_t)frame[d+2] & 0x0f);
  159. lc = (lc == 0x800 ? 0 : dv_audio_12to16(lc));
  160. rc = (rc == 0x800 ? 0 : dv_audio_12to16(rc));
  161. of = sys->audio_shuffle[i%half_ch][j] + (d - 8) / 3 * sys->audio_stride;
  162. if (of*2 >= size)
  163. continue;
  164. pcm[of*2] = lc & 0xff; // FIXME: maybe we have to admit
  165. pcm[of*2+1] = lc >> 8; // that DV is a big-endian PCM
  166. of = sys->audio_shuffle[i%half_ch+half_ch][j] +
  167. (d - 8) / 3 * sys->audio_stride;
  168. pcm[of*2] = rc & 0xff; // FIXME: maybe we have to admit
  169. pcm[of*2+1] = rc >> 8; // that DV is a big-endian PCM
  170. ++d;
  171. }
  172. }
  173. frame += 16 * 80; /* 15 Video DIFs + 1 Audio DIF */
  174. }
  175. }
  176. }
  177. return size;
  178. }
  179. static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame)
  180. {
  181. const uint8_t* as_pack;
  182. int freq, stype, smpls, quant, i, ach;
  183. as_pack = dv_extract_pack(frame, dv_audio_source);
  184. if (!as_pack || !c->sys) { /* No audio ? */
  185. c->ach = 0;
  186. return 0;
  187. }
  188. smpls = as_pack[1] & 0x3f; /* samples in this frame - min. samples */
  189. freq = (as_pack[4] >> 3) & 0x07; /* 0 - 48kHz, 1 - 44,1kHz, 2 - 32kHz */
  190. stype = (as_pack[3] & 0x1f); /* 0 - 2CH, 2 - 4CH, 3 - 8CH */
  191. quant = as_pack[4] & 0x07; /* 0 - 16bit linear, 1 - 12bit nonlinear */
  192. if (freq >= FF_ARRAY_ELEMS(dv_audio_frequency)) {
  193. av_log(c->fctx, AV_LOG_ERROR,
  194. "Unrecognized audio sample rate index (%d)\n", freq);
  195. return 0;
  196. }
  197. if (stype > 3) {
  198. av_log(c->fctx, AV_LOG_ERROR, "stype %d is invalid\n", stype);
  199. c->ach = 0;
  200. return 0;
  201. }
  202. /* note: ach counts PAIRS of channels (i.e. stereo channels) */
  203. ach = ((int[4]){ 1, 0, 2, 4})[stype];
  204. if (ach == 1 && quant && freq == 2)
  205. ach = 2;
  206. /* Dynamic handling of the audio streams in DV */
  207. for (i = 0; i < ach; i++) {
  208. if (!c->ast[i]) {
  209. c->ast[i] = avformat_new_stream(c->fctx, NULL);
  210. if (!c->ast[i])
  211. break;
  212. avpriv_set_pts_info(c->ast[i], 64, 1, 30000);
  213. c->ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO;
  214. c->ast[i]->codec->codec_id = CODEC_ID_PCM_S16LE;
  215. av_init_packet(&c->audio_pkt[i]);
  216. c->audio_pkt[i].size = 0;
  217. c->audio_pkt[i].data = c->audio_buf[i];
  218. c->audio_pkt[i].stream_index = c->ast[i]->index;
  219. c->audio_pkt[i].flags |= AV_PKT_FLAG_KEY;
  220. }
  221. c->ast[i]->codec->sample_rate = dv_audio_frequency[freq];
  222. c->ast[i]->codec->channels = 2;
  223. c->ast[i]->codec->bit_rate = 2 * dv_audio_frequency[freq] * 16;
  224. c->ast[i]->start_time = 0;
  225. }
  226. c->ach = i;
  227. return (c->sys->audio_min_samples[freq] + smpls) * 4; /* 2ch, 2bytes */;
  228. }
  229. static int dv_extract_video_info(DVDemuxContext *c, uint8_t* frame)
  230. {
  231. const uint8_t* vsc_pack;
  232. AVCodecContext* avctx;
  233. int apt, is16_9;
  234. int size = 0;
  235. if (c->sys) {
  236. avctx = c->vst->codec;
  237. avpriv_set_pts_info(c->vst, 64, c->sys->time_base.num,
  238. c->sys->time_base.den);
  239. avctx->time_base= c->sys->time_base;
  240. /* finding out SAR is a little bit messy */
  241. vsc_pack = dv_extract_pack(frame, dv_video_control);
  242. apt = frame[4] & 0x07;
  243. is16_9 = (vsc_pack && ((vsc_pack[2] & 0x07) == 0x02 ||
  244. (!apt && (vsc_pack[2] & 0x07) == 0x07)));
  245. c->vst->sample_aspect_ratio = c->sys->sar[is16_9];
  246. avctx->bit_rate = av_rescale_q(c->sys->frame_size, (AVRational){8,1},
  247. c->sys->time_base);
  248. size = c->sys->frame_size;
  249. }
  250. return size;
  251. }
  252. static int dv_extract_timecode(DVDemuxContext* c, uint8_t* frame, char *tc)
  253. {
  254. const uint8_t *tc_pack;
  255. // For PAL systems, drop frame bit is replaced by an arbitrary
  256. // bit so its value should not be considered. Drop frame timecode
  257. // is only relevant for NTSC systems.
  258. int prevent_df = c->sys->ltc_divisor == 25 || c->sys->ltc_divisor == 50;
  259. tc_pack = dv_extract_pack(frame, dv_timecode);
  260. if (!tc_pack)
  261. return 0;
  262. av_timecode_make_smpte_tc_string(tc, AV_RB32(tc_pack + 1), prevent_df);
  263. return 1;
  264. }
  265. /*
  266. * The following 3 functions constitute our interface to the world
  267. */
  268. DVDemuxContext* avpriv_dv_init_demux(AVFormatContext *s)
  269. {
  270. DVDemuxContext *c;
  271. c = av_mallocz(sizeof(DVDemuxContext));
  272. if (!c)
  273. return NULL;
  274. c->vst = avformat_new_stream(s, NULL);
  275. if (!c->vst) {
  276. av_free(c);
  277. return NULL;
  278. }
  279. c->fctx = s;
  280. c->vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
  281. c->vst->codec->codec_id = CODEC_ID_DVVIDEO;
  282. c->vst->codec->bit_rate = 25000000;
  283. c->vst->start_time = 0;
  284. return c;
  285. }
  286. int avpriv_dv_get_packet(DVDemuxContext *c, AVPacket *pkt)
  287. {
  288. int size = -1;
  289. int i;
  290. for (i = 0; i < c->ach; i++) {
  291. if (c->ast[i] && c->audio_pkt[i].size) {
  292. *pkt = c->audio_pkt[i];
  293. c->audio_pkt[i].size = 0;
  294. size = pkt->size;
  295. break;
  296. }
  297. }
  298. return size;
  299. }
  300. int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
  301. uint8_t* buf, int buf_size, int64_t pos)
  302. {
  303. int size, i;
  304. uint8_t *ppcm[4] = {0};
  305. if (buf_size < DV_PROFILE_BYTES ||
  306. !(c->sys = avpriv_dv_frame_profile(c->sys, buf, buf_size)) ||
  307. buf_size < c->sys->frame_size) {
  308. return -1; /* Broken frame, or not enough data */
  309. }
  310. /* Queueing audio packet */
  311. /* FIXME: in case of no audio/bad audio we have to do something */
  312. size = dv_extract_audio_info(c, buf);
  313. for (i = 0; i < c->ach; i++) {
  314. c->audio_pkt[i].pos = pos;
  315. c->audio_pkt[i].size = size;
  316. c->audio_pkt[i].pts = c->abytes * 30000*8 / c->ast[i]->codec->bit_rate;
  317. ppcm[i] = c->audio_buf[i];
  318. }
  319. if (c->ach)
  320. dv_extract_audio(buf, ppcm, c->sys);
  321. /* We work with 720p frames split in half, thus even frames have
  322. * channels 0,1 and odd 2,3. */
  323. if (c->sys->height == 720) {
  324. if (buf[1] & 0x0C) {
  325. c->audio_pkt[2].size = c->audio_pkt[3].size = 0;
  326. } else {
  327. c->audio_pkt[0].size = c->audio_pkt[1].size = 0;
  328. c->abytes += size;
  329. }
  330. } else {
  331. c->abytes += size;
  332. }
  333. /* Now it's time to return video packet */
  334. size = dv_extract_video_info(c, buf);
  335. av_init_packet(pkt);
  336. pkt->data = buf;
  337. pkt->pos = pos;
  338. pkt->size = size;
  339. pkt->flags |= AV_PKT_FLAG_KEY;
  340. pkt->stream_index = c->vst->id;
  341. pkt->pts = c->frames;
  342. c->frames++;
  343. return size;
  344. }
  345. static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c,
  346. int64_t timestamp, int flags)
  347. {
  348. // FIXME: sys may be wrong if last dv_read_packet() failed (buffer is junk)
  349. const DVprofile* sys = avpriv_dv_codec_profile(c->vst->codec);
  350. int64_t offset;
  351. int64_t size = avio_size(s->pb) - s->data_offset;
  352. int64_t max_offset = ((size-1) / sys->frame_size) * sys->frame_size;
  353. offset = sys->frame_size * timestamp;
  354. if (size >= 0 && offset > max_offset) offset = max_offset;
  355. else if (offset < 0) offset = 0;
  356. return offset + s->data_offset;
  357. }
  358. void ff_dv_offset_reset(DVDemuxContext *c, int64_t frame_offset)
  359. {
  360. c->frames= frame_offset;
  361. if (c->ach)
  362. c->abytes= av_rescale_q(c->frames, c->sys->time_base,
  363. (AVRational){8, c->ast[0]->codec->bit_rate});
  364. c->audio_pkt[0].size = c->audio_pkt[1].size = 0;
  365. c->audio_pkt[2].size = c->audio_pkt[3].size = 0;
  366. }
  367. /************************************************************
  368. * Implementation of the easiest DV storage of all -- raw DV.
  369. ************************************************************/
  370. typedef struct RawDVContext {
  371. DVDemuxContext* dv_demux;
  372. uint8_t buf[DV_MAX_FRAME_SIZE];
  373. } RawDVContext;
  374. static int dv_read_timecode(AVFormatContext *s) {
  375. int ret;
  376. char timecode[AV_TIMECODE_STR_SIZE];
  377. int64_t pos = avio_tell(s->pb);
  378. // Read 3 DIF blocks: Header block and 2 Subcode blocks.
  379. int partial_frame_size = 3 * 80;
  380. uint8_t *partial_frame = av_mallocz(sizeof(*partial_frame) *
  381. partial_frame_size);
  382. RawDVContext *c = s->priv_data;
  383. ret = avio_read(s->pb, partial_frame, partial_frame_size);
  384. if (ret < 0)
  385. goto finish;
  386. if (ret < partial_frame_size) {
  387. ret = -1;
  388. goto finish;
  389. }
  390. ret = dv_extract_timecode(c->dv_demux, partial_frame, timecode);
  391. if (ret)
  392. av_dict_set(&s->metadata, "timecode", timecode, 0);
  393. else if (ret < 0)
  394. av_log(s, AV_LOG_ERROR, "Detected timecode is invalid");
  395. finish:
  396. av_free(partial_frame);
  397. avio_seek(s->pb, pos, SEEK_SET);
  398. return ret;
  399. }
  400. static int dv_read_header(AVFormatContext *s)
  401. {
  402. unsigned state, marker_pos = 0;
  403. RawDVContext *c = s->priv_data;
  404. c->dv_demux = avpriv_dv_init_demux(s);
  405. if (!c->dv_demux)
  406. return -1;
  407. state = avio_rb32(s->pb);
  408. while ((state & 0xffffff7f) != 0x1f07003f) {
  409. if (url_feof(s->pb)) {
  410. av_log(s, AV_LOG_ERROR, "Cannot find DV header.\n");
  411. return -1;
  412. }
  413. if (state == 0x003f0700 || state == 0xff3f0700)
  414. marker_pos = avio_tell(s->pb);
  415. if (state == 0xff3f0701 && avio_tell(s->pb) - marker_pos == 80) {
  416. avio_seek(s->pb, -163, SEEK_CUR);
  417. state = avio_rb32(s->pb);
  418. break;
  419. }
  420. state = (state << 8) | avio_r8(s->pb);
  421. }
  422. AV_WB32(c->buf, state);
  423. if (avio_read(s->pb, c->buf + 4, DV_PROFILE_BYTES - 4) != DV_PROFILE_BYTES - 4 ||
  424. avio_seek(s->pb, -DV_PROFILE_BYTES, SEEK_CUR) < 0)
  425. return AVERROR(EIO);
  426. c->dv_demux->sys = avpriv_dv_frame_profile(c->dv_demux->sys, c->buf, DV_PROFILE_BYTES);
  427. if (!c->dv_demux->sys) {
  428. av_log(s, AV_LOG_ERROR, "Can't determine profile of DV input stream.\n");
  429. return -1;
  430. }
  431. s->bit_rate = av_rescale_q(c->dv_demux->sys->frame_size, (AVRational){8,1},
  432. c->dv_demux->sys->time_base);
  433. if (s->pb->seekable)
  434. dv_read_timecode(s);
  435. return 0;
  436. }
  437. static int dv_read_packet(AVFormatContext *s, AVPacket *pkt)
  438. {
  439. int size;
  440. RawDVContext *c = s->priv_data;
  441. size = avpriv_dv_get_packet(c->dv_demux, pkt);
  442. if (size < 0) {
  443. int64_t pos = avio_tell(s->pb);
  444. if (!c->dv_demux->sys)
  445. return AVERROR(EIO);
  446. size = c->dv_demux->sys->frame_size;
  447. if (avio_read(s->pb, c->buf, size) <= 0)
  448. return AVERROR(EIO);
  449. size = avpriv_dv_produce_packet(c->dv_demux, pkt, c->buf, size, pos);
  450. }
  451. return size;
  452. }
  453. static int dv_read_seek(AVFormatContext *s, int stream_index,
  454. int64_t timestamp, int flags)
  455. {
  456. RawDVContext *r = s->priv_data;
  457. DVDemuxContext *c = r->dv_demux;
  458. int64_t offset = dv_frame_offset(s, c, timestamp, flags);
  459. if (avio_seek(s->pb, offset, SEEK_SET) < 0)
  460. return -1;
  461. ff_dv_offset_reset(c, offset / c->sys->frame_size);
  462. return 0;
  463. }
  464. static int dv_read_close(AVFormatContext *s)
  465. {
  466. RawDVContext *c = s->priv_data;
  467. av_free(c->dv_demux);
  468. return 0;
  469. }
  470. static int dv_probe(AVProbeData *p)
  471. {
  472. unsigned state, marker_pos = 0;
  473. int i;
  474. int matches = 0;
  475. int secondary_matches = 0;
  476. if (p->buf_size < 5)
  477. return 0;
  478. state = AV_RB32(p->buf);
  479. for (i = 4; i < p->buf_size; i++) {
  480. if ((state & 0xffffff7f) == 0x1f07003f)
  481. matches++;
  482. // any section header, also with seq/chan num != 0,
  483. // should appear around every 12000 bytes, at least 10 per frame
  484. if ((state & 0xff07ff7f) == 0x1f07003f)
  485. secondary_matches++;
  486. if (state == 0x003f0700 || state == 0xff3f0700)
  487. marker_pos = i;
  488. if (state == 0xff3f0701 && i - marker_pos == 80)
  489. matches++;
  490. state = (state << 8) | p->buf[i];
  491. }
  492. if (matches && p->buf_size / matches < 1024*1024) {
  493. if (matches > 4 || (secondary_matches >= 10 && p->buf_size / secondary_matches < 24000))
  494. return AVPROBE_SCORE_MAX*3/4; // not max to avoid dv in mov to match
  495. return AVPROBE_SCORE_MAX/4;
  496. }
  497. return 0;
  498. }
  499. #if CONFIG_DV_DEMUXER
  500. AVInputFormat ff_dv_demuxer = {
  501. .name = "dv",
  502. .long_name = NULL_IF_CONFIG_SMALL("DV video format"),
  503. .priv_data_size = sizeof(RawDVContext),
  504. .read_probe = dv_probe,
  505. .read_header = dv_read_header,
  506. .read_packet = dv_read_packet,
  507. .read_close = dv_read_close,
  508. .read_seek = dv_read_seek,
  509. .extensions = "dv,dif",
  510. };
  511. #endif