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

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

View file

@ -7,6 +7,18 @@
android:title="@string/grid"
app:showAsAction="ifRoom" />
<item android:id="@+id/start_downloads"
android:visible="false"
android:icon="?attr/play"
android:title="@string/start_downloads"
app:showAsAction="ifRoom" />
<item android:id="@+id/pause_downloads"
android:visible="false"
android:icon="?attr/pause"
android:title="@string/pause_downloads"
app:showAsAction="ifRoom" />
<item android:id="@+id/clear_list"
android:visible="false"
android:icon="?attr/ic_delete"

View file

@ -1,4 +1,13 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/retry"
android:title="@string/retry" />
<item
android:id="@+id/cancel"
android:title="@string/cancel" />
<item
android:id="@+id/start"
android:title="@string/start" />
@ -13,8 +22,8 @@
android:checkable="true"/>
<item
android:id="@+id/open"
android:title="@string/view" />
android:id="@+id/menu_item_share"
android:title="@string/share" />
<item
android:id="@+id/delete"

View file

@ -434,7 +434,7 @@
<string name="permission_denied">系统拒绝该行动</string>
<string name="download_failed">下载失败</string>
<string name="download_finished">下载完成</string>
<string name="download_finished_more">%已下载完毕</string>
<string name="download_finished_more">%s已下载完毕</string>
<string name="generate_unique_name">生成独特的名字</string>
<string name="overwrite">覆写</string>
<string name="overwrite_warning">同名的已下载文件已经存在</string>

View file

