annotate libmpcodecs/ve_rawrgb.c @ 11739:74d9297d937b

synced with 1.16
author paszczi
date Sat, 03 Jan 2004 17:39:25 +0000
parents c671e9adbe22
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5550
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
1 #include <stdio.h>
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
2 #include <stdlib.h>
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
3 #include <string.h>
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
4
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
5 #include "../config.h"
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
6 #include "../mp_msg.h"
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
7
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
8 #include "codec-cfg.h"
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
9 #include "stream.h"
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
10 #include "demuxer.h"
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
11 #include "stheader.h"
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
12
8585
27da710563c2 the long-waited MUXER layer, and new MPEG-PS muxer
arpi
parents: 7368
diff changeset
13 #include "muxer.h"
5550
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
14
5607
1972c3475d93 mp_image.h and img_format.h moved to libmpcodecs
arpi
parents: 5565
diff changeset
15 #include "img_format.h"
1972c3475d93 mp_image.h and img_format.h moved to libmpcodecs
arpi
parents: 5565
diff changeset
16 #include "mp_image.h"
5550
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
17 #include "vf.h"
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
18
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
19 //===========================================================================//
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
20
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
21 struct vf_priv_s {
8585
27da710563c2 the long-waited MUXER layer, and new MPEG-PS muxer
arpi
parents: 7368
diff changeset
22 muxer_stream_t* mux;
5550
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
23 };
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
24 #define mux_v (vf->priv->mux)
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
25
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
26 static int config(struct vf_instance_s* vf,
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
27 int width, int height, int d_width, int d_height,
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
28 unsigned int flags, unsigned int outfmt){
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
29
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
30 mux_v->bih->biWidth=width;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
31 mux_v->bih->biHeight=height;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
32 mux_v->bih->biSizeImage=mux_v->bih->biWidth*mux_v->bih->biHeight*(mux_v->bih->biBitCount/8);
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
33
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
34 return 1;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
35 }
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
36
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
37 static int control(struct vf_instance_s* vf, int request, void* data){
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
38
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
39 return CONTROL_UNKNOWN;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
40 }
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
41
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
42 static int query_format(struct vf_instance_s* vf, unsigned int fmt){
5895
e69d0434d92b Uncompressed avi files are stored upside down.
ksorim
parents: 5607
diff changeset
43 if(fmt==IMGFMT_BGR24) return 3 | VFCAP_FLIPPED;
5550
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
44 return 0;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
45 }
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
46
7368
a894e99c1e51 changing return type of put_image void->int
arpi
parents: 7127
diff changeset
47 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){
5550
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
48 mux_v->buffer=mpi->planes[0];
9014
c671e9adbe22 Cleanup of the muxer API, func parameters muxer & muxer_f eliminated.
arpi
parents: 8585
diff changeset
49 muxer_write_chunk(mux_v, mpi->width*mpi->height*3, 0x10);
7368
a894e99c1e51 changing return type of put_image void->int
arpi
parents: 7127
diff changeset
50 return 1;
5550
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
51 }
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
52
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
53 //===========================================================================//
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
54
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
55 static int vf_open(vf_instance_t *vf, char* args){
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
56 vf->config=config;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
57 vf->control=control;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
58 vf->query_format=query_format;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
59 vf->put_image=put_image;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
60 vf->priv=malloc(sizeof(struct vf_priv_s));
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
61 memset(vf->priv,0,sizeof(struct vf_priv_s));
8585
27da710563c2 the long-waited MUXER layer, and new MPEG-PS muxer
arpi
parents: 7368
diff changeset
62 vf->priv->mux=(muxer_stream_t*)args;
5550
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
63
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
64 mux_v->bih=malloc(sizeof(BITMAPINFOHEADER));
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
65 mux_v->bih->biSize=sizeof(BITMAPINFOHEADER);
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
66 mux_v->bih->biWidth=0;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
67 mux_v->bih->biHeight=0;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
68 mux_v->bih->biCompression=0;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
69 mux_v->bih->biPlanes=1;
5551
73978162b6a1 soem fixes
arpi
parents: 5550
diff changeset
70 mux_v->bih->biBitCount=24;
5550
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
71
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
72 return 1;
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
73 }
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
74
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
75 vf_info_t ve_info_rawrgb = {
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
76 "rawrgb encoder",
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
77 "rawrgb",
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
78 "A'rpi",
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
79 "for internal use by mencoder",
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
80 vf_open
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
81 };
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
82
7d1dfb59c6c0 encoders
arpi
parents:
diff changeset
83 //===========================================================================//