7 #include <X11/extensions/XShm.h>
8 #include <X11/extensions/Xvlib.h>
10 #include "bcwindowbase.inc"
15 //#define BITMAP_RING 1
21 BC_Bitmap(BC_WindowBase
*parent_window
, unsigned char *png_data
);
22 BC_Bitmap(BC_WindowBase
*parent_window
, VFrame
*frame
);
24 // Shared memory is a problem in X because it's asynchronous and there's
25 // no easy way to join with the blitting process.
26 BC_Bitmap(BC_WindowBase
*parent_window
,
34 int read_frame(VFrame
*frame
,
35 int in_x
, int in_y
, int in_w
, int in_h
,
36 int out_x
, int out_y
, int out_w
, int out_h
);
37 // x1, y1, x2, y2 dimensions of output area
38 int read_frame(VFrame
*frame
,
39 int x1
, int y1
, int x2
, int y2
);
40 // Reset bitmap to match the new parameters
41 int match_params(int w
,
45 // Test if bitmap already matches parameters
46 int params_match(int w
, int h
, int color_model
, int use_shm
);
48 // When showing the same frame twice need to rewind
50 // If dont_wait is true, the XSync comes before the flash.
51 // For YUV bitmaps, the image is scaled to fill dest_x ... w * dest_y ... h
52 int write_drawable(Drawable
&pixmap
,
63 int write_drawable(Drawable
&pixmap
,
72 // the bitmap must be wholly contained in the source during a GetImage
73 int read_drawable(Drawable
&pixmap
, int source_x
, int source_y
);
75 int rotate_90(int side
);
78 void transparency_bitswap();
79 // Data pointers for current ring buffer
80 unsigned char* get_data();
81 unsigned char* get_y_plane();
82 unsigned char* get_u_plane();
83 unsigned char* get_v_plane();
84 // Get the frame buffer itself
85 int get_color_model();
86 int hardware_scaling();
87 unsigned char** get_row_pointers();
88 int get_bytes_per_line();
91 // Offset of current ringbuffer in shared memory
92 long get_shm_offset();
93 // Returns plane offset + ringbuffer offset
94 long get_y_shm_offset();
95 long get_u_shm_offset();
96 long get_v_shm_offset();
97 // Returns just the plane offset
102 // Rewing ringbuffer to the previous frame
103 void rewind_ringbuffer();
104 int set_bg_color(int color
);
108 int initialize(BC_WindowBase
*parent_window
, int w
, int h
, int color_model
, int use_shm
);
111 int get_default_depth();
112 char byte_bitswap(char src
);
114 int ring_buffers
, current_ringbuffer
;
116 // Color model from colormodels.h
118 // Background color for using pngs
120 // Override top_level for small bitmaps
122 BC_WindowBase
*top_level
;
123 BC_WindowBase
*parent_window
;
124 // Points directly to the frame buffer
125 unsigned char *data
[BITMAP_RING
];
126 // Row pointers to the frame buffer
127 unsigned char **row_data
[BITMAP_RING
];
129 // This differs from the depth parameter of top_level
133 // For resetting XVideo
134 int last_pixmap_used
;
136 unsigned char bg_r
, bg_g
, bg_b
;
137 // For less than 8 bit depths
141 // Need last pixmap to stop XVideo
142 Drawable last_pixmap
;
143 XImage
*ximage
[BITMAP_RING
];
144 XvImage
*xv_image
[BITMAP_RING
];
145 XShmSegmentInfo shm_info
;