Mercurial > libavformat.hg
comparison mpeg.c @ 1167:d89d7ef290da libavformat
give AVInput/OutputFormat structs consistent names
author | mru |
---|---|
date | Sun, 09 Jul 2006 23:40:53 +0000 |
parents | 11a8f0c50814 |
children | d18cc9a1fd02 |
comparison
equal
deleted
inserted
replaced
1166:e89500dd9064 | 1167:d89d7ef290da |
---|---|
106 #define STREAM_TYPE_AUDIO_DTS 0x8a | 106 #define STREAM_TYPE_AUDIO_DTS 0x8a |
107 | 107 |
108 static const int lpcm_freq_tab[4] = { 48000, 96000, 44100, 32000 }; | 108 static const int lpcm_freq_tab[4] = { 48000, 96000, 44100, 32000 }; |
109 | 109 |
110 #ifdef CONFIG_MUXERS | 110 #ifdef CONFIG_MUXERS |
111 static AVOutputFormat mpeg1system_mux; | 111 static AVOutputFormat mpeg1system_muxer; |
112 static AVOutputFormat mpeg1vcd_mux; | 112 static AVOutputFormat mpeg1vcd_muxer; |
113 static AVOutputFormat mpeg2vob_mux; | 113 static AVOutputFormat mpeg2vob_muxer; |
114 static AVOutputFormat mpeg2svcd_mux; | 114 static AVOutputFormat mpeg2svcd_muxer; |
115 static AVOutputFormat mpeg2dvd_mux; | 115 static AVOutputFormat mpeg2dvd_muxer; |
116 | 116 |
117 static int put_pack_header(AVFormatContext *ctx, | 117 static int put_pack_header(AVFormatContext *ctx, |
118 uint8_t *buf, int64_t timestamp) | 118 uint8_t *buf, int64_t timestamp) |
119 { | 119 { |
120 MpegMuxContext *s = ctx->priv_data; | 120 MpegMuxContext *s = ctx->priv_data; |
328 StreamInfo *stream; | 328 StreamInfo *stream; |
329 int audio_bitrate; | 329 int audio_bitrate; |
330 int video_bitrate; | 330 int video_bitrate; |
331 | 331 |
332 s->packet_number = 0; | 332 s->packet_number = 0; |
333 s->is_vcd = (ctx->oformat == &mpeg1vcd_mux); | 333 s->is_vcd = (ctx->oformat == &mpeg1vcd_muxer); |
334 s->is_svcd = (ctx->oformat == &mpeg2svcd_mux); | 334 s->is_svcd = (ctx->oformat == &mpeg2svcd_muxer); |
335 s->is_mpeg2 = (ctx->oformat == &mpeg2vob_mux || ctx->oformat == &mpeg2svcd_mux || ctx->oformat == &mpeg2dvd_mux); | 335 s->is_mpeg2 = (ctx->oformat == &mpeg2vob_muxer || ctx->oformat == &mpeg2svcd_muxer || ctx->oformat == &mpeg2dvd_muxer); |
336 s->is_dvd = (ctx->oformat == &mpeg2dvd_mux); | 336 s->is_dvd = (ctx->oformat == &mpeg2dvd_muxer); |
337 | 337 |
338 if(ctx->packet_size) | 338 if(ctx->packet_size) |
339 s->packet_size = ctx->packet_size; | 339 s->packet_size = ctx->packet_size; |
340 else | 340 else |
341 s->packet_size = 2048; | 341 s->packet_size = 2048; |
1711 *ppos = pos; | 1711 *ppos = pos; |
1712 return dts; | 1712 return dts; |
1713 } | 1713 } |
1714 | 1714 |
1715 #ifdef CONFIG_MUXERS | 1715 #ifdef CONFIG_MUXERS |
1716 static AVOutputFormat mpeg1system_mux = { | 1716 static AVOutputFormat mpeg1system_muxer = { |
1717 "mpeg", | 1717 "mpeg", |
1718 "MPEG1 System format", | 1718 "MPEG1 System format", |
1719 "video/mpeg", | 1719 "video/mpeg", |
1720 "mpg,mpeg", | 1720 "mpg,mpeg", |
1721 sizeof(MpegMuxContext), | 1721 sizeof(MpegMuxContext), |
1724 mpeg_mux_init, | 1724 mpeg_mux_init, |
1725 mpeg_mux_write_packet, | 1725 mpeg_mux_write_packet, |
1726 mpeg_mux_end, | 1726 mpeg_mux_end, |
1727 }; | 1727 }; |
1728 | 1728 |
1729 static AVOutputFormat mpeg1vcd_mux = { | 1729 static AVOutputFormat mpeg1vcd_muxer = { |
1730 "vcd", | 1730 "vcd", |
1731 "MPEG1 System format (VCD)", | 1731 "MPEG1 System format (VCD)", |
1732 "video/mpeg", | 1732 "video/mpeg", |
1733 NULL, | 1733 NULL, |
1734 sizeof(MpegMuxContext), | 1734 sizeof(MpegMuxContext), |
1737 mpeg_mux_init, | 1737 mpeg_mux_init, |
1738 mpeg_mux_write_packet, | 1738 mpeg_mux_write_packet, |
1739 mpeg_mux_end, | 1739 mpeg_mux_end, |
1740 }; | 1740 }; |
1741 | 1741 |
1742 static AVOutputFormat mpeg2vob_mux = { | 1742 static AVOutputFormat mpeg2vob_muxer = { |
1743 "vob", | 1743 "vob", |
1744 "MPEG2 PS format (VOB)", | 1744 "MPEG2 PS format (VOB)", |
1745 "video/mpeg", | 1745 "video/mpeg", |
1746 "vob", | 1746 "vob", |
1747 sizeof(MpegMuxContext), | 1747 sizeof(MpegMuxContext), |
1750 mpeg_mux_init, | 1750 mpeg_mux_init, |
1751 mpeg_mux_write_packet, | 1751 mpeg_mux_write_packet, |
1752 mpeg_mux_end, | 1752 mpeg_mux_end, |
1753 }; | 1753 }; |
1754 | 1754 |
1755 /* Same as mpeg2vob_mux except that the pack size is 2324 */ | 1755 /* Same as mpeg2vob_muxer except that the pack size is 2324 */ |
1756 static AVOutputFormat mpeg2svcd_mux = { | 1756 static AVOutputFormat mpeg2svcd_muxer = { |
1757 "svcd", | 1757 "svcd", |
1758 "MPEG2 PS format (VOB)", | 1758 "MPEG2 PS format (VOB)", |
1759 "video/mpeg", | 1759 "video/mpeg", |
1760 "vob", | 1760 "vob", |
1761 sizeof(MpegMuxContext), | 1761 sizeof(MpegMuxContext), |
1764 mpeg_mux_init, | 1764 mpeg_mux_init, |
1765 mpeg_mux_write_packet, | 1765 mpeg_mux_write_packet, |
1766 mpeg_mux_end, | 1766 mpeg_mux_end, |
1767 }; | 1767 }; |
1768 | 1768 |
1769 /* Same as mpeg2vob_mux except the 'is_dvd' flag is set to produce NAV pkts */ | 1769 /* Same as mpeg2vob_muxer except the 'is_dvd' flag is set to produce NAV pkts */ |
1770 static AVOutputFormat mpeg2dvd_mux = { | 1770 static AVOutputFormat mpeg2dvd_muxer = { |
1771 "dvd", | 1771 "dvd", |
1772 "MPEG2 PS format (DVD VOB)", | 1772 "MPEG2 PS format (DVD VOB)", |
1773 "video/mpeg", | 1773 "video/mpeg", |
1774 "dvd", | 1774 "dvd", |
1775 sizeof(MpegMuxContext), | 1775 sizeof(MpegMuxContext), |
1780 mpeg_mux_end, | 1780 mpeg_mux_end, |
1781 }; | 1781 }; |
1782 | 1782 |
1783 #endif //CONFIG_MUXERS | 1783 #endif //CONFIG_MUXERS |
1784 | 1784 |
1785 AVInputFormat mpegps_demux = { | 1785 AVInputFormat mpegps_demuxer = { |
1786 "mpeg", | 1786 "mpeg", |
1787 "MPEG PS format", | 1787 "MPEG PS format", |
1788 sizeof(MpegDemuxContext), | 1788 sizeof(MpegDemuxContext), |
1789 mpegps_probe, | 1789 mpegps_probe, |
1790 mpegps_read_header, | 1790 mpegps_read_header, |
1796 }; | 1796 }; |
1797 | 1797 |
1798 int mpegps_init(void) | 1798 int mpegps_init(void) |
1799 { | 1799 { |
1800 #ifdef CONFIG_MUXERS | 1800 #ifdef CONFIG_MUXERS |
1801 av_register_output_format(&mpeg1system_mux); | 1801 av_register_output_format(&mpeg1system_muxer); |
1802 av_register_output_format(&mpeg1vcd_mux); | 1802 av_register_output_format(&mpeg1vcd_muxer); |
1803 av_register_output_format(&mpeg2vob_mux); | 1803 av_register_output_format(&mpeg2vob_muxer); |
1804 av_register_output_format(&mpeg2svcd_mux); | 1804 av_register_output_format(&mpeg2svcd_muxer); |
1805 av_register_output_format(&mpeg2dvd_mux); | 1805 av_register_output_format(&mpeg2dvd_muxer); |
1806 #endif //CONFIG_MUXERS | 1806 #endif //CONFIG_MUXERS |
1807 av_register_input_format(&mpegps_demux); | 1807 av_register_input_format(&mpegps_demuxer); |
1808 return 0; | 1808 return 0; |
1809 } | 1809 } |