1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2009 Mohamed Tarek
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
27 typedef struct rm_packet
29 uint8_t data
[30000]; /* Reordered data. No malloc, hence the size */
33 uint16_t stream_number
;
37 typedef struct rm_context
43 int audio_stream_num
; /*< Stream number for audio packets*/
44 int audio_pkt_cnt
; /* Output packet counter*/
46 /* Stream Variables */
47 uint32_t audiotimestamp
; /* Audio packet timestamp*/
48 uint16_t sub_packet_cnt
; /* Subpacket counter, used while reading */
49 uint16_t sub_packet_size
, sub_packet_h
, coded_framesize
; /* Descrambling parameters from container */
50 uint16_t audio_framesize
; /* Audio frame size from container */
51 uint16_t sub_packet_lengths
[16]; /* Length of each subpacket */
57 uint32_t extradata_size
;
64 uint32_t cook_version
;
65 uint16_t samples_pf_pc
; /* samples per frame per channel */
66 uint16_t nb_subbands
; /* number of subbands in the frequency domain */
67 /* extra 8 bytes for stereo data */
69 uint16_t js_subband_start
; /* joint stereo subband start */
74 int open_wav(char* filename
);
75 void close_wav(int fd
, RMContext
*rmctx
);
76 int real_parse_header(int fd
, RMContext
*rmctx
);
77 void rm_get_packet(int fd
,RMContext
*rmctx
, RMPacket
*pkt
);