New MP4 muxer + Queue changes + Storage fixes

Main changes:
* correctly check the available space (CircularFile.java)
* misc cleanup (CircularFile.java)
* use the "Error Reporter" for non-http errors
* rewrite network state checking and add better support for API 21 (Lollipop) or higher
* implement "metered networks"
* add buttons in "Downloads" activity to start/pause all pending downloads, ignoring the queue flag or if the network is "metered"
* add workaround for VPN connections and/or network switching. Example: switching WiFi to 3G
* rewrite DataReader ¡Webm muxer is now 57% more faster!
* rewrite CircularFile, use file buffers instead of memory buffers. Less troubles in low-end devices
* fix missing offset for KaxCluster (WebMWriter.java), manifested as no thumbnails on file explorers

Download queue:
* remember queue status, unless the user pause the download (un-queue)
* semi-automatic downloads, between networks. Effective if the user create a new download or the downloads activity is starts
* allow enqueue failed downloads
* new option, queue limit, enabled by default. Used to allow one or multiple downloads at same time

Miscellaneous:
* fix crash while selecting details/error menu (mistake on MissionFragment.java)
* misc serialize changes (DownloadMission.java)
* minor UI tweaks
* allow overwrite paused downloads
* fix wrong icons for grid/list button in downloads
* add share option
* implement #2006
* correct misspelled word in strings.xml (es) (cmn)
* fix MissionAdapter crash during device shutdown

New Mp4Muxer + required changes:
* new mp4 muxer (from dash only) with this, muxing on Android 7 is possible now!!!
* re-work in SharpStream
* drop mp4 dash muxer
* misc changes: add warning in SecondaryStreamHelper.java,
* strip m4a DASH files to normal m4a format (youtube only)

Fix storage issues:
* warn to the user if is choosing a "read only" download directory (for external SD Cards), useless is rooted :)
* "write proof" allow post-processing resuming only if the device ran out of space
* implement "insufficient storage" error for downloads
This commit is contained in:
kapodamy 2019-03-22 22:54:07 -03:00
parent 1684a2110c
commit 9e34fee58c
49 changed files with 2715 additions and 1936 deletions

View file

@ -25,6 +25,7 @@
<attr name="search_add" format="reference"/>
<attr name="options" format="reference"/>
<attr name="play" format="reference"/>
<attr name="pause" format="reference"/>
<attr name="bug" format="reference"/>
<attr name="settings" format="reference"/>
<attr name="ic_hot" format="reference"/>

View file

@ -192,6 +192,7 @@
</string-array>
<string name="downloads_cross_network" translatable="false">cross_network_downloads</string>
<string name="downloads_queue_limit" translatable="false">downloads_queue_limit</string>
<string name="default_download_threads" translatable="false">default_download_threads</string>

View file

@ -196,6 +196,7 @@
<string name="invalid_url_toast">Invalid URL</string>
<string name="video_streams_empty">No video streams found</string>
<string name="audio_streams_empty">No audio streams found</string>
<string name="missing_file">File moved or deleted</string>
<string name="invalid_directory">No such folder</string>
<string name="invalid_source">No such file/content source</string>
<string name="invalid_file">The file doesn\'t exist or permission to read or write to it is lacking</string>
@ -513,6 +514,8 @@
<string name="overwrite">Overwrite</string>
<string name="overwrite_warning">A downloaded file with this name already exists</string>
<string name="download_already_running">There is a download in progress with this name</string>
<string name="download_already_pending">There is a pending download with this name</string>
<!-- message dialog about download error -->
<string name="show_error">Show error</string>
<string name="label_code">Code</string>
@ -527,13 +530,20 @@
<string name="error_http_requested_range_not_satisfiable">Requested range not satisfiable</string>
<string name="error_http_not_found">Not found</string>
<string name="error_postprocessing_failed">Post-processing failed</string>
<string name="error_postprocessing_stopped">NewPipe was closed while working on the file</string>
<string name="error_insufficient_storage">No space left on device</string>
<string name="clear_finished_download">Clear finished downloads</string>
<string name="msg_pending_downloads">Continue your %s pending transfers from Downloads</string>
<string name="stop">Stop</string>
<string name="max_retry_msg">Maximum retries</string>
<string name="max_retry_desc">Maximum number of attempts before canceling the download</string>
<string name="pause_downloads_on_mobile">Pause on switching to mobile data</string>
<string name="pause_downloads_on_mobile_desc">Downloads that can not be paused will be restarted</string>
<string name="pause_downloads_on_mobile">Interrupt on metered networks</string>
<string name="pause_downloads_on_mobile_desc">Useful when switching to mobile data, although some downloads cannot be suspended</string>
<string name="close">Close</string>
<string name="enable_queue_limit">Limit download queue</string>
<string name="enable_queue_limit_desc">One download will run at the same time</string>
<string name="start_downloads">Start downloads</string>
<string name="pause_downloads">Pause downloads</string>
</resources>

View file

@ -41,6 +41,7 @@
<item name="search_add">@drawable/ic_arrow_top_left_black_24dp</item>
<item name="options">@drawable/ic_more_vert_black_24dp</item>
<item name="play">@drawable/ic_play_arrow_black_24dp</item>
<item name="pause">@drawable/ic_pause_black_24dp</item>
<item name="settings">@drawable/ic_settings_black_24dp</item>
<item name="ic_hot">@drawable/ic_whatshot_black_24dp</item>
<item name="ic_channel">@drawable/ic_channel_black_24dp</item>
@ -119,6 +120,7 @@
<item name="ic_list">@drawable/ic_list_white_24dp</item>
<item name="ic_grid">@drawable/ic_grid_white_24dp</item>
<item name="ic_delete">@drawable/ic_delete_white_24dp</item>
<item name="pause">@drawable/ic_pause_white_24dp</item>
<item name="ic_settings_update">@drawable/ic_settings_update_white</item>
<item name="separator_color">@color/dark_separator_color</item>