Commit 6638207b authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  Fix 'heigth' vs. 'height' typos.
  lavc/lavf: use unique private classes.
  lavc: use designated initializers for av_codec_context_class

Conflicts:
	libavdevice/fbdev.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 2c1c0c50 e83c2dde
......@@ -486,13 +486,13 @@ the computed values for @var{x} and @var{y}. They are evaluated for
each new frame.
@item in_w, in_h
the input width and heigth
the input width and height
@item iw, ih
same as @var{in_w} and @var{in_h}
@item out_w, out_h
the output (cropped) width and heigth
the output (cropped) width and height
@item ow, oh
same as @var{out_w} and @var{out_h}
......@@ -1548,13 +1548,13 @@ the corresponding mathematical approximated values for e
(euler number), pi (greek PI), phi (golden ratio)
@item in_w, in_h
the input video width and heigth
the input video width and height
@item iw, ih
same as @var{in_w} and @var{in_h}
@item out_w, out_h
the output width and heigth, that is the size of the padded area as
the output width and height, that is the size of the padded area as
specified by the @var{width} and @var{height} expressions
@item ow, oh
......@@ -1667,13 +1667,13 @@ the corresponding mathematical approximated values for e
(euler number), pi (greek PI), phi (golden ratio)
@item in_w, in_h
the input width and heigth
the input width and height
@item iw, ih
same as @var{in_w} and @var{in_h}
@item out_w, out_h
the output (cropped) width and heigth
the output (cropped) width and height
@item ow, oh
same as @var{out_w} and @var{out_h}
......@@ -2318,7 +2318,7 @@ alpha specifier. The default value is "black".
@item frame_size
Specify the size of the sourced video, it may be a string of the form
@var{width}x@var{heigth}, or the name of a size abbreviation. The
@var{width}x@var{height}, or the name of a size abbreviation. The
default value is "320x240".
@item frame_rate
......
......@@ -1463,7 +1463,7 @@ static const AVOption options[] = {
};
static const AVClass ac3_decoder_class = {
.class_name = "(E-)AC3 decoder",
.class_name = "AC3 decoder",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
......@@ -1485,6 +1485,12 @@ AVCodec ff_ac3_decoder = {
};
#if CONFIG_EAC3_DECODER
static const AVClass eac3_decoder_class = {
.class_name = "E-AC3 decoder",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
};
AVCodec ff_eac3_decoder = {
.name = "eac3",
.type = AVMEDIA_TYPE_AUDIO,
......@@ -1497,6 +1503,6 @@ AVCodec ff_eac3_decoder = {
.sample_fmts = (const enum AVSampleFormat[]) {
AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
},
.priv_class = &ac3_decoder_class,
.priv_class = &eac3_decoder_class,
};
#endif
......@@ -122,7 +122,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
ctx->height = AV_RB16(buf + 0x18);
ctx->width = AV_RB16(buf + 0x1a);
av_dlog(ctx->avctx, "width %d, heigth %d\n", ctx->width, ctx->height);
av_dlog(ctx->avctx, "width %d, height %d\n", ctx->width, ctx->height);
if (buf[0x21] & 0x40) {
ctx->avctx->pix_fmt = PIX_FMT_YUV422P10;
......
......@@ -517,7 +517,14 @@ static const AVOption options[]={
#undef D
#undef DEFAULT
static const AVClass av_codec_context_class = { "AVCodecContext", context_to_name, options, LIBAVUTIL_VERSION_INT, OFFSET(log_level_offset), .opt_find = opt_find};
static const AVClass av_codec_context_class = {
.class_name = "AVCodecContext",
.item_name = context_to_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
.log_level_offset_offset = OFFSET(log_level_offset),
.opt_find = opt_find,
};
void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType codec_type){
int flags=0;
......
......@@ -84,7 +84,7 @@ typedef struct {
int64_t time_frame; ///< time for the next frame to output (in 1/1000000 units)
int fd; ///< framebuffer device file descriptor
int width, heigth; ///< assumed frame resolution
int width, height; ///< assumed frame resolution
int frame_linesize; ///< linesize of the output frame, it is assumed to be constant
int bytes_per_pixel;
......@@ -147,10 +147,10 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx,
}
fbdev->width = fbdev->varinfo.xres;
fbdev->heigth = fbdev->varinfo.yres;
fbdev->height = fbdev->varinfo.yres;
fbdev->bytes_per_pixel = (fbdev->varinfo.bits_per_pixel + 7) >> 3;
fbdev->frame_linesize = fbdev->width * fbdev->bytes_per_pixel;
fbdev->frame_size = fbdev->frame_linesize * fbdev->heigth;
fbdev->frame_size = fbdev->frame_linesize * fbdev->height;
fbdev->time_frame = AV_NOPTS_VALUE;
fbdev->data = mmap(NULL, fbdev->fixinfo.smem_len, PROT_READ, MAP_SHARED, fbdev->fd, 0);
if (fbdev->data == MAP_FAILED) {
......@@ -162,15 +162,15 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx,
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = CODEC_ID_RAWVIDEO;
st->codec->width = fbdev->width;
st->codec->height = fbdev->heigth;
st->codec->height = fbdev->height;
st->codec->pix_fmt = pix_fmt;
st->codec->time_base = (AVRational){fbdev->framerate_q.den, fbdev->framerate_q.num};
st->codec->bit_rate =
fbdev->width * fbdev->heigth * fbdev->bytes_per_pixel * av_q2d(fbdev->framerate_q) * 8;
fbdev->width * fbdev->height * fbdev->bytes_per_pixel * av_q2d(fbdev->framerate_q) * 8;
av_log(avctx, AV_LOG_INFO,
"w:%d h:%d bpp:%d pixfmt:%s fps:%d/%d bit_rate:%d\n",
fbdev->width, fbdev->heigth, fbdev->varinfo.bits_per_pixel,
fbdev->width, fbdev->height, fbdev->varinfo.bits_per_pixel,
av_pix_fmt_descriptors[pix_fmt].name,
fbdev->framerate_q.num, fbdev->framerate_q.den,
st->codec->bit_rate);
......@@ -225,7 +225,7 @@ static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt)
fbdev->varinfo.yoffset * fbdev->fixinfo.line_length;
pout = pkt->data;
for (i = 0; i < fbdev->heigth; i++) {
for (i = 0; i < fbdev->height; i++) {
memcpy(pout, pin, fbdev->frame_linesize);
pin += fbdev->fixinfo.line_length;
pout += fbdev->frame_linesize;
......
......@@ -469,15 +469,14 @@ static const AVOption options[] = {
{ NULL },
};
/* input */
#if CONFIG_IMAGE2_DEMUXER
static const AVClass img2_class = {
.class_name = "image2 demuxer",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
};
/* input */
#if CONFIG_IMAGE2_DEMUXER
AVInputFormat ff_image2_demuxer = {
.name = "image2",
.long_name = NULL_IF_CONFIG_SMALL("image2 sequence"),
......@@ -490,13 +489,19 @@ AVInputFormat ff_image2_demuxer = {
};
#endif
#if CONFIG_IMAGE2PIPE_DEMUXER
static const AVClass img2pipe_class = {
.class_name = "image2pipe demuxer",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
};
AVInputFormat ff_image2pipe_demuxer = {
.name = "image2pipe",
.long_name = NULL_IF_CONFIG_SMALL("piped image2 sequence"),
.priv_data_size = sizeof(VideoData),
.read_header = read_header,
.read_packet = read_packet,
.priv_class = &img2_class,
.priv_class = &img2pipe_class,
};
#endif
......
......@@ -48,11 +48,12 @@ static const AVOption options[] = {
{ NULL },
};
static const AVClass mov_muxer_class = {
.class_name = "MOV/3GP/MP4/3G2 muxer",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
#define MOV_CLASS(flavor)\
static const AVClass flavor ## _muxer_class = {\
.class_name = #flavor " muxer",\
.item_name = av_default_item_name,\
.option = options,\
.version = LIBAVUTIL_VERSION_INT,\
};
//FIXME support 64 bit variant with wide placeholders
......@@ -2351,6 +2352,7 @@ static int mov_write_trailer(AVFormatContext *s)
}
#if CONFIG_MOV_MUXER
MOV_CLASS(mov)
AVOutputFormat ff_mov_muxer = {
.name = "mov",
.long_name = NULL_IF_CONFIG_SMALL("MOV format"),
......@@ -2371,6 +2373,7 @@ AVOutputFormat ff_mov_muxer = {
};
#endif
#if CONFIG_TGP_MUXER
MOV_CLASS(tgp)
AVOutputFormat ff_tgp_muxer = {
.name = "3gp",
.long_name = NULL_IF_CONFIG_SMALL("3GP format"),
......@@ -2383,10 +2386,11 @@ AVOutputFormat ff_tgp_muxer = {
.write_trailer = mov_write_trailer,
.flags = AVFMT_GLOBALHEADER,
.codec_tag = (const AVCodecTag* const []){codec_3gp_tags, 0},
.priv_class = &mov_muxer_class,
.priv_class = &tgp_muxer_class,
};
#endif
#if CONFIG_MP4_MUXER
MOV_CLASS(mp4)
AVOutputFormat ff_mp4_muxer = {
.name = "mp4",
.long_name = NULL_IF_CONFIG_SMALL("MP4 format"),
......@@ -2404,10 +2408,11 @@ AVOutputFormat ff_mp4_muxer = {
.write_trailer = mov_write_trailer,
.flags = AVFMT_GLOBALHEADER,
.codec_tag = (const AVCodecTag* const []){ff_mp4_obj_type, 0},
.priv_class = &mov_muxer_class,
.priv_class = &mp4_muxer_class,
};
#endif
#if CONFIG_PSP_MUXER
MOV_CLASS(psp)
AVOutputFormat ff_psp_muxer = {
.name = "psp",
.long_name = NULL_IF_CONFIG_SMALL("PSP MP4 format"),
......@@ -2424,10 +2429,11 @@ AVOutputFormat ff_psp_muxer = {
.write_trailer = mov_write_trailer,
.flags = AVFMT_GLOBALHEADER,
.codec_tag = (const AVCodecTag* const []){ff_mp4_obj_type, 0},
.priv_class = &mov_muxer_class,
.priv_class = &psp_muxer_class,
};
#endif
#if CONFIG_TG2_MUXER
MOV_CLASS(tg2)
AVOutputFormat ff_tg2_muxer = {
.name = "3g2",
.long_name = NULL_IF_CONFIG_SMALL("3GP2 format"),
......@@ -2440,10 +2446,11 @@ AVOutputFormat ff_tg2_muxer = {
.write_trailer = mov_write_trailer,
.flags = AVFMT_GLOBALHEADER,
.codec_tag = (const AVCodecTag* const []){codec_3gp_tags, 0},
.priv_class = &mov_muxer_class,
.priv_class = &tg2_muxer_class,
};
#endif
#if CONFIG_IPOD_MUXER
MOV_CLASS(ipod)
AVOutputFormat ff_ipod_muxer = {
.name = "ipod",
.long_name = NULL_IF_CONFIG_SMALL("iPod H.264 MP4 format"),
......@@ -2457,6 +2464,6 @@ AVOutputFormat ff_ipod_muxer = {
.write_trailer = mov_write_trailer,
.flags = AVFMT_GLOBALHEADER,
.codec_tag = (const AVCodecTag* const []){codec_ipod_tags, 0},
.priv_class = &mov_muxer_class,
.priv_class = &ipod_muxer_class,
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment