Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
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 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
michael@0 | 3 | * |
michael@0 | 4 | * Use of this source code is governed by a BSD-style license |
michael@0 | 5 | * that can be found in the LICENSE file in the root of the source |
michael@0 | 6 | * tree. An additional intellectual property rights grant can be found |
michael@0 | 7 | * in the file PATENTS. All contributing project authors may |
michael@0 | 8 | * be found in the AUTHORS file in the root of the source tree. |
michael@0 | 9 | */ |
michael@0 | 10 | |
michael@0 | 11 | |
michael@0 | 12 | #include "vp8.h" |
michael@0 | 13 | |
michael@0 | 14 | /*!\defgroup vp8_decoder WebM VP8 Decoder |
michael@0 | 15 | * \ingroup vp8 |
michael@0 | 16 | * |
michael@0 | 17 | * @{ |
michael@0 | 18 | */ |
michael@0 | 19 | /*!\file |
michael@0 | 20 | * \brief Provides definitions for using the VP8 algorithm within the vpx Decoder |
michael@0 | 21 | * interface. |
michael@0 | 22 | */ |
michael@0 | 23 | #ifndef VP8DX_H |
michael@0 | 24 | #define VP8DX_H |
michael@0 | 25 | |
michael@0 | 26 | #ifdef __cplusplus |
michael@0 | 27 | extern "C" { |
michael@0 | 28 | #endif |
michael@0 | 29 | |
michael@0 | 30 | /*!\name Algorithm interface for VP8 |
michael@0 | 31 | * |
michael@0 | 32 | * This interface provides the capability to decode raw VP8 streams, as would |
michael@0 | 33 | * be found in AVI files and other non-Flash uses. |
michael@0 | 34 | * @{ |
michael@0 | 35 | */ |
michael@0 | 36 | extern vpx_codec_iface_t vpx_codec_vp8_dx_algo; |
michael@0 | 37 | extern vpx_codec_iface_t *vpx_codec_vp8_dx(void); |
michael@0 | 38 | |
michael@0 | 39 | /* TODO(jkoleszar): These move to VP9 in a later patch set. */ |
michael@0 | 40 | extern vpx_codec_iface_t vpx_codec_vp9_dx_algo; |
michael@0 | 41 | extern vpx_codec_iface_t *vpx_codec_vp9_dx(void); |
michael@0 | 42 | /*!@} - end algorithm interface member group*/ |
michael@0 | 43 | |
michael@0 | 44 | /* Include controls common to both the encoder and decoder */ |
michael@0 | 45 | #include "vp8.h" |
michael@0 | 46 | |
michael@0 | 47 | |
michael@0 | 48 | /*!\enum vp8_dec_control_id |
michael@0 | 49 | * \brief VP8 decoder control functions |
michael@0 | 50 | * |
michael@0 | 51 | * This set of macros define the control functions available for the VP8 |
michael@0 | 52 | * decoder interface. |
michael@0 | 53 | * |
michael@0 | 54 | * \sa #vpx_codec_control |
michael@0 | 55 | */ |
michael@0 | 56 | enum vp8_dec_control_id { |
michael@0 | 57 | /** control function to get info on which reference frames were updated |
michael@0 | 58 | * by the last decode |
michael@0 | 59 | */ |
michael@0 | 60 | VP8D_GET_LAST_REF_UPDATES = VP8_DECODER_CTRL_ID_START, |
michael@0 | 61 | |
michael@0 | 62 | /** check if the indicated frame is corrupted */ |
michael@0 | 63 | VP8D_GET_FRAME_CORRUPTED, |
michael@0 | 64 | |
michael@0 | 65 | /** control function to get info on which reference frames were used |
michael@0 | 66 | * by the last decode |
michael@0 | 67 | */ |
michael@0 | 68 | VP8D_GET_LAST_REF_USED, |
michael@0 | 69 | |
michael@0 | 70 | /** decryption function to decrypt encoded buffer data immediately |
michael@0 | 71 | * before decoding. Takes a vp8_decrypt_init, which contains |
michael@0 | 72 | * a callback function and opaque context pointer. |
michael@0 | 73 | */ |
michael@0 | 74 | VP8D_SET_DECRYPTOR, |
michael@0 | 75 | |
michael@0 | 76 | /** For testing. */ |
michael@0 | 77 | VP9_INVERT_TILE_DECODE_ORDER, |
michael@0 | 78 | |
michael@0 | 79 | VP8_DECODER_CTRL_ID_MAX |
michael@0 | 80 | }; |
michael@0 | 81 | |
michael@0 | 82 | /*!\brief Structure to hold decryption state |
michael@0 | 83 | * |
michael@0 | 84 | * Defines a structure to hold the decryption state and access function. |
michael@0 | 85 | */ |
michael@0 | 86 | typedef struct vp8_decrypt_init { |
michael@0 | 87 | /** Decrypt n bytes of data from input -> output, using the decrypt_state |
michael@0 | 88 | * passed in VP8D_SET_DECRYPTOR. |
michael@0 | 89 | */ |
michael@0 | 90 | void (*decrypt_cb)(void *decrypt_state, const unsigned char *input, |
michael@0 | 91 | unsigned char *output, int count); |
michael@0 | 92 | /*! Decryption state. */ |
michael@0 | 93 | void *decrypt_state; |
michael@0 | 94 | } vp8_decrypt_init; |
michael@0 | 95 | |
michael@0 | 96 | /*!\brief VP8 decoder control function parameter type |
michael@0 | 97 | * |
michael@0 | 98 | * Defines the data types that VP8D control functions take. Note that |
michael@0 | 99 | * additional common controls are defined in vp8.h |
michael@0 | 100 | * |
michael@0 | 101 | */ |
michael@0 | 102 | |
michael@0 | 103 | |
michael@0 | 104 | VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_UPDATES, int *) |
michael@0 | 105 | VPX_CTRL_USE_TYPE(VP8D_GET_FRAME_CORRUPTED, int *) |
michael@0 | 106 | VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_USED, int *) |
michael@0 | 107 | VPX_CTRL_USE_TYPE(VP8D_SET_DECRYPTOR, vp8_decrypt_init *) |
michael@0 | 108 | VPX_CTRL_USE_TYPE(VP9_INVERT_TILE_DECODE_ORDER, int) |
michael@0 | 109 | |
michael@0 | 110 | /*! @} - end defgroup vp8_decoder */ |
michael@0 | 111 | |
michael@0 | 112 | #ifdef __cplusplus |
michael@0 | 113 | } // extern "C" |
michael@0 | 114 | #endif |
michael@0 | 115 | |
michael@0 | 116 | #endif |