annotate raw.c @ 487:7942c1aa0028 libavformat

simplify
author michael
date Fri, 25 Jun 2004 20:03:51 +0000
parents f4e9e55f703c
children 112057e05179
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
1 /*
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
2 * RAW encoder and decoder
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
3 * Copyright (c) 2001 Fabrice Bellard.
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
4 *
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
5 * This library is free software; you can redistribute it and/or
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
6 * modify it under the terms of the GNU Lesser General Public
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
7 * License as published by the Free Software Foundation; either
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
8 * version 2 of the License, or (at your option) any later version.
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
9 *
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
10 * This library is distributed in the hope that it will be useful,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
13 * Lesser General Public License for more details.
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
14 *
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
15 * You should have received a copy of the GNU Lesser General Public
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
16 * License along with this library; if not, write to the Free Software
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
18 */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
19 #include "avformat.h"
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
20
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
21 #ifdef CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
22 /* simple formats */
64
b0e0eb595e29 * static,const,compiler warning cleanup
kabi
parents: 63
diff changeset
23 static int raw_write_header(struct AVFormatContext *s)
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
24 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
25 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
26 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
27
468
60f897e8dd2d pass AVPacket into av_write_frame()
michael
parents: 464
diff changeset
28 static int raw_write_packet(struct AVFormatContext *s, AVPacket *pkt)
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
29 {
468
60f897e8dd2d pass AVPacket into av_write_frame()
michael
parents: 464
diff changeset
30 put_buffer(&s->pb, pkt->data, pkt->size);
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
31 put_flush_packet(&s->pb);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
32 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
33 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
34
64
b0e0eb595e29 * static,const,compiler warning cleanup
kabi
parents: 63
diff changeset
35 static int raw_write_trailer(struct AVFormatContext *s)
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
36 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
37 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
38 }
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
39 #endif //CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
40
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
41 /* raw input */
65
a58a8a53eb46 * UINTX -> uintx_t INTX -> intx_t
kabi
parents: 64
diff changeset
42 static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
43 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
44 AVStream *st;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
45 int id;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
46
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
47 st = av_new_stream(s, 0);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
48 if (!st)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
49 return AVERROR_NOMEM;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
50 if (ap) {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
51 id = s->iformat->value;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
52 if (id == CODEC_ID_RAWVIDEO) {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
53 st->codec.codec_type = CODEC_TYPE_VIDEO;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
54 } else {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
55 st->codec.codec_type = CODEC_TYPE_AUDIO;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
56 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
57 st->codec.codec_id = id;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
58
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
59 switch(st->codec.codec_type) {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
60 case CODEC_TYPE_AUDIO:
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
61 st->codec.sample_rate = ap->sample_rate;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
62 st->codec.channels = ap->channels;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
63 break;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
64 case CODEC_TYPE_VIDEO:
85
25062c9b1f86 per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents: 65
diff changeset
65 st->codec.frame_rate = ap->frame_rate;
25062c9b1f86 per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents: 65
diff changeset
66 st->codec.frame_rate_base = ap->frame_rate_base;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
67 st->codec.width = ap->width;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
68 st->codec.height = ap->height;
128
45633cd5518a * introducing new public interface in imgconvert.c
romansh
parents: 126
diff changeset
69 st->codec.pix_fmt = ap->pix_fmt;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
70 break;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
71 default:
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
72 return -1;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
73 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
74 } else {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
75 return -1;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
76 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
77 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
78 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
79
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
80 #define RAW_PACKET_SIZE 1024
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
81
64
b0e0eb595e29 * static,const,compiler warning cleanup
kabi
parents: 63
diff changeset
82 static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
83 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
84 int ret, size;
28
64678c053566 removed warnings
bellard
parents: 0
diff changeset
85 // AVStream *st = s->streams[0];
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
86
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
87 size= RAW_PACKET_SIZE;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
88
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
89 if (av_new_packet(pkt, size) < 0)
482
0fdc96c2f2fe sweeping change from -EIO -> AVERROR_IO
melanson
parents: 473
diff changeset
90 return AVERROR_IO;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
91
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
92 pkt->stream_index = 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
93 ret = get_buffer(&s->pb, pkt->data, size);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
94 if (ret <= 0) {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
95 av_free_packet(pkt);
482
0fdc96c2f2fe sweeping change from -EIO -> AVERROR_IO
melanson
parents: 473
diff changeset
96 return AVERROR_IO;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
97 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
98 /* note: we need to modify the packet size here to handle the last
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
99 packet */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
100 pkt->size = ret;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
101 return ret;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
102 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
103
389
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
104 static int raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt)
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
105 {
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
106 int ret, size;
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
107
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
108 size = RAW_PACKET_SIZE;
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
109
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
110 if (av_new_packet(pkt, size) < 0)
482
0fdc96c2f2fe sweeping change from -EIO -> AVERROR_IO
melanson
parents: 473
diff changeset
111 return AVERROR_IO;
389
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
112
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
113 pkt->stream_index = 0;
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
114 ret = get_partial_buffer(&s->pb, pkt->data, size);
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
115 if (ret <= 0) {
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
116 av_free_packet(pkt);
482
0fdc96c2f2fe sweeping change from -EIO -> AVERROR_IO
melanson
parents: 473
diff changeset
117 return AVERROR_IO;
389
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
118 }
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
119 pkt->size = ret;
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
120 return ret;
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
121 }
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
122
64
b0e0eb595e29 * static,const,compiler warning cleanup
kabi
parents: 63
diff changeset
123 static int raw_read_close(AVFormatContext *s)
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
124 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
125 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
126 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
127
306
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
128 int pcm_read_seek(AVFormatContext *s,
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
129 int stream_index, int64_t timestamp)
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
130 {
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
131 AVStream *st;
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
132 int block_align, byte_rate;
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
133 int64_t pos;
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
134
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
135 st = s->streams[0];
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
136 switch(st->codec.codec_id) {
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
137 case CODEC_ID_PCM_S16LE:
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
138 case CODEC_ID_PCM_S16BE:
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
139 case CODEC_ID_PCM_U16LE:
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
140 case CODEC_ID_PCM_U16BE:
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
141 block_align = 2 * st->codec.channels;
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
142 byte_rate = block_align * st->codec.sample_rate;
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
143 break;
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
144 case CODEC_ID_PCM_S8:
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
145 case CODEC_ID_PCM_U8:
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
146 case CODEC_ID_PCM_MULAW:
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
147 case CODEC_ID_PCM_ALAW:
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
148 block_align = st->codec.channels;
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
149 byte_rate = block_align * st->codec.sample_rate;
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
150 break;
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
151 default:
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
152 block_align = st->codec.block_align;
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
153 byte_rate = st->codec.bit_rate / 8;
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
154 break;
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
155 }
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
156
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
157 if (block_align <= 0 || byte_rate <= 0)
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
158 return -1;
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
159
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
160 /* compute the position by aligning it to block_align */
463
696f41bc8784 store index for seeking in the native timebase of each stream
michael
parents: 389
diff changeset
161 pos = av_rescale(timestamp * byte_rate, st->time_base.num, st->time_base.den);
306
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
162 pos = (pos / block_align) * block_align;
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
163
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
164 /* recompute exact position */
464
09e46bfc859c cur_dts in native timebase
michael
parents: 463
diff changeset
165 st->cur_dts = av_rescale(pos, st->time_base.den, byte_rate * (int64_t)st->time_base.num);
306
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
166 url_fseek(&s->pb, pos + s->data_offset, SEEK_SET);
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
167 return 0;
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
168 }
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
169
63
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
170 /* ac3 read */
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
171 static int ac3_read_header(AVFormatContext *s,
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
172 AVFormatParameters *ap)
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
173 {
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
174 AVStream *st;
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
175
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
176 st = av_new_stream(s, 0);
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
177 if (!st)
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
178 return AVERROR_NOMEM;
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
179
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
180 st->codec.codec_type = CODEC_TYPE_AUDIO;
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
181 st->codec.codec_id = CODEC_ID_AC3;
306
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
182 st->need_parsing = 1;
63
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
183 /* the parameters will be extracted from the compressed bitstream */
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
184 return 0;
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
185 }
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
186
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
187 /* mpeg1/h263 input */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
188 static int video_read_header(AVFormatContext *s,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
189 AVFormatParameters *ap)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
190 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
191 AVStream *st;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
192
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
193 st = av_new_stream(s, 0);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
194 if (!st)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
195 return AVERROR_NOMEM;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
196
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
197 st->codec.codec_type = CODEC_TYPE_VIDEO;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
198 st->codec.codec_id = s->iformat->value;
306
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
199 st->need_parsing = 1;
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
200
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
201 /* for mjpeg, specify frame rate */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
202 /* for mpeg4 specify it too (most mpeg4 streams dont have the fixed_vop_rate set ...)*/
306
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
203 if (st->codec.codec_id == CODEC_ID_MJPEG ||
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
204 st->codec.codec_id == CODEC_ID_MPEG4) {
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
205 if (ap && ap->frame_rate) {
85
25062c9b1f86 per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents: 65
diff changeset
206 st->codec.frame_rate = ap->frame_rate;
25062c9b1f86 per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents: 65
diff changeset
207 st->codec.frame_rate_base = ap->frame_rate_base;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
208 } else {
85
25062c9b1f86 per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents: 65
diff changeset
209 st->codec.frame_rate = 25;
25062c9b1f86 per context frame_rate_base, this should finally fix frame_rate related av sync issues
michaelni
parents: 65
diff changeset
210 st->codec.frame_rate_base = 1;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
211 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
212 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
213 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
214 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
215
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
216 #define SEQ_START_CODE 0x000001b3
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
217 #define GOP_START_CODE 0x000001b8
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
218 #define PICTURE_START_CODE 0x00000100
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
219
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
220 /* XXX: improve that by looking at several start codes */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
221 static int mpegvideo_probe(AVProbeData *p)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
222 {
49
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
223 int code;
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
224 const uint8_t *d;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
225
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
226 /* we search the first start code. If it is a sequence, gop or
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
227 picture start code then we decide it is an mpeg video
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
228 stream. We do not send highest value to give a chance to mpegts */
49
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
229 /* NOTE: the search range was restricted to avoid too many false
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
230 detections */
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
231
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
232 if (p->buf_size < 6)
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
233 return 0;
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
234 d = p->buf;
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
235 code = (d[0] << 24) | (d[1] << 16) | (d[2] << 8) | (d[3]);
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
236 if ((code & 0xffffff00) == 0x100) {
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
237 if (code == SEQ_START_CODE ||
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
238 code == GOP_START_CODE ||
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
239 code == PICTURE_START_CODE)
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
240 return 50 - 1;
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
241 else
3e7e13e08b27 avoid too many false detections
bellard
parents: 28
diff changeset
242 return 0;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
243 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
244 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
245 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
246
135
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
247 static int h263_probe(AVProbeData *p)
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
248 {
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
249 int code;
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
250 const uint8_t *d;
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
251
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
252 if (p->buf_size < 6)
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
253 return 0;
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
254 d = p->buf;
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
255 code = (d[0] << 14) | (d[1] << 6) | (d[2] >> 2);
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
256 if (code == 0x20) {
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
257 return 50;
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
258 }
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
259 return 0;
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
260 }
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
261
473
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
262 static int h261_probe(AVProbeData *p)
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
263 {
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
264 int code;
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
265 const uint8_t *d;
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
266
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
267 if (p->buf_size < 6)
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
268 return 0;
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
269 d = p->buf;
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
270 code = (d[0] << 12) | (d[1] << 4) | (d[2] >> 4);
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
271 if (code == 0x10) {
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
272 return 50;
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
273 }
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
274 return 0;
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
275 }
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
276
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
277 AVInputFormat ac3_iformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
278 "ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
279 "raw ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
280 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
281 NULL,
63
8329ba7cbd01 raw ac3 auto detects parameters
bellard
parents: 49
diff changeset
282 ac3_read_header,
389
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
283 raw_read_partial_packet,
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
284 raw_read_close,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
285 .extensions = "ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
286 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
287
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
288 #ifdef CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
289 AVOutputFormat ac3_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
290 "ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
291 "raw ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
292 "audio/x-ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
293 "ac3",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
294 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
295 CODEC_ID_AC3,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
296 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
297 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
298 raw_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
299 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
300 };
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
301 #endif //CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
302
473
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
303 AVInputFormat h261_iformat = {
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
304 "h261",
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
305 "raw h261",
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
306 0,
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
307 h261_probe,
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
308 video_read_header,
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
309 raw_read_partial_packet,
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
310 raw_read_close,
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
311 .extensions = "h261",
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
312 .value = CODEC_ID_H261,
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
313 };
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
314
135
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
315 AVInputFormat h263_iformat = {
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
316 "h263",
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
317 "raw h263",
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
318 0,
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
319 h263_probe,
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
320 video_read_header,
389
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
321 raw_read_partial_packet,
135
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
322 raw_read_close,
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
323 // .extensions = "h263", //FIXME remove after writing mpeg4_probe
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
324 .value = CODEC_ID_H263,
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
325 };
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
326
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
327 #ifdef CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
328 AVOutputFormat h263_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
329 "h263",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
330 "raw h263",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
331 "video/x-h263",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
332 "h263",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
333 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
334 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
335 CODEC_ID_H263,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
336 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
337 raw_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
338 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
339 };
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
340 #endif //CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
341
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
342 AVInputFormat m4v_iformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
343 "m4v",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
344 "raw MPEG4 video format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
345 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
346 NULL /*mpegvideo_probe*/,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
347 video_read_header,
389
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
348 raw_read_partial_packet,
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
349 raw_read_close,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
350 .extensions = "m4v", //FIXME remove after writing mpeg4_probe
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
351 .value = CODEC_ID_MPEG4,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
352 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
353
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
354 #ifdef CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
355 AVOutputFormat m4v_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
356 "m4v",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
357 "raw MPEG4 video format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
358 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
359 "m4v",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
360 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
361 CODEC_ID_NONE,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
362 CODEC_ID_MPEG4,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
363 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
364 raw_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
365 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
366 };
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
367 #endif //CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
368
100
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
369 AVInputFormat h264_iformat = {
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
370 "h264",
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
371 "raw H264 video format",
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
372 0,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
373 NULL /*mpegvideo_probe*/,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
374 video_read_header,
389
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
375 raw_read_partial_packet,
100
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
376 raw_read_close,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
377 .extensions = "h26l,h264", //FIXME remove after writing mpeg4_probe
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
378 .value = CODEC_ID_H264,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
379 };
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
380
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
381 #ifdef CONFIG_ENCODERS
100
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
382 AVOutputFormat h264_oformat = {
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
383 "h264",
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
384 "raw H264 video format",
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
385 NULL,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
386 "h264",
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
387 0,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
388 CODEC_ID_NONE,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
389 CODEC_ID_H264,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
390 raw_write_header,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
391 raw_write_packet,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
392 raw_write_trailer,
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
393 };
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
394 #endif //CONFIG_ENCODERS
100
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
395
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
396 AVInputFormat mpegvideo_iformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
397 "mpegvideo",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
398 "MPEG video",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
399 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
400 mpegvideo_probe,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
401 video_read_header,
389
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
402 raw_read_partial_packet,
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
403 raw_read_close,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
404 .value = CODEC_ID_MPEG1VIDEO,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
405 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
406
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
407 #ifdef CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
408 AVOutputFormat mpeg1video_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
409 "mpeg1video",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
410 "MPEG video",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
411 "video/x-mpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
412 "mpg,mpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
413 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
414 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
415 CODEC_ID_MPEG1VIDEO,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
416 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
417 raw_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
418 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
419 };
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
420 #endif //CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
421
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
422 AVInputFormat mjpeg_iformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
423 "mjpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
424 "MJPEG video",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
425 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
426 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
427 video_read_header,
389
e14fcd57ad2f decode latency patch by (Leon van Stuivenberg <l dot vanstuivenberg at chello dot nl>)
michael
parents: 306
diff changeset
428 raw_read_partial_packet,
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
429 raw_read_close,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
430 .extensions = "mjpg,mjpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
431 .value = CODEC_ID_MJPEG,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
432 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
433
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
434 #ifdef CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
435 AVOutputFormat mjpeg_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
436 "mjpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
437 "MJPEG video",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
438 "video/x-mjpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
439 "mjpg,mjpeg",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
440 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
441 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
442 CODEC_ID_MJPEG,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
443 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
444 raw_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
445 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
446 };
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
447 #endif //CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
448
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
449 /* pcm formats */
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
450
306
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
451 #define PCMINPUTDEF(name, long_name, ext, codec) \
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
452 AVInputFormat pcm_ ## name ## _iformat = {\
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
453 #name,\
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
454 long_name,\
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
455 0,\
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
456 NULL,\
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
457 raw_read_header,\
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
458 raw_read_packet,\
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
459 raw_read_close,\
306
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
460 pcm_read_seek,\
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
461 .extensions = ext,\
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
462 .value = codec,\
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
463 };
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
464
306
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
465 #if !defined(CONFIG_ENCODERS) && defined(CONFIG_DECODERS)
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
466
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
467 #define PCMDEF(name, long_name, ext, codec) \
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
468 PCMINPUTDEF(name, long_name, ext, codec)
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
469
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
470 #else
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
471
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
472 #define PCMDEF(name, long_name, ext, codec) \
306
e7a8d4dd8e14 seek support for PCM formats
bellard
parents: 277
diff changeset
473 PCMINPUTDEF(name, long_name, ext, codec)\
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
474 \
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
475 AVOutputFormat pcm_ ## name ## _oformat = {\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
476 #name,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
477 long_name,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
478 NULL,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
479 ext,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
480 0,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
481 codec,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
482 0,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
483 raw_write_header,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
484 raw_write_packet,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
485 raw_write_trailer,\
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
486 };
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
487 #endif //CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
488
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
489 #ifdef WORDS_BIGENDIAN
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
490 #define BE_DEF(s) s
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
491 #define LE_DEF(s) NULL
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
492 #else
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
493 #define BE_DEF(s) NULL
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
494 #define LE_DEF(s) s
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
495 #endif
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
496
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
497
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
498 PCMDEF(s16le, "pcm signed 16 bit little endian format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
499 LE_DEF("sw"), CODEC_ID_PCM_S16LE)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
500
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
501 PCMDEF(s16be, "pcm signed 16 bit big endian format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
502 BE_DEF("sw"), CODEC_ID_PCM_S16BE)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
503
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
504 PCMDEF(u16le, "pcm unsigned 16 bit little endian format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
505 LE_DEF("uw"), CODEC_ID_PCM_U16LE)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
506
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
507 PCMDEF(u16be, "pcm unsigned 16 bit big endian format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
508 BE_DEF("uw"), CODEC_ID_PCM_U16BE)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
509
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
510 PCMDEF(s8, "pcm signed 8 bit format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
511 "sb", CODEC_ID_PCM_S8)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
512
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
513 PCMDEF(u8, "pcm unsigned 8 bit format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
514 "ub", CODEC_ID_PCM_U8)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
515
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
516 PCMDEF(mulaw, "pcm mu law format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
517 "ul", CODEC_ID_PCM_MULAW)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
518
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
519 PCMDEF(alaw, "pcm A law format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
520 "al", CODEC_ID_PCM_ALAW)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
521
64
b0e0eb595e29 * static,const,compiler warning cleanup
kabi
parents: 63
diff changeset
522 static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
523 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
524 int packet_size, ret, width, height;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
525 AVStream *st = s->streams[0];
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
526
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
527 width = st->codec.width;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
528 height = st->codec.height;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
529
128
45633cd5518a * introducing new public interface in imgconvert.c
romansh
parents: 126
diff changeset
530 packet_size = avpicture_get_size(st->codec.pix_fmt, width, height);
45633cd5518a * introducing new public interface in imgconvert.c
romansh
parents: 126
diff changeset
531 if (packet_size < 0)
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
532 av_abort();
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
533
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
534 if (av_new_packet(pkt, packet_size) < 0)
482
0fdc96c2f2fe sweeping change from -EIO -> AVERROR_IO
melanson
parents: 473
diff changeset
535 return AVERROR_IO;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
536
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
537 pkt->stream_index = 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
538 #if 0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
539 /* bypass buffered I/O */
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
540 ret = url_read(url_fileno(&s->pb), pkt->data, pkt->size);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
541 #else
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
542 ret = get_buffer(&s->pb, pkt->data, pkt->size);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
543 #endif
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
544 if (ret != pkt->size) {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
545 av_free_packet(pkt);
482
0fdc96c2f2fe sweeping change from -EIO -> AVERROR_IO
melanson
parents: 473
diff changeset
546 return AVERROR_IO;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
547 } else {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
548 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
549 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
550 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
551
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
552 AVInputFormat rawvideo_iformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
553 "rawvideo",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
554 "raw video format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
555 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
556 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
557 raw_read_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
558 rawvideo_read_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
559 raw_read_close,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
560 .extensions = "yuv",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
561 .value = CODEC_ID_RAWVIDEO,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
562 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
563
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
564 #ifdef CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
565 AVOutputFormat rawvideo_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
566 "rawvideo",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
567 "raw video format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
568 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
569 "yuv",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
570 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
571 CODEC_ID_NONE,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
572 CODEC_ID_RAWVIDEO,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
573 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
574 raw_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
575 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
576 };
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
577 #endif //CONFIG_ENCODERS
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
578
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
579 #ifdef CONFIG_ENCODERS
468
60f897e8dd2d pass AVPacket into av_write_frame()
michael
parents: 464
diff changeset
580 static int null_write_packet(struct AVFormatContext *s, AVPacket *pkt)
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
581 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
582 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
583 }
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
584
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
585 AVOutputFormat null_oformat = {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
586 "null",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
587 "null video format",
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
588 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
589 NULL,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
590 0,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
591 #ifdef WORDS_BIGENDIAN
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
592 CODEC_ID_PCM_S16BE,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
593 #else
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
594 CODEC_ID_PCM_S16LE,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
595 #endif
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
596 CODEC_ID_RAWVIDEO,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
597 raw_write_header,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
598 null_write_packet,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
599 raw_write_trailer,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
600 .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE,
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
601 };
277
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
602 #endif //CONFIG_ENCODERS
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
603
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
604 #ifndef CONFIG_ENCODERS
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
605 #define av_register_output_format(format)
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
606 #endif
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
607 #ifndef CONFIG_DECODERS
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
608 #define av_register_input_format(format)
a313e1080322 disable encoders where appropriate (patch courtesy of BERO
melanson
parents: 241
diff changeset
609 #endif
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
610
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
611 int raw_init(void)
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
612 {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
613 av_register_input_format(&ac3_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
614 av_register_output_format(&ac3_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
615
473
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
616 av_register_input_format(&h261_iformat);
e0a66a870b7f h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
michael
parents: 468
diff changeset
617
135
56590088f801 truncated h263 decoding support / H263-ES "demuxer"
michaelni
parents: 128
diff changeset
618 av_register_input_format(&h263_iformat);
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
619 av_register_output_format(&h263_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
620
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
621 av_register_input_format(&m4v_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
622 av_register_output_format(&m4v_oformat);
100
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
623
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
624 av_register_input_format(&h264_iformat);
fa3ebf0d0270 H264 decoder & demuxer
michaelni
parents: 85
diff changeset
625 av_register_output_format(&h264_oformat);
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
626
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
627 av_register_input_format(&mpegvideo_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
628 av_register_output_format(&mpeg1video_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
629
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
630 av_register_input_format(&mjpeg_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
631 av_register_output_format(&mjpeg_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
632
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
633 av_register_input_format(&pcm_s16le_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
634 av_register_output_format(&pcm_s16le_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
635 av_register_input_format(&pcm_s16be_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
636 av_register_output_format(&pcm_s16be_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
637 av_register_input_format(&pcm_u16le_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
638 av_register_output_format(&pcm_u16le_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
639 av_register_input_format(&pcm_u16be_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
640 av_register_output_format(&pcm_u16be_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
641 av_register_input_format(&pcm_s8_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
642 av_register_output_format(&pcm_s8_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
643 av_register_input_format(&pcm_u8_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
644 av_register_output_format(&pcm_u8_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
645 av_register_input_format(&pcm_mulaw_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
646 av_register_output_format(&pcm_mulaw_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
647 av_register_input_format(&pcm_alaw_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
648 av_register_output_format(&pcm_alaw_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
649
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
650 av_register_input_format(&rawvideo_iformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
651 av_register_output_format(&rawvideo_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
652
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
653 av_register_output_format(&null_oformat);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
654 return 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
655 }