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 | /* vim:set ts=2 sw=2 sts=2 et cindent: */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef __APPLE__ |
michael@0 | 7 | |
michael@0 | 8 | /* |
michael@0 | 9 | * List of symbol names we need to dlsym from the gstreamer library. |
michael@0 | 10 | */ |
michael@0 | 11 | GST_FUNC(LIBGSTAPP, gst_app_sink_get_type) |
michael@0 | 12 | GST_FUNC(LIBGSTAPP, gst_app_sink_set_callbacks) |
michael@0 | 13 | GST_FUNC(LIBGSTAPP, gst_app_src_end_of_stream) |
michael@0 | 14 | GST_FUNC(LIBGSTAPP, gst_app_src_get_size) |
michael@0 | 15 | GST_FUNC(LIBGSTAPP, gst_app_src_get_type) |
michael@0 | 16 | GST_FUNC(LIBGSTAPP, gst_app_src_push_buffer) |
michael@0 | 17 | GST_FUNC(LIBGSTAPP, gst_app_src_set_callbacks) |
michael@0 | 18 | GST_FUNC(LIBGSTAPP, gst_app_src_set_caps) |
michael@0 | 19 | GST_FUNC(LIBGSTAPP, gst_app_src_set_size) |
michael@0 | 20 | GST_FUNC(LIBGSTAPP, gst_app_src_set_stream_type) |
michael@0 | 21 | GST_FUNC(LIBGSTREAMER, gst_bin_get_by_name) |
michael@0 | 22 | GST_FUNC(LIBGSTREAMER, gst_bin_get_type) |
michael@0 | 23 | GST_FUNC(LIBGSTREAMER, gst_bin_iterate_recurse) |
michael@0 | 24 | GST_FUNC(LIBGSTREAMER, gst_buffer_get_type) |
michael@0 | 25 | GST_FUNC(LIBGSTREAMER, gst_buffer_new) |
michael@0 | 26 | GST_FUNC(LIBGSTREAMER, gst_bus_set_sync_handler) |
michael@0 | 27 | GST_FUNC(LIBGSTREAMER, gst_bus_timed_pop_filtered) |
michael@0 | 28 | GST_FUNC(LIBGSTREAMER, gst_caps_append) |
michael@0 | 29 | GST_FUNC(LIBGSTREAMER, gst_caps_can_intersect) |
michael@0 | 30 | GST_FUNC(LIBGSTREAMER, gst_caps_from_string) |
michael@0 | 31 | GST_FUNC(LIBGSTREAMER, gst_caps_get_size) |
michael@0 | 32 | GST_FUNC(LIBGSTREAMER, gst_caps_get_structure) |
michael@0 | 33 | GST_FUNC(LIBGSTREAMER, gst_caps_new_any) |
michael@0 | 34 | GST_FUNC(LIBGSTREAMER, gst_caps_new_empty) |
michael@0 | 35 | GST_FUNC(LIBGSTREAMER, gst_caps_new_full) |
michael@0 | 36 | GST_FUNC(LIBGSTREAMER, gst_caps_new_simple) |
michael@0 | 37 | GST_FUNC(LIBGSTREAMER, gst_caps_set_simple) |
michael@0 | 38 | GST_FUNC(LIBGSTREAMER, gst_element_factory_get_static_pad_templates) |
michael@0 | 39 | GST_FUNC(LIBGSTREAMER, gst_element_factory_get_type) |
michael@0 | 40 | GST_FUNC(LIBGSTREAMER, gst_element_factory_make) |
michael@0 | 41 | GST_FUNC(LIBGSTREAMER, gst_element_get_factory) |
michael@0 | 42 | GST_FUNC(LIBGSTREAMER, gst_element_get_static_pad) |
michael@0 | 43 | GST_FUNC(LIBGSTREAMER, gst_element_get_type) |
michael@0 | 44 | GST_FUNC(LIBGSTREAMER, gst_element_query_convert) |
michael@0 | 45 | GST_FUNC(LIBGSTREAMER, gst_element_query_duration) |
michael@0 | 46 | GST_FUNC(LIBGSTREAMER, gst_element_seek_simple) |
michael@0 | 47 | GST_FUNC(LIBGSTREAMER, gst_element_set_state) |
michael@0 | 48 | GST_FUNC(LIBGSTREAMER, gst_flow_get_name) |
michael@0 | 49 | GST_FUNC(LIBGSTREAMER, gst_init) |
michael@0 | 50 | GST_FUNC(LIBGSTREAMER, gst_init_check) |
michael@0 | 51 | GST_FUNC(LIBGSTREAMER, gst_iterator_next) |
michael@0 | 52 | GST_FUNC(LIBGSTREAMER, gst_message_parse_error) |
michael@0 | 53 | GST_FUNC(LIBGSTREAMER, gst_message_type_get_name) |
michael@0 | 54 | GST_FUNC(LIBGSTREAMER, gst_mini_object_ref) |
michael@0 | 55 | GST_FUNC(LIBGSTREAMER, gst_mini_object_unref) |
michael@0 | 56 | GST_FUNC(LIBGSTREAMER, gst_object_get_name) |
michael@0 | 57 | GST_FUNC(LIBGSTREAMER, gst_object_get_parent) |
michael@0 | 58 | GST_FUNC(LIBGSTREAMER, gst_object_unref) |
michael@0 | 59 | GST_FUNC(LIBGSTREAMER, gst_pad_get_element_private) |
michael@0 | 60 | GST_FUNC(LIBGSTREAMER, gst_pad_set_element_private) |
michael@0 | 61 | GST_FUNC(LIBGSTREAMER, gst_parse_bin_from_description) |
michael@0 | 62 | GST_FUNC(LIBGSTREAMER, gst_pipeline_get_bus) |
michael@0 | 63 | GST_FUNC(LIBGSTREAMER, gst_pipeline_get_type) |
michael@0 | 64 | GST_FUNC(LIBGSTREAMER, gst_plugin_feature_get_rank) |
michael@0 | 65 | GST_FUNC(LIBGSTREAMER, gst_registry_feature_filter) |
michael@0 | 66 | GST_FUNC(LIBGSTREAMER, gst_registry_get_feature_list_cookie) |
michael@0 | 67 | GST_FUNC(LIBGSTREAMER, gst_segment_init) |
michael@0 | 68 | GST_FUNC(LIBGSTREAMER, gst_segment_to_stream_time) |
michael@0 | 69 | GST_FUNC(LIBGSTREAMER, gst_static_caps_get) |
michael@0 | 70 | GST_FUNC(LIBGSTREAMER, gst_structure_copy) |
michael@0 | 71 | GST_FUNC(LIBGSTREAMER, gst_structure_get_fraction) |
michael@0 | 72 | GST_FUNC(LIBGSTREAMER, gst_structure_get_int) |
michael@0 | 73 | GST_FUNC(LIBGSTREAMER, gst_structure_get_value) |
michael@0 | 74 | GST_FUNC(LIBGSTREAMER, gst_structure_new) |
michael@0 | 75 | GST_FUNC(LIBGSTREAMER, gst_util_uint64_scale) |
michael@0 | 76 | |
michael@0 | 77 | #if GST_VERSION_MAJOR == 0 |
michael@0 | 78 | GST_FUNC(LIBGSTAPP, gst_app_sink_pull_buffer) |
michael@0 | 79 | GST_FUNC(LIBGSTREAMER, gst_buffer_copy_metadata) |
michael@0 | 80 | GST_FUNC(LIBGSTREAMER, gst_buffer_new_and_alloc) |
michael@0 | 81 | GST_FUNC(LIBGSTREAMER, gst_caps_unref) |
michael@0 | 82 | GST_FUNC(LIBGSTREAMER, gst_element_factory_get_klass) |
michael@0 | 83 | GST_FUNC(LIBGSTREAMER, gst_element_get_pad) |
michael@0 | 84 | GST_FUNC(LIBGSTREAMER, gst_event_parse_new_segment) |
michael@0 | 85 | GST_FUNC(LIBGSTREAMER, gst_mini_object_get_type) |
michael@0 | 86 | GST_FUNC(LIBGSTREAMER, gst_mini_object_new) |
michael@0 | 87 | GST_FUNC(LIBGSTREAMER, gst_pad_add_event_probe) |
michael@0 | 88 | GST_FUNC(LIBGSTREAMER, gst_pad_alloc_buffer) |
michael@0 | 89 | GST_FUNC(LIBGSTREAMER, gst_pad_get_negotiated_caps) |
michael@0 | 90 | GST_FUNC(LIBGSTREAMER, gst_pad_set_bufferalloc_function) |
michael@0 | 91 | GST_FUNC(LIBGSTREAMER, gst_registry_get_default) |
michael@0 | 92 | GST_FUNC(LIBGSTREAMER, gst_segment_set_newsegment) |
michael@0 | 93 | GST_FUNC(LIBGSTVIDEO, gst_video_format_get_component_height) |
michael@0 | 94 | GST_FUNC(LIBGSTVIDEO, gst_video_format_get_component_offset) |
michael@0 | 95 | GST_FUNC(LIBGSTVIDEO, gst_video_format_get_component_width) |
michael@0 | 96 | GST_FUNC(LIBGSTVIDEO, gst_video_format_get_pixel_stride) |
michael@0 | 97 | GST_FUNC(LIBGSTVIDEO, gst_video_format_get_row_stride) |
michael@0 | 98 | GST_FUNC(LIBGSTVIDEO, gst_video_format_parse_caps) |
michael@0 | 99 | GST_FUNC(LIBGSTVIDEO, gst_video_parse_caps_pixel_aspect_ratio) |
michael@0 | 100 | #else |
michael@0 | 101 | |
michael@0 | 102 | GST_FUNC(LIBGSTAPP, gst_app_sink_pull_sample) |
michael@0 | 103 | GST_FUNC(LIBGSTREAMER, _gst_caps_any) |
michael@0 | 104 | GST_FUNC(LIBGSTREAMER, gst_allocator_get_type) |
michael@0 | 105 | GST_FUNC(LIBGSTREAMER, gst_buffer_copy_into) |
michael@0 | 106 | GST_FUNC(LIBGSTREAMER, gst_buffer_extract) |
michael@0 | 107 | GST_FUNC(LIBGSTREAMER, gst_buffer_get_meta) |
michael@0 | 108 | GST_FUNC(LIBGSTREAMER, gst_buffer_get_size) |
michael@0 | 109 | GST_FUNC(LIBGSTREAMER, gst_buffer_map) |
michael@0 | 110 | GST_FUNC(LIBGSTREAMER, gst_buffer_new_allocate) |
michael@0 | 111 | GST_FUNC(LIBGSTREAMER, gst_buffer_n_memory) |
michael@0 | 112 | GST_FUNC(LIBGSTREAMER, gst_buffer_peek_memory) |
michael@0 | 113 | GST_FUNC(LIBGSTREAMER, gst_buffer_pool_acquire_buffer) |
michael@0 | 114 | GST_FUNC(LIBGSTREAMER, gst_buffer_pool_config_set_allocator) |
michael@0 | 115 | GST_FUNC(LIBGSTREAMER, gst_buffer_pool_config_set_params) |
michael@0 | 116 | GST_FUNC(LIBGSTREAMER, gst_buffer_pool_get_config) |
michael@0 | 117 | GST_FUNC(LIBGSTREAMER, gst_buffer_pool_get_type) |
michael@0 | 118 | GST_FUNC(LIBGSTREAMER, gst_buffer_pool_is_active) |
michael@0 | 119 | GST_FUNC(LIBGSTREAMER, gst_buffer_pool_set_active) |
michael@0 | 120 | GST_FUNC(LIBGSTREAMER, gst_buffer_pool_set_config) |
michael@0 | 121 | GST_FUNC(LIBGSTREAMER, gst_buffer_set_size) |
michael@0 | 122 | GST_FUNC(LIBGSTREAMER, gst_buffer_unmap) |
michael@0 | 123 | GST_FUNC(LIBGSTREAMER, gst_element_factory_get_metadata) |
michael@0 | 124 | GST_FUNC(LIBGSTREAMER, gst_event_parse_segment) |
michael@0 | 125 | GST_FUNC(LIBGSTREAMER, gst_event_type_get_name) |
michael@0 | 126 | GST_FUNC(LIBGSTREAMER, gst_memory_init) |
michael@0 | 127 | GST_FUNC(LIBGSTREAMER, gst_memory_map) |
michael@0 | 128 | GST_FUNC(LIBGSTREAMER, gst_memory_unmap) |
michael@0 | 129 | GST_FUNC(LIBGSTREAMER, gst_object_get_type) |
michael@0 | 130 | GST_FUNC(LIBGSTREAMER, gst_pad_add_probe) |
michael@0 | 131 | GST_FUNC(LIBGSTREAMER, gst_pad_get_current_caps) |
michael@0 | 132 | GST_FUNC(LIBGSTREAMER, gst_pad_probe_info_get_query) |
michael@0 | 133 | GST_FUNC(LIBGSTREAMER, gst_query_add_allocation_meta) |
michael@0 | 134 | GST_FUNC(LIBGSTREAMER, gst_query_add_allocation_param) |
michael@0 | 135 | GST_FUNC(LIBGSTREAMER, gst_query_add_allocation_pool) |
michael@0 | 136 | GST_FUNC(LIBGSTREAMER, gst_query_parse_allocation) |
michael@0 | 137 | GST_FUNC(LIBGSTREAMER, gst_registry_get) |
michael@0 | 138 | GST_FUNC(LIBGSTREAMER, gst_sample_get_buffer) |
michael@0 | 139 | GST_FUNC(LIBGSTREAMER, gst_segment_copy_into) |
michael@0 | 140 | GST_FUNC(LIBGSTREAMER, gst_structure_free) |
michael@0 | 141 | GST_FUNC(LIBGSTVIDEO, gst_buffer_pool_config_get_video_alignment) |
michael@0 | 142 | GST_FUNC(LIBGSTVIDEO, gst_buffer_pool_has_option) |
michael@0 | 143 | GST_FUNC(LIBGSTVIDEO, gst_video_buffer_pool_get_type) |
michael@0 | 144 | GST_FUNC(LIBGSTVIDEO, gst_video_frame_map) |
michael@0 | 145 | GST_FUNC(LIBGSTVIDEO, gst_video_frame_unmap) |
michael@0 | 146 | GST_FUNC(LIBGSTVIDEO, gst_video_info_align) |
michael@0 | 147 | GST_FUNC(LIBGSTVIDEO, gst_video_info_from_caps) |
michael@0 | 148 | GST_FUNC(LIBGSTVIDEO, gst_video_info_init) |
michael@0 | 149 | GST_FUNC(LIBGSTVIDEO, gst_video_meta_api_get_type) |
michael@0 | 150 | GST_FUNC(LIBGSTVIDEO, gst_video_meta_map) |
michael@0 | 151 | GST_FUNC(LIBGSTVIDEO, gst_video_meta_unmap) |
michael@0 | 152 | |
michael@0 | 153 | #endif |
michael@0 | 154 | |
michael@0 | 155 | /* |
michael@0 | 156 | * Functions that have been defined in the header file. We replace them so that |
michael@0 | 157 | * they don't try to use the global gstreamer functions. |
michael@0 | 158 | */ |
michael@0 | 159 | #ifdef REPLACE_FUNC |
michael@0 | 160 | REPLACE_FUNC(gst_buffer_ref); |
michael@0 | 161 | REPLACE_FUNC(gst_buffer_unref); |
michael@0 | 162 | REPLACE_FUNC(gst_message_unref); |
michael@0 | 163 | |
michael@0 | 164 | #if GST_VERSION_MAJOR == 1 |
michael@0 | 165 | REPLACE_FUNC(gst_caps_unref); |
michael@0 | 166 | REPLACE_FUNC(gst_sample_unref); |
michael@0 | 167 | #endif |
michael@0 | 168 | #endif |
michael@0 | 169 | |
michael@0 | 170 | #endif // !defined(__APPLE__) |