FS#12756 by Marek Salaba - update Czech translation
[maemo-rb.git] / apps / plugins / mpegplayer / video_out.h
blob2a3364c38225c5034237d871881b246c8f36e30d
1 /*
2 * video_out.h
3 * Copyright (C) 2000-2003 Michel Lespinasse <walken@zoy.org>
4 * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
6 * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
7 * See http://libmpeg2.sourceforge.net/ for updates.
9 * mpeg2dec is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * mpeg2dec is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 * $Id$
24 * libmpeg2 sync history:
25 * 2008-07-01 - CVS revision 1.22
28 #ifndef VIDEO_OUT_H
29 #define VIDEO_OUT_H
31 #if LCD_WIDTH >= LCD_HEIGHT
32 #define SCREEN_WIDTH LCD_WIDTH
33 #define SCREEN_HEIGHT LCD_HEIGHT
34 #define LCD_LANDSCAPE
35 #else /* Assume the screen is rotated on portrait LCDs */
36 #define SCREEN_WIDTH LCD_HEIGHT
37 #define SCREEN_HEIGHT LCD_WIDTH
38 #define LCD_PORTRAIT
39 #endif
41 /* Structure to hold width and height values */
42 struct vo_ext
44 int w, h;
47 /* Structure that defines a rectangle by its edges */
48 struct vo_rect
50 int l, t, r, b;
53 void vo_draw_frame (uint8_t * const * buf);
54 bool vo_draw_frame_thumb (uint8_t * const * buf,
55 const struct vo_rect *rc);
56 bool vo_init (void);
57 bool vo_show (bool show);
58 bool vo_is_visible(void);
59 void vo_setup (const mpeg2_sequence_t * sequence);
60 void vo_set_clip_rect(const struct vo_rect *rc);
61 bool vo_get_clip_rect(struct vo_rect *rc);
62 void vo_dimensions(struct vo_ext *sz);
63 void vo_cleanup (void);
64 void vo_set_post_draw_callback(void (*cb)(void));
66 #if NUM_CORES > 1
67 void vo_lock(void);
68 void vo_unlock(void);
69 #else
70 static inline void vo_lock(void) {}
71 static inline void vo_unlock(void) {}
72 #endif
74 /* Sets all coordinates of a vo_rect to 0 */
75 void vo_rect_clear(struct vo_rect *rc);
76 /* Returns true if left >= right or top >= bottom */
77 bool vo_rect_empty(const struct vo_rect *rc);
78 /* Initializes a vo_rect using upper-left corner and extents */
79 void vo_rect_set_ext(struct vo_rect *rc, int x, int y,
80 int width, int height);
81 /* Query if two rectangles intersect
82 * If either are empty returns false */
83 bool vo_rects_intersect(const struct vo_rect *rc1,
84 const struct vo_rect *rc2);
86 /* Intersect two rectangles
87 * Resulting rectangle is placed in rc_dst.
88 * rc_dst is set to empty if they don't intersect.
89 * Empty source rectangles do not intersect any rectangle.
90 * rc_dst may be the same structure as rc1 or rc2.
91 * Returns true if the resulting rectangle is not empty. */
92 bool vo_rect_intersect(struct vo_rect *rc_dst,
93 const struct vo_rect *rc1,
94 const struct vo_rect *rc2);
96 bool vo_rect_union(struct vo_rect *rc_dst,
97 const struct vo_rect *rc1,
98 const struct vo_rect *rc2);
100 void vo_rect_offset(struct vo_rect *rc, int dx, int dy);
102 #endif /* VIDEO_OUT_H */