5550
|
1 #include <stdio.h>
|
|
2 #include <stdlib.h>
|
|
3 #include <string.h>
|
|
4
|
|
5 #include "../config.h"
|
|
6 #include "../mp_msg.h"
|
|
7
|
|
8 #include "codec-cfg.h"
|
|
9 #include "stream.h"
|
|
10 #include "demuxer.h"
|
|
11 #include "stheader.h"
|
|
12
|
|
13 #include "aviwrite.h"
|
|
14
|
5607
|
15 #include "img_format.h"
|
|
16 #include "mp_image.h"
|
5550
|
17 #include "vf.h"
|
|
18
|
|
19 //===========================================================================//
|
|
20
|
|
21 struct vf_priv_s {
|
|
22 aviwrite_stream_t* mux;
|
|
23 };
|
|
24 #define mux_v (vf->priv->mux)
|
|
25
|
|
26 static int config(struct vf_instance_s* vf,
|
|
27 int width, int height, int d_width, int d_height,
|
|
28 unsigned int flags, unsigned int outfmt){
|
|
29
|
|
30 mux_v->bih->biWidth=width;
|
|
31 mux_v->bih->biHeight=height;
|
|
32 mux_v->bih->biSizeImage=mux_v->bih->biWidth*mux_v->bih->biHeight*(mux_v->bih->biBitCount/8);
|
|
33
|
|
34 return 1;
|
|
35 }
|
|
36
|
|
37 static int control(struct vf_instance_s* vf, int request, void* data){
|
|
38
|
|
39 return CONTROL_UNKNOWN;
|
|
40 }
|
|
41
|
|
42 static int query_format(struct vf_instance_s* vf, unsigned int fmt){
|
5895
|
43 if(fmt==IMGFMT_BGR24) return 3 | VFCAP_FLIPPED;
|
5550
|
44 return 0;
|
|
45 }
|
|
46
|
|
47 static void put_image(struct vf_instance_s* vf, mp_image_t *mpi){
|
|
48 mux_v->buffer=mpi->planes[0];
|
|
49 mencoder_write_chunk(mux_v, mpi->width*mpi->height*3, 0x10);
|
|
50 }
|
|
51
|
|
52 //===========================================================================//
|
|
53
|
|
54 static int vf_open(vf_instance_t *vf, char* args){
|
|
55 vf->config=config;
|
|
56 vf->control=control;
|
|
57 vf->query_format=query_format;
|
|
58 vf->put_image=put_image;
|
|
59 vf->priv=malloc(sizeof(struct vf_priv_s));
|
|
60 memset(vf->priv,0,sizeof(struct vf_priv_s));
|
|
61 vf->priv->mux=args;
|
|
62
|
|
63 mux_v->bih=malloc(sizeof(BITMAPINFOHEADER));
|
|
64 mux_v->bih->biSize=sizeof(BITMAPINFOHEADER);
|
|
65 mux_v->bih->biWidth=0;
|
|
66 mux_v->bih->biHeight=0;
|
|
67 mux_v->bih->biCompression=0;
|
|
68 mux_v->bih->biPlanes=1;
|
5551
|
69 mux_v->bih->biBitCount=24;
|
5550
|
70
|
|
71 return 1;
|
|
72 }
|
|
73
|
|
74 vf_info_t ve_info_rawrgb = {
|
|
75 "rawrgb encoder",
|
|
76 "rawrgb",
|
|
77 "A'rpi",
|
|
78 "for internal use by mencoder",
|
|
79 vf_open
|
|
80 };
|
|
81
|
|
82 //===========================================================================//
|