├── .gitignore ├── .gitmodules ├── .travis.yml ├── CMakeLists.txt ├── LICENSES ├── README.md ├── audio ├── CMakeLists.txt ├── audio.vcproj ├── audio.vcxproj ├── audio.vcxproj.filters ├── audio_out.cpp ├── audio_out.h ├── audio_render.h ├── audiocvt.h ├── dsound_render.cpp ├── dsound_render.h ├── internal.h ├── sdl_render.cpp ├── sdl_render.h ├── wave_render.cpp └── wave_render.h ├── avplay_vc2005.sln ├── avplay_vc2012.sln ├── avplayer.kdev4 ├── demux ├── demux.cpp ├── demux.h ├── demux.vcproj ├── demux.vcxproj ├── demux.vcxproj.filters ├── demuxer.h ├── generic_demux.cpp ├── generic_demux.h ├── internal.h ├── youku_demux.cpp └── youku_demux.h ├── libav ├── CMakeLists.txt ├── avplay.c ├── avplay.h ├── ffmpeg.h ├── globals.h ├── libav.vcproj ├── libav.vcxproj └── libav.vcxproj.filters ├── libtorrent ├── AUTHORS ├── CMakeLists.txt ├── COPYING ├── ChangeLog ├── Jamfile ├── Jamroot.jam ├── LICENSE ├── Makefile.am ├── NEWS ├── README ├── autotool.sh ├── bindings │ ├── Makefile.am │ ├── README.txt │ ├── c │ │ ├── Jamfile │ │ ├── library.cpp │ │ ├── libtorrent.h │ │ └── simple_client.c │ └── python │ │ ├── Jamfile │ │ ├── Makefile.am │ │ ├── client.py │ │ ├── make_torrent.py │ │ ├── rss_reader.py │ │ ├── setup.py.in │ │ ├── simple_client.py │ │ └── src │ │ ├── alert.cpp │ │ ├── big_number.cpp │ │ ├── converters.cpp │ │ ├── create_torrent.cpp │ │ ├── datetime.cpp │ │ ├── entry.cpp │ │ ├── error_code.cpp │ │ ├── fingerprint.cpp │ │ ├── gil.hpp │ │ ├── ip_filter.cpp │ │ ├── magnet_uri.cpp │ │ ├── module.cpp │ │ ├── optional.hpp │ │ ├── peer_info.cpp │ │ ├── session.cpp │ │ ├── session_settings.cpp │ │ ├── string.cpp │ │ ├── torrent.cpp │ │ ├── torrent_handle.cpp │ │ ├── torrent_info.cpp │ │ ├── torrent_status.cpp │ │ ├── utility.cpp │ │ └── version.cpp ├── build_dist.sh ├── configure.ac ├── darwin_valgrind.suppressions ├── dht_flood.py ├── docs │ ├── Linkage.png │ ├── arctic_thumb.png │ ├── auth.rst │ ├── bitbuddy_thumb.jpg │ ├── bitfox.png │ ├── bitrocket_thumb.png │ ├── bitscast_thumb.png │ ├── bitslug_thumb.png │ ├── btg_thumb.jpg │ ├── bubba.png │ ├── building.html │ ├── building.rst │ ├── client_test.html │ ├── client_test.png │ ├── client_test.rst │ ├── contributing.html │ ├── contributing.rst │ ├── cwnd.png │ ├── cwnd_thumb.png │ ├── delays.png │ ├── delays_thumb.png │ ├── deluge.png │ ├── dht_extensions.html │ ├── dht_extensions.rst │ ├── dht_rss.html │ ├── dht_rss.rst │ ├── dht_sec.html │ ├── dht_sec.rst │ ├── dht_store.html │ ├── dht_store.rst │ ├── disk_access.png │ ├── disk_access_elevator.png │ ├── disk_access_no_elevator.png │ ├── disk_buffer.png │ ├── disk_buffer_before_optimization.png │ ├── disk_buffer_sample.png │ ├── disk_io.png │ ├── electric_sheep_thumb.jpg │ ├── examples.html │ ├── examples.rst │ ├── extension_protocol.html │ ├── extension_protocol.rst │ ├── fatrat.png │ ├── fdm.png │ ├── features.html │ ├── features.rst │ ├── firetorrent.png │ ├── flush.jpg │ ├── folx.png │ ├── hacking.rst │ ├── halite_thumb.png │ ├── im_thumb.jpg │ ├── index.html │ ├── index.rst │ ├── ip_id_v4.png │ ├── ip_id_v6.png │ ├── ips.py │ ├── leechcraft.png │ ├── libtorrent_plugins.html │ ├── libtorrent_plugins.rst │ ├── libtorrent_screen.png │ ├── limewire.png │ ├── lince.png │ ├── make_thumb.sh │ ├── make_torrent.html │ ├── make_torrent.rst │ ├── makefile │ ├── manual.html │ ├── manual.rst │ ├── merkle_tree.graffle │ ├── merkle_tree.png │ ├── miro.jpg │ ├── moopolice_thumb.gif │ ├── our_delay_base.png │ ├── our_delay_base_thumb.png │ ├── projects.html │ ├── projects.rst │ ├── pump.png │ ├── python_binding.html │ ├── python_binding.rst │ ├── qbittorrent_thumb.jpg │ ├── read_disk_buffers.dot │ ├── read_disk_buffers.graffle │ ├── read_disk_buffers.png │ ├── running_tests.html │ ├── running_tests.rst │ ├── session_stats_peers.png │ ├── storage.graffle │ ├── storage.png │ ├── style.css │ ├── stylesheet │ ├── t2e.jpg │ ├── template.txt │ ├── todo.html │ ├── tonidoplug.png │ ├── troubleshooting.dot │ ├── troubleshooting.png │ ├── tuning.html │ ├── tuning.rst │ ├── tvblob.jpg │ ├── tvitty.jpg │ ├── udp_tracker_protocol.html │ ├── udp_tracker_protocol.rst │ ├── unicode_support.png │ ├── utp.html │ ├── utp.rst │ ├── write_disk_buffers.dot │ ├── write_disk_buffers.graffle │ ├── write_disk_buffers.png │ ├── ziptorrent_thumb.gif │ └── zyxel.png ├── examples │ ├── Jamfile │ ├── Makefile.am │ ├── client_test.cpp │ ├── client_test.vcproj │ ├── connection_tester.cpp │ ├── dump_torrent.cpp │ ├── enum_if.cpp │ ├── fragmentation_test.cpp │ ├── make_torrent.cpp │ ├── parse_request_log.cpp │ ├── rss_reader.cpp │ ├── run_benchmarks.py │ ├── simple_client.cpp │ ├── simple_client.vcproj │ ├── upnp_test.cpp │ └── utp_test.cpp ├── gen_todo.py ├── include │ ├── libtorrent.vcproj │ ├── libtorrent.vcxproj │ ├── libtorrent.vcxproj.filters │ └── libtorrent │ │ ├── ConvertUTF.h │ │ ├── GeoIP.h │ │ ├── Makefile.am │ │ ├── add_torrent_params.hpp │ │ ├── address.hpp │ │ ├── alert.hpp │ │ ├── alert_dispatcher.hpp │ │ ├── alert_types.hpp │ │ ├── alloca.hpp │ │ ├── allocator.hpp │ │ ├── assert.hpp │ │ ├── aux_ │ │ └── session_impl.hpp │ │ ├── bandwidth_limit.hpp │ │ ├── bandwidth_manager.hpp │ │ ├── bandwidth_queue_entry.hpp │ │ ├── bandwidth_socket.hpp │ │ ├── bencode.hpp │ │ ├── bitfield.hpp │ │ ├── bloom_filter.hpp │ │ ├── broadcast_socket.hpp │ │ ├── bt_peer_connection.hpp │ │ ├── buffer.hpp │ │ ├── build_config.hpp │ │ ├── chained_buffer.hpp │ │ ├── config.hpp │ │ ├── connection_queue.hpp │ │ ├── copy_ptr.hpp │ │ ├── create_torrent.hpp │ │ ├── deadline_timer.hpp │ │ ├── debug.hpp │ │ ├── disk_buffer_holder.hpp │ │ ├── disk_buffer_pool.hpp │ │ ├── disk_io_thread.hpp │ │ ├── entry.hpp │ │ ├── enum_net.hpp │ │ ├── error.hpp │ │ ├── error_code.hpp │ │ ├── escape_string.hpp │ │ ├── extensions.hpp │ │ ├── extensions │ │ ├── logger.hpp │ │ ├── lt_trackers.hpp │ │ ├── metadata_transfer.hpp │ │ ├── smart_ban.hpp │ │ ├── ut_metadata.hpp │ │ └── ut_pex.hpp │ │ ├── extern_read_op.hpp │ │ ├── file.hpp │ │ ├── file_pool.hpp │ │ ├── file_storage.hpp │ │ ├── fingerprint.hpp │ │ ├── gzip.hpp │ │ ├── hasher.hpp │ │ ├── http_connection.hpp │ │ ├── http_parser.hpp │ │ ├── http_seed_connection.hpp │ │ ├── http_stream.hpp │ │ ├── http_tracker_connection.hpp │ │ ├── i2p_stream.hpp │ │ ├── identify_client.hpp │ │ ├── instantiate_connection.hpp │ │ ├── intrusive_ptr_base.hpp │ │ ├── invariant_check.hpp │ │ ├── io.hpp │ │ ├── io_service.hpp │ │ ├── io_service_fwd.hpp │ │ ├── ip_filter.hpp │ │ ├── ip_voter.hpp │ │ ├── kademlia │ │ ├── dht_observer.hpp │ │ ├── dht_tracker.hpp │ │ ├── find_data.hpp │ │ ├── logging.hpp │ │ ├── msg.hpp │ │ ├── node.hpp │ │ ├── node_entry.hpp │ │ ├── node_id.hpp │ │ ├── observer.hpp │ │ ├── refresh.hpp │ │ ├── routing_table.hpp │ │ ├── rpc_manager.hpp │ │ └── traversal_algorithm.hpp │ │ ├── lazy_entry.hpp │ │ ├── lsd.hpp │ │ ├── magnet_uri.hpp │ │ ├── max.hpp │ │ ├── natpmp.hpp │ │ ├── packet_buffer.hpp │ │ ├── parse_url.hpp │ │ ├── pch.hpp │ │ ├── pe_crypto.hpp │ │ ├── peer.hpp │ │ ├── peer_connection.hpp │ │ ├── peer_id.hpp │ │ ├── peer_info.hpp │ │ ├── peer_request.hpp │ │ ├── piece_block_progress.hpp │ │ ├── piece_picker.hpp │ │ ├── policy.hpp │ │ ├── proxy_base.hpp │ │ ├── ptime.hpp │ │ ├── puff.hpp │ │ ├── random.hpp │ │ ├── rsa.hpp │ │ ├── rss.hpp │ │ ├── session.hpp │ │ ├── session_settings.hpp │ │ ├── session_status.hpp │ │ ├── settings.hpp │ │ ├── size_type.hpp │ │ ├── sliding_average.hpp │ │ ├── socket.hpp │ │ ├── socket_io.hpp │ │ ├── socket_type.hpp │ │ ├── socket_type_fwd.hpp │ │ ├── socks5_stream.hpp │ │ ├── ssl_stream.hpp │ │ ├── stat.hpp │ │ ├── storage.hpp │ │ ├── storage_defs.hpp │ │ ├── string_util.hpp │ │ ├── struct_debug.hpp │ │ ├── thread.hpp │ │ ├── time.hpp │ │ ├── timestamp_history.hpp │ │ ├── tommath.h │ │ ├── tommath_class.h │ │ ├── tommath_superclass.h │ │ ├── torrent.hpp │ │ ├── torrent_handle.hpp │ │ ├── torrent_info.hpp │ │ ├── tracker_manager.hpp │ │ ├── udp_socket.hpp │ │ ├── udp_tracker_connection.hpp │ │ ├── union_endpoint.hpp │ │ ├── upnp.hpp │ │ ├── utf8.hpp │ │ ├── utp_socket_manager.hpp │ │ ├── utp_stream.hpp │ │ ├── version.hpp │ │ ├── web_connection_base.hpp │ │ ├── web_peer_connection.hpp │ │ └── xml_parse.hpp ├── libtorrent-rasterbar-cmake.pc.in ├── libtorrent-rasterbar.pc.in ├── list_files.py ├── m4 │ ├── ax_boost_base.m4 │ ├── ax_boost_python.m4 │ ├── ax_boost_system.m4 │ ├── ax_check_geoip.m4 │ ├── ax_check_openssl.m4 │ ├── ax_pthread.m4 │ ├── ax_python_devel.m4 │ ├── config.rpath │ ├── gettext-lib.m4 │ ├── iconv.m4 │ └── pkgconfig.m4 ├── parse_bandwidth_log.py ├── parse_buffer_log.py ├── parse_dht_log.py ├── parse_dht_rtt.py ├── parse_dht_stats.py ├── parse_disk_access.py ├── parse_disk_buffer_log.py ├── parse_disk_log.py ├── parse_memory_log.py ├── parse_sample.py ├── parse_session_stats.py ├── parse_utp_log.py ├── sanity-checker.xml ├── set_version.py ├── src │ ├── ConvertUTF.cpp │ ├── GeoIP.c │ ├── Makefile.am │ ├── alert.cpp │ ├── allocator.cpp │ ├── asio.cpp │ ├── asio_ssl.cpp │ ├── assert.cpp │ ├── bandwidth_limit.cpp │ ├── bandwidth_manager.cpp │ ├── bandwidth_queue_entry.cpp │ ├── bloom_filter.cpp │ ├── broadcast_socket.cpp │ ├── bt_peer_connection.cpp │ ├── chained_buffer.cpp │ ├── connection_queue.cpp │ ├── create_torrent.cpp │ ├── disk_buffer_holder.cpp │ ├── disk_buffer_pool.cpp │ ├── disk_io_thread.cpp │ ├── entry.cpp │ ├── enum_net.cpp │ ├── error_code.cpp │ ├── escape_string.cpp │ ├── file.cpp │ ├── file_pool.cpp │ ├── file_storage.cpp │ ├── gzip.cpp │ ├── http_connection.cpp │ ├── http_parser.cpp │ ├── http_seed_connection.cpp │ ├── http_stream.cpp │ ├── http_tracker_connection.cpp │ ├── i2p_stream.cpp │ ├── identify_client.cpp │ ├── instantiate_connection.cpp │ ├── ip_filter.cpp │ ├── ip_voter.cpp │ ├── kademlia │ │ ├── dht_tracker.cpp │ │ ├── find_data.cpp │ │ ├── node.cpp │ │ ├── node_id.cpp │ │ ├── refresh.cpp │ │ ├── routing_table.cpp │ │ ├── rpc_manager.cpp │ │ └── traversal_algorithm.cpp │ ├── lazy_bdecode.cpp │ ├── logger.cpp │ ├── lsd.cpp │ ├── lt_trackers.cpp │ ├── magnet_uri.cpp │ ├── metadata_transfer.cpp │ ├── mpi.c │ ├── natpmp.cpp │ ├── packet_buffer.cpp │ ├── parse_url.cpp │ ├── pe_crypto.cpp │ ├── peer_connection.cpp │ ├── piece_picker.cpp │ ├── policy.cpp │ ├── puff.cpp │ ├── random.cpp │ ├── rsa.cpp │ ├── rss.cpp │ ├── session.cpp │ ├── session_impl.cpp │ ├── settings.cpp │ ├── sha1.cpp │ ├── smart_ban.cpp │ ├── socket_io.cpp │ ├── socket_type.cpp │ ├── socks5_stream.cpp │ ├── stat.cpp │ ├── storage.cpp │ ├── string_util.cpp │ ├── thread.cpp │ ├── time.cpp │ ├── timestamp_history.cpp │ ├── torrent.cpp │ ├── torrent_handle.cpp │ ├── torrent_info.cpp │ ├── tracker_manager.cpp │ ├── udp_socket.cpp │ ├── udp_tracker_connection.cpp │ ├── upnp.cpp │ ├── ut_metadata.cpp │ ├── ut_pex.cpp │ ├── utf8.cpp │ ├── utp_socket_manager.cpp │ ├── utp_stream.cpp │ ├── web_connection_base.cpp │ └── web_peer_connection.cpp ├── test │ ├── Jamfile │ ├── Makefile.am │ ├── cb.xml │ ├── eztv.xml │ ├── kat.xml │ ├── main.cpp │ ├── mn.xml │ ├── pb.xml │ ├── root1.xml │ ├── root2.xml │ ├── setup_transfer.cpp │ ├── setup_transfer.hpp │ ├── test.hpp │ ├── test_auto_unchoke.cpp │ ├── test_bandwidth_limiter.cpp │ ├── test_bdecode_performance.cpp │ ├── test_bencoding.cpp │ ├── test_buffer.cpp │ ├── test_checking.cpp │ ├── test_dht.cpp │ ├── test_fast_extension.cpp │ ├── test_file.cpp │ ├── test_hasher.cpp │ ├── test_http_connection.cpp │ ├── test_ip_filter.cpp │ ├── test_lsd.cpp │ ├── test_metadata_extension.cpp │ ├── test_natpmp.cpp │ ├── test_pe_crypto.cpp │ ├── test_peer_priority.cpp │ ├── test_pex.cpp │ ├── test_piece_picker.cpp │ ├── test_primitives.cpp │ ├── test_rss.cpp │ ├── test_storage.cpp │ ├── test_swarm.cpp │ ├── test_threads.cpp │ ├── test_torrent.cpp │ ├── test_torrent_parse.cpp │ ├── test_tracker.cpp │ ├── test_trackers_extension.cpp │ ├── test_transfer.cpp │ ├── test_upnp.cpp │ ├── test_utp.cpp │ └── test_web_seed.cpp ├── tools │ ├── Jamfile │ ├── Makefile.am │ └── parse_hash_fails.cpp └── update_copyright.py ├── libyk ├── CMakeLists.txt ├── libyk.cpp ├── libyk.h ├── libyk.vcproj ├── libyk.vcxproj ├── libyk.vcxproj.filters ├── youku_impl.cpp └── youku_impl.h ├── linux ├── CMakeLists.txt ├── main.cpp ├── player.cpp └── player.h ├── logo.png ├── logo.svg ├── source ├── CMakeLists.txt ├── asio.cpp ├── av_source.h ├── file_source.cpp ├── file_source.h ├── internal.h ├── source.cpp ├── source.h ├── source.vcproj ├── source.vcxproj ├── source.vcxproj.filters ├── torrent_source.cpp ├── torrent_source.h ├── yk_source.cpp └── yk_source.h ├── third_party ├── ffmpeg │ ├── bin │ │ ├── SDL.dll │ │ ├── VSFilter.dll │ │ ├── avcodec-54.dll │ │ ├── avdevice-54.dll │ │ ├── avfilter-3.dll │ │ ├── avformat-54.dll │ │ ├── avutil-52.dll │ │ ├── ffmpeg.exe │ │ ├── ffplay.exe │ │ ├── ffprobe.exe │ │ ├── libeay32.dll │ │ ├── libgcc_s_dw2-1.dll │ │ ├── postproc-52.dll │ │ ├── pthreadGC2.dll │ │ ├── ssleay32.dll │ │ ├── swresample-0.dll │ │ └── swscale-2.dll │ ├── include │ │ ├── SDL │ │ │ ├── SDL.h │ │ │ ├── SDL_active.h │ │ │ ├── SDL_audio.h │ │ │ ├── SDL_byteorder.h │ │ │ ├── SDL_cdrom.h │ │ │ ├── SDL_config.h │ │ │ ├── SDL_copying.h │ │ │ ├── SDL_cpuinfo.h │ │ │ ├── SDL_endian.h │ │ │ ├── SDL_error.h │ │ │ ├── SDL_events.h │ │ │ ├── SDL_getenv.h │ │ │ ├── SDL_joystick.h │ │ │ ├── SDL_keyboard.h │ │ │ ├── SDL_keysym.h │ │ │ ├── SDL_loadso.h │ │ │ ├── SDL_main.h │ │ │ ├── SDL_mouse.h │ │ │ ├── SDL_mutex.h │ │ │ ├── SDL_name.h │ │ │ ├── SDL_opengl.h │ │ │ ├── SDL_platform.h │ │ │ ├── SDL_quit.h │ │ │ ├── SDL_rwops.h │ │ │ ├── SDL_stdinc.h │ │ │ ├── SDL_syswm.h │ │ │ ├── SDL_thread.h │ │ │ ├── SDL_timer.h │ │ │ ├── SDL_types.h │ │ │ ├── SDL_version.h │ │ │ ├── SDL_video.h │ │ │ ├── begin_code.h │ │ │ ├── close_code.h │ │ │ └── doxyfile │ │ ├── libavcodec │ │ │ ├── avcodec.h │ │ │ ├── avfft.h │ │ │ ├── dxva2.h │ │ │ ├── old_codec_ids.h │ │ │ ├── vaapi.h │ │ │ ├── vda.h │ │ │ ├── vdpau.h │ │ │ ├── version.h │ │ │ └── xvmc.h │ │ ├── libavdevice │ │ │ ├── avdevice.h │ │ │ └── version.h │ │ ├── libavfilter │ │ │ ├── asrc_abuffer.h │ │ │ ├── avcodec.h │ │ │ ├── avfilter.h │ │ │ ├── avfiltergraph.h │ │ │ ├── buffersink.h │ │ │ ├── buffersrc.h │ │ │ └── version.h │ │ ├── libavformat │ │ │ ├── avformat.h │ │ │ ├── avio.h │ │ │ └── version.h │ │ ├── libavutil │ │ │ ├── adler32.h │ │ │ ├── aes.h │ │ │ ├── attributes.h │ │ │ ├── audio_fifo.h │ │ │ ├── audioconvert.h │ │ │ ├── avassert.h │ │ │ ├── avconfig.h │ │ │ ├── avstring.h │ │ │ ├── avutil.h │ │ │ ├── base64.h │ │ │ ├── blowfish.h │ │ │ ├── bprint.h │ │ │ ├── bswap.h │ │ │ ├── channel_layout.h │ │ │ ├── common.h │ │ │ ├── cpu.h │ │ │ ├── crc.h │ │ │ ├── dict.h │ │ │ ├── error.h │ │ │ ├── eval.h │ │ │ ├── fifo.h │ │ │ ├── file.h │ │ │ ├── imgutils.h │ │ │ ├── intfloat.h │ │ │ ├── intfloat_readwrite.h │ │ │ ├── intreadwrite.h │ │ │ ├── lfg.h │ │ │ ├── log.h │ │ │ ├── lzo.h │ │ │ ├── mathematics.h │ │ │ ├── md5.h │ │ │ ├── mem.h │ │ │ ├── old_pix_fmts.h │ │ │ ├── opt.h │ │ │ ├── parseutils.h │ │ │ ├── pixdesc.h │ │ │ ├── pixfmt.h │ │ │ ├── random_seed.h │ │ │ ├── rational.h │ │ │ ├── samplefmt.h │ │ │ ├── sha.h │ │ │ ├── time.h │ │ │ ├── timecode.h │ │ │ ├── timestamp.h │ │ │ ├── version.h │ │ │ └── xtea.h │ │ ├── libpostproc │ │ │ ├── postprocess.h │ │ │ └── version.h │ │ ├── libswresample │ │ │ ├── swresample.h │ │ │ └── version.h │ │ └── libswscale │ │ │ ├── swscale.h │ │ │ └── version.h │ ├── lib │ │ ├── avcodec-54.def │ │ ├── avcodec.lib │ │ ├── avdevice-54.def │ │ ├── avdevice.lib │ │ ├── avfilter-3.def │ │ ├── avfilter.lib │ │ ├── avformat-54.def │ │ ├── avformat.lib │ │ ├── avutil-52.def │ │ ├── avutil.lib │ │ ├── libSDL.a │ │ ├── libavcodec.dll.a │ │ ├── libavdevice.dll.a │ │ ├── libavfilter.dll.a │ │ ├── libavformat.dll.a │ │ ├── libavutil.dll.a │ │ ├── libbz2.a │ │ ├── libgcc.a │ │ ├── libmingwex.a │ │ ├── libpostproc.dll.a │ │ ├── libpthreadGC2.a │ │ ├── libswresample.dll.a │ │ ├── libswscale.dll.a │ │ ├── libz.a │ │ ├── postproc-52.def │ │ ├── postproc.lib │ │ ├── swresample-0.def │ │ ├── swresample.lib │ │ ├── swscale-2.def │ │ └── swscale.lib │ └── share │ │ ├── ffmpeg │ │ ├── examples │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── decoding_encoding.c │ │ │ ├── demuxing.c │ │ │ ├── filtering_audio.c │ │ │ ├── filtering_video.c │ │ │ ├── metadata.c │ │ │ ├── muxing.c │ │ │ ├── resampling_audio.c │ │ │ └── scaling_video.c │ │ ├── ffprobe.xsd │ │ ├── libvpx-1080p.ffpreset │ │ ├── libvpx-1080p50_60.ffpreset │ │ ├── libvpx-360p.ffpreset │ │ ├── libvpx-720p.ffpreset │ │ ├── libvpx-720p50_60.ffpreset │ │ ├── libx264-ipod320.ffpreset │ │ └── libx264-ipod640.ffpreset │ │ └── man │ │ └── man1 │ │ ├── ffmpeg-bitstream-filters.1 │ │ ├── ffmpeg-codecs.1 │ │ ├── ffmpeg-devices.1 │ │ ├── ffmpeg-filters.1 │ │ ├── ffmpeg-formats.1 │ │ ├── ffmpeg-protocols.1 │ │ ├── ffmpeg-resampler.1 │ │ ├── ffmpeg-scaler.1 │ │ ├── ffmpeg-utils.1 │ │ ├── ffmpeg.1 │ │ ├── ffplay.1 │ │ ├── ffprobe.1 │ │ ├── libavcodec.3 │ │ ├── libavdevice.3 │ │ ├── libavfilter.3 │ │ ├── libavformat.3 │ │ ├── libavutil.3 │ │ ├── libswresample.3 │ │ └── libswscale.3 ├── include │ ├── inttypes.h │ ├── pthread.h │ ├── sched.h │ ├── semaphore.h │ └── stdint.h └── openssl │ ├── include │ └── openssl │ │ ├── aes.h │ │ ├── applink.c │ │ ├── asn1.h │ │ ├── asn1_mac.h │ │ ├── asn1t.h │ │ ├── bio.h │ │ ├── blowfish.h │ │ ├── bn.h │ │ ├── buffer.h │ │ ├── camellia.h │ │ ├── cast.h │ │ ├── cmac.h │ │ ├── cms.h │ │ ├── comp.h │ │ ├── conf.h │ │ ├── conf_api.h │ │ ├── crypto.h │ │ ├── des.h │ │ ├── des_old.h │ │ ├── dh.h │ │ ├── dsa.h │ │ ├── dso.h │ │ ├── dtls1.h │ │ ├── e_os2.h │ │ ├── ebcdic.h │ │ ├── ec.h │ │ ├── ecdh.h │ │ ├── ecdsa.h │ │ ├── engine.h │ │ ├── err.h │ │ ├── evp.h │ │ ├── hmac.h │ │ ├── idea.h │ │ ├── krb5_asn.h │ │ ├── kssl.h │ │ ├── lhash.h │ │ ├── md4.h │ │ ├── md5.h │ │ ├── mdc2.h │ │ ├── modes.h │ │ ├── obj_mac.h │ │ ├── objects.h │ │ ├── ocsp.h │ │ ├── opensslconf.h │ │ ├── opensslv.h │ │ ├── ossl_typ.h │ │ ├── pem.h │ │ ├── pem2.h │ │ ├── pkcs12.h │ │ ├── pkcs7.h │ │ ├── pqueue.h │ │ ├── rand.h │ │ ├── rc2.h │ │ ├── rc4.h │ │ ├── ripemd.h │ │ ├── rsa.h │ │ ├── safestack.h │ │ ├── seed.h │ │ ├── sha.h │ │ ├── srp.h │ │ ├── srtp.h │ │ ├── ssl.h │ │ ├── ssl2.h │ │ ├── ssl23.h │ │ ├── ssl3.h │ │ ├── stack.h │ │ ├── symhacks.h │ │ ├── tls1.h │ │ ├── ts.h │ │ ├── txt_db.h │ │ ├── ui.h │ │ ├── ui_compat.h │ │ ├── whrlpool.h │ │ ├── x509.h │ │ ├── x509_vfy.h │ │ └── x509v3.h │ └── libs │ ├── libeay32.lib │ └── ssleay32.lib ├── video ├── CMakeLists.txt ├── d3d_render.cpp ├── d3d_render.h ├── ddraw_render.cpp ├── ddraw_render.h ├── internal.h ├── opengl_render.cpp ├── opengl_render.h ├── sdl_render.cpp ├── sdl_render.h ├── soft_render.cpp ├── soft_render.h ├── video.vcproj ├── video.vcxproj ├── video.vcxproj.filters ├── video_out.cpp ├── video_out.h ├── video_render.h ├── y4m_render.cpp └── y4m_render.h └── win32 ├── CMakeLists.txt ├── avcore ├── avcore.vcproj ├── avcore.vcxproj ├── avcore.vcxproj.filters ├── avplayer.cpp ├── avplayer.h ├── player_impl.cpp ├── player_impl.h ├── stdafx.cpp └── stdafx.h └── avplayer ├── ReadMe.txt ├── avplayer.ico ├── avplayer.rc ├── avplayer.vcproj ├── avplayer.vcxproj ├── avplayer.vcxproj.filters ├── main.cpp ├── resource.h └── small.ico /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | *.dylib 9 | 10 | # Compiled Static libraries 11 | *.lai 12 | *.la 13 | *.a 14 | 15 | .kdev4/ 16 | *.kdev4 17 | build/ 18 | Debug/ 19 | Release/ 20 | 21 | #Visual Studio files 22 | *.[Oo]bj 23 | *.user 24 | *.aps 25 | *.pch 26 | *.vspscc 27 | *.vssscc 28 | *_i.c 29 | *_p.c 30 | *.ncb 31 | *.suo 32 | *.tlb 33 | *.tlh 34 | *.bak 35 | *.[Cc]ache 36 | *.ilk 37 | *.log 38 | *.lib 39 | *.sbr 40 | *.sdf 41 | *.sdf 42 | *.opensdf 43 | *.pdb 44 | *.idb 45 | *.res 46 | *.unsuccessfulbuild 47 | *.lastbuildstate 48 | *.tlog 49 | *.intermediate 50 | *.dll 51 | *.exp 52 | *.exe 53 | *.manifest 54 | *.rc 55 | ipch/ 56 | obj/ 57 | *.resfiles 58 | [Bb]in 59 | Binaries/ 60 | VS11.winrt/ 61 | !*.vcxproj.* 62 | 63 | core 64 | core.* 65 | .* 66 | *.torrent -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "third_party/avhttp"] 2 | path = third_party/avhttp 3 | url = git://github.com/avplayer/avhttp.git 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | compiler: 3 | - gcc 4 | - clang 5 | 6 | before_install: 7 | - sudo add-apt-repository -y ppa:28msec/boost 8 | - sudo add-apt-repository -y ppa:jon-severinsson/ffmpeg 9 | - sudo apt-get update 10 | - sudo apt-get install -qq boost1.50 libsdl-dev 11 | - sudo apt-get install -qq libswresample-dev libavformat-dev libavcodec-dev libavutil-dev libswscale-dev 12 | 13 | before_script: 14 | cmake . 15 | 16 | script: 17 | make 18 | 19 | branches: 20 | only: 21 | - master 22 | notifications: 23 | recipients: 24 | - microcaicai@gmail.com 25 | - jack.wgm@gmail.com 26 | email: 27 | on_success: change 28 | on_failure: always 29 | 30 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | project(avplayer) 3 | list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}") 4 | 5 | SET(CMAKE_INCLUDE_CURRENT_DIR ON) 6 | 7 | SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}) 8 | set(Boost_USE_MULTITHREADED ON) 9 | set(Boost_USE_STATIC_LIBS ON) 10 | set(Boost_USE_STATIC_RUNTIME ON) 11 | 12 | find_package( Boost 1.50 REQUIRED COMPONENTS thread filesystem) 13 | 14 | add_definitions(-D__STDC_CONSTANT_MACROS) 15 | 16 | #dont't define this, libbt need depreated api 17 | include_directories(${Boost_INCLUDE_DIRS}) 18 | include_directories(${PROJECT_SOURCE_DIR}) 19 | include_directories(libav/) 20 | include_directories(source/) 21 | include_directories(audio/) 22 | 23 | option(bt "support bt protocol" ON) 24 | option(yk "support youku video" ON) 25 | 26 | add_subdirectory(libav) 27 | add_subdirectory(video) 28 | add_subdirectory(audio) 29 | add_subdirectory(source) 30 | 31 | if(bt) 32 | add_subdirectory(libtorrent) 33 | endif() 34 | 35 | if(yk) 36 | add_subdirectory(libyk) 37 | endif() 38 | 39 | if(UNIX) 40 | add_subdirectory(linux) 41 | endif() 42 | 43 | if(WIN32) 44 | add_subdirectory(win32) 45 | endif() 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 一直以来, 在多媒体播放器这块, 即使目前有许多开源的播放器项目, 但要写一个播放器仍然是件非常困难的事, 如果在windows上你有可能需要熟悉DShow, 另外的话, 你需要学习一堆开源项目(比如FFmpeg, MPC, VLC, Mplayer), 而且多数都是基于linux, 在windows上学习起来很不容易, 然而这些开源项目对于一些希望快速实现自己播放器, 就显得很困难. 2 | 因此, 我创建了这个项目, 致力于以最简单的方法实现自己的播放器, 并提供一个可以很方便使用的接口. 3 | 4 | 目前, 在这个代码中, 主要链接到FFmpeg来进行解码, 并将其改造成一个通用的播放器框架. 在这个框架中能够接受各种数据的读入, 可以很方便的封装自己的数据读取模块, 也可以很方便的定制自己的视频渲染模块和音频播放模块, 你只需要参考其中的实现即可. 5 | 另外在当前的实现中, 因为个人精力实在有限, 所以借鉴了一些开源项目的代码(如Mplayer), 并且该代码跨平台(目前在linux平台的实现稍简单). 所以, 我希望有朋友能参与到这个项目中一起研究和学习, 并完成这个目标. 6 | 7 | 在 https://sourceforge.net/projects/avplayer/files/ 中有已经编译好的exe和torrent可供测试, 测试命令格式如下: 8 | 9 | avplayer.exe <文件名|URL|TORRENT> 10 | 11 | 12 | 源代码: 13 | 14 | 请使用git下载, 以便随时更新代码, 这样做也可以方便在你自己的分支中开发, 并提交补丁. 15 | 16 | $ git clone https://github.com/avplayer/avplayer.git avplayer 17 | 18 | 更新 19 | 20 | $ git pull 21 | 22 | 更新子模块 23 | 24 | $ git submodule init 25 | $ git submodule update 26 | 27 | 28 | 在windows下, 需要下载https://sourceforge.net/projects/avplayer/files/develop/FFmpeg-dev/ 和 https://sourceforge.net/projects/avplayer/files/develop/OpenSSL-dev/ 解压到third_party目录下. 29 | 以及下载配置DXSDK环境 http://sourceforge.net/projects/avplayer/files/develop/DXSDK/ , 配置DXSDK有疑问, 可以参考wiki中的 https://github.com/Jackarain/avplayer/wiki/build 30 | 有任何问题, 请在issues里提交问题. 31 | 32 | ##### 使用 cmake 编译 33 | 34 | cmake . && make 35 | 36 | #### 本程序基于FFmpeg, 所以只能以GPL协议发布, 任何人请在遵守协议的前提下复制、发布、修改. 37 | #### 最后本程序作者不承担使用该程序所带来的任何问题并拥有一切解释权. 38 | #### 提供商业技术支持服务. 39 | 40 | 41 | 42 | 联系方式: 43 | 44 | mail: jack.wgm AT gmail.com microcaicai AT gmail.com 45 | 46 | qq: 17146738 47 | 48 | 49 | -------------------------------------------------------------------------------- /audio/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package( Boost 1.50 COMPONENTS thread) 2 | 3 | add_library(avaudio STATIC sdl_render.cpp) 4 | target_link_libraries(avaudio ${Boost_LIBRARIES}) 5 | -------------------------------------------------------------------------------- /audio/audio.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/audio/audio.vcproj -------------------------------------------------------------------------------- /audio/audio.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | source 6 | 7 | 8 | source 9 | 10 | 11 | source 12 | 13 | 14 | 15 | 16 | include 17 | 18 | 19 | include 20 | 21 | 22 | include 23 | 24 | 25 | include 26 | 27 | 28 | include 29 | 30 | 31 | include 32 | 33 | 34 | 35 | 36 | {3f430ef3-f6c8-4b69-9fd5-ca52f8e8993f} 37 | 38 | 39 | {6de7fcce-612b-4e9f-b117-1119979a7a23} 40 | 41 | 42 | -------------------------------------------------------------------------------- /audio/audio_out.h: -------------------------------------------------------------------------------- 1 | // 2 | // audio_out.h 3 | // ~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2011 Jack (jack.wgm@gmail.com) 6 | // 7 | 8 | #ifndef __AUDIO_OUT_H__ 9 | #define __AUDIO_OUT_H__ 10 | 11 | #ifdef _MSC_VER 12 | # ifdef AUDIO_EXPORTS 13 | # define EXPORT_API __declspec(dllexport) 14 | # else 15 | # define EXPORT_API __declspec(dllimport) 16 | # endif 17 | #else 18 | # define EXPORT_API 19 | #endif 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | EXPORT_API int wave_init_audio(struct ao_context *ctx, uint32_t channels, 26 | uint32_t bits_per_sample, uint32_t sample_rate, int format); 27 | EXPORT_API int wave_play_audio(struct ao_context *ctx, uint8_t *data, uint32_t size); 28 | EXPORT_API void wave_audio_control(struct ao_context *ctx, double l, double r); 29 | EXPORT_API void wave_mute_set(struct ao_context *ctx, int s); 30 | EXPORT_API void wave_destory_audio(struct ao_context *ctx); 31 | 32 | 33 | EXPORT_API int dsound_init_audio(struct ao_context *ctx, uint32_t channels, 34 | uint32_t bits_per_sample, uint32_t sample_rate, int format); 35 | EXPORT_API int dsound_play_audio(struct ao_context *ctx, uint8_t *data, uint32_t size); 36 | EXPORT_API void dsound_audio_control(struct ao_context *ctx, double l, double r); 37 | EXPORT_API void dsound_mute_set(struct ao_context *ctx, int s); 38 | EXPORT_API void dsound_destory_audio(struct ao_context *ctx); 39 | 40 | EXPORT_API int sdl_init_audio(struct ao_context *ctx, uint32_t channels, 41 | uint32_t bits_per_sample, uint32_t sample_rate, int format); 42 | EXPORT_API int sdl_play_audio(struct ao_context *ctx, uint8_t *data, uint32_t size); 43 | EXPORT_API void sdl_audio_control(struct ao_context *ctx, double l, double r); 44 | EXPORT_API void sdl_mute_set(struct ao_context *ctx, int s); 45 | EXPORT_API void sdl_destory_audio(struct ao_context *ctx); 46 | 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif // __AUDIO_OUT_H__ 53 | 54 | 55 | -------------------------------------------------------------------------------- /audio/dsound_render.h: -------------------------------------------------------------------------------- 1 | // 2 | // dsound_render.h 3 | // ~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2011 Jack (jack.wgm@gmail.com) 6 | // 7 | 8 | #ifndef __DSOUND_RENDER_H__ 9 | #define __DSOUND_RENDER_H__ 10 | 11 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 12 | # pragma once 13 | #endif 14 | 15 | #include "audio_render.h" 16 | 17 | class dsound_render 18 | : public audio_render 19 | { 20 | public: 21 | dsound_render(); 22 | virtual ~dsound_render(); 23 | 24 | public: 25 | // 初始化音频输出. 26 | virtual bool init_audio(void* ctx, int channels, int bits_per_sample, int sample_rate, int format); 27 | 28 | // 播放音频数据. 29 | virtual int play_audio(uint8_t* data, uint32_t size); 30 | 31 | // 音频播放控制, cmd为CONTROL_开始的宏定义. 32 | virtual void audio_control(int cmd, void* arg); 33 | 34 | // 销毁音频输出组件. 35 | virtual void destory_audio(); 36 | 37 | private: 38 | int af_fmt2bits(int format); 39 | char* dserr2str(int err); 40 | 41 | private: 42 | // direct sound object. 43 | LPDIRECTSOUND8 m_dsound; 44 | 45 | // primary direct sound buffer. 46 | LPDIRECTSOUNDBUFFER m_dsbuffer_primary; 47 | 48 | // secondary direct sound buffer (stream buffer) 49 | LPDIRECTSOUNDBUFFER m_dsbuffer_second; 50 | 51 | // wanted device number. 52 | int m_device_num; 53 | 54 | // size in bytes of the direct sound buffer. 55 | int m_buffer_size; 56 | 57 | // offset of the write cursor in the direct sound buffer. 58 | int m_write_offset; 59 | 60 | // if the free space is below this value get_space() will return 0 61 | int m_min_free_space; 62 | 63 | // 声道数. 64 | int m_channels; 65 | 66 | // 比特率. 67 | int m_bitrate; 68 | 69 | // 音频格式. 70 | int m_format; 71 | }; 72 | 73 | #endif // __DSOUND_RENDER_H__ 74 | -------------------------------------------------------------------------------- /audio/internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // internal.h 3 | // ~~~~~ 4 | // 5 | // Copyright (c) 2011 Jack (jack.wgm@gmail.com) 6 | // 7 | 8 | #ifndef __INTERNAL_H__ 9 | #define __INTEENAL_H__ 10 | 11 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 12 | # pragma once 13 | #endif 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | #endif // __INTERNAL_H__ 26 | -------------------------------------------------------------------------------- /audio/sdl_render.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 microcai 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License along 15 | with this program; if not, write to the Free Software Foundation, Inc., 16 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | */ 18 | 19 | 20 | #ifndef SDL_RENDER_H 21 | #define SDL_RENDER_H 22 | #include 23 | #include "audio_render.h" 24 | 25 | class sdl_audio_render:public audio_render 26 | { 27 | public: 28 | // 初始化音频输出. 29 | virtual bool init_audio(void* ctx, int channels, int bits_per_sample, int sample_rate, int format); 30 | 31 | // 播放音频数据. 32 | virtual int play_audio(uint8_t* data, uint32_t size); 33 | 34 | // 音频播放控制, cmd为CONTROL_开始的宏定义. 35 | virtual void audio_control(int cmd, void* arg); 36 | 37 | // 销毁音频输出组件. 38 | virtual void destory_audio(); 39 | 40 | static void sdl_audio_callback(void *userdata, Uint8 *stream, int len); 41 | friend void sdl_audio_callback(void *userdata, Uint8 *stream, int len); 42 | private: 43 | void audio_callback(Uint8 *stream, int len); 44 | private: 45 | int adfd[2]; 46 | }; 47 | 48 | #endif // SDL_RENDER_H 49 | -------------------------------------------------------------------------------- /audio/wave_render.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/audio/wave_render.cpp -------------------------------------------------------------------------------- /audio/wave_render.h: -------------------------------------------------------------------------------- 1 | // 2 | // wave_render.h 3 | // ~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2011 Jack (jack.wgm@gmail.com) 6 | // 7 | 8 | #ifndef __WAVE_RENDER_H__ 9 | #define __WAVE_RENDER_H__ 10 | 11 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 12 | # pragma once 13 | #endif 14 | 15 | #include "audio_render.h" 16 | 17 | class wave_render 18 | : public audio_render 19 | { 20 | public: 21 | wave_render(); 22 | virtual ~wave_render(); 23 | 24 | public: 25 | // 初始化音频输出. 26 | virtual bool init_audio(void* ctx, int channels, int bits_per_sample, int sample_rate, int format); 27 | 28 | // 播放音频数据. 29 | virtual int play_audio(uint8_t* data, uint32_t size); 30 | 31 | // 音频播放控制, cmd为CONTROL_开始的宏定义. 32 | virtual void audio_control(int cmd, void* arg); 33 | 34 | // 销毁音频输出组件. 35 | virtual void destory_audio(); 36 | 37 | private: 38 | static void __stdcall waveOutProc(HWAVEOUT hWaveOut,UINT uMsg,DWORD dwInstance, 39 | DWORD dwParam1,DWORD dwParam2); 40 | 41 | private: 42 | // waveOut句柄. 43 | HWAVEOUT m_hwaveout; 44 | 45 | // 缓冲大小. 46 | int m_buffersize; 47 | 48 | // pointer to our ringbuffer memory. 49 | WAVEHDR* m_wave_blocks; 50 | 51 | // 写入位置. 52 | unsigned int m_buf_write; 53 | 54 | // 播放位置. 55 | volatile int m_buf_read; 56 | 57 | // 保存当前音量大小. 58 | control_vol_t m_volume; 59 | }; 60 | 61 | #endif // __WAVE_RENDER_H__ 62 | -------------------------------------------------------------------------------- /avplayer.kdev4: -------------------------------------------------------------------------------- 1 | [Project] 2 | Manager=KDevCMakeManager 3 | Name=avplayer 4 | -------------------------------------------------------------------------------- /demux/demux.h: -------------------------------------------------------------------------------- 1 | // 2 | // demux.h 3 | // ~~~~~~~ 4 | // 5 | // Copyright (c) 2013 Jack (jack.wgm@gmail.com) 6 | // 7 | 8 | #ifndef __DEMUX_H__ 9 | #define __DEMUX_H__ 10 | 11 | #ifdef _MSC_VER 12 | #ifdef DEMUX_EXPORTS 13 | #define EXPORT_API __declspec(dllexport) 14 | #else 15 | #define EXPORT_API __declspec(dllimport) 16 | #endif 17 | #else 18 | #define EXPORT_API 19 | #endif 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | // 除非特定的视频数据, 统一使用以下函数来demux, 实际上就是使用ffmpeg来实现demux. 26 | EXPORT_API int generic_init_demux(struct demux_context *demux_ctx); 27 | EXPORT_API int generic_read_packet(struct demux_context *demux_ctx, AVPacket *pkt); 28 | EXPORT_API int generic_packet_seek(struct demux_context *demux_ctx, int64_t timestamp); 29 | EXPORT_API int generic_read_pause(struct demux_context *demux_ctx); 30 | EXPORT_API int generic_read_play(struct demux_context *demux_ctx); 31 | EXPORT_API int generic_stream_index(struct demux_context *demux_ctx, enum AVMediaType type); 32 | EXPORT_API enum AVCodecID generic_query_avcodec_id(struct demux_context *demux_ctx, int index); 33 | EXPORT_API void generic_destory(struct demux_context *demux_ctx); 34 | 35 | // 优酷视频demux, 由于youku视频是分段的flv, 所以必须处理各段的数据, 以保证看起来像是同一个文件. 36 | EXPORT_API int youku_init_demux(struct demux_context *demux_ctx); 37 | EXPORT_API int youku_read_packet(struct demux_context *demux_ctx, AVPacket *pkt); 38 | EXPORT_API int youku_packet_seek(struct demux_context *demux_ctx, int64_t timestamp); 39 | EXPORT_API int youku_read_pause(struct demux_context *demux_ctx); 40 | EXPORT_API int youku_read_play(struct demux_context *demux_ctx); 41 | EXPORT_API int youku_stream_index(struct demux_context *demux_ctx, enum AVMediaType type); 42 | EXPORT_API enum AVCodecID youku_query_avcodec_id(struct demux_context *demux_ctx, int index); 43 | EXPORT_API void youku_destory(struct demux_context *demux_ctx); 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | 50 | #endif // __DEMUX_H__ 51 | -------------------------------------------------------------------------------- /demux/demux.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/demux/demux.vcproj -------------------------------------------------------------------------------- /demux/demux.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 6 | h;hpp;hxx;hm;inl;inc;xsd 7 | 8 | 9 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 10 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 11 | 12 | 13 | 14 | 15 | source 16 | 17 | 18 | source 19 | 20 | 21 | source 22 | 23 | 24 | 25 | 26 | include 27 | 28 | 29 | include 30 | 31 | 32 | include 33 | 34 | 35 | include 36 | 37 | 38 | include 39 | 40 | 41 | -------------------------------------------------------------------------------- /demux/demuxer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/demux/demuxer.h -------------------------------------------------------------------------------- /demux/internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // internal.h 3 | // ~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2011 Jack (jack.wgm@gmail.com) 6 | // 7 | 8 | #ifndef __INTERNAL_H__ 9 | #define __INTERNAL_H__ 10 | 11 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 12 | # pragma once 13 | #endif 14 | 15 | #ifdef _MSC_VER 16 | # pragma warning(push) 17 | # pragma warning(disable : 4244) 18 | #endif // _MS_VER 19 | 20 | // 内部使用的头文件. 21 | extern "C" 22 | { 23 | #include 24 | #include 25 | #include 26 | } 27 | 28 | #include 29 | #include 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | namespace fs = boost::filesystem; 37 | 38 | #ifdef _MSC_VER 39 | # pragma warning(pop) 40 | #endif // _MS_VER 41 | 42 | #endif // __INTERNAL_H__ 43 | -------------------------------------------------------------------------------- /libav/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_library(av STATIC avplay.c) 3 | 4 | 5 | target_link_libraries(av -lavcodec -lavformat -lswscale -lswresample) -------------------------------------------------------------------------------- /libav/ffmpeg.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * globals.h 4 | * ~~~~~~~~~ 5 | * 6 | * Copyright (c) 2013 Jack (jack.wgm@gmail.com) 7 | */ 8 | 9 | #ifndef __FFMPEG_H__ 10 | #define __FFMPEG_H__ 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | 28 | #endif // __FFMPEG_H__ 29 | -------------------------------------------------------------------------------- /libav/libav.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libav/libav.vcproj -------------------------------------------------------------------------------- /libav/libav.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | include 6 | 7 | 8 | include 9 | 10 | 11 | 12 | 13 | {2cbd1fd8-62c6-4084-b24c-98e91e142d4e} 14 | 15 | 16 | {dd1d3195-d98d-4834-9739-f6e163cb471e} 17 | 18 | 19 | 20 | 21 | source 22 | 23 | 24 | -------------------------------------------------------------------------------- /libtorrent/AUTHORS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/AUTHORS -------------------------------------------------------------------------------- /libtorrent/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2003 - 2007, Arvid Norberg 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions 6 | are met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the distribution. 13 | * Neither the name of Rasterbar Software nor the names of its 14 | contributors may be used to endorse or promote products derived 15 | from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | POSSIBILITY OF SUCH DAMAGE. 28 | 29 | -------------------------------------------------------------------------------- /libtorrent/Jamroot.jam: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/Jamroot.jam -------------------------------------------------------------------------------- /libtorrent/NEWS: -------------------------------------------------------------------------------- 1 | 2 | initial release of libtorrent 0.9 3 | 4 | -------------------------------------------------------------------------------- /libtorrent/README: -------------------------------------------------------------------------------- 1 | libtorrent is a C++ library that aims to be a good alternative to all the 2 | other bittorrent implementations around. It is a 3 | library and not a full featured client, although it comes with a working 4 | example client. 5 | 6 | The main goals of libtorrent are: 7 | 8 | * to be cpu efficient 9 | * to be memory efficient 10 | * to be very easy to use 11 | 12 | See docs/manual.html for more detailed build and usage instructions. 13 | 14 | To build with autotools, run: 15 | 16 | ./configure 17 | 18 | Followed by 19 | 20 | make 21 | 22 | When libtorrent is built, finish off by running the tests: 23 | 24 | make check 25 | 26 | -------------------------------------------------------------------------------- /libtorrent/bindings/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = python 3 | 4 | EXTRA_DIST = README.txt 5 | -------------------------------------------------------------------------------- /libtorrent/bindings/README.txt: -------------------------------------------------------------------------------- 1 | Documentation covering building and using the python binding for libtorrent 2 | is located in the main doc directory. See docs/python_binding.html 3 | 4 | -------------------------------------------------------------------------------- /libtorrent/bindings/c/Jamfile: -------------------------------------------------------------------------------- 1 | use-project /torrent : ../.. ; 2 | 3 | rule libtorrent_linking ( properties * ) 4 | { 5 | local result ; 6 | 7 | if gcc in $(properties) && shared in $(properties) 8 | { 9 | result += on ; 10 | } 11 | 12 | # if gcc in $(properties) || darwin in $(properties) 13 | # { 14 | # result += hidden ; 15 | # } 16 | 17 | return $(result) ; 18 | } 19 | 20 | lib torrentc 21 | 22 | : # sources 23 | library.cpp 24 | 25 | : # requirements 26 | @libtorrent_linking 27 | /torrent//torrent/static 28 | . 29 | 30 | : # default build 31 | static 32 | 33 | : # usage-requirements 34 | . 35 | ; 36 | 37 | exe simple_client : simple_client.c torrentc ; 38 | 39 | -------------------------------------------------------------------------------- /libtorrent/bindings/python/Jamfile: -------------------------------------------------------------------------------- 1 | import python ; 2 | 3 | use-project /torrent : ../.. ; 4 | 5 | lib boost_python : : darwin boost_python-mt $(boost-library-search-path) ; 6 | lib boost_python : : boost_python ; 7 | 8 | rule libtorrent_linking ( properties * ) 9 | { 10 | local result ; 11 | 12 | if gcc in $(properties) 13 | { 14 | result += on ; 15 | } 16 | 17 | if gcc in $(properties) 18 | || darwin in $(properties) 19 | || clang in $(properties) 20 | { 21 | result += -fvisibility=hidden ; 22 | } 23 | 24 | if source in $(properties) 25 | { 26 | if static in $(properties) || static in $(properties) 27 | { 28 | result += /boost/python//boost_python/static ; 29 | result += /torrent//torrent/static ; 30 | } 31 | else 32 | { 33 | result += /boost/python//boost_python/shared ; 34 | result += /torrent//torrent/shared/shared ; 35 | } 36 | } 37 | else 38 | { 39 | result += boost_python ; 40 | result += /torrent//torrent/shared/shared ; 41 | } 42 | 43 | return $(result) ; 44 | } 45 | 46 | python-extension libtorrent 47 | : src/module.cpp 48 | src/big_number.cpp 49 | src/converters.cpp 50 | src/create_torrent.cpp 51 | src/fingerprint.cpp 52 | src/utility.cpp 53 | src/session.cpp 54 | src/entry.cpp 55 | src/torrent_info.cpp 56 | src/string.cpp 57 | src/torrent_handle.cpp 58 | src/torrent_status.cpp 59 | src/session_settings.cpp 60 | src/version.cpp 61 | src/alert.cpp 62 | src/datetime.cpp 63 | src/torrent.cpp 64 | src/peer_info.cpp 65 | src/ip_filter.cpp 66 | src/magnet_uri.cpp 67 | src/error_code.cpp 68 | : src 69 | @libtorrent_linking 70 | : 71 | static 72 | ; 73 | 74 | install stage_module : libtorrent : . ; 75 | 76 | -------------------------------------------------------------------------------- /libtorrent/bindings/python/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST = \ 3 | Jamfile \ 4 | setup.py \ 5 | client.py \ 6 | rss_reader.py \ 7 | simple_client.py \ 8 | make_torrent.py \ 9 | src/alert.cpp \ 10 | src/big_number.cpp \ 11 | src/converters.cpp \ 12 | src/create_torrent.cpp \ 13 | src/datetime.cpp \ 14 | src/entry.cpp \ 15 | src/error_code.cpp \ 16 | src/fingerprint.cpp \ 17 | src/gil.hpp \ 18 | src/ip_filter.cpp \ 19 | src/magnet_uri.cpp \ 20 | src/module.cpp \ 21 | src/optional.hpp \ 22 | src/peer_info.cpp \ 23 | src/session.cpp \ 24 | src/session_settings.cpp \ 25 | src/string.cpp \ 26 | src/torrent.cpp \ 27 | src/torrent_handle.cpp \ 28 | src/torrent_info.cpp \ 29 | src/torrent_status.cpp \ 30 | src/utility.cpp \ 31 | src/version.cpp 32 | 33 | if ENABLE_PYTHON_BINDING 34 | 35 | all-local: 36 | $(PYTHON) setup.py build 37 | 38 | install-exec-local: 39 | $(PYTHON) setup.py install @PYTHON_INSTALL_PARAMS@ 40 | 41 | uninstall-local: 42 | rm -rf $(DESTDIR)$(libdir)/python*/*-packages/*libtorrent* 43 | 44 | clean-local: 45 | $(PYTHON) setup.py clean --all 46 | 47 | endif 48 | -------------------------------------------------------------------------------- /libtorrent/bindings/python/make_torrent.py: -------------------------------------------------------------------------------- 1 | #!/bin/python 2 | 3 | import sys 4 | import os 5 | import libtorrent 6 | 7 | if len(sys.argv) < 3: 8 | print 'usage make_torrent.py file tracker-url' 9 | sys.exit(1) 10 | 11 | input = os.path.abspath(sys.argv[1]) 12 | 13 | fs = libtorrent.file_storage() 14 | libtorrent.add_files(fs, input) 15 | if fs.num_files() == 0: 16 | print 'no files added' 17 | sys.exit(1) 18 | 19 | t = libtorrent.create_torrent(fs, 0, 4 * 1024 * 1024) 20 | 21 | t.add_tracker(sys.argv[2]) 22 | t.set_creator('libtorrent %s' % libtorrent.version) 23 | 24 | libtorrent.set_piece_hashes(t, os.path.split(input)[0], lambda x: sys.stderr.write('.')) 25 | sys.stderr.write('\n') 26 | 27 | print libtorrent.bencode(t.generate()) 28 | -------------------------------------------------------------------------------- /libtorrent/bindings/python/rss_reader.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import sys 4 | import libtorrent as lt 5 | import time 6 | 7 | if len(sys.argv) != 2: 8 | print('usage: rss_reader.py rss-feed-url') 9 | sys.exit(1) 10 | 11 | ses = lt.session() 12 | 13 | h = ses.add_feed({'url': sys.argv[1], 'auto_download': False}) 14 | f = h.get_feed_status() 15 | spinner = ['|', '/', '-', '\\'] 16 | i = 0 17 | while f['updating']: 18 | time.sleep(0.1) 19 | i = (i + 1) % 4 20 | print('\b%s' % spinner[i]), 21 | sys.stdout.flush() 22 | f = h.get_feed_status() 23 | 24 | print('\n\nFEED: %s' % f['url']) 25 | if len(f['error']) > 0: 26 | print('ERROR: %s' % f['error']) 27 | 28 | print(' %s\n %s\n' % (f['title'], f['description'])) 29 | print(' ttl: %d minutes' % f['ttl']) 30 | 31 | for item in f['items']: 32 | print('\n%s\n------------------------------------------------------' % item['title']) 33 | print(' url: %s\n size: %d\n uuid: %s\n description: %s' % (item['url'], item['size'], item['uuid'], item['description'])) 34 | print(' comment: %s\n category: %s' % (item['comment'], item['category'])) 35 | 36 | -------------------------------------------------------------------------------- /libtorrent/bindings/python/simple_client.py: -------------------------------------------------------------------------------- 1 | #!/bin/python 2 | # Copyright Arvid Norberg 2008. Use, modification and distribution is 3 | # subject to the Boost Software License, Version 1.0. (See accompanying 4 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | 7 | import libtorrent as lt 8 | import time 9 | import sys 10 | 11 | ses = lt.session() 12 | ses.listen_on(6881, 6891) 13 | 14 | info = lt.torrent_info(sys.argv[1]) 15 | h = ses.add_torrent({'ti': info, 'save_path': './'}) 16 | print('starting', h.name()) 17 | 18 | while (not h.is_seed()): 19 | s = h.status() 20 | 21 | state_str = ['queued', 'checking', 'downloading metadata', \ 22 | 'downloading', 'finished', 'seeding', 'allocating', 'checking fastresume'] 23 | print('\r%.2f%% complete (down: %.1f kb/s up: %.1f kB/s peers: %d) %s' % \ 24 | (s.progress * 100, s.download_rate / 1000, s.upload_rate / 1000, \ 25 | s.num_peers, state_str[s.state]), end=' ') 26 | sys.stdout.flush() 27 | 28 | time.sleep(1) 29 | 30 | print(h.name(), 'complete') 31 | 32 | -------------------------------------------------------------------------------- /libtorrent/bindings/python/src/big_number.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Daniel Wallin 2006. Use, modification and distribution is 2 | // subject to the Boost Software License, Version 1.0. (See accompanying 3 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | 5 | #include 6 | #include 7 | 8 | void bind_big_number() 9 | { 10 | using namespace boost::python; 11 | using namespace libtorrent; 12 | 13 | class_("big_number") 14 | .def(self == self) 15 | .def(self != self) 16 | .def(self < self) 17 | .def(self_ns::str(self)) 18 | .def(init()) 19 | .def("clear", &big_number::clear) 20 | .def("is_all_zeros", &big_number::is_all_zeros) 21 | .def("to_string", &big_number::to_string) 22 | // .def("__getitem__", &big_number::opreator[]) 23 | ; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /libtorrent/bindings/python/src/converters.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Andrew Resch 2009. Use, modification and distribution is 2 | // subject to the Boost Software License, Version 1.0. (See accompanying 3 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | 5 | #include 6 | 7 | using namespace boost::python; 8 | 9 | template 10 | struct pair_to_tuple 11 | { 12 | static PyObject* convert(const std::pair& p) 13 | { 14 | return incref(make_tuple(p.first, p.second).ptr()); 15 | } 16 | }; 17 | 18 | template 19 | struct tuple_to_pair 20 | { 21 | tuple_to_pair() 22 | { 23 | converter::registry::push_back( 24 | &convertible, &construct, type_id >() 25 | ); 26 | } 27 | 28 | static void* convertible(PyObject* x) 29 | { 30 | return PyTuple_Check(x) ? x: 0; 31 | } 32 | 33 | static void construct(PyObject* x, converter::rvalue_from_python_stage1_data* data) 34 | { 35 | void* storage = ((converter::rvalue_from_python_storage< 36 | std::pair >*)data)->storage.bytes; 37 | 38 | object o(borrowed(x)); 39 | std::pair p; 40 | p.first = extract(o[0]); 41 | p.second = extract(o[1]); 42 | new (storage) std::pair(p); 43 | data->convertible = storage; 44 | } 45 | }; 46 | 47 | void bind_converters() 48 | { 49 | to_python_converter, pair_to_tuple >(); 50 | tuple_to_pair(); 51 | } 52 | -------------------------------------------------------------------------------- /libtorrent/bindings/python/src/error_code.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2011, Arvid Norberg 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the distribution. 15 | * Neither the name of the author nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #include 34 | #include 35 | 36 | using namespace boost::python; 37 | using namespace libtorrent; 38 | 39 | void bind_error_code() 40 | { 41 | class_("error_code") 42 | .def(init<>()) 43 | .def("message", &error_code::message) 44 | .def("value", &error_code::value) 45 | .def("clear", &error_code::clear) 46 | ; 47 | } 48 | 49 | -------------------------------------------------------------------------------- /libtorrent/bindings/python/src/fingerprint.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Daniel Wallin 2006. Use, modification and distribution is 2 | // subject to the Boost Software License, Version 1.0. (See accompanying 3 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | 5 | #include 6 | #include 7 | 8 | void bind_fingerprint() 9 | { 10 | using namespace boost::python; 11 | using namespace libtorrent; 12 | 13 | class_("fingerprint", no_init) 14 | .def( 15 | init( 16 | (arg("id"), "major", "minor", "revision", "tag") 17 | ) 18 | ) 19 | .def("__str__", &fingerprint::to_string) 20 | .def_readonly("name", &fingerprint::name) 21 | .def_readonly("major_version", &fingerprint::major_version) 22 | .def_readonly("minor_version", &fingerprint::minor_version) 23 | .def_readonly("revision_version", &fingerprint::revision_version) 24 | .def_readonly("tag_version", &fingerprint::tag_version) 25 | ; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /libtorrent/bindings/python/src/ip_filter.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Andrew Resch 2008. Use, modification and distribution is 2 | // subject to the Boost Software License, Version 1.0. (See accompanying 3 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | 5 | #include 6 | #include 7 | #include "gil.hpp" 8 | 9 | using namespace boost::python; 10 | using namespace libtorrent; 11 | 12 | namespace 13 | { 14 | void add_rule(ip_filter& filter, std::string start, std::string end, int flags) 15 | { 16 | return filter.add_rule(address::from_string(start), address::from_string(end), flags); 17 | } 18 | 19 | int access0(ip_filter& filter, std::string addr) 20 | { 21 | return filter.access(address::from_string(addr)); 22 | } 23 | } 24 | 25 | void bind_ip_filter() 26 | { 27 | class_("ip_filter") 28 | .def("add_rule", add_rule) 29 | .def("access", access0) 30 | .def("export_filter", allow_threads(&ip_filter::export_filter)) 31 | ; 32 | } 33 | -------------------------------------------------------------------------------- /libtorrent/bindings/python/src/module.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Daniel Wallin 2006. Use, modification and distribution is 2 | // subject to the Boost Software License, Version 1.0. (See accompanying 3 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | 5 | #ifdef __GNUC__ 6 | #define BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY 1 7 | #endif 8 | 9 | #include "libtorrent/config.hpp" 10 | #include 11 | 12 | void bind_utility(); 13 | void bind_fingerprint(); 14 | void bind_big_number(); 15 | void bind_session(); 16 | void bind_entry(); 17 | void bind_torrent_info(); 18 | void bind_unicode_string_conversion(); 19 | void bind_torrent_handle(); 20 | void bind_torrent_status(); 21 | void bind_session_settings(); 22 | void bind_version(); 23 | void bind_alert(); 24 | void bind_datetime(); 25 | void bind_torrent(); 26 | void bind_peer_info(); 27 | void bind_ip_filter(); 28 | void bind_magnet_uri(); 29 | void bind_converters(); 30 | void bind_create_torrent(); 31 | void bind_error_code(); 32 | 33 | BOOST_PYTHON_MODULE(libtorrent) 34 | { 35 | Py_Initialize(); 36 | PyEval_InitThreads(); 37 | 38 | bind_error_code(); 39 | bind_utility(); 40 | bind_fingerprint(); 41 | bind_big_number(); 42 | bind_entry(); 43 | bind_session(); 44 | bind_torrent_info(); 45 | #if TORRENT_USE_WSTRING 46 | bind_unicode_string_conversion(); 47 | #endif 48 | bind_torrent_handle(); 49 | bind_torrent_status(); 50 | bind_session_settings(); 51 | bind_version(); 52 | bind_alert(); 53 | bind_datetime(); 54 | bind_torrent(); 55 | bind_peer_info(); 56 | bind_ip_filter(); 57 | bind_magnet_uri(); 58 | bind_converters(); 59 | bind_create_torrent(); 60 | } 61 | -------------------------------------------------------------------------------- /libtorrent/bindings/python/src/optional.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Daniel Wallin 2007. Use, modification and distribution is 2 | // subject to the Boost Software License, Version 1.0. (See accompanying 3 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | 5 | #ifndef OPTIONAL_070108_HPP 6 | # define OPTIONAL_070108_HPP 7 | 8 | # include 9 | # include 10 | 11 | template 12 | struct optional_to_python 13 | { 14 | optional_to_python() 15 | { 16 | boost::python::to_python_converter< 17 | boost::optional, optional_to_python 18 | >(); 19 | } 20 | 21 | static PyObject* convert(boost::optional const& x) 22 | { 23 | if (!x) 24 | return boost::python::incref(Py_None); 25 | 26 | return boost::python::incref(boost::python::object(*x).ptr()); 27 | } 28 | }; 29 | 30 | #endif // OPTIONAL_070108_HPP 31 | 32 | -------------------------------------------------------------------------------- /libtorrent/bindings/python/src/torrent.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Daniel Wallin 2007. Use, modification and distribution is 2 | // subject to the Boost Software License, Version 1.0. (See accompanying 3 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | 5 | #include 6 | #include 7 | 8 | using namespace boost::python; 9 | using namespace libtorrent; 10 | 11 | void bind_torrent() 12 | { 13 | class_("torrent", no_init); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /libtorrent/bindings/python/src/utility.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Daniel Wallin 2006. Use, modification and distribution is 2 | // subject to the Boost Software License, Version 1.0. (See accompanying 3 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | using namespace boost::python; 10 | using namespace libtorrent; 11 | 12 | object client_fingerprint_(peer_id const& id) 13 | { 14 | boost::optional result = client_fingerprint(id); 15 | return result ? object(*result) : object(); 16 | } 17 | 18 | entry bdecode_(std::string const& data) 19 | { 20 | return bdecode(data.begin(), data.end()); 21 | } 22 | 23 | std::string bencode_(entry const& e) 24 | { 25 | std::string result; 26 | bencode(std::back_inserter(result), e); 27 | return result; 28 | } 29 | 30 | void bind_utility() 31 | { 32 | def("identify_client", &libtorrent::identify_client); 33 | def("client_fingerprint", &client_fingerprint_); 34 | def("bdecode", &bdecode_); 35 | def("bencode", &bencode_); 36 | } 37 | 38 | -------------------------------------------------------------------------------- /libtorrent/bindings/python/src/version.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Daniel Wallin 2006. Use, modification and distribution is 2 | // subject to the Boost Software License, Version 1.0. (See accompanying 3 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | 5 | #include 6 | #include 7 | 8 | using namespace boost::python; 9 | 10 | void bind_version() 11 | { 12 | scope().attr("version") = LIBTORRENT_VERSION; 13 | scope().attr("version_major") = LIBTORRENT_VERSION_MAJOR; 14 | scope().attr("version_minor") = LIBTORRENT_VERSION_MINOR; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /libtorrent/build_dist.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | 4 | #clear out any extended attributes that Finder may add 5 | sudo xattr -r -d com.apple.FinderInfo * 6 | 7 | rm -f config.log config.report configure 8 | rm -f m4/libtool.m4 m4/lt~obsolete.m4 m4/ltsugar.m4 m4/ltversion.m4 m4/ltoptions.m4 9 | rm -fr autom4te.cache build-aux 10 | rm -f Makefile Makefile.in 11 | rm -f src/Makefile src/Makefile.in 12 | rm -f include/libtorrent/Makefile include/libtorrent/Makefile.in 13 | rm -f examples/Makefile examples/Makefile.in examples/.dep examples/.libs 14 | rm -rf test/Makefile test/Makefile.in test/.dep test/.lib 15 | rm -rf bindings/Makefile bindings/Makefile.in bindings/.dep bindings/.libs 16 | rm -f bindings/python/Makefile bindings/python/Makefile.in 17 | chmod a-x docs/*.rst docs/*.htm* src/*.cpp include/libtorrent/*.hpp 18 | 19 | ./autotool.sh 20 | ./configure --enable-python-binding --enable-examples=yes --enable-tests=yes --with-boost-system=mt --with-boost-python=mt --enable-tests 21 | make V=1 -j8 dist check 22 | -------------------------------------------------------------------------------- /libtorrent/dht_flood.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | import socket 4 | import sys 5 | from types import StringType, IntType, LongType, DictType, ListType, TupleType 6 | import random 7 | 8 | port = int(sys.argv[1]) 9 | 10 | # from BitTorrent 4.3.0 11 | def encode_bencached(x,r): 12 | r.append(x.bencoded) 13 | 14 | def encode_int(x, r): 15 | r.extend(('i', str(x), 'e')) 16 | 17 | def encode_string(x, r): 18 | r.extend((str(len(x)), ':', x)) 19 | 20 | def encode_list(x, r): 21 | r.append('l') 22 | for i in x: 23 | encode_func[type(i)](i, r) 24 | r.append('e') 25 | 26 | def encode_dict(x,r): 27 | r.append('d') 28 | ilist = x.items() 29 | ilist.sort() 30 | for k, v in ilist: 31 | r.extend((str(len(k)), ':', k)) 32 | encode_func[type(v)](v, r) 33 | r.append('e') 34 | 35 | encode_func = {} 36 | encode_func[IntType] = encode_int 37 | encode_func[LongType] = encode_int 38 | encode_func[StringType] = encode_string 39 | encode_func[ListType] = encode_list 40 | encode_func[TupleType] = encode_list 41 | encode_func[DictType] = encode_dict 42 | 43 | def bencode(x): 44 | r = [] 45 | encode_func[type(x)](x, r) 46 | return ''.join(r) 47 | 48 | def send_dht_message(msg): 49 | s.sendto(bencode(msg), 0, ('127.0.0.1', port)) 50 | 51 | def random_key(): 52 | ret = '' 53 | for i in range(0, 20): 54 | ret += chr(random.randint(0, 255)) 55 | return ret 56 | 57 | s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) 58 | node_id = '1' * 20; 59 | query = 'get_peers' 60 | 61 | print 'test random info-hashes' 62 | for i in xrange(1, 30000): 63 | send_dht_message({'a': {'id': node_id, 'info_hash': random_key()}, 'q': query, 'y': 'q', 't': '%d' % i}) 64 | 65 | print 'test random peer-ids' 66 | for i in xrange(1, 30000): 67 | send_dht_message({'a': {'id': random_key(), 'info_hash': random_key()}, 'q': query, 'y': 'q', 't': '%d' % i}) 68 | 69 | -------------------------------------------------------------------------------- /libtorrent/docs/Linkage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/Linkage.png -------------------------------------------------------------------------------- /libtorrent/docs/arctic_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/arctic_thumb.png -------------------------------------------------------------------------------- /libtorrent/docs/bitbuddy_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/bitbuddy_thumb.jpg -------------------------------------------------------------------------------- /libtorrent/docs/bitfox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/bitfox.png -------------------------------------------------------------------------------- /libtorrent/docs/bitrocket_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/bitrocket_thumb.png -------------------------------------------------------------------------------- /libtorrent/docs/bitscast_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/bitscast_thumb.png -------------------------------------------------------------------------------- /libtorrent/docs/bitslug_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/bitslug_thumb.png -------------------------------------------------------------------------------- /libtorrent/docs/btg_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/btg_thumb.jpg -------------------------------------------------------------------------------- /libtorrent/docs/bubba.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/bubba.png -------------------------------------------------------------------------------- /libtorrent/docs/client_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/client_test.png -------------------------------------------------------------------------------- /libtorrent/docs/contributing.rst: -------------------------------------------------------------------------------- 1 | ================= 2 | libtorrent manual 3 | ================= 4 | 5 | :Author: Arvid Norberg, arvid@rasterbar.com 6 | :Version: 1.0.0 7 | 8 | .. contents:: Table of contents 9 | :depth: 2 10 | :backlinks: none 11 | 12 | contributing to libtorrent 13 | ========================== 14 | 15 | There are several ways to contribute to libtorrent at various levels. Any help is 16 | much appreciated. If you're interested in something libtorrent related that's not 17 | enumerated on this page, please contact arvid@rasterbar.com or the `mailing list`_. 18 | 19 | .. _`mailing list`: http://lists.sourceforge.net/lists/listinfo/libtorrent-discuss 20 | 21 | 1. Testing 22 | This is not just limited to finding bugs and ways to reproduce crashes, but also 23 | sub-optimal behavior is certain scenarios and finding ways to reproduce those. Please 24 | report any issue to the bug tracker at `google code`_. 25 | 26 | New features that need testing are streaming (``set_piece_deadline()``), the different 27 | choking algorithms (especially the new BitTyrant choker), the disk cache options (such 28 | as ``explicit_cache``). 29 | 30 | .. _`google code`: http://code.google.com/p/libtorrent/issues/entry 31 | 32 | 2. Documentation 33 | Finding typos or outdated sections in the documentation. Contributing documentation 34 | based on your own experience and experimentation with the library or with BitTorrent 35 | in general. Non-reference documentation is very much welcome as well, higher level 36 | descriptions on how to configure libtorrent for various situations for instance. 37 | 38 | 3. Code 39 | Contributing code for new features or bug-fixes is highly welcome. If you're interested 40 | in adding a feature but not sure where to start, please contact the `mailing list`_ or 41 | ``#libtorrent`` @ ``irc.freenode.net``. 42 | 43 | New features might be better support for integrating with other services, new choking 44 | algorithms, seeding policies, ports to new platforms etc. 45 | 46 | For an overview of the internals of libtorrent, see the hacking_ page. 47 | 48 | For outstanding things to do, see the `todo list`_. 49 | 50 | .. _hacking: hacking.html 51 | 52 | .. _`todo list`: todo.html 53 | 54 | -------------------------------------------------------------------------------- /libtorrent/docs/cwnd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/cwnd.png -------------------------------------------------------------------------------- /libtorrent/docs/cwnd_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/cwnd_thumb.png -------------------------------------------------------------------------------- /libtorrent/docs/delays.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/delays.png -------------------------------------------------------------------------------- /libtorrent/docs/delays_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/delays_thumb.png -------------------------------------------------------------------------------- /libtorrent/docs/deluge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/deluge.png -------------------------------------------------------------------------------- /libtorrent/docs/disk_access.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/disk_access.png -------------------------------------------------------------------------------- /libtorrent/docs/disk_access_elevator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/disk_access_elevator.png -------------------------------------------------------------------------------- /libtorrent/docs/disk_access_no_elevator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/disk_access_no_elevator.png -------------------------------------------------------------------------------- /libtorrent/docs/disk_buffer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/disk_buffer.png -------------------------------------------------------------------------------- /libtorrent/docs/disk_buffer_before_optimization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/disk_buffer_before_optimization.png -------------------------------------------------------------------------------- /libtorrent/docs/disk_buffer_sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/disk_buffer_sample.png -------------------------------------------------------------------------------- /libtorrent/docs/disk_io.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/disk_io.png -------------------------------------------------------------------------------- /libtorrent/docs/electric_sheep_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/electric_sheep_thumb.jpg -------------------------------------------------------------------------------- /libtorrent/docs/fatrat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/fatrat.png -------------------------------------------------------------------------------- /libtorrent/docs/fdm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/fdm.png -------------------------------------------------------------------------------- /libtorrent/docs/firetorrent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/firetorrent.png -------------------------------------------------------------------------------- /libtorrent/docs/flush.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/flush.jpg -------------------------------------------------------------------------------- /libtorrent/docs/folx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/folx.png -------------------------------------------------------------------------------- /libtorrent/docs/halite_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/halite_thumb.png -------------------------------------------------------------------------------- /libtorrent/docs/im_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/im_thumb.jpg -------------------------------------------------------------------------------- /libtorrent/docs/ip_id_v4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/ip_id_v4.png -------------------------------------------------------------------------------- /libtorrent/docs/ip_id_v6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/ip_id_v6.png -------------------------------------------------------------------------------- /libtorrent/docs/ips.py: -------------------------------------------------------------------------------- 1 | #/bin/python 2 | 3 | import os 4 | import sys 5 | 6 | def num_ids(bits, total_bits): 7 | 8 | if total_bits == 32: 9 | bit_dec = 2 10 | else: 11 | bit_dec = 1 12 | 13 | num_used = 7; 14 | ret = 3 15 | 16 | while bits > 0: 17 | ret += min(num_used, bits) 18 | num_used -= bit_dec 19 | if num_used < 0: num_used = 0 20 | bits -= 8 21 | 22 | return 1 << ret 23 | 24 | f = open('ip_id_v4.dat', 'w+') 25 | for i in range(0, 33): 26 | print >>f, '%d\t%d\t%d' % (i, num_ids(i, 32), 1 << i) 27 | f.close() 28 | 29 | f = open('ip_id_v6.dat', 'w+') 30 | for i in range(0, 65): 31 | print >>f, '%d\t%d\t%d' % (i, num_ids(i, 64), 1 << i) 32 | f.close() 33 | 34 | f = open('ip_id.gnuplot', 'w+') 35 | 36 | f.write(''' 37 | set term png size 600,300 38 | set output "ip_id_v4.png" 39 | set logscale y 40 | set title "Number of possible node IDs" 41 | set ylabel "possible node IDs" 42 | set xlabel "bits controlled in IPv4" 43 | set xtics 4 44 | set grid 45 | plot "ip_id_v4.dat" using 1:2 title "octet-wise modulus" with lines, \ 46 | "ip_id_v4.dat" using 1:3 title "hash of IP" with lines 47 | 48 | set output "ip_id_v6.png" 49 | set title "Number of possible node IDs" 50 | set xlabel "bits controlled in IPv6" 51 | plot "ip_id_v6.dat" using 1:2 title "octet-wise modulus" with lines, \ 52 | "ip_id_v6.dat" using 1:3 title "hash of IP" with lines 53 | ''') 54 | f.close() 55 | os.system('gnuplot ip_id.gnuplot') 56 | 57 | -------------------------------------------------------------------------------- /libtorrent/docs/leechcraft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/leechcraft.png -------------------------------------------------------------------------------- /libtorrent/docs/libtorrent_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/libtorrent_screen.png -------------------------------------------------------------------------------- /libtorrent/docs/limewire.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/limewire.png -------------------------------------------------------------------------------- /libtorrent/docs/lince.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/lince.png -------------------------------------------------------------------------------- /libtorrent/docs/make_thumb.sh: -------------------------------------------------------------------------------- 1 | convert $1 -resize 150x130 $1 2 | 3 | -------------------------------------------------------------------------------- /libtorrent/docs/makefile: -------------------------------------------------------------------------------- 1 | # this makefile assumes that you have docutils and rst2pdf installed 2 | 3 | WEB_PATH = ~/Documents/rasterbar/web/products/libtorrent 4 | 5 | TARGETS = index \ 6 | udp_tracker_protocol \ 7 | dht_rss \ 8 | dht_store \ 9 | client_test \ 10 | manual \ 11 | building \ 12 | features \ 13 | contributing\ 14 | examples \ 15 | extension_protocol \ 16 | make_torrent \ 17 | dht_extensions \ 18 | dht_sec \ 19 | libtorrent_plugins \ 20 | python_binding \ 21 | projects \ 22 | running_tests \ 23 | utp \ 24 | tuning \ 25 | hacking 26 | 27 | FIGURES = read_disk_buffers write_disk_buffers troubleshooting 28 | 29 | html: $(TARGETS:=.html) $(FIGURES:=.png) 30 | 31 | pdf: $(TARGETS:=.pdf) $(FIGURES:=.eps) 32 | 33 | epub: $(TARGETS:=.epub) $(FIGURES:=.png) 34 | 35 | all: html 36 | 37 | %.epub:%.rst 38 | rst2epub $? $@ 39 | 40 | %.pdf:%.rst 41 | rst2pdf $? -o $@ --stylesheets stylesheet 42 | 43 | %.html:%.rst 44 | rst2html-2.6.py --template=template.txt --stylesheet-path=style.css --link-stylesheet --no-toc-backlinks $? > $@ 45 | cp $@ $(WEB_PATH)/$@ 46 | 47 | %.png:%.dot 48 | dot -Tpng $? >$@ 49 | cp $@ $(WEB_PATH)/$@ 50 | 51 | %.eps:%.dot 52 | dot -Teps $? >$@ 53 | cp $@ $(WEB_PATH)/$@ 54 | 55 | clean: 56 | rm -f $(TARGETS:=.html) $(TARGETS:=.pdf) 57 | 58 | -------------------------------------------------------------------------------- /libtorrent/docs/merkle_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/merkle_tree.png -------------------------------------------------------------------------------- /libtorrent/docs/miro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/miro.jpg -------------------------------------------------------------------------------- /libtorrent/docs/moopolice_thumb.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/moopolice_thumb.gif -------------------------------------------------------------------------------- /libtorrent/docs/our_delay_base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/our_delay_base.png -------------------------------------------------------------------------------- /libtorrent/docs/our_delay_base_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/our_delay_base_thumb.png -------------------------------------------------------------------------------- /libtorrent/docs/pump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/pump.png -------------------------------------------------------------------------------- /libtorrent/docs/qbittorrent_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/qbittorrent_thumb.jpg -------------------------------------------------------------------------------- /libtorrent/docs/read_disk_buffers.dot: -------------------------------------------------------------------------------- 1 | digraph uploading { 2 | 3 | node [shape=box]; 4 | 5 | subgraph user_space { 6 | rank=same; 7 | "disk cache" -> "send buffer" [label="copy into peer's send buffer (copy)"] 8 | "send buffer" -> "encrypted send buffer" [label="encrypt in-place (no copy)" style=dashed]; 9 | } 10 | 11 | subgraph kernel { 12 | rank=same; 13 | "kernel page cache"; 14 | "socket kernel buffer" 15 | } 16 | 17 | "encrypted send buffer" -> "socket kernel buffer" [label="write() to socket (copy)"]; 18 | "kernel page cache" -> "disk cache" [label="read() from file (copy)"] 19 | } 20 | 21 | -------------------------------------------------------------------------------- /libtorrent/docs/read_disk_buffers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/read_disk_buffers.png -------------------------------------------------------------------------------- /libtorrent/docs/session_stats_peers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/session_stats_peers.png -------------------------------------------------------------------------------- /libtorrent/docs/storage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/storage.png -------------------------------------------------------------------------------- /libtorrent/docs/t2e.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/t2e.jpg -------------------------------------------------------------------------------- /libtorrent/docs/template.txt: -------------------------------------------------------------------------------- 1 | %(head_prefix)s 2 | %(head)s 3 | 4 | 5 | 16 | %(stylesheet)s 17 | 22 | %(body_prefix)s 23 |
24 |
25 | 30 |
31 | 35 |
36 | %(body_pre_docinfo)s 37 | %(docinfo)s 38 | %(body)s 39 |
40 | 43 |
44 | 46 | 50 | %(body_suffix)s 51 | -------------------------------------------------------------------------------- /libtorrent/docs/tonidoplug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/tonidoplug.png -------------------------------------------------------------------------------- /libtorrent/docs/troubleshooting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/troubleshooting.png -------------------------------------------------------------------------------- /libtorrent/docs/tvblob.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/tvblob.jpg -------------------------------------------------------------------------------- /libtorrent/docs/tvitty.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/tvitty.jpg -------------------------------------------------------------------------------- /libtorrent/docs/udp_tracker_protocol.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/udp_tracker_protocol.html -------------------------------------------------------------------------------- /libtorrent/docs/unicode_support.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/unicode_support.png -------------------------------------------------------------------------------- /libtorrent/docs/write_disk_buffers.dot: -------------------------------------------------------------------------------- 1 | digraph downloading { 2 | label="" 3 | node [shape=box]; 4 | 5 | subgraph user_space { 6 | rank=same; 7 | "receive buffer" -> "plain text buffer" [label="decrypt in-place (no copy)" style=dashed]; 8 | "plain text buffer" -> "disk cache" [label="move buffer reference (no copy)" style=dashed] 9 | } 10 | 11 | subgraph kernel { 12 | rank=same; 13 | "socket kernel buffer"; 14 | "kernel page cache" 15 | } 16 | 17 | "socket kernel buffer" -> "receive buffer" [label="read() on socket (copy)"]; 18 | "disk cache" -> "kernel page cache" [label="write() to file (copy)"] 19 | } 20 | 21 | -------------------------------------------------------------------------------- /libtorrent/docs/write_disk_buffers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/write_disk_buffers.png -------------------------------------------------------------------------------- /libtorrent/docs/ziptorrent_thumb.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/ziptorrent_thumb.gif -------------------------------------------------------------------------------- /libtorrent/docs/zyxel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libtorrent/docs/zyxel.png -------------------------------------------------------------------------------- /libtorrent/examples/Jamfile: -------------------------------------------------------------------------------- 1 | import modules ; 2 | 3 | BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ; 4 | 5 | use-project /torrent : .. ; 6 | 7 | if $(BOOST_ROOT) 8 | { 9 | use-project /boost : $(BOOST_ROOT) ; 10 | } 11 | 12 | project client_test 13 | : requirements 14 | multi /torrent//torrent 15 | : default-build 16 | static 17 | ; 18 | 19 | exe client_test : client_test.cpp ; 20 | 21 | exe simple_client : simple_client.cpp ; 22 | exe dump_torrent : dump_torrent.cpp ; 23 | exe make_torrent : make_torrent.cpp ; 24 | exe enum_if : enum_if.cpp ; 25 | exe connection_tester : connection_tester.cpp ; 26 | exe fragmentation_test : fragmentation_test.cpp ; 27 | exe rss_reader : rss_reader.cpp ; 28 | exe upnp_test : upnp_test.cpp ; 29 | 30 | exe parse_request_log : parse_request_log.cpp ; 31 | 32 | -------------------------------------------------------------------------------- /libtorrent/examples/Makefile.am: -------------------------------------------------------------------------------- 1 | example_programs = \ 2 | client_test \ 3 | dump_torrent \ 4 | enum_if \ 5 | fragmentation_test\ 6 | make_torrent \ 7 | simple_client \ 8 | rss_reader \ 9 | parse_request_log \ 10 | upnp_test \ 11 | utp_test \ 12 | connection_tester 13 | 14 | if ENABLE_EXAMPLES 15 | bin_PROGRAMS = $(example_programs) 16 | endif 17 | 18 | EXTRA_PROGRAMS = $(example_programs) 19 | EXTRA_DIST = Jamfile 20 | 21 | client_test_SOURCES = client_test.cpp 22 | #client_test_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la 23 | 24 | dump_torrent_SOURCES = dump_torrent.cpp 25 | #dump_torrent_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la 26 | 27 | make_torrent_SOURCES = make_torrent.cpp 28 | #make_torrent_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la 29 | 30 | simple_client_SOURCES = simple_client.cpp 31 | #simple_client_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la 32 | 33 | enum_if_SOURCES = enum_if.cpp 34 | #enum_if_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la 35 | 36 | connection_tester_SOURCES = connection_tester.cpp 37 | #connection_tester_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la 38 | 39 | rss_reader_SOURCES = rss_reader.cpp 40 | #rss_reader_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la 41 | 42 | utp_test_SOURCES = rss_reader.cpp 43 | #utp_test_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la 44 | 45 | parse_request_log_SOURCES = parse_request_log.cpp 46 | #parse_request_log_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la 47 | 48 | fragmentation_test_SOURCES = fragmentation_test.cpp 49 | #fragmentation_test_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la 50 | 51 | upnp_test_SOURCES = upnp_test.cpp 52 | #upnp_test_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la 53 | 54 | LDADD = $(top_builddir)/src/libtorrent-rasterbar.la 55 | 56 | AM_CPPFLAGS = -ftemplate-depth-50 -I$(top_srcdir)/include @DEBUGFLAGS@ 57 | 58 | AM_LDFLAGS = @BOOST_SYSTEM_LIB@ 59 | #AM_LDFLAGS = $(LDFLAGS) @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @OPENSSL_LDFLAGS@ @OPENSSL_LIBS@ 60 | #AM_LDFLAGS = @OPENSSL_LDFLAGS@ 61 | -------------------------------------------------------------------------------- /libtorrent/include/libtorrent/alert_dispatcher.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2012, Arvid Norberg 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the distribution. 15 | * Neither the name of the author nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef TORRENT_ALERT_DISPATCHER_HPP_INCLUDED 34 | #define TORRENT_ALERT_DISPATCHER_HPP_INCLUDED 35 | 36 | namespace libtorrent 37 | { 38 | class alert; 39 | 40 | struct alert_dispatcher 41 | { 42 | // return true if the alert was swallowed (i.e. 43 | // ownership was taken over). In this case, the 44 | // alert will not be passed on to any one else 45 | virtual bool post_alert(alert* a) = 0; 46 | }; 47 | } 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /libtorrent/include/libtorrent/alloca.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2008-2012, Arvid Norberg 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the distribution. 15 | * Neither the name of the author nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef TORRENT_ALLOCA 34 | 35 | #include "libtorrent/config.hpp" 36 | 37 | #if defined TORRENT_WINDOWS || defined TORRENT_MINGW 38 | 39 | #include 40 | #define TORRENT_ALLOCA(t, n) static_cast(_alloca(sizeof(t) * (n))) 41 | 42 | #elif defined TORRENT_BSD 43 | 44 | #include 45 | #define TORRENT_ALLOCA(t, n) static_cast(alloca(sizeof(t) * (n))) 46 | 47 | #else 48 | 49 | #include 50 | #define TORRENT_ALLOCA(t, n) static_cast(alloca(sizeof(t) * (n))) 51 | 52 | #endif 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /libtorrent/include/libtorrent/bandwidth_socket.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2009-2012, Arvid Norberg 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the distribution. 15 | * Neither the name of the author nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | 34 | #ifndef TORRENT_BANDWIDTH_SOCKET_HPP_INCLUDED 35 | #define TORRENT_BANDWIDTH_SOCKET_HPP_INCLUDED 36 | 37 | #include "libtorrent/intrusive_ptr_base.hpp" 38 | 39 | namespace libtorrent 40 | { 41 | struct bandwidth_socket 42 | : public intrusive_ptr_base 43 | { 44 | virtual void assign_bandwidth(int channel, int amount) = 0; 45 | virtual bool is_disconnecting() const = 0; 46 | virtual ~bandwidth_socket() {} 47 | }; 48 | } 49 | 50 | #endif // TORRENT_BANDWIDTH_SOCKET_HPP_INCLUDED 51 | 52 | -------------------------------------------------------------------------------- /libtorrent/include/libtorrent/extensions/logger.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2006, Arvid Norberg 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the distribution. 15 | * Neither the name of the author nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef TORRENT_LOGGER_HPP_INCLUDED 34 | #define TORRENT_LOGGER_HPP_INCLUDED 35 | 36 | #ifdef _MSC_VER 37 | #pragma warning(push, 1) 38 | #endif 39 | 40 | #include 41 | 42 | #ifdef _MSC_VER 43 | #pragma warning(pop) 44 | #endif 45 | 46 | #include "libtorrent/config.hpp" 47 | 48 | #if TORRENT_USE_IOSTREAM 49 | 50 | namespace libtorrent 51 | { 52 | struct torrent_plugin; 53 | class torrent; 54 | boost::shared_ptr create_logger_plugin(torrent*); 55 | } 56 | 57 | #endif 58 | 59 | #endif // TORRENT_LOGGER_HPP_INCLUDED 60 | 61 | -------------------------------------------------------------------------------- /libtorrent/include/libtorrent/extensions/lt_trackers.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2008, Arvid Norberg 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the distribution. 15 | * Neither the name of the author nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef TORRENT_LT_TRACKERS_HPP_INCLUDED 34 | #define TORRENT_LT_TRACKERS_HPP_INCLUDED 35 | 36 | #ifdef _MSC_VER 37 | #pragma warning(push, 1) 38 | #endif 39 | 40 | #include 41 | #include "libtorrent/config.hpp" 42 | 43 | #ifdef _MSC_VER 44 | #pragma warning(pop) 45 | #endif 46 | 47 | namespace libtorrent 48 | { 49 | struct torrent_plugin; 50 | class torrent; 51 | boost::shared_ptr TORRENT_EXPORT create_lt_trackers_plugin(torrent*, void*); 52 | } 53 | 54 | #endif // TORRENT_LT_TRACKERS_HPP_INCLUDED 55 | 56 | -------------------------------------------------------------------------------- /libtorrent/include/libtorrent/extensions/smart_ban.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2007, Arvid Norberg 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the distribution. 15 | * Neither the name of the author nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef TORRENT_SMART_BAN_HPP_INCLUDED 34 | #define TORRENT_SMART_BAN_HPP_INCLUDED 35 | 36 | #ifdef _MSC_VER 37 | #pragma warning(push, 1) 38 | #endif 39 | 40 | #include 41 | #include "libtorrent/config.hpp" 42 | 43 | #ifdef _MSC_VER 44 | #pragma warning(pop) 45 | #endif 46 | 47 | namespace libtorrent 48 | { 49 | struct torrent_plugin; 50 | class torrent; 51 | TORRENT_EXPORT boost::shared_ptr create_smart_ban_plugin(torrent*, void*); 52 | } 53 | 54 | #endif // TORRENT_SMART_BAN_HPP_INCLUDED 55 | 56 | -------------------------------------------------------------------------------- /libtorrent/include/libtorrent/extensions/ut_metadata.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2007, Arvid Norberg 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the distribution. 15 | * Neither the name of the author nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef TORRENT_UT_METADATA_HPP_INCLUDED 34 | #define TORRENT_UT_METADATA_HPP_INCLUDED 35 | 36 | #ifdef _MSC_VER 37 | #pragma warning(push, 1) 38 | #endif 39 | 40 | #include 41 | #include "libtorrent/config.hpp" 42 | 43 | #ifdef _MSC_VER 44 | #pragma warning(pop) 45 | #endif 46 | 47 | namespace libtorrent 48 | { 49 | struct torrent_plugin; 50 | class torrent; 51 | TORRENT_EXPORT boost::shared_ptr create_ut_metadata_plugin(torrent*, void*); 52 | } 53 | 54 | #endif // TORRENT_UT_METADATA_HPP_INCLUDED 55 | 56 | -------------------------------------------------------------------------------- /libtorrent/include/libtorrent/extensions/ut_pex.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2006, MassaRoddel 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the distribution. 15 | * Neither the name of the author nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef TORRENT_UT_PEX_EXTENSION_HPP_INCLUDED 34 | #define TORRENT_UT_PEX_EXTENSION_HPP_INCLUDED 35 | 36 | #ifdef _MSC_VER 37 | #pragma warning(push, 1) 38 | #endif 39 | 40 | #include 41 | #include "libtorrent/config.hpp" 42 | 43 | #ifdef _MSC_VER 44 | #pragma warning(pop) 45 | #endif 46 | 47 | namespace libtorrent 48 | { 49 | struct torrent_plugin; 50 | class torrent; 51 | TORRENT_EXPORT boost::shared_ptr create_ut_pex_plugin(torrent*, void*); 52 | } 53 | 54 | #endif // TORRENT_UT_PEX_EXTENSION_HPP_INCLUDED 55 | -------------------------------------------------------------------------------- /libtorrent/include/libtorrent/gzip.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2007-2012, Arvid Norberg 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the distribution. 15 | * Neither the name of the author nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef TORRENT_GZIP_HPP_INCLUDED 34 | #define TORRENT_GZIP_HPP_INCLUDED 35 | 36 | #include "libtorrent/config.hpp" 37 | #include 38 | #include 39 | 40 | namespace libtorrent 41 | { 42 | 43 | TORRENT_EXTRA_EXPORT bool inflate_gzip( 44 | char const* in, int size 45 | , std::vector& buffer 46 | , int maximum_size 47 | , std::string& error); 48 | 49 | } 50 | 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /libtorrent/include/libtorrent/invariant_check.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Daniel Wallin 2004. Use, modification and distribution is 2 | // subject to the Boost Software License, Version 1.0. (See accompanying 3 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | 5 | #ifndef TORRENT_INVARIANT_ACCESS_HPP_INCLUDED 6 | #define TORRENT_INVARIANT_ACCESS_HPP_INCLUDED 7 | 8 | #include "libtorrent/assert.hpp" 9 | 10 | namespace libtorrent 11 | { 12 | 13 | class invariant_access 14 | { 15 | public: 16 | template 17 | static void check_invariant(T const& self) 18 | { 19 | self.check_invariant(); 20 | } 21 | }; 22 | 23 | template 24 | void check_invariant(T const& x) 25 | { 26 | invariant_access::check_invariant(x); 27 | } 28 | 29 | struct invariant_checker {}; 30 | 31 | template 32 | struct invariant_checker_impl : invariant_checker 33 | { 34 | invariant_checker_impl(T const& self_) 35 | : self(self_) 36 | { 37 | try 38 | { 39 | check_invariant(self); 40 | } 41 | catch (...) 42 | { 43 | TORRENT_ASSERT(false); 44 | } 45 | } 46 | 47 | ~invariant_checker_impl() 48 | { 49 | try 50 | { 51 | check_invariant(self); 52 | } 53 | catch (...) 54 | { 55 | TORRENT_ASSERT(false); 56 | } 57 | } 58 | 59 | T const& self; 60 | }; 61 | 62 | template 63 | invariant_checker_impl make_invariant_checker(T const& x) 64 | { 65 | return invariant_checker_impl(x); 66 | } 67 | } 68 | 69 | #if defined TORRENT_DEBUG && !defined TORRENT_DISABLE_INVARIANT_CHECKS 70 | #define INVARIANT_CHECK \ 71 | invariant_checker const& _invariant_check = make_invariant_checker(*this); \ 72 | (void)_invariant_check; \ 73 | do {} while (false) 74 | #else 75 | #define INVARIANT_CHECK do {} while (false) 76 | #endif 77 | 78 | #endif // TORRENT_INVARIANT_ACCESS_HPP_INCLUDED 79 | -------------------------------------------------------------------------------- /libtorrent/include/libtorrent/kademlia/dht_observer.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2012, Arvid Norberg 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the distribution. 15 | * Neither the name of the author nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef DHT_OBSERVER_HPP 34 | #define DHT_OBSERVER_HPP 35 | 36 | #include "libtorrent/address.hpp" 37 | 38 | namespace libtorrent { namespace dht 39 | { 40 | struct dht_observer 41 | { 42 | virtual void set_external_address(address const& addr 43 | , address const& source) = 0; 44 | }; 45 | }} 46 | 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /libtorrent/include/libtorrent/peer.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2003-2012, Arvid Norberg 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the distribution. 15 | * Neither the name of the author nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef TORRENT_PEER_HPP_INCLUDED 34 | #define TORRENT_PEER_HPP_INCLUDED 35 | 36 | #include 37 | 38 | #include "libtorrent/peer_id.hpp" 39 | 40 | namespace libtorrent 41 | { 42 | 43 | struct TORRENT_EXTRA_EXPORT peer_entry 44 | { 45 | std::string ip; 46 | int port; 47 | peer_id pid; 48 | 49 | bool operator==(const peer_entry& p) const 50 | { 51 | return pid == p.pid; 52 | } 53 | 54 | bool operator<(const peer_entry& p) const 55 | { 56 | return pid < p.pid; 57 | } 58 | }; 59 | 60 | } 61 | 62 | #endif // TORRENT_PEER_HPP_INCLUDED 63 | 64 | -------------------------------------------------------------------------------- /libtorrent/include/libtorrent/peer_request.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2006-2012, Arvid Norberg 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the distribution. 15 | * Neither the name of the author nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef TORRENT_PEER_REQUEST_HPP_INCLUDED 34 | #define TORRENT_PEER_REQUEST_HPP_INCLUDED 35 | 36 | namespace libtorrent 37 | { 38 | struct TORRENT_EXTRA_EXPORT peer_request 39 | { 40 | int piece; 41 | int start; 42 | int length; 43 | bool operator==(peer_request const& r) const 44 | { return piece == r.piece && start == r.start && length == r.length; } 45 | }; 46 | } 47 | 48 | #endif // TORRENT_PEER_REQUEST_HPP_INCLUDED 49 | 50 | -------------------------------------------------------------------------------- /libtorrent/include/libtorrent/puff.hpp: -------------------------------------------------------------------------------- 1 | /* puff.h 2 | Copyright (C) 2002, 2003 Mark Adler, all rights reserved 3 | version 1.7, 3 Mar 2002 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the author be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | Mark Adler madler@alumni.caltech.edu 22 | */ 23 | 24 | 25 | /* 26 | * See puff.c for purpose and usage. 27 | */ 28 | #include 29 | 30 | int puff(unsigned char *dest, /* pointer to destination pointer */ 31 | boost::uint32_t *destlen, /* amount of output space */ 32 | unsigned char *source, /* pointer to source data pointer */ 33 | boost::uint32_t *sourcelen); /* amount of input available */ 34 | -------------------------------------------------------------------------------- /libtorrent/include/libtorrent/random.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2011-2012, Arvid Norberg 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the distribution. 15 | * Neither the name of the author nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #include 34 | 35 | namespace libtorrent 36 | { 37 | void random_seed(boost::uint32_t v); 38 | boost::uint32_t random(); 39 | } 40 | -------------------------------------------------------------------------------- /libtorrent/include/libtorrent/size_type.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2003-2012, Arvid Norberg 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the distribution. 15 | * Neither the name of the author nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef TORRENT_SIZE_TYPE_HPP_INCLUDED 34 | #define TORRENT_SIZE_TYPE_HPP_INCLUDED 35 | 36 | #ifdef _MSC_VER 37 | #pragma warning(push, 1) 38 | #endif 39 | 40 | #include 41 | 42 | #ifdef _MSC_VER 43 | #pragma warning(pop) 44 | #endif 45 | 46 | namespace libtorrent 47 | { 48 | typedef boost::int64_t size_type; 49 | typedef boost::uint64_t unsigned_size_type; 50 | } 51 | 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /libtorrent/include/libtorrent/socket_type_fwd.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2009-2012, Arvid Norberg 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the distribution. 15 | * Neither the name of the author nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef TORRENT_SOCKET_TYPE_FWD_HPP 34 | #define TORRENT_SOCKET_TYPE_FWD_HPP 35 | 36 | namespace libtorrent 37 | { 38 | struct socket_type; 39 | } 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /libtorrent/include/libtorrent/version.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2003-2012, Arvid Norberg 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the distribution. 15 | * Neither the name of the author nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef TORRENT_VERSION_HPP_INCLUDED 34 | #define TORRENT_VERSION_HPP_INCLUDED 35 | 36 | #define LIBTORRENT_VERSION_MAJOR 1 37 | #define LIBTORRENT_VERSION_MINOR 0 38 | #define LIBTORRENT_VERSION_TINY 0 39 | 40 | // the format of this version is: MMmmtt 41 | // M = Major version, m = minor version, t = tiny version 42 | #define LIBTORRENT_VERSION_NUM ((LIBTORRENT_VERSION_MAJOR * 10000) + (LIBTORRENT_VERSION_MINOR * 100) + LIBTORRENT_VERSION_TINY) 43 | 44 | #define LIBTORRENT_VERSION "1.0.0.0" 45 | #define LIBTORRENT_REVISION "$Rev$" 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /libtorrent/libtorrent-rasterbar-cmake.pc.in: -------------------------------------------------------------------------------- 1 | Name: libtorrent-rasterbar 2 | Description: Bittorrent library. 3 | Version: @VERSION@ 4 | Libs: -L${CMAKE_INSTALL_PREFIX}/lib -ltorrent-rasterbar 5 | Cflags: -I${CMAKE_INSTALL_PREFIX}/include -I${CMAKE_INSTALL_PREFIX}/include/libtorrent @COMPILETIME_OPTIONS@ @CXX_DEFINES@ 6 | 7 | -------------------------------------------------------------------------------- /libtorrent/libtorrent-rasterbar.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | bindir=@bindir@ 4 | libdir=@libdir@ 5 | datarootdir=@datarootdir@ 6 | datadir=@datadir@ 7 | sysconfdir=@sysconfdir@ 8 | includedir=@includedir@ 9 | package=@PACKAGE@ 10 | 11 | Name: libtorrent-rasterbar 12 | Description: Bittorrent library. 13 | Version: @VERSION@ 14 | Libs: -L${libdir} -ltorrent-rasterbar 15 | Libs.private: @LIBS@ @BOOST_SYSTEM_LIB@ @PTHREAD_LIBS@ @OPENSSL_LIBS@ 16 | Cflags: -I${includedir} -I${includedir}/libtorrent @COMPILETIME_OPTIONS@ 17 | -------------------------------------------------------------------------------- /libtorrent/list_files.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # Copyright Arvid Norberg 2008. Use, modification and distribution is 3 | # subject to the Boost Software License, Version 1.0. (See accompanying 4 | # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | import os 7 | import sys 8 | 9 | def list_directory(path): 10 | tree = os.walk(path) 11 | for i in tree: 12 | dirs = i[0].split('/') 13 | if 'CVS' in dirs: continue 14 | if '.svn' in dirs: continue 15 | 16 | for file in i[2]: 17 | if file.startswith('.#'): continue 18 | if file == '.DS_Store': continue 19 | print os.path.join(i[0], file) + ' \\' 20 | 21 | list_directory(sys.argv[1]) 22 | 23 | -------------------------------------------------------------------------------- /libtorrent/parse_bandwidth_log.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | import os, sys, time 3 | 4 | keys = [['upload rate', 'x1y1', 6], ['history entries', 'x1y2', 10], ['queue', 'x1y2', 4]] 5 | 6 | out = open('bandwidth.gnuplot', 'wb') 7 | print >>out, "set term png size 1200,700" 8 | print >>out, 'set output "bandwidth_manager.png"' 9 | print >>out, 'set xrange [0:*]' 10 | print >>out, 'set xlabel "time (ms)"' 11 | print >>out, 'set ylabel "Rate (B/s)"' 12 | print >>out, 'set ytics 10000' 13 | print >>out, 'set y2label "number"' 14 | print >>out, 'set y2range [0:*]' 15 | #print >>out, "set style data lines" 16 | print >>out, "set key box" 17 | print >>out, 'plot', 18 | for k, a, c in keys: 19 | print >>out, ' "%s" using 1:%d title "%s" axes %s with steps,' % (sys.argv[1], c, k, a), 20 | print >>out, 'x=0' 21 | out.close() 22 | 23 | os.system('gnuplot bandwidth.gnuplot'); 24 | 25 | -------------------------------------------------------------------------------- /libtorrent/parse_dht_rtt.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | import sys 4 | import os 5 | 6 | quantize = 100 7 | max_rtt = 5000 8 | 9 | f = open(sys.argv[1]) 10 | distribution = {} 11 | num_messages = 0 12 | 13 | for i in range(0, max_rtt, quantize): 14 | distribution[i] = 0 15 | 16 | for line in f: 17 | time = int(line.split('\t')[1]) 18 | if (time < 0 or time > max_rtt - quantize): continue 19 | num_messages += 1 20 | time /= quantize 21 | time *= quantize 22 | distribution[time] += 1 23 | 24 | f = open('round_trip_distribution.log', 'w+') 25 | 26 | for k, v in distribution.items(): 27 | print >>f, '%f %d' % ((k + (quantize / 2)) / 1000.0, v) 28 | f.close(); 29 | 30 | f = open('round_trip_distribution.gnuplot', 'w+') 31 | 32 | f.write(''' 33 | set term png size 1200,700 34 | set title "Message round trip times" 35 | set terminal postscript 36 | set ylabel "# of requests" 37 | set xlabel "Round trip time (seconds)" 38 | set grid 39 | set style fill solid border -1 pattern 2 40 | set output "round_trip_distribution.ps" 41 | set boxwidth %f 42 | plot "round_trip_distribution.log" using 1:2 title "requests" with boxes 43 | 44 | set terminal png small 45 | set output "round_trip_distribution.png" 46 | replot 47 | ''' % (float(quantize) / 1000.0)) 48 | f.close() 49 | 50 | os.system('gnuplot round_trip_distribution.gnuplot'); 51 | 52 | -------------------------------------------------------------------------------- /libtorrent/parse_dht_stats.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | import sys 3 | import os 4 | 5 | gnuplot_scripts = [] 6 | 7 | def gen_stats_gnuplot(name, y, lines): 8 | 9 | global gnuplot_scripts 10 | 11 | stat = open(sys.argv[1]) 12 | line = stat.readline() 13 | while not 'minute:' in line: 14 | line = stat.readline() 15 | 16 | names = line.strip().split(':') 17 | counter = 1 18 | for i in names: 19 | print '%d: %s' % (counter, i) 20 | counter += 1 21 | 22 | out = open('%s.gnuplot' % name, 'w+') 23 | out.write(''' 24 | set term png size 1200,700 small 25 | set output "%s.png" 26 | set title "%s" 27 | set ylabel "%s" 28 | set xlabel "time (minutes)" 29 | plot ''' % (name, name.strip('_'), y)) 30 | first = True 31 | for i in lines: 32 | if not first: 33 | out.write(', \\\n') 34 | first = False 35 | out.write('"%s" using 1:%d title "%s" with lines' % (sys.argv[1], names.index(i)+1, i)) 36 | out.write('\n') 37 | 38 | out.write('''set terminal postscript 39 | set output "%s.ps" 40 | replot 41 | ''' % (name)) 42 | out.close() 43 | gnuplot_scripts += [name] 44 | 45 | gen_stats_gnuplot('dht_routing_table_size', 'nodes', ['active nodes','passive nodes']) 46 | gen_stats_gnuplot('dht_tracker_table_size', '', ['num torrents', 'num peers']) 47 | gen_stats_gnuplot('dht_announces', 'messages per minute', ['announces per min', 'failed announces per min']) 48 | gen_stats_gnuplot('dht_clients', 'messages per minute', ['total msgs per min', 'az msgs per min', 'ut msgs per min', 'lt msgs per min', 'mp msgs per min', 'gr msgs per min']) 49 | gen_stats_gnuplot('dht_rate', 'bytes per second', ['bytes in per sec', 'bytes out per sec']) 50 | gen_stats_gnuplot('dht_errors', 'messages per minute', ['error replies sent', 'error queries recvd']) 51 | 52 | for i in gnuplot_scripts: 53 | os.system('gnuplot %s.gnuplot' % i); 54 | -------------------------------------------------------------------------------- /libtorrent/sanity-checker.xml: -------------------------------------------------------------------------------- 1 | 2 | 0.16.2 3 | 4 | 5 | 6 | include/libtorrent 7 | 8 | 9 | 10 | include/ 11 | include/libtorrent/ 12 | /Users/arvid/Documents/dev/boost_1_47_0/ 13 | 14 | 15 | 16 | #define BOOST_ALL_NO_LIB 1 17 | #define BOOST_ASIO_DYN_LINK 1 18 | #define BOOST_ASIO_ENABLE_CANCELIO 1 19 | #define BOOST_ASIO_HASH_MAP_BUCKETS 1021 20 | #define BOOST_ASIO_SEPARATE_COMPILATION 1 21 | #define BOOST_ASIO_SOURCE 1 22 | #define BOOST_EXCEPTION_DISABLE 1 23 | #define BOOST_SYSTEM_SOURCE 1 24 | #define BOOST_SYSTEM_STATIC_LINK 1 25 | #define BOOST_THREAD_USE_LIB 1 26 | #define TORRENT_BUILDING_SHARED 1 27 | #define TORRENT_DEBUG 1 28 | #define TORRENT_DISABLE_GEO_IP 1 29 | #define TORRENT_USE_TOMMATH 1 30 | #define UNICODE 1 31 | #define _FILE_OFFSET_BITS 64 32 | #define _UNICODE 1 33 | #define TORRENT_USE_OPENSSL 1 34 | 35 | 36 | 37 | libtorrent::aux 38 | 39 | 40 | 41 | bin/darwin-4.2.1/debug/boost-source/threading-multi/libtorrent.dylib.0.16.1 42 | 43 | -------------------------------------------------------------------------------- /libtorrent/set_version.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | import os 3 | import sys 4 | import glob 5 | 6 | version = (int(sys.argv[1]), int(sys.argv[2]), int(sys.argv[3]), int(sys.argv[4])) 7 | 8 | def substitute_file(name): 9 | subst = '' 10 | f = open(name) 11 | for l in f: 12 | if '#define LIBTORRENT_VERSION_MAJOR' in l and name.endswith('.hpp'): 13 | l = '#define LIBTORRENT_VERSION_MAJOR %d\n' % version[0] 14 | elif '#define LIBTORRENT_VERSION_MINOR' in l and name.endswith('.hpp'): 15 | l = '#define LIBTORRENT_VERSION_MINOR %d\n' % version[1] 16 | elif '#define LIBTORRENT_VERSION_TINY' in l and name.endswith('.hpp'): 17 | l = '#define LIBTORRENT_VERSION_TINY %d\n' % version[2] 18 | elif '#define LIBTORRENT_VERSION ' in l and name.endswith('.hpp'): 19 | l = '#define LIBTORRENT_VERSION "%d.%d.%d.%d"\n' % (version[0], version[1], version[2], version[3]) 20 | elif 'AC_INIT([libtorrent-rasterbar]' in l and name.endswith('.ac'): 21 | l = 'AC_INIT([libtorrent-rasterbar],[%d.%d.%d],[arvid@cs.umu.se],\n' % (version[0], version[1], version[2]) 22 | elif 'set (VERSION ' in l and name.endswith('.txt'): 23 | l = 'set (VERSION "%d.%d.%d")\n' % (version[0], version[1], version[2]) 24 | elif ':Version: ' in l and name.endswith('.rst'): 25 | l = ':Version: %d.%d.%d\n' % (version[0], version[1], version[2]) 26 | elif 'VERSION = ' in l and name.endswith('Jamfile'): 27 | l = 'VERSION = %d.%d.%d ;\n' % (version[0], version[1], version[2]) 28 | 29 | subst += l 30 | 31 | f.close() 32 | open(name, 'w+').write(subst) 33 | 34 | 35 | substitute_file('include/libtorrent/version.hpp') 36 | substitute_file('CMakeLists.txt') 37 | substitute_file('configure.ac') 38 | for i in glob.glob('docs/*.rst'): 39 | substitute_file(i) 40 | substitute_file('Jamfile') 41 | 42 | 43 | -------------------------------------------------------------------------------- /libtorrent/src/asio.cpp: -------------------------------------------------------------------------------- 1 | // builds all boost.asio source as a separate compilation unit 2 | #include 3 | 4 | #ifndef BOOST_ASIO_SOURCE 5 | #define BOOST_ASIO_SOURCE 6 | #endif 7 | 8 | #include "libtorrent/config.hpp" 9 | 10 | #define TORRENT_HAS_ASIO_DECL x ## BOOST_ASIO_DECL 11 | 12 | // only define BOOST_ASIO_DECL if it hasn't already been defined 13 | // or if it has been defined to an empty string 14 | #if TORRENT_HAS_ASIO_DECL == x 15 | #define BOOST_ASIO_DECL BOOST_SYMBOL_EXPORT 16 | #endif 17 | 18 | #if BOOST_VERSION >= 104500 19 | #include 20 | #elif BOOST_VERSION >= 104400 21 | #include 22 | #endif 23 | 24 | -------------------------------------------------------------------------------- /libtorrent/src/asio_ssl.cpp: -------------------------------------------------------------------------------- 1 | // builds all boost.asio SSL source as a separate compilation unit 2 | #include 3 | 4 | #if BOOST_VERSION >= 104610 5 | #include 6 | #endif 7 | 8 | -------------------------------------------------------------------------------- /libtorrent/src/stat.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2003-2012, Arvid Norberg 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the distribution. 15 | * Neither the name of the author nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #include "libtorrent/pch.hpp" 34 | 35 | #include 36 | #include 37 | 38 | #include "libtorrent/stat.hpp" 39 | 40 | namespace libtorrent { 41 | 42 | void stat_channel::second_tick(int tick_interval_ms) 43 | { 44 | int sample = int(size_type(m_counter) * 1000 / tick_interval_ms); 45 | TORRENT_ASSERT(sample >= 0); 46 | m_5_sec_average = size_type(m_5_sec_average) * 4 / 5 + sample / 5; 47 | m_30_sec_average = size_type(m_30_sec_average) * 29 / 30 + sample / 30; 48 | m_counter = 0; 49 | } 50 | 51 | } 52 | 53 | -------------------------------------------------------------------------------- /libtorrent/test/Jamfile: -------------------------------------------------------------------------------- 1 | import testing ; 2 | 3 | use-project /torrent : .. ; 4 | 5 | exe test_natpmp : test_natpmp.cpp /torrent//torrent 6 | : multi on full ; 7 | 8 | explicit test_natpmp ; 9 | 10 | rule libtorrent_dependency ( properties * ) 11 | { 12 | local result ; 13 | 14 | if msvc in $(properties) 15 | { 16 | # for some reason, the visual studio debugger seems 17 | # to get very confused with the dynamic linking. 18 | # since debugging unit tests is common, just link 19 | # statically with msvc 20 | result += /torrent//torrent/static/static/on ; 21 | } 22 | else 23 | { 24 | result += /torrent//torrent/shared/shared/on ; 25 | } 26 | 27 | return $(result) ; 28 | } 29 | 30 | project 31 | : requirements 32 | @libtorrent_dependency 33 | main.cpp 34 | setup_transfer.cpp 35 | : default-build 36 | multi 37 | full 38 | on 39 | ; 40 | 41 | test-suite libtorrent : 42 | [ run test_peer_priority.cpp ] 43 | [ run test_file.cpp ] 44 | [ run test_threads.cpp ] 45 | [ run test_rss.cpp ] 46 | [ run test_bandwidth_limiter.cpp ] 47 | [ run test_buffer.cpp ] 48 | [ run test_piece_picker.cpp ] 49 | [ run test_bencoding.cpp ] 50 | [ run test_fast_extension.cpp ] 51 | [ run test_primitives.cpp ] 52 | [ run test_ip_filter.cpp ] 53 | [ run test_hasher.cpp ] 54 | [ run test_dht.cpp ] 55 | [ run test_storage.cpp ] 56 | [ run test_torrent_parse.cpp ] 57 | [ run test_upnp.cpp ] 58 | 59 | [ run test_tracker.cpp ] 60 | [ run test_checking.cpp ] 61 | [ run test_web_seed.cpp ] 62 | [ run test_bdecode_performance.cpp ] 63 | [ run test_pe_crypto.cpp ] 64 | 65 | [ run test_utp.cpp ] 66 | [ run test_auto_unchoke.cpp ] 67 | [ run test_http_connection.cpp ] 68 | [ run test_torrent.cpp ] 69 | [ run test_transfer.cpp ] 70 | # [ run test_entry.cpp ] 71 | [ run test_metadata_extension.cpp ] 72 | [ run test_trackers_extension.cpp ] 73 | [ run test_swarm.cpp ] 74 | [ run test_lsd.cpp ] 75 | [ run test_pex.cpp ] 76 | ; 77 | 78 | -------------------------------------------------------------------------------- /libtorrent/tools/Jamfile: -------------------------------------------------------------------------------- 1 | import modules ; 2 | 3 | BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ; 4 | 5 | use-project /torrent : .. ; 6 | 7 | if $(BOOST_ROOT) 8 | { 9 | use-project /boost : $(BOOST_ROOT) ; 10 | } 11 | 12 | project tools 13 | : requirements 14 | multi /torrent//torrent 15 | : default-build 16 | static 17 | ; 18 | 19 | exe parse_hash_fails : parse_hash_fails.cpp ; 20 | 21 | -------------------------------------------------------------------------------- /libtorrent/tools/Makefile.am: -------------------------------------------------------------------------------- 1 | tool_programs = \ 2 | parse_hash_fails 3 | 4 | if ENABLE_EXAMPLES 5 | bin_PROGRAMS = $(tool_programs) 6 | endif 7 | 8 | EXTRA_PROGRAMS = $(tool_programs) 9 | EXTRA_DIST = Jamfile 10 | 11 | parse_hash_fails_SOURCES = parse_hash_fails.cpp 12 | #client_test_LDADD = $(top_builddir)/src/libtorrent-rasterbar.la 13 | 14 | LDADD = $(top_builddir)/src/libtorrent-rasterbar.la 15 | 16 | AM_CPPFLAGS = -ftemplate-depth-50 -I$(top_srcdir)/include @DEBUGFLAGS@ 17 | 18 | AM_LDFLAGS = @BOOST_SYSTEM_LIB@ 19 | #AM_LDFLAGS = $(LDFLAGS) @BOOST_SYSTEM_LIB@ @OPENSSL_LDFLAGS@ @OPENSSL_LIBS@ 20 | #AM_LDFLAGS = @OPENSSL_LDFLAGS@ 21 | -------------------------------------------------------------------------------- /libtorrent/update_copyright.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | import os 3 | import sys 4 | import glob 5 | import datetime 6 | 7 | this_year = datetime.date.today().year 8 | print 'current year: %d' % this_year 9 | 10 | def update_file(name): 11 | subst = '' 12 | f = open(name) 13 | for l in f: 14 | if l.startswith('Copyright (c) '): 15 | first_year = int(l[14:18]) 16 | if first_year != this_year: 17 | if l[18] == '-': 18 | l = l[:19] + str(this_year) + l[23:] 19 | else: 20 | l = l[:18] + '-' + str(this_year) + l[18:] 21 | 22 | subst += l 23 | 24 | f.close() 25 | open(name, 'w+').write(subst) 26 | 27 | for i in glob.glob('src/*.cpp') + glob.glob('include/libtorrent/*.hpp') + \ 28 | glob.glob('include/libtorrent/kademlia/*.hpp') + glob.glob('src/kademlia/*.cpp'): 29 | update_file(i) 30 | 31 | -------------------------------------------------------------------------------- /libyk/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | find_package( Boost 1.48 REQUIRED COMPONENTS signals date_time program_options filesystem regex chrono locale system thread) 4 | find_package( CURL REQUIRED ) 5 | find_package( Threads ) 6 | 7 | add_library(libky STATIC youku_impl.cpp libyk.cpp) 8 | 9 | include_directories(${Boost_INCLUDE_DIRS}) 10 | include_directories( ../third_party/avhttp/include ) 11 | 12 | target_link_libraries(libky ${Boost_LIBRARIES}) 13 | target_link_libraries( libky ${CMAKE_THREAD_LIBS_INIT}) 14 | 15 | # fix static build 16 | if(UNIX) # windows 下就算了 17 | target_link_libraries(libky -lrt) 18 | endif() -------------------------------------------------------------------------------- /libyk/libyk.cpp: -------------------------------------------------------------------------------- 1 | #include "libyk.h" 2 | #include "youku_impl.h" 3 | 4 | namespace libyk { 5 | 6 | // youku的具体实现. 7 | youku::youku() 8 | : m_impl(NULL) 9 | { 10 | m_impl = new youku_impl(); 11 | } 12 | 13 | youku::~youku() 14 | { 15 | delete m_impl; 16 | } 17 | 18 | bool youku::open(const std::string &url, std::string save_path /*= "."*/, video_quality quality /*= normal_quality*/) 19 | { 20 | return m_impl->open(url, save_path, quality); 21 | } 22 | 23 | void youku::stop() 24 | { 25 | m_impl->stop(); 26 | } 27 | 28 | bool youku::wait_for_complete() 29 | { 30 | return m_impl->wait_for_complete(); 31 | } 32 | 33 | duration_info youku::current_duration_info() 34 | { 35 | return m_impl->current_duration_info(); 36 | } 37 | 38 | bool youku::change_download(int index) 39 | { 40 | return m_impl->change_download(index); 41 | } 42 | 43 | bool youku::read_data(char* data, std::size_t size, std::size_t &read_size) 44 | { 45 | return m_impl->read_data(data, size, read_size); 46 | } 47 | 48 | boost::int64_t youku::read_seek(boost::uint64_t offset, int whence) 49 | { 50 | return m_impl->read_seek(offset, whence); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /libyk/libyk.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/libyk/libyk.vcproj -------------------------------------------------------------------------------- /libyk/libyk.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {676d393f-8086-4f94-818f-117af30eb2ef} 6 | 7 | 8 | {8b138c79-d194-4218-9793-c2a59b83cdc6} 9 | 10 | 11 | 12 | 13 | include 14 | 15 | 16 | include 17 | 18 | 19 | 20 | 21 | source 22 | 23 | 24 | source 25 | 26 | 27 | -------------------------------------------------------------------------------- /linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package(SDL REQUIRED) 2 | find_package(X11) 3 | find_package( Boost 1.50 COMPONENTS filesystem) 4 | 5 | include_directories(${SDL_INCLUDE_DIR}) 6 | 7 | add_executable(avplayer player.cpp main.cpp) 8 | 9 | target_link_libraries(avplayer av avsource avaudio avaudio avvideo) 10 | 11 | if(bt) 12 | target_link_libraries(avplayer torrent-rasterbar) 13 | endif() 14 | 15 | target_link_libraries(avplayer ${X11_LIBRARIES}) 16 | target_link_libraries(avplayer ${SDL_LIBRARY}) 17 | target_link_libraries(avplayer ${Boost_LIBRARIES}) 18 | 19 | INSTALL(TARGETS avplayer RUNTIME DESTINATION bin) 20 | -------------------------------------------------------------------------------- /linux/player.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 microcai 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License along 15 | with this program; if not, write to the Free Software Foundation, Inc., 16 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | */ 18 | 19 | 20 | #ifndef PLAYER_H 21 | #define PLAYER_H 22 | #include 23 | #include 24 | #include 25 | 26 | class player 27 | { 28 | public: 29 | // 播放控制. 30 | void fwd(); //快进 31 | void bwd(); //快退 32 | 33 | // 调节大小. 34 | void resize(int, int); 35 | // 全屏. 36 | void togglefs(); 37 | 38 | private: 39 | bool HasWindow(){return true;}; 40 | 41 | // 播放器相关的函数. 42 | void init_file_source(source_context *sc); 43 | void init_torrent_source(source_context *sc); 44 | void init_audio(ao_context *ao); 45 | void init_video(vo_context *vo); 46 | 47 | // 实时处理视频渲染的视频数据, 在这里完成比较加字幕, 加水印等操作. 48 | static int draw_frame(void *ctx, AVFrame* data, int pix_fmt, double pts); 49 | 50 | public: 51 | int open(const char *movie, int media_type); 52 | bool play(double fact = 0.0f, int index = 0); 53 | // 等待播放直到完成. 54 | bool wait_for_completion(); 55 | void close(); 56 | private: 57 | avplay* m_avplay; 58 | source_context* m_source; 59 | // 媒体文件信息. 60 | std::map m_media_list; 61 | ao_context* m_audio; 62 | vo_context* m_video; 63 | int m_video_width; 64 | int m_video_height; 65 | int m_cur_index; 66 | 67 | bool m_fs; 68 | }; 69 | 70 | #endif // PLAYER_H 71 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/logo.png -------------------------------------------------------------------------------- /source/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(avsource STATIC file_source.cpp source.cpp torrent_source.cpp) 2 | 3 | if(bt) 4 | add_definitions(-DUSE_TORRENT -DANSI_TERMINAL_COLORS -DBOOST_ASIO_DYN_LINK) 5 | endif() 6 | 7 | include_directories(${PROJECT_SOURCE_DIR}/libtorrent/include) 8 | -------------------------------------------------------------------------------- /source/asio.cpp: -------------------------------------------------------------------------------- 1 | // builds all boost.asio source as a separate compilation unit 2 | #ifndef BOOST_ASIO_SOURCE 3 | #define BOOST_ASIO_SOURCE 4 | #endif 5 | 6 | #include 7 | 8 | // for openssl. 9 | #if BOOST_VERSION >= 104610 10 | #include 11 | #endif 12 | -------------------------------------------------------------------------------- /source/av_source.h: -------------------------------------------------------------------------------- 1 | // 2 | // av_source.h 3 | // ~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2011 Jack (jack.wgm@gmail.com) 6 | // 7 | 8 | #ifndef __AV_SOURCE_H__ 9 | #define __AV_SOURCE_H__ 10 | 11 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 12 | # pragma once 13 | #endif 14 | 15 | #include 16 | 17 | class av_source 18 | { 19 | public: 20 | av_source() {} 21 | virtual ~av_source() {} 22 | 23 | public: 24 | // 打开. 25 | virtual bool open(boost::any ctx) = 0; 26 | 27 | // 读取数据. 28 | virtual bool read_data(char *data, size_t size, size_t &read_size) = 0; 29 | 30 | // seek操作. 31 | virtual int64_t read_seek(uint64_t offset, int whence) { return -1; } 32 | 33 | // 关闭. 34 | virtual void close() = 0; 35 | }; 36 | 37 | 38 | #endif // __AV_SOURCE_H__ 39 | -------------------------------------------------------------------------------- /source/file_source.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "internal.h" 4 | #include "file_source.h" 5 | 6 | 7 | #ifndef AVSEEK_SIZE 8 | #define AVSEEK_SIZE 0x10000 9 | #endif 10 | 11 | file_source::file_source() 12 | {} 13 | 14 | file_source::~file_source() 15 | { 16 | close(); 17 | if (m_open_data) 18 | delete m_open_data; 19 | } 20 | 21 | bool file_source::open(boost::any ctx) 22 | { 23 | // 保存ctx. 24 | m_open_data = boost::any_cast(ctx); 25 | 26 | // 文件是否存在. 27 | if (!boost::filesystem::exists(m_open_data->filename)) 28 | return false; 29 | 30 | // 打开文件. 31 | m_file.open(m_open_data->filename, std::ios::binary|std::ios::in); 32 | if (!m_file.is_open()) 33 | return false; 34 | 35 | return true; 36 | } 37 | 38 | bool file_source::read_data(char* data, size_t size, size_t &read_size) 39 | { 40 | // 根据参数加锁. 41 | if (m_open_data->is_multithread) 42 | m_mutex.lock(); 43 | 44 | if (!m_file) 45 | { 46 | if (m_open_data->is_multithread) 47 | m_mutex.unlock(); 48 | return false; 49 | } 50 | 51 | // 开始读取数据. 52 | m_file.read(data, size); 53 | read_size = m_file.gcount(); 54 | 55 | if (m_open_data->is_multithread) 56 | m_mutex.unlock(); 57 | 58 | return true; 59 | } 60 | 61 | int64_t file_source::read_seek(uint64_t offset, int whence) 62 | { 63 | // 参数检查. 64 | int64_t ret = boost::filesystem::file_size(m_open_data->filename); 65 | 66 | if (offset > ret || !m_file.is_open()) 67 | return false; 68 | 69 | if (m_open_data->is_multithread) 70 | m_mutex.lock(); 71 | 72 | std::ios_base::seekdir way = (std::ios_base::seekdir)whence; 73 | 74 | // 进行seek操作. 75 | if (whence != AVSEEK_SIZE) 76 | { 77 | m_file.clear(); 78 | m_file.seekg(offset, way); 79 | if (m_file.good()) 80 | ret = 0; 81 | else 82 | ret = -1; 83 | } 84 | 85 | if (m_open_data->is_multithread) 86 | m_mutex.unlock(); 87 | 88 | return ret; 89 | } 90 | 91 | void file_source::close() 92 | { 93 | if (m_file.is_open()) 94 | m_file.close(); 95 | } 96 | -------------------------------------------------------------------------------- /source/file_source.h: -------------------------------------------------------------------------------- 1 | // 2 | // file_source.h 3 | // ~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2011 Jack (jack.wgm@gmail.com) 6 | // 7 | 8 | #ifndef __FILE_SOURCE_H__ 9 | #define __FILE_SOURCE_H__ 10 | 11 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 12 | # pragma once 13 | #endif 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #include "av_source.h" 21 | 22 | 23 | struct open_file_data 24 | { 25 | // 是否是多线程访问. 26 | bool is_multithread; 27 | 28 | // 打开文件名. 29 | std::string filename; 30 | }; 31 | 32 | class file_source 33 | : public av_source 34 | { 35 | public: 36 | file_source(); 37 | virtual ~file_source(); 38 | 39 | public: 40 | // 打开. 41 | virtual bool open(boost::any ctx); 42 | 43 | // 读取数据. 44 | virtual bool read_data(char* data, size_t size, size_t &read_size); 45 | 46 | // seek操作. 47 | virtual int64_t read_seek(uint64_t offset, int whence); 48 | 49 | // 关闭. 50 | virtual void close(); 51 | 52 | private: 53 | // 文件打开结构. 54 | open_file_data *m_open_data; 55 | 56 | // 文件指针. 57 | boost::filesystem::fstream m_file; 58 | 59 | // 线程安全锁. 60 | mutable boost::mutex m_mutex; 61 | }; 62 | 63 | #endif // __FILE_SOURCE_H__ 64 | 65 | -------------------------------------------------------------------------------- /source/internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // internal.h 3 | // ~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2011 Jack (jack.wgm@gmail.com) 6 | // 7 | // This file is part of Libavplayer. 8 | // 9 | // Libavplayer is free software; you can redistribute it and/or 10 | // modify it under the terms of the GNU Lesser General Public 11 | // License as published by the Free Software Foundation; either 12 | // version 2.1 of the License, or (at your option) any later version. 13 | // 14 | // Libavplayer is distributed in the hope that it will be useful, 15 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | // Lesser General Public License for more details. 18 | // 19 | // You should have received a copy of the GNU Lesser General Public 20 | // License along with Libavplayer; if not, write to the Free Software 21 | // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | // 23 | // * $Id: ins.h 98 2011-08-19 16:08:52Z jack $ 24 | // 25 | 26 | #ifndef __INTERNAL_H__ 27 | #define __INTERNAL_H__ 28 | 29 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 30 | # pragma once 31 | #endif 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #ifndef WIN32 41 | # include 42 | # include 43 | # include 44 | #else 45 | # include 46 | # include 47 | #endif // WIN32 48 | 49 | 50 | #include 51 | #include 52 | #include 53 | #include 54 | 55 | 56 | 57 | #endif // __INTERNAL_H__ 58 | -------------------------------------------------------------------------------- /source/source.h: -------------------------------------------------------------------------------- 1 | // 2 | // source.h 3 | // ~~~~~~~~ 4 | // 5 | // Copyright (c) 2011 Jack (jack.wgm@gmail.com) 6 | // 7 | 8 | #ifndef __SOURCE_H__ 9 | #define __SOURCE_H__ 10 | 11 | #ifdef _MSC_VER 12 | #ifdef SOURCE_EXPORTS 13 | #define EXPORT_API __declspec(dllexport) 14 | #else 15 | #define EXPORT_API __declspec(dllimport) 16 | #endif 17 | #else 18 | #define EXPORT_API 19 | #endif 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | // 文件数据源. 26 | EXPORT_API int file_init_source(struct source_context *ctx); 27 | EXPORT_API int64_t file_read_data(struct source_context *ctx, char* buff, size_t buf_size); 28 | EXPORT_API int64_t file_read_seek(struct source_context *ctx, int64_t offset, int whence); 29 | EXPORT_API void file_close(struct source_context *ctx); 30 | EXPORT_API void file_destory(struct source_context *ctx); 31 | 32 | // bt数据源. 33 | EXPORT_API int bt_init_source(struct source_context *ctx); 34 | EXPORT_API int64_t bt_read_data(struct source_context *ctx, char* buff, size_t buf_size); 35 | EXPORT_API int64_t bt_read_seek(struct source_context *ctx, int64_t offset, int whence); 36 | EXPORT_API void bt_close(struct source_context *ctx); 37 | EXPORT_API void bt_destory(struct source_context *ctx); 38 | 39 | // youku数据源. 40 | typedef struct youku_video 41 | { 42 | int index; // file index. 43 | int duration; // second. 44 | } youku_video; 45 | 46 | EXPORT_API int yk_init_source(struct source_context *ctx); 47 | 48 | // 用于获得媒体文件的信息. 49 | EXPORT_API int yk_media_info(struct source_context *ctx, youku_video **list, int *size); 50 | // 释放媒体文件的信息. 51 | EXPORT_API int yk_free_media_info(struct source_context *ctx, youku_video **list); 52 | // 通知文件下载位置, 由demux的seek计算得到新的index, 此时, 我们youku模块应该按请求的index 53 | // 文件下载. 54 | EXPORT_API int yk_change_file(struct source_context *ctx, int index); 55 | 56 | // 以下函数则和globals.h中的source_context定义一样. 57 | EXPORT_API int64_t yk_read_data(struct source_context *ctx, char* buff, size_t buf_size); 58 | EXPORT_API int64_t yk_read_seek(struct source_context *ctx, int64_t offset, int whence); 59 | EXPORT_API void yk_close(struct source_context *ctx); 60 | EXPORT_API void yk_destory(struct source_context *ctx); 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | 67 | #endif // __SOURCE_H__ 68 | -------------------------------------------------------------------------------- /source/source.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/source/source.vcproj -------------------------------------------------------------------------------- /source/source.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 14 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 15 | 16 | 17 | 18 | 19 | source 20 | 21 | 22 | source 23 | 24 | 25 | source 26 | 27 | 28 | 29 | 30 | include 31 | 32 | 33 | include 34 | 35 | 36 | include 37 | 38 | 39 | include 40 | 41 | 42 | -------------------------------------------------------------------------------- /source/yk_source.cpp: -------------------------------------------------------------------------------- 1 | #include "yk_source.h" 2 | #include "source.h" 3 | 4 | yk_source::yk_source(void) 5 | : m_abort(false) 6 | , m_reset(false) 7 | { 8 | } 9 | 10 | yk_source::~yk_source(void) 11 | { 12 | } 13 | 14 | bool yk_source::open(boost::any ctx) 15 | { 16 | // 保存打开参数信息参数. 17 | m_open_data = boost::any_cast(ctx); 18 | // 打开youku下载器, 质量自动选择高质量. 19 | if (!m_yk_video.open(m_open_data.url, m_open_data.save_path, libyk::high_quality)) 20 | return false; 21 | return true; 22 | } 23 | 24 | bool yk_source::read_data(char* data, size_t size, size_t& read_size) 25 | { 26 | // 暂无实现. 27 | return false; 28 | } 29 | 30 | int64_t yk_source::read_seek(uint64_t offset, int whence) 31 | { 32 | return -1; 33 | } 34 | 35 | void yk_source::close() 36 | { 37 | } 38 | 39 | bool yk_source::set_current_video(int index) 40 | { 41 | return false; 42 | } 43 | 44 | bool yk_source::get_current_video(open_yk_data& vfi) const 45 | { 46 | return false; 47 | } 48 | 49 | std::vector yk_source::video_list() const 50 | { 51 | return std::vector(); 52 | } 53 | 54 | void yk_source::reset() 55 | { 56 | 57 | } 58 | 59 | int yk_source::youku_video_list_size() 60 | { 61 | libyk::duration_info d = m_yk_video.current_duration_info(); 62 | return d.size(); 63 | } 64 | 65 | bool yk_source::youku_video_list(struct youku_video *l) 66 | { 67 | libyk::duration_info d = m_yk_video.current_duration_info(); 68 | if (d.size() == 0) 69 | return false; 70 | int index = 0; 71 | for (libyk::duration_info::iterator i = d.begin(); 72 | i != d.end(); i++) 73 | { 74 | l->index = i->first; 75 | l->duration = i->second; 76 | l++; 77 | } 78 | return true; 79 | } 80 | -------------------------------------------------------------------------------- /source/yk_source.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "internal.h" 5 | 6 | #include "av_source.h" 7 | #include "libyk.h" 8 | 9 | 10 | // yk中的视频信息. 11 | struct open_yk_data 12 | { 13 | std::string url; // 播放youku的url. 14 | int type; // 当前请求播放的类型, 有hd2,mp4,3gp,3gphd,flv,m3u8, 默认为自动高清. 15 | std::string save_path; // 下载的youku视频保存位置. 16 | }; 17 | 18 | class yk_source 19 | : public av_source 20 | { 21 | public: 22 | yk_source(void); 23 | virtual ~yk_source(void); 24 | 25 | public: 26 | // 打开. 27 | virtual bool open(boost::any ctx); 28 | 29 | // 读取数据. 30 | virtual bool read_data(char* data, size_t size, size_t& read_size); 31 | 32 | // seek操作, 此处返回true, 表示数据不够, 需要缓冲. 33 | virtual int64_t read_seek(uint64_t offset, int whence); 34 | 35 | // 关闭. 36 | virtual void close(); 37 | 38 | // 设置或获得当前播放的视频文件. 39 | virtual bool set_current_video(int index); 40 | virtual bool get_current_video(open_yk_data& vfi) const; 41 | 42 | // 当前视频列表. 43 | virtual std::vector video_list() const; 44 | 45 | // 重置读取数据. 46 | virtual void reset(); 47 | 48 | // 返回视频文件列表信息. 49 | bool youku_video_list(struct youku_video *list); 50 | 51 | // 返回视频文件个数. 52 | int youku_video_list_size(); 53 | 54 | private: 55 | libyk::youku m_yk_video; 56 | open_yk_data m_open_data; 57 | bool m_abort; 58 | bool m_reset; 59 | }; 60 | -------------------------------------------------------------------------------- /third_party/ffmpeg/bin/SDL.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/bin/SDL.dll -------------------------------------------------------------------------------- /third_party/ffmpeg/bin/VSFilter.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/bin/VSFilter.dll -------------------------------------------------------------------------------- /third_party/ffmpeg/bin/avcodec-54.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/bin/avcodec-54.dll -------------------------------------------------------------------------------- /third_party/ffmpeg/bin/avdevice-54.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/bin/avdevice-54.dll -------------------------------------------------------------------------------- /third_party/ffmpeg/bin/avfilter-3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/bin/avfilter-3.dll -------------------------------------------------------------------------------- /third_party/ffmpeg/bin/avformat-54.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/bin/avformat-54.dll -------------------------------------------------------------------------------- /third_party/ffmpeg/bin/avutil-52.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/bin/avutil-52.dll -------------------------------------------------------------------------------- /third_party/ffmpeg/bin/ffmpeg.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/bin/ffmpeg.exe -------------------------------------------------------------------------------- /third_party/ffmpeg/bin/ffplay.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/bin/ffplay.exe -------------------------------------------------------------------------------- /third_party/ffmpeg/bin/ffprobe.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/bin/ffprobe.exe -------------------------------------------------------------------------------- /third_party/ffmpeg/bin/libeay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/bin/libeay32.dll -------------------------------------------------------------------------------- /third_party/ffmpeg/bin/libgcc_s_dw2-1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/bin/libgcc_s_dw2-1.dll -------------------------------------------------------------------------------- /third_party/ffmpeg/bin/postproc-52.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/bin/postproc-52.dll -------------------------------------------------------------------------------- /third_party/ffmpeg/bin/pthreadGC2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/bin/pthreadGC2.dll -------------------------------------------------------------------------------- /third_party/ffmpeg/bin/ssleay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/bin/ssleay32.dll -------------------------------------------------------------------------------- /third_party/ffmpeg/bin/swresample-0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/bin/swresample-0.dll -------------------------------------------------------------------------------- /third_party/ffmpeg/bin/swscale-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/bin/swscale-2.dll -------------------------------------------------------------------------------- /third_party/ffmpeg/include/SDL/SDL_active.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** 24 | * @file SDL_active.h 25 | * Include file for SDL application focus event handling 26 | */ 27 | 28 | #ifndef _SDL_active_h 29 | #define _SDL_active_h 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | 34 | #include "begin_code.h" 35 | /* Set up for C function definitions, even when using C++ */ 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** @name The available application states */ 41 | /*@{*/ 42 | #define SDL_APPMOUSEFOCUS 0x01 /**< The app has mouse coverage */ 43 | #define SDL_APPINPUTFOCUS 0x02 /**< The app has input focus */ 44 | #define SDL_APPACTIVE 0x04 /**< The application is active */ 45 | /*@}*/ 46 | 47 | /* Function prototypes */ 48 | /** 49 | * This function returns the current state of the application, which is a 50 | * bitwise combination of SDL_APPMOUSEFOCUS, SDL_APPINPUTFOCUS, and 51 | * SDL_APPACTIVE. If SDL_APPACTIVE is set, then the user is able to 52 | * see your application, otherwise it has been iconified or disabled. 53 | */ 54 | extern DECLSPEC Uint8 SDLCALL SDL_GetAppState(void); 55 | 56 | 57 | /* Ends C function definitions when using C++ */ 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | #include "close_code.h" 62 | 63 | #endif /* _SDL_active_h */ 64 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/SDL/SDL_byteorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** 24 | * @file SDL_byteorder.h 25 | * @deprecated Use SDL_endian.h instead 26 | */ 27 | 28 | /* DEPRECATED */ 29 | #include "SDL_endian.h" 30 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/SDL/SDL_copying.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/SDL/SDL_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** 24 | * @file SDL_error.h 25 | * Simple error message routines for SDL 26 | */ 27 | 28 | #ifndef _SDL_error_h 29 | #define _SDL_error_h 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * @name Public functions 41 | */ 42 | /*@{*/ 43 | extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...); 44 | extern DECLSPEC char * SDLCALL SDL_GetError(void); 45 | extern DECLSPEC void SDLCALL SDL_ClearError(void); 46 | /*@}*/ 47 | 48 | /** 49 | * @name Private functions 50 | * @internal Private error message function - used internally 51 | */ 52 | /*@{*/ 53 | #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) 54 | #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) 55 | typedef enum { 56 | SDL_ENOMEM, 57 | SDL_EFREAD, 58 | SDL_EFWRITE, 59 | SDL_EFSEEK, 60 | SDL_UNSUPPORTED, 61 | SDL_LASTERROR 62 | } SDL_errorcode; 63 | extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code); 64 | /*@}*/ 65 | 66 | /* Ends C function definitions when using C++ */ 67 | #ifdef __cplusplus 68 | } 69 | #endif 70 | #include "close_code.h" 71 | 72 | #endif /* _SDL_error_h */ 73 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/SDL/SDL_getenv.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL_getenv.h 24 | * @deprecated Use SDL_stdinc.h instead 25 | */ 26 | 27 | /* DEPRECATED */ 28 | #include "SDL_stdinc.h" 29 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/SDL/SDL_name.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SDLname_h_ 3 | #define _SDLname_h_ 4 | 5 | #if defined(__STDC__) || defined(__cplusplus) 6 | #define NeedFunctionPrototypes 1 7 | #endif 8 | 9 | #define SDL_NAME(X) SDL_##X 10 | 11 | #endif /* _SDLname_h_ */ 12 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/SDL/SDL_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** @file SDL_types.h 24 | * @deprecated Use SDL_stdinc.h instead. 25 | */ 26 | 27 | /* DEPRECATED */ 28 | #include "SDL_stdinc.h" 29 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/SDL/close_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL - Simple DirectMedia Layer 3 | Copyright (C) 1997-2009 Sam Lantinga 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | 19 | Sam Lantinga 20 | slouken@libsdl.org 21 | */ 22 | 23 | /** 24 | * @file close_code.h 25 | * This file reverses the effects of begin_code.h and should be included 26 | * after you finish any function and structure declarations in your headers 27 | */ 28 | 29 | #undef _begin_code_h 30 | 31 | /** 32 | * @file close_code.h 33 | * Reset structure packing at previous byte alignment 34 | */ 35 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__) 36 | #ifdef __BORLANDC__ 37 | #pragma nopackwarning 38 | #endif 39 | #if (defined(__MWERKS__) && defined(__MACOS__)) 40 | #pragma options align=reset 41 | #pragma enumsalwaysint reset 42 | #else 43 | #pragma pack(pop) 44 | #endif 45 | #endif /* Compiler needs structure packing set */ 46 | 47 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/libavdevice/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVDEVICE_VERSION_H 20 | #define AVDEVICE_VERSION_H 21 | 22 | /** 23 | * @file 24 | * @ingroup lavd 25 | * Libavdevice version macros 26 | */ 27 | 28 | #include "libavutil/avutil.h" 29 | 30 | #define LIBAVDEVICE_VERSION_MAJOR 54 31 | #define LIBAVDEVICE_VERSION_MINOR 3 32 | #define LIBAVDEVICE_VERSION_MICRO 102 33 | 34 | #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ 35 | LIBAVDEVICE_VERSION_MINOR, \ 36 | LIBAVDEVICE_VERSION_MICRO) 37 | #define LIBAVDEVICE_VERSION AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, \ 38 | LIBAVDEVICE_VERSION_MINOR, \ 39 | LIBAVDEVICE_VERSION_MICRO) 40 | #define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT 41 | 42 | #define LIBAVDEVICE_IDENT "Lavd" AV_STRINGIFY(LIBAVDEVICE_VERSION) 43 | 44 | /** 45 | * FF_API_* defines may be placed below to indicate public API that will be 46 | * dropped at a future version bump. The defines themselves are not part of 47 | * the public API and may change, break or disappear at any time. 48 | */ 49 | 50 | #endif /* AVDEVICE_VERSION_H */ 51 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/libavutil/adler32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Mans Rullgard 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_ADLER32_H 22 | #define AVUTIL_ADLER32_H 23 | 24 | #include 25 | #include "attributes.h" 26 | 27 | /** 28 | * @ingroup lavu_crypto 29 | * Calculate the Adler32 checksum of a buffer. 30 | * 31 | * Passing the return value to a subsequent av_adler32_update() call 32 | * allows the checksum of multiple buffers to be calculated as though 33 | * they were concatenated. 34 | * 35 | * @param adler initial checksum value 36 | * @param buf pointer to input buffer 37 | * @param len size of input buffer 38 | * @return updated checksum 39 | */ 40 | unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf, 41 | unsigned int len) av_pure; 42 | 43 | #endif /* AVUTIL_ADLER32_H */ 44 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/libavutil/aes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2007 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_AES_H 22 | #define AVUTIL_AES_H 23 | 24 | #include 25 | 26 | #include "attributes.h" 27 | #include "version.h" 28 | 29 | /** 30 | * @defgroup lavu_aes AES 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | extern const int av_aes_size; 36 | 37 | struct AVAES; 38 | 39 | /** 40 | * Allocate an AVAES context. 41 | */ 42 | struct AVAES *av_aes_alloc(void); 43 | 44 | /** 45 | * Initialize an AVAES context. 46 | * @param key_bits 128, 192 or 256 47 | * @param decrypt 0 for encryption, 1 for decryption 48 | */ 49 | int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt); 50 | 51 | /** 52 | * Encrypt or decrypt a buffer using a previously initialized context. 53 | * @param count number of 16 byte blocks 54 | * @param dst destination array, can be equal to src 55 | * @param src source array, can be equal to dst 56 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used 57 | * @param decrypt 0 for encryption, 1 for decryption 58 | */ 59 | void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); 60 | 61 | /** 62 | * @} 63 | */ 64 | 65 | #endif /* AVUTIL_AES_H */ 66 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/libavutil/audioconvert.h: -------------------------------------------------------------------------------- 1 | 2 | #include "version.h" 3 | 4 | #if FF_API_AUDIOCONVERT 5 | #include "channel_layout.h" 6 | #endif 7 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/libavutil/avconfig.h: -------------------------------------------------------------------------------- 1 | /* Generated by ffconf */ 2 | #ifndef AVUTIL_AVCONFIG_H 3 | #define AVUTIL_AVCONFIG_H 4 | #define AV_HAVE_BIGENDIAN 0 5 | #define AV_HAVE_FAST_UNALIGNED 1 6 | #define AV_HAVE_INCOMPATIBLE_FORK_ABI 0 7 | #endif /* AVUTIL_AVCONFIG_H */ 8 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/libavutil/intfloat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Mans Rullgard 3 | * 4 | * This file is part of Libav. 5 | * 6 | * Libav is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * Libav is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with Libav; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_INTFLOAT_H 22 | #define AVUTIL_INTFLOAT_H 23 | 24 | #include 25 | #include "attributes.h" 26 | 27 | union av_intfloat32 { 28 | uint32_t i; 29 | float f; 30 | }; 31 | 32 | union av_intfloat64 { 33 | uint64_t i; 34 | double f; 35 | }; 36 | 37 | /** 38 | * Reinterpret a 32-bit integer as a float. 39 | */ 40 | static av_always_inline float av_int2float(uint32_t i) 41 | { 42 | union av_intfloat32 v; 43 | v.i = i; 44 | return v.f; 45 | } 46 | 47 | /** 48 | * Reinterpret a float as a 32-bit integer. 49 | */ 50 | static av_always_inline uint32_t av_float2int(float f) 51 | { 52 | union av_intfloat32 v; 53 | v.f = f; 54 | return v.i; 55 | } 56 | 57 | /** 58 | * Reinterpret a 64-bit integer as a double. 59 | */ 60 | static av_always_inline double av_int2double(uint64_t i) 61 | { 62 | union av_intfloat64 v; 63 | v.i = i; 64 | return v.f; 65 | } 66 | 67 | /** 68 | * Reinterpret a double as a 64-bit integer. 69 | */ 70 | static av_always_inline uint64_t av_double2int(double f) 71 | { 72 | union av_intfloat64 v; 73 | v.f = f; 74 | return v.i; 75 | } 76 | 77 | #endif /* AVUTIL_INTFLOAT_H */ 78 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/libavutil/intfloat_readwrite.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2005 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_INTFLOAT_READWRITE_H 22 | #define AVUTIL_INTFLOAT_READWRITE_H 23 | 24 | #include 25 | #include "attributes.h" 26 | 27 | /* IEEE 80 bits extended float */ 28 | typedef struct AVExtFloat { 29 | uint8_t exponent[2]; 30 | uint8_t mantissa[8]; 31 | } AVExtFloat; 32 | 33 | attribute_deprecated double av_int2dbl(int64_t v) av_const; 34 | attribute_deprecated float av_int2flt(int32_t v) av_const; 35 | attribute_deprecated double av_ext2dbl(const AVExtFloat ext) av_const; 36 | attribute_deprecated int64_t av_dbl2int(double d) av_const; 37 | attribute_deprecated int32_t av_flt2int(float d) av_const; 38 | attribute_deprecated AVExtFloat av_dbl2ext(double d) av_const; 39 | 40 | #endif /* AVUTIL_INTFLOAT_READWRITE_H */ 41 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/libavutil/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_MD5_H 22 | #define AVUTIL_MD5_H 23 | 24 | #include 25 | 26 | #include "attributes.h" 27 | #include "version.h" 28 | 29 | /** 30 | * @defgroup lavu_md5 MD5 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | extern const int av_md5_size; 36 | 37 | struct AVMD5; 38 | 39 | struct AVMD5 *av_md5_alloc(void); 40 | void av_md5_init(struct AVMD5 *ctx); 41 | void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, const int len); 42 | void av_md5_final(struct AVMD5 *ctx, uint8_t *dst); 43 | void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len); 44 | 45 | /** 46 | * @} 47 | */ 48 | 49 | #endif /* AVUTIL_MD5_H */ 50 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/libavutil/random_seed.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009 Baptiste Coudurier 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_RANDOM_SEED_H 22 | #define AVUTIL_RANDOM_SEED_H 23 | 24 | #include 25 | /** 26 | * @addtogroup lavu_crypto 27 | * @{ 28 | */ 29 | 30 | /** 31 | * Get a seed to use in conjunction with random functions. 32 | * This function tries to provide a good seed at a best effort bases. 33 | * Its possible to call this function multiple times if more bits are needed. 34 | * It can be quite slow, which is why it should only be used as seed for a faster 35 | * PRNG. The quality of the seed depends on the platform. 36 | */ 37 | uint32_t av_get_random_seed(void); 38 | 39 | /** 40 | * @} 41 | */ 42 | 43 | #endif /* AVUTIL_RANDOM_SEED_H */ 44 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/libavutil/time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2000-2003 Fabrice Bellard 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_TIME_H 22 | #define AVUTIL_TIME_H 23 | 24 | #include 25 | 26 | /** 27 | * Get the current time in microseconds. 28 | */ 29 | int64_t av_gettime(void); 30 | 31 | /** 32 | * Sleep for a period of time. Although the duration is expressed in 33 | * microseconds, the actual delay may be rounded to the precision of the 34 | * system timer. 35 | * 36 | * @param usec Number of microseconds to sleep. 37 | * @return zero on success or (negative) error code. 38 | */ 39 | int av_usleep(unsigned usec); 40 | 41 | #endif /* AVUTIL_TIME_H */ 42 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/libavutil/xtea.h: -------------------------------------------------------------------------------- 1 | /* 2 | * A 32-bit implementation of the XTEA algorithm 3 | * Copyright (c) 2012 Samuel Pitoiset 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * FFmpeg is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_XTEA_H 23 | #define AVUTIL_XTEA_H 24 | 25 | #include 26 | 27 | /** 28 | * @defgroup lavu_xtea XTEA 29 | * @ingroup lavu_crypto 30 | * @{ 31 | */ 32 | 33 | typedef struct AVXTEA { 34 | uint32_t key[16]; 35 | } AVXTEA; 36 | 37 | /** 38 | * Initialize an AVXTEA context. 39 | * 40 | * @param ctx an AVXTEA context 41 | * @param key a key of 16 bytes used for encryption/decryption 42 | */ 43 | void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]); 44 | 45 | /** 46 | * Encrypt or decrypt a buffer using a previously initialized context. 47 | * 48 | * @param ctx an AVXTEA context 49 | * @param dst destination array, can be equal to src 50 | * @param src source array, can be equal to dst 51 | * @param count number of 8 byte blocks 52 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used 53 | * @param decrypt 0 for encryption, 1 for decryption 54 | */ 55 | void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src, 56 | int count, uint8_t *iv, int decrypt); 57 | 58 | /** 59 | * @} 60 | */ 61 | 62 | #endif /* AVUTIL_XTEA_H */ 63 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/libpostproc/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Version macros. 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef POSTPROC_POSTPROCESS_VERSION_H 22 | #define POSTPROC_POSTPROCESS_VERSION_H 23 | 24 | /** 25 | * @file 26 | * Libpostproc version macros 27 | */ 28 | 29 | #include "libavutil/avutil.h" 30 | 31 | #define LIBPOSTPROC_VERSION_MAJOR 52 32 | #define LIBPOSTPROC_VERSION_MINOR 2 33 | #define LIBPOSTPROC_VERSION_MICRO 100 34 | 35 | #define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \ 36 | LIBPOSTPROC_VERSION_MINOR, \ 37 | LIBPOSTPROC_VERSION_MICRO) 38 | #define LIBPOSTPROC_VERSION AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, \ 39 | LIBPOSTPROC_VERSION_MINOR, \ 40 | LIBPOSTPROC_VERSION_MICRO) 41 | #define LIBPOSTPROC_BUILD LIBPOSTPROC_VERSION_INT 42 | 43 | #define LIBPOSTPROC_IDENT "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION) 44 | 45 | #endif /* POSTPROC_POSTPROCESS_VERSION_H */ 46 | -------------------------------------------------------------------------------- /third_party/ffmpeg/include/libswresample/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Version macros. 3 | * 4 | * This file is part of libswresample 5 | * 6 | * libswresample is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * libswresample is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with libswresample; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef SWR_VERSION_H 22 | #define SWR_VERSION_H 23 | 24 | /** 25 | * @file 26 | * Libswresample version macros 27 | */ 28 | 29 | #include "libavutil/avutil.h" 30 | 31 | #define LIBSWRESAMPLE_VERSION_MAJOR 0 32 | #define LIBSWRESAMPLE_VERSION_MINOR 17 33 | #define LIBSWRESAMPLE_VERSION_MICRO 102 34 | 35 | #define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ 36 | LIBSWRESAMPLE_VERSION_MINOR, \ 37 | LIBSWRESAMPLE_VERSION_MICRO) 38 | #define LIBSWRESAMPLE_VERSION AV_VERSION(LIBSWRESAMPLE_VERSION_MAJOR, \ 39 | LIBSWRESAMPLE_VERSION_MINOR, \ 40 | LIBSWRESAMPLE_VERSION_MICRO) 41 | #define LIBSWRESAMPLE_BUILD LIBSWRESAMPLE_VERSION_INT 42 | 43 | #define LIBSWRESAMPLE_IDENT "SwR" AV_STRINGIFY(LIBSWRESAMPLE_VERSION) 44 | 45 | #endif /* SWR_VERSION_H */ 46 | -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/avcodec.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/avcodec.lib -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/avdevice-54.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | avdevice_configuration 3 | avdevice_license 4 | avdevice_register_all 5 | avdevice_version 6 | -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/avdevice.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/avdevice.lib -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/avfilter.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/avfilter.lib -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/avformat.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/avformat.lib -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/avutil.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/avutil.lib -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/libSDL.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/libSDL.a -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/libavcodec.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/libavcodec.dll.a -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/libavdevice.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/libavdevice.dll.a -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/libavfilter.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/libavfilter.dll.a -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/libavformat.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/libavformat.dll.a -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/libavutil.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/libavutil.dll.a -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/libbz2.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/libbz2.a -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/libgcc.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/libgcc.a -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/libmingwex.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/libmingwex.a -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/libpostproc.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/libpostproc.dll.a -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/libpthreadGC2.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/libpthreadGC2.a -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/libswresample.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/libswresample.dll.a -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/libswscale.dll.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/libswscale.dll.a -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/libz.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/libz.a -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/postproc-52.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | postproc_configuration 3 | postproc_license 4 | postproc_version 5 | pp_free_context 6 | pp_free_mode 7 | pp_get_context 8 | pp_get_mode_by_name_and_quality 9 | pp_help DATA 10 | pp_postprocess 11 | -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/postproc.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/postproc.lib -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/swresample.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/swresample.lib -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/swscale-2.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | sws_addVec 3 | sws_allocVec 4 | sws_alloc_context 5 | sws_cloneVec 6 | sws_context_class DATA 7 | sws_convVec 8 | sws_convertPalette8ToPacked24 9 | sws_convertPalette8ToPacked32 10 | sws_format_name 11 | sws_freeContext 12 | sws_freeFilter 13 | sws_freeVec 14 | sws_getCachedContext 15 | sws_getCoefficients 16 | sws_getColorspaceDetails 17 | sws_getConstVec 18 | sws_getContext 19 | sws_getDefaultFilter 20 | sws_getGaussianVec 21 | sws_getIdentityVec 22 | sws_get_class 23 | sws_init_context 24 | sws_isSupportedInput 25 | sws_isSupportedOutput 26 | sws_normalizeVec 27 | sws_printVec2 28 | sws_rgb2rgb_init 29 | sws_scale 30 | sws_scaleVec 31 | sws_setColorspaceDetails 32 | sws_shiftVec 33 | sws_subVec 34 | swscale_configuration 35 | swscale_license 36 | swscale_version 37 | -------------------------------------------------------------------------------- /third_party/ffmpeg/lib/swscale.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/ffmpeg/lib/swscale.lib -------------------------------------------------------------------------------- /third_party/ffmpeg/share/ffmpeg/examples/Makefile: -------------------------------------------------------------------------------- 1 | # use pkg-config for getting CFLAGS and LDLIBS 2 | FFMPEG_LIBS= libavdevice \ 3 | libavformat \ 4 | libavfilter \ 5 | libavcodec \ 6 | libswresample \ 7 | libswscale \ 8 | libavutil \ 9 | 10 | CFLAGS += -Wall -O2 -g 11 | CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS) 12 | LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS) 13 | 14 | EXAMPLES= decoding_encoding \ 15 | demuxing \ 16 | filtering_video \ 17 | filtering_audio \ 18 | metadata \ 19 | muxing \ 20 | resampling_audio \ 21 | scaling_video \ 22 | 23 | OBJS=$(addsuffix .o,$(EXAMPLES)) 24 | 25 | # the following examples make explicit use of the math library 26 | decoding_encoding: LDLIBS += -lm 27 | muxing: LDLIBS += -lm 28 | 29 | .phony: all clean-test clean 30 | 31 | all: $(OBJS) $(EXAMPLES) 32 | 33 | clean-test: 34 | $(RM) test*.pgm test.h264 test.mp2 test.sw test.mpg 35 | 36 | clean: clean-test 37 | $(RM) $(EXAMPLES) $(OBJS) 38 | -------------------------------------------------------------------------------- /third_party/ffmpeg/share/ffmpeg/examples/README: -------------------------------------------------------------------------------- 1 | FFmpeg examples README 2 | ---------------------- 3 | 4 | Both following use cases rely on pkg-config and make, thus make sure 5 | that you have them installed and working on your system. 6 | 7 | 8 | 1) Build the installed examples in a generic read/write user directory 9 | 10 | Copy to a read/write user directory and just use "make", it will link 11 | to the libraries on your system, assuming the PKG_CONFIG_PATH is 12 | correctly configured. 13 | 14 | 2) Build the examples in-tree 15 | 16 | Assuming you are in the source FFmpeg checkout directory, you need to build 17 | FFmpeg (no need to make install in any prefix). Then you can go into the 18 | doc/examples and run a command such as PKG_CONFIG_PATH=pc-uninstalled make. 19 | -------------------------------------------------------------------------------- /third_party/ffmpeg/share/ffmpeg/examples/metadata.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Reinhard Tartler 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy 5 | * of this software and associated documentation files (the "Software"), to deal 6 | * in the Software without restriction, including without limitation the rights 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | * copies of the Software, and to permit persons to whom the Software is 9 | * furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | * THE SOFTWARE. 21 | */ 22 | 23 | /** 24 | * @file 25 | * Shows how the metadata API can be used in application programs. 26 | * @example doc/examples/metadata.c 27 | */ 28 | 29 | #include 30 | 31 | #include 32 | #include 33 | 34 | int main (int argc, char **argv) 35 | { 36 | AVFormatContext *fmt_ctx = NULL; 37 | AVDictionaryEntry *tag = NULL; 38 | int ret; 39 | 40 | if (argc != 2) { 41 | printf("usage: %s \n" 42 | "example program to demonstrate the use of the libavformat metadata API.\n" 43 | "\n", argv[0]); 44 | return 1; 45 | } 46 | 47 | av_register_all(); 48 | if ((ret = avformat_open_input(&fmt_ctx, argv[1], NULL, NULL))) 49 | return ret; 50 | 51 | while ((tag = av_dict_get(fmt_ctx->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) 52 | printf("%s=%s\n", tag->key, tag->value); 53 | 54 | avformat_close_input(&fmt_ctx); 55 | return 0; 56 | } 57 | -------------------------------------------------------------------------------- /third_party/ffmpeg/share/ffmpeg/libvpx-1080p.ffpreset: -------------------------------------------------------------------------------- 1 | vcodec=libvpx 2 | 3 | g=120 4 | lag-in-frames=16 5 | deadline=good 6 | cpu-used=0 7 | vprofile=1 8 | qmax=51 9 | qmin=11 10 | slices=4 11 | b=2M 12 | 13 | #ignored unless using -pass 2 14 | maxrate=24M 15 | minrate=100k 16 | auto-alt-ref=1 17 | arnr-maxframes=7 18 | arnr-strength=5 19 | arnr-type=centered 20 | -------------------------------------------------------------------------------- /third_party/ffmpeg/share/ffmpeg/libvpx-1080p50_60.ffpreset: -------------------------------------------------------------------------------- 1 | vcodec=libvpx 2 | 3 | g=120 4 | lag-in-frames=25 5 | deadline=good 6 | cpu-used=0 7 | vprofile=1 8 | qmax=51 9 | qmin=11 10 | slices=4 11 | b=2M 12 | 13 | #ignored unless using -pass 2 14 | maxrate=24M 15 | minrate=100k 16 | auto-alt-ref=1 17 | arnr-maxframes=7 18 | arnr-strength=5 19 | arnr-type=centered 20 | -------------------------------------------------------------------------------- /third_party/ffmpeg/share/ffmpeg/libvpx-360p.ffpreset: -------------------------------------------------------------------------------- 1 | vcodec=libvpx 2 | 3 | g=120 4 | lag-in-frames=16 5 | deadline=good 6 | cpu-used=0 7 | vprofile=0 8 | qmax=63 9 | qmin=0 10 | b=768k 11 | 12 | #ignored unless using -pass 2 13 | maxrate=1.5M 14 | minrate=40k 15 | auto-alt-ref=1 16 | arnr-maxframes=7 17 | arnr-strength=5 18 | arnr-type=centered 19 | -------------------------------------------------------------------------------- /third_party/ffmpeg/share/ffmpeg/libvpx-720p.ffpreset: -------------------------------------------------------------------------------- 1 | vcodec=libvpx 2 | 3 | g=120 4 | lag-in-frames=16 5 | deadline=good 6 | cpu-used=0 7 | vprofile=0 8 | qmax=51 9 | qmin=11 10 | slices=4 11 | b=2M 12 | 13 | #ignored unless using -pass 2 14 | maxrate=24M 15 | minrate=100k 16 | auto-alt-ref=1 17 | arnr-maxframes=7 18 | arnr-strength=5 19 | arnr-type=centered 20 | -------------------------------------------------------------------------------- /third_party/ffmpeg/share/ffmpeg/libvpx-720p50_60.ffpreset: -------------------------------------------------------------------------------- 1 | vcodec=libvpx 2 | 3 | g=120 4 | lag-in-frames=25 5 | deadline=good 6 | cpu-used=0 7 | vprofile=0 8 | qmax=51 9 | qmin=11 10 | slices=4 11 | b=2M 12 | 13 | #ignored unless using -pass 2 14 | maxrate=24M 15 | minrate=100k 16 | auto-alt-ref=1 17 | arnr-maxframes=7 18 | arnr-strength=5 19 | arnr-type=centered 20 | -------------------------------------------------------------------------------- /third_party/ffmpeg/share/ffmpeg/libx264-ipod320.ffpreset: -------------------------------------------------------------------------------- 1 | vcodec=libx264 2 | 3 | vprofile=baseline 4 | level=13 5 | maxrate=768000 6 | bufsize=3000000 7 | -------------------------------------------------------------------------------- /third_party/ffmpeg/share/ffmpeg/libx264-ipod640.ffpreset: -------------------------------------------------------------------------------- 1 | vcodec=libx264 2 | 3 | vprofile=baseline 4 | level=30 5 | maxrate=10000000 6 | bufsize=10000000 7 | -------------------------------------------------------------------------------- /third_party/openssl/include/openssl/ebcdic.h: -------------------------------------------------------------------------------- 1 | /* crypto/ebcdic.h */ 2 | 3 | #ifndef HEADER_EBCDIC_H 4 | #define HEADER_EBCDIC_H 5 | 6 | #include 7 | 8 | /* Avoid name clashes with other applications */ 9 | #define os_toascii _openssl_os_toascii 10 | #define os_toebcdic _openssl_os_toebcdic 11 | #define ebcdic2ascii _openssl_ebcdic2ascii 12 | #define ascii2ebcdic _openssl_ascii2ebcdic 13 | 14 | extern const unsigned char os_toascii[256]; 15 | extern const unsigned char os_toebcdic[256]; 16 | void *ebcdic2ascii(void *dest, const void *srce, size_t count); 17 | void *ascii2ebcdic(void *dest, const void *srce, size_t count); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /third_party/openssl/include/openssl/whrlpool.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_WHRLPOOL_H 2 | #define HEADER_WHRLPOOL_H 3 | 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define WHIRLPOOL_DIGEST_LENGTH (512/8) 12 | #define WHIRLPOOL_BBLOCK 512 13 | #define WHIRLPOOL_COUNTER (256/8) 14 | 15 | typedef struct { 16 | union { 17 | unsigned char c[WHIRLPOOL_DIGEST_LENGTH]; 18 | /* double q is here to ensure 64-bit alignment */ 19 | double q[WHIRLPOOL_DIGEST_LENGTH/sizeof(double)]; 20 | } H; 21 | unsigned char data[WHIRLPOOL_BBLOCK/8]; 22 | unsigned int bitoff; 23 | size_t bitlen[WHIRLPOOL_COUNTER/sizeof(size_t)]; 24 | } WHIRLPOOL_CTX; 25 | 26 | #ifndef OPENSSL_NO_WHIRLPOOL 27 | #ifdef OPENSSL_FIPS 28 | int private_WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 29 | #endif 30 | int WHIRLPOOL_Init (WHIRLPOOL_CTX *c); 31 | int WHIRLPOOL_Update (WHIRLPOOL_CTX *c,const void *inp,size_t bytes); 32 | void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c,const void *inp,size_t bits); 33 | int WHIRLPOOL_Final (unsigned char *md,WHIRLPOOL_CTX *c); 34 | unsigned char *WHIRLPOOL(const void *inp,size_t bytes,unsigned char *md); 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /third_party/openssl/libs/libeay32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/openssl/libs/libeay32.lib -------------------------------------------------------------------------------- /third_party/openssl/libs/ssleay32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/third_party/openssl/libs/ssleay32.lib -------------------------------------------------------------------------------- /video/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(avvideo STATIC sdl_render.cpp) 2 | 3 | target_link_libraries(avvideo -lswscale) -------------------------------------------------------------------------------- /video/internal.h: -------------------------------------------------------------------------------- 1 | // 2 | // internal.h 3 | // ~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2011 Jack (jack.wgm@gmail.com) 6 | // 7 | 8 | #ifndef __INTERNAL_H__ 9 | #define __INTERNAL_H__ 10 | 11 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 12 | # pragma once 13 | #endif 14 | 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | extern "C" 27 | { 28 | #include "libswscale/swscale.h" 29 | #include "libavcodec/avcodec.h" 30 | } 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #include 37 | #include 38 | 39 | #include 40 | #include 41 | 42 | #endif // __INTERNAL_H__ 43 | -------------------------------------------------------------------------------- /video/opengl_render.h: -------------------------------------------------------------------------------- 1 | // 2 | // opengl_render.h 3 | // ~~~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2011 Jack (jack.wgm@gmail.com) 6 | // 7 | 8 | #ifndef __OPENGL_RENDER_H__ 9 | #define __OPENGL_RENDER_H__ 10 | 11 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 12 | # pragma once 13 | #endif 14 | 15 | #include "video_render.h" 16 | 17 | class opengl_render 18 | : public video_render 19 | { 20 | public: 21 | opengl_render(); 22 | virtual ~opengl_render(); 23 | 24 | public: 25 | // 初始render. 26 | virtual bool init_render(void* ctx, int w, int h, int pix_fmt); 27 | 28 | // 渲染一帧. 29 | virtual bool render_one_frame(AVFrame* data, int pix_fmt); 30 | 31 | // 调整大小. 32 | virtual void re_size(int width, int height); 33 | 34 | // 设置宽高比. 35 | virtual void aspect_ratio(int srcw, int srch, bool enable_aspect); 36 | 37 | // 撤销render. 38 | virtual void destory_render(); 39 | 40 | private: 41 | bool InitGL(GLvoid); 42 | GLvoid KillGLWindow(GLvoid); 43 | 44 | private: 45 | // 窗口着色描述表句柄. 46 | HGLRC m_hglrc; 47 | 48 | // 保存窗口句柄. 49 | HWND m_hwnd; 50 | 51 | // OpenGL渲染描述表句柄. 52 | HDC m_hdc; 53 | 54 | // 转换颜色YUV到RGB的上下文指针. 55 | SwsContext* m_swsctx; 56 | 57 | // 当前帧的RGB缓冲. 58 | uint8_t* m_framebuffer; 59 | 60 | // 当前渲染纹理. 61 | GLuint m_texture; 62 | 63 | // 视频宽. 64 | int m_image_width; 65 | 66 | // 视频高. 67 | int m_image_height; 68 | 69 | // 是否启用宽高比. 70 | bool m_keep_aspect; 71 | 72 | // 宽高比. 73 | float m_window_aspect; 74 | 75 | // 最后位置参数. 76 | RECT m_last_rect_client; 77 | 78 | // 当前宽. 79 | int m_current_width; 80 | 81 | // 当前高. 82 | int m_current_height; 83 | }; 84 | 85 | #endif // __OPENGL_RENDER_H__ 86 | -------------------------------------------------------------------------------- /video/sdl_render.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 microcai 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License along 15 | with this program; if not, write to the Free Software Foundation, Inc., 16 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | */ 18 | 19 | 20 | #ifndef SDL_RENDER_H 21 | #define SDL_RENDER_H 22 | 23 | #include "video_render.h" 24 | #include 25 | 26 | class sdl_render : public video_render 27 | { 28 | public: 29 | // 初始render. 30 | virtual bool init_render(void* ctx, int w, int h, int pix_fmt); 31 | 32 | // 渲染一帧. 33 | virtual bool render_one_frame(AVFrame* data, int pix_fmt); 34 | 35 | // 调整大小. 36 | virtual void re_size(int width, int height); 37 | 38 | // 设置宽高比. 39 | virtual void aspect_ratio(int srcw, int srch, bool enable_aspect); 40 | 41 | // 撤销render. 42 | virtual void destory_render(); 43 | virtual bool use_overlay(); 44 | private: 45 | SDL_Overlay* m_yuv; 46 | SDL_Surface* sfc; 47 | boost::mutex renderlock; 48 | int m_pix_fmt; 49 | int m_image_width, m_image_height; 50 | SwsContext* m_swsctx; 51 | }; 52 | 53 | #endif // SDL_RENDER_H 54 | -------------------------------------------------------------------------------- /video/soft_render.h: -------------------------------------------------------------------------------- 1 | // 2 | // soft_render.h 3 | // ~~~~~~~~~~~~~ 4 | // 5 | // Copyright (c) 2011 Jack (jack.wgm@gmail.com) 6 | // 7 | 8 | #ifndef __SOFT_RENDER_H__ 9 | #define __SOFT_RENDER_H__ 10 | 11 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 12 | # pragma once 13 | #endif 14 | 15 | #include "video_render.h" 16 | 17 | class soft_render 18 | : public video_render 19 | { 20 | public: 21 | soft_render(); 22 | virtual ~soft_render(); 23 | 24 | public: 25 | // 初始render. 26 | virtual bool init_render(void* ctx, int w, int h, int pix_fmt); 27 | 28 | // 渲染一帧. 29 | virtual bool render_one_frame(AVFrame* data, int pix_fmt); 30 | 31 | // 调整大小. 32 | virtual void re_size(int width, int height); 33 | 34 | // 设置宽高比. 35 | virtual void aspect_ratio(int srcw, int srch, bool enable_aspect); 36 | 37 | // 撤销render. 38 | virtual void destory_render(); 39 | 40 | private: 41 | // 窗口句柄. 42 | HWND m_hwnd; 43 | 44 | // 画面dc. 45 | HDC m_hdc; 46 | 47 | // GDI+的指针. 48 | ULONG_PTR m_gdiplusToken; 49 | 50 | // 帧缓冲. 51 | uint8_t* m_framebuffer; 52 | 53 | // 用于转换帧数据格式. 54 | SwsContext* m_swsctx; 55 | 56 | // 视频宽. 57 | int m_image_width; 58 | 59 | // 视频高. 60 | int m_image_height; 61 | 62 | // 是否启用宽高比. 63 | bool m_keep_aspect; 64 | 65 | // 宽高比. 66 | float m_window_aspect; 67 | }; 68 | 69 | #endif // __SOFT_RENDER_H__ 70 | 71 | -------------------------------------------------------------------------------- /video/video.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/video/video.vcproj -------------------------------------------------------------------------------- /video/video.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | source 6 | 7 | 8 | source 9 | 10 | 11 | source 12 | 13 | 14 | source 15 | 16 | 17 | source 18 | 19 | 20 | source 21 | 22 | 23 | 24 | 25 | include 26 | 27 | 28 | include 29 | 30 | 31 | include 32 | 33 | 34 | include 35 | 36 | 37 | include 38 | 39 | 40 | include 41 | 42 | 43 | 44 | 45 | include 46 | 47 | 48 | include 49 | 50 | 51 | 52 | 53 | {86f1dcfd-f9c2-4b7d-beb1-b0f016aa5d6c} 54 | 55 | 56 | {4cb23453-7e42-4c9b-8a20-c60abb16a27f} 57 | 58 | 59 | -------------------------------------------------------------------------------- /video/y4m_render.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/video/y4m_render.cpp -------------------------------------------------------------------------------- /video/y4m_render.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/video/y4m_render.h -------------------------------------------------------------------------------- /win32/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_executable(avplayer 3 | avplayer/avplayer.rc 4 | avplayer/main.cpp 5 | avcore/avplayer.cpp 6 | avcore/player_impl.cpp 7 | avcore/stdafx.cpp 8 | ) 9 | 10 | target_link_libraries(avplayer av avsource avaudio avaudio avvideo) 11 | 12 | if(bt) 13 | target_link_libraries(avplayer torrent-rasterbar) 14 | endif() -------------------------------------------------------------------------------- /win32/avcore/avcore.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/win32/avcore/avcore.vcproj -------------------------------------------------------------------------------- /win32/avcore/avcore.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | source 6 | 7 | 8 | source 9 | 10 | 11 | source 12 | 13 | 14 | 15 | 16 | include 17 | 18 | 19 | include 20 | 21 | 22 | 23 | 24 | {2ded8dfc-4e42-40f6-bb5c-5086280cb3e3} 25 | 26 | 27 | {4ba27865-b686-4e7d-91ae-7450265464c3} 28 | 29 | 30 | 31 | 32 | include 33 | 34 | 35 | -------------------------------------------------------------------------------- /win32/avcore/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : 只包括标准包含文件的源文件 2 | // ffplay.pch 将作为预编译头 3 | // stdafx.obj 将包含预编译类型信息 4 | 5 | #include "stdafx.h" 6 | 7 | /*#include "../video/video_render.h"*/ -------------------------------------------------------------------------------- /win32/avcore/stdafx.h: -------------------------------------------------------------------------------- 1 | // 2 | // stdafx.h 3 | // ~~~~~~~~ 4 | // 5 | // Copyright (c) 2011 Jack (jack.wgm@gmail.com) 6 | // 7 | 8 | #ifndef __STDAFX_H__ 9 | #define __STDAFX_H__ 10 | 11 | #pragma once 12 | 13 | #ifndef _WIN32_WINNT 14 | #define _WIN32_WINNT 0x0501 15 | #endif 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /win32/avplayer/ReadMe.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/win32/avplayer/ReadMe.txt -------------------------------------------------------------------------------- /win32/avplayer/avplayer.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/win32/avplayer/avplayer.ico -------------------------------------------------------------------------------- /win32/avplayer/avplayer.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/win32/avplayer/avplayer.rc -------------------------------------------------------------------------------- /win32/avplayer/avplayer.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/win32/avplayer/avplayer.vcproj -------------------------------------------------------------------------------- /win32/avplayer/avplayer.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | resource 6 | 7 | 8 | resource 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | {93eaae54-c3b0-408c-8341-72c38934862e} 17 | 18 | 19 | {be1e2427-4c23-4c4e-b6aa-2b28e0885666} 20 | 21 | 22 | {6a7cf9b5-1b47-4f96-a85e-418dfc4e86b5} 23 | 24 | 25 | 26 | 27 | source 28 | 29 | 30 | 31 | 32 | include 33 | 34 | 35 | 36 | 37 | resource 38 | 39 | 40 | -------------------------------------------------------------------------------- /win32/avplayer/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by avplayer.rc 4 | // 5 | 6 | #define IDS_APP_TITLE 103 7 | 8 | #define IDR_MAINFRAME 128 9 | #define IDD_AVPLAYER_DIALOG 102 10 | #define IDD_ABOUTBOX 103 11 | #define IDM_ABOUT 104 12 | #define IDM_EXIT 105 13 | #define IDI_AVPLAYER 107 14 | #define IDI_SMALL 108 15 | #define IDC_AVPLAYER 109 16 | #define IDC_MYICON 2 17 | #ifndef IDC_STATIC 18 | #define IDC_STATIC -1 19 | #endif 20 | // 新对象的下一组默认值 21 | // 22 | #ifdef APSTUDIO_INVOKED 23 | #ifndef APSTUDIO_READONLY_SYMBOLS 24 | 25 | #define _APS_NO_MFC 130 26 | #define _APS_NEXT_RESOURCE_VALUE 129 27 | #define _APS_NEXT_COMMAND_VALUE 32771 28 | #define _APS_NEXT_CONTROL_VALUE 1000 29 | #define _APS_NEXT_SYMED_VALUE 110 30 | #endif 31 | #endif 32 | -------------------------------------------------------------------------------- /win32/avplayer/small.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jackarain/avplayer/20f1bd164fccb5482e2dd554de89c0c128d72775/win32/avplayer/small.ico --------------------------------------------------------------------------------