Compare commits

..

No commits in common. "stable" and "v0.1.3" have entirely different histories.

21 changed files with 16 additions and 188 deletions

2
.idea/compiler.xml generated

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="17" />
<bytecodeTargetLevel target="11" />
</component>
</project>

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<value>
<entry key="app">
<State />
</entry>
</value>
</component>
</project>

10
.idea/migrations.xml generated

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>

2
.idea/misc.xml generated

@ -17,7 +17,7 @@
</option>
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

@ -14,21 +14,9 @@ The maximum number of cameras is determined by the device's capabilities.
The stream decoding and rendering is demanded to [VLC's library](https://code.videolan.org/videolan/vlc-android): without their effort this app wouldn't be possible.
This app was specifically developed for F-Droid, as I couldn't find any open source RTSP vievers in the main repository.
The app can be opened deeplinking to url ojo://view.
To open the app with focus on a specific camera, you can use an intent (it.danieleverducci.ojo.OPEN_CAMERA) to specify which camera you want to view.
The extra argument it.danieleverducci.ojo.CAMERA_NAME will open the app with the camera with the name you specified while adding the camera.
The extra argument it.danieleverducci.ojo.CAMERA_NUMBER starting at 1 could be used as well, if you have multiple cameras with the same name.
See belows example how to use the intent. The flag (-f 268468224) could be useful if you want to switch to an other camera while the app is running.
```shell
adb -s <YOUR_DEVICE> shell am start -a it.danieleverducci.ojo.OPEN_CAMERA -f 268468224 --es it.danieleverducci.ojo.CAMERA_NAME <YOUR_CAMERA_NAME>
adb -s <YOUR_DEVICE> shell am start -a it.danieleverducci.ojo.OPEN_CAMERA -f 268468224 --es it.danieleverducci.ojo.CAMERA_NUMBER <YOUR_CAMERA_NUMBER>
```
![Screenshot 1](media/screenshots/1.png) ![Screenshot 2](media/screenshots/2.png) ![Screenshot 3](media/screenshots/3.png)
## Contributors
- Thanks to [brenard](https://github.com/brenard) for the new grid sizing method
- Thanks to [davquar](https://github.com/davquar) for the fullscreen compatibility fix on Android 11
- Thanks to [jayfan0](https://github.com/jayfan0) for the first deep link implementation
- Thanks to [free-bots](https://github.com/free-bots) for the selection border on Android TV, intents for direct camera access and leanback support
Thanks to [brenard](https://github.com/brenard) for the new grid sizing method
Thanks to [davquar](https://github.com/davquar) for the fullscreen compatibility fix on Android 11

@ -9,8 +9,8 @@ android {
applicationId "it.danieleverducci.ojo"
minSdkVersion 15
targetSdkVersion 33
versionCode 9
versionName "0.1.4"
versionCode 8
versionName "0.1.3"
vectorDrawables.useSupportLibrary = true

@ -1,11 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature
android:name="android.software.leanback"
android:required="false" />
<application
android:allowBackup="true"
@ -16,7 +12,6 @@
android:theme="@style/Theme.Ojo">
<activity
android:name=".ui.SettingsActivity"
android:banner="@mipmap/ic_launcher"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.Ojo">
@ -30,17 +25,12 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="ojo" android:host="view"/>
</intent-filter>
<intent-filter>
<action android:name="it.danieleverducci.ojo.OPEN_CAMERA"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>

@ -1,7 +1,6 @@
package it.danieleverducci.ojo.ui;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
@ -29,6 +28,7 @@ import org.videolan.libvlc.MediaPlayer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import it.danieleverducci.ojo.R;
import it.danieleverducci.ojo.Settings;
@ -100,8 +100,6 @@ public class SurveillanceFragment extends Fragment {
cv.startPlayback();
}
expandToCameraViewIfRequired();
// Register for back pressed events
((MainActivity)getActivity()).setOnBackButtonPressedListener(new OnBackButtonPressedListener() {
@Override
@ -258,44 +256,6 @@ public class SurveillanceFragment extends Fragment {
return dimensions;
}
private void expandToCameraViewIfRequired() {
final String EXTRA_CAMERA_NUMBER = "it.danieleverducci.ojo.CAMERA_NUMBER";
final String EXTRA_CAMERA_NAME = "it.danieleverducci.ojo.CAMERA_NAME";
final String OPEN_CAMERA = "it.danieleverducci.ojo.OPEN_CAMERA";
if (this.getActivity() == null) {
return;
}
Intent intent = this.getActivity().getIntent();
if (OPEN_CAMERA.equals(intent.getAction())) {
String cameraName = intent.getStringExtra(EXTRA_CAMERA_NAME);
if (cameraName == null) {
int cameraNumber = intent.getIntExtra(EXTRA_CAMERA_NUMBER, 0) - 1;
expandByIndex(cameraNumber);
return;
}
expandByName(cameraName);
}
}
private void expandByIndex(int index) {
if (index < 0 || cameraViews.size() <= index) {
return;
}
hideAllCameraViewsButNot(cameraViews.get(index).surfaceView);
}
private void expandByName(String name) {
for(CameraView cameraView: cameraViews) {
if (cameraView.camera.getName().equals(name)) {
hideAllCameraViewsButNot(cameraView.surfaceView);
break;
}
}
}
/**
* Contains all entities (views and java entities) related to a camera stream viewer
*/
@ -317,7 +277,6 @@ public class SurveillanceFragment extends Fragment {
}
});
surfaceView.setOnFocusChangeListener((view, hasFocus) -> view.setBackgroundResource(hasFocus ? R.drawable.focus_border : 0));
SurfaceHolder holder = surfaceView.getHolder();
holder.setKeepScreenOn(true);

@ -1,6 +0,0 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:width="1dip"
android:color="@color/white" />
</shape>

@ -58,19 +58,6 @@
android:layout_marginTop="20dp"
android:text="@string/app_info_lib_desc"
android:autoLink="web"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textStyle="bold"
android:text="@string/app_info_translators_title"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="@string/app_info_translators_names"/>
</LinearLayout>
</ScrollView>

@ -5,9 +5,7 @@
android:layout_height="wrap_content"
android:paddingTop="@dimen/text_margin"
android:paddingBottom="@dimen/text_margin"
android:orientation="horizontal"
android:focusable="true"
android:focusableInTouchMode="true">
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"

@ -12,7 +12,7 @@
android:id="@+id/settingsToolbar"
app:title="@string/app_name"
style="@style/ToolBarStyle"
android:focusable="true"/>
/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
@ -24,7 +24,6 @@
android:layout_marginRight="16dp"
app:layoutManager="LinearLayoutManager"
tools:context=".ui.SettingsFragment"
tools:listitem="@layout/fragment_settings_item"
android:focusable="true" />
tools:listitem="@layout/fragment_settings_item" />
</LinearLayout>

@ -27,7 +27,5 @@
<string name="app_info_license_desc">Questa app è rilasciata sotto licenza GNU GENERAL PUBLIC LICENSE v3+. Puoi ottenerne una copia qui: https://raw.githubusercontent.com/penguin86/ojo/master/LICENSE</string>
<string name="app_info_repo_desc">Puoi trovare il codice sorgente al repository: https://github.com/penguin86/ojo</string>
<string name="app_info_lib_desc">Questa app è resa possibile dal magnifico lavoro dei team vlc and vlc-android! Per saperne di più o ottenere il codice sorgente: https://code.videolan.org/videolan/vlc-android</string>
<string name="app_info_translators_title">Traduttori:</string>
<string name="app_info_translators_names">Yurt Page (Russian)</string>
</resources>

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Ojo</string>
<!-- Strings used for fragments for navigation -->
<string name="first_fragment_label">Первый Фрагмент</string>
<string name="second_fragment_label">Второй Фрагмент</string>
<string name="fab_add_camera">Добавить</string>
<string name="stream_list_default_camera_name">VidБезымянная камера №{camNo}</string>
<string name="add_stream_placeholder_url">rtsp://username:password@192.168.1.123:554</string>
<string name="add_stream_placeholder_name">Название IP камеры</string>
<string name="add_stream_name">Нзвание потока IP камеры</string>
<string name="add_stream_save">Сохранить</string>
<string name="add_stream_invalid_url">Неправильный RTSP URL</string>
<string name="add_stream_invalid_url_dismiss">Закрыть</string>
<string name="add_stream_error_saving">Произошла ошибка при сохранении конфигурации</string>
<string name="add_stream">Пожалуйста введите RTSP поток вашей камеры. Обратите внимание, что URL отличается от камеры к камере: вы можете найти полный URL адрес в настройках вашей камеры или руководстве пользователя.</string>
<string name="menuitem_allow_rotation">Разрешить вращение экрана</string>
<string name="menuitem_deny_rotation">Только альбомная</string>
<string name="menuitem_info">Инфо</string>
<string name="menuitem_add_camera">Добавить</string>
<string name="app_info_title">О программе</string>
<string name="app_info_creator_desc">Автор: Daniele Verducci.</string>
<string name="app_info_license_desc">Это приложение лицензировано в соответствии с GNU GENERAL PUBLIC LICENSE v3+. Ознакомьтесь тут: https://raw.githubusercontent.com/penguin86/ojo/master/LICENSE</string>
<string name="app_info_repo_desc">Исходный код в репозитории на GitHub:: https://github.com/penguin86/ojo</string>
<string name="app_info_lib_desc">Это приложение стало возможным благодаря усилиям команды VLC и VLC-Android! Вы можете узнать больше или получить исходный код тут: https://code.videolan.org/videolan/vlc-android</string>
</resources>

@ -24,8 +24,6 @@
<string name="app_info_title">About Ojo</string>
<string name="app_info_creator_desc">Created by Daniele Verducci.</string>
<string name="app_info_license_desc">This application is licensed under the GNU GENERAL PUBLIC LICENSE v3+. You can obtain a copy here: https://raw.githubusercontent.com/penguin86/ojo/master/LICENSE</string>
<string name="app_info_repo_desc">The source code can be obtained at the GitHub repository: https://github.com/penguin86/ojo</string>
<string name="app_info_lib_desc">This app is made possible by the gorgeous VLC and VLC-Android teams effort! You can know more or obtain the source code at https://code.videolan.org/videolan/vlc-android</string>
<string name="app_info_translators_title">Translators:</string>
<string name="app_info_translators_names" translatable="false">Yurt Page (Russian)</string>
<string name="app_info_repo_desc">The source code can be obtained at the github repository: https://github.com/penguin86/ojo</string>
<string name="app_info_lib_desc">This app is made possible by the gourgeous vlc and vlc-android teams effort! You can know more or obtain the source code at https://code.videolan.org/videolan/vlc-android</string>
</resources>

@ -1,2 +0,0 @@
Added russian translation (thanks to Yurt Page!)

@ -1,16 +1,8 @@
Ojo is a basic IP Camera surveillance wall.
IP camera's RTSP streams are added via its url and shown in the classic tile configuration. The number of tiles is automatically chosen based on the number of configured cameras: a single camera goes full screen, adding more cameras the app switches to a grid view: 2x2, 3x3, 4x4 and so on.
IP camera's RTSP streams are added via its url and shown in the classic tile configuration. The number of tiles is automatically choosen based on the number of configured cameras: a single camera goes full screen, adding more cameras the app switches to a grid view: 2x2, 3x3, 4x4 and so on.
The maximum number of cameras is determined by the device's capabilities.
The stream decoding and rendering is demanded to VLC's library: without their effort this app wouldn't be possible.
This app was specifically developed for F-Droid, as I couldn't find any open source RTSP viewers in the main repository.
This app was specifically developed for F-Droid, as I couldn't find any open source RTSP vievers in the main repository.
The app can be opened deeplinking to url ojo://view
To open the app with focus on a specific camera, you can use an intent (it.danieleverducci.ojo.OPEN_CAMERA) to specify which camera you want to view.
The extra argument it.danieleverducci.ojo.CAMERA_NAME will open the app with the camera with the name you specified while adding the camera.
The extra argument it.danieleverducci.ojo.CAMERA_NUMBER starting at 1 could be used as well, if you have multiple cameras with the same name.
See below an example how to use the intent. The flag (-f 268468224) could be useful if you want to switch to another camera while the app is running:
adb -s <YOUR_DEVICE> shell am start -a it.danieleverducci.ojo.OPEN_CAMERA -f 268468224 --es it.danieleverducci.ojo.CAMERA_NAME <YOUR_CAMERA_NAME>
adb -s <YOUR_DEVICE> shell am start -a it.danieleverducci.ojo.OPEN_CAMERA -f 268468224 --es it.danieleverducci.ojo.CAMERA_NUMBER <YOUR_CAMERA_NUMBER>

@ -1 +0,0 @@
Aggiunta traduzione in russo (grazie a Yurt Page!)

@ -1,19 +0,0 @@
OJO это базовый просмотрщик IP камер наблюдения.
RTSP потоки IP камеры добавляются через его URL адрес и показаны в классической плиточной конфигурации. Количество плиток автоматически выбирается на основе количества настроенных камер: одна камера показана на весь экран, добавление больше камер переключает на сетку: 2x2, 3x3, 4x4 и т. д.
Максимальное количество камер определяется возможностями устройства.
Декодирование и рендеринг потока требует библиотеки VLC: без их стараний это приложение не было бы возможно.
Это приложение было специально разработано для F-Droid, так как я не мог найти каких-либо просмотрщиков RTSP с открытым исходным кодом в основном репозитории.
Приложение может быть открыто с глубокой ссылкой по URL ojo://view.
Чтобы открыть приложение с фокусом на определенной камере, вы можете использовать intent (it.danieleverducci.ojo.OPEN_CAMERA) чтобы указать какую камеру вы хотите просмотреть.
Дополнительный аргумент it.danieleverducci.ojo.CAMERA_NAME откроет приложение с камерой с указанным вами названием при добавлении камеры.
Дополнительный аргумент it.danieleverducci.ojo.CAMERA_NUMBER начиная с 1 также может использоваться, если у вас есть несколько камер с одним и тем же названием.
Ниже пример как использовать intent. Флаг (-F 268468224) может быть полезен, если вы хотите переключиться на другую камеру во время работы приложения:
adb -s <ВАШЕ_УСТРОЙСТВО> shell am start -a it.danieleverducci.ojo.OPEN_CAMERA -f 268468224 --es it.danieleverducci.ojo.CAMERA_NAME <ИМЯ_ВАШЕЙ_КАМЕРЫ>
adb -s <ВАШЕ_УСТРОЙСТВО> shell am start -a it.danieleverducci.ojo.OPEN_CAMERA -f 268468224 --es it.danieleverducci.ojo.CAMERA_NUMBER <НОМЕР_ВАШЕЙ_КАМЕРЫ>

@ -1 +0,0 @@
OJO это базовый просмотрщик IP камер наблюдения.

@ -1 +0,0 @@
Ojo RTSP просмотрщик IP Камер