You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

789 lines
18KB

  1. /*
  2. * RAW encoder and decoder
  3. * Copyright (c) 2001 Fabrice Bellard.
  4. * Copyright (c) 2005 Alex Beregszaszi
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with this library; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #include "avformat.h"
  21. #ifdef CONFIG_MUXERS
  22. /* simple formats */
  23. static int raw_write_header(struct AVFormatContext *s)
  24. {
  25. return 0;
  26. }
  27. static int raw_write_packet(struct AVFormatContext *s, AVPacket *pkt)
  28. {
  29. put_buffer(&s->pb, pkt->data, pkt->size);
  30. put_flush_packet(&s->pb);
  31. return 0;
  32. }
  33. static int raw_write_trailer(struct AVFormatContext *s)
  34. {
  35. return 0;
  36. }
  37. #endif //CONFIG_MUXERS
  38. /* raw input */
  39. static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
  40. {
  41. AVStream *st;
  42. int id;
  43. st = av_new_stream(s, 0);
  44. if (!st)
  45. return AVERROR_NOMEM;
  46. if (ap) {
  47. id = s->iformat->value;
  48. if (id == CODEC_ID_RAWVIDEO) {
  49. st->codec->codec_type = CODEC_TYPE_VIDEO;
  50. } else {
  51. st->codec->codec_type = CODEC_TYPE_AUDIO;
  52. }
  53. st->codec->codec_id = id;
  54. switch(st->codec->codec_type) {
  55. case CODEC_TYPE_AUDIO:
  56. st->codec->sample_rate = ap->sample_rate;
  57. st->codec->channels = ap->channels;
  58. av_set_pts_info(st, 64, 1, st->codec->sample_rate);
  59. break;
  60. case CODEC_TYPE_VIDEO:
  61. av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den);
  62. st->codec->width = ap->width;
  63. st->codec->height = ap->height;
  64. st->codec->pix_fmt = ap->pix_fmt;
  65. if(st->codec->pix_fmt == PIX_FMT_NONE)
  66. st->codec->pix_fmt= PIX_FMT_YUV420P;
  67. break;
  68. default:
  69. return -1;
  70. }
  71. } else {
  72. return -1;
  73. }
  74. return 0;
  75. }
  76. #define RAW_PACKET_SIZE 1024
  77. static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)
  78. {
  79. int ret, size;
  80. // AVStream *st = s->streams[0];
  81. size= RAW_PACKET_SIZE;
  82. ret= av_get_packet(&s->pb, pkt, size);
  83. pkt->stream_index = 0;
  84. if (ret <= 0) {
  85. return AVERROR_IO;
  86. }
  87. /* note: we need to modify the packet size here to handle the last
  88. packet */
  89. pkt->size = ret;
  90. return ret;
  91. }
  92. static int raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt)
  93. {
  94. int ret, size;
  95. size = RAW_PACKET_SIZE;
  96. if (av_new_packet(pkt, size) < 0)
  97. return AVERROR_IO;
  98. pkt->pos= url_ftell(&s->pb);
  99. pkt->stream_index = 0;
  100. ret = get_partial_buffer(&s->pb, pkt->data, size);
  101. if (ret <= 0) {
  102. av_free_packet(pkt);
  103. return AVERROR_IO;
  104. }
  105. pkt->size = ret;
  106. return ret;
  107. }
  108. // http://www.artificis.hu/files/texts/ingenient.txt
  109. static int ingenient_read_packet(AVFormatContext *s, AVPacket *pkt)
  110. {
  111. int ret, size, w, h, unk1, unk2;
  112. if (get_le32(&s->pb) != MKTAG('M', 'J', 'P', 'G'))
  113. return AVERROR_IO; // FIXME
  114. size = get_le32(&s->pb);
  115. w = get_le16(&s->pb);
  116. h = get_le16(&s->pb);
  117. url_fskip(&s->pb, 8); // zero + size (padded?)
  118. url_fskip(&s->pb, 2);
  119. unk1 = get_le16(&s->pb);
  120. unk2 = get_le16(&s->pb);
  121. url_fskip(&s->pb, 22); // ascii timestamp
  122. av_log(NULL, AV_LOG_DEBUG, "Ingenient packet: size=%d, width=%d, height=%d, unk1=%d unk2=%d\n",
  123. size, w, h, unk1, unk2);
  124. if (av_new_packet(pkt, size) < 0)
  125. return AVERROR_IO;
  126. pkt->pos = url_ftell(&s->pb);
  127. pkt->stream_index = 0;
  128. ret = get_buffer(&s->pb, pkt->data, size);
  129. if (ret <= 0) {
  130. av_free_packet(pkt);
  131. return AVERROR_IO;
  132. }
  133. pkt->size = ret;
  134. return ret;
  135. }
  136. static int raw_read_close(AVFormatContext *s)
  137. {
  138. return 0;
  139. }
  140. int pcm_read_seek(AVFormatContext *s,
  141. int stream_index, int64_t timestamp, int flags)
  142. {
  143. AVStream *st;
  144. int block_align, byte_rate;
  145. int64_t pos;
  146. st = s->streams[0];
  147. switch(st->codec->codec_id) {
  148. case CODEC_ID_PCM_S16LE:
  149. case CODEC_ID_PCM_S16BE:
  150. case CODEC_ID_PCM_U16LE:
  151. case CODEC_ID_PCM_U16BE:
  152. block_align = 2 * st->codec->channels;
  153. byte_rate = block_align * st->codec->sample_rate;
  154. break;
  155. case CODEC_ID_PCM_S8:
  156. case CODEC_ID_PCM_U8:
  157. case CODEC_ID_PCM_MULAW:
  158. case CODEC_ID_PCM_ALAW:
  159. block_align = st->codec->channels;
  160. byte_rate = block_align * st->codec->sample_rate;
  161. break;
  162. default:
  163. block_align = st->codec->block_align;
  164. byte_rate = st->codec->bit_rate / 8;
  165. break;
  166. }
  167. if (block_align <= 0 || byte_rate <= 0)
  168. return -1;
  169. /* compute the position by aligning it to block_align */
  170. pos = av_rescale_rnd(timestamp * byte_rate,
  171. st->time_base.num,
  172. st->time_base.den * (int64_t)block_align,
  173. (flags & AVSEEK_FLAG_BACKWARD) ? AV_ROUND_DOWN : AV_ROUND_UP);
  174. pos *= block_align;
  175. /* recompute exact position */
  176. st->cur_dts = av_rescale(pos, st->time_base.den, byte_rate * (int64_t)st->time_base.num);
  177. url_fseek(&s->pb, pos + s->data_offset, SEEK_SET);
  178. return 0;
  179. }
  180. /* ac3 read */
  181. static int ac3_read_header(AVFormatContext *s,
  182. AVFormatParameters *ap)
  183. {
  184. AVStream *st;
  185. st = av_new_stream(s, 0);
  186. if (!st)
  187. return AVERROR_NOMEM;
  188. st->codec->codec_type = CODEC_TYPE_AUDIO;
  189. st->codec->codec_id = CODEC_ID_AC3;
  190. st->need_parsing = 1;
  191. /* the parameters will be extracted from the compressed bitstream */
  192. return 0;
  193. }
  194. static int shorten_read_header(AVFormatContext *s,
  195. AVFormatParameters *ap)
  196. {
  197. AVStream *st;
  198. st = av_new_stream(s, 0);
  199. if (!st)
  200. return AVERROR_NOMEM;
  201. st->codec->codec_type = CODEC_TYPE_AUDIO;
  202. st->codec->codec_id = CODEC_ID_SHORTEN;
  203. st->need_parsing = 1;
  204. /* the parameters will be extracted from the compressed bitstream */
  205. return 0;
  206. }
  207. /* dts read */
  208. static int dts_read_header(AVFormatContext *s,
  209. AVFormatParameters *ap)
  210. {
  211. AVStream *st;
  212. st = av_new_stream(s, 0);
  213. if (!st)
  214. return AVERROR_NOMEM;
  215. st->codec->codec_type = CODEC_TYPE_AUDIO;
  216. st->codec->codec_id = CODEC_ID_DTS;
  217. st->need_parsing = 1;
  218. /* the parameters will be extracted from the compressed bitstream */
  219. return 0;
  220. }
  221. /* mpeg1/h263 input */
  222. static int video_read_header(AVFormatContext *s,
  223. AVFormatParameters *ap)
  224. {
  225. AVStream *st;
  226. st = av_new_stream(s, 0);
  227. if (!st)
  228. return AVERROR_NOMEM;
  229. st->codec->codec_type = CODEC_TYPE_VIDEO;
  230. st->codec->codec_id = s->iformat->value;
  231. st->need_parsing = 1;
  232. /* for mjpeg, specify frame rate */
  233. /* for mpeg4 specify it too (most mpeg4 streams dont have the fixed_vop_rate set ...)*/
  234. if (ap && ap->time_base.num) {
  235. av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den);
  236. } else if ( st->codec->codec_id == CODEC_ID_MJPEG ||
  237. st->codec->codec_id == CODEC_ID_MPEG4 ||
  238. st->codec->codec_id == CODEC_ID_H264) {
  239. av_set_pts_info(st, 64, 1, 25);
  240. }
  241. return 0;
  242. }
  243. #define SEQ_START_CODE 0x000001b3
  244. #define GOP_START_CODE 0x000001b8
  245. #define PICTURE_START_CODE 0x00000100
  246. #define SLICE_START_CODE 0x00000101
  247. #define PACK_START_CODE 0x000001ba
  248. static int mpegvideo_probe(AVProbeData *p)
  249. {
  250. uint32_t code= -1;
  251. int pic=0, seq=0, slice=0, pspack=0;
  252. int i;
  253. for(i=0; i<p->buf_size; i++){
  254. code = (code<<8) + p->buf[i];
  255. if ((code & 0xffffff00) == 0x100) {
  256. switch(code){
  257. case SEQ_START_CODE: seq++; break;
  258. case PICTURE_START_CODE: pic++; break;
  259. case SLICE_START_CODE: slice++; break;
  260. case PACK_START_CODE: pspack++; break;
  261. }
  262. }
  263. }
  264. if(seq && seq*9<=pic*10 && pic*9<=slice*10 && !pspack)
  265. return AVPROBE_SCORE_MAX/2+1; // +1 for .mpg
  266. return 0;
  267. }
  268. static int h263_probe(AVProbeData *p)
  269. {
  270. int code;
  271. const uint8_t *d;
  272. if (p->buf_size < 6)
  273. return 0;
  274. d = p->buf;
  275. code = (d[0] << 14) | (d[1] << 6) | (d[2] >> 2);
  276. if (code == 0x20) {
  277. return 50;
  278. }
  279. return 0;
  280. }
  281. static int h261_probe(AVProbeData *p)
  282. {
  283. int code;
  284. const uint8_t *d;
  285. if (p->buf_size < 6)
  286. return 0;
  287. d = p->buf;
  288. code = (d[0] << 12) | (d[1] << 4) | (d[2] >> 4);
  289. if (code == 0x10) {
  290. return 50;
  291. }
  292. return 0;
  293. }
  294. AVInputFormat shorten_iformat = {
  295. "shn",
  296. "raw shorten",
  297. 0,
  298. NULL,
  299. shorten_read_header,
  300. raw_read_partial_packet,
  301. raw_read_close,
  302. .extensions = "shn",
  303. };
  304. AVInputFormat ac3_iformat = {
  305. "ac3",
  306. "raw ac3",
  307. 0,
  308. NULL,
  309. ac3_read_header,
  310. raw_read_partial_packet,
  311. raw_read_close,
  312. .extensions = "ac3",
  313. };
  314. #ifdef CONFIG_MUXERS
  315. AVOutputFormat ac3_oformat = {
  316. "ac3",
  317. "raw ac3",
  318. "audio/x-ac3",
  319. "ac3",
  320. 0,
  321. CODEC_ID_AC3,
  322. 0,
  323. raw_write_header,
  324. raw_write_packet,
  325. raw_write_trailer,
  326. };
  327. #endif //CONFIG_MUXERS
  328. AVInputFormat dts_iformat = {
  329. "dts",
  330. "raw dts",
  331. 0,
  332. NULL,
  333. dts_read_header,
  334. raw_read_partial_packet,
  335. raw_read_close,
  336. .extensions = "dts",
  337. };
  338. AVInputFormat h261_iformat = {
  339. "h261",
  340. "raw h261",
  341. 0,
  342. h261_probe,
  343. video_read_header,
  344. raw_read_partial_packet,
  345. raw_read_close,
  346. .extensions = "h261",
  347. .value = CODEC_ID_H261,
  348. };
  349. #ifdef CONFIG_MUXERS
  350. AVOutputFormat h261_oformat = {
  351. "h261",
  352. "raw h261",
  353. "video/x-h261",
  354. "h261",
  355. 0,
  356. 0,
  357. CODEC_ID_H261,
  358. raw_write_header,
  359. raw_write_packet,
  360. raw_write_trailer,
  361. };
  362. #endif //CONFIG_MUXERS
  363. AVInputFormat h263_iformat = {
  364. "h263",
  365. "raw h263",
  366. 0,
  367. h263_probe,
  368. video_read_header,
  369. raw_read_partial_packet,
  370. raw_read_close,
  371. // .extensions = "h263", //FIXME remove after writing mpeg4_probe
  372. .value = CODEC_ID_H263,
  373. };
  374. #ifdef CONFIG_MUXERS
  375. AVOutputFormat h263_oformat = {
  376. "h263",
  377. "raw h263",
  378. "video/x-h263",
  379. "h263",
  380. 0,
  381. 0,
  382. CODEC_ID_H263,
  383. raw_write_header,
  384. raw_write_packet,
  385. raw_write_trailer,
  386. };
  387. #endif //CONFIG_MUXERS
  388. AVInputFormat m4v_iformat = {
  389. "m4v",
  390. "raw MPEG4 video format",
  391. 0,
  392. NULL /*mpegvideo_probe*/,
  393. video_read_header,
  394. raw_read_partial_packet,
  395. raw_read_close,
  396. .extensions = "m4v", //FIXME remove after writing mpeg4_probe
  397. .value = CODEC_ID_MPEG4,
  398. };
  399. #ifdef CONFIG_MUXERS
  400. AVOutputFormat m4v_oformat = {
  401. "m4v",
  402. "raw MPEG4 video format",
  403. NULL,
  404. "m4v",
  405. 0,
  406. CODEC_ID_NONE,
  407. CODEC_ID_MPEG4,
  408. raw_write_header,
  409. raw_write_packet,
  410. raw_write_trailer,
  411. };
  412. #endif //CONFIG_MUXERS
  413. AVInputFormat h264_iformat = {
  414. "h264",
  415. "raw H264 video format",
  416. 0,
  417. NULL /*mpegvideo_probe*/,
  418. video_read_header,
  419. raw_read_partial_packet,
  420. raw_read_close,
  421. .extensions = "h26l,h264,264", //FIXME remove after writing mpeg4_probe
  422. .value = CODEC_ID_H264,
  423. };
  424. #ifdef CONFIG_MUXERS
  425. AVOutputFormat h264_oformat = {
  426. "h264",
  427. "raw H264 video format",
  428. NULL,
  429. "h264",
  430. 0,
  431. CODEC_ID_NONE,
  432. CODEC_ID_H264,
  433. raw_write_header,
  434. raw_write_packet,
  435. raw_write_trailer,
  436. };
  437. #endif //CONFIG_MUXERS
  438. AVInputFormat mpegvideo_iformat = {
  439. "mpegvideo",
  440. "MPEG video",
  441. 0,
  442. mpegvideo_probe,
  443. video_read_header,
  444. raw_read_partial_packet,
  445. raw_read_close,
  446. .value = CODEC_ID_MPEG1VIDEO,
  447. };
  448. #ifdef CONFIG_MUXERS
  449. AVOutputFormat mpeg1video_oformat = {
  450. "mpeg1video",
  451. "MPEG video",
  452. "video/x-mpeg",
  453. "mpg,mpeg,m1v",
  454. 0,
  455. 0,
  456. CODEC_ID_MPEG1VIDEO,
  457. raw_write_header,
  458. raw_write_packet,
  459. raw_write_trailer,
  460. };
  461. #endif //CONFIG_MUXERS
  462. #ifdef CONFIG_MUXERS
  463. AVOutputFormat mpeg2video_oformat = {
  464. "mpeg2video",
  465. "MPEG2 video",
  466. NULL,
  467. "m2v",
  468. 0,
  469. 0,
  470. CODEC_ID_MPEG2VIDEO,
  471. raw_write_header,
  472. raw_write_packet,
  473. raw_write_trailer,
  474. };
  475. #endif //CONFIG_MUXERS
  476. AVInputFormat mjpeg_iformat = {
  477. "mjpeg",
  478. "MJPEG video",
  479. 0,
  480. NULL,
  481. video_read_header,
  482. raw_read_partial_packet,
  483. raw_read_close,
  484. .extensions = "mjpg,mjpeg",
  485. .value = CODEC_ID_MJPEG,
  486. };
  487. AVInputFormat ingenient_iformat = {
  488. "ingenient",
  489. "Ingenient MJPEG",
  490. 0,
  491. NULL,
  492. video_read_header,
  493. ingenient_read_packet,
  494. raw_read_close,
  495. .extensions = "cgi", // FIXME
  496. .value = CODEC_ID_MJPEG,
  497. };
  498. #ifdef CONFIG_MUXERS
  499. AVOutputFormat mjpeg_oformat = {
  500. "mjpeg",
  501. "MJPEG video",
  502. "video/x-mjpeg",
  503. "mjpg,mjpeg",
  504. 0,
  505. 0,
  506. CODEC_ID_MJPEG,
  507. raw_write_header,
  508. raw_write_packet,
  509. raw_write_trailer,
  510. };
  511. #endif //CONFIG_MUXERS
  512. /* pcm formats */
  513. #define PCMINPUTDEF(name, long_name, ext, codec) \
  514. AVInputFormat pcm_ ## name ## _iformat = {\
  515. #name,\
  516. long_name,\
  517. 0,\
  518. NULL,\
  519. raw_read_header,\
  520. raw_read_packet,\
  521. raw_read_close,\
  522. pcm_read_seek,\
  523. .extensions = ext,\
  524. .value = codec,\
  525. };
  526. #if !defined(CONFIG_MUXERS) && defined(CONFIG_DEMUXERS)
  527. #define PCMDEF(name, long_name, ext, codec) \
  528. PCMINPUTDEF(name, long_name, ext, codec)
  529. #else
  530. #define PCMDEF(name, long_name, ext, codec) \
  531. PCMINPUTDEF(name, long_name, ext, codec)\
  532. \
  533. AVOutputFormat pcm_ ## name ## _oformat = {\
  534. #name,\
  535. long_name,\
  536. NULL,\
  537. ext,\
  538. 0,\
  539. codec,\
  540. 0,\
  541. raw_write_header,\
  542. raw_write_packet,\
  543. raw_write_trailer,\
  544. };
  545. #endif //CONFIG_MUXERS
  546. #ifdef WORDS_BIGENDIAN
  547. #define BE_DEF(s) s
  548. #define LE_DEF(s) NULL
  549. #else
  550. #define BE_DEF(s) NULL
  551. #define LE_DEF(s) s
  552. #endif
  553. PCMDEF(s16le, "pcm signed 16 bit little endian format",
  554. LE_DEF("sw"), CODEC_ID_PCM_S16LE)
  555. PCMDEF(s16be, "pcm signed 16 bit big endian format",
  556. BE_DEF("sw"), CODEC_ID_PCM_S16BE)
  557. PCMDEF(u16le, "pcm unsigned 16 bit little endian format",
  558. LE_DEF("uw"), CODEC_ID_PCM_U16LE)
  559. PCMDEF(u16be, "pcm unsigned 16 bit big endian format",
  560. BE_DEF("uw"), CODEC_ID_PCM_U16BE)
  561. PCMDEF(s8, "pcm signed 8 bit format",
  562. "sb", CODEC_ID_PCM_S8)
  563. PCMDEF(u8, "pcm unsigned 8 bit format",
  564. "ub", CODEC_ID_PCM_U8)
  565. PCMDEF(mulaw, "pcm mu law format",
  566. "ul", CODEC_ID_PCM_MULAW)
  567. PCMDEF(alaw, "pcm A law format",
  568. "al", CODEC_ID_PCM_ALAW)
  569. static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
  570. {
  571. int packet_size, ret, width, height;
  572. AVStream *st = s->streams[0];
  573. width = st->codec->width;
  574. height = st->codec->height;
  575. packet_size = avpicture_get_size(st->codec->pix_fmt, width, height);
  576. if (packet_size < 0)
  577. return -1;
  578. ret= av_get_packet(&s->pb, pkt, packet_size);
  579. pkt->stream_index = 0;
  580. if (ret != packet_size) {
  581. return AVERROR_IO;
  582. } else {
  583. return 0;
  584. }
  585. }
  586. AVInputFormat rawvideo_iformat = {
  587. "rawvideo",
  588. "raw video format",
  589. 0,
  590. NULL,
  591. raw_read_header,
  592. rawvideo_read_packet,
  593. raw_read_close,
  594. .extensions = "yuv,cif,qcif",
  595. .value = CODEC_ID_RAWVIDEO,
  596. };
  597. #ifdef CONFIG_MUXERS
  598. AVOutputFormat rawvideo_oformat = {
  599. "rawvideo",
  600. "raw video format",
  601. NULL,
  602. "yuv",
  603. 0,
  604. CODEC_ID_NONE,
  605. CODEC_ID_RAWVIDEO,
  606. raw_write_header,
  607. raw_write_packet,
  608. raw_write_trailer,
  609. };
  610. #endif //CONFIG_MUXERS
  611. #ifdef CONFIG_MUXERS
  612. static int null_write_packet(struct AVFormatContext *s, AVPacket *pkt)
  613. {
  614. return 0;
  615. }
  616. AVOutputFormat null_oformat = {
  617. "null",
  618. "null video format",
  619. NULL,
  620. NULL,
  621. 0,
  622. #ifdef WORDS_BIGENDIAN
  623. CODEC_ID_PCM_S16BE,
  624. #else
  625. CODEC_ID_PCM_S16LE,
  626. #endif
  627. CODEC_ID_RAWVIDEO,
  628. raw_write_header,
  629. null_write_packet,
  630. raw_write_trailer,
  631. .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE,
  632. };
  633. #endif //CONFIG_MUXERS
  634. #ifndef CONFIG_MUXERS
  635. #define av_register_output_format(format)
  636. #endif
  637. #ifndef CONFIG_DEMUXERS
  638. #define av_register_input_format(format)
  639. #endif
  640. int raw_init(void)
  641. {
  642. av_register_input_format(&shorten_iformat);
  643. av_register_input_format(&ac3_iformat);
  644. av_register_output_format(&ac3_oformat);
  645. av_register_input_format(&dts_iformat);
  646. av_register_input_format(&h261_iformat);
  647. av_register_output_format(&h261_oformat);
  648. av_register_input_format(&h263_iformat);
  649. av_register_output_format(&h263_oformat);
  650. av_register_input_format(&m4v_iformat);
  651. av_register_output_format(&m4v_oformat);
  652. av_register_input_format(&h264_iformat);
  653. av_register_output_format(&h264_oformat);
  654. av_register_input_format(&mpegvideo_iformat);
  655. av_register_output_format(&mpeg1video_oformat);
  656. av_register_output_format(&mpeg2video_oformat);
  657. av_register_input_format(&mjpeg_iformat);
  658. av_register_output_format(&mjpeg_oformat);
  659. av_register_input_format(&ingenient_iformat);
  660. av_register_input_format(&pcm_s16le_iformat);
  661. av_register_output_format(&pcm_s16le_oformat);
  662. av_register_input_format(&pcm_s16be_iformat);
  663. av_register_output_format(&pcm_s16be_oformat);
  664. av_register_input_format(&pcm_u16le_iformat);
  665. av_register_output_format(&pcm_u16le_oformat);
  666. av_register_input_format(&pcm_u16be_iformat);
  667. av_register_output_format(&pcm_u16be_oformat);
  668. av_register_input_format(&pcm_s8_iformat);
  669. av_register_output_format(&pcm_s8_oformat);
  670. av_register_input_format(&pcm_u8_iformat);
  671. av_register_output_format(&pcm_u8_oformat);
  672. av_register_input_format(&pcm_mulaw_iformat);
  673. av_register_output_format(&pcm_mulaw_oformat);
  674. av_register_input_format(&pcm_alaw_iformat);
  675. av_register_output_format(&pcm_alaw_oformat);
  676. av_register_input_format(&rawvideo_iformat);
  677. av_register_output_format(&rawvideo_oformat);
  678. av_register_output_format(&null_oformat);
  679. return 0;
  680. }