diff options
author | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-12-08 12:44:11 +0000 |
---|---|---|
committer | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2003-12-08 12:44:11 +0000 |
commit | 27c454b1395cb7578f4a0cd7fd4112c74bcea4dd (patch) | |
tree | 26912aeef55d2904526f3f46f003705c4a5c0bb5 /libmpcodecs | |
parent | e7d9078afcad18cae14e4653b1e945926471fbac (diff) | |
download | mpv-27c454b1395cb7578f4a0cd7fd4112c74bcea4dd.tar.bz2 mpv-27c454b1395cb7578f4a0cd7fd4112c74bcea4dd.tar.xz |
RAWYUV output in MEncoder. Patch by Tuukka Toivonen <tuukkat@ee.oulu.fi>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11582 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/Makefile | 2 | ||||
-rw-r--r-- | libmpcodecs/ve.c | 2 | ||||
-rw-r--r-- | libmpcodecs/ve_rawyuv.c | 81 |
3 files changed, 84 insertions, 1 deletions
diff --git a/libmpcodecs/Makefile b/libmpcodecs/Makefile index 8eca67280b..65bc0b9398 100644 --- a/libmpcodecs/Makefile +++ b/libmpcodecs/Makefile @@ -19,7 +19,7 @@ ifeq ($(HAVE_FFPOSTPROCESS),yes) VFILTER_SRCS += vf_pp.c endif -ENCODER_SRCS=ve.c ve_divx4.c ve_lavc.c ve_vfw.c ve_rawrgb.c ve_libdv.c ve_xvid.c ve_xvid4.c ve_qtvideo.c ve_nuv.c +ENCODER_SRCS=ve.c ve_divx4.c ve_lavc.c ve_vfw.c ve_rawrgb.c ve_rawyuv.c ve_libdv.c ve_xvid.c ve_xvid4.c ve_qtvideo.c ve_nuv.c NATIVE_SRCS=native/RTjpegN.c native/cinepak.c native/fli.c native/minilzo.c native/msvidc.c native/nuppelvideo.c native/qtrle.c native/qtrpza.c native/qtsmc.c native/roqav.c native/xa_gsm.c native/decode144.c native/decode288.c diff --git a/libmpcodecs/ve.c b/libmpcodecs/ve.c index 1e9dd3dfe9..1b6aba9326 100644 --- a/libmpcodecs/ve.c +++ b/libmpcodecs/ve.c @@ -13,6 +13,7 @@ extern vf_info_t ve_info_divx4; extern vf_info_t ve_info_lavc; extern vf_info_t ve_info_vfw; extern vf_info_t ve_info_rawrgb; +extern vf_info_t ve_info_rawyuv; extern vf_info_t ve_info_libdv; extern vf_info_t ve_info_xvid; extern vf_info_t ve_info_qtvideo; @@ -33,6 +34,7 @@ static vf_info_t* encoder_list[]={ &ve_info_libdv, #endif &ve_info_rawrgb, + &ve_info_rawyuv, #if defined(HAVE_XVID3) || defined(HAVE_XVID4) &ve_info_xvid, #endif diff --git a/libmpcodecs/ve_rawyuv.c b/libmpcodecs/ve_rawyuv.c new file mode 100644 index 0000000000..ea322c39ad --- /dev/null +++ b/libmpcodecs/ve_rawyuv.c @@ -0,0 +1,81 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "../config.h" +#include "../mp_msg.h" + +#include "codec-cfg.h" +#include "stream.h" +#include "demuxer.h" +#include "stheader.h" + +#include "muxer.h" + +#include "img_format.h" +#include "mp_image.h" +#include "vf.h" + +//===========================================================================// + +struct vf_priv_s { + muxer_stream_t* mux; +}; +#define mux_v (vf->priv->mux) + +static int config(struct vf_instance_s *vf, + int width, int height, int d_width, int d_height, + unsigned int flags, unsigned int outfmt) +{ + mux_v->bih->biWidth = width; + mux_v->bih->biHeight = height; + mux_v->bih->biSizeImage = mux_v->bih->biWidth*mux_v->bih->biHeight*(mux_v->bih->biBitCount/8); + return 1; +} + +static int control(struct vf_instance_s *vf, int request, void *data) { + return CONTROL_UNKNOWN; +} + +static int query_format(struct vf_instance_s *vf, unsigned int fmt) { + if (fmt==IMGFMT_I420) return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW; + return 0; +} + +static int put_image(struct vf_instance_s *vf, mp_image_t *mpi) { + mux_v->buffer = mpi->planes[0]; + muxer_write_chunk(mux_v, mpi->width*mpi->height*3/2, 0x10); + return 1; +} + +//===========================================================================// + +static int vf_open(vf_instance_t *vf, char* args){ + vf->config = config; + vf->control = control; + vf->query_format = query_format; + vf->put_image = put_image; + vf->priv = malloc(sizeof(struct vf_priv_s)); + memset(vf->priv, 0, sizeof(struct vf_priv_s)); + vf->priv->mux = (muxer_stream_t*)args; + + mux_v->bih = malloc(sizeof(BITMAPINFOHEADER)); + mux_v->bih->biSize = sizeof(BITMAPINFOHEADER); + mux_v->bih->biWidth = 0; + mux_v->bih->biHeight = 0; + mux_v->bih->biCompression = mmioFOURCC('I', '4', '2', '0'); + mux_v->bih->biPlanes = 3; + mux_v->bih->biBitCount = 12; + + return 1; +} + +vf_info_t ve_info_rawyuv = { + "rawyuv encoder", + "rawyuv", + "tuukkat@ee.oulu.fi", + "Based on rawrgb", + vf_open +}; + +//===========================================================================// |