1 /*
2 * RAW video demuxer
3 * Copyright (c) 2001 Fabrice Bellard
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
28
30 const AVClass *
class;
/**< Class for private options. */
31 int width,
height;
/**< Integers describing video size, set by a private option. */
35
36
38 {
42 int packet_size;
43
45 if (!st)
47
49
51
56 }
57
59
64 if (packet_size < 0)
65 return packet_size;
69
70 return 0;
71 }
72
73
75 {
76 int ret;
77
80
82 if (ret < 0)
83 return ret;
84 return 0;
85 }
86
87 #define OFFSET(x) offsetof(RawVideoDemuxerContext, x)
88 #define DEC AV_OPT_FLAG_DECODING_PARAM
94 };
95
101 };
102
110 .extensions = "yuv,cif,qcif,rgb",
112 .priv_class = &rawvideo_demuxer_class,
113 };
static enum AVPixelFormat pix_fmt
int64_t bit_rate
the average bitrate
#define LIBAVUTIL_VERSION_INT
int64_t pos
byte position in stream, -1 if unknown
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static const AVOption rawvideo_options[]
static const AVClass rawvideo_demuxer_class
static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVRational framerate
AVRational describing framerate, set by a private option.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, int align)
Return the size in bytes of the amount of data required to store an image with the given parameters...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
AVCodecContext * codec
Codec context associated with this stream.
int width
picture width / height.
static int rawvideo_read_header(AVFormatContext *ctx)
static int read_header(FFV1Context *f)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
enum AVMediaType codec_type
AVIOContext * pb
I/O context.
int height
Integers describing video size, set by a private option.
AVInputFormat ff_rawvideo_demuxer
Describe the class of an AVClass context structure.
rational number numerator/denominator
offset must point to AVRational
char * pixel_format
Set by a private option.
offset must point to two consecutive integers
struct AVInputFormat * iformat
The input container format.
void * priv_data
Format private data.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
AVPixelFormat
Pixel format.
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...