A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 44 lines 1.5 kB view raw
1/*************************************************************************** 2 * __________ __ ___. 3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 * \/ \/ \/ \/ \/ 8 * $Id$ 9 * 10 * Copyright (C) 2010 Marcin Bukat 11 * 12 * This program is free software; you can redistribute it and/or 13 * modify it under the terms of the GNU General Public License 14 * as published by the Free Software Foundation; either version 2 15 * of the License, or (at your option) any later version. 16 * 17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 18 * KIND, either express or implied. 19 * 20 ****************************************************************************/ 21 22/* Magic constants. */ 23#define PPM_MAGIC1 'P' 24#define PPM_MAGIC2 '3' 25#define RPPM_MAGIC2 '6' 26#define PPM_FORMAT (PPM_MAGIC1 * 256 + PPM_MAGIC2) 27#define RPPM_FORMAT (PPM_MAGIC1 * 256 + RPPM_MAGIC2) 28 29#define PPM_OVERALLMAXVAL 65535 30 31#define ppm_error(...) rb->splashf(HZ*2, __VA_ARGS__ ) 32 33struct ppm_info { 34 int x; 35 int y; 36 int maxval; 37 int format; 38 unsigned char *buf; 39 size_t buf_size; 40 unsigned int native_img_size; 41}; 42 43/* public prototype */ 44int read_ppm(int fd, struct ppm_info *ppm);