| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
#ifndef DV_DISPLAY_H |
| 28 |
#define DV_DISPLAY_H |
| 29 |
|
| 30 |
#if HAVE_CONFIG_H |
| 31 |
# include <config.h> |
| 32 |
#endif |
| 33 |
|
| 34 |
#include "libdv/dv_types.h" |
| 35 |
#include <gtk/gtk.h> |
| 36 |
|
| 37 |
#if HAVE_LIBXV |
| 38 |
#include <X11/Xlib.h> |
| 39 |
#include <X11/Xutil.h> |
| 40 |
#include <X11/keysym.h> |
| 41 |
#include <X11/extensions/XShm.h> |
| 42 |
#include <X11/extensions/Xvlib.h> |
| 43 |
#endif |
| 44 |
|
| 45 |
#if HAVE_SDL |
| 46 |
#include <SDL/SDL.h> |
| 47 |
#include <SDL/SDL_syswm.h> |
| 48 |
#endif |
| 49 |
|
| 50 |
#if HAVE_GTK |
| 51 |
#include <gtk/gtk.h> |
| 52 |
#endif |
| 53 |
|
| 54 |
#define DV_FOURCC_YV12 0x32315659 |
| 55 |
#define DV_FOURCC_YUY2 0x32595559 |
| 56 |
|
| 57 |
#if HAVE_LIBXV |
| 58 |
#define DV_DISPLAY_OPT_METHOD 0 |
| 59 |
#define DV_DISPLAY_OPT_ASPECT 1 |
| 60 |
#define DV_DISPLAY_OPT_SIZE 2 |
| 61 |
#define DV_DISPLAY_OPT_CALLBACK 3 |
| 62 |
#define DV_DISPLAY_OPT_XV_PORT 4 |
| 63 |
#define DV_DISPLAY_NUM_OPTS 5 |
| 64 |
#else |
| 65 |
#define DV_DISPLAY_OPT_METHOD 0 |
| 66 |
#define DV_DISPLAY_OPT_CALLBACK 1 |
| 67 |
#define DV_DISPLAY_NUM_OPTS 2 |
| 68 |
#endif |
| 69 |
|
| 70 |
typedef enum dv_dpy_lib_e { |
| 71 |
e_dv_dpy_Xv, |
| 72 |
e_dv_dpy_SDL, |
| 73 |
e_dv_dpy_gtk, |
| 74 |
e_dv_dpy_XShm, |
| 75 |
} dv_dpy_lib_t; |
| 76 |
|
| 77 |
typedef struct { |
| 78 |
dv_color_space_t color_space; |
| 79 |
gint width, height; |
| 80 |
guchar *pixels[3]; |
| 81 |
gint pitches[3]; |
| 82 |
|
| 83 |
|
| 84 |
dv_dpy_lib_t lib; |
| 85 |
guint32 len; |
| 86 |
guint32 format; |
| 87 |
|
| 88 |
#if HAVE_LIBXV |
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
Display *dpy; |
| 93 |
Screen *scn; |
| 94 |
Window rwin, win; |
| 95 |
gint dwidth, dheight, |
| 96 |
swidth, sheight, |
| 97 |
lwidth, lheight, |
| 98 |
lxoff, lyoff, |
| 99 |
flags, |
| 100 |
pic_format; |
| 101 |
GC gc; |
| 102 |
XEvent event; |
| 103 |
XvPortID port; |
| 104 |
XShmSegmentInfo shminfo; |
| 105 |
XvImage *xv_image; |
| 106 |
#endif |
| 107 |
|
| 108 |
#if HAVE_GTK |
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
GtkWidget *window, *image; |
| 113 |
#endif |
| 114 |
|
| 115 |
#if HAVE_SDL |
| 116 |
SDL_Surface* sdl_screen; |
| 117 |
SDL_Overlay *overlay; |
| 118 |
SDL_Rect rect; |
| 119 |
#endif |
| 120 |
|
| 121 |
gint arg_display, |
| 122 |
arg_aspect_val, |
| 123 |
arg_size_val, |
| 124 |
arg_xv_port; |
| 125 |
gchar *arg_aspect_string; |
| 126 |
|
| 127 |
#if HAVE_LIBPOPT |
| 128 |
struct poptOption option_table[DV_DISPLAY_NUM_OPTS+1]; |
| 129 |
#endif |
| 130 |
} dv_display_t; |
| 131 |
|
| 132 |
#ifdef __cplusplus |
| 133 |
extern "C" { |
| 134 |
#endif |
| 135 |
|
| 136 |
extern dv_display_t *dv_display_new(void); |
| 137 |
extern gboolean dv_display_init(dv_display_t *dpy, |
| 138 |
int *argc, char ***argv, |
| 139 |
int width, int height, |
| 140 |
dv_sample_t sampling, |
| 141 |
char *w_name, char *i_name); |
| 142 |
|
| 143 |
extern void dv_display_show(dv_display_t *dv_dpy); |
| 144 |
extern void dv_display_exit(dv_display_t *dv_dpy); |
| 145 |
extern void dv_display_set_norm (dv_display_t *dv_dpy, dv_system_t norm); |
| 146 |
extern void dv_display_check_format(dv_display_t *dv_dpy, int pic_format); |
| 147 |
|
| 148 |
#ifdef __cplusplus |
| 149 |
} |
| 150 |
#endif |
| 151 |
|
| 152 |
#endif |
| 153 |
|