annotate libmpcodecs/vf_bmovl.c @ 8363:ae74be3e2ed0

dump subtitles in SAMI format patch by Salvatore Falco <sfalco@studenti.ing.uniroma1.it>
author arpi
date Thu, 05 Dec 2002 00:07:59 +0000
parents fcd8c5d6795d
children 12e69a0d5a67
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7855
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
1 /* vf_bmovl.c v0.9.1 - BitMap OVerLay videofilter for MPlayer
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
2 *
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
3 * (C) 2002 Per Wigren <wigren@home.se>
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
4 * Licenced under the GNU General Public License
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
5 *
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
6 * Use MPlayer as a framebuffer to read bitmaps and commands from a FIFO
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
7 * and display them in the window.
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
8 *
7895
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
9 * Commands are:
7855
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
10 *
7895
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
11 * RGBA32 width height xpos ypos alpha clear
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
12 * * Followed by width*height*4 bytes of raw RGBA32 data.
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
13 * ABGR32 width height xpos ypos alpha clear
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
14 * * Followed by width*height*4 bytes of raw ABGR32 data.
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
15 * RGB24 width height xpos ypos alpha clear
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
16 * * Followed by width*height*3 bytes of raw RGB32 data.
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
17 * BGR24 width height xpos ypos alpha clear
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
18 * * Followed by width*height*3 bytes of raw BGR32 data.
7855
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
19 *
7895
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
20 * ALPHA width height xpos ypos alpha
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
21 * * Change alpha for area
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
22 * CLEAR width height xpos ypos
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
23 * * Clear area
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
24 * OPAQUE
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
25 * * Disable all alpha transparency!
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
26 * Send "ALPHA 0 0 0 0 0" to enable again!
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
27 * HIDE
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
28 * * Hide bitmap
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
29 * SHOW
fcd8c5d6795d updated comments
arpi
parents: 7858
diff changeset
30 * * Show bitmap
7855
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
31 *
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
32 * Arguments are:
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
33 * width, height Size of image/area
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
34 * xpos, ypos Start blitting at X/Y position
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
35 * alpha Set alpha difference. 0 means same as original.
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
36 * 255 makes everything opaque
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
37 * -255 makes everything transparent
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
38 * If you set this to -255 you can then send a sequence of
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
39 * ALPHA-commands to set the area to -225, -200, -175 etc
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
40 * for a nice fade-in-effect! ;)
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
41 * clear Clear the framebuffer before blitting. 1 means clear.
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
42 * If 0, the image will just be blitted on top of the old
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
43 * one, so you don't need to send 1,8MB of RGBA32 data
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
44 * everytime a small part of the screen is updated.
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
45 *
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
46 * Arguments for the filter are hidden:opaque:fifo
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
47 * For example 1:0:/tmp/myfifo.fifo will start the filter hidden, transparent
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
48 * and use /tmp/myfifo.fifo as the fifo.
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
49 *
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
50 * If you find bugs, please send me patches! ;)
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
51 *
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
52 * This filter was developed for use in Freevo (http://freevo.sf.net), but
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
53 * anyone is free to use it! ;)
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
54 *
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
55 */
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
56
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
57 #include <stdio.h>
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
58 #include <stdlib.h>
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
59 #include <string.h>
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
60 #include <unistd.h>
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
61 #include <errno.h>
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
62 #include <sys/stat.h>
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
63 #include <sys/types.h>
7858
6ccc14497807 time.h required for select()
arpi
parents: 7855
diff changeset
64 #include <sys/time.h>
7855
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
65 #include <fcntl.h>
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
66 #include "mp_image.h"
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
67 #include "vf.h"
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
68 #include "img_format.h"
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
69
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
70 #include "../libvo/fastmemcpy.h"
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
71
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
72 #define IS_RAWIMG 0x100
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
73 #define IS_IMG 0x200
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
74
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
75 #define NONE 0x000
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
76 #define IMG_RGBA32 0x101
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
77 #define IMG_ABGR32 0x102
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
78 #define IMG_RGB24 0x103
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
79 #define IMG_BGR24 0x104
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
80 #define IMG_PNG 0x201
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
81 #define CMD_CLEAR 0x001
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
82 #define CMD_ALPHA 0x002
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
83
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
84 #define TRUE 1
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
85 #define FALSE 0
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
86
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
87 #define MAX(a,b) ((a) > (b) ? (a) : (b))
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
88 #define MIN(a,b) ((a) < (b) ? (a) : (b))
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
89 #define INRANGE(a,b,c) ( ((a) < (b)) ? (b) : ( ((a) > (c)) ? (c) : (a) ) )
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
90
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
91 #define rgb2y(R,G,B) ( (0.257 * R) + (0.504 * G) + (0.098 * B) + 16 )
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
92 #define rgb2u(R,G,B) ( -(0.148 * R) - (0.291 * G) + (0.439 * B) + 128 )
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
93 #define rgb2v(R,G,B) ( (0.439 * R) - (0.368 * G) - (0.071 * B) + 128 )
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
94
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
95 #define DBG(a) (printf("DEBUG: %d\n", a))
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
96
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
97 struct vf_priv_s {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
98 int w, h, x1, y1, x2, y2;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
99 struct {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
100 unsigned char *y, *u, *v, *a, *oa;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
101 } bitmap;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
102 int stream_fd;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
103 fd_set stream_fdset;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
104 int opaque, hidden;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
105 };
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
106
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
107 static int
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
108 query_format(struct vf_instance_s* vf, unsigned int fmt){
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
109 if(fmt==IMGFMT_YV12) return VFCAP_CSP_SUPPORTED;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
110 return 0;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
111 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
112
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
113
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
114 static int
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
115 config(struct vf_instance_s* vf,
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
116 int width, int height, int d_width, int d_height,
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
117 unsigned int flags, unsigned int outfmt)
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
118 {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
119 vf->priv->bitmap.y = malloc( width*height );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
120 vf->priv->bitmap.u = malloc( width*height/4 );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
121 vf->priv->bitmap.v = malloc( width*height/4 );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
122 vf->priv->bitmap.a = malloc( width*height );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
123 vf->priv->bitmap.oa = malloc( width*height );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
124 if(!( vf->priv->bitmap.y &&
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
125 vf->priv->bitmap.u &&
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
126 vf->priv->bitmap.v &&
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
127 vf->priv->bitmap.a &&
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
128 vf->priv->bitmap.oa )) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
129 fprintf(stderr, "vf_bmovl: Could not allocate memory for bitmap buffer: %s\n", strerror(errno) );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
130 exit(10);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
131 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
132
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
133 // Set default to black...
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
134 memset( vf->priv->bitmap.u, 128, width*height/4 );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
135 memset( vf->priv->bitmap.v, 128, width*height/4 );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
136
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
137 vf->priv->w = vf->priv->x1 = width;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
138 vf->priv->h = vf->priv->y1 = height;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
139 vf->priv->y2 = vf->priv->x2 = 0;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
140
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
141 return vf_next_config(vf, width, height, d_width, d_height, flags, outfmt);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
142 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
143
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
144 static void
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
145 uninit(struct vf_instance_s *vf)
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
146 {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
147 if(vf->priv) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
148 free(vf->priv->bitmap.y);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
149 free(vf->priv->bitmap.u);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
150 free(vf->priv->bitmap.v);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
151 free(vf->priv->bitmap.a);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
152 free(vf->priv->bitmap.oa);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
153 free(vf->priv);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
154 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
155 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
156
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
157 static int
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
158 _read_cmd(int fd, char *cmd, char *args) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
159 int done=FALSE, pos=0;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
160 char tmp;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
161
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
162 while(!done) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
163 if(! read( fd, &tmp, 1 ) ) return FALSE;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
164 if( (tmp>='A' && tmp<='Z') || (tmp>='0' && tmp<='9') )
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
165 cmd[pos]=tmp;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
166 else if(tmp == ' ') {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
167 cmd[pos]='\0';
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
168 done=TRUE;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
169 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
170 else if(tmp == '\n') {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
171 cmd[pos]='\0';
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
172 args[0]='\0';
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
173 return TRUE;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
174 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
175 if(pos++>20) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
176 cmd[0]='\0';
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
177 return TRUE;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
178 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
179 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
180 done=FALSE; pos=0;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
181 while(!done) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
182 if(! read( fd, &tmp, 1 ) ) return FALSE;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
183 if( (tmp >= ' ') && (pos<100) ) args[pos]=tmp;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
184 else {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
185 args[pos]='\0';
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
186 done=TRUE;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
187 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
188 pos++;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
189 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
190 return TRUE;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
191 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
192
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
193
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
194 static int
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
195 put_image(struct vf_instance_s* vf, mp_image_t* mpi){
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
196 int buf_x=0, buf_y=0, buf_pos=0;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
197 int xpos=0, ypos=0, pos=0;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
198 unsigned char red=0, green=0, blue=0;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
199 int alpha;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
200 mp_image_t* dmpi;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
201
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
202 dmpi = vf_get_image(vf->next, mpi->imgfmt, MP_IMGTYPE_TEMP,
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
203 MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE,
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
204 mpi->w, mpi->h);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
205
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
206 memcpy( dmpi->planes[0], mpi->planes[0], mpi->stride[0] * mpi->height);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
207 memcpy( dmpi->planes[1], mpi->planes[1], mpi->stride[1] * mpi->chroma_height);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
208 memcpy( dmpi->planes[2], mpi->planes[2], mpi->stride[2] * mpi->chroma_height);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
209
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
210 if(vf->priv->stream_fd >= 0) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
211 struct timeval tv;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
212
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
213 FD_SET( vf->priv->stream_fd, &vf->priv->stream_fdset );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
214 tv.tv_sec=0; tv.tv_usec=0;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
215
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
216 if( select( vf->priv->stream_fd+1, &vf->priv->stream_fdset, NULL, NULL, &tv ) > 0) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
217 // We've got new data from the FIFO
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
218
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
219 char cmd[20], args[100];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
220 int imgw,imgh,imgx,imgy,clear,imgalpha,pxsz=1,command;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
221 unsigned char *buffer = NULL;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
222
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
223 if(! _read_cmd( vf->priv->stream_fd, cmd, args) ) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
224 fprintf(stderr, "\nvf_bmovl: Error reading commands: %s\n\n", strerror(errno));
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
225 exit(10);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
226 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
227 printf("\nDEBUG: Got: %s+%s\n", cmd, args);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
228
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
229 command=NONE;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
230 if ( strncmp(cmd,"RGBA32",6)==0 ) { pxsz=4; command = IMG_RGBA32; }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
231 else if( strncmp(cmd,"ABGR32",6)==0 ) { pxsz=4; command = IMG_ABGR32; }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
232 else if( strncmp(cmd,"RGB24" ,5)==0 ) { pxsz=3; command = IMG_RGB24; }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
233 else if( strncmp(cmd,"BGR24" ,5)==0 ) { pxsz=3; command = IMG_BGR24; }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
234 else if( strncmp(cmd,"CLEAR" ,5)==0 ) { pxsz=1; command = CMD_CLEAR; }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
235 else if( strncmp(cmd,"ALPHA" ,5)==0 ) { pxsz=1; command = CMD_ALPHA; }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
236 else if( strncmp(cmd,"OPAQUE",6)==0 ) vf->priv->opaque=TRUE;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
237 else if( strncmp(cmd,"SHOW", 4)==0 ) vf->priv->hidden=FALSE;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
238 else if( strncmp(cmd,"HIDE", 4)==0 ) vf->priv->hidden=TRUE;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
239 else if( strncmp(cmd,"FLUSH" ,5)==0 ) return vf_next_put_image(vf, dmpi);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
240 else {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
241 fprintf(stderr, "\nvf_bmovl: Unknown command: '%s'. Ignoring.\n", cmd);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
242 return vf_next_put_image(vf, dmpi);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
243 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
244
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
245 if(command == CMD_ALPHA) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
246 sscanf( args, "%d %d %d %d %d", &imgw, &imgh, &imgx, &imgy, &imgalpha);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
247 printf("\nDEBUG: ALPHA: %d %d %d %d %d\n\n",
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
248 imgw, imgh, imgx, imgy, imgalpha);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
249 if(imgw==0 && imgh==0) vf->priv->opaque=FALSE;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
250 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
251
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
252 if(command & IS_RAWIMG) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
253 sscanf( args, "%d %d %d %d %d %d",
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
254 &imgw, &imgh, &imgx, &imgy, &imgalpha, &clear);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
255 printf("\nDEBUG: RAWIMG: %d %d %d %d %d %d\n\n",
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
256 imgw, imgh, imgx, imgy, imgalpha, clear);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
257
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
258 buffer = malloc(imgw*imgh*pxsz);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
259 if(!buffer) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
260 fprintf(stderr, "\nvf_bmovl: Couldn't allocate temporary buffer! Skipping...\n\n");
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
261 return vf_next_put_image(vf, dmpi);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
262 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
263 printf("Got %d bytes...\n", read( vf->priv->stream_fd, buffer, (imgw*imgh*pxsz) ) );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
264
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
265 if(clear) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
266 memset( vf->priv->bitmap.y, 0, vf->priv->w*vf->priv->h );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
267 memset( vf->priv->bitmap.u, 128, vf->priv->w*vf->priv->h/4 );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
268 memset( vf->priv->bitmap.v, 128, vf->priv->w*vf->priv->h/4 );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
269 memset( vf->priv->bitmap.a, 0, vf->priv->w*vf->priv->h );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
270 memset( vf->priv->bitmap.oa, 0, vf->priv->w*vf->priv->h );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
271 vf->priv->x1 = dmpi->width;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
272 vf->priv->y1 = dmpi->height;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
273 vf->priv->x2 = vf->priv->y2 = 0;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
274 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
275 // Define how much of our bitmap that contains graphics!
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
276 vf->priv->x1 = MAX( 0, MIN(vf->priv->x1, imgx) );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
277 vf->priv->y1 = MAX( 0, MIN(vf->priv->y1, imgy) );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
278 vf->priv->x2 = MIN( vf->priv->w, MAX(vf->priv->x2, ( imgx + imgw)) );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
279 vf->priv->y2 = MIN( vf->priv->h, MAX(vf->priv->y2, ( imgy + imgh)) );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
280 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
281
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
282 if( command == CMD_CLEAR ) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
283 sscanf( args, "%d %d %d %d", &imgw, &imgh, &imgx, &imgy);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
284 printf("\nDEBUG: CLEAR: %d %d %d %d\n\n", imgw, imgh, imgx, imgy);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
285
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
286 for( ypos=imgy ; (ypos < (imgy+imgh)) && (ypos < vf->priv->y2) ; ypos++ ) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
287 memset( vf->priv->bitmap.y + (ypos*vf->priv->w) + imgx, 0, imgw );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
288 memset( vf->priv->bitmap.a + (ypos*vf->priv->w) + imgx, 0, imgw );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
289 memset( vf->priv->bitmap.oa + (ypos*vf->priv->w) + imgx, 0, imgw );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
290 if(ypos%2) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
291 memset( vf->priv->bitmap.u + ((ypos/2)*dmpi->stride[1]) + (imgx/2), 128, imgw/2 );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
292 memset( vf->priv->bitmap.v + ((ypos/2)*dmpi->stride[2]) + (imgx/2), 128, imgw/2 );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
293 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
294 } // Recalculate area that contains graphics
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
295 if( (imgx <= vf->priv->x1) && ( (imgw+imgx) >= vf->priv->x2) ) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
296 if( (imgy <= vf->priv->y1) && ( (imgy+imgh) >= vf->priv->y1) )
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
297 vf->priv->y1 = imgy+imgh;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
298 if( (imgy <= vf->priv->y2) && ( (imgy+imgh) >= vf->priv->y2) )
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
299 vf->priv->y2 = imgy;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
300 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
301 if( (imgy <= vf->priv->y1) && ( (imgy+imgh) >= vf->priv->y2) ) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
302 if( (imgx <= vf->priv->x1) && ( (imgx+imgw) >= vf->priv->x1) )
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
303 vf->priv->x1 = imgx+imgw;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
304 if( (imgx <= vf->priv->x2) && ( (imgx+imgw) >= vf->priv->x2) )
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
305 vf->priv->x2 = imgx;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
306 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
307 return vf_next_put_image(vf, dmpi);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
308 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
309
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
310 for( buf_y=0 ; (buf_y < imgh) && (buf_y < (vf->priv->h-imgy)) ; buf_y++ ) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
311 for( buf_x=0 ; (buf_x < (imgw*pxsz)) && (buf_x < ((vf->priv->w+imgx)*pxsz)) ; buf_x += pxsz ) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
312 if(command & IS_RAWIMG) buf_pos = (buf_y * imgw * pxsz) + buf_x;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
313 pos = ((buf_y+imgy) * vf->priv->w) + ((buf_x/pxsz)+imgx);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
314
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
315 switch(command) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
316 case IMG_RGBA32:
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
317 red = buffer[buf_pos+0];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
318 green = buffer[buf_pos+1];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
319 blue = buffer[buf_pos+2];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
320 alpha = buffer[buf_pos+3];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
321 break;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
322 case IMG_ABGR32:
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
323 alpha = buffer[buf_pos+0];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
324 blue = buffer[buf_pos+1];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
325 green = buffer[buf_pos+2];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
326 red = buffer[buf_pos+3];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
327 break;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
328 case IMG_RGB24:
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
329 red = buffer[buf_pos+0];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
330 green = buffer[buf_pos+1];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
331 blue = buffer[buf_pos+2];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
332 alpha = 0xFF;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
333 break;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
334 case IMG_BGR24:
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
335 blue = buffer[buf_pos+0];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
336 green = buffer[buf_pos+1];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
337 red = buffer[buf_pos+2];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
338 alpha = 0xFF;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
339 break;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
340 case CMD_ALPHA:
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
341 vf->priv->bitmap.a[pos] = INRANGE((vf->priv->bitmap.oa[pos]+imgalpha),0,255);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
342 break;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
343 default:
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
344 fprintf(stderr, "vf_bmovl: Internal error!\n");
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
345 exit( 10 );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
346 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
347 if( command & IS_RAWIMG ) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
348 vf->priv->bitmap.y[pos] = rgb2y(red,green,blue);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
349 vf->priv->bitmap.oa[pos] = alpha;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
350 vf->priv->bitmap.a[pos] = INRANGE((alpha+imgalpha),0,255);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
351 if((buf_y%2) && ((buf_x/pxsz)%2)) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
352 pos = ( ((buf_y+imgy)/2) * dmpi->stride[1] ) + (((buf_x/pxsz)+imgx)/2);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
353 vf->priv->bitmap.u[pos] = rgb2u(red,green,blue);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
354 vf->priv->bitmap.v[pos] = rgb2v(red,green,blue);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
355 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
356 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
357 } // for buf_x
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
358 } // for buf_y
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
359 free (buffer);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
360 } else if(errno) fprintf(stderr, "\nvf_bmovl: Error %d in fifo: %s\n\n", errno, strerror(errno));
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
361 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
362
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
363 if(vf->priv->hidden) return vf_next_put_image(vf, dmpi);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
364
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
365 if(vf->priv->opaque) { // Just copy buffer memory to screen
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
366 for( ypos=vf->priv->y1 ; ypos < vf->priv->y2 ; ypos++ ) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
367 memcpy( dmpi->planes[0] + (ypos*dmpi->stride[0]) + vf->priv->x1,
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
368 vf->priv->bitmap.y + (ypos*vf->priv->w) + vf->priv->x1,
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
369 vf->priv->x2 - vf->priv->x1 );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
370 if(ypos%2) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
371 memcpy( dmpi->planes[1] + ((ypos/2)*dmpi->stride[1]) + (vf->priv->x1/2),
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
372 vf->priv->bitmap.u + (((ypos/2)*(vf->priv->w)/2)) + (vf->priv->x1/2),
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
373 (vf->priv->x2 - vf->priv->x1)/2 );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
374 memcpy( dmpi->planes[2] + ((ypos/2)*dmpi->stride[2]) + (vf->priv->x1/2),
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
375 vf->priv->bitmap.v + (((ypos/2)*(vf->priv->w)/2)) + (vf->priv->x1/2),
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
376 (vf->priv->x2 - vf->priv->x1)/2 );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
377 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
378 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
379 } else { // Blit the bitmap to the videoscreen, pixel for pixel
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
380 for( ypos=vf->priv->y1 ; ypos < vf->priv->y2 ; ypos++ ) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
381 for ( xpos=vf->priv->x1 ; xpos < vf->priv->x2 ; xpos++ ) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
382 pos = (ypos * dmpi->stride[0]) + xpos;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
383
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
384 alpha = vf->priv->bitmap.a[pos];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
385
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
386 if (alpha == 0) continue; // Completly transparent pixel
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
387
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
388 if (alpha == 255) { // Opaque pixel
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
389 dmpi->planes[0][pos] = vf->priv->bitmap.y[pos];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
390 if ((ypos%2) && (xpos%2)) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
391 pos = ( (ypos/2) * dmpi->stride[1] ) + (xpos/2);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
392 dmpi->planes[1][pos] = vf->priv->bitmap.u[pos];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
393 dmpi->planes[2][pos] = vf->priv->bitmap.v[pos];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
394 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
395 } else { // Alphablended pixel
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
396 dmpi->planes[0][pos] = (dmpi->planes[0][pos]*(1.0-(alpha/255.0))) + (vf->priv->bitmap.y[pos]*(alpha/255.0));
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
397 if ((ypos%2) && (xpos%2)) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
398 pos = ( (ypos/2) * dmpi->stride[1] ) + (xpos/2);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
399 dmpi->planes[1][pos] = (dmpi->planes[1][pos]*(1.0-(alpha/255.0))) + (vf->priv->bitmap.u[pos]*(alpha/255.0));
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
400 dmpi->planes[2][pos] = (dmpi->planes[2][pos]*(1.0-(alpha/255.0))) + (vf->priv->bitmap.v[pos]*(alpha/255.0));
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
401 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
402 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
403 } // for xpos
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
404 } // for ypos
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
405 } // if !opaque
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
406 return vf_next_put_image(vf, dmpi);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
407 } // put_image
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
408
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
409 static int
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
410 vf_open(vf_instance_t* vf, char* args)
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
411 {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
412 char filename[1000];
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
413
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
414 vf->config = config;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
415 vf->put_image = put_image;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
416 vf->query_format = query_format;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
417 vf->uninit = uninit;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
418
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
419 vf->priv = malloc(sizeof(struct vf_priv_s));
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
420
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
421 if( sscanf(args, "%d:%d:%s", &vf->priv->hidden, &vf->priv->opaque, filename) < 3 ) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
422 fprintf(stderr, "vf_bmovl: Bad arguments!\n");
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
423 fprintf(stderr, "vf_bmovl: Arguments are 'bool hidden:bool opaque:string fifo'\n");
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
424 exit(5);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
425 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
426
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
427 vf->priv->stream_fd = open(filename, O_RDWR);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
428 if(vf->priv->stream_fd >= 0) {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
429 FD_ZERO( &vf->priv->stream_fdset );
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
430 printf("vf_bmovl: Opened fifo %s as FD %d\n", filename, vf->priv->stream_fd);
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
431 } else {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
432 fprintf(stderr, "vf_bmovl: Error! Couldn't open FIFO %s: %s\n", filename, strerror(errno));
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
433 vf->priv->stream_fd = -1;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
434 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
435
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
436 return TRUE;
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
437 }
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
438
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
439 vf_info_t vf_info_bmovl = {
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
440 "Read bitmaps from a FIFO and display them in window",
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
441 "bmovl",
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
442 "Per Wigren",
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
443 "",
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
444 vf_open
fe88f7403d64 -vop bmovl - BitMap OVerLay videofilter for MPlayer
arpi
parents:
diff changeset
445 };