├── .clang-format ├── .gitattributes ├── .github └── workflows │ ├── sync-labels.yaml │ ├── update-issues.yaml │ └── validate-pr-title.yaml ├── .gitignore ├── .gitmodules ├── .gn ├── BUILD.gn ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Doxyfile.in ├── LICENSE ├── LICENSE.chromium ├── Makefile.in ├── README.md ├── build.py ├── build_overrides ├── build.gni └── gtest.gni ├── cipd.ensure ├── common.gni ├── configure ├── gen_docs.py ├── sample_xcode_project ├── LICENSE ├── README.md ├── build.sh ├── sample_xcode_project.xcodeproj │ └── project.pbxproj └── sample_xcode_project │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── AssetSelectionTableViewController.h │ ├── AssetSelectionTableViewController.m │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-1024.png │ │ ├── Icon-121.png │ │ ├── Icon-152.png │ │ ├── Icon-167.png │ │ ├── Icon-180.png │ │ └── Icon-76.png │ ├── Contents.json │ ├── audio_only_1.imageset │ │ ├── Contents.json │ │ └── audio_only_1.png │ ├── audio_only_2.imageset │ │ ├── Contents.json │ │ └── audio_only_2.png │ ├── audio_only_3.imageset │ │ ├── Contents.json │ │ └── audio_only_3.png │ ├── audio_only_4.imageset │ │ ├── Contents.json │ │ └── audio_only_4.png │ ├── baseline_close_white_18pt.imageset │ │ ├── Contents.json │ │ ├── baseline_close_white_18pt_1x.png │ │ ├── baseline_close_white_18pt_2x.png │ │ └── baseline_close_white_18pt_3x.png │ ├── baseline_info_white_36pt.imageset │ │ ├── Contents.json │ │ ├── baseline_info_white_36pt_1x.png │ │ ├── baseline_info_white_36pt_2x.png │ │ └── baseline_info_white_36pt_3x.png │ ├── baseline_language_white_18pt.imageset │ │ ├── Contents.json │ │ ├── baseline_language_white_18pt_1x.png │ │ ├── baseline_language_white_18pt_2x.png │ │ └── baseline_language_white_18pt_3x.png │ ├── baseline_more_vert_white_18pt.imageset │ │ ├── Contents.json │ │ ├── baseline_more_vert_white_18pt_1x.png │ │ ├── baseline_more_vert_white_18pt_2x.png │ │ └── baseline_more_vert_white_18pt_3x.png │ ├── baseline_settings_white_36pt.imageset │ │ ├── Contents.json │ │ ├── baseline_settings_white_36pt_1x.png │ │ ├── baseline_settings_white_36pt_2x.png │ │ └── baseline_settings_white_36pt_3x.png │ ├── baseline_video_library_white_36pt.imageset │ │ ├── Contents.json │ │ ├── baseline_video_library_white_36pt_1x.png │ │ ├── baseline_video_library_white_36pt_2x.png │ │ └── baseline_video_library_white_36pt_3x.png │ ├── ic_closed_caption_white_18pt.imageset │ │ ├── Contents.json │ │ ├── ic_closed_caption_white_18pt.png │ │ ├── ic_closed_caption_white_18pt_2x.png │ │ └── ic_closed_caption_white_18pt_3x.png │ ├── ic_pause_white_18pt.imageset │ │ ├── Contents.json │ │ ├── ic_pause_white_18pt.png │ │ ├── ic_pause_white_18pt_2x.png │ │ └── ic_pause_white_18pt_3x.png │ ├── ic_play_arrow_white_18pt.imageset │ │ ├── Contents.json │ │ ├── ic_play_arrow_white_18pt.png │ │ ├── ic_play_arrow_white_18pt_2x.png │ │ └── ic_play_arrow_white_18pt_3x.png │ ├── ic_replay_white_18pt.imageset │ │ ├── Contents.json │ │ ├── ic_replay_white_18pt.png │ │ ├── ic_replay_white_18pt_2x.png │ │ └── ic_replay_white_18pt_3x.png │ └── poster.imageset │ │ ├── Contents.json │ │ └── poster.jpg │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── ConfigTableValue.h │ ├── ConfigTableValue.m │ ├── ConfigTableViewController.h │ ├── ConfigTableViewController.m │ ├── ErrorDisplayView.h │ ├── ErrorDisplayView.m │ ├── Info.plist │ ├── LicenseTableViewController.h │ ├── LicenseTableViewController.m │ ├── LicenseViewController.h │ ├── LicenseViewController.m │ ├── NSObject+ShakaLayoutHelpers.h │ ├── NSObject+ShakaLayoutHelpers.m │ ├── PlayerViewController.h │ ├── PlayerViewController.m │ ├── ProgressAndBufferedSlider.h │ ├── ProgressAndBufferedSlider.m │ ├── assets.plist │ └── main.m ├── shaka ├── demo │ ├── Info.plist │ └── main.cc ├── docs │ ├── abi_guidelines.md │ ├── eme_plugins.md │ ├── ffmpeg_encryption.md │ ├── layout.xml │ ├── media_pipeline.md │ ├── symbolizing-crash-reports.md │ ├── tutorial-add-file.png │ ├── tutorial-disable-bitcode.png │ ├── tutorial-embed-binaries-1.png │ ├── tutorial-embed-binaries-2.png │ ├── tutorial-search-paths.png │ ├── tutorial_filters.md │ └── tutorial_setup.md ├── include │ └── shaka │ │ ├── ShakaPlayer.h │ │ ├── ShakaPlayerEmbedded.h │ │ ├── ShakaPlayerStorage.h │ │ ├── ShakaPlayerView.h │ │ ├── async_results.h │ │ ├── config_names.h │ │ ├── eme │ │ ├── configuration.h │ │ ├── data.h │ │ ├── eme_promise.h │ │ ├── implementation.h │ │ ├── implementation_factory.h │ │ ├── implementation_helper.h │ │ └── implementation_registry.h │ │ ├── error.h │ │ ├── error_objc.h │ │ ├── js_manager.h │ │ ├── macros.h │ │ ├── media │ │ ├── apple_audio_renderer.h │ │ ├── apple_video_renderer.h │ │ ├── decoder.h │ │ ├── default_media_player.h │ │ ├── demuxer.h │ │ ├── frames.h │ │ ├── media_capabilities.h │ │ ├── media_player.h │ │ ├── media_track.h │ │ ├── proxy_media_player.h │ │ ├── renderer.h │ │ ├── sdl_audio_renderer.h │ │ ├── sdl_video_renderer.h │ │ ├── stream_info.h │ │ ├── streams.h │ │ ├── text_track.h │ │ └── vtt_cue.h │ │ ├── net.h │ │ ├── net_objc.h │ │ ├── optional.h │ │ ├── player.h │ │ ├── sdl_frame_drawer.h │ │ ├── storage.h │ │ ├── utils.h │ │ └── variant.h ├── js │ ├── shaka-player.compiled.debug.js │ └── shaka-player.compiled.js ├── src │ ├── core │ │ ├── environment.cc │ │ ├── environment.h │ │ ├── js_manager_impl.cc │ │ ├── js_manager_impl.h │ │ ├── js_object_wrapper.cc │ │ ├── js_object_wrapper.h │ │ ├── member.h │ │ ├── network_thread.cc │ │ ├── network_thread.h │ │ ├── ref_ptr.h │ │ ├── rejected_promise_handler.cc │ │ ├── rejected_promise_handler.h │ │ ├── task_runner.cc │ │ └── task_runner.h │ ├── debug │ │ ├── mutex.h │ │ ├── thread.cc │ │ ├── thread.h │ │ ├── thread_event.cc │ │ ├── thread_event.h │ │ ├── waitable.cc │ │ ├── waitable.h │ │ ├── waiting_tracker.cc │ │ └── waiting_tracker.h │ ├── eme │ │ ├── clearkey.json │ │ ├── clearkey_implementation.cc │ │ ├── clearkey_implementation.h │ │ ├── clearkey_implementation_factory.cc │ │ ├── clearkey_implementation_factory.h │ │ ├── configuration.cc │ │ └── implementation.cc │ ├── js │ │ ├── base_64.cc │ │ ├── base_64.h │ │ ├── console.cc │ │ ├── console.h │ │ ├── debug.cc │ │ ├── debug.h │ │ ├── dom │ │ │ ├── attr.cc │ │ │ ├── attr.h │ │ │ ├── character_data.cc │ │ │ ├── character_data.h │ │ │ ├── comment.cc │ │ │ ├── comment.h │ │ │ ├── container_node.cc │ │ │ ├── container_node.h │ │ │ ├── document.cc │ │ │ ├── document.h │ │ │ ├── dom_exception.cc │ │ │ ├── dom_exception.h │ │ │ ├── dom_parser.cc │ │ │ ├── dom_parser.h │ │ │ ├── dom_string_list.cc │ │ │ ├── dom_string_list.h │ │ │ ├── element.cc │ │ │ ├── element.h │ │ │ ├── exception_code.h │ │ │ ├── node.cc │ │ │ ├── node.h │ │ │ ├── text.cc │ │ │ ├── text.h │ │ │ ├── xml_document_parser.cc │ │ │ └── xml_document_parser.h │ │ ├── eme │ │ │ ├── implementation_helper_impl.cc │ │ │ ├── implementation_helper_impl.h │ │ │ ├── implementation_registry.cc │ │ │ ├── media_key_session.cc │ │ │ ├── media_key_session.h │ │ │ ├── media_key_system_access.cc │ │ │ ├── media_key_system_access.h │ │ │ ├── media_key_system_configuration.cc │ │ │ ├── media_key_system_configuration.h │ │ │ ├── media_keys.cc │ │ │ ├── media_keys.h │ │ │ ├── search_registry.cc │ │ │ └── search_registry.h │ │ ├── events │ │ │ ├── event.cc │ │ │ ├── event.h │ │ │ ├── event_names.h │ │ │ ├── event_target.cc │ │ │ ├── event_target.h │ │ │ ├── media_encrypted_event.cc │ │ │ ├── media_encrypted_event.h │ │ │ ├── media_key_message_event.cc │ │ │ ├── media_key_message_event.h │ │ │ ├── progress_event.cc │ │ │ ├── progress_event.h │ │ │ ├── version_change_event.cc │ │ │ └── version_change_event.h │ │ ├── idb │ │ │ ├── cursor.cc │ │ │ ├── cursor.h │ │ │ ├── database.cc │ │ │ ├── database.h │ │ │ ├── database.proto │ │ │ ├── delete_db_request.cc │ │ │ ├── delete_db_request.h │ │ │ ├── idb_factory.cc │ │ │ ├── idb_factory.h │ │ │ ├── idb_utils.cc │ │ │ ├── idb_utils.h │ │ │ ├── object_store.cc │ │ │ ├── object_store.h │ │ │ ├── open_db_request.cc │ │ │ ├── open_db_request.h │ │ │ ├── request.cc │ │ │ ├── request.h │ │ │ ├── request_impls.cc │ │ │ ├── request_impls.h │ │ │ ├── sqlite.cc │ │ │ ├── sqlite.h │ │ │ ├── transaction.cc │ │ │ └── transaction.h │ │ ├── js_error.cc │ │ ├── js_error.h │ │ ├── location.cc │ │ ├── location.h │ │ ├── manifest.idl │ │ ├── mse │ │ │ ├── media_element.cc │ │ │ ├── media_element.h │ │ │ ├── media_error.cc │ │ │ ├── media_error.h │ │ │ ├── media_source.cc │ │ │ ├── media_source.h │ │ │ ├── media_track.cc │ │ │ ├── media_track.h │ │ │ ├── source_buffer.cc │ │ │ ├── source_buffer.h │ │ │ ├── text_track.cc │ │ │ ├── text_track.h │ │ │ ├── time_ranges.cc │ │ │ ├── time_ranges.h │ │ │ ├── track_list.cc │ │ │ ├── track_list.h │ │ │ ├── video_element.cc │ │ │ └── video_element.h │ │ ├── navigator.cc │ │ ├── navigator.h │ │ ├── net.cc │ │ ├── net.h │ │ ├── offline_externs.idl │ │ ├── player_externs.idl │ │ ├── stats.idl │ │ ├── test_type.cc │ │ ├── test_type.h │ │ ├── text_coders.cc │ │ ├── text_coders.h │ │ ├── timeouts.cc │ │ ├── timeouts.h │ │ ├── track.idl │ │ ├── url.cc │ │ ├── url.h │ │ ├── vtt_cue.cc │ │ ├── vtt_cue.h │ │ ├── xml_http_request.cc │ │ └── xml_http_request.h │ ├── mapping │ │ ├── any.cc │ │ ├── any.h │ │ ├── backing_object.cc │ │ ├── backing_object.h │ │ ├── backing_object_factory.cc │ │ ├── backing_object_factory.h │ │ ├── byte_buffer.cc │ │ ├── byte_buffer.h │ │ ├── byte_string.cc │ │ ├── byte_string.h │ │ ├── callback.cc │ │ ├── callback.h │ │ ├── convert_js.h │ │ ├── enum.h │ │ ├── exception_or.h │ │ ├── generic_converter.h │ │ ├── js_engine.h │ │ ├── js_utils.cc │ │ ├── js_utils.h │ │ ├── js_wrappers.h │ │ ├── jsc │ │ │ ├── js_engine.cc │ │ │ ├── js_wrappers.cc │ │ │ ├── jsc_utils.cc │ │ │ └── jsc_utils.h │ │ ├── names.h │ │ ├── promise.cc │ │ ├── promise.h │ │ ├── register_member.cc │ │ ├── register_member.h │ │ ├── struct.cc │ │ ├── struct.h │ │ ├── v8 │ │ │ ├── js_engine.cc │ │ │ ├── js_wrappers.cc │ │ │ ├── v8_utils.cc │ │ │ └── v8_utils.h │ │ └── weak_js_ptr.h │ ├── media │ │ ├── apple │ │ │ ├── apple_decoded_frame.cc │ │ │ ├── apple_decoded_frame.h │ │ │ ├── apple_decoder.cc │ │ │ └── apple_decoder.h │ │ ├── apple_audio_renderer.cc │ │ ├── apple_video_renderer.cc │ │ ├── audio_renderer_common.cc │ │ ├── audio_renderer_common.h │ │ ├── decoder.cc │ │ ├── decoder_thread.cc │ │ ├── decoder_thread.h │ │ ├── default_media_player.cc │ │ ├── demuxer.cc │ │ ├── demuxer_thread.cc │ │ ├── demuxer_thread.h │ │ ├── ffmpeg │ │ │ ├── ffmpeg_decoded_frame.cc │ │ │ ├── ffmpeg_decoded_frame.h │ │ │ ├── ffmpeg_decoder.cc │ │ │ ├── ffmpeg_decoder.h │ │ │ ├── ffmpeg_demuxer.cc │ │ │ ├── ffmpeg_demuxer.h │ │ │ ├── ffmpeg_encoded_frame.cc │ │ │ └── ffmpeg_encoded_frame.h │ │ ├── frames.cc │ │ ├── ios │ │ │ ├── av_media_player.h │ │ │ ├── av_media_player.mm │ │ │ ├── av_media_track.h │ │ │ ├── av_media_track.mm │ │ │ ├── av_text_track.h │ │ │ └── av_text_track.mm │ │ ├── media_capabilities.cc │ │ ├── media_player.cc │ │ ├── media_track_public.cc │ │ ├── media_utils.cc │ │ ├── media_utils.h │ │ ├── media_utils_ios.mm │ │ ├── mse_media_player.cc │ │ ├── mse_media_player.h │ │ ├── pipeline_manager.cc │ │ ├── pipeline_manager.h │ │ ├── pipeline_monitor.cc │ │ ├── pipeline_monitor.h │ │ ├── proxy_media_player.cc │ │ ├── renderer.cc │ │ ├── sdl_audio_renderer.cc │ │ ├── sdl_video_renderer.cc │ │ ├── stream_info.cc │ │ ├── streams.cc │ │ ├── text_track_public.cc │ │ ├── types.h │ │ ├── video_renderer_common.cc │ │ ├── video_renderer_common.h │ │ └── vtt_cue_public.cc │ ├── memory │ │ ├── heap_tracer.cc │ │ ├── heap_tracer.h │ │ ├── object_tracker.cc │ │ ├── object_tracker.h │ │ ├── v8_heap_tracer.cc │ │ └── v8_heap_tracer.h │ ├── public │ │ ├── ShakaPlayer+Internal.h │ │ ├── ShakaPlayer.mm │ │ ├── ShakaPlayerStorage.mm │ │ ├── ShakaPlayerView.mm │ │ ├── data.cc │ │ ├── eme_promise.cc │ │ ├── eme_promise_impl.h │ │ ├── error.cc │ │ ├── error_objc+Internal.h │ │ ├── error_objc.mm │ │ ├── js_manager.cc │ │ ├── net_objc+Internal.h │ │ ├── net_objc.mm │ │ ├── net_public.cc │ │ ├── optional.cc │ │ ├── player.cc │ │ ├── sdl_frame_drawer.cc │ │ ├── shaka_utils.cc │ │ └── storage.cc │ └── util │ │ ├── buffer_reader.cc │ │ ├── buffer_reader.h │ │ ├── buffer_writer.cc │ │ ├── buffer_writer.h │ │ ├── cfref.cc │ │ ├── cfref.h │ │ ├── clock.cc │ │ ├── clock.h │ │ ├── crypto.h │ │ ├── crypto_darwin.cc │ │ ├── crypto_openssl.cc │ │ ├── darwin_utils.h │ │ ├── darwin_utils.mm │ │ ├── decryptor.h │ │ ├── decryptor_darwin.cc │ │ ├── decryptor_openssl.cc │ │ ├── dynamic_buffer.cc │ │ ├── dynamic_buffer.h │ │ ├── file_system.cc │ │ ├── file_system.h │ │ ├── file_system_posix.cc │ │ ├── file_system_win.cc │ │ ├── js_wrapper.h │ │ ├── macros.h │ │ ├── objc_utils.h │ │ ├── pseudo_singleton.h │ │ ├── shared_lock.cc │ │ ├── shared_lock.h │ │ ├── templates.h │ │ ├── utils.cc │ │ └── utils.h ├── test │ ├── main.cc │ ├── media │ │ ├── README.md │ │ ├── clear_high.mp4 │ │ ├── clear_high.mp4.dat │ │ ├── clear_low.mp4 │ │ ├── clear_low.webm │ │ ├── clear_low_frag_init.mp4 │ │ ├── clear_low_frag_init.mp4.dat │ │ ├── clear_low_frag_seg1.mp4 │ │ ├── clear_low_frag_seg1.mp4.dat │ │ ├── clear_low_hevc.mp4 │ │ ├── clear_low_hevc.mp4.dat │ │ ├── dash.mpd │ │ ├── encrypted_key_rotation.mp4 │ │ ├── encrypted_low.mp4 │ │ ├── encrypted_low.mp4.dat │ │ ├── encrypted_low.webm │ │ ├── encrypted_low_cbcs.mp4 │ │ ├── encrypted_low_cenc.mp4 │ │ ├── get_media_info.py │ │ ├── hash_file.txt │ │ └── hash_file_hevc.txt │ ├── src │ │ ├── core │ │ │ ├── ref_ptr_unittest.cc │ │ │ └── task_runner_unittest.cc │ │ ├── debug │ │ │ └── integration.cc │ │ ├── eme │ │ │ └── clearkey_implementation_unittest.cc │ │ ├── js │ │ │ └── idb │ │ │ │ └── sqlite_unittest.cc │ │ ├── media │ │ │ ├── audio_renderer_common_unittest.cc │ │ │ ├── decoder_integration.cc │ │ │ ├── demuxer_unittest.cc │ │ │ ├── media_tests.proto │ │ │ ├── media_utils_unittest.cc │ │ │ ├── pipeline_manager_unittest.cc │ │ │ ├── pipeline_monitor_unittest.cc │ │ │ ├── streams_unittest.cc │ │ │ └── video_renderer_common_unittest.cc │ │ ├── memory │ │ │ ├── heap_tracer_unittest.cc │ │ │ ├── object_tracker_integration.cc │ │ │ └── object_tracker_unittest.cc │ │ ├── public │ │ │ ├── player_integration.cc │ │ │ ├── shaka_utils_unittest.cc │ │ │ └── variant_unittest.cc │ │ ├── test │ │ │ ├── frame_converter.cc │ │ │ ├── frame_converter.h │ │ │ ├── global_fields.h │ │ │ ├── js_test_fixture.cc │ │ │ ├── js_test_fixture.h │ │ │ ├── media_files.h │ │ │ ├── media_files_ios.cc │ │ │ ├── media_files_other.cc │ │ │ ├── test_utils.h │ │ │ ├── v8_test.cc │ │ │ └── v8_test.h │ │ └── util │ │ │ ├── buffer_reader_unittest.cc │ │ │ ├── buffer_writer_unittest.cc │ │ │ ├── dynamic_buffer_unittest.cc │ │ │ ├── file_system_unittest.cc │ │ │ ├── shared_lock_unittest.cc │ │ │ └── utils_unittest.cc │ └── tests │ │ ├── _test_fixture.js │ │ ├── base64.js │ │ ├── dom.js │ │ ├── eme.js │ │ ├── events.js │ │ ├── idb.js │ │ ├── test_type.js │ │ ├── text_coding.js │ │ ├── timeouts.js │ │ ├── xml.js │ │ └── xml_http_request.js └── tools │ ├── abi_test.py │ ├── clang_tidy.py │ ├── embed_tests.py │ ├── embed_utils.py │ ├── embed_v8_snapshot.py │ ├── eme_plugin_build_info.py │ ├── gen_config_h.py │ ├── gen_eme_plugins.py │ ├── gen_info_plist.py │ ├── idl │ └── exposed_type_generator.py │ ├── make_license_file.py │ ├── parse_makefile.py │ ├── patch.py │ ├── presubmit.py │ ├── run_configure.py │ ├── run_ios_tests.py │ ├── touch.py │ ├── utils.py │ ├── version.py │ ├── version_test.py │ └── webidl │ ├── tests │ ├── __init__.py │ ├── arguments_test.py │ ├── defaults_test.py │ ├── dictionary_test.py │ ├── extensions_test.py │ ├── lexer_test.py │ ├── parser_test.py │ ├── test_common.py │ └── types_test.py │ └── webidl │ ├── __init__.py │ ├── lexer.py │ ├── parser.py │ └── types.py ├── test.py ├── third_party ├── SUMMARY.txt ├── boringssl │ ├── BUILD.gn │ └── LICENSE ├── curl │ ├── BUILD.gn │ ├── LICENSE │ ├── config │ │ ├── linux │ │ │ ├── curl_config.h │ │ │ └── find_curl_ca_bundle.py │ │ └── mac │ │ │ └── curl_config.h │ └── configure ├── doxygen │ └── LICENSE ├── extraLicenses.txt ├── ffmpeg │ ├── BUILD.gn │ ├── LICENSE │ ├── avformat.patch │ ├── mkv.patch │ ├── mkv_enc.patch │ ├── mov.patch │ ├── opus.patch │ └── utils.patch ├── gflags │ ├── BUILD.gn │ └── LICENSE ├── glog │ ├── BUILD.gn │ └── LICENSE ├── googletest │ ├── BUILD.gn │ └── LICENSE ├── jasmine │ ├── LICENSE │ ├── README.md │ ├── jasmine.js │ └── jasmine_boot.js ├── libxml │ ├── BUILD.gn │ └── LICENSE ├── licensePaths.txt ├── protobuf │ ├── BUILD.gn │ ├── LICENSE │ ├── protobuf.gni │ └── wrapper.py ├── pymake │ └── LICENSE ├── sdl2 │ ├── BUILD.gn │ └── LICENSE ├── styleguide │ └── LICENSE └── zlib │ ├── BUILD.gn │ ├── LICENSE │ └── zlib.h └── tools ├── cfi └── blacklist.txt ├── memory ├── asan │ └── blacklist.txt └── tsan_v2 │ └── ignores.txt └── ubsan ├── blacklist.txt └── vptr_blacklist.txt /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: Google 3 | AllowShortFunctionsOnASingleLine: Empty 4 | AllowShortIfStatementsOnASingleLine: false 5 | AllowShortLoopsOnASingleLine: false 6 | DerivePointerAlignment: false 7 | IndentPPDirectives: AfterHash 8 | MaxEmptyLinesToKeep: 2 9 | SpacesInContainerLiterals: false 10 | Standard: Cpp11 11 | --- 12 | Language: ObjC 13 | ColumnLimit: 100 14 | PointerAlignment: Right 15 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.dat binary 2 | -------------------------------------------------------------------------------- /.github/workflows/sync-labels.yaml: -------------------------------------------------------------------------------- 1 | # Install this in .github/workflows/ to automate label updates 2 | name: Sync Labels 3 | 4 | on: 5 | workflow_dispatch: 6 | # Allows for manual triggering. 7 | inputs: 8 | dry_run: 9 | description: "If true, don't make any actual changes" 10 | required: false 11 | default: false 12 | schedule: 13 | # Run every week on Sunday at 5:42 AM. 14 | - cron: '42 5 * * 0' 15 | 16 | jobs: 17 | sync-labels: 18 | runs-on: ubuntu-latest 19 | steps: 20 | - name: Checkout code 21 | uses: actions/checkout@v3 22 | with: 23 | repository: shaka-project/shaka-github-tools 24 | 25 | # TODO: revert to micnncim and new release after landing 26 | # https://github.com/micnncim/action-label-syncer/pull/68 27 | - uses: joeyparrish/action-label-syncer@v1.8.0 28 | with: 29 | dry_run: ${{ github.event.inputs.dry_run || false }} 30 | prune: true 31 | manifest: sync-labels/configs/${{ github.repository }}.yaml 32 | repository: ${{ github.repository }} 33 | token: ${{ github.token }} 34 | -------------------------------------------------------------------------------- /.github/workflows/update-issues.yaml: -------------------------------------------------------------------------------- 1 | # Install this in .github/workflows/ to automate issue maintenance. 2 | name: Update Issues 3 | 4 | on: 5 | workflow_dispatch: 6 | # Allows for manual triggering. 7 | schedule: 8 | # Run every 30 minutes 9 | - cron: '*/30 * * * *' 10 | 11 | permissions: 12 | issues: write 13 | pull-requests: write 14 | 15 | jobs: 16 | update-issues: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: Checkout code 20 | uses: actions/checkout@v3 21 | with: 22 | repository: shaka-project/shaka-github-tools 23 | 24 | - name: Update Issues 25 | env: 26 | # Use SHAKA_BOT_TOKEN if found, otherwise the default GITHUB_TOKEN. 27 | GITHUB_TOKEN: ${{ secrets.SHAKA_BOT_TOKEN || secrets.GITHUB_TOKEN }} 28 | run: | 29 | cd update-issues 30 | npm ci 31 | node main.js 32 | -------------------------------------------------------------------------------- /.github/workflows/validate-pr-title.yaml: -------------------------------------------------------------------------------- 1 | name: Validate PR Title 2 | 3 | on: 4 | # NOTE: The automated PRs from release-please-action do not seem to trigger 5 | # any of the default PR triggers (opened, synchronize, reopened). So we need 6 | # additional types. This is a good set that makes it easy to trigger the 7 | # workflow manually if needed. This is not neccessary if your release-please 8 | # workflow uses a personal access token (PAT) from Shaka Bot. 9 | pull_request_target: 10 | types: 11 | - opened 12 | - reopened 13 | - edited 14 | - synchronize 15 | - assigned 16 | - labeled 17 | - ready_for_review 18 | - review_requested 19 | 20 | jobs: 21 | main: 22 | name: Validate PR Title 23 | runs-on: ubuntu-latest 24 | steps: 25 | - uses: amannn/action-semantic-pull-request@v5 26 | env: 27 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /core 2 | *.pyc 3 | *_pb2.py 4 | *~ 5 | Makefile 6 | .DS_Store 7 | *.xcworkspace 8 | 9 | /.cipd 10 | /cipd.lock 11 | /buildtools/ 12 | 13 | /Doxyfile 14 | 15 | /third_party/boringssl/* 16 | !/third_party/boringssl/BUILD.gn 17 | !/third_party/boringssl/LICENSE 18 | !/third_party/boringssl/src 19 | 20 | /docs/ 21 | /out/ 22 | /third_party/doxygen/build/ 23 | /third_party/binutils 24 | /third_party/llvm-build/ 25 | 26 | /sample_xcode_project/*.framework/ 27 | /sample_xcode_project/sample_xcode_project.xcodeproj/xcshareddata/ 28 | /sample_xcode_project/sample_xcode_project.xcodeproj/xcuserdata/ 29 | -------------------------------------------------------------------------------- /.gn: -------------------------------------------------------------------------------- 1 | # Copyright 2016 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | buildconfig = "//build/config/BUILDCONFIG.gn" 16 | secondary_source = "//build/secondary" 17 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 (2020-05-27) 2 | 3 | First full release! Public API is stable from this point onward. 4 | 5 | New Features (not exhaustive): 6 | - Generic media pipeline allowing apps to replace media components 7 | - Offline storage and playback support 8 | - Use native AVPlayer for HLS 9 | - Controllable with `streaming.useNativeHlsOnSafari` configuration 10 | - Exposes the AVPlayer instance for app control 11 | - Don't use FFmpeg decoders to reduce binary size 12 | - Removes SDL to reduce binary size 13 | - Better Swift support 14 | - Network request/response filters 15 | - Playback of HEVC content 16 | - Honors sample aspect ratio (SAR) 17 | - Allow setting video fill mode 18 | 19 | 20 | ## 0.1.0-beta (2018-11-30) 21 | 22 | Initial beta launch! 23 | 24 | New Features (not exhaustive): 25 | - DASH and HLS playback 26 | - Adaptation support and manual stream switching 27 | - VOD and Live content 28 | - MP4 and WebM playback 29 | - With hardware acceleration on iOS with H.264 30 | - Encrypted media playback 31 | - Clear key built in 32 | - Plugin system for external DRM providers 33 | -------------------------------------------------------------------------------- /Doxyfile.in: -------------------------------------------------------------------------------- 1 | ## Copyright 2016 Google LLC 2 | ## 3 | ## Licensed under the Apache License, Version 2.0 (the "License"); 4 | ## you may not use this file except in compliance with the License. 5 | ## You may obtain a copy of the License at 6 | ## 7 | ## https://www.apache.org/licenses/LICENSE-2.0 8 | ## 9 | ## Unless required by applicable law or agreed to in writing, software 10 | ## distributed under the License is distributed on an "AS IS" BASIS, 11 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | ## See the License for the specific language governing permissions and 13 | ## limitations under the License. 14 | 15 | PROJECT_NAME = "Shaka Player Embedded" 16 | OUTPUT_DIRECTORY = docs 17 | INPUT = shaka/docs/ shaka/include/ shaka/src/ README.md {{EXTRA_PATH}} 18 | IMAGE_PATH = shaka/docs/ 19 | EXCLUDE_PATTERNS = *.idl 20 | USE_MDFILE_AS_MAINPAGE = README.md 21 | LAYOUT_FILE = shaka/docs/layout.xml 22 | GENERATE_LATEX = NO 23 | RECURSIVE = YES 24 | DISTRIBUTE_GROUP_DOC = YES 25 | EXTRACT_ALL = YES 26 | WARN_AS_ERROR = YES 27 | MACRO_EXPANSION = YES 28 | 29 | SOURCE_BROWSER = YES 30 | -------------------------------------------------------------------------------- /LICENSE.chromium: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Chromium Authors. All rights reserved. 2 | // 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are 5 | // met: 6 | // 7 | // * Redistributions of source code must retain the above copyright 8 | // notice, this list of conditions and the following disclaimer. 9 | // * Redistributions in binary form must reproduce the above 10 | // copyright notice, this list of conditions and the following disclaimer 11 | // in the documentation and/or other materials provided with the 12 | // distribution. 13 | // * Neither the name of Google Inc. nor the names of its 14 | // contributors may be used to endorse or promote products derived from 15 | // this software without specific prior written permission. 16 | // 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | -------------------------------------------------------------------------------- /Makefile.in: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | SOURCE_ROOT={{SOURCE_ROOT}} 16 | TARGET_OS={{TARGET_OS}} 17 | 18 | 19 | .PHONY: all 20 | all: shaka-player 21 | 22 | .PHONY: install 23 | install: 24 | @echo 'Installing is not supported yet'; exit 1 25 | 26 | .PHONY: clean 27 | clean: 28 | @python '$(SOURCE_ROOT)/build.py' --clean 29 | 30 | .PHONY: distclean 31 | distclean: clean 32 | rm -rf gen obj args.gn build.ninja build.ninja.d toolchain.ninja \ 33 | shaka-player.compiled.js Makefile 34 | 35 | # TODO: These should be changed to work with iOS/Android targets. 36 | .PHONY: run 37 | run: shaka-player 38 | './demo' $(ARGS) 39 | 40 | .PHONY: check 41 | check: 42 | @python '$(SOURCE_ROOT)/shaka/tools/presubmit.py' $(ARGS) 43 | 44 | .PHONY: test 45 | test: shaka-player 46 | @python '$(SOURCE_ROOT)/test.py' $(ARGS) 47 | 48 | .PHONY: shaka-player 49 | shaka-player: 50 | @python '$(SOURCE_ROOT)/build.py' 51 | 52 | .PHONY: docs 53 | docs: shaka-player 54 | @python '$(SOURCE_ROOT)/gen_docs.py' 55 | -------------------------------------------------------------------------------- /build_overrides/build.gni: -------------------------------------------------------------------------------- 1 | # Copyright 2016 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | mac_sdk_min_build_override = "10.7" 16 | mac_deployment_target_build_override = "10.7" 17 | use_system_xcode = true 18 | linux_use_bundled_binutils_override = true 19 | 20 | # Our binaries are not large, so ignore 32-bit limitations. 21 | ignore_elf32_limitations = true 22 | 23 | build_with_chromium = false 24 | -------------------------------------------------------------------------------- /build_overrides/gtest.gni: -------------------------------------------------------------------------------- 1 | # Copyright 2016 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Derived from: https://cs.chromium.org/chromium/src/build_overrides/gtest.gni 16 | 17 | # Exclude support for registering main function in multi-process tests. 18 | gtest_include_multiprocess = false 19 | 20 | # Exclude support for platform-specific operations across unit tests. 21 | gtest_include_platform_test = false 22 | 23 | # Exclude support for testing Objective C code on OS X and iOS. 24 | gtest_include_objc_support = false 25 | 26 | # Exclude support for flushing coverage files on iOS. 27 | gtest_include_ios_coverage = false 28 | -------------------------------------------------------------------------------- /cipd.ensure: -------------------------------------------------------------------------------- 1 | # Copyright 2019 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # CIPD ensure file, this describes the files that need to be downloaded and 16 | # their versions. These are pulled from the DEPS files from Chromium. 17 | # See https://godoc.org/go.chromium.org/luci/cipd/client/cipd/ensure 18 | 19 | $ServiceURL https://chrome-infra-packages.appspot.com/ 20 | $ParanoidMode CheckPresence 21 | 22 | # GN for Linux 23 | @Subdir buildtools/${os=linux}64 24 | gn/gn/linux-amd64 git_revision:ad9e442d92dcd9ee73a557428cfc336b55cbd533 25 | 26 | # GN for Mac 27 | @Subdir buildtools/${os=mac} 28 | gn/gn/mac-amd64 git_revision:ad9e442d92dcd9ee73a557428cfc336b55cbd533 29 | 30 | 31 | # dsymutil for Mac 32 | # TODO: Have this be conditional on Mac. 33 | @Subdir tools/clang/dsymutil 34 | chromium/llvm-build-tools/dsymutil M56jPzDv1620Rnm__jTMYS62Zi8rxHVq7yw0qeBFEgkC 35 | -------------------------------------------------------------------------------- /sample_xcode_project/README.md: -------------------------------------------------------------------------------- 1 | # Shaka Player Embedded Sample XCode Project 2 | 3 | This xcode project demonstrates how to use Shaka Player Embedded in an app. 4 | 5 | ### Credits 6 | 7 | The icons used in the UI come from the [Google Material Design icon catalog][]. 8 | 9 | [Google Material Design icon catalog]: https://material.io/tools/icons/ -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import 16 | 17 | @interface AppDelegate : UIResponder 18 | 19 | @property(strong, nonatomic) UIWindow *window; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import "AppDelegate.h" 16 | 17 | @interface AppDelegate () 18 | 19 | @end 20 | 21 | @implementation AppDelegate 22 | 23 | - (BOOL)application:(UIApplication *)application 24 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 25 | return YES; 26 | } 27 | 28 | - (void)applicationWillResignActive:(UIApplication *)application { 29 | } 30 | 31 | - (void)applicationDidEnterBackground:(UIApplication *)application { 32 | } 33 | 34 | - (void)applicationWillEnterForeground:(UIApplication *)application { 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | } 39 | 40 | - (void)applicationWillTerminate:(UIApplication *)application { 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/AssetSelectionTableViewController.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import 16 | 17 | @interface AssetSelectionTableViewController : UITableViewController 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/AppIcon.appiconset/Icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/AppIcon.appiconset/Icon-1024.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/AppIcon.appiconset/Icon-121.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/AppIcon.appiconset/Icon-121.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/AppIcon.appiconset/Icon-152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/AppIcon.appiconset/Icon-152.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/AppIcon.appiconset/Icon-167.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/AppIcon.appiconset/Icon-167.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/AppIcon.appiconset/Icon-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/AppIcon.appiconset/Icon-180.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/AppIcon.appiconset/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/AppIcon.appiconset/Icon-76.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/audio_only_1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "audio_only_1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/audio_only_1.imageset/audio_only_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/audio_only_1.imageset/audio_only_1.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/audio_only_2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "audio_only_2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/audio_only_2.imageset/audio_only_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/audio_only_2.imageset/audio_only_2.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/audio_only_3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "audio_only_3.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/audio_only_3.imageset/audio_only_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/audio_only_3.imageset/audio_only_3.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/audio_only_4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "audio_only_4.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/audio_only_4.imageset/audio_only_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/audio_only_4.imageset/audio_only_4.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_close_white_18pt.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "baseline_close_white_18pt_1x.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "baseline_close_white_18pt_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "baseline_close_white_18pt_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "template-rendering-intent": "template", 22 | "version": 1 23 | } 24 | } -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_close_white_18pt.imageset/baseline_close_white_18pt_1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_close_white_18pt.imageset/baseline_close_white_18pt_1x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_close_white_18pt.imageset/baseline_close_white_18pt_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_close_white_18pt.imageset/baseline_close_white_18pt_2x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_close_white_18pt.imageset/baseline_close_white_18pt_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_close_white_18pt.imageset/baseline_close_white_18pt_3x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_info_white_36pt.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "baseline_info_white_36pt_1x.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "baseline_info_white_36pt_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "baseline_info_white_36pt_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "template-rendering-intent": "template", 22 | "version": 1 23 | } 24 | } -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_info_white_36pt.imageset/baseline_info_white_36pt_1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_info_white_36pt.imageset/baseline_info_white_36pt_1x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_info_white_36pt.imageset/baseline_info_white_36pt_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_info_white_36pt.imageset/baseline_info_white_36pt_2x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_info_white_36pt.imageset/baseline_info_white_36pt_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_info_white_36pt.imageset/baseline_info_white_36pt_3x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_language_white_18pt.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "baseline_language_white_18pt_1x.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "baseline_language_white_18pt_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "baseline_language_white_18pt_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "template-rendering-intent": "template", 22 | "version": 1 23 | } 24 | } -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_language_white_18pt.imageset/baseline_language_white_18pt_1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_language_white_18pt.imageset/baseline_language_white_18pt_1x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_language_white_18pt.imageset/baseline_language_white_18pt_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_language_white_18pt.imageset/baseline_language_white_18pt_2x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_language_white_18pt.imageset/baseline_language_white_18pt_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_language_white_18pt.imageset/baseline_language_white_18pt_3x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_more_vert_white_18pt.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "baseline_more_vert_white_18pt_1x.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "baseline_more_vert_white_18pt_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "baseline_more_vert_white_18pt_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "template-rendering-intent": "template", 22 | "version": 1 23 | } 24 | } -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_more_vert_white_18pt.imageset/baseline_more_vert_white_18pt_1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_more_vert_white_18pt.imageset/baseline_more_vert_white_18pt_1x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_more_vert_white_18pt.imageset/baseline_more_vert_white_18pt_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_more_vert_white_18pt.imageset/baseline_more_vert_white_18pt_2x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_more_vert_white_18pt.imageset/baseline_more_vert_white_18pt_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_more_vert_white_18pt.imageset/baseline_more_vert_white_18pt_3x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_settings_white_36pt.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "baseline_settings_white_36pt_1x.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "baseline_settings_white_36pt_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "baseline_settings_white_36pt_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "template-rendering-intent": "template", 22 | "version": 1 23 | } 24 | } -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_settings_white_36pt.imageset/baseline_settings_white_36pt_1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_settings_white_36pt.imageset/baseline_settings_white_36pt_1x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_settings_white_36pt.imageset/baseline_settings_white_36pt_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_settings_white_36pt.imageset/baseline_settings_white_36pt_2x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_settings_white_36pt.imageset/baseline_settings_white_36pt_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_settings_white_36pt.imageset/baseline_settings_white_36pt_3x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_video_library_white_36pt.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "baseline_video_library_white_36pt_1x.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "baseline_video_library_white_36pt_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "baseline_video_library_white_36pt_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "template-rendering-intent": "template", 22 | "version": 1 23 | } 24 | } -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_video_library_white_36pt.imageset/baseline_video_library_white_36pt_1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_video_library_white_36pt.imageset/baseline_video_library_white_36pt_1x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_video_library_white_36pt.imageset/baseline_video_library_white_36pt_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_video_library_white_36pt.imageset/baseline_video_library_white_36pt_2x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_video_library_white_36pt.imageset/baseline_video_library_white_36pt_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/baseline_video_library_white_36pt.imageset/baseline_video_library_white_36pt_3x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_closed_caption_white_18pt.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "ic_closed_caption_white_18pt.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "ic_closed_caption_white_18pt_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "ic_closed_caption_white_18pt_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "version": 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_closed_caption_white_18pt.imageset/ic_closed_caption_white_18pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_closed_caption_white_18pt.imageset/ic_closed_caption_white_18pt.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_closed_caption_white_18pt.imageset/ic_closed_caption_white_18pt_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_closed_caption_white_18pt.imageset/ic_closed_caption_white_18pt_2x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_closed_caption_white_18pt.imageset/ic_closed_caption_white_18pt_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_closed_caption_white_18pt.imageset/ic_closed_caption_white_18pt_3x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_pause_white_18pt.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "ic_pause_white_18pt.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "ic_pause_white_18pt_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "ic_pause_white_18pt_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "version": 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_pause_white_18pt.imageset/ic_pause_white_18pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_pause_white_18pt.imageset/ic_pause_white_18pt.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_pause_white_18pt.imageset/ic_pause_white_18pt_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_pause_white_18pt.imageset/ic_pause_white_18pt_2x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_pause_white_18pt.imageset/ic_pause_white_18pt_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_pause_white_18pt.imageset/ic_pause_white_18pt_3x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_play_arrow_white_18pt.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "ic_play_arrow_white_18pt.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "ic_play_arrow_white_18pt_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "ic_play_arrow_white_18pt_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "version": 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_play_arrow_white_18pt.imageset/ic_play_arrow_white_18pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_play_arrow_white_18pt.imageset/ic_play_arrow_white_18pt.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_play_arrow_white_18pt.imageset/ic_play_arrow_white_18pt_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_play_arrow_white_18pt.imageset/ic_play_arrow_white_18pt_2x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_play_arrow_white_18pt.imageset/ic_play_arrow_white_18pt_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_play_arrow_white_18pt.imageset/ic_play_arrow_white_18pt_3x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_replay_white_18pt.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "filename": "ic_replay_white_18pt.png", 5 | "idiom": "universal", 6 | "scale": "1x" 7 | }, 8 | { 9 | "filename": "ic_replay_white_18pt_2x.png", 10 | "idiom": "universal", 11 | "scale": "2x" 12 | }, 13 | { 14 | "filename": "ic_replay_white_18pt_3x.png", 15 | "idiom": "universal", 16 | "scale": "3x" 17 | } 18 | ], 19 | "info": { 20 | "author": "xcode", 21 | "version": 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_replay_white_18pt.imageset/ic_replay_white_18pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_replay_white_18pt.imageset/ic_replay_white_18pt.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_replay_white_18pt.imageset/ic_replay_white_18pt_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_replay_white_18pt.imageset/ic_replay_white_18pt_2x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_replay_white_18pt.imageset/ic_replay_white_18pt_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/ic_replay_white_18pt.imageset/ic_replay_white_18pt_3x.png -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/poster.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "poster.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Assets.xcassets/poster.imageset/poster.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/sample_xcode_project/sample_xcode_project/Assets.xcassets/poster.imageset/poster.jpg -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/ConfigTableValue.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import 16 | 17 | typedef enum { 18 | kConfigTableValueTypeString, 19 | kConfigTableValueTypeBool, 20 | kConfigTableValueTypeNumber 21 | } ConfigTableValueType; 22 | 23 | @interface ConfigTableValue : NSObject 24 | 25 | @property NSString *name; 26 | @property NSString *path; 27 | @property ConfigTableValueType type; 28 | @property NSString *valueString; 29 | @property NSNumber *valueNumber; 30 | @property NSInteger tag; 31 | @property float min; 32 | @property float max; 33 | 34 | - (instancetype)init; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/ConfigTableValue.m: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import "ConfigTableValue.h" 16 | 17 | @implementation ConfigTableValue 18 | 19 | - (instancetype)init { 20 | if (self = [super init]) { 21 | self.name = @""; 22 | self.path = @""; 23 | self.type = kConfigTableValueTypeString; 24 | self.valueString = @""; 25 | self.valueNumber = @0; 26 | self.tag = 0; 27 | self.min = 0; 28 | self.max = 0; 29 | } 30 | return self; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/ConfigTableViewController.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import 16 | 17 | @interface ConfigTableViewController : UITableViewController 18 | 19 | + (void)setup; 20 | + (NSDictionary *)getConfigurations; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/ErrorDisplayView.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import 16 | 17 | @interface ErrorDisplayView : UIView 18 | 19 | - (void)applyError:(NSString *)error; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | ${DEVELOPMENT_LANGUAGE} 7 | CFBundleDisplayName 8 | Shaka Player 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | ${IOS_BUNDLE_ID_PREFIX}.${EXECUTABLE_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/LicenseTableViewController.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import 16 | 17 | @interface LicenseTableViewController : UITableViewController 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/LicenseViewController.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import 16 | 17 | @interface LicenseViewController : UIViewController 18 | 19 | @property NSString *license; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/LicenseViewController.m: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import "LicenseViewController.h" 16 | #import "NSObject+ShakaLayoutHelpers.h" 17 | 18 | @implementation LicenseViewController 19 | 20 | - (void)viewWillAppear:(BOOL)animated { 21 | [super viewWillAppear:animated]; 22 | 23 | UITextView *textView = [[UITextView alloc] init]; 24 | textView.text = self.license; 25 | textView.editable = NO; 26 | [self.view addSubview:textView]; 27 | 28 | // Place autolayout constraints on views. 29 | NSDictionary *views = @{ @"t" : textView }; 30 | [self shaka_constraint:@"|-0-[t]-0-|" onViews:views]; 31 | [self shaka_constraint:@"V:|-0-[t]-0-|" onViews:views]; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/PlayerViewController.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import 16 | 17 | @interface PlayerViewController : UIViewController 18 | 19 | @property NSString *assetURI; 20 | @property NSDictionary *configuration; 21 | 22 | + (NSString *)getShakaPlayerVersion; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/ProgressAndBufferedSlider.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import 16 | 17 | typedef void (^ProgressAndBufferedSliderActiveChangedBlock)(BOOL); 18 | 19 | @interface ProgressAndBufferedSlider : UIControl 20 | 21 | /** Whether the slider is currently being interacted with. */ 22 | @property BOOL active; 23 | 24 | /** Whether the presentation is live or not. */ 25 | @property BOOL isLive; 26 | 27 | /** A block that is called whenever active changes. */ 28 | @property ProgressAndBufferedSliderActiveChangedBlock activeChangedBlock; 29 | 30 | /** The main (progress) value of the control. */ 31 | @property (readonly) double value; 32 | 33 | /** Sets the start and duration of the presentation. */ 34 | - (void)setStart:(double)start andDuration:(double)duration; 35 | 36 | /** Sets the state of the sub-sliders as appropriate, based on the video's state. */ 37 | - (void)setProgress:(double)progress 38 | bufferedStart:(double)bufferedStart 39 | andBufferedEnd:(double)bufferedEnd; 40 | 41 | /** Synchronizes the sub-sliders to the state of the nub. Meant to be used while seeking. */ 42 | - (void)synchronize; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /sample_xcode_project/sample_xcode_project/main.m: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #import 16 | #import "AppDelegate.h" 17 | 18 | int main(int argc, char* argv[]) { 19 | @autoreleasepool { 20 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /shaka/demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleVersion 6 | 1.0 7 | CFBundleSignature 8 | ???? 9 | CFBundlePackageType 10 | APPL 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleIdentifier 14 | ${IOS_BUNDLE_ID_PREFIX}.${EXECUTABLE_NAME:rfc1034identifier} 15 | CFBundleExecutable 16 | ${EXECUTABLE_NAME} 17 | CFBundleDevelopmentRegion 18 | English 19 | 20 | 21 | -------------------------------------------------------------------------------- /shaka/docs/layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /shaka/docs/tutorial-add-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/docs/tutorial-add-file.png -------------------------------------------------------------------------------- /shaka/docs/tutorial-disable-bitcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/docs/tutorial-disable-bitcode.png -------------------------------------------------------------------------------- /shaka/docs/tutorial-embed-binaries-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/docs/tutorial-embed-binaries-1.png -------------------------------------------------------------------------------- /shaka/docs/tutorial-embed-binaries-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/docs/tutorial-embed-binaries-2.png -------------------------------------------------------------------------------- /shaka/docs/tutorial-search-paths.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/docs/tutorial-search-paths.png -------------------------------------------------------------------------------- /shaka/include/shaka/ShakaPlayerView.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_SHAKA_PLAYER_VIEW_H_ 16 | #define SHAKA_EMBEDDED_SHAKA_PLAYER_VIEW_H_ 17 | 18 | #import 19 | #import 20 | 21 | #include "ShakaPlayer.h" 22 | #include "macros.h" 23 | 24 | NS_ASSUME_NONNULL_BEGIN 25 | 26 | /** 27 | * A view that displays the video frames from an ShakaPlayer object. 28 | * 29 | * @ingroup player 30 | */ 31 | SHAKA_EXPORT 32 | @interface ShakaPlayerView : UIView 33 | 34 | // No need to override "init" since UIView's will call "initWithFrame:". 35 | - (instancetype)initWithFrame:(CGRect)frame; 36 | - (instancetype)initWithCoder:(NSCoder *)coder; 37 | - (instancetype)initWithPlayer:(nullable ShakaPlayer *)player; 38 | 39 | /** Gets/sets the ShakaPlayer instance to draw. */ 40 | @property(atomic, nullable) ShakaPlayer *player; 41 | 42 | /** Sets how to resize the video frame within the view. */ 43 | - (void)setVideoGravity:(AVLayerVideoGravity)videoGravity; 44 | 45 | @end 46 | 47 | NS_ASSUME_NONNULL_END 48 | #endif // SHAKA_EMBEDDED_SHAKA_PLAYER_VIEW_H_ 49 | -------------------------------------------------------------------------------- /shaka/include/shaka/media/apple_audio_renderer.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_MEDIA_APPLE_AUDIO_RENDERER_H_ 16 | #define SHAKA_EMBEDDED_MEDIA_APPLE_AUDIO_RENDERER_H_ 17 | 18 | #include 19 | #include 20 | 21 | #include "../macros.h" 22 | #include "renderer.h" 23 | 24 | namespace shaka { 25 | namespace media { 26 | 27 | /** 28 | * Defines an audio renderer that renders frames using AudioToolbox. 29 | * 30 | * @ingroup media 31 | */ 32 | class SHAKA_EXPORT AppleAudioRenderer final : public AudioRenderer { 33 | public: 34 | AppleAudioRenderer(); 35 | ~AppleAudioRenderer() override; 36 | 37 | void SetPlayer(const MediaPlayer* player) override; 38 | void Attach(const DecodedStream* stream) override; 39 | void Detach() override; 40 | 41 | double Volume() const override; 42 | void SetVolume(double volume) override; 43 | bool Muted() const override; 44 | void SetMuted(bool muted) override; 45 | 46 | private: 47 | class Impl; 48 | std::unique_ptr impl_; 49 | }; 50 | 51 | } // namespace media 52 | } // namespace shaka 53 | 54 | #endif // SHAKA_EMBEDDED_MEDIA_APPLE_AUDIO_RENDERER_H_ 55 | -------------------------------------------------------------------------------- /shaka/src/core/environment.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_CORE_ENVIRONMENT_H_ 16 | #define SHAKA_EMBEDDED_CORE_ENVIRONMENT_H_ 17 | 18 | #include 19 | 20 | namespace shaka { 21 | 22 | /** 23 | * Manages the JavaScript global environment. This installs functions and 24 | * global objects like Navigator, XMLHttpRequest, and MediaSource. This also 25 | * holds the factories used to create instances. This object must live as long 26 | * as the JavaScript engine is being used. 27 | */ 28 | class Environment { 29 | public: 30 | Environment(); 31 | ~Environment(); 32 | 33 | /** Populates the global environment into the current V8 isolate. */ 34 | void Install(); 35 | 36 | private: 37 | struct Impl; 38 | std::unique_ptr impl_; 39 | }; 40 | 41 | } // namespace shaka 42 | 43 | #endif // SHAKA_EMBEDDED_CORE_ENVIRONMENT_H_ 44 | -------------------------------------------------------------------------------- /shaka/src/debug/thread.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/debug/thread.h" 16 | 17 | #include 18 | 19 | #include 20 | 21 | #include "src/debug/waiting_tracker.h" 22 | #include "src/util/utils.h" 23 | 24 | namespace shaka { 25 | 26 | namespace { 27 | 28 | void ThreadMain(const std::string& name, std::function callback) { 29 | #if defined(OS_MAC) || defined(OS_IOS) 30 | pthread_setname_np(name.c_str()); 31 | #elif defined(OS_POSIX) 32 | pthread_setname_np(pthread_self(), name.c_str()); 33 | #else 34 | # error "Not implemented for Windows" 35 | #endif 36 | 37 | #ifdef DEBUG_DEADLOCKS 38 | util::Finally scope(&WaitingTracker::ThreadExit); 39 | #endif 40 | callback(); 41 | } 42 | 43 | } // namespace 44 | 45 | Thread::Thread(const std::string& name, std::function callback) 46 | : name_(name), thread_(&ThreadMain, name, std::move(callback)) { 47 | DCHECK_LT(name.size(), 16u) << "Name too long: " << name; 48 | #ifdef DEBUG_DEADLOCKS 49 | original_id_ = thread_.get_id(); 50 | WaitingTracker::AddThread(this); 51 | #endif 52 | } 53 | 54 | Thread::~Thread() { 55 | DCHECK(!thread_.joinable()); 56 | #ifdef DEBUG_DEADLOCKS 57 | WaitingTracker::RemoveThread(this); 58 | #endif 59 | } 60 | 61 | } // namespace shaka 62 | -------------------------------------------------------------------------------- /shaka/src/debug/thread_event.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/debug/thread_event.h" 16 | 17 | #include "src/debug/thread.h" 18 | 19 | namespace shaka { 20 | 21 | ThreadEventBase::ThreadEventBase(const std::string& name) 22 | : Waitable(name), provider_(nullptr) {} 23 | 24 | ThreadEventBase::~ThreadEventBase() {} 25 | 26 | std::thread::id ThreadEventBase::GetProvider() const { 27 | Thread* thread = provider_.load(std::memory_order_acquire); 28 | if (thread && thread->get_id() == std::thread::id()) { 29 | // Once a thread exits, its thread id gets reset. 30 | LOG(FATAL) << "Waiting on an event whose provider thread has exited: " 31 | << name(); 32 | } 33 | return thread ? thread->get_id() : std::thread::id(); 34 | } 35 | 36 | } // namespace shaka 37 | -------------------------------------------------------------------------------- /shaka/src/debug/waitable.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/debug/waitable.h" 16 | 17 | #include "src/debug/waiting_tracker.h" 18 | 19 | namespace shaka { 20 | 21 | Waitable::Waitable(const std::string& name) : name_(name) {} 22 | 23 | Waitable::~Waitable() { 24 | #ifdef DEBUG_DEADLOCKS 25 | WaitingTracker::RemoveWaitable(this); 26 | #endif 27 | } 28 | 29 | } // namespace shaka 30 | -------------------------------------------------------------------------------- /shaka/src/debug/waitable.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_DEBUG_WAITABLE_H_ 16 | #define SHAKA_EMBEDDED_DEBUG_WAITABLE_H_ 17 | 18 | #include 19 | #include 20 | 21 | namespace shaka { 22 | 23 | class Thread; 24 | 25 | /** 26 | * The base class for objects that a thread can wait on. These represent 27 | * resources that a thread needs to block for another thread to provide. This 28 | * can be an explicit event (like a seek event) or it could be a lock that 29 | * another thread needs to release. 30 | */ 31 | class Waitable { 32 | public: 33 | explicit Waitable(const std::string& name); 34 | virtual ~Waitable(); 35 | 36 | /** @return The name of this thing, used for debugging. */ 37 | std::string name() const { 38 | return name_; 39 | } 40 | 41 | /** 42 | * @return The thread that will be providing the thing. This can return 43 | * id() if it is unknown. 44 | */ 45 | virtual std::thread::id GetProvider() const = 0; 46 | 47 | private: 48 | const std::string name_; 49 | }; 50 | 51 | } // namespace shaka 52 | 53 | #endif // SHAKA_EMBEDDED_DEBUG_WAITABLE_H_ 54 | -------------------------------------------------------------------------------- /shaka/src/eme/clearkey.json: -------------------------------------------------------------------------------- 1 | { 2 | "implementations": [ 3 | { 4 | "factory_type": "shaka::eme::ClearKeyImplementationFactory", 5 | "header": "clearkey_implementation_factory.h", 6 | "key_system": "org.w3.clearkey" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /shaka/src/eme/implementation.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "shaka/eme/implementation.h" 16 | 17 | #include "shaka/eme/implementation_factory.h" 18 | #include "shaka/eme/implementation_helper.h" 19 | 20 | namespace shaka { 21 | namespace eme { 22 | 23 | // \cond Doxygen_Skip 24 | Implementation::Implementation() {} 25 | Implementation::~Implementation() {} 26 | 27 | ImplementationFactory::ImplementationFactory() {} 28 | ImplementationFactory::~ImplementationFactory() {} 29 | 30 | ImplementationHelper::ImplementationHelper() {} 31 | ImplementationHelper::~ImplementationHelper() {} 32 | // \endcond Doxygen_Skip 33 | 34 | } // namespace eme 35 | } // namespace shaka 36 | -------------------------------------------------------------------------------- /shaka/src/js/base_64.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_JS_BASE_64_H_ 16 | #define SHAKA_EMBEDDED_JS_BASE_64_H_ 17 | 18 | #include 19 | 20 | #include "src/mapping/byte_string.h" 21 | #include "src/mapping/exception_or.h" 22 | 23 | namespace shaka { 24 | namespace js { 25 | 26 | class Base64 { 27 | public: 28 | static void Install(); 29 | 30 | static std::string Encode(ByteString input); 31 | static ExceptionOr Decode(const std::string& input); 32 | 33 | static std::string EncodeUrl(ByteString input); 34 | static ExceptionOr DecodeUrl(const std::string& input); 35 | }; 36 | 37 | } // namespace js 38 | } // namespace shaka 39 | 40 | #endif // SHAKA_EMBEDDED_JS_BASE_64_H_ 41 | -------------------------------------------------------------------------------- /shaka/src/js/debug.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/js/debug.h" 16 | 17 | #include 18 | #include 19 | 20 | namespace shaka { 21 | namespace js { 22 | 23 | Debug::Debug() {} 24 | // \cond Doxygen_Skip 25 | Debug::~Debug() {} 26 | // \endcond Doxygen_Skip 27 | 28 | std::string Debug::InternalTypeName(RefPtr object) { 29 | return object->factory()->name(); 30 | } 31 | 32 | std::string Debug::IndirectBases(RefPtr object) { 33 | std::string ret; 34 | const BackingObjectFactoryBase* ptr = object->factory(); 35 | while (ptr) { 36 | if (!ret.empty()) 37 | ret.append(", "); 38 | ret.append(ptr->name()); 39 | ptr = ptr->base(); 40 | } 41 | return ret; 42 | } 43 | 44 | void Debug::Sleep(uint64_t delay_ms) { 45 | std::this_thread::sleep_for(std::chrono::microseconds(delay_ms)); 46 | } 47 | 48 | 49 | DebugFactory::DebugFactory() { 50 | AddStaticFunction("internalTypeName", &Debug::InternalTypeName); 51 | AddStaticFunction("indirectBases", &Debug::IndirectBases); 52 | AddStaticFunction("sleep", &Debug::Sleep); 53 | } 54 | 55 | 56 | } // namespace js 57 | } // namespace shaka 58 | -------------------------------------------------------------------------------- /shaka/src/js/debug.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_JS_DEBUG_H_ 16 | #define SHAKA_EMBEDDED_JS_DEBUG_H_ 17 | 18 | #include 19 | 20 | #include "src/core/ref_ptr.h" 21 | #include "src/mapping/backing_object.h" 22 | #include "src/mapping/backing_object_factory.h" 23 | 24 | namespace shaka { 25 | namespace js { 26 | 27 | /** 28 | * Defines a number of internal, project-specific JavaScript methods used to 29 | * help debug the project. 30 | */ 31 | class Debug : public BackingObject { 32 | DECLARE_TYPE_INFO(Debug); 33 | 34 | public: 35 | Debug(); 36 | 37 | static std::string InternalTypeName(RefPtr object); 38 | static std::string IndirectBases(RefPtr object); 39 | 40 | static void Sleep(uint64_t delay_ms); 41 | }; 42 | 43 | class DebugFactory : public BackingObjectFactory { 44 | public: 45 | DebugFactory(); 46 | }; 47 | 48 | } // namespace js 49 | } // namespace shaka 50 | 51 | #endif // SHAKA_EMBEDDED_JS_DEBUG_H_ 52 | -------------------------------------------------------------------------------- /shaka/src/js/dom/character_data.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/js/dom/character_data.h" 16 | 17 | #include "src/js/dom/document.h" 18 | #include "src/js/js_error.h" 19 | #include "src/util/utils.h" 20 | 21 | namespace shaka { 22 | namespace js { 23 | namespace dom { 24 | 25 | CharacterData::CharacterData(NodeType type, RefPtr document) 26 | : Node(type, document) {} 27 | 28 | CharacterData::CharacterData(NodeType type, RefPtr document, 29 | const std::string& data) 30 | : Node(type, document), data_(data) {} 31 | 32 | // \cond Doxygen_Skip 33 | CharacterData::~CharacterData() {} 34 | // \endcond Doxygen_Skip 35 | 36 | optional CharacterData::NodeValue() const { 37 | return data_; 38 | } 39 | 40 | optional CharacterData::TextContent() const { 41 | return data_; 42 | } 43 | 44 | void CharacterData::SetData(const std::string& data) { 45 | data_ = data; 46 | } 47 | 48 | 49 | CharacterDataFactory::CharacterDataFactory() { 50 | AddGenericProperty("data", &CharacterData::data, &CharacterData::SetData); 51 | AddGenericProperty("length", &CharacterData::length); 52 | } 53 | 54 | } // namespace dom 55 | } // namespace js 56 | } // namespace shaka 57 | -------------------------------------------------------------------------------- /shaka/src/js/dom/comment.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/js/dom/comment.h" 16 | 17 | #include "src/js/dom/document.h" 18 | 19 | namespace shaka { 20 | namespace js { 21 | namespace dom { 22 | 23 | Comment::Comment(RefPtr document, const std::string& data) 24 | : CharacterData(COMMENT_NODE, document, data) {} 25 | 26 | // \cond Doxygen_Skip 27 | Comment::~Comment() {} 28 | // \endcond Doxygen_Skip 29 | 30 | std::string Comment::node_name() const { 31 | return "#comment"; 32 | } 33 | 34 | CommentFactory::CommentFactory() {} 35 | 36 | } // namespace dom 37 | } // namespace js 38 | } // namespace shaka 39 | -------------------------------------------------------------------------------- /shaka/src/js/dom/comment.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_JS_DOM_COMMENT_H_ 16 | #define SHAKA_EMBEDDED_JS_DOM_COMMENT_H_ 17 | 18 | #include 19 | 20 | #include "src/core/ref_ptr.h" 21 | #include "src/js/dom/character_data.h" 22 | 23 | namespace shaka { 24 | namespace js { 25 | namespace dom { 26 | 27 | /** 28 | * Implements the Comment interface for DOM. 29 | * https://dom.spec.whatwg.org/#comment 30 | */ 31 | class Comment : public CharacterData { 32 | DECLARE_TYPE_INFO(Comment); 33 | 34 | public: 35 | Comment(RefPtr document, const std::string& data); 36 | 37 | std::string node_name() const override; 38 | }; 39 | 40 | class CommentFactory : public BackingObjectFactory { 41 | public: 42 | CommentFactory(); 43 | }; 44 | 45 | } // namespace dom 46 | } // namespace js 47 | } // namespace shaka 48 | 49 | #endif // SHAKA_EMBEDDED_JS_DOM_COMMENT_H_ 50 | -------------------------------------------------------------------------------- /shaka/src/js/dom/dom_parser.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/js/dom/dom_parser.h" 16 | 17 | #include "src/js/dom/document.h" 18 | #include "src/js/dom/xml_document_parser.h" 19 | #include "src/js/js_error.h" 20 | #include "src/util/utils.h" 21 | 22 | namespace shaka { 23 | namespace js { 24 | namespace dom { 25 | 26 | DOMParser::DOMParser() {} 27 | // \cond Doxygen_Skip 28 | DOMParser::~DOMParser() {} 29 | // \endcond Doxygen_Skip 30 | 31 | ExceptionOr> DOMParser::ParseFromString( 32 | const std::string& source, const std::string& type) const { 33 | const std::string type_lower = util::ToAsciiLower(type); 34 | if (type_lower == "text/xml" || type_lower == "application/xml") { 35 | RefPtr ret = new Document(); 36 | XMLDocumentParser parser(ret); 37 | return parser.Parse(source); 38 | } 39 | 40 | return JsError::TypeError("Unsupported parse type " + type); 41 | } 42 | 43 | 44 | DOMParserFactory::DOMParserFactory() { 45 | AddMemberFunction("parseFromString", &DOMParser::ParseFromString); 46 | } 47 | 48 | } // namespace dom 49 | } // namespace js 50 | } // namespace shaka 51 | -------------------------------------------------------------------------------- /shaka/src/js/dom/dom_string_list.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/js/dom/dom_string_list.h" 16 | 17 | namespace shaka { 18 | namespace js { 19 | namespace dom { 20 | 21 | DOMStringList::DOMStringList() {} 22 | DOMStringList::DOMStringList(const std::vector& copy) 23 | : std::vector(copy) {} 24 | // \cond Doxygen_Skip 25 | DOMStringList::~DOMStringList() {} 26 | // \endcond Doxygen_Skip 27 | 28 | optional DOMStringList::item(uint32_t index) const { 29 | if (index >= size()) 30 | return nullopt; 31 | return (*this)[index]; 32 | } 33 | 34 | bool DOMStringList::getter(size_t index, std::string* value) const { 35 | if (index >= size()) 36 | return false; 37 | *value = (*this)[index]; 38 | return true; 39 | } 40 | 41 | bool DOMStringList::contains(const std::string& item) const { 42 | return util::contains(*this, item); 43 | } 44 | 45 | 46 | DOMStringListFactory::DOMStringListFactory() { 47 | AddIndexer(&DOMStringList::getter); 48 | 49 | AddGenericProperty("length", &DOMStringList::size); 50 | 51 | AddMemberFunction("item", &DOMStringList::item); 52 | AddMemberFunction("contains", &DOMStringList::contains); 53 | } 54 | 55 | } // namespace dom 56 | } // namespace js 57 | } // namespace shaka 58 | -------------------------------------------------------------------------------- /shaka/src/js/dom/dom_string_list.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_JS_DOM_DOM_STRING_LIST_H_ 16 | #define SHAKA_EMBEDDED_JS_DOM_DOM_STRING_LIST_H_ 17 | 18 | #include 19 | #include 20 | 21 | #include "shaka/optional.h" 22 | #include "src/mapping/backing_object.h" 23 | #include "src/mapping/backing_object_factory.h" 24 | 25 | namespace shaka { 26 | namespace js { 27 | namespace dom { 28 | 29 | class DOMStringList : public BackingObject, public std::vector { 30 | DECLARE_TYPE_INFO(DOMStringList); 31 | 32 | public: 33 | DOMStringList(); 34 | explicit DOMStringList(const std::vector& copy); 35 | 36 | optional item(uint32_t index) const; 37 | bool getter(size_t index, std::string* value) const; 38 | 39 | bool contains(const std::string& item) const; 40 | }; 41 | 42 | class DOMStringListFactory : public BackingObjectFactory { 43 | public: 44 | DOMStringListFactory(); 45 | }; 46 | 47 | } // namespace dom 48 | } // namespace js 49 | } // namespace shaka 50 | 51 | #endif // SHAKA_EMBEDDED_JS_DOM_DOM_STRING_LIST_H_ 52 | -------------------------------------------------------------------------------- /shaka/src/js/dom/text.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/js/dom/text.h" 16 | 17 | #include 18 | 19 | #include "src/js/dom/container_node.h" 20 | #include "src/js/dom/document.h" 21 | 22 | namespace shaka { 23 | namespace js { 24 | namespace dom { 25 | 26 | Text::Text(RefPtr document, const std::string& data) 27 | : CharacterData(TEXT_NODE, document, data) {} 28 | 29 | // \cond Doxygen_Skip 30 | Text::~Text() {} 31 | // \endcond Doxygen_Skip 32 | 33 | std::string Text::node_name() const { 34 | return "#text"; 35 | } 36 | 37 | 38 | TextFactory::TextFactory() { 39 | NotImplemented("splitText"); 40 | NotImplemented("wholeText"); 41 | } 42 | 43 | } // namespace dom 44 | } // namespace js 45 | } // namespace shaka 46 | -------------------------------------------------------------------------------- /shaka/src/js/dom/text.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_JS_DOM_TEXT_H_ 16 | #define SHAKA_EMBEDDED_JS_DOM_TEXT_H_ 17 | 18 | #include 19 | 20 | #include "src/core/ref_ptr.h" 21 | #include "src/js/dom/character_data.h" 22 | 23 | namespace shaka { 24 | namespace js { 25 | namespace dom { 26 | 27 | /** 28 | * Implements the Text interface for DOM. 29 | * https://dom.spec.whatwg.org/#text 30 | */ 31 | class Text : public CharacterData { 32 | DECLARE_TYPE_INFO(Text); 33 | 34 | public: 35 | Text(RefPtr document, const std::string& data); 36 | 37 | std::string node_name() const override; 38 | }; 39 | 40 | class TextFactory : public BackingObjectFactory { 41 | public: 42 | TextFactory(); 43 | }; 44 | 45 | } // namespace dom 46 | } // namespace js 47 | } // namespace shaka 48 | 49 | #endif // SHAKA_EMBEDDED_JS_DOM_TEXT_H_ 50 | -------------------------------------------------------------------------------- /shaka/src/js/eme/implementation_registry.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "shaka/eme/implementation_registry.h" 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | #include "src/util/macros.h" 23 | 24 | namespace shaka { 25 | namespace eme { 26 | 27 | namespace { 28 | 29 | BEGIN_ALLOW_COMPLEX_STATICS 30 | std::unordered_map> 31 | factories_; 32 | std::mutex mutex_; 33 | END_ALLOW_COMPLEX_STATICS 34 | 35 | } // namespace 36 | 37 | void ImplementationRegistry::AddImplementation( 38 | const std::string& key_system, 39 | std::shared_ptr factory) { 40 | std::unique_lock lock(mutex_); 41 | const auto it = factories_.find(key_system); 42 | if (it != factories_.end()) 43 | it->second = factory; 44 | else 45 | factories_.emplace(key_system, factory); 46 | } 47 | 48 | std::shared_ptr 49 | ImplementationRegistry::GetImplementation(const std::string& key_system) { 50 | std::unique_lock lock(mutex_); 51 | auto it = factories_.find(key_system); 52 | return it != factories_.end() ? it->second : nullptr; 53 | } 54 | 55 | } // namespace eme 56 | } // namespace shaka 57 | -------------------------------------------------------------------------------- /shaka/src/js/eme/media_key_system_configuration.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/js/eme/media_key_system_configuration.h" 16 | 17 | namespace shaka { 18 | namespace js { 19 | namespace eme { 20 | 21 | DEFINE_STRUCT_SPECIAL_METHODS_COPYABLE(MediaKeySystemMediaCapability); 22 | 23 | DEFINE_STRUCT_SPECIAL_METHODS_COPYABLE(MediaKeySystemConfiguration); 24 | 25 | } // namespace eme 26 | } // namespace js 27 | } // namespace shaka 28 | -------------------------------------------------------------------------------- /shaka/src/js/events/progress_event.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/js/events/progress_event.h" 16 | 17 | namespace shaka { 18 | namespace js { 19 | namespace events { 20 | 21 | ProgressEvent::ProgressEvent(EventType type, bool length_computable, 22 | double loaded, double total) 23 | : ProgressEvent(to_string(type), length_computable, loaded, total) {} 24 | 25 | ProgressEvent::ProgressEvent(const std::string& type, bool length_computable, 26 | double loaded, double total) 27 | : Event(type), 28 | length_computable(length_computable), 29 | loaded(loaded), 30 | total(total) {} 31 | 32 | // \cond Doxygen_Skip 33 | ProgressEvent::~ProgressEvent() {} 34 | // \endcond Doxygen_Skip 35 | 36 | 37 | ProgressEventFactory::ProgressEventFactory() { 38 | AddReadOnlyProperty("lengthComputable", &ProgressEvent::length_computable); 39 | AddReadOnlyProperty("loaded", &ProgressEvent::loaded); 40 | AddReadOnlyProperty("total", &ProgressEvent::total); 41 | } 42 | 43 | } // namespace events 44 | } // namespace js 45 | } // namespace shaka 46 | -------------------------------------------------------------------------------- /shaka/src/js/events/progress_event.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_JS_EVENTS_PROGRESS_EVENT_H_ 16 | #define SHAKA_EMBEDDED_JS_EVENTS_PROGRESS_EVENT_H_ 17 | 18 | #include 19 | 20 | #include "src/js/events/event.h" 21 | #include "src/mapping/backing_object_factory.h" 22 | 23 | namespace shaka { 24 | namespace js { 25 | namespace events { 26 | 27 | class ProgressEvent : public Event { 28 | DECLARE_TYPE_INFO(ProgressEvent); 29 | 30 | public: 31 | ProgressEvent(EventType, bool, double, double); 32 | 33 | static ProgressEvent* Create(const std::string& type) { 34 | return new ProgressEvent(type, false, 0, 0); 35 | } 36 | 37 | const bool length_computable; 38 | const double loaded; 39 | const double total; 40 | 41 | private: 42 | ProgressEvent(const std::string& type, bool length_computable, double loaded, 43 | double total); 44 | }; 45 | 46 | class ProgressEventFactory : public BackingObjectFactory { 47 | public: 48 | ProgressEventFactory(); 49 | }; 50 | 51 | } // namespace events 52 | } // namespace js 53 | } // namespace shaka 54 | 55 | #endif // SHAKA_EMBEDDED_JS_EVENTS_PROGRESS_EVENT_H_ 56 | -------------------------------------------------------------------------------- /shaka/src/js/idb/delete_db_request.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_JS_IDB_DELETE_DB_REQUEST_H_ 16 | #define SHAKA_EMBEDDED_JS_IDB_DELETE_DB_REQUEST_H_ 17 | 18 | #include 19 | 20 | #include "src/js/idb/request.h" 21 | 22 | namespace shaka { 23 | namespace js { 24 | namespace idb { 25 | 26 | class IDBDeleteDBRequest : public IDBRequest { 27 | public: 28 | explicit IDBDeleteDBRequest(const std::string& name); 29 | 30 | void DoOperation(const std::string& db_path); 31 | 32 | void PerformOperation(SqliteTransaction* transaction) override; 33 | 34 | private: 35 | const std::string name_; 36 | }; 37 | 38 | } // namespace idb 39 | } // namespace js 40 | } // namespace shaka 41 | 42 | #endif // SHAKA_EMBEDDED_JS_IDB_DELETE_DB_REQUEST_H_ 43 | -------------------------------------------------------------------------------- /shaka/src/js/idb/idb_factory.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_JS_IDB_IDB_FACTORY_H_ 16 | #define SHAKA_EMBEDDED_JS_IDB_IDB_FACTORY_H_ 17 | 18 | #include 19 | 20 | #include "shaka/optional.h" 21 | #include "src/core/ref_ptr.h" 22 | #include "src/js/events/event_target.h" 23 | #include "src/mapping/any.h" 24 | #include "src/mapping/backing_object_factory.h" 25 | #include "src/mapping/exception_or.h" 26 | 27 | namespace shaka { 28 | namespace js { 29 | namespace idb { 30 | 31 | class IDBOpenDBRequest; 32 | class IDBRequest; 33 | 34 | class IDBFactory : public events::EventTarget { 35 | DECLARE_TYPE_INFO(IDBFactory); 36 | 37 | public: 38 | IDBFactory(); 39 | 40 | RefPtr Open(const std::string& name, 41 | optional version); 42 | RefPtr OpenTestDb(); 43 | RefPtr DeleteDatabase(const std::string& name); 44 | 45 | ExceptionOr CloneForTesting(Any value); 46 | }; 47 | 48 | class IDBFactoryFactory 49 | : public BackingObjectFactory { 50 | public: 51 | IDBFactoryFactory(); 52 | }; 53 | 54 | } // namespace idb 55 | } // namespace js 56 | } // namespace shaka 57 | 58 | #endif // SHAKA_EMBEDDED_JS_IDB_IDB_FACTORY_H_ 59 | -------------------------------------------------------------------------------- /shaka/src/js/idb/open_db_request.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_JS_IDB_OPEN_DB_REQUEST_H_ 16 | #define SHAKA_EMBEDDED_JS_IDB_OPEN_DB_REQUEST_H_ 17 | 18 | #include 19 | 20 | #include "shaka/optional.h" 21 | #include "src/js/events/event_target.h" 22 | #include "src/js/idb/request.h" 23 | #include "src/mapping/backing_object_factory.h" 24 | 25 | namespace shaka { 26 | namespace js { 27 | namespace idb { 28 | 29 | class SqliteTransaction; 30 | 31 | class IDBOpenDBRequest : public IDBRequest { 32 | DECLARE_TYPE_INFO(IDBOpenDBRequest); 33 | 34 | public: 35 | IDBOpenDBRequest(const std::string& name, optional version); 36 | 37 | void DoOperation(const std::string& db_path); 38 | 39 | void PerformOperation(SqliteTransaction* transaction) override; 40 | 41 | Listener on_upgrade_needed; 42 | 43 | private: 44 | const std::string name_; 45 | const optional version_; 46 | }; 47 | 48 | class IDBOpenDBRequestFactory 49 | : public BackingObjectFactory { 50 | public: 51 | IDBOpenDBRequestFactory(); 52 | }; 53 | 54 | } // namespace idb 55 | } // namespace js 56 | } // namespace shaka 57 | 58 | #endif // SHAKA_EMBEDDED_JS_IDB_OPEN_DB_REQUEST_H_ 59 | -------------------------------------------------------------------------------- /shaka/src/js/location.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/js/location.h" 16 | 17 | namespace shaka { 18 | namespace js { 19 | 20 | Location::Location() {} 21 | // \cond Doxygen_Skip 22 | Location::~Location() {} 23 | // \endcond Doxygen_Skip 24 | 25 | 26 | LocationFactory::LocationFactory() { 27 | AddReadOnlyProperty("protocol", &Location::protocol); 28 | } 29 | LocationFactory::~LocationFactory() {} 30 | 31 | } // namespace js 32 | } // namespace shaka 33 | -------------------------------------------------------------------------------- /shaka/src/js/location.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_JS_LOCATION_H_ 16 | #define SHAKA_EMBEDDED_JS_LOCATION_H_ 17 | 18 | #include 19 | 20 | #include "src/mapping/backing_object.h" 21 | #include "src/mapping/backing_object_factory.h" 22 | 23 | namespace shaka { 24 | namespace js { 25 | 26 | class Location : public BackingObject { 27 | DECLARE_TYPE_INFO(Location); 28 | 29 | public: 30 | Location(); 31 | 32 | const std::string protocol = "http:"; 33 | }; 34 | 35 | class LocationFactory : public BackingObjectFactory { 36 | public: 37 | LocationFactory(); 38 | ~LocationFactory() override; 39 | }; 40 | 41 | } // namespace js 42 | } // namespace shaka 43 | 44 | #endif // SHAKA_EMBEDDED_JS_LOCATION_H_ 45 | -------------------------------------------------------------------------------- /shaka/src/js/mse/media_error.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/js/mse/media_error.h" 16 | 17 | namespace shaka { 18 | namespace js { 19 | namespace mse { 20 | 21 | MediaError::MediaError(MediaErrorCode code, const std::string& message) 22 | : code(code), message(message) {} 23 | // \cond Doxygen_Skip 24 | MediaError::~MediaError() {} 25 | // \endcond Doxygen_Skip 26 | 27 | 28 | MediaErrorFactory::MediaErrorFactory() { 29 | AddConstant("MEDIA_ERR_ABORTED", MEDIA_ERR_ABORTED); 30 | AddConstant("MEDIA_ERR_NETWORK", MEDIA_ERR_NETWORK); 31 | AddConstant("MEDIA_ERR_DECODE", MEDIA_ERR_DECODE); 32 | AddConstant("MEDIA_ERR_SRC_NOT_SUPPORTED", MEDIA_ERR_SRC_NOT_SUPPORTED); 33 | 34 | AddReadOnlyProperty("code", &MediaError::code); 35 | AddReadOnlyProperty("message", &MediaError::message); 36 | } 37 | 38 | } // namespace mse 39 | } // namespace js 40 | } // namespace shaka 41 | -------------------------------------------------------------------------------- /shaka/src/js/mse/media_error.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_JS_MSE_MEDIA_ERROR_H_ 16 | #define SHAKA_EMBEDDED_JS_MSE_MEDIA_ERROR_H_ 17 | 18 | #include 19 | 20 | #include "src/mapping/backing_object.h" 21 | #include "src/mapping/backing_object_factory.h" 22 | #include "src/mapping/enum.h" 23 | 24 | namespace shaka { 25 | namespace js { 26 | namespace mse { 27 | 28 | enum MediaErrorCode { 29 | MEDIA_ERR_ABORTED = 1, 30 | MEDIA_ERR_NETWORK = 2, 31 | MEDIA_ERR_DECODE = 3, 32 | MEDIA_ERR_SRC_NOT_SUPPORTED = 4, 33 | }; 34 | 35 | /** 36 | * An error in a media element. 37 | * @see https://html.spec.whatwg.org/multipage/media.html#mediaerror 38 | */ 39 | class MediaError : public BackingObject { 40 | DECLARE_TYPE_INFO(MediaError); 41 | 42 | public: 43 | MediaError(MediaErrorCode code, const std::string& message); 44 | 45 | const MediaErrorCode code; 46 | const std::string message; 47 | }; 48 | 49 | class MediaErrorFactory : public BackingObjectFactory { 50 | public: 51 | MediaErrorFactory(); 52 | }; 53 | 54 | } // namespace mse 55 | } // namespace js 56 | } // namespace shaka 57 | 58 | CONVERT_ENUM_AS_NUMBER(shaka::js::mse, MediaErrorCode); 59 | 60 | #endif // SHAKA_EMBEDDED_JS_MSE_MEDIA_ERROR_H_ 61 | -------------------------------------------------------------------------------- /shaka/src/js/mse/time_ranges.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_JS_MSE_TIME_RANGES_H_ 16 | #define SHAKA_EMBEDDED_JS_MSE_TIME_RANGES_H_ 17 | 18 | #include "src/mapping/backing_object.h" 19 | #include "src/mapping/backing_object_factory.h" 20 | #include "src/mapping/exception_or.h" 21 | #include "src/media/types.h" 22 | 23 | namespace shaka { 24 | namespace js { 25 | namespace mse { 26 | 27 | class TimeRanges : public BackingObject { 28 | DECLARE_TYPE_INFO(TimeRanges); 29 | 30 | public: 31 | explicit TimeRanges(media::BufferedRanges ranges); 32 | 33 | bool IsShortLived() const override; 34 | 35 | uint32_t length() const { 36 | return ranges_.size(); 37 | } 38 | 39 | ExceptionOr Start(uint32_t index) const; 40 | ExceptionOr End(uint32_t index) const; 41 | 42 | private: 43 | media::BufferedRanges ranges_; 44 | }; 45 | 46 | class TimeRangesFactory : public BackingObjectFactory { 47 | public: 48 | TimeRangesFactory(); 49 | }; 50 | 51 | } // namespace mse 52 | } // namespace js 53 | } // namespace shaka 54 | 55 | #endif // SHAKA_EMBEDDED_JS_MSE_TIME_RANGES_H_ 56 | -------------------------------------------------------------------------------- /shaka/src/js/net.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/js/net.h" 16 | 17 | namespace shaka { 18 | namespace js { 19 | 20 | DEFINE_STRUCT_SPECIAL_METHODS_MOVE_ONLY(Request); 21 | DEFINE_STRUCT_SPECIAL_METHODS_MOVE_ONLY(Response); 22 | 23 | } // namespace js 24 | } // namespace shaka 25 | -------------------------------------------------------------------------------- /shaka/src/js/offline_externs.idl: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * Contains a description of a piece of content that is stored offline. 17 | * @ingroup externs 18 | */ 19 | dictionary StoredContent { 20 | /** 21 | * An offline URI to access the content. This can be passed directly to 22 | * Player. If the uri is null, it means that the content has not finished 23 | * downloading and is not ready to play. 24 | */ 25 | DOMString? offlineUri; 26 | 27 | /** The original manifest URI of the content stored. */ 28 | DOMString originalManifestUri; 29 | 30 | /** The duration of the content, in seconds. */ 31 | double duration; 32 | 33 | /** The size of the content, in bytes. */ 34 | double size; 35 | 36 | /** 37 | * The time that the encrypted license expires, in milliseconds. If the media 38 | * is clear or the license never expires, this will equal Infinity. 39 | */ 40 | double expiration; 41 | 42 | /** The metadata passed to store. */ 43 | record appMetadata; 44 | }; 45 | -------------------------------------------------------------------------------- /shaka/src/js/player_externs.idl: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /** 16 | * Contains the times of a range of buffered content. 17 | * @ingroup externs 18 | */ 19 | dictionary BufferedRange { 20 | /** The start time of the range, in seconds. */ 21 | double start; 22 | 23 | /** The end time of the range, in seconds. */ 24 | double end; 25 | }; 26 | 27 | /** 28 | * Contains information about the current buffered ranges. 29 | * @ingroup externs 30 | */ 31 | dictionary BufferedInfo { 32 | /** The combined audio/video buffered ranges, reported by |video.buffered|. */ 33 | sequence total; 34 | 35 | /** The buffered ranges for audio content. */ 36 | sequence audio; 37 | 38 | /** The buffered ranges for video content. */ 39 | sequence video; 40 | 41 | /** The buffered ranges for text content. */ 42 | sequence text; 43 | }; 44 | 45 | /** 46 | * A pair of language and role. 47 | * @ingroup externs 48 | */ 49 | dictionary LanguageRole { 50 | /** The language code for the stream. */ 51 | DOMString language; 52 | 53 | /** 54 | * The role name for the stream. If the stream has no role, |role| will be ''. 55 | */ 56 | DOMString role; 57 | }; 58 | -------------------------------------------------------------------------------- /shaka/src/js/timeouts.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_JS_TIMEOUTS_H_ 16 | #define SHAKA_EMBEDDED_JS_TIMEOUTS_H_ 17 | 18 | #include "shaka/optional.h" 19 | #include "src/mapping/callback.h" 20 | 21 | namespace shaka { 22 | namespace js { 23 | 24 | class Timeouts { 25 | public: 26 | static void Install(); 27 | 28 | static int SetTimeout(Callback callback, optional timeout); 29 | static int SetInterval(Callback callback, optional timeout); 30 | 31 | // These are optional since jasmine passes in undefined sometimes. 32 | static void ClearTimeout(optional id); 33 | static void ClearInterval(optional id); 34 | }; 35 | 36 | } // namespace js 37 | } // namespace shaka 38 | 39 | #endif // SHAKA_EMBEDDED_JS_TIMEOUTS_H_ 40 | -------------------------------------------------------------------------------- /shaka/src/js/url.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/js/url.h" 16 | 17 | #include "src/js/mse/media_source.h" 18 | 19 | namespace shaka { 20 | namespace js { 21 | 22 | URL::URL() {} 23 | // \cond Doxygen_Skip 24 | URL::~URL() {} 25 | // \endcond Doxygen_Skip 26 | 27 | std::string URL::CreateObjectUrl(RefPtr media_source) { 28 | return media_source->url; 29 | } 30 | 31 | 32 | URLFactory::URLFactory() { 33 | AddStaticFunction("createObjectURL", &URL::CreateObjectUrl); 34 | } 35 | 36 | } // namespace js 37 | } // namespace shaka 38 | -------------------------------------------------------------------------------- /shaka/src/js/url.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_JS_URL_H_ 16 | #define SHAKA_EMBEDDED_JS_URL_H_ 17 | 18 | #include 19 | 20 | #include "src/core/ref_ptr.h" 21 | #include "src/mapping/backing_object.h" 22 | #include "src/mapping/backing_object_factory.h" 23 | 24 | namespace shaka { 25 | namespace js { 26 | 27 | namespace mse { 28 | class MediaSource; 29 | } // namespace mse 30 | 31 | class URL : public BackingObject { 32 | DECLARE_TYPE_INFO(URL); 33 | 34 | public: 35 | URL(); 36 | 37 | static std::string CreateObjectUrl(RefPtr media_source); 38 | }; 39 | 40 | class URLFactory : public BackingObjectFactory { 41 | public: 42 | URLFactory(); 43 | }; 44 | 45 | } // namespace js 46 | } // namespace shaka 47 | 48 | #endif // SHAKA_EMBEDDED_JS_URL_H_ 49 | -------------------------------------------------------------------------------- /shaka/src/mapping/byte_string.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_MAPPING_BYTE_STRING_H_ 16 | #define SHAKA_EMBEDDED_MAPPING_BYTE_STRING_H_ 17 | 18 | #include 19 | #include 20 | 21 | #include "src/mapping/generic_converter.h" 22 | 23 | namespace shaka { 24 | 25 | /** 26 | * Represents a string where each character is interpreted as a byte, 27 | * independent of the encoding. 28 | * 29 | * This inherits from std::vector to expose the same methods (e.g. size(), 30 | * data(), operator[]). 31 | */ 32 | class ByteString : public std::vector, 33 | public GenericConverter, 34 | public memory::Traceable { 35 | public: 36 | static std::string name() { 37 | return "string"; 38 | } 39 | 40 | explicit ByteString(const char* source); 41 | explicit ByteString(const std::string& source); 42 | 43 | // Inherit other constructors from std::vector. 44 | using std::vector::vector; 45 | 46 | 47 | bool TryConvert(Handle value) override; 48 | ReturnVal ToJsValue() const override; 49 | void Trace(memory::HeapTracer* tracer) const override {} 50 | }; 51 | 52 | } // namespace shaka 53 | 54 | #endif // SHAKA_EMBEDDED_MAPPING_BYTE_STRING_H_ 55 | -------------------------------------------------------------------------------- /shaka/src/mapping/callback.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/mapping/callback.h" 16 | 17 | #include "src/memory/heap_tracer.h" 18 | 19 | namespace shaka { 20 | 21 | Callback::Callback() {} 22 | Callback::~Callback() {} 23 | 24 | Callback::Callback(const Callback&) = default; 25 | Callback::Callback(Callback&&) = default; 26 | Callback& Callback::operator=(const Callback&) = default; 27 | Callback& Callback::operator=(Callback&&) = default; 28 | 29 | bool Callback::TryConvert(Handle given) { 30 | if (GetValueType(given) != proto::ValueType::Function) 31 | return false; 32 | callback_ = UnsafeJsCast(given); 33 | return true; 34 | } 35 | 36 | ReturnVal Callback::ToJsValue() const { 37 | return callback_.value(); 38 | } 39 | 40 | void Callback::Trace(memory::HeapTracer* tracer) const { 41 | tracer->Trace(&callback_); 42 | } 43 | 44 | } // namespace shaka 45 | -------------------------------------------------------------------------------- /shaka/src/mapping/exception_or.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_MAPPING_EXCEPTION_OR_H_ 16 | #define SHAKA_EMBEDDED_MAPPING_EXCEPTION_OR_H_ 17 | 18 | #include 19 | 20 | #include "shaka/variant.h" 21 | #include "src/js/js_error.h" 22 | 23 | namespace shaka { 24 | 25 | #define RETURN_IF_ERROR(code) \ 26 | do { \ 27 | ExceptionOr except = (code); \ 28 | if (holds_alternative(except)) \ 29 | return get(std::move(except)); \ 30 | } while (false) 31 | 32 | /** 33 | * Contains either an exception or a return value. 34 | */ 35 | template 36 | struct ExceptionOr final : variant { 37 | using variant::variant; 38 | }; 39 | 40 | template <> 41 | struct ExceptionOr final : variant { 42 | using variant::variant; 43 | ExceptionOr() : variant(monostate()) {} 44 | }; 45 | 46 | } // namespace shaka 47 | 48 | #endif // SHAKA_EMBEDDED_MAPPING_EXCEPTION_OR_H_ 49 | -------------------------------------------------------------------------------- /shaka/src/mapping/jsc/jsc_utils.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_MAPPING_JSC_JSC_UTILS_H_ 16 | #define SHAKA_EMBEDDED_MAPPING_JSC_JSC_UTILS_H_ 17 | 18 | #include 19 | #include // NOLINT(build/include_alpha) 20 | 21 | #include 22 | 23 | namespace shaka { 24 | 25 | JSContextRef GetContext(); 26 | 27 | void OnUncaughtException(JSValueRef exception, bool in_promise); 28 | 29 | JSValueRef CreateNativeObject(const std::string& name, JSValueRef* args, 30 | size_t argc); 31 | 32 | } // namespace shaka 33 | 34 | #endif // SHAKA_EMBEDDED_MAPPING_JSC_JSC_UTILS_H_ 35 | -------------------------------------------------------------------------------- /shaka/src/mapping/register_member.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/mapping/register_member.h" 16 | 17 | #include "src/mapping/backing_object.h" 18 | #include "src/mapping/backing_object_factory.h" 19 | 20 | namespace shaka { 21 | namespace impl { 22 | 23 | bool ConstructWrapperObject(const CallbackArguments& arguments, 24 | BackingObject* that) { 25 | #if defined(USING_V8) 26 | that->SetJsThis(arguments.This()); 27 | arguments.This()->SetAlignedPointerInInternalField(0, that); 28 | arguments.This()->SetAlignedPointerInInternalField(1, nullptr); 29 | #elif defined(USING_JSC) 30 | JSClassRef cls = that->factory()->GetClass(); 31 | LocalVar obj(JSObjectMake(GetContext(), cls, that)); 32 | if (!obj) 33 | return false; 34 | that->SetJsThis(obj); 35 | arguments.SetReturn(obj); 36 | #endif 37 | return true; 38 | } 39 | 40 | } // namespace impl 41 | } // namespace shaka 42 | -------------------------------------------------------------------------------- /shaka/src/mapping/struct.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/mapping/struct.h" 16 | 17 | #include "src/mapping/weak_js_ptr.h" 18 | 19 | namespace shaka { 20 | 21 | Struct::Struct() {} 22 | Struct::~Struct() {} 23 | 24 | Struct::Struct(const Struct&) = default; 25 | Struct::Struct(Struct&&) = default; 26 | Struct& Struct::operator=(const Struct&) = default; 27 | Struct& Struct::operator=(Struct&&) = default; 28 | 29 | bool Struct::TryConvert(Handle value) { 30 | if (!IsObject(value)) 31 | return false; 32 | 33 | LocalVar obj = UnsafeJsCast(value); 34 | object_ = obj; 35 | for (auto& converter : converters_) 36 | converter->SearchAndStore(this, obj); 37 | return true; 38 | } 39 | 40 | ReturnVal Struct::ToJsValue() const { 41 | if (object_.empty()) 42 | object_ = CreateObject(); 43 | 44 | for (auto& converter : converters_) 45 | converter->AddToObject(this, object_.handle()); 46 | return object_.value(); 47 | } 48 | 49 | void Struct::Trace(memory::HeapTracer* tracer) const { 50 | tracer->Trace(&object_); 51 | for (auto& converter : converters_) 52 | converter->Trace(this, tracer); 53 | } 54 | 55 | } // namespace shaka 56 | -------------------------------------------------------------------------------- /shaka/src/mapping/v8/v8_utils.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_MAPPING_V8_V8_UTILS_H_ 16 | #define SHAKA_EMBEDDED_MAPPING_V8_V8_UTILS_H_ 17 | 18 | #include 19 | 20 | #include 21 | 22 | namespace shaka { 23 | 24 | /** 25 | * Gets the current Isolate instance, checking that we are in a valid state. V8 26 | * must be ready first, meaning that this must be the event thread or we are 27 | * being initialized (event loop is stopped). 28 | */ 29 | v8::Isolate* GetIsolate(); 30 | 31 | /** @return Wether the value is the value |true|. */ 32 | inline bool IsTrue(const v8::Maybe& value) { 33 | return value.IsJust() && value.FromJust(); 34 | } 35 | 36 | /** Prints the given stack trace to stderr. */ 37 | void PrintStackTrace(const v8::Local& stack); 38 | 39 | /** 40 | * Called when an uncaught exception occurs. Prints information about the 41 | * given exception. 42 | */ 43 | void OnUncaughtException(const v8::Local& exception, 44 | bool in_promise); 45 | 46 | } // namespace shaka 47 | 48 | #endif // SHAKA_EMBEDDED_MAPPING_V8_V8_UTILS_H_ 49 | -------------------------------------------------------------------------------- /shaka/src/media/apple/apple_decoded_frame.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/media/apple/apple_decoded_frame.h" 16 | 17 | #include 18 | 19 | namespace shaka { 20 | namespace media { 21 | namespace apple { 22 | 23 | AppleDecodedFrame::AppleDecodedFrame(std::shared_ptr stream, 24 | double time, double duration, 25 | SampleFormat format, uint32_t sample_count, 26 | std::vector buffer) 27 | : DecodedFrame(stream, time, time, duration, format, sample_count, 28 | {buffer.data()}, {buffer.size()}), 29 | data_(std::move(buffer)) {} 30 | 31 | AppleDecodedFrame::AppleDecodedFrame(std::shared_ptr stream, 32 | double time, double duration, 33 | CVImageBufferRef img) 34 | : DecodedFrame(stream, time, time, duration, PixelFormat::VideoToolbox, 0, 35 | {reinterpret_cast(img)}, {0}), 36 | img_(util::acquire_ref, img) {} 37 | 38 | AppleDecodedFrame::~AppleDecodedFrame() {} 39 | 40 | } // namespace apple 41 | } // namespace media 42 | } // namespace shaka 43 | -------------------------------------------------------------------------------- /shaka/src/media/apple/apple_decoded_frame.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_MEDIA_APPLE_DECODED_FRAME_H_ 16 | #define SHAKA_EMBEDDED_MEDIA_APPLE_DECODED_FRAME_H_ 17 | 18 | #include 19 | 20 | #include 21 | #include 22 | 23 | #include "shaka/media/frames.h" 24 | #include "src/util/cfref.h" 25 | 26 | namespace shaka { 27 | namespace media { 28 | namespace apple { 29 | 30 | /** This defines a single decoded media frame. */ 31 | class AppleDecodedFrame final : public DecodedFrame { 32 | public: 33 | // An audio frame. 34 | AppleDecodedFrame(std::shared_ptr stream, double time, 35 | double duration, SampleFormat format, uint32_t sample_count, 36 | std::vector buffer); 37 | // A video frame. 38 | AppleDecodedFrame(std::shared_ptr stream, double time, 39 | double duration, CVImageBufferRef img); 40 | ~AppleDecodedFrame() override; 41 | 42 | private: 43 | util::CFRef img_; 44 | std::vector data_; 45 | }; 46 | 47 | } // namespace apple 48 | } // namespace media 49 | } // namespace shaka 50 | 51 | #endif // SHAKA_EMBEDDED_MEDIA_APPLE_DECODED_FRAME_H_ 52 | -------------------------------------------------------------------------------- /shaka/src/media/decoder.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "shaka/media/decoder.h" 16 | 17 | #if defined(HAS_FFMPEG_DECODER) 18 | # include "src/media/ffmpeg/ffmpeg_decoder.h" 19 | #elif defined(HAS_APPLE_DECODER) 20 | # include "src/media/apple/apple_decoder.h" 21 | #endif 22 | 23 | namespace shaka { 24 | namespace media { 25 | 26 | // \cond Doxygen_Skip 27 | Decoder::Decoder() {} 28 | Decoder::~Decoder() {} 29 | // \endcond Doxygen_Skip 30 | 31 | std::unique_ptr Decoder::CreateDefaultDecoder() { 32 | #if defined(HAS_FFMPEG_DECODER) 33 | return std::unique_ptr(new ffmpeg::FFmpegDecoder); 34 | #elif defined(HAS_APPLE_DECODER) 35 | return std::unique_ptr(new apple::AppleDecoder); 36 | #else 37 | return nullptr; 38 | #endif 39 | } 40 | 41 | } // namespace media 42 | } // namespace shaka 43 | -------------------------------------------------------------------------------- /shaka/src/media/ios/av_media_track.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_MEDIA_IOS_AV_MEDIA_TRACK_H_ 16 | #define SHAKA_EMBEDDED_MEDIA_IOS_AV_MEDIA_TRACK_H_ 17 | 18 | #import 19 | 20 | #include "shaka/media/media_track.h" 21 | 22 | namespace shaka { 23 | namespace media { 24 | namespace ios { 25 | 26 | /** 27 | * Defines a subclass of MediaTrack that handles selecting the track. This 28 | * allows selecting the resulting track for playback. 29 | */ 30 | class AvMediaTrack : public MediaTrack { 31 | public: 32 | AvMediaTrack(AVPlayerItem *item, AVMediaSelectionGroup *group, 33 | AVMediaSelectionOption *option); 34 | ~AvMediaTrack() override; 35 | 36 | bool enabled() const override; 37 | void SetEnabled(bool enabled) override; 38 | 39 | private: 40 | AVPlayerItem *item_; 41 | AVMediaSelectionGroup *group_; 42 | AVMediaSelectionOption *option_; 43 | }; 44 | 45 | } // namespace ios 46 | } // namespace media 47 | } // namespace shaka 48 | 49 | #endif // SHAKA_EMBEDDED_MEDIA_IOS_AV_MEDIA_TRACK_H_ 50 | -------------------------------------------------------------------------------- /shaka/src/media/ios/av_text_track.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_MEDIA_IOS_AV_TEXT_TRACK_H_ 16 | #define SHAKA_EMBEDDED_MEDIA_IOS_AV_TEXT_TRACK_H_ 17 | 18 | #import 19 | 20 | #include "shaka/media/text_track.h" 21 | #include "src/media/ios/av_media_track.h" 22 | 23 | namespace shaka { 24 | namespace media { 25 | namespace ios { 26 | 27 | /** 28 | * Defines a subclass of TextTrack that handles selecting the track. This 29 | * allows selecting the resulting track for playback. This doesn't track 30 | * individual cues since those aren't exposed through AVFoundation. 31 | * 32 | * This subclasses AvMediaTrack to avoid code duplication for handling of the 33 | * iOS track. 34 | */ 35 | class AvTextTrack : AvMediaTrack, public TextTrack { 36 | public: 37 | AvTextTrack(AVPlayerItem *item, AVMediaSelectionGroup *group, 38 | AVMediaSelectionOption *option); 39 | ~AvTextTrack() override; 40 | 41 | TextTrackMode mode() const override; 42 | void SetMode(TextTrackMode mode) override; 43 | }; 44 | 45 | } // namespace ios 46 | } // namespace media 47 | } // namespace shaka 48 | 49 | #endif // SHAKA_EMBEDDED_MEDIA_IOS_AV_TEXT_TRACK_H_ 50 | -------------------------------------------------------------------------------- /shaka/src/media/ios/av_text_track.mm: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/media/ios/av_text_track.h" 16 | 17 | namespace shaka { 18 | namespace media { 19 | namespace ios { 20 | 21 | AvTextTrack::AvTextTrack(AVPlayerItem *item, AVMediaSelectionGroup *group, 22 | AVMediaSelectionOption *option) 23 | : AvMediaTrack(item, group, option), 24 | TextTrack(TextTrackKind::Subtitles, AvMediaTrack::label, AvMediaTrack::language, 25 | AvMediaTrack::id) {} 26 | 27 | AvTextTrack::~AvTextTrack() {} 28 | 29 | TextTrackMode AvTextTrack::mode() const { 30 | if (enabled()) 31 | return TextTrackMode::Showing; 32 | else 33 | return TextTrackMode::Hidden; 34 | } 35 | 36 | void AvTextTrack::SetMode(TextTrackMode mode) { 37 | SetEnabled(mode == TextTrackMode::Showing); 38 | } 39 | 40 | } // namespace ios 41 | } // namespace media 42 | } // namespace shaka 43 | -------------------------------------------------------------------------------- /shaka/src/media/media_track_public.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "shaka/media/media_track.h" 16 | 17 | namespace shaka { 18 | namespace media { 19 | 20 | class MediaTrack::Impl {}; 21 | 22 | MediaTrack::MediaTrack(MediaTrackKind kind, const std::string& label, 23 | const std::string& language, const std::string& id) 24 | : label(label), language(language), id(id), kind(kind), enabled_(false) {} 25 | 26 | MediaTrack::~MediaTrack() {} 27 | 28 | bool MediaTrack::enabled() const { 29 | return enabled_; 30 | } 31 | 32 | void MediaTrack::SetEnabled(bool enabled) { 33 | enabled_ = enabled; 34 | } 35 | 36 | } // namespace media 37 | } // namespace shaka 38 | -------------------------------------------------------------------------------- /shaka/src/media/media_utils_ios.mm: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/media/media_utils.h" 16 | 17 | #import 18 | 19 | namespace shaka { 20 | namespace media { 21 | 22 | std::pair GetScreenResolution() { 23 | CGRect screenBounds = [[UIScreen mainScreen] bounds]; 24 | CGFloat screenScale = [[UIScreen mainScreen] scale]; 25 | return {static_cast(screenBounds.size.width * screenScale), 26 | static_cast(screenBounds.size.height * screenScale)}; 27 | } 28 | 29 | } // namespace media 30 | } // namespace shaka 31 | -------------------------------------------------------------------------------- /shaka/src/media/renderer.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "shaka/media/renderer.h" 16 | 17 | namespace shaka { 18 | namespace media { 19 | 20 | // \cond Doxygen_Skip 21 | Renderer::Renderer() {} 22 | Renderer::~Renderer() {} 23 | // \endcond Doxygen_Skip 24 | 25 | } // namespace media 26 | } // namespace shaka 27 | -------------------------------------------------------------------------------- /shaka/src/media/stream_info.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "shaka/media/stream_info.h" 16 | 17 | #include 18 | 19 | namespace shaka { 20 | namespace media { 21 | 22 | class StreamInfo::Impl {}; 23 | 24 | StreamInfo::StreamInfo(const std::string& mime, const std::string& codec, 25 | bool is_video, Rational time_scale, 26 | Rational sample_aspect_ratio, 27 | const std::vector& extra_data, uint32_t width, 28 | uint32_t height, uint32_t channel_count, 29 | uint32_t sample_rate) 30 | : mime_type(mime), 31 | codec(codec), 32 | time_scale(time_scale), 33 | sample_aspect_ratio(sample_aspect_ratio), 34 | extra_data(extra_data), 35 | is_video(is_video), 36 | width(width), 37 | height(height), 38 | channel_count(channel_count), 39 | sample_rate(sample_rate) {} 40 | StreamInfo::~StreamInfo() {} 41 | 42 | } // namespace media 43 | } // namespace shaka 44 | -------------------------------------------------------------------------------- /shaka/src/media/types.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_MEDIA_TYPES_H_ 16 | #define SHAKA_EMBEDDED_MEDIA_TYPES_H_ 17 | 18 | #include 19 | 20 | #include "shaka/media/streams.h" 21 | #include "src/util/macros.h" 22 | 23 | namespace shaka { 24 | namespace media { 25 | 26 | using BufferedRanges = std::vector; 27 | 28 | } // namespace media 29 | } // namespace shaka 30 | 31 | #endif // SHAKA_EMBEDDED_MEDIA_TYPES_H_ 32 | -------------------------------------------------------------------------------- /shaka/src/public/ShakaPlayer+Internal.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_SHAKA_PLAYER_INTERNAL_H_ 16 | #define SHAKA_EMBEDDED_SHAKA_PLAYER_INTERNAL_H_ 17 | 18 | #import 19 | 20 | #include 21 | 22 | #include "shaka/js_manager.h" 23 | #include "shaka/media/apple_video_renderer.h" 24 | #include "shaka/media/default_media_player.h" 25 | #include "shaka/player.h" 26 | 27 | std::shared_ptr ShakaGetGlobalEngine(); 28 | 29 | @interface ShakaPlayer(Internal) 30 | 31 | @property(atomic, readonly) shaka::Player* playerInstance; 32 | @property(atomic, readonly) shaka::media::DefaultMediaPlayer* mediaPlayer; 33 | @property(atomic, readonly) shaka::media::AppleVideoRenderer* videoRenderer; 34 | 35 | @end 36 | 37 | #endif // SHAKA_EMBEDDED_SHAKA_PLAYER_INTERNAL_H_ 38 | -------------------------------------------------------------------------------- /shaka/src/public/data.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "shaka/eme/data.h" 16 | 17 | #include 18 | 19 | #include "src/core/ref_ptr.h" 20 | #include "src/js/eme/media_key_session.h" 21 | #include "src/mapping/byte_buffer.h" 22 | #include "src/mapping/js_utils.h" 23 | #include "src/memory/object_tracker.h" 24 | #include "src/util/macros.h" 25 | 26 | namespace shaka { 27 | namespace eme { 28 | 29 | class Data::Impl { 30 | public: 31 | explicit Impl(ByteBuffer buffer) 32 | : buffer(MakeJsRef(std::move(buffer))) {} 33 | ~Impl() {} 34 | 35 | SHAKA_NON_COPYABLE_OR_MOVABLE_TYPE(Impl); 36 | 37 | RefPtr buffer; 38 | }; 39 | 40 | Data::Data(Data&& other) = default; 41 | Data::~Data() {} 42 | 43 | Data& Data::operator=(Data&& other) = default; 44 | 45 | const uint8_t* Data::data() const { 46 | return impl_->buffer->data(); 47 | } 48 | 49 | size_t Data::size() const { 50 | return impl_->buffer->size(); 51 | } 52 | 53 | Data::Data(ByteBuffer* buffer) : impl_(new Impl(std::move(*buffer))) {} 54 | 55 | } // namespace eme 56 | } // namespace shaka 57 | -------------------------------------------------------------------------------- /shaka/src/public/eme_promise_impl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_EME_PROMISE_IMPL_H_ 16 | #define SHAKA_EMBEDDED_EME_PROMISE_IMPL_H_ 17 | 18 | #include 19 | #include 20 | 21 | #include "shaka/eme/eme_promise.h" 22 | 23 | #include "src/core/ref_ptr.h" 24 | #include "src/mapping/promise.h" 25 | #include "src/util/macros.h" 26 | 27 | namespace shaka { 28 | namespace eme { 29 | 30 | class EmePromise::Impl { 31 | public: 32 | Impl(const Promise& promise, bool has_value); 33 | virtual ~Impl(); 34 | 35 | SHAKA_NON_COPYABLE_OR_MOVABLE_TYPE(Impl); 36 | 37 | virtual void Resolve(); 38 | virtual void ResolveWith(bool value); 39 | virtual void Reject(ExceptionType except_type, const std::string& message); 40 | 41 | protected: 42 | Impl(); 43 | 44 | private: 45 | RefPtr promise_; 46 | std::atomic is_pending_; 47 | const bool has_value_; 48 | }; 49 | 50 | } // namespace eme 51 | } // namespace shaka 52 | 53 | #endif // SHAKA_EMBEDDED_EME_PROMISE_IMPL_H_ 54 | -------------------------------------------------------------------------------- /shaka/src/public/error.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "shaka/error.h" 16 | 17 | #include "src/util/macros.h" 18 | 19 | namespace shaka { 20 | 21 | class Error::Impl {}; 22 | 23 | Error::Error(const std::string& message) 24 | : message(message), severity(0), category(0), code(0) {} 25 | 26 | Error::Error(int severity, int category, int code, const std::string& message) 27 | : message(message), severity(severity), category(category), code(code) {} 28 | 29 | Error::Error(const Error& other) 30 | : message(other.message), 31 | severity(other.severity), 32 | category(other.category), 33 | code(other.code) {} 34 | 35 | Error::Error(Error&&) = default; 36 | 37 | Error::~Error() {} 38 | 39 | Error& Error::operator=(const Error& other) { 40 | message = other.message; 41 | severity = other.severity; 42 | category = other.category; 43 | code = other.code; 44 | 45 | return *this; 46 | } 47 | 48 | Error& Error::operator=(Error&&) = default; 49 | 50 | } // namespace shaka 51 | -------------------------------------------------------------------------------- /shaka/src/public/error_objc+Internal.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_ERROR_OBJC_INTERNAL_H_ 16 | #define SHAKA_EMBEDDED_ERROR_OBJC_INTERNAL_H_ 17 | 18 | #import 19 | 20 | #include "shaka/error.h" 21 | #include "shaka/error_objc.h" 22 | 23 | @interface ShakaPlayerError(Internal) 24 | 25 | - (instancetype)initWithError:(const shaka::Error&)error; 26 | 27 | @end 28 | 29 | #endif // SHAKA_EMBEDDED_ERROR_OBJC_INTERNAL_H_ 30 | -------------------------------------------------------------------------------- /shaka/src/public/net_objc+Internal.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_PUBLIC_NET_OBJC_INTERNAL_H_ 16 | #define SHAKA_EMBEDDED_PUBLIC_NET_OBJC_INTERNAL_H_ 17 | 18 | #import "shaka/net.h" 19 | #import "shaka/net_objc.h" 20 | 21 | @interface ShakaPlayerRequest(Internal) 22 | 23 | - (instancetype)initWithRequest:(const shaka::Request &)request; 24 | 25 | - (void)finalize:(shaka::Request *)request; 26 | 27 | @end 28 | 29 | 30 | @interface ShakaPlayerResponse(Internal) 31 | 32 | - (instancetype)initWithResponse:(const shaka::Response &)response; 33 | 34 | - (void)finalize:(shaka::Response *)response; 35 | 36 | @end 37 | 38 | #endif // SHAKA_EMBEDDED_PUBLIC_NET_OBJC_INTERNAL_H_ 39 | -------------------------------------------------------------------------------- /shaka/src/public/optional.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "shaka/optional.h" 16 | 17 | #include "src/util/macros.h" 18 | 19 | namespace shaka { 20 | 21 | BEGIN_ALLOW_COMPLEX_STATICS 22 | const nullopt_t nullopt = nullopt_t(0); 23 | END_ALLOW_COMPLEX_STATICS 24 | 25 | } // namespace shaka 26 | -------------------------------------------------------------------------------- /shaka/src/util/buffer_writer.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/util/buffer_writer.h" 16 | 17 | #include 18 | 19 | #include 20 | 21 | namespace shaka { 22 | namespace util { 23 | 24 | BufferWriter::BufferWriter(uint8_t* data, size_t data_size) 25 | : data_(data), size_(data_size) {} 26 | 27 | void BufferWriter::Write(const void* src, size_t src_size) { 28 | CHECK(size_ >= src_size) << "No output remaining"; 29 | std::memcpy(data_, src, src_size); 30 | data_ += src_size; 31 | size_ -= src_size; 32 | } 33 | 34 | } // namespace util 35 | } // namespace shaka 36 | -------------------------------------------------------------------------------- /shaka/src/util/cfref.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifdef __APPLE__ 16 | 17 | # include "src/util/cfref.h" 18 | 19 | namespace shaka { 20 | namespace util { 21 | 22 | absorb_ref_t absorb_ref; 23 | acquire_ref_t acquire_ref; 24 | 25 | } // namespace util 26 | } // namespace shaka 27 | 28 | #endif // __APPLE__ 29 | -------------------------------------------------------------------------------- /shaka/src/util/clock.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/util/clock.h" 16 | 17 | #include 18 | #include 19 | 20 | #include "src/util/macros.h" 21 | 22 | namespace shaka { 23 | namespace util { 24 | 25 | BEGIN_ALLOW_COMPLEX_STATICS 26 | const Clock Clock::Instance; 27 | END_ALLOW_COMPLEX_STATICS 28 | 29 | uint64_t Clock::GetMonotonicTime() const { 30 | return std::chrono::steady_clock::now().time_since_epoch() / 31 | std::chrono::milliseconds(1); 32 | } 33 | 34 | uint64_t Clock::GetEpochTime() const { 35 | return std::chrono::system_clock::now().time_since_epoch() / 36 | std::chrono::milliseconds(1); 37 | } 38 | 39 | void Clock::SleepSeconds(double seconds) const { 40 | std::this_thread::sleep_for( 41 | std::chrono::milliseconds(static_cast(seconds * 1000))); 42 | } 43 | 44 | } // namespace util 45 | } // namespace shaka 46 | -------------------------------------------------------------------------------- /shaka/src/util/clock.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_UTIL_CLOCK_H_ 16 | #define SHAKA_EMBEDDED_UTIL_CLOCK_H_ 17 | 18 | #include 19 | 20 | namespace shaka { 21 | namespace util { 22 | 23 | /** Used to get the current system time. This can be overridden by tests. */ 24 | class Clock { 25 | public: 26 | virtual ~Clock() {} 27 | 28 | /** Contains a static instance of the clock. */ 29 | static const Clock Instance; 30 | 31 | /** 32 | * @return The current time, in milliseconds. The value is not specific, but 33 | * is guaranteed to be increasing over the course of the program. 34 | */ 35 | virtual uint64_t GetMonotonicTime() const; 36 | 37 | /** @return The current wall-clock time, in milliseconds. */ 38 | virtual uint64_t GetEpochTime() const; 39 | 40 | /** Sleeps for the given number of seconds. */ 41 | virtual void SleepSeconds(double seconds) const; 42 | }; 43 | 44 | } // namespace util 45 | } // namespace shaka 46 | 47 | #endif // SHAKA_EMBEDDED_UTIL_CLOCK_H_ 48 | -------------------------------------------------------------------------------- /shaka/src/util/crypto.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_UTIL_CRYPTO_H_ 16 | #define SHAKA_EMBEDDED_UTIL_CRYPTO_H_ 17 | 18 | #include // for size_t 19 | #include // for uint8_t 20 | 21 | #include 22 | 23 | namespace shaka { 24 | namespace util { 25 | 26 | /** Calculates the MD5 hash of the given data. */ 27 | std::vector HashData(const uint8_t* data, size_t size); 28 | 29 | } // namespace util 30 | } // namespace shaka 31 | 32 | #endif // SHAKA_EMBEDDED_UTIL_CRYPTO_H_ 33 | -------------------------------------------------------------------------------- /shaka/src/util/crypto_darwin.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | #include 17 | 18 | #include "src/util/crypto.h" 19 | 20 | namespace shaka { 21 | namespace util { 22 | 23 | std::vector HashData(const uint8_t* data, size_t size) { 24 | std::vector ret(CC_MD5_DIGEST_LENGTH); 25 | CHECK(CC_MD5(data, size, ret.data())); 26 | return ret; 27 | } 28 | 29 | } // namespace util 30 | } // namespace shaka 31 | -------------------------------------------------------------------------------- /shaka/src/util/crypto_openssl.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | #include 17 | 18 | #include "src/util/crypto.h" 19 | 20 | #define HASH_ALGORITHM EVP_md5() 21 | 22 | namespace shaka { 23 | namespace util { 24 | 25 | std::vector HashData(const uint8_t* data, size_t size) { 26 | EVP_MD_CTX* ctx = EVP_MD_CTX_create(); 27 | CHECK(ctx); 28 | 29 | CHECK_EQ(EVP_DigestInit_ex(ctx, HASH_ALGORITHM, nullptr), 1u); 30 | CHECK_EQ(EVP_DigestUpdate(ctx, data, size), 1u); 31 | 32 | std::vector result(EVP_MD_size(HASH_ALGORITHM)); 33 | CHECK_EQ(EVP_DigestFinal_ex(ctx, result.data(), nullptr), 1u); 34 | return result; 35 | } 36 | 37 | } // namespace util 38 | } // namespace shaka 39 | -------------------------------------------------------------------------------- /shaka/src/util/darwin_utils.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_UTIL_DARWIN_UTILS_H_ 16 | #define SHAKA_EMBEDDED_UTIL_DARWIN_UTILS_H_ 17 | 18 | #ifdef __APPLE__ 19 | 20 | # include 21 | 22 | namespace shaka { 23 | namespace util { 24 | 25 | std::string GetTemporaryDirectory(); 26 | 27 | } // namespace util 28 | } // namespace shaka 29 | 30 | #endif 31 | 32 | #endif // SHAKA_EMBEDDED_UTIL_DARWIN_UTILS_H_ 33 | -------------------------------------------------------------------------------- /shaka/src/util/darwin_utils.mm: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifdef __APPLE__ 16 | 17 | # include "src/util/darwin_utils.h" 18 | 19 | # include 20 | # include 21 | 22 | # include 23 | 24 | namespace shaka { 25 | namespace util { 26 | 27 | std::string GetTemporaryDirectory() { 28 | @autoreleasepool { 29 | NSString *dir = NSTemporaryDirectory(); 30 | CHECK(dir); 31 | return [dir UTF8String]; 32 | } 33 | } 34 | 35 | } // namespace util 36 | } // namespace shaka 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /shaka/src/util/file_system_win.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | #include 17 | 18 | #include "src/util/file_system.h" 19 | 20 | namespace shaka { 21 | namespace util { 22 | 23 | // static 24 | std::string FileSystem::PathJoin(const std::string& a, const std::string& b) { 25 | std::string ret(MAX_PATH, '\0'); 26 | if (!PathCombineA(ret.c_str(), a.c_str(), b.c_str())) 27 | return ""; 28 | ret.resize(strlen(ret.c_str())); 29 | return ret; 30 | } 31 | 32 | // static 33 | std::string FileSystem::DirName(const std::string& path) { 34 | #error "Not implemented for Windows" 35 | } 36 | 37 | bool FileSystem::FileExists(const std::string& path) const { 38 | // Cannot use fstream for this since it allows opening directories. 39 | return PathFileExists(path.c_str()); 40 | } 41 | 42 | bool FileSystem::DirectoryExists(const std::string& path) const { 43 | return PathIsDirectory(path.c_str()); 44 | } 45 | 46 | bool FileSystem::ListFiles(const std::string& path, 47 | std::vector* files) const { 48 | files->clear(); 49 | 50 | #error "Not implemented for Windows" 51 | 52 | return true; 53 | } 54 | 55 | } // namespace util 56 | } // namespace shaka 57 | -------------------------------------------------------------------------------- /shaka/test/media/clear_high.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/test/media/clear_high.mp4 -------------------------------------------------------------------------------- /shaka/test/media/clear_high.mp4.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/test/media/clear_high.mp4.dat -------------------------------------------------------------------------------- /shaka/test/media/clear_low.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/test/media/clear_low.mp4 -------------------------------------------------------------------------------- /shaka/test/media/clear_low.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/test/media/clear_low.webm -------------------------------------------------------------------------------- /shaka/test/media/clear_low_frag_init.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/test/media/clear_low_frag_init.mp4 -------------------------------------------------------------------------------- /shaka/test/media/clear_low_frag_init.mp4.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/test/media/clear_low_frag_init.mp4.dat -------------------------------------------------------------------------------- /shaka/test/media/clear_low_frag_seg1.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/test/media/clear_low_frag_seg1.mp4 -------------------------------------------------------------------------------- /shaka/test/media/clear_low_frag_seg1.mp4.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/test/media/clear_low_frag_seg1.mp4.dat -------------------------------------------------------------------------------- /shaka/test/media/clear_low_hevc.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/test/media/clear_low_hevc.mp4 -------------------------------------------------------------------------------- /shaka/test/media/clear_low_hevc.mp4.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/test/media/clear_low_hevc.mp4.dat -------------------------------------------------------------------------------- /shaka/test/media/dash.mpd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd 9 | 10 | 11 | 12 | 13 | text_en.mp4 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | video_240p_242k_h264.mp4 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /shaka/test/media/encrypted_key_rotation.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/test/media/encrypted_key_rotation.mp4 -------------------------------------------------------------------------------- /shaka/test/media/encrypted_low.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/test/media/encrypted_low.mp4 -------------------------------------------------------------------------------- /shaka/test/media/encrypted_low.mp4.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/test/media/encrypted_low.mp4.dat -------------------------------------------------------------------------------- /shaka/test/media/encrypted_low.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/test/media/encrypted_low.webm -------------------------------------------------------------------------------- /shaka/test/media/encrypted_low_cbcs.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/test/media/encrypted_low_cbcs.mp4 -------------------------------------------------------------------------------- /shaka/test/media/encrypted_low_cenc.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/shaka/test/media/encrypted_low_cenc.mp4 -------------------------------------------------------------------------------- /shaka/test/src/test/global_fields.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_TEST_GLOBAL_FIELDS_H_ 16 | #define SHAKA_EMBEDDED_TEST_GLOBAL_FIELDS_H_ 17 | 18 | #include "shaka/media/default_media_player.h" 19 | #include "shaka/js_manager.h" 20 | 21 | namespace shaka { 22 | 23 | // Defined and initialized in //shaka/test/main.cc 24 | 25 | extern media::DefaultMediaPlayer* g_media_player; 26 | extern JsManager* g_js_manager; 27 | 28 | } // namespace shaka 29 | 30 | #endif // SHAKA_EMBEDDED_TEST_GLOBAL_FIELDS_H_ 31 | -------------------------------------------------------------------------------- /shaka/test/src/test/js_test_fixture.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_TEST_JS_TEST_FIXTURE_H_ 16 | #define SHAKA_EMBEDDED_TEST_JS_TEST_FIXTURE_H_ 17 | 18 | namespace shaka { 19 | 20 | void RegisterTestFixture(); 21 | 22 | } // namespace shaka 23 | 24 | #endif // SHAKA_EMBEDDED_TEST_JS_TEST_FIXTURE_H_ 25 | -------------------------------------------------------------------------------- /shaka/test/src/test/media_files.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef SHAKA_EMBEDDED_TEST_TEST_MEDIA_FILES_H_ 16 | #define SHAKA_EMBEDDED_TEST_TEST_MEDIA_FILES_H_ 17 | 18 | #include 19 | #include 20 | 21 | namespace shaka { 22 | 23 | /** 24 | * Searches for the media files directory. This needs to be called during 25 | * initialization and should be given argv[0]. 26 | */ 27 | void InitMediaFiles(const char* arg0); 28 | 29 | /** Gets the bytes from the media file with the given name. */ 30 | std::vector GetMediaFile(const std::string& file_name); 31 | 32 | } // namespace shaka 33 | 34 | #endif // SHAKA_EMBEDDED_TEST_TEST_MEDIA_FILES_H_ 35 | -------------------------------------------------------------------------------- /shaka/test/src/test/media_files_ios.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | 17 | #include "src/test/media_files.h" 18 | #include "src/util/file_system.h" 19 | 20 | namespace shaka { 21 | 22 | // Unlike in POSIX, we don't need to search for the media directory. 23 | void InitMediaFiles(const char* arg0) {} 24 | 25 | std::vector GetMediaFile(const std::string& file_name) { 26 | const std::string path = 27 | util::FileSystem::GetPathForStaticFile(".", true, file_name); 28 | util::FileSystem fs; 29 | std::vector ret; 30 | CHECK(fs.ReadFile(path, &ret)); 31 | return ret; 32 | } 33 | 34 | } // namespace shaka 35 | -------------------------------------------------------------------------------- /shaka/test/src/test/v8_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "src/test/v8_test.h" 16 | 17 | namespace shaka { 18 | 19 | V8Test::V8Test() {} 20 | V8Test::~V8Test() {} 21 | 22 | void V8Test::SetUp() { 23 | engine_.reset(new JsEngine); 24 | setup_.reset(new JsEngine::SetupContext); 25 | } 26 | 27 | void V8Test::TearDown() { 28 | setup_.reset(); 29 | engine_.reset(); 30 | } 31 | 32 | } // namespace shaka 33 | -------------------------------------------------------------------------------- /shaka/tools/touch.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # Copyright 2018 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | """A GN utility that touches the given files.""" 18 | 19 | import argparse 20 | import os 21 | import sys 22 | 23 | 24 | def Touch(path, create=True): 25 | if not os.path.exists(path): 26 | if create: 27 | with open(path, 'w'): 28 | pass 29 | else: 30 | raise IOError('File not found') 31 | os.utime(path, None) 32 | 33 | 34 | if __name__ == '__main__': 35 | parser = argparse.ArgumentParser(description=__doc__) 36 | parser.add_argument('--new-file', action='append', 37 | help="Touch these files and create if they don't exist.") 38 | parser.add_argument('files', nargs='*', 39 | help='The files to update, must already exist.') 40 | 41 | args = parser.parse_args(sys.argv[1:]) 42 | for f in args.new_file: 43 | Touch(f, create=True) 44 | for f in args.files: 45 | Touch(f, create=False) 46 | -------------------------------------------------------------------------------- /shaka/tools/webidl/tests/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # Copyright 2018 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | -------------------------------------------------------------------------------- /shaka/tools/webidl/webidl/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # Copyright 2018 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Expose all the parser types on the |webidl| package. 17 | from .lexer import * 18 | from .parser import * 19 | from .types import * 20 | -------------------------------------------------------------------------------- /third_party/curl/LICENSE: -------------------------------------------------------------------------------- 1 | COPYRIGHT AND PERMISSION NOTICE 2 | 3 | Copyright (c) 1996 - 2017, Daniel Stenberg, , and many 4 | contributors, see the THANKS file. 5 | 6 | All rights reserved. 7 | 8 | Permission to use, copy, modify, and distribute this software for any purpose 9 | with or without fee is hereby granted, provided that the above copyright 10 | notice and this permission notice appear in all copies. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN 15 | NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 16 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 17 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 18 | OR OTHER DEALINGS IN THE SOFTWARE. 19 | 20 | Except as contained in this notice, the name of a copyright holder shall not 21 | be used in advertising or otherwise to promote the sale, use or other dealings 22 | in this Software without prior written authorization of the copyright holder. 23 | -------------------------------------------------------------------------------- /third_party/curl/config/linux/find_curl_ca_bundle.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # Copyright 2015 Google Inc. All rights reserved. 3 | # 4 | # Use of this source code is governed by a BSD-style 5 | # license that can be found in the LICENSE file or at 6 | # https://developers.google.com/open-source/licenses/bsd 7 | 8 | # Modified from: 9 | # https://github.com/shaka-project/shaka-packager/blob/main/packager/third_party/curl/config/linux/find_curl_ca_bundle.sh 10 | 11 | from __future__ import print_function 12 | 13 | import os 14 | 15 | 16 | paths = [ 17 | '/etc/pki/tls/certs/ca-bundle.crt', 18 | '/etc/ssl/cert.pem', 19 | '/etc/ssl/certs/ca-bundle.crt', 20 | '/etc/ssl/certs/ca-certificates.crt', 21 | '/usr/local/share/certs/ca-root.crt', 22 | '/usr/share/ssl/certs/ca-bundle.crt', 23 | ] 24 | 25 | 26 | def find_ca(): 27 | """Returns the path to an existing CA bundle.""" 28 | for f in paths: 29 | if os.path.isfile(f): 30 | return f 31 | raise Exception('Unable to locate SSL CA cert') 32 | 33 | 34 | if __name__ == '__main__': 35 | print(find_ca()) 36 | -------------------------------------------------------------------------------- /third_party/extraLicenses.txt: -------------------------------------------------------------------------------- 1 | Dig the Uke 2 | From: http://dig.ccmixter.org/files/JeffSpeed68/53327\nLicensed under Creative Commons BY-NC 3.0.\nFree for non-commercial use with attribution.\nhttp://creativecommons.org/licenses/by-nc/3.0/ -------------------------------------------------------------------------------- /third_party/ffmpeg/avformat.patch: -------------------------------------------------------------------------------- 1 | diff --git a/libavformat/avformat.h b/libavformat/avformat.h 2 | index fdaffa5bf41..b51e50c5cd8 100644 3 | --- a/libavformat/avformat.h 4 | +++ b/libavformat/avformat.h 5 | @@ -320,7 +320,7 @@ 6 | #include "libavutil/dict.h" 7 | #include "libavutil/log.h" 8 | 9 | -#include "avio.h" 10 | +#include "libavformat/avio.h" 11 | #include "libavformat/version.h" 12 | 13 | struct AVFormatContext; 14 | @@ -2167,6 +2167,14 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c); 15 | int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type, 16 | uint8_t *data, size_t size); 17 | 18 | +/** 19 | + * Remove the given side data type from the stream. 20 | + * 21 | + * @param st stream 22 | + * @param type side information type 23 | + */ 24 | +void av_stream_remove_side_data(AVStream *st, enum AVPacketSideDataType type); 25 | + 26 | /** 27 | * Allocate new information from stream. 28 | * 29 | -------------------------------------------------------------------------------- /third_party/ffmpeg/mkv.patch: -------------------------------------------------------------------------------- 1 | diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c 2 | index 2faaf9dfb8b..38ce66157a4 100644 3 | --- a/libavformat/matroskadec.c 4 | +++ b/libavformat/matroskadec.c 5 | @@ -80,6 +80,7 @@ typedef enum { 6 | EBML_PASS, 7 | EBML_STOP, 8 | EBML_SINT, 9 | + EBML_NEW_INIT_SEGMENT, 10 | EBML_TYPE_COUNT 11 | } EbmlType; 12 | 13 | @@ -734,6 +735,7 @@ static const EbmlSyntax matroska_cluster_incremental_parsing[] = { 14 | { MATROSKA_ID_CUES, EBML_NONE }, 15 | { MATROSKA_ID_TAGS, EBML_NONE }, 16 | { MATROSKA_ID_SEEKHEAD, EBML_NONE }, 17 | + { EBML_ID_HEADER, EBML_NEW_INIT_SEGMENT }, 18 | { MATROSKA_ID_CLUSTER, EBML_STOP }, 19 | { 0 } 20 | }; 21 | @@ -1230,6 +1232,8 @@ static int ebml_parse_elem(MatroskaDemuxContext *matroska, 22 | return ebml_parse_id(matroska, syntax->def.n, id, data); 23 | case EBML_STOP: 24 | return 1; 25 | + case EBML_NEW_INIT_SEGMENT: 26 | + return -123456; 27 | default: 28 | if (ffio_limit(pb, length) != length) 29 | return AVERROR(EIO); 30 | @@ -3514,7 +3518,10 @@ static int matroska_read_packet(AVFormatContext *s, AVPacket *pkt) 31 | int64_t pos = avio_tell(matroska->ctx->pb); 32 | if (matroska->done) 33 | return (ret < 0) ? ret : AVERROR_EOF; 34 | - if (matroska_parse_cluster(matroska) < 0) 35 | + ret = matroska_parse_cluster(matroska); 36 | + if (ret == -123456) 37 | + break; 38 | + else if (ret < 0) 39 | ret = matroska_resync(matroska, pos); 40 | } 41 | 42 | -------------------------------------------------------------------------------- /third_party/ffmpeg/mov.patch: -------------------------------------------------------------------------------- 1 | diff --git a/libavformat/mov.c b/libavformat/mov.c 2 | index 522ce60c2d..289bad1e2a 100644 3 | --- a/libavformat/mov.c 4 | +++ b/libavformat/mov.c 5 | @@ -1153,9 +1153,8 @@ static int mov_read_moov(MOVContext *c, AVIOContext *pb, MOVAtom atom) 6 | int ret; 7 | 8 | if (c->found_moov) { 9 | - av_log(c->fc, AV_LOG_WARNING, "Found duplicated MOOV Atom. Skipped it\n"); 10 | - avio_skip(pb, atom.size); 11 | - return 0; 12 | + av_log(c->fc, AV_LOG_INFO, "Found duplicated MOOV Atom. Stopping.\n"); 13 | + return -123456; 14 | } 15 | 16 | if ((ret = mov_read_default(c, pb, atom)) < 0) 17 | -------------------------------------------------------------------------------- /third_party/ffmpeg/opus.patch: -------------------------------------------------------------------------------- 1 | diff --git a/libavcodec/opus_parser.c b/libavcodec/opus_parser.c 2 | index 28b09339009..d76f0e48a0b 100644 3 | --- a/libavcodec/opus_parser.c 4 | +++ b/libavcodec/opus_parser.c 5 | @@ -25,10 +25,10 @@ 6 | * Determines the duration for each packet. 7 | */ 8 | 9 | -#include "avcodec.h" 10 | -#include "bytestream.h" 11 | -#include "opus.h" 12 | -#include "parser.h" 13 | +#include "libavcodec/avcodec.h" 14 | +#include "libavcodec/bytestream.h" 15 | +#include "libavcodec/opus.h" 16 | +#include "libavcodec/parser.h" 17 | 18 | typedef struct OpusParseContext { 19 | ParseContext pc; 20 | @@ -180,9 +180,7 @@ static int opus_parse(AVCodecParserContext *ctx, AVCodecContext *avctx, 21 | } 22 | 23 | if (next == AVERROR_INVALIDDATA){ 24 | - *poutbuf = NULL; 25 | - *poutbuf_size = 0; 26 | - return buf_size; 27 | + next = buf_size; 28 | } 29 | 30 | *poutbuf = buf + header_len; 31 | -------------------------------------------------------------------------------- /third_party/ffmpeg/utils.patch: -------------------------------------------------------------------------------- 1 | diff --git a/libavformat/utils.c b/libavformat/utils.c 2 | index b0b5e164a6e..ca6856abdf7 100644 3 | --- a/libavformat/utils.c 4 | +++ b/libavformat/utils.c 5 | @@ -1240,15 +1240,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, 6 | 7 | if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && pkt->dts != AV_NOPTS_VALUE) { 8 | if (pkt->dts == pkt->pts && st->last_dts_for_order_check != AV_NOPTS_VALUE) { 9 | - if (st->last_dts_for_order_check <= pkt->dts) { 10 | - st->dts_ordered++; 11 | - } else { 12 | - av_log(s, st->dts_misordered ? AV_LOG_DEBUG : AV_LOG_WARNING, 13 | - "DTS %"PRIi64" < %"PRIi64" out of order\n", 14 | - pkt->dts, 15 | - st->last_dts_for_order_check); 16 | - st->dts_misordered++; 17 | - } 18 | + st->dts_ordered++; 19 | if (st->dts_ordered + st->dts_misordered > 250) { 20 | st->dts_ordered >>= 1; 21 | st->dts_misordered >>= 1; 22 | @@ -5509,6 +5501,17 @@ uint8_t *av_stream_new_side_data(AVStream *st, enum AVPacketSideDataType type, 23 | return data; 24 | } 25 | 26 | +void av_stream_remove_side_data(AVStream *st, enum AVPacketSideDataType type) 27 | +{ 28 | + for (int i = 0; i < st->nb_side_data; i++) { 29 | + if (st->side_data[i].type == type) { 30 | + av_freep(&st->side_data[i].data); 31 | + st->side_data[i] = st->side_data[st->nb_side_data - 1]; 32 | + st->nb_side_data--; 33 | + } 34 | + } 35 | +} 36 | + 37 | int ff_stream_add_bitstream_filter(AVStream *st, const char *name, const char *args) 38 | { 39 | int ret; 40 | -------------------------------------------------------------------------------- /third_party/gflags/BUILD.gn: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | config("internal_config") { 16 | include_dirs = [ 17 | "src/src", 18 | "$root_gen_dir/gflags/include/gflags", 19 | ] 20 | 21 | defines = [ 22 | "GFLAGS_DLL_DECL=__attribute__((visibility(\"default\")))", 23 | ] 24 | } 25 | 26 | config("external_config") { 27 | include_dirs = [ 28 | "$root_gen_dir/gflags/include", 29 | ] 30 | } 31 | 32 | component("gflags") { 33 | sources = [ 34 | "src/src/gflags.cc", 35 | "src/src/gflags_completions.cc", 36 | "src/src/gflags_reporting.cc", 37 | ] 38 | 39 | if (is_win) { 40 | sources += [ 41 | "src/src/windows_port.cc", 42 | ] 43 | } 44 | 45 | configs -= [ "//build/config/compiler:chromium_code" ] 46 | configs += [ "//build/config/compiler:no_chromium_code" ] 47 | 48 | configs += [ ":internal_config" ] 49 | public_configs = [ ":external_config" ] 50 | } 51 | -------------------------------------------------------------------------------- /third_party/gflags/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006, Google Inc. 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 are 6 | 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 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /third_party/googletest/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008, Google Inc. 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 are 6 | 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 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /third_party/jasmine/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-2017 Pivotal Labs 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /third_party/jasmine/README.md: -------------------------------------------------------------------------------- 1 | DOM-less simple JavaScript testing framework http://jasmine.github.io/ 2 | 3 | |jasmine.js| is the standalone release 2.8.0 (8cf8736) of Jasmine. 4 | -------------------------------------------------------------------------------- /third_party/jasmine/jasmine_boot.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2008-2016 Pivotal Labs 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 19 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 20 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 21 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | /* 25 | * Derived from: 26 | * https://github.com/jasmine/jasmine/blob/master/lib/jasmine-core/boot/boot.js 27 | */ 28 | 29 | (function() { 30 | /** 31 | * Require Jasmine's core files. Specifically, this requires and attaches all 32 | * of Jasmine's code to the `jasmine` reference. 33 | */ 34 | window.jasmine = jasmineRequire.core(jasmineRequire); 35 | }()); 36 | -------------------------------------------------------------------------------- /third_party/libxml/LICENSE: -------------------------------------------------------------------------------- 1 | Except where otherwise noted in the source code (e.g. the files hash.c, 2 | list.c and the trio files, which are covered by a similar licence but 3 | with different Copyright notices) all the files are: 4 | 5 | Copyright (C) 1998-2012 Daniel Veillard. All Rights Reserved. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is fur- 12 | nished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- 19 | NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /third_party/licensePaths.txt: -------------------------------------------------------------------------------- 1 | Shaka Player: ../LICENSE 2 | Chromium: ../LICENSE.chromium 3 | curl: curl/LICENSE 4 | FFmpeg: ffmpeg/LICENSE 5 | gflags: gflags/LICENSE 6 | glog: glog/LICENSE 7 | libxml: libxml/LICENSE 8 | protobuf: protobuf/LICENSE 9 | sdl2: sdl2/LICENSE 10 | zlib: zlib/LICENSE 11 | -------------------------------------------------------------------------------- /third_party/protobuf/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008 Google Inc. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | Code generated by the Protocol Buffer compiler is owned by the owner 30 | of the input file used when generating it. This code is not 31 | standalone and requires a support library to be linked with it. This 32 | support library is itself covered by the above license. 33 | -------------------------------------------------------------------------------- /third_party/protobuf/wrapper.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # Copyright 2017 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | """A wrapper script to execute the given command. 17 | 18 | This will simply execute the command that is specified in the command-line 19 | arguments. This is required since GN only accepts python files in actions. 20 | This is used to invoke the protoc compiler. 21 | """ 22 | 23 | import subprocess 24 | import sys 25 | 26 | 27 | if __name__ == '__main__': 28 | subprocess.check_call(sys.argv[1:]) 29 | -------------------------------------------------------------------------------- /third_party/pymake/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2009 The Mozilla Foundation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /third_party/sdl2/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors 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 | -------------------------------------------------------------------------------- /third_party/zlib/BUILD.gn: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | config("external_config") { 16 | include_dirs = [ 17 | "src", 18 | ] 19 | 20 | defines = [ 21 | "HAVE_UNISTD_H", 22 | "HAVE_STDARG_H", 23 | # This allows using the 'const' keyword. But don't define it since gecko 24 | # assumes the fields are non-const. 25 | # "ZLIB_CONST", 26 | ] 27 | } 28 | 29 | component("zlib") { 30 | sources = [ 31 | "src/adler32.c", 32 | "src/crc32.c", 33 | "src/deflate.c", 34 | "src/infback.c", 35 | "src/inffast.c", 36 | "src/inflate.c", 37 | "src/inftrees.c", 38 | "src/trees.c", 39 | "src/uncompr.c", 40 | "src/zutil.c", 41 | 42 | # Don't include the compression code. 43 | # "src/compress.c", 44 | # "src/gzclose.c", 45 | # "src/gzlib.c", 46 | # "src/gzread.c", 47 | # "src/gzwrite.c", 48 | ] 49 | 50 | configs -= [ "//build/config/compiler:chromium_code" ] 51 | configs += [ "//build/config/compiler:no_chromium_code" ] 52 | 53 | if (is_component_build) { 54 | configs -= [ "//build/config/gcc:symbol_visibility_hidden" ] 55 | configs += [ "//build/config/gcc:symbol_visibility_default" ] 56 | } 57 | 58 | public_configs = [ ":external_config" ] 59 | } 60 | 61 | -------------------------------------------------------------------------------- /third_party/zlib/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright notice: 2 | 3 | (C) 1995-2017 Jean-loup Gailly and Mark Adler 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors 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 | Jean-loup Gailly Mark Adler 22 | jloup@gzip.org madler@alumni.caltech.edu 23 | 24 | If you use the zlib library in a product, we would appreciate *not* receiving 25 | lengthy legal documents to sign. The sources are provided for free but without 26 | warranty of any kind. The library has been entirely written by Jean-loup 27 | Gailly and Mark Adler; it does not include third-party code. 28 | 29 | If you redistribute modified sources, we would appreciate that you include in 30 | the file ChangeLog history information documenting your changes. Please read 31 | the FAQ for more information on the distribution of modified source versions. 32 | -------------------------------------------------------------------------------- /third_party/zlib/zlib.h: -------------------------------------------------------------------------------- 1 | src/zlib.h -------------------------------------------------------------------------------- /tools/cfi/blacklist.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/tools/cfi/blacklist.txt -------------------------------------------------------------------------------- /tools/memory/asan/blacklist.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/tools/memory/asan/blacklist.txt -------------------------------------------------------------------------------- /tools/memory/tsan_v2/ignores.txt: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # TSan blacklist. 3 | 4 | # Ignore errors in V8. 5 | fun:*ThreadData*Initialize* 6 | fun:*v8*internal*ThreadEntry* 7 | -------------------------------------------------------------------------------- /tools/ubsan/blacklist.txt: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # UBSan blacklist. 3 | 4 | # We don't control V8 and it gives too many false positives. 5 | src:*/v8/* 6 | 7 | # We don't control SDL and it causes segfaults if enabled. 8 | src:*/sdl2/* 9 | -------------------------------------------------------------------------------- /tools/ubsan/vptr_blacklist.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shaka-project/shaka-player-embedded/1fa1114c5b0a7ad23be27cb6a3dee7cc501bf696/tools/ubsan/vptr_blacklist.txt --------------------------------------------------------------------------------