Mercurial > libavformat.hg
changeset 6425:61cc005602fc libavformat
move id roq muxer to its own file
author | aurel |
---|---|
date | Sun, 29 Aug 2010 16:35:44 +0000 |
parents | 6a8fc2ab012c |
children | ee9bbe013610 |
files | Makefile idroqenc.c raw.c raw.h |
diffstat | 4 files changed, 71 insertions(+), 49 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile Sun Aug 29 16:18:20 2010 +0000 +++ b/Makefile Sun Aug 29 16:35:44 2010 +0000 @@ -210,7 +210,7 @@ OBJS-$(CONFIG_RM_DEMUXER) += rmdec.o rm.o OBJS-$(CONFIG_RM_MUXER) += rmenc.o rm.o OBJS-$(CONFIG_ROQ_DEMUXER) += idroq.o -OBJS-$(CONFIG_ROQ_MUXER) += raw.o +OBJS-$(CONFIG_ROQ_MUXER) += idroqenc.o OBJS-$(CONFIG_RSO_DEMUXER) += rsodec.o rso.o raw.o OBJS-$(CONFIG_RSO_MUXER) += rsoenc.o rso.o OBJS-$(CONFIG_RPL_DEMUXER) += rpl.o
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idroqenc.c Sun Aug 29 16:35:44 2010 +0000 @@ -0,0 +1,49 @@ +/* + * id RoQ (.roq) File muxer + * Copyright (c) 2007 Vitor Sessak + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "avformat.h" +#include "raw.h" + + +static int roq_write_header(struct AVFormatContext *s) +{ + static const uint8_t header[] = { + 0x84, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0x1E, 0x00 + }; + + put_buffer(s->pb, header, 8); + put_flush_packet(s->pb); + + return 0; +} + +AVOutputFormat roq_muxer = +{ + "RoQ", + NULL_IF_CONFIG_SMALL("raw id RoQ format"), + NULL, + "roq", + 0, + CODEC_ID_ROQ_DPCM, + CODEC_ID_ROQ, + roq_write_header, + ff_raw_write_packet, +};
--- a/raw.c Sun Aug 29 16:18:20 2010 +0000 +++ b/raw.c Sun Aug 29 16:35:44 2010 +0000 @@ -31,20 +31,6 @@ /* simple formats */ -#if CONFIG_ROQ_MUXER -static int roq_write_header(struct AVFormatContext *s) -{ - static const uint8_t header[] = { - 0x84, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0x1E, 0x00 - }; - - put_buffer(s->pb, header, 8); - put_flush_packet(s->pb); - - return 0; -} -#endif - #if CONFIG_NULL_MUXER static int null_write_packet(struct AVFormatContext *s, AVPacket *pkt) { @@ -53,7 +39,7 @@ #endif #if CONFIG_MUXERS -static int raw_write_packet(struct AVFormatContext *s, AVPacket *pkt) +int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt) { put_buffer(s->pb, pkt->data, pkt->size); put_flush_packet(s->pb); @@ -688,7 +674,7 @@ CODEC_ID_AC3, CODEC_ID_NONE, NULL, - raw_write_packet, + ff_raw_write_packet, .flags= AVFMT_NOTIMESTAMPS, }; #endif @@ -716,7 +702,7 @@ CODEC_ID_NONE, CODEC_ID_DIRAC, NULL, - raw_write_packet, + ff_raw_write_packet, .flags= AVFMT_NOTIMESTAMPS, }; #endif @@ -744,7 +730,7 @@ CODEC_ID_NONE, CODEC_ID_DNXHD, NULL, - raw_write_packet, + ff_raw_write_packet, .flags= AVFMT_NOTIMESTAMPS, }; #endif @@ -773,7 +759,7 @@ CODEC_ID_DTS, CODEC_ID_NONE, NULL, - raw_write_packet, + ff_raw_write_packet, .flags= AVFMT_NOTIMESTAMPS, }; #endif @@ -802,7 +788,7 @@ CODEC_ID_EAC3, CODEC_ID_NONE, NULL, - raw_write_packet, + ff_raw_write_packet, .flags= AVFMT_NOTIMESTAMPS, }; #endif @@ -845,7 +831,7 @@ CODEC_ID_NONE, CODEC_ID_H261, NULL, - raw_write_packet, + ff_raw_write_packet, .flags= AVFMT_NOTIMESTAMPS, }; #endif @@ -874,7 +860,7 @@ CODEC_ID_NONE, CODEC_ID_H263, NULL, - raw_write_packet, + ff_raw_write_packet, .flags= AVFMT_NOTIMESTAMPS, }; #endif @@ -903,7 +889,7 @@ CODEC_ID_NONE, CODEC_ID_H264, NULL, - raw_write_packet, + ff_raw_write_packet, .flags= AVFMT_NOTIMESTAMPS, }; #endif @@ -918,7 +904,7 @@ CODEC_ID_NONE, CODEC_ID_CAVS, NULL, - raw_write_packet, + ff_raw_write_packet, .flags= AVFMT_NOTIMESTAMPS, }; #endif @@ -961,7 +947,7 @@ CODEC_ID_NONE, CODEC_ID_MPEG4, NULL, - raw_write_packet, + ff_raw_write_packet, .flags= AVFMT_NOTIMESTAMPS, }; #endif @@ -990,7 +976,7 @@ CODEC_ID_NONE, CODEC_ID_MJPEG, NULL, - raw_write_packet, + ff_raw_write_packet, .flags= AVFMT_NOTIMESTAMPS, }; #endif @@ -1019,7 +1005,7 @@ CODEC_ID_MLP, CODEC_ID_NONE, NULL, - raw_write_packet, + ff_raw_write_packet, .flags= AVFMT_NOTIMESTAMPS, }; #endif @@ -1030,7 +1016,7 @@ .long_name = NULL_IF_CONFIG_SMALL("SubRip subtitle format"), .mime_type = "application/x-subrip", .extensions = "srt", - .write_packet = raw_write_packet, + .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, .subtitle_codec = CODEC_ID_SRT, }; @@ -1060,7 +1046,7 @@ CODEC_ID_TRUEHD, CODEC_ID_NONE, NULL, - raw_write_packet, + ff_raw_write_packet, .flags= AVFMT_NOTIMESTAMPS, }; #endif @@ -1075,7 +1061,7 @@ CODEC_ID_NONE, CODEC_ID_MPEG1VIDEO, NULL, - raw_write_packet, + ff_raw_write_packet, .flags= AVFMT_NOTIMESTAMPS, }; #endif @@ -1090,7 +1076,7 @@ CODEC_ID_NONE, CODEC_ID_MPEG2VIDEO, NULL, - raw_write_packet, + ff_raw_write_packet, .flags= AVFMT_NOTIMESTAMPS, }; #endif @@ -1164,26 +1150,11 @@ CODEC_ID_NONE, CODEC_ID_RAWVIDEO, NULL, - raw_write_packet, + ff_raw_write_packet, .flags= AVFMT_NOTIMESTAMPS, }; #endif -#if CONFIG_ROQ_MUXER -AVOutputFormat roq_muxer = -{ - "RoQ", - NULL_IF_CONFIG_SMALL("raw id RoQ format"), - NULL, - "roq", - 0, - CODEC_ID_ROQ_DPCM, - CODEC_ID_ROQ, - roq_write_header, - raw_write_packet, -}; -#endif - #if CONFIG_SHORTEN_DEMUXER AVInputFormat shorten_demuxer = { "shn", @@ -1238,7 +1209,7 @@ codec,\ CODEC_ID_NONE,\ NULL,\ - raw_write_packet,\ + ff_raw_write_packet,\ .flags= AVFMT_NOTIMESTAMPS,\ };
--- a/raw.h Sun Aug 29 16:18:20 2010 +0000 +++ b/raw.h Sun Aug 29 16:35:44 2010 +0000 @@ -27,6 +27,8 @@ int pcm_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags); +int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt); + int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt); #endif /* AVFORMAT_RAW_H */