summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/ve_rawrgb.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-10 23:23:36 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-10 23:23:36 +0000
commit4d865e3f47633c627745c12f0520321b0df2fd74 (patch)
tree64bc0b958b07cad63d1f8362fbd591a8e1e05ad4 /libmpcodecs/ve_rawrgb.c
parentd04cd780992b26fa20001c795ea262125935adb4 (diff)
downloadmpv-4d865e3f47633c627745c12f0520321b0df2fd74.tar.bz2
mpv-4d865e3f47633c627745c12f0520321b0df2fd74.tar.xz
encoders
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5551 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/ve_rawrgb.c')
-rw-r--r--libmpcodecs/ve_rawrgb.c81
1 files changed, 81 insertions, 0 deletions
diff --git a/libmpcodecs/ve_rawrgb.c b/libmpcodecs/ve_rawrgb.c
new file mode 100644
index 0000000000..813c66d3b7
--- /dev/null
+++ b/libmpcodecs/ve_rawrgb.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 "aviwrite.h"
+
+#include "../libvo/img_format.h"
+#include "../mp_image.h"
+#include "vf.h"
+
+//===========================================================================//
+
+struct vf_priv_s {
+ aviwrite_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_BGR24) return 1;
+ return 0;
+}
+
+static void put_image(struct vf_instance_s* vf, mp_image_t *mpi){
+ mux_v->buffer=mpi->planes[0];
+ mencoder_write_chunk(mux_v, mpi->width*mpi->height*3, 0x10);
+}
+
+//===========================================================================//
+
+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=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=0;
+ mux_v->bih->biPlanes=1;
+
+ return 1;
+}
+
+vf_info_t ve_info_rawrgb = {
+ "rawrgb encoder",
+ "rawrgb",
+ "A'rpi",
+ "for internal use by mencoder",
+ vf_open
+};
+
+//===========================================================================//