A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 102 lines 3.4 kB view raw
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> 5 * 6 * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. 7 * See http://libmpeg2.sourceforge.net/ for updates. 8 * 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. 13 * 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. 18 * 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 22 * 23 * $Id$ 24 * libmpeg2 sync history: 25 * 2008-07-01 - CVS revision 1.22 26 */ 27 28#ifndef VIDEO_OUT_H 29#define VIDEO_OUT_H 30 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 40 41/* Structure to hold width and height values */ 42struct vo_ext 43{ 44 int w, h; 45}; 46 47/* Structure that defines a rectangle by its edges */ 48struct vo_rect 49{ 50 int l, t, r, b; 51}; 52 53void vo_draw_frame (uint8_t * const * buf); 54bool vo_draw_frame_thumb (uint8_t * const * buf, 55 const struct vo_rect *rc); 56bool vo_init (void); 57bool vo_show (bool show); 58bool vo_is_visible(void); 59void vo_setup (const mpeg2_sequence_t * sequence); 60void vo_set_clip_rect(const struct vo_rect *rc); 61bool vo_get_clip_rect(struct vo_rect *rc); 62void vo_dimensions(struct vo_ext *sz); 63void vo_cleanup (void); 64void vo_set_post_draw_callback(void (*cb)(void)); 65 66#if NUM_CORES > 1 67void vo_lock(void); 68void vo_unlock(void); 69#else 70static inline void vo_lock(void) {} 71static inline void vo_unlock(void) {} 72#endif 73 74/* Sets all coordinates of a vo_rect to 0 */ 75void vo_rect_clear(struct vo_rect *rc); 76/* Returns true if left >= right or top >= bottom */ 77bool vo_rect_empty(const struct vo_rect *rc); 78/* Initializes a vo_rect using upper-left corner and extents */ 79void 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 */ 83bool vo_rects_intersect(const struct vo_rect *rc1, 84 const struct vo_rect *rc2); 85 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. */ 92bool vo_rect_intersect(struct vo_rect *rc_dst, 93 const struct vo_rect *rc1, 94 const struct vo_rect *rc2); 95 96bool vo_rect_union(struct vo_rect *rc_dst, 97 const struct vo_rect *rc1, 98 const struct vo_rect *rc2); 99 100void vo_rect_offset(struct vo_rect *rc, int dx, int dy); 101 102#endif /* VIDEO_OUT_H */