Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | /******************************************************************** |
michael@0 | 2 | * * |
michael@0 | 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * |
michael@0 | 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * |
michael@0 | 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * |
michael@0 | 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * |
michael@0 | 7 | * * |
michael@0 | 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * |
michael@0 | 9 | * by the Xiph.Org Foundation http://www.xiph.org/ * |
michael@0 | 10 | * * |
michael@0 | 11 | ******************************************************************** |
michael@0 | 12 | |
michael@0 | 13 | function: bitrate tracking and management |
michael@0 | 14 | last mod: $Id: bitrate.h 13293 2007-07-24 00:09:47Z xiphmont $ |
michael@0 | 15 | |
michael@0 | 16 | ********************************************************************/ |
michael@0 | 17 | |
michael@0 | 18 | #ifndef _V_BITRATE_H_ |
michael@0 | 19 | #define _V_BITRATE_H_ |
michael@0 | 20 | |
michael@0 | 21 | #include "vorbis/codec.h" |
michael@0 | 22 | #include "codec_internal.h" |
michael@0 | 23 | #include "os.h" |
michael@0 | 24 | |
michael@0 | 25 | /* encode side bitrate tracking */ |
michael@0 | 26 | typedef struct bitrate_manager_state { |
michael@0 | 27 | int managed; |
michael@0 | 28 | |
michael@0 | 29 | long avg_reservoir; |
michael@0 | 30 | long minmax_reservoir; |
michael@0 | 31 | long avg_bitsper; |
michael@0 | 32 | long min_bitsper; |
michael@0 | 33 | long max_bitsper; |
michael@0 | 34 | |
michael@0 | 35 | long short_per_long; |
michael@0 | 36 | double avgfloat; |
michael@0 | 37 | |
michael@0 | 38 | vorbis_block *vb; |
michael@0 | 39 | int choice; |
michael@0 | 40 | } bitrate_manager_state; |
michael@0 | 41 | |
michael@0 | 42 | typedef struct bitrate_manager_info{ |
michael@0 | 43 | long avg_rate; |
michael@0 | 44 | long min_rate; |
michael@0 | 45 | long max_rate; |
michael@0 | 46 | long reservoir_bits; |
michael@0 | 47 | double reservoir_bias; |
michael@0 | 48 | |
michael@0 | 49 | double slew_damp; |
michael@0 | 50 | |
michael@0 | 51 | } bitrate_manager_info; |
michael@0 | 52 | |
michael@0 | 53 | extern void vorbis_bitrate_init(vorbis_info *vi,bitrate_manager_state *bs); |
michael@0 | 54 | extern void vorbis_bitrate_clear(bitrate_manager_state *bs); |
michael@0 | 55 | extern int vorbis_bitrate_managed(vorbis_block *vb); |
michael@0 | 56 | extern int vorbis_bitrate_addblock(vorbis_block *vb); |
michael@0 | 57 | extern int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd, ogg_packet *op); |
michael@0 | 58 | |
michael@0 | 59 | #endif |