@ -159,7 +159,7 @@ abrir en modo popup</string>
<string name="contribution_encouragement">Si tienes ideas de; traducción, cambios de diseño, limpieza de código o cambios de código realmente fuertes—la ayuda siempre es bienvenida. Cuanto más se hace, mejor se pone!</string>
<string name="read_full_license">Leer licencia</string>
<string name="contribution_title">Contribuir</string>
<string name="subscribe_button_title">Suscribirse</string>
<string name="subscribe_button_title">Suscribirse</string>
<string name="subscribed_button_title">Suscrito</string>
<string name="channel_unsubscribed">Canal no suscrito</string>
<string name="subscription_change_failed">No se pudo cambiar la suscripción</string>
@ -211,8 +211,8 @@ abrir en modo popup</string>
<item quantity="other">Vídeos</item>
</plurals>
<string name="item_deleted">Elemento eliminado</string>
<string name="delete_item_search_history">¿Desea eliminar este elemento del historial de búsqueda?</string>
<string name="main_page_content">Contenido de la página principal</string>
<string name="delete_item_search_history">¿Desea eliminar este elemento del historial de búsqueda?</string>
<string name="main_page_content">Contenido de la página principal</string>
<string name="blank_page_summary">Página en blanco</string>
<string name="kiosk_page_summary">Página del kiosco</string>
<string name="subscription_page_summary">Página de suscripción</string>
@ -224,7 +224,7 @@ abrir en modo popup</string>
<string name="kiosk">Kiosco</string>
<string name="trending">Tendencias</string>
<string name="top_50">Top 50</string>
<string name="show_hold_to_append_summary">Mostrar sugerencia cuando se presiona el botón de segundo plano o popup en la página de detalles del vídeo</string>
<string name="show_hold_to_append_summary">Mostrar sugerencia cuando se presiona el botón de segundo plano o popup en la página de detalles del vídeo</string>
<string name="background_player_append">En cola en el reproductor de fondo</string>
<string name="popup_playing_append">En cola en el reproductor popup</string>
<string name="play_all">Reproducir todo</string>
@ -242,7 +242,7 @@ abrir en modo popup</string>
<string name="start_here_on_main">Comenzar a reproducir aquí</string>
<string name="start_here_on_background">Comenzar aquí en segundo plano</string>
<string name="start_here_on_popup">Comenzar aquí en popup</string>
<string name="show_hold_to_append_title">Mostrar consejo \"Mantener para poner en la cola\"</string>
<string name="show_hold_to_append_title">Mostrar consejo \"Mantener para poner en la cola\"</string>
<string name="new_and_hot">Nuevo y popular</string>
<string name="hold_to_append">Mantener para poner en la cola</string>
<string name="donation_title">Donar</string>
@ -270,7 +270,7 @@ abrir en modo popup</string>
<string name="popup_player">Reproductor de popup</string>
<string name="preferred_player_fetcher_notification_title">Obteniendo información…</string>
<string name="preferred_player_fetcher_notification_message">Cargando contenido solicitado</string>
<string name="import_data_title">Importar base de datos</string>
<string name="import_data_title">Importar base de datos</string>
<string name="export_data_title">Exportar base de datos</string>
<string name="import_data_summary">Reemplazará su historial actual y sus suscripciones</string>
<string name="export_data_summary">Exportar historial, suscripciones y listas de reproducción</string>
@ -325,6 +325,7 @@ abrir en modo popup</string>
<string name="live">DIRECTO</string>
<string name="live_sync">SINCRONIZAR</string>
<string name="file">Archivo</string>
<string name="missing_file">Archivo movido o eliminado</string>
<string name="invalid_directory">No existe el directorio</string>
<string name="invalid_source">No existe la fuente del archivo/contenido</string>
<string name="invalid_file">El archivo no existe o insuficientes permisos para leerlo o escribir en él</string>
@ -419,6 +420,8 @@ abrir en modo popup</string>
<string name="overwrite">Sobrescribir</string>
<string name="overwrite_warning">Ya existe un archivo descargado con este nombre</string>
<string name="download_already_running">Hay una descarga en curso con este nombre</string>
<string name="download_already_pending">Hay una descarga pendiente con este nombre</string>
<string name="grid">Mostrar como grilla</string>
<string name="list">Mostrar como lista</string>
<string name="clear_finished_download">Limpiar descargas finalizadas</string>
@ -426,8 +429,14 @@ abrir en modo popup</string>
<string name="stop">Detener</string>
<string name="max_retry_msg">Intentos máximos</string>
<string name="max_retry_desc">Cantidad máxima de intentos antes de cancelar la descarga</string>
<string name="pause_downloads_on_mobile">Pausar al cambiar a datos moviles</string>
<string name="pause_downloads_on_mobile_desc">Las descargas que no se pueden pausar serán reiniciadas</string>
<string name="pause_downloads_on_mobile">Interrumpir en redes medidas</string>
<string name="pause_downloads_on_mobile_desc">Útil al cambiar a Datos Móviles, solo algunas descargas no se pueden suspender</string>
<string name="enable_queue_limit">Limitar cola de descarga</string>
<string name="enable_queue_limit_desc">Solo se permitirá una descarga a la vez</string>
<string name="start_downloads">Iniciar descargas</string>
<string name="pause_downloads">Pausar descargas</string>
<!-- message dialog about download error -->
<string name="show_error">Mostrar error</string>
<string name="label_code">Codigo</string>
@ -439,9 +448,12 @@ abrir en modo popup</string>
<string name="error_connect_host">No se puede conectar con el servidor</string>
<string name="error_http_no_content">El servidor no devolvio datos</string>
<string name="error_http_unsupported_range">El servidor no acepta descargas multi-hilos, intente de nuevo con @string/msg_threads = 1</string>
<string name="error_http_requested_range_not_satisfiable">El rango solicitado no se puede satisfacer</string>
<string name="error_http_requested_range_not_satisfiable">No se logro obtener el rango solicitado</string>
<string name="error_http_not_found">No encontrado</string>
<string name="error_postprocessing_failed">Fallo el post-procesado</string>
<string name="error_postprocessing_stopped">NewPipe se cerro mientras se trabajaba en el archivo</string>
<string name="error_insufficient_storage">No hay suficiente espacio disponible en el dispositivo</string>
<string name="unsubscribe">Desuscribirse</string>
<string name="tab_new">Nueva pestaña</string>
<string name="tab_choose">Elige la pestaña</string>

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>

View file

@ -50,4 +50,11 @@
android:summary="@string/pause_downloads_on_mobile_desc"
android:title="@string/pause_downloads_on_mobile" />
<SwitchPreference
app:iconSpaceReserved="false"
android:defaultValue="true"
android:key="@string/downloads_queue_limit"
android:summary="@string/enable_queue_limit_desc"
android:title="@string/enable_queue_limit" />
</PreferenceScreen>