r827: Fix a crash when no audio output device can be opened.
[cinelerra_cv.git] / cinelerra / vdevicex11.h
blob47b3fea312bf2ccd5d65599374c0bfa5e6f08ea3
1 #ifndef VDEVICEX11_H
2 #define VDEVICEX11_H
4 #include "canvas.inc"
5 #include "edl.inc"
6 #include "guicast.h"
7 #include "thread.h"
8 #include "vdevicebase.h"
10 // output_frame is the same one written to device
11 #define BITMAP_PRIMARY 0
12 // output_frame is a temporary converted to the device format
13 #define BITMAP_TEMP 1
15 class VDeviceX11 : public VDeviceBase
17 public:
18 VDeviceX11(VideoDevice *device, Canvas *output);
19 ~VDeviceX11();
21 int open_input();
22 int close_all();
23 int read_buffer(VFrame *frame);
24 int reset_parameters();
25 // User always gets the colormodel requested
26 void new_output_buffer(VFrame **output_frames, int colormodel);
28 int open_output();
29 int start_playback();
30 int stop_playback();
31 int output_visible();
32 // After loading the bitmap with a picture, write it
33 int write_buffer(VFrame **outputs, EDL *edl);
35 private:
36 // Closest colormodel the hardware can do for playback
37 int get_best_colormodel(int colormodel);
38 // Get best colormodel for recording
39 int get_best_colormodel(Asset *asset);
41 BC_Bitmap *bitmap; // Bitmap to be written to device
42 VFrame *output_frame; // Wrapper for bitmap or intermediate frame
43 int bitmap_type; // Type of output_frame
44 int bitmap_w, bitmap_h; // dimensions of buffers written to window
45 ArrayList<int> render_strategies;
46 // Canvas for output
47 Canvas *output;
48 int color_model;
49 int color_model_selected;
50 // Transfers for last frame rendered.
51 // These stick the last frame to the display.
52 int in_x, in_y, in_w, in_h, out_x, out_y, out_w, out_h;
53 // Screen capture
54 BC_Capture *capture_bitmap;
57 #endif