├── .gitignore
├── .idea
├── codeStyles
│ ├── Project.xml
│ └── codeStyleConfig.xml
├── encodings.xml
├── gradle.xml
├── misc.xml
├── runConfigurations.xml
└── vcs.xml
├── LICENSE
├── README.md
├── app
├── .gitignore
├── build.gradle
├── javadoc
│ ├── app
│ │ ├── alltypes
│ │ │ ├── index.html
│ │ │ └── index.md
│ │ ├── com.dhirajgupta.multicam.interfaces
│ │ │ ├── -c-a-m-e-r-a-s-t-a-t-e_-i-d-l-e.html
│ │ │ ├── -c-a-m-e-r-a-s-t-a-t-e_-i-d-l-e.md
│ │ │ ├── -c-a-m-e-r-a-s-t-a-t-e_-p-i-c-t-u-r-e_-t-a-k-e-n.html
│ │ │ ├── -c-a-m-e-r-a-s-t-a-t-e_-p-i-c-t-u-r-e_-t-a-k-e-n.md
│ │ │ ├── -c-a-m-e-r-a-s-t-a-t-e_-p-r-e-v-i-e-w.html
│ │ │ ├── -c-a-m-e-r-a-s-t-a-t-e_-p-r-e-v-i-e-w.md
│ │ │ ├── -c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-l-o-c-k.html
│ │ │ ├── -c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-l-o-c-k.md
│ │ │ ├── -c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-n-o-n_-p-r-e-c-a-p-t-u-r-e.html
│ │ │ ├── -c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-n-o-n_-p-r-e-c-a-p-t-u-r-e.md
│ │ │ ├── -c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-p-r-e-c-a-p-t-u-r-e.html
│ │ │ ├── -c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-p-r-e-c-a-p-t-u-r-e.md
│ │ │ ├── -managed-camera-status
│ │ │ │ ├── camera-f-p-schanged.html
│ │ │ │ ├── camera-f-p-schanged.md
│ │ │ │ ├── camera-saved-photo.html
│ │ │ │ ├── camera-saved-photo.md
│ │ │ │ ├── camera-state-changed.html
│ │ │ │ ├── camera-state-changed.md
│ │ │ │ ├── index.html
│ │ │ │ └── index.md
│ │ │ ├── index.html
│ │ │ └── index.md
│ │ ├── com.dhirajgupta.multicam.services
│ │ │ ├── -managed-camera
│ │ │ │ ├── -init-.html
│ │ │ │ ├── -init-.md
│ │ │ │ ├── activity.html
│ │ │ │ ├── activity.md
│ │ │ │ ├── camera-state.html
│ │ │ │ ├── camera-state.md
│ │ │ │ ├── filename-format.html
│ │ │ │ ├── filename-format.md
│ │ │ │ ├── index.html
│ │ │ │ ├── index.md
│ │ │ │ ├── is-previewing.html
│ │ │ │ ├── is-previewing.md
│ │ │ │ ├── last-f-p-s.html
│ │ │ │ ├── last-f-p-s.md
│ │ │ │ ├── last-millis.html
│ │ │ │ ├── last-millis.md
│ │ │ │ ├── listener.html
│ │ │ │ ├── listener.md
│ │ │ │ ├── lock-focus.html
│ │ │ │ ├── lock-focus.md
│ │ │ │ ├── prepare-to-preview.html
│ │ │ │ ├── prepare-to-preview.md
│ │ │ │ ├── release-resources.html
│ │ │ │ ├── release-resources.md
│ │ │ │ ├── surface-texture-listener.html
│ │ │ │ ├── surface-texture-listener.md
│ │ │ │ ├── system-id.html
│ │ │ │ ├── system-id.md
│ │ │ │ ├── texture-view.html
│ │ │ │ ├── texture-view.md
│ │ │ │ ├── thread-name.html
│ │ │ │ ├── thread-name.md
│ │ │ │ ├── update-preview-status.html
│ │ │ │ └── update-preview-status.md
│ │ │ ├── index.html
│ │ │ └── index.md
│ │ ├── com.dhirajgupta.multicam.utils
│ │ │ ├── -compare-sizes-by-area
│ │ │ │ ├── -init-.html
│ │ │ │ ├── -init-.md
│ │ │ │ ├── compare.html
│ │ │ │ ├── compare.md
│ │ │ │ ├── index.html
│ │ │ │ └── index.md
│ │ │ ├── index.html
│ │ │ └── index.md
│ │ ├── com.dhirajgupta.multicam.views
│ │ │ ├── -auto-fit-texture-view
│ │ │ │ ├── -init-.html
│ │ │ │ ├── -init-.md
│ │ │ │ ├── index.html
│ │ │ │ ├── index.md
│ │ │ │ ├── on-measure.html
│ │ │ │ ├── on-measure.md
│ │ │ │ ├── set-aspect-ratio.html
│ │ │ │ └── set-aspect-ratio.md
│ │ │ ├── index.html
│ │ │ └── index.md
│ │ ├── com.dhirajgupta.multicam
│ │ │ ├── -app
│ │ │ │ ├── -init-.html
│ │ │ │ ├── -init-.md
│ │ │ │ ├── index.html
│ │ │ │ ├── index.md
│ │ │ │ ├── instance.html
│ │ │ │ ├── instance.md
│ │ │ │ ├── on-create.html
│ │ │ │ └── on-create.md
│ │ │ ├── -main-activity
│ │ │ │ ├── -init-.html
│ │ │ │ ├── -init-.md
│ │ │ │ ├── -p-e-r-m-r-e-q_-c-a-m-e-r-a.html
│ │ │ │ ├── -p-e-r-m-r-e-q_-c-a-m-e-r-a.md
│ │ │ │ ├── all-permissions-granted.html
│ │ │ │ ├── all-permissions-granted.md
│ │ │ │ ├── ask-all-required-permissions.html
│ │ │ │ ├── ask-all-required-permissions.md
│ │ │ │ ├── camera-status-handler.html
│ │ │ │ ├── camera-status-handler.md
│ │ │ │ ├── camera0.html
│ │ │ │ ├── camera0.md
│ │ │ │ ├── camera1.html
│ │ │ │ ├── camera1.md
│ │ │ │ ├── index.html
│ │ │ │ ├── index.md
│ │ │ │ ├── init-cameras.html
│ │ │ │ ├── init-cameras.md
│ │ │ │ ├── on-create.html
│ │ │ │ ├── on-create.md
│ │ │ │ ├── on-pause.html
│ │ │ │ ├── on-pause.md
│ │ │ │ ├── on-request-permissions-result.html
│ │ │ │ ├── on-request-permissions-result.md
│ │ │ │ ├── on-resume-fragments.html
│ │ │ │ ├── on-resume-fragments.md
│ │ │ │ ├── toggle-camera.html
│ │ │ │ └── toggle-camera.md
│ │ │ ├── index.html
│ │ │ └── index.md
│ │ ├── index-outline.html
│ │ ├── index.html
│ │ ├── index.md
│ │ └── package-list
│ └── style.css
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── dhirajgupta
│ │ └── multicam
│ │ └── ExampleInstrumentedTest.kt
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── dhirajgupta
│ │ │ └── multicam
│ │ │ ├── App.kt
│ │ │ ├── MainActivity.kt
│ │ │ ├── interfaces
│ │ │ └── ManagedCameraStatus.kt
│ │ │ ├── services
│ │ │ ├── ImageSaver.kt
│ │ │ └── ManagedCamera.kt
│ │ │ ├── utils
│ │ │ └── CompareSizesByArea.kt
│ │ │ └── views
│ │ │ └── AutoFitTextureView.kt
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ └── ic_launcher_background.xml
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── dhirajgupta
│ └── multicam
│ └── ExampleUnitTest.kt
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── javadoc
└── app
│ ├── alltypes
│ └── index.md
│ ├── com.dhirajgupta.multicam.interfaces
│ ├── -c-a-m-e-r-a-s-t-a-t-e_-i-d-l-e.md
│ ├── -c-a-m-e-r-a-s-t-a-t-e_-p-i-c-t-u-r-e_-t-a-k-e-n.md
│ ├── -c-a-m-e-r-a-s-t-a-t-e_-p-r-e-v-i-e-w.md
│ ├── -c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-l-o-c-k.md
│ ├── -c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-n-o-n_-p-r-e-c-a-p-t-u-r-e.md
│ ├── -c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-p-r-e-c-a-p-t-u-r-e.md
│ ├── -managed-camera-status
│ │ ├── camera-f-p-schanged.md
│ │ ├── camera-saved-photo.md
│ │ ├── camera-state-changed.md
│ │ └── index.md
│ └── index.md
│ ├── com.dhirajgupta.multicam.services
│ ├── -managed-camera
│ │ ├── -init-.md
│ │ ├── activity.md
│ │ ├── camera-state.md
│ │ ├── filename-format.md
│ │ ├── index.md
│ │ ├── is-previewing.md
│ │ ├── last-f-p-s.md
│ │ ├── last-millis.md
│ │ ├── listener.md
│ │ ├── lock-focus.md
│ │ ├── prepare-to-preview.md
│ │ ├── release-resources.md
│ │ ├── surface-texture-listener.md
│ │ ├── system-id.md
│ │ ├── texture-view.md
│ │ ├── thread-name.md
│ │ └── update-preview-status.md
│ └── index.md
│ ├── com.dhirajgupta.multicam.utils
│ ├── -compare-sizes-by-area
│ │ ├── -init-.md
│ │ ├── compare.md
│ │ └── index.md
│ └── index.md
│ ├── com.dhirajgupta.multicam.views
│ ├── -auto-fit-texture-view
│ │ ├── -init-.md
│ │ ├── index.md
│ │ ├── on-measure.md
│ │ └── set-aspect-ratio.md
│ └── index.md
│ ├── com.dhirajgupta.multicam
│ ├── -app
│ │ ├── -init-.md
│ │ ├── index.md
│ │ ├── instance.md
│ │ └── on-create.md
│ ├── -main-activity
│ │ ├── -init-.md
│ │ ├── -p-e-r-m-r-e-q_-c-a-m-e-r-a.md
│ │ ├── all-permissions-granted.md
│ │ ├── ask-all-required-permissions.md
│ │ ├── camera-status-handler.md
│ │ ├── camera0.md
│ │ ├── camera1.md
│ │ ├── index.md
│ │ ├── init-cameras.md
│ │ ├── on-create.md
│ │ ├── on-pause.md
│ │ ├── on-request-permissions-result.md
│ │ ├── on-resume-fragments.md
│ │ └── toggle-camera.md
│ └── index.md
│ ├── index.md
│ └── package-list
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | xmlns:android
26 | ^$
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 | xmlns:.*
36 | ^$
37 |
38 |
39 | BY_NAME
40 |
41 |
42 |
43 |
44 |
45 |
46 | .*:id
47 | http://schemas.android.com/apk/res/android
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 | .*:name
57 | http://schemas.android.com/apk/res/android
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | name
67 | ^$
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | style
77 | ^$
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 | .*
87 | ^$
88 |
89 |
90 | BY_NAME
91 |
92 |
93 |
94 |
95 |
96 |
97 | .*
98 | http://schemas.android.com/apk/res/android
99 |
100 |
101 | ANDROID_ATTRIBUTE_ORDER
102 |
103 |
104 |
105 |
106 |
107 |
108 | .*
109 | .*
110 |
111 |
112 | BY_NAME
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
--------------------------------------------------------------------------------
/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Dhiraj Gupta
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | 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 FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Android MultiCamera Camera2 API Demo
2 |
3 | Android MultiCam project. Demonstrates how the Camera2 API allows simultaneous Camera Preview and Image Capture from multiple cameras on one device.
4 |
5 | The codebase is a liberal refactor and inspired from Google's [Android Camera2Basic example](https://github.com/googlesamples/android-Camera2Basic). A new [ManagedCamera](https://github.com/dhiraj/androidmulticam/blob/develop/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/index.md) class has been created to as a common code module that can be reused to create multiple instances of simultaneous cameras and this is showcased in the provided Activity.
6 |
7 | ## Getting Started
8 |
9 | Clone the repository and use Open existing project in Android Studio to get started. Constructive feedback and pull requests are always welcome.
10 |
11 |
12 | ## Documentation
13 |
14 | Code comments using KDoc syntax are available throughout. You can browse the generated [HTML] and [Markdown] as well. Documentation is generated using the Dokka Android plugin.
15 |
16 | ## Versioning
17 |
18 | We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/dhiraj/androidmulticam/tags).
19 |
20 | ## Authors
21 |
22 | * **Dhiraj Gupta** - *Initial work* - [dhiraj](https://github.com/dhiraj)
23 |
24 | ## License
25 |
26 | This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
27 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | apply plugin: 'kotlin-android'
4 |
5 | apply plugin: 'kotlin-android-extensions'
6 |
7 | apply plugin: 'org.jetbrains.dokka-android'
8 |
9 | android {
10 | compileSdkVersion 29
11 | buildToolsVersion "29.0.1"
12 | defaultConfig {
13 | applicationId "com.dhirajgupta.multicam"
14 | minSdkVersion 25
15 | targetSdkVersion 29
16 | versionCode 1
17 | versionName "1.0"
18 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
19 | }
20 | buildTypes {
21 | release {
22 | minifyEnabled false
23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24 | }
25 | }
26 | dokka {
27 | outputFormat = 'html'
28 | outputDirectory = "$buildDir/javadoc"
29 | }
30 | }
31 |
32 | dependencies {
33 | implementation fileTree(dir: 'libs', include: ['*.jar'])
34 | implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
35 | implementation 'androidx.appcompat:appcompat:1.0.2'
36 | implementation 'androidx.core:core-ktx:1.0.2'
37 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
38 | testImplementation 'junit:junit:4.12'
39 | androidTestImplementation 'androidx.test:runner:1.2.0'
40 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
41 |
42 | //Logging
43 | implementation 'com.jakewharton.timber:timber:4.7.1'
44 | }
45 |
--------------------------------------------------------------------------------
/app/javadoc/app/alltypes/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | alltypes - app
5 |
6 |
7 |
8 | All Types
9 |
10 |
11 |
12 |
13 | com.dhirajgupta.multicam.App
14 |
15 | Standard Android App subclass that is useful for most Apps. By providing the shared instance of the App object,
16 | we are able to access the Application Context anywhere that it is useful. In this particular project we're using
17 | Application Context to ask MediaScannerConnection to scan our newly saved images so that it appears in the user's
18 | Photo Gallery application.
19 |
20 |
21 |
22 |
23 | com.dhirajgupta.multicam.views.AutoFitTextureView
24 |
25 | A TextureView that can be adjusted to a specified aspect ratio.
26 |
27 |
28 |
29 |
30 | com.dhirajgupta.multicam.utils.CompareSizesByArea
31 |
32 | Compares two Size
s based on their areas.
33 |
34 |
35 |
36 |
37 | com.dhirajgupta.multicam.MainActivity
38 |
39 |
40 |
41 |
42 |
43 | com.dhirajgupta.multicam.services.ManagedCamera
44 |
45 | This class is heavily inspired from Google's Camera2Basic sample at https://github.com/googlesamples/android-Camera2Basic
46 | Heavy refactoring has been carried out to move all the code from the Fragment in the sample to a self contained
47 | ManagedCamera class that can take care of it's own threads and is almost fully self sufficient.
48 | By modularizing the Camera in this way we are able to easily create multiple instances (two in this case) while the
49 | implementation code remains common between both the cameras.
50 |
51 |
52 |
53 |
54 | com.dhirajgupta.multicam.interfaces.ManagedCameraStatus
55 |
56 | Consumers of ManagedCamera need to supply an implementation of this interface to allow the camera instance to
57 | communicate back as required
58 |
59 |
60 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/app/javadoc/app/alltypes/index.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ### All Types
4 |
5 | | Name | Summary |
6 | |---|---|
7 | | [com.dhirajgupta.multicam.App](../com.dhirajgupta.multicam/-app/index.md) | Standard Android App subclass that is useful for most Apps. By providing the shared instance of the App object, we are able to access the Application Context anywhere that it is useful. In this particular project we're using Application Context to ask [MediaScannerConnection](https://developer.android.com/reference/android/media/MediaScannerConnection.html) to scan our newly saved images so that it appears in the user's Photo Gallery application. |
8 | | [com.dhirajgupta.multicam.views.AutoFitTextureView](../com.dhirajgupta.multicam.views/-auto-fit-texture-view/index.md) | A [TextureView](https://developer.android.com/reference/android/view/TextureView.html) that can be adjusted to a specified aspect ratio. |
9 | | [com.dhirajgupta.multicam.utils.CompareSizesByArea](../com.dhirajgupta.multicam.utils/-compare-sizes-by-area/index.md) | Compares two `Size`s based on their areas. |
10 | | [com.dhirajgupta.multicam.MainActivity](../com.dhirajgupta.multicam/-main-activity/index.md) | |
11 | | [com.dhirajgupta.multicam.services.ManagedCamera](../com.dhirajgupta.multicam.services/-managed-camera/index.md) | This class is heavily inspired from Google's Camera2Basic sample at https://github.com/googlesamples/android-Camera2Basic Heavy refactoring has been carried out to move all the code from the Fragment in the sample to a self contained [ManagedCamera](../com.dhirajgupta.multicam.services/-managed-camera/index.md) class that can take care of it's own threads and is almost fully self sufficient. By modularizing the Camera in this way we are able to easily create multiple instances (two in this case) while the implementation code remains common between both the cameras. |
12 | | [com.dhirajgupta.multicam.interfaces.ManagedCameraStatus](../com.dhirajgupta.multicam.interfaces/-managed-camera-status/index.md) | Consumers of [ManagedCamera](../com.dhirajgupta.multicam.services/-managed-camera/index.md) need to supply an implementation of this interface to allow the camera instance to communicate back as required |
13 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-c-a-m-e-r-a-s-t-a-t-e_-i-d-l-e.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CAMERASTATE_IDLE - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.interfaces / CAMERASTATE_IDLE
9 |
10 | CAMERASTATE_IDLE
11 |
12 | val CAMERASTATE_IDLE : Int
13 | Camera state: Idle / Not started.
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-c-a-m-e-r-a-s-t-a-t-e_-i-d-l-e.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.interfaces](index.md) / [CAMERASTATE_IDLE](./-c-a-m-e-r-a-s-t-a-t-e_-i-d-l-e.md)
2 |
3 | # CAMERASTATE_IDLE
4 |
5 | `val CAMERASTATE_IDLE: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
6 |
7 | Camera state: Idle / Not started.
8 |
9 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-c-a-m-e-r-a-s-t-a-t-e_-p-i-c-t-u-r-e_-t-a-k-e-n.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CAMERASTATE_PICTURE_TAKEN - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.interfaces / CAMERASTATE_PICTURE_TAKEN
9 |
10 | CAMERASTATE_PICTURE_TAKEN
11 |
12 | val CAMERASTATE_PICTURE_TAKEN : Int
13 | Camera state: Picture was taken.
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-c-a-m-e-r-a-s-t-a-t-e_-p-i-c-t-u-r-e_-t-a-k-e-n.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.interfaces](index.md) / [CAMERASTATE_PICTURE_TAKEN](./-c-a-m-e-r-a-s-t-a-t-e_-p-i-c-t-u-r-e_-t-a-k-e-n.md)
2 |
3 | # CAMERASTATE_PICTURE_TAKEN
4 |
5 | `val CAMERASTATE_PICTURE_TAKEN: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
6 |
7 | Camera state: Picture was taken.
8 |
9 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-c-a-m-e-r-a-s-t-a-t-e_-p-r-e-v-i-e-w.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CAMERASTATE_PREVIEW - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.interfaces / CAMERASTATE_PREVIEW
9 |
10 | CAMERASTATE_PREVIEW
11 |
12 | val CAMERASTATE_PREVIEW : Int
13 | Camera state: Showing camera preview.
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-c-a-m-e-r-a-s-t-a-t-e_-p-r-e-v-i-e-w.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.interfaces](index.md) / [CAMERASTATE_PREVIEW](./-c-a-m-e-r-a-s-t-a-t-e_-p-r-e-v-i-e-w.md)
2 |
3 | # CAMERASTATE_PREVIEW
4 |
5 | `val CAMERASTATE_PREVIEW: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
6 |
7 | Camera state: Showing camera preview.
8 |
9 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-l-o-c-k.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CAMERASTATE_WAITING_LOCK - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.interfaces / CAMERASTATE_WAITING_LOCK
9 |
10 | CAMERASTATE_WAITING_LOCK
11 |
12 | val CAMERASTATE_WAITING_LOCK : Int
13 | Camera state: Waiting for the focus to be locked.
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-l-o-c-k.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.interfaces](index.md) / [CAMERASTATE_WAITING_LOCK](./-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-l-o-c-k.md)
2 |
3 | # CAMERASTATE_WAITING_LOCK
4 |
5 | `val CAMERASTATE_WAITING_LOCK: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
6 |
7 | Camera state: Waiting for the focus to be locked.
8 |
9 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-n-o-n_-p-r-e-c-a-p-t-u-r-e.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CAMERASTATE_WAITING_NON_PRECAPTURE - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.interfaces / CAMERASTATE_WAITING_NON_PRECAPTURE
9 |
10 | CAMERASTATE_WAITING_NON_PRECAPTURE
11 |
12 | val CAMERASTATE_WAITING_NON_PRECAPTURE : Int
13 | Camera state: Waiting for the exposure state to be something other than precapture.
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-n-o-n_-p-r-e-c-a-p-t-u-r-e.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.interfaces](index.md) / [CAMERASTATE_WAITING_NON_PRECAPTURE](./-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-n-o-n_-p-r-e-c-a-p-t-u-r-e.md)
2 |
3 | # CAMERASTATE_WAITING_NON_PRECAPTURE
4 |
5 | `val CAMERASTATE_WAITING_NON_PRECAPTURE: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
6 |
7 | Camera state: Waiting for the exposure state to be something other than precapture.
8 |
9 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-p-r-e-c-a-p-t-u-r-e.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CAMERASTATE_WAITING_PRECAPTURE - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.interfaces / CAMERASTATE_WAITING_PRECAPTURE
9 |
10 | CAMERASTATE_WAITING_PRECAPTURE
11 |
12 | val CAMERASTATE_WAITING_PRECAPTURE : Int
13 | Camera state: Waiting for the exposure to be precapture state.
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-p-r-e-c-a-p-t-u-r-e.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.interfaces](index.md) / [CAMERASTATE_WAITING_PRECAPTURE](./-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-p-r-e-c-a-p-t-u-r-e.md)
2 |
3 | # CAMERASTATE_WAITING_PRECAPTURE
4 |
5 | `val CAMERASTATE_WAITING_PRECAPTURE: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
6 |
7 | Camera state: Waiting for the exposure to be precapture state.
8 |
9 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-managed-camera-status/camera-f-p-schanged.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCameraStatus.cameraFPSchanged - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.interfaces / ManagedCameraStatus / cameraFPSchanged
9 |
10 | cameraFPSchanged
11 |
12 | abstract fun cameraFPSchanged ( camera : ManagedCamera , fps : Int ) : Unit
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-managed-camera-status/camera-f-p-schanged.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.interfaces](../index.md) / [ManagedCameraStatus](index.md) / [cameraFPSchanged](./camera-f-p-schanged.md)
2 |
3 | # cameraFPSchanged
4 |
5 | `abstract fun cameraFPSchanged(camera: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`, fps: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-managed-camera-status/camera-saved-photo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCameraStatus.cameraSavedPhoto - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.interfaces / ManagedCameraStatus / cameraSavedPhoto
9 |
10 | cameraSavedPhoto
11 |
12 | abstract fun cameraSavedPhoto ( camera : ManagedCamera , filePath : File ) : Unit
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-managed-camera-status/camera-saved-photo.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.interfaces](../index.md) / [ManagedCameraStatus](index.md) / [cameraSavedPhoto](./camera-saved-photo.md)
2 |
3 | # cameraSavedPhoto
4 |
5 | `abstract fun cameraSavedPhoto(camera: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`, filePath: `[`File`](https://developer.android.com/reference/java/io/File.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-managed-camera-status/camera-state-changed.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCameraStatus.cameraStateChanged - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.interfaces / ManagedCameraStatus / cameraStateChanged
9 |
10 | cameraStateChanged
11 |
12 | abstract fun cameraStateChanged ( camera : ManagedCamera , state : Int ) : Unit
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-managed-camera-status/camera-state-changed.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.interfaces](../index.md) / [ManagedCameraStatus](index.md) / [cameraStateChanged](./camera-state-changed.md)
2 |
3 | # cameraStateChanged
4 |
5 | `abstract fun cameraStateChanged(camera: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`, state: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-managed-camera-status/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCameraStatus - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.interfaces / ManagedCameraStatus
9 |
10 | ManagedCameraStatus
11 | interface ManagedCameraStatus
12 | Consumers of ManagedCamera need to supply an implementation of this interface to allow the camera instance to
13 | communicate back as required
14 | Functions
15 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/-managed-camera-status/index.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.interfaces](../index.md) / [ManagedCameraStatus](./index.md)
2 |
3 | # ManagedCameraStatus
4 |
5 | `interface ManagedCameraStatus`
6 |
7 | Consumers of [ManagedCamera](../../com.dhirajgupta.multicam.services/-managed-camera/index.md) need to supply an implementation of this interface to allow the camera instance to
8 | communicate back as required
9 |
10 | ### Functions
11 |
12 | | Name | Summary |
13 | |---|---|
14 | | [cameraFPSchanged](camera-f-p-schanged.md) | `abstract fun cameraFPSchanged(camera: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`, fps: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
15 | | [cameraSavedPhoto](camera-saved-photo.md) | `abstract fun cameraSavedPhoto(camera: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`, filePath: `[`File`](https://developer.android.com/reference/java/io/File.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
16 | | [cameraStateChanged](camera-state-changed.md) | `abstract fun cameraStateChanged(camera: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`, state: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
17 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | com.dhirajgupta.multicam.interfaces - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.interfaces
9 |
10 | Package com.dhirajgupta.multicam.interfaces
11 | Types
12 |
13 |
14 |
15 |
16 | ManagedCameraStatus
17 |
18 |
19 | interface ManagedCameraStatus
20 | Consumers of ManagedCamera need to supply an implementation of this interface to allow the camera instance to
21 | communicate back as required
22 |
23 |
24 |
25 |
26 | Properties
27 |
28 |
29 |
30 |
31 | CAMERASTATE_IDLE
32 |
33 |
34 | val CAMERASTATE_IDLE : Int
35 | Camera state: Idle / Not started.
36 |
37 |
38 |
39 |
40 | CAMERASTATE_PICTURE_TAKEN
41 |
42 |
43 | val CAMERASTATE_PICTURE_TAKEN : Int
44 | Camera state: Picture was taken.
45 |
46 |
47 |
48 |
49 | CAMERASTATE_PREVIEW
50 |
51 |
52 | val CAMERASTATE_PREVIEW : Int
53 | Camera state: Showing camera preview.
54 |
55 |
56 |
57 |
58 | CAMERASTATE_WAITING_LOCK
59 |
60 |
61 | val CAMERASTATE_WAITING_LOCK : Int
62 | Camera state: Waiting for the focus to be locked.
63 |
64 |
65 |
66 |
67 | CAMERASTATE_WAITING_NON_PRECAPTURE
68 |
69 |
70 | val CAMERASTATE_WAITING_NON_PRECAPTURE : Int
71 | Camera state: Waiting for the exposure state to be something other than precapture.
72 |
73 |
74 |
75 |
76 | CAMERASTATE_WAITING_PRECAPTURE
77 |
78 |
79 | val CAMERASTATE_WAITING_PRECAPTURE : Int
80 | Camera state: Waiting for the exposure to be precapture state.
81 |
82 |
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.interfaces/index.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.interfaces](./index.md)
2 |
3 | ## Package com.dhirajgupta.multicam.interfaces
4 |
5 | ### Types
6 |
7 | | Name | Summary |
8 | |---|---|
9 | | [ManagedCameraStatus](-managed-camera-status/index.md) | `interface ManagedCameraStatus` Consumers of [ManagedCamera](../com.dhirajgupta.multicam.services/-managed-camera/index.md) need to supply an implementation of this interface to allow the camera instance to communicate back as required |
10 |
11 | ### Properties
12 |
13 | | Name | Summary |
14 | |---|---|
15 | | [CAMERASTATE_IDLE](-c-a-m-e-r-a-s-t-a-t-e_-i-d-l-e.md) | `val CAMERASTATE_IDLE: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) Camera state: Idle / Not started. |
16 | | [CAMERASTATE_PICTURE_TAKEN](-c-a-m-e-r-a-s-t-a-t-e_-p-i-c-t-u-r-e_-t-a-k-e-n.md) | `val CAMERASTATE_PICTURE_TAKEN: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) Camera state: Picture was taken. |
17 | | [CAMERASTATE_PREVIEW](-c-a-m-e-r-a-s-t-a-t-e_-p-r-e-v-i-e-w.md) | `val CAMERASTATE_PREVIEW: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) Camera state: Showing camera preview. |
18 | | [CAMERASTATE_WAITING_LOCK](-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-l-o-c-k.md) | `val CAMERASTATE_WAITING_LOCK: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) Camera state: Waiting for the focus to be locked. |
19 | | [CAMERASTATE_WAITING_NON_PRECAPTURE](-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-n-o-n_-p-r-e-c-a-p-t-u-r-e.md) | `val CAMERASTATE_WAITING_NON_PRECAPTURE: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) Camera state: Waiting for the exposure state to be something other than precapture. |
20 | | [CAMERASTATE_WAITING_PRECAPTURE](-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-p-r-e-c-a-p-t-u-r-e.md) | `val CAMERASTATE_WAITING_PRECAPTURE: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) Camera state: Waiting for the exposure to be precapture state. |
21 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/-init-.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCamera. - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.services / ManagedCamera / <init>
9 |
10 | <init>
11 |
12 | ManagedCamera ( systemId : String , threadName : String , textureView : AutoFitTextureView , listener : ManagedCameraStatus )
13 | This class is heavily inspired from Google's Camera2Basic sample at https://github.com/googlesamples/android-Camera2Basic
14 | Heavy refactoring has been carried out to move all the code from the Fragment in the sample to a self contained
15 | ManagedCamera class that can take care of it's own threads and is almost fully self sufficient.
16 | By modularizing the Camera in this way we are able to easily create multiple instances (two in this case) while the
17 | implementation code remains common between both the cameras.
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/-init-.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [<init>](./-init-.md)
2 |
3 | # <init>
4 |
5 | `ManagedCamera(systemId: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, threadName: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, textureView: `[`AutoFitTextureView`](../../com.dhirajgupta.multicam.views/-auto-fit-texture-view/index.md)`, listener: `[`ManagedCameraStatus`](../../com.dhirajgupta.multicam.interfaces/-managed-camera-status/index.md)`)`
6 |
7 | This class is heavily inspired from Google's Camera2Basic sample at https://github.com/googlesamples/android-Camera2Basic
8 | Heavy refactoring has been carried out to move all the code from the Fragment in the sample to a self contained
9 | [ManagedCamera](index.md) class that can take care of it's own threads and is almost fully self sufficient.
10 | By modularizing the Camera in this way we are able to easily create multiple instances (two in this case) while the
11 | implementation code remains common between both the cameras.
12 |
13 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/activity.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCamera.activity - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.services / ManagedCamera / activity
9 |
10 | activity
11 |
12 | val activity : Activity
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/activity.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [activity](./activity.md)
2 |
3 | # activity
4 |
5 | `val activity: `[`Activity`](https://developer.android.com/reference/android/app/Activity.html)
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/camera-state.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCamera.cameraState - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.services / ManagedCamera / cameraState
9 |
10 | cameraState
11 |
12 | var cameraState : Int
13 | The current state of camera state for taking pictures.
14 | REFACTORING NOTE: CAMERASTSATE_IDLE has been specifically added to allow consumers to know when the Camera is idle
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/camera-state.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [cameraState](./camera-state.md)
2 |
3 | # cameraState
4 |
5 | `var cameraState: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
6 |
7 | The current state of camera state for taking pictures.
8 | REFACTORING NOTE: CAMERASTSATE_IDLE has been specifically added to allow consumers to know when the Camera is idle
9 |
10 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/filename-format.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCamera.filenameFormat - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.services / ManagedCamera / filenameFormat
9 |
10 | filenameFormat
11 |
12 | val filenameFormat : SimpleDateFormat
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/filename-format.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [filenameFormat](./filename-format.md)
2 |
3 | # filenameFormat
4 |
5 | `val filenameFormat: `[`SimpleDateFormat`](https://developer.android.com/reference/java/text/SimpleDateFormat.html)
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/is-previewing.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCamera.isPreviewing - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.services / ManagedCamera / isPreviewing
9 |
10 | isPreviewing
11 |
12 | var isPreviewing : Boolean
13 | A flag to match the preview playing status of the camera. If initially set to true, then the ManagedCamera
14 | instance will automatically start the preview when it becomes possible
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/is-previewing.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [isPreviewing](./is-previewing.md)
2 |
3 | # isPreviewing
4 |
5 | `var isPreviewing: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
6 |
7 | A flag to match the preview playing status of the camera. If initially set to true, then the [ManagedCamera](index.md)
8 | instance will automatically start the preview when it becomes possible
9 |
10 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/last-f-p-s.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCamera.lastFPS - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.services / ManagedCamera / lastFPS
9 |
10 | lastFPS
11 |
12 | var lastFPS : Int
13 | Capture the last FPS to allow debouncing to notify the consumer only when an FPS change is actually detected.
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/last-f-p-s.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [lastFPS](./last-f-p-s.md)
2 |
3 | # lastFPS
4 |
5 | `var lastFPS: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
6 |
7 | Capture the last FPS to allow debouncing to notify the consumer only when an FPS change is actually detected.
8 |
9 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/last-millis.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCamera.lastMillis - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.services / ManagedCamera / lastMillis
9 |
10 | lastMillis
11 |
12 | var lastMillis : Long
13 | Capture the last milliseconds to allow fps calculation for this camera view
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/last-millis.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [lastMillis](./last-millis.md)
2 |
3 | # lastMillis
4 |
5 | `var lastMillis: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)
6 |
7 | Capture the last milliseconds to allow fps calculation for this camera view
8 |
9 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/listener.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCamera.listener - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.services / ManagedCamera / listener
9 |
10 | listener
11 |
12 | val listener : ManagedCameraStatus
13 | Listener to observe notifications from camera state and FPS changeΩs
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/listener.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [listener](./listener.md)
2 |
3 | # listener
4 |
5 | `val listener: `[`ManagedCameraStatus`](../../com.dhirajgupta.multicam.interfaces/-managed-camera-status/index.md)
6 |
7 | Listener to observe notifications from camera state and FPS changeΩs
8 |
9 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/lock-focus.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCamera.lockFocus - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.services / ManagedCamera / lockFocus
9 |
10 | lockFocus
11 |
12 | fun lockFocus ( ) : Unit
13 | Lock the focus as the first step for a still image capture.
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/lock-focus.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [lockFocus](./lock-focus.md)
2 |
3 | # lockFocus
4 |
5 | `fun lockFocus(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | Lock the focus as the first step for a still image capture.
8 |
9 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/prepare-to-preview.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCamera.prepareToPreview - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.services / ManagedCamera / prepareToPreview
9 |
10 | prepareToPreview
11 |
12 | fun prepareToPreview ( ) : Unit
13 | The Consumer should call this method when it wants the ManagedCamera to become ready to function
14 | If isPreviewing is set to true before calling this function, then the camera instance will automatically
15 | start the Camera preview in the supplied TextureView as well
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/prepare-to-preview.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [prepareToPreview](./prepare-to-preview.md)
2 |
3 | # prepareToPreview
4 |
5 | `fun prepareToPreview(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | The Consumer should call this method when it wants the [ManagedCamera](index.md) to become ready to function
8 | If [isPreviewing](is-previewing.md) is set to true before calling this function, then the camera instance will automatically
9 | start the Camera preview in the supplied TextureView as well
10 |
11 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/release-resources.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCamera.releaseResources - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.services / ManagedCamera / releaseResources
9 |
10 | releaseResources
11 |
12 | fun releaseResources ( ) : Unit
13 | The Consumer should call this method when it wants the ManagedCamera to release camera resources, and shut down
14 | any ongoing previews.
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/release-resources.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [releaseResources](./release-resources.md)
2 |
3 | # releaseResources
4 |
5 | `fun releaseResources(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | The Consumer should call this method when it wants the [ManagedCamera](index.md) to release camera resources, and shut down
8 | any ongoing previews.
9 |
10 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/surface-texture-listener.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCamera.surfaceTextureListener - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.services / ManagedCamera / surfaceTextureListener
9 |
10 | surfaceTextureListener
11 |
12 | val surfaceTextureListener : SurfaceTextureListener
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/surface-texture-listener.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [surfaceTextureListener](./surface-texture-listener.md)
2 |
3 | # surfaceTextureListener
4 |
5 | `val surfaceTextureListener: `[`SurfaceTextureListener`](https://developer.android.com/reference/android/view/TextureView/SurfaceTextureListener.html)
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/system-id.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCamera.systemId - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.services / ManagedCamera / systemId
9 |
10 | systemId
11 |
12 | val systemId : String
13 | systemId holds the cameraId that maps this camera instance to the system's camera device number.
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/system-id.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [systemId](./system-id.md)
2 |
3 | # systemId
4 |
5 | `val systemId: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
6 |
7 | systemId holds the cameraId that maps this camera instance to the system's camera device number.
8 |
9 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/texture-view.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCamera.textureView - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.services / ManagedCamera / textureView
9 |
10 | textureView
11 |
12 | val textureView : AutoFitTextureView
13 | An AutoFitTextureView for camera preview.
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/texture-view.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [textureView](./texture-view.md)
2 |
3 | # textureView
4 |
5 | `val textureView: `[`AutoFitTextureView`](../../com.dhirajgupta.multicam.views/-auto-fit-texture-view/index.md)
6 |
7 | An [AutoFitTextureView](../../com.dhirajgupta.multicam.views/-auto-fit-texture-view/index.md) for camera preview.
8 |
9 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/thread-name.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCamera.threadName - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.services / ManagedCamera / threadName
9 |
10 | threadName
11 |
12 | val threadName : String
13 | Name of the thread that this camera object will use
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/thread-name.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [threadName](./thread-name.md)
2 |
3 | # threadName
4 |
5 | `val threadName: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
6 |
7 | Name of the thread that this camera object will use
8 |
9 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/update-preview-status.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ManagedCamera.updatePreviewStatus - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.services / ManagedCamera / updatePreviewStatus
9 |
10 | updatePreviewStatus
11 |
12 | fun updatePreviewStatus ( ) : Unit
13 | Is called whenever the implementation should be made to match up with the state of isPreviewing .
14 | cameraState is also set to IDLE or PREVIEW to match with the implementation, here.
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/update-preview-status.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [updatePreviewStatus](./update-preview-status.md)
2 |
3 | # updatePreviewStatus
4 |
5 | `fun updatePreviewStatus(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | Is called whenever the implementation should be made to match up with the state of [isPreviewing](is-previewing.md).
8 | [cameraState](camera-state.md) is also set to IDLE or PREVIEW to match with the implementation, here.
9 |
10 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | com.dhirajgupta.multicam.services - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.services
9 |
10 | Package com.dhirajgupta.multicam.services
11 | Types
12 |
13 |
14 |
15 |
16 | ManagedCamera
17 |
18 |
19 | class ManagedCamera
20 | This class is heavily inspired from Google's Camera2Basic sample at https://github.com/googlesamples/android-Camera2Basic
21 | Heavy refactoring has been carried out to move all the code from the Fragment in the sample to a self contained
22 | ManagedCamera class that can take care of it's own threads and is almost fully self sufficient.
23 | By modularizing the Camera in this way we are able to easily create multiple instances (two in this case) while the
24 | implementation code remains common between both the cameras.
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.services/index.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.services](./index.md)
2 |
3 | ## Package com.dhirajgupta.multicam.services
4 |
5 | ### Types
6 |
7 | | Name | Summary |
8 | |---|---|
9 | | [ManagedCamera](-managed-camera/index.md) | `class ManagedCamera` This class is heavily inspired from Google's Camera2Basic sample at https://github.com/googlesamples/android-Camera2Basic Heavy refactoring has been carried out to move all the code from the Fragment in the sample to a self contained [ManagedCamera](-managed-camera/index.md) class that can take care of it's own threads and is almost fully self sufficient. By modularizing the Camera in this way we are able to easily create multiple instances (two in this case) while the implementation code remains common between both the cameras. |
10 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.utils/-compare-sizes-by-area/-init-.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CompareSizesByArea. - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.utils / CompareSizesByArea / <init>
9 |
10 | <init>
11 |
12 | CompareSizesByArea ( )
13 | Compares two Size
s based on their areas.
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.utils/-compare-sizes-by-area/-init-.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.utils](../index.md) / [CompareSizesByArea](index.md) / [<init>](./-init-.md)
2 |
3 | # <init>
4 |
5 | `CompareSizesByArea()`
6 |
7 | Compares two `Size`s based on their areas.
8 |
9 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.utils/-compare-sizes-by-area/compare.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CompareSizesByArea.compare - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.utils / CompareSizesByArea / compare
9 |
10 | compare
11 |
12 | fun compare ( lhs : Size , rhs : Size ) : Int
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.utils/-compare-sizes-by-area/compare.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.utils](../index.md) / [CompareSizesByArea](index.md) / [compare](./compare.md)
2 |
3 | # compare
4 |
5 | `fun compare(lhs: `[`Size`](https://developer.android.com/reference/android/util/Size.html)`, rhs: `[`Size`](https://developer.android.com/reference/android/util/Size.html)`): `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.utils/-compare-sizes-by-area/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CompareSizesByArea - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.utils / CompareSizesByArea
9 |
10 | CompareSizesByArea
11 | class CompareSizesByArea : Comparator < Size >
12 | Compares two Size
s based on their areas.
13 | Constructors
14 |
15 |
16 |
17 |
18 | <init>
19 |
20 |
21 | CompareSizesByArea ( )
22 | Compares two Size
s based on their areas.
23 |
24 |
25 |
26 |
27 | Functions
28 |
29 |
30 |
31 |
32 | compare
33 |
34 |
35 | fun compare ( lhs : Size , rhs : Size ) : Int
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.utils/-compare-sizes-by-area/index.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.utils](../index.md) / [CompareSizesByArea](./index.md)
2 |
3 | # CompareSizesByArea
4 |
5 | `class CompareSizesByArea : `[`Comparator`](https://developer.android.com/reference/java/util/Comparator.html)`<`[`Size`](https://developer.android.com/reference/android/util/Size.html)`>`
6 |
7 | Compares two `Size`s based on their areas.
8 |
9 | ### Constructors
10 |
11 | | Name | Summary |
12 | |---|---|
13 | | [<init>](-init-.md) | `CompareSizesByArea()` Compares two `Size`s based on their areas. |
14 |
15 | ### Functions
16 |
17 | | Name | Summary |
18 | |---|---|
19 | | [compare](compare.md) | `fun compare(lhs: `[`Size`](https://developer.android.com/reference/android/util/Size.html)`, rhs: `[`Size`](https://developer.android.com/reference/android/util/Size.html)`): `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) |
20 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.utils/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | com.dhirajgupta.multicam.utils - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.utils
9 |
10 | Package com.dhirajgupta.multicam.utils
11 | Types
12 |
13 |
14 |
15 |
16 | CompareSizesByArea
17 |
18 |
19 | class CompareSizesByArea : Comparator < Size >
20 | Compares two Size
s based on their areas.
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.utils/index.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.utils](./index.md)
2 |
3 | ## Package com.dhirajgupta.multicam.utils
4 |
5 | ### Types
6 |
7 | | Name | Summary |
8 | |---|---|
9 | | [CompareSizesByArea](-compare-sizes-by-area/index.md) | `class CompareSizesByArea : `[`Comparator`](https://developer.android.com/reference/java/util/Comparator.html)`<`[`Size`](https://developer.android.com/reference/android/util/Size.html)`>` Compares two `Size`s based on their areas. |
10 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.views/-auto-fit-texture-view/-init-.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | AutoFitTextureView. - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.views / AutoFitTextureView / <init>
9 |
10 | <init>
11 |
12 | AutoFitTextureView ( context : Context , attrs : AttributeSet ? = null, defStyle : Int = 0)
13 | A TextureView that can be adjusted to a specified aspect ratio.
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.views/-auto-fit-texture-view/-init-.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.views](../index.md) / [AutoFitTextureView](index.md) / [<init>](./-init-.md)
2 |
3 | # <init>
4 |
5 | `AutoFitTextureView(context: `[`Context`](https://developer.android.com/reference/android/content/Context.html)`, attrs: `[`AttributeSet`](https://developer.android.com/reference/android/util/AttributeSet.html)`? = null, defStyle: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0)`
6 |
7 | A [TextureView](https://developer.android.com/reference/android/view/TextureView.html) that can be adjusted to a specified aspect ratio.
8 |
9 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.views/-auto-fit-texture-view/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | AutoFitTextureView - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.views / AutoFitTextureView
9 |
10 | AutoFitTextureView
11 | class AutoFitTextureView : TextureView
12 | A TextureView that can be adjusted to a specified aspect ratio.
13 | Constructors
14 |
15 |
16 |
17 |
18 | <init>
19 |
20 |
21 | AutoFitTextureView ( context : Context , attrs : AttributeSet ? = null, defStyle : Int = 0)
22 | A TextureView that can be adjusted to a specified aspect ratio.
23 |
24 |
25 |
26 |
27 | Functions
28 |
29 |
30 |
31 |
32 | onMeasure
33 |
34 |
35 | fun onMeasure ( widthMeasureSpec : Int , heightMeasureSpec : Int ) : Unit
36 |
37 |
38 |
39 | setAspectRatio
40 |
41 |
42 | fun setAspectRatio ( width : Int , height : Int ) : Unit
43 | Sets the aspect ratio for this view. The size of the view will be measured based on the ratio
44 | calculated from the parameters. Note that the actual sizes of parameters don't matter, that
45 | is, calling setAspectRatio(2, 3) and setAspectRatio(4, 6) make the same result.
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.views/-auto-fit-texture-view/index.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.views](../index.md) / [AutoFitTextureView](./index.md)
2 |
3 | # AutoFitTextureView
4 |
5 | `class AutoFitTextureView : `[`TextureView`](https://developer.android.com/reference/android/view/TextureView.html)
6 |
7 | A [TextureView](https://developer.android.com/reference/android/view/TextureView.html) that can be adjusted to a specified aspect ratio.
8 |
9 | ### Constructors
10 |
11 | | Name | Summary |
12 | |---|---|
13 | | [<init>](-init-.md) | `AutoFitTextureView(context: `[`Context`](https://developer.android.com/reference/android/content/Context.html)`, attrs: `[`AttributeSet`](https://developer.android.com/reference/android/util/AttributeSet.html)`? = null, defStyle: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0)` A [TextureView](https://developer.android.com/reference/android/view/TextureView.html) that can be adjusted to a specified aspect ratio. |
14 |
15 | ### Functions
16 |
17 | | Name | Summary |
18 | |---|---|
19 | | [onMeasure](on-measure.md) | `fun onMeasure(widthMeasureSpec: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, heightMeasureSpec: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
20 | | [setAspectRatio](set-aspect-ratio.md) | `fun setAspectRatio(width: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, height: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) Sets the aspect ratio for this view. The size of the view will be measured based on the ratio calculated from the parameters. Note that the actual sizes of parameters don't matter, that is, calling setAspectRatio(2, 3) and setAspectRatio(4, 6) make the same result. |
21 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.views/-auto-fit-texture-view/on-measure.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | AutoFitTextureView.onMeasure - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.views / AutoFitTextureView / onMeasure
9 |
10 | onMeasure
11 |
12 | protected fun onMeasure ( widthMeasureSpec : Int , heightMeasureSpec : Int ) : Unit
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.views/-auto-fit-texture-view/on-measure.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.views](../index.md) / [AutoFitTextureView](index.md) / [onMeasure](./on-measure.md)
2 |
3 | # onMeasure
4 |
5 | `protected fun onMeasure(widthMeasureSpec: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, heightMeasureSpec: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.views/-auto-fit-texture-view/set-aspect-ratio.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | AutoFitTextureView.setAspectRatio - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.views / AutoFitTextureView / setAspectRatio
9 |
10 | setAspectRatio
11 |
12 | fun setAspectRatio ( width : Int , height : Int ) : Unit
13 | Sets the aspect ratio for this view. The size of the view will be measured based on the ratio
14 | calculated from the parameters. Note that the actual sizes of parameters don't matter, that
15 | is, calling setAspectRatio(2, 3) and setAspectRatio(4, 6) make the same result.
16 | Parameters
17 |
18 | width
- Relative horizontal size
19 |
20 | height
- Relative vertical size
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.views/-auto-fit-texture-view/set-aspect-ratio.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.views](../index.md) / [AutoFitTextureView](index.md) / [setAspectRatio](./set-aspect-ratio.md)
2 |
3 | # setAspectRatio
4 |
5 | `fun setAspectRatio(width: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, height: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | Sets the aspect ratio for this view. The size of the view will be measured based on the ratio
8 | calculated from the parameters. Note that the actual sizes of parameters don't matter, that
9 | is, calling setAspectRatio(2, 3) and setAspectRatio(4, 6) make the same result.
10 |
11 | ### Parameters
12 |
13 | `width` - Relative horizontal size
14 |
15 | `height` - Relative vertical size
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.views/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | com.dhirajgupta.multicam.views - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam.views
9 |
10 | Package com.dhirajgupta.multicam.views
11 | Types
12 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam.views/index.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.views](./index.md)
2 |
3 | ## Package com.dhirajgupta.multicam.views
4 |
5 | ### Types
6 |
7 | | Name | Summary |
8 | |---|---|
9 | | [AutoFitTextureView](-auto-fit-texture-view/index.md) | `class AutoFitTextureView : `[`TextureView`](https://developer.android.com/reference/android/view/TextureView.html) A [TextureView](https://developer.android.com/reference/android/view/TextureView.html) that can be adjusted to a specified aspect ratio. |
10 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-app/-init-.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | App. - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam / App / <init>
9 |
10 | <init>
11 |
12 | App ( )
13 | Standard Android App subclass that is useful for most Apps. By providing the shared instance of the App object,
14 | we are able to access the Application Context anywhere that it is useful. In this particular project we're using
15 | Application Context to ask MediaScannerConnection to scan our newly saved images so that it appears in the user's
16 | Photo Gallery application.
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-app/-init-.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [App](index.md) / [<init>](./-init-.md)
2 |
3 | # <init>
4 |
5 | `App()`
6 |
7 | Standard Android App subclass that is useful for most Apps. By providing the shared instance of the App object,
8 | we are able to access the Application Context anywhere that it is useful. In this particular project we're using
9 | Application Context to ask [MediaScannerConnection](https://developer.android.com/reference/android/media/MediaScannerConnection.html) to scan our newly saved images so that it appears in the user's
10 | Photo Gallery application.
11 |
12 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-app/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | App - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam / App
9 |
10 | App
11 | class App : Application
12 | Standard Android App subclass that is useful for most Apps. By providing the shared instance of the App object,
13 | we are able to access the Application Context anywhere that it is useful. In this particular project we're using
14 | Application Context to ask MediaScannerConnection to scan our newly saved images so that it appears in the user's
15 | Photo Gallery application.
16 | Constructors
17 |
18 |
19 |
20 |
21 | <init>
22 |
23 |
24 | App ( )
25 | Standard Android App subclass that is useful for most Apps. By providing the shared instance of the App object,
26 | we are able to access the Application Context anywhere that it is useful. In this particular project we're using
27 | Application Context to ask MediaScannerConnection to scan our newly saved images so that it appears in the user's
28 | Photo Gallery application.
29 |
30 |
31 |
32 |
33 | Functions
34 |
35 |
36 |
37 |
38 | onCreate
39 |
40 |
41 | fun onCreate ( ) : Unit
42 |
43 |
44 |
45 | Companion Object Properties
46 |
47 |
48 |
49 |
50 | instance
51 |
52 |
53 | lateinit var instance : App
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-app/index.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [App](./index.md)
2 |
3 | # App
4 |
5 | `class App : `[`Application`](https://developer.android.com/reference/android/app/Application.html)
6 |
7 | Standard Android App subclass that is useful for most Apps. By providing the shared instance of the App object,
8 | we are able to access the Application Context anywhere that it is useful. In this particular project we're using
9 | Application Context to ask [MediaScannerConnection](https://developer.android.com/reference/android/media/MediaScannerConnection.html) to scan our newly saved images so that it appears in the user's
10 | Photo Gallery application.
11 |
12 | ### Constructors
13 |
14 | | Name | Summary |
15 | |---|---|
16 | | [<init>](-init-.md) | `App()` Standard Android App subclass that is useful for most Apps. By providing the shared instance of the App object, we are able to access the Application Context anywhere that it is useful. In this particular project we're using Application Context to ask [MediaScannerConnection](https://developer.android.com/reference/android/media/MediaScannerConnection.html) to scan our newly saved images so that it appears in the user's Photo Gallery application. |
17 |
18 | ### Functions
19 |
20 | | Name | Summary |
21 | |---|---|
22 | | [onCreate](on-create.md) | `fun onCreate(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
23 |
24 | ### Companion Object Properties
25 |
26 | | Name | Summary |
27 | |---|---|
28 | | [instance](instance.md) | `lateinit var instance: `[`App`](./index.md) |
29 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-app/instance.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | App.instance - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam / App / instance
9 |
10 | instance
11 |
12 | lateinit var instance : App
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-app/instance.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [App](index.md) / [instance](./instance.md)
2 |
3 | # instance
4 |
5 | `lateinit var instance: `[`App`](index.md)
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-app/on-create.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | App.onCreate - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam / App / onCreate
9 |
10 | onCreate
11 |
12 | fun onCreate ( ) : Unit
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-app/on-create.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [App](index.md) / [onCreate](./on-create.md)
2 |
3 | # onCreate
4 |
5 | `fun onCreate(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/-init-.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MainActivity. - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam / MainActivity / <init>
9 |
10 | <init>
11 |
12 | MainActivity ( )
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/-init-.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [<init>](./-init-.md)
2 |
3 | # <init>
4 |
5 | `MainActivity()`
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/-p-e-r-m-r-e-q_-c-a-m-e-r-a.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MainActivity.PERMREQ_CAMERA - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam / MainActivity / PERMREQ_CAMERA
9 |
10 | PERMREQ_CAMERA
11 |
12 | val PERMREQ_CAMERA : Int
13 | Request code for Camera permission request
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/-p-e-r-m-r-e-q_-c-a-m-e-r-a.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [PERMREQ_CAMERA](./-p-e-r-m-r-e-q_-c-a-m-e-r-a.md)
2 |
3 | # PERMREQ_CAMERA
4 |
5 | `val PERMREQ_CAMERA: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
6 |
7 | Request code for Camera permission request
8 |
9 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/all-permissions-granted.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MainActivity.allPermissionsGranted - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam / MainActivity / allPermissionsGranted
9 |
10 | allPermissionsGranted
11 |
12 | fun allPermissionsGranted ( ) : Unit
13 | All the required permissions have been granted, so we can now do the sensitive operations that require these
14 | permissions, namely initing the cameras and also creating the storage folder that will house saved images
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/all-permissions-granted.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [allPermissionsGranted](./all-permissions-granted.md)
2 |
3 | # allPermissionsGranted
4 |
5 | `fun allPermissionsGranted(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | All the required permissions have been granted, so we can now do the sensitive operations that require these
8 | permissions, namely initing the cameras and also creating the storage folder that will house saved images
9 |
10 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/ask-all-required-permissions.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MainActivity.askAllRequiredPermissions - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam / MainActivity / askAllRequiredPermissions
9 |
10 | askAllRequiredPermissions
11 |
12 | fun askAllRequiredPermissions ( ) : Boolean
13 | Utility function to ask for any of our required permission
14 | If the function did not ask for any permission, because all of them are granted already, returns false
15 | else it asks for the required permissions and returns true
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/ask-all-required-permissions.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [askAllRequiredPermissions](./ask-all-required-permissions.md)
2 |
3 | # askAllRequiredPermissions
4 |
5 | `fun askAllRequiredPermissions(): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
6 |
7 | Utility function to ask for any of our required permission
8 | If the function did not ask for any permission, because all of them are granted already, returns false
9 | else it asks for the required permissions and returns true
10 |
11 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/camera-status-handler.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MainActivity.cameraStatusHandler - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam / MainActivity / cameraStatusHandler
9 |
10 | cameraStatusHandler
11 |
12 | val cameraStatusHandler : ManagedCameraStatus
13 | Implementation of Custom interface to handle communication from ManagedCamera back to MainActivity .
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/camera-status-handler.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [cameraStatusHandler](./camera-status-handler.md)
2 |
3 | # cameraStatusHandler
4 |
5 | `val cameraStatusHandler: `[`ManagedCameraStatus`](../../com.dhirajgupta.multicam.interfaces/-managed-camera-status/index.md)
6 |
7 | Implementation of Custom interface to handle communication from [ManagedCamera](../../com.dhirajgupta.multicam.services/-managed-camera/index.md) back to [MainActivity](index.md).
8 |
9 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/camera0.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MainActivity.camera0 - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam / MainActivity / camera0
9 |
10 | camera0
11 |
12 | var camera0 : ManagedCamera ?
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/camera0.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [camera0](./camera0.md)
2 |
3 | # camera0
4 |
5 | `var camera0: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`?`
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/camera1.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MainActivity.camera1 - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam / MainActivity / camera1
9 |
10 | camera1
11 |
12 | var camera1 : ManagedCamera ?
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/camera1.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [camera1](./camera1.md)
2 |
3 | # camera1
4 |
5 | `var camera1: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`?`
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/index.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](./index.md)
2 |
3 | # MainActivity
4 |
5 | `class MainActivity : AppCompatActivity`
6 |
7 | ### Constructors
8 |
9 | | Name | Summary |
10 | |---|---|
11 | | [<init>](-init-.md) | `MainActivity()` |
12 |
13 | ### Properties
14 |
15 | | Name | Summary |
16 | |---|---|
17 | | [camera0](camera0.md) | `var camera0: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`?` |
18 | | [camera1](camera1.md) | `var camera1: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`?` |
19 | | [cameraStatusHandler](camera-status-handler.md) | `val cameraStatusHandler: `[`ManagedCameraStatus`](../../com.dhirajgupta.multicam.interfaces/-managed-camera-status/index.md) Implementation of Custom interface to handle communication from [ManagedCamera](../../com.dhirajgupta.multicam.services/-managed-camera/index.md) back to [MainActivity](./index.md). |
20 | | [PERMREQ_CAMERA](-p-e-r-m-r-e-q_-c-a-m-e-r-a.md) | `val PERMREQ_CAMERA: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) Request code for Camera permission request |
21 |
22 | ### Functions
23 |
24 | | Name | Summary |
25 | |---|---|
26 | | [allPermissionsGranted](all-permissions-granted.md) | `fun allPermissionsGranted(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) All the required permissions have been granted, so we can now do the sensitive operations that require these permissions, namely initing the cameras and also creating the storage folder that will house saved images |
27 | | [askAllRequiredPermissions](ask-all-required-permissions.md) | `fun askAllRequiredPermissions(): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) Utility function to ask for any of our required permission If the function did not ask for any permission, because all of them are granted already, returns false else it asks for the required permissions and returns true |
28 | | [initCameras](init-cameras.md) | `fun initCameras(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) Checks available cameras and inits them. At least one camera is required, else the app will quit |
29 | | [onCreate](on-create.md) | `fun onCreate(savedInstanceState: `[`Bundle`](https://developer.android.com/reference/android/os/Bundle.html)`?): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
30 | | [onPause](on-pause.md) | `fun onPause(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) We must save the state of the app, including which cameras were operational and then, relinquish control on the camera(s) so that the OS can allocate them as required |
31 | | [onRequestPermissionsResult](on-request-permissions-result.md) | `fun onRequestPermissionsResult(requestCode: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, permissions: `[`Array`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)`, grantResults: `[`IntArray`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int-array/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) Handle Activity permission request responses |
32 | | [onResumeFragments](on-resume-fragments.md) | `fun onResumeFragments(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) Even though we're not using Fragments, *right now*, we will ultimately do so in the future, so it makes sense to override onResumeFragments instead of onResume We will perform on-foreground steps in this method, and open the camera(s) that were operating in last session, or if [MainActivity](./index.md) was just created, then the first Camera only |
33 | | [toggleCamera](toggle-camera.md) | `fun toggleCamera(camera: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`?): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) Simple function that sets the [ManagedCamera.isPreviewing](../../com.dhirajgupta.multicam.services/-managed-camera/is-previewing.md) to the opposite of whatever it is, currently, and then asks the camera to update it's preview status. As the status of the camera changes, the appropriate callbacks will be called to update [MainActivity](./index.md) labels. |
34 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/init-cameras.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MainActivity.initCameras - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam / MainActivity / initCameras
9 |
10 | initCameras
11 |
12 | fun initCameras ( ) : Unit
13 | Checks available cameras and inits them. At least one camera is required, else the app will quit
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/init-cameras.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [initCameras](./init-cameras.md)
2 |
3 | # initCameras
4 |
5 | `fun initCameras(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | Checks available cameras and inits them. At least one camera is required, else the app will quit
8 |
9 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/on-create.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MainActivity.onCreate - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam / MainActivity / onCreate
9 |
10 | onCreate
11 |
12 | protected fun onCreate ( savedInstanceState : Bundle ? ) : Unit
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/on-create.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [onCreate](./on-create.md)
2 |
3 | # onCreate
4 |
5 | `protected fun onCreate(savedInstanceState: `[`Bundle`](https://developer.android.com/reference/android/os/Bundle.html)`?): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/on-pause.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MainActivity.onPause - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam / MainActivity / onPause
9 |
10 | onPause
11 |
12 | protected fun onPause ( ) : Unit
13 | We must save the state of the app, including which cameras were operational and then,
14 | relinquish control on the camera(s) so that the OS can allocate them as required
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/on-pause.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [onPause](./on-pause.md)
2 |
3 | # onPause
4 |
5 | `protected fun onPause(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | We must save the state of the app, including which cameras were operational and then,
8 | relinquish control on the camera(s) so that the OS can allocate them as required
9 |
10 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/on-request-permissions-result.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MainActivity.onRequestPermissionsResult - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam / MainActivity / onRequestPermissionsResult
9 |
10 | onRequestPermissionsResult
11 |
12 | fun onRequestPermissionsResult ( requestCode : Int , permissions : Array < out String > , grantResults : IntArray ) : Unit
13 | Handle Activity permission request responses
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/on-request-permissions-result.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [onRequestPermissionsResult](./on-request-permissions-result.md)
2 |
3 | # onRequestPermissionsResult
4 |
5 | `fun onRequestPermissionsResult(requestCode: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, permissions: `[`Array`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)`, grantResults: `[`IntArray`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int-array/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | Handle Activity permission request responses
8 |
9 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/on-resume-fragments.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MainActivity.onResumeFragments - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam / MainActivity / onResumeFragments
9 |
10 | onResumeFragments
11 |
12 | protected fun onResumeFragments ( ) : Unit
13 | Even though we're not using Fragments, right now , we will ultimately do so in the future,
14 | so it makes sense to override onResumeFragments instead of onResume
15 | We will perform on-foreground steps in this method, and open the camera(s) that were operating
16 | in last session, or if MainActivity was just created, then the first Camera only
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/on-resume-fragments.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [onResumeFragments](./on-resume-fragments.md)
2 |
3 | # onResumeFragments
4 |
5 | `protected fun onResumeFragments(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | Even though we're not using Fragments, *right now*, we will ultimately do so in the future,
8 | so it makes sense to override onResumeFragments instead of onResume
9 | We will perform on-foreground steps in this method, and open the camera(s) that were operating
10 | in last session, or if [MainActivity](index.md) was just created, then the first Camera only
11 |
12 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/toggle-camera.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MainActivity.toggleCamera - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam / MainActivity / toggleCamera
9 |
10 | toggleCamera
11 |
12 | fun toggleCamera ( camera : ManagedCamera ? ) : Unit
13 | Simple function that sets the ManagedCamera.isPreviewing to the opposite of whatever it is, currently, and
14 | then asks the camera to update it's preview status.
15 | As the status of the camera changes, the appropriate callbacks will be called to update MainActivity labels.
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/-main-activity/toggle-camera.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [toggleCamera](./toggle-camera.md)
2 |
3 | # toggleCamera
4 |
5 | `fun toggleCamera(camera: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`?): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | Simple function that sets the [ManagedCamera.isPreviewing](../../com.dhirajgupta.multicam.services/-managed-camera/is-previewing.md) to the opposite of whatever it is, currently, and
8 | then asks the camera to update it's preview status.
9 | As the status of the camera changes, the appropriate callbacks will be called to update [MainActivity](index.md) labels.
10 |
11 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | com.dhirajgupta.multicam - app
5 |
6 |
7 |
8 | app / com.dhirajgupta.multicam
9 |
10 | Package com.dhirajgupta.multicam
11 | Types
12 |
13 |
14 |
15 |
16 | App
17 |
18 |
19 | class App : Application
20 | Standard Android App subclass that is useful for most Apps. By providing the shared instance of the App object,
21 | we are able to access the Application Context anywhere that it is useful. In this particular project we're using
22 | Application Context to ask MediaScannerConnection to scan our newly saved images so that it appears in the user's
23 | Photo Gallery application.
24 |
25 |
26 |
27 |
28 | MainActivity
29 |
30 |
31 | class MainActivity : AppCompatActivity
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/app/javadoc/app/com.dhirajgupta.multicam/index.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam](./index.md)
2 |
3 | ## Package com.dhirajgupta.multicam
4 |
5 | ### Types
6 |
7 | | Name | Summary |
8 | |---|---|
9 | | [App](-app/index.md) | `class App : `[`Application`](https://developer.android.com/reference/android/app/Application.html) Standard Android App subclass that is useful for most Apps. By providing the shared instance of the App object, we are able to access the Application Context anywhere that it is useful. In this particular project we're using Application Context to ask [MediaScannerConnection](https://developer.android.com/reference/android/media/MediaScannerConnection.html) to scan our newly saved images so that it appears in the user's Photo Gallery application. |
10 | | [MainActivity](-main-activity/index.md) | `class MainActivity : AppCompatActivity` |
11 |
--------------------------------------------------------------------------------
/app/javadoc/app/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | app
5 |
6 |
7 |
8 | app
9 |
10 | Packages
11 |
50 | Index
51 | All Types
52 |
53 |
54 |
--------------------------------------------------------------------------------
/app/javadoc/app/index.md:
--------------------------------------------------------------------------------
1 | [app](./index.md)
2 |
3 | ### Packages
4 |
5 | | Name | Summary |
6 | |---|---|
7 | | [com.dhirajgupta.multicam](com.dhirajgupta.multicam/index.md) | |
8 | | [com.dhirajgupta.multicam.interfaces](com.dhirajgupta.multicam.interfaces/index.md) | |
9 | | [com.dhirajgupta.multicam.services](com.dhirajgupta.multicam.services/index.md) | |
10 | | [com.dhirajgupta.multicam.utils](com.dhirajgupta.multicam.utils/index.md) | |
11 | | [com.dhirajgupta.multicam.views](com.dhirajgupta.multicam.views/index.md) | |
12 |
13 | ### Index
14 |
15 | [All Types](alltypes/index.md)
--------------------------------------------------------------------------------
/app/javadoc/app/package-list:
--------------------------------------------------------------------------------
1 | $dokka.format:html
2 | $dokka.linkExtension:html
3 |
4 | com.dhirajgupta.multicam
5 | com.dhirajgupta.multicam.interfaces
6 | com.dhirajgupta.multicam.services
7 | com.dhirajgupta.multicam.utils
8 | com.dhirajgupta.multicam.views
9 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/dhirajgupta/multicam/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.dhirajgupta.multicam
2 |
3 | import androidx.test.InstrumentationRegistry
4 | import androidx.test.runner.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getTargetContext()
22 | assertEquals("com.dhirajgupta.multicam", appContext.packageName)
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
20 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dhirajgupta/multicam/App.kt:
--------------------------------------------------------------------------------
1 | package com.dhirajgupta.multicam
2 |
3 | import android.app.Application
4 | import android.media.MediaScannerConnection
5 | import timber.log.Timber
6 |
7 | /**
8 | * Standard Android App subclass that is useful for most Apps. By providing the shared instance of the App object,
9 | * we are able to access the Application Context anywhere that it is useful. In this particular project we're using
10 | * Application Context to ask [MediaScannerConnection] to scan our newly saved images so that it appears in the user's
11 | * Photo Gallery application.
12 | */
13 | class App: Application() {
14 | override fun onCreate() {
15 | super.onCreate()
16 | instance = this
17 |
18 | if (BuildConfig.DEBUG) { //Debug level logging so that we can see logging output in LogCat console
19 | Timber.plant(Timber.DebugTree())
20 | }
21 | Timber.i("App starting up...")
22 | }
23 | companion object {
24 | lateinit var instance: App
25 | private set
26 | }
27 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/dhirajgupta/multicam/interfaces/ManagedCameraStatus.kt:
--------------------------------------------------------------------------------
1 | package com.dhirajgupta.multicam.interfaces
2 |
3 | import com.dhirajgupta.multicam.services.ManagedCamera
4 | import java.io.File
5 |
6 | /**
7 | * Camera state: Idle / Not started.
8 | */
9 | val CAMERASTATE_IDLE = -1
10 |
11 | /**
12 | * Camera state: Showing camera preview.
13 | */
14 | val CAMERASTATE_PREVIEW = 0
15 |
16 | /**
17 | * Camera state: Waiting for the focus to be locked.
18 | */
19 | val CAMERASTATE_WAITING_LOCK = 1
20 |
21 | /**
22 | * Camera state: Waiting for the exposure to be precapture state.
23 | */
24 | val CAMERASTATE_WAITING_PRECAPTURE = 2
25 |
26 | /**
27 | * Camera state: Waiting for the exposure state to be something other than precapture.
28 | */
29 | val CAMERASTATE_WAITING_NON_PRECAPTURE = 3
30 |
31 | /**
32 | * Camera state: Picture was taken.
33 | */
34 | val CAMERASTATE_PICTURE_TAKEN = 4
35 |
36 | /**
37 | * Consumers of [ManagedCamera] need to supply an implementation of this interface to allow the camera instance to
38 | * communicate back as required
39 | */
40 | interface ManagedCameraStatus {
41 | fun cameraFPSchanged(camera: ManagedCamera, fps: Int)
42 | fun cameraStateChanged(camera: ManagedCamera, state: Int)
43 | fun cameraSavedPhoto(camera: ManagedCamera, filePath:File)
44 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/dhirajgupta/multicam/services/ImageSaver.kt:
--------------------------------------------------------------------------------
1 | package com.dhirajgupta.multicam.services
2 |
3 | import android.media.Image
4 | import android.media.MediaScannerConnection
5 | import android.net.Uri
6 | import com.dhirajgupta.multicam.App
7 | import timber.log.Timber
8 | import java.io.File
9 | import java.io.FileOutputStream
10 | import java.io.IOException
11 |
12 |
13 | /**
14 | * Saves a JPEG [Image] into the specified [File].
15 | */
16 | internal class ImageSaver(
17 | /**
18 | * The JPEG image
19 | */
20 | private val image: Image,
21 |
22 | /**
23 | * The file we save the image into.
24 | */
25 | private val file: File
26 | ) : Runnable {
27 |
28 | override fun run() {
29 | val buffer = image.planes[0].buffer
30 | val bytes = ByteArray(buffer.remaining())
31 | buffer.get(bytes)
32 | var output: FileOutputStream? = null
33 | try {
34 | output = FileOutputStream(file).apply {
35 | write(bytes)
36 | }
37 | } catch (e: IOException) {
38 | Timber.e(e)
39 | } finally {
40 | image.close()
41 | output?.let {
42 | try {
43 | it.close()
44 | } catch (e: IOException) {
45 | Timber.e(e)
46 | }
47 | }
48 |
49 | /**
50 | * Ask the MediaScanner service to scan the file that we just saved on to External Storage so that it
51 | * becomes available in the Device gallery
52 | */
53 | MediaScannerConnection.scanFile(
54 | App.instance,
55 | arrayOf(file.absolutePath),
56 | null,
57 | object : MediaScannerConnection.OnScanCompletedListener {
58 | override fun onScanCompleted(path: String?, uri: Uri?) {
59 | Timber.i("ContentScanner scanned path:$path, uri:$uri")
60 | }
61 | })
62 | }
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dhirajgupta/multicam/utils/CompareSizesByArea.kt:
--------------------------------------------------------------------------------
1 | package com.dhirajgupta.multicam.utils
2 |
3 | import android.util.Size
4 | import java.lang.Long.signum
5 |
6 | import java.util.Comparator
7 |
8 | /**
9 | * Compares two `Size`s based on their areas.
10 | */
11 | class CompareSizesByArea : Comparator {
12 |
13 | // We cast here to ensure the multiplications won't overflow
14 | override fun compare(lhs: Size, rhs: Size) =
15 | signum(lhs.width.toLong() * lhs.height - rhs.width.toLong() * rhs.height)
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dhirajgupta/multicam/views/AutoFitTextureView.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The Android Open Source Project
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 | * http://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 | package com.dhirajgupta.multicam.views
18 |
19 | import android.content.Context
20 | import android.util.AttributeSet
21 | import android.view.TextureView
22 | import android.view.View
23 |
24 | /**
25 | * A [TextureView] that can be adjusted to a specified aspect ratio.
26 | */
27 | class AutoFitTextureView @JvmOverloads constructor(
28 | context: Context,
29 | attrs: AttributeSet? = null,
30 | defStyle: Int = 0
31 | ) : TextureView(context, attrs, defStyle) {
32 |
33 | private var ratioWidth = 0
34 | private var ratioHeight = 0
35 |
36 | /**
37 | * Sets the aspect ratio for this view. The size of the view will be measured based on the ratio
38 | * calculated from the parameters. Note that the actual sizes of parameters don't matter, that
39 | * is, calling setAspectRatio(2, 3) and setAspectRatio(4, 6) make the same result.
40 | *
41 | * @param width Relative horizontal size
42 | * @param height Relative vertical size
43 | */
44 | fun setAspectRatio(width: Int, height: Int) {
45 | if (width < 0 || height < 0) {
46 | throw IllegalArgumentException("Size cannot be negative.")
47 | }
48 | ratioWidth = width
49 | ratioHeight = height
50 | requestLayout()
51 | }
52 |
53 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
54 | super.onMeasure(widthMeasureSpec, heightMeasureSpec)
55 | val width = View.MeasureSpec.getSize(widthMeasureSpec)
56 | val height = View.MeasureSpec.getSize(heightMeasureSpec)
57 | if (ratioWidth == 0 || ratioHeight == 0) {
58 | setMeasuredDimension(width, height)
59 | } else {
60 | if (width < height * ratioWidth / ratioHeight) {
61 | setMeasuredDimension(width, width * ratioHeight / ratioWidth)
62 | } else {
63 | setMeasuredDimension(height * ratioWidth / ratioHeight, height)
64 | }
65 | }
66 | }
67 |
68 | }
69 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhiraj/androidmulticam/1144541e6b986d37d49f7a0175b15095eebf485c/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhiraj/androidmulticam/1144541e6b986d37d49f7a0175b15095eebf485c/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhiraj/androidmulticam/1144541e6b986d37d49f7a0175b15095eebf485c/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhiraj/androidmulticam/1144541e6b986d37d49f7a0175b15095eebf485c/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhiraj/androidmulticam/1144541e6b986d37d49f7a0175b15095eebf485c/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhiraj/androidmulticam/1144541e6b986d37d49f7a0175b15095eebf485c/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhiraj/androidmulticam/1144541e6b986d37d49f7a0175b15095eebf485c/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhiraj/androidmulticam/1144541e6b986d37d49f7a0175b15095eebf485c/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhiraj/androidmulticam/1144541e6b986d37d49f7a0175b15095eebf485c/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhiraj/androidmulticam/1144541e6b986d37d49f7a0175b15095eebf485c/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | MultiCam
3 | Yes
4 | No
5 | OK
6 | Cancel
7 | This device has no cameras, the application cannot show any video!
8 |
9 | MolecuLight Camera Test
10 | Save
11 | Stop
12 | Start
13 | Cam %1$s: %2$d fps
14 | Cam %1$s: idle
15 | Browse
16 | Cam %1$s saved photo to %2$s
17 | MultiCam needs your permission to Record Video and access Storage to function properly. Press Yes to proceed.
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/dhirajgupta/multicam/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.dhirajgupta.multicam
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext.kotlin_version = '1.3.31'
5 | ext.dokka_version = '0.9.18'
6 | repositories {
7 | google()
8 | jcenter()
9 |
10 | }
11 | dependencies {
12 | classpath 'com.android.tools.build:gradle:3.4.2'
13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14 | classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:$dokka_version"
15 | // NOTE: Do not place your application dependencies here; they belong
16 | // in the individual module build.gradle files
17 | }
18 | }
19 |
20 | allprojects {
21 | repositories {
22 | google()
23 | jcenter()
24 |
25 | }
26 | }
27 |
28 | task clean(type: Delete) {
29 | delete rootProject.buildDir
30 | }
31 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
22 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dhiraj/androidmulticam/1144541e6b986d37d49f7a0175b15095eebf485c/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Jul 21 09:35:34 EDT 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/javadoc/app/alltypes/index.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ### All Types
4 |
5 | | Name | Summary |
6 | |---|---|
7 | | [com.dhirajgupta.multicam.App](../com.dhirajgupta.multicam/-app/index.md) | Standard Android App subclass that is useful for most Apps. By providing the shared instance of the App object, we are able to access the Application Context anywhere that it is useful. In this particular project we're using Application Context to ask [MediaScannerConnection](https://developer.android.com/reference/android/media/MediaScannerConnection.html) to scan our newly saved images so that it appears in the user's Photo Gallery application. |
8 | | [com.dhirajgupta.multicam.views.AutoFitTextureView](../com.dhirajgupta.multicam.views/-auto-fit-texture-view/index.md) | A [TextureView](https://developer.android.com/reference/android/view/TextureView.html) that can be adjusted to a specified aspect ratio. |
9 | | [com.dhirajgupta.multicam.utils.CompareSizesByArea](../com.dhirajgupta.multicam.utils/-compare-sizes-by-area/index.md) | Compares two `Size`s based on their areas. |
10 | | [com.dhirajgupta.multicam.MainActivity](../com.dhirajgupta.multicam/-main-activity/index.md) | |
11 | | [com.dhirajgupta.multicam.services.ManagedCamera](../com.dhirajgupta.multicam.services/-managed-camera/index.md) | This class is heavily inspired from Google's Camera2Basic sample at https://github.com/googlesamples/android-Camera2Basic Heavy refactoring has been carried out to move all the code from the Fragment in the sample to a self contained [ManagedCamera](../com.dhirajgupta.multicam.services/-managed-camera/index.md) class that can take care of it's own threads and is almost fully self sufficient. By modularizing the Camera in this way we are able to easily create multiple instances (two in this case) while the implementation code remains common between both the cameras. |
12 | | [com.dhirajgupta.multicam.interfaces.ManagedCameraStatus](../com.dhirajgupta.multicam.interfaces/-managed-camera-status/index.md) | Consumers of [ManagedCamera](../com.dhirajgupta.multicam.services/-managed-camera/index.md) need to supply an implementation of this interface to allow the camera instance to communicate back as required |
13 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.interfaces/-c-a-m-e-r-a-s-t-a-t-e_-i-d-l-e.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.interfaces](index.md) / [CAMERASTATE_IDLE](./-c-a-m-e-r-a-s-t-a-t-e_-i-d-l-e.md)
2 |
3 | # CAMERASTATE_IDLE
4 |
5 | `val CAMERASTATE_IDLE: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
6 |
7 | Camera state: Idle / Not started.
8 |
9 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.interfaces/-c-a-m-e-r-a-s-t-a-t-e_-p-i-c-t-u-r-e_-t-a-k-e-n.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.interfaces](index.md) / [CAMERASTATE_PICTURE_TAKEN](./-c-a-m-e-r-a-s-t-a-t-e_-p-i-c-t-u-r-e_-t-a-k-e-n.md)
2 |
3 | # CAMERASTATE_PICTURE_TAKEN
4 |
5 | `val CAMERASTATE_PICTURE_TAKEN: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
6 |
7 | Camera state: Picture was taken.
8 |
9 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.interfaces/-c-a-m-e-r-a-s-t-a-t-e_-p-r-e-v-i-e-w.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.interfaces](index.md) / [CAMERASTATE_PREVIEW](./-c-a-m-e-r-a-s-t-a-t-e_-p-r-e-v-i-e-w.md)
2 |
3 | # CAMERASTATE_PREVIEW
4 |
5 | `val CAMERASTATE_PREVIEW: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
6 |
7 | Camera state: Showing camera preview.
8 |
9 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.interfaces/-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-l-o-c-k.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.interfaces](index.md) / [CAMERASTATE_WAITING_LOCK](./-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-l-o-c-k.md)
2 |
3 | # CAMERASTATE_WAITING_LOCK
4 |
5 | `val CAMERASTATE_WAITING_LOCK: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
6 |
7 | Camera state: Waiting for the focus to be locked.
8 |
9 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.interfaces/-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-n-o-n_-p-r-e-c-a-p-t-u-r-e.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.interfaces](index.md) / [CAMERASTATE_WAITING_NON_PRECAPTURE](./-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-n-o-n_-p-r-e-c-a-p-t-u-r-e.md)
2 |
3 | # CAMERASTATE_WAITING_NON_PRECAPTURE
4 |
5 | `val CAMERASTATE_WAITING_NON_PRECAPTURE: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
6 |
7 | Camera state: Waiting for the exposure state to be something other than precapture.
8 |
9 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.interfaces/-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-p-r-e-c-a-p-t-u-r-e.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.interfaces](index.md) / [CAMERASTATE_WAITING_PRECAPTURE](./-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-p-r-e-c-a-p-t-u-r-e.md)
2 |
3 | # CAMERASTATE_WAITING_PRECAPTURE
4 |
5 | `val CAMERASTATE_WAITING_PRECAPTURE: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
6 |
7 | Camera state: Waiting for the exposure to be precapture state.
8 |
9 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.interfaces/-managed-camera-status/camera-f-p-schanged.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.interfaces](../index.md) / [ManagedCameraStatus](index.md) / [cameraFPSchanged](./camera-f-p-schanged.md)
2 |
3 | # cameraFPSchanged
4 |
5 | `abstract fun cameraFPSchanged(camera: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`, fps: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.interfaces/-managed-camera-status/camera-saved-photo.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.interfaces](../index.md) / [ManagedCameraStatus](index.md) / [cameraSavedPhoto](./camera-saved-photo.md)
2 |
3 | # cameraSavedPhoto
4 |
5 | `abstract fun cameraSavedPhoto(camera: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`, filePath: `[`File`](https://developer.android.com/reference/java/io/File.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.interfaces/-managed-camera-status/camera-state-changed.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.interfaces](../index.md) / [ManagedCameraStatus](index.md) / [cameraStateChanged](./camera-state-changed.md)
2 |
3 | # cameraStateChanged
4 |
5 | `abstract fun cameraStateChanged(camera: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`, state: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.interfaces/-managed-camera-status/index.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.interfaces](../index.md) / [ManagedCameraStatus](./index.md)
2 |
3 | # ManagedCameraStatus
4 |
5 | `interface ManagedCameraStatus`
6 |
7 | Consumers of [ManagedCamera](../../com.dhirajgupta.multicam.services/-managed-camera/index.md) need to supply an implementation of this interface to allow the camera instance to
8 | communicate back as required
9 |
10 | ### Functions
11 |
12 | | Name | Summary |
13 | |---|---|
14 | | [cameraFPSchanged](camera-f-p-schanged.md) | `abstract fun cameraFPSchanged(camera: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`, fps: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
15 | | [cameraSavedPhoto](camera-saved-photo.md) | `abstract fun cameraSavedPhoto(camera: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`, filePath: `[`File`](https://developer.android.com/reference/java/io/File.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
16 | | [cameraStateChanged](camera-state-changed.md) | `abstract fun cameraStateChanged(camera: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`, state: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
17 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.interfaces/index.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.interfaces](./index.md)
2 |
3 | ## Package com.dhirajgupta.multicam.interfaces
4 |
5 | ### Types
6 |
7 | | Name | Summary |
8 | |---|---|
9 | | [ManagedCameraStatus](-managed-camera-status/index.md) | `interface ManagedCameraStatus` Consumers of [ManagedCamera](../com.dhirajgupta.multicam.services/-managed-camera/index.md) need to supply an implementation of this interface to allow the camera instance to communicate back as required |
10 |
11 | ### Properties
12 |
13 | | Name | Summary |
14 | |---|---|
15 | | [CAMERASTATE_IDLE](-c-a-m-e-r-a-s-t-a-t-e_-i-d-l-e.md) | `val CAMERASTATE_IDLE: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) Camera state: Idle / Not started. |
16 | | [CAMERASTATE_PICTURE_TAKEN](-c-a-m-e-r-a-s-t-a-t-e_-p-i-c-t-u-r-e_-t-a-k-e-n.md) | `val CAMERASTATE_PICTURE_TAKEN: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) Camera state: Picture was taken. |
17 | | [CAMERASTATE_PREVIEW](-c-a-m-e-r-a-s-t-a-t-e_-p-r-e-v-i-e-w.md) | `val CAMERASTATE_PREVIEW: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) Camera state: Showing camera preview. |
18 | | [CAMERASTATE_WAITING_LOCK](-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-l-o-c-k.md) | `val CAMERASTATE_WAITING_LOCK: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) Camera state: Waiting for the focus to be locked. |
19 | | [CAMERASTATE_WAITING_NON_PRECAPTURE](-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-n-o-n_-p-r-e-c-a-p-t-u-r-e.md) | `val CAMERASTATE_WAITING_NON_PRECAPTURE: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) Camera state: Waiting for the exposure state to be something other than precapture. |
20 | | [CAMERASTATE_WAITING_PRECAPTURE](-c-a-m-e-r-a-s-t-a-t-e_-w-a-i-t-i-n-g_-p-r-e-c-a-p-t-u-r-e.md) | `val CAMERASTATE_WAITING_PRECAPTURE: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) Camera state: Waiting for the exposure to be precapture state. |
21 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/-init-.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [<init>](./-init-.md)
2 |
3 | # <init>
4 |
5 | `ManagedCamera(systemId: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, threadName: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, textureView: `[`AutoFitTextureView`](../../com.dhirajgupta.multicam.views/-auto-fit-texture-view/index.md)`, listener: `[`ManagedCameraStatus`](../../com.dhirajgupta.multicam.interfaces/-managed-camera-status/index.md)`)`
6 |
7 | This class is heavily inspired from Google's Camera2Basic sample at https://github.com/googlesamples/android-Camera2Basic
8 | Heavy refactoring has been carried out to move all the code from the Fragment in the sample to a self contained
9 | [ManagedCamera](index.md) class that can take care of it's own threads and is almost fully self sufficient.
10 | By modularizing the Camera in this way we are able to easily create multiple instances (two in this case) while the
11 | implementation code remains common between both the cameras.
12 |
13 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/activity.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [activity](./activity.md)
2 |
3 | # activity
4 |
5 | `val activity: `[`Activity`](https://developer.android.com/reference/android/app/Activity.html)
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/camera-state.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [cameraState](./camera-state.md)
2 |
3 | # cameraState
4 |
5 | `var cameraState: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
6 |
7 | The current state of camera state for taking pictures.
8 | REFACTORING NOTE: CAMERASTSATE_IDLE has been specifically added to allow consumers to know when the Camera is idle
9 |
10 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/filename-format.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [filenameFormat](./filename-format.md)
2 |
3 | # filenameFormat
4 |
5 | `val filenameFormat: `[`SimpleDateFormat`](https://developer.android.com/reference/java/text/SimpleDateFormat.html)
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/is-previewing.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [isPreviewing](./is-previewing.md)
2 |
3 | # isPreviewing
4 |
5 | `var isPreviewing: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
6 |
7 | A flag to match the preview playing status of the camera. If initially set to true, then the [ManagedCamera](index.md)
8 | instance will automatically start the preview when it becomes possible
9 |
10 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/last-f-p-s.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [lastFPS](./last-f-p-s.md)
2 |
3 | # lastFPS
4 |
5 | `var lastFPS: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
6 |
7 | Capture the last FPS to allow debouncing to notify the consumer only when an FPS change is actually detected.
8 |
9 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/last-millis.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [lastMillis](./last-millis.md)
2 |
3 | # lastMillis
4 |
5 | `var lastMillis: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)
6 |
7 | Capture the last milliseconds to allow fps calculation for this camera view
8 |
9 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/listener.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [listener](./listener.md)
2 |
3 | # listener
4 |
5 | `val listener: `[`ManagedCameraStatus`](../../com.dhirajgupta.multicam.interfaces/-managed-camera-status/index.md)
6 |
7 | Listener to observe notifications from camera state and FPS changeΩs
8 |
9 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/lock-focus.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [lockFocus](./lock-focus.md)
2 |
3 | # lockFocus
4 |
5 | `fun lockFocus(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | Lock the focus as the first step for a still image capture.
8 |
9 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/prepare-to-preview.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [prepareToPreview](./prepare-to-preview.md)
2 |
3 | # prepareToPreview
4 |
5 | `fun prepareToPreview(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | The Consumer should call this method when it wants the [ManagedCamera](index.md) to become ready to function
8 | If [isPreviewing](is-previewing.md) is set to true before calling this function, then the camera instance will automatically
9 | start the Camera preview in the supplied TextureView as well
10 |
11 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/release-resources.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [releaseResources](./release-resources.md)
2 |
3 | # releaseResources
4 |
5 | `fun releaseResources(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | The Consumer should call this method when it wants the [ManagedCamera](index.md) to release camera resources, and shut down
8 | any ongoing previews.
9 |
10 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/surface-texture-listener.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [surfaceTextureListener](./surface-texture-listener.md)
2 |
3 | # surfaceTextureListener
4 |
5 | `val surfaceTextureListener: `[`SurfaceTextureListener`](https://developer.android.com/reference/android/view/TextureView/SurfaceTextureListener.html)
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/system-id.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [systemId](./system-id.md)
2 |
3 | # systemId
4 |
5 | `val systemId: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
6 |
7 | systemId holds the cameraId that maps this camera instance to the system's camera device number.
8 |
9 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/texture-view.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [textureView](./texture-view.md)
2 |
3 | # textureView
4 |
5 | `val textureView: `[`AutoFitTextureView`](../../com.dhirajgupta.multicam.views/-auto-fit-texture-view/index.md)
6 |
7 | An [AutoFitTextureView](../../com.dhirajgupta.multicam.views/-auto-fit-texture-view/index.md) for camera preview.
8 |
9 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/thread-name.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [threadName](./thread-name.md)
2 |
3 | # threadName
4 |
5 | `val threadName: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
6 |
7 | Name of the thread that this camera object will use
8 |
9 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.services/-managed-camera/update-preview-status.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.services](../index.md) / [ManagedCamera](index.md) / [updatePreviewStatus](./update-preview-status.md)
2 |
3 | # updatePreviewStatus
4 |
5 | `fun updatePreviewStatus(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | Is called whenever the implementation should be made to match up with the state of [isPreviewing](is-previewing.md).
8 | [cameraState](camera-state.md) is also set to IDLE or PREVIEW to match with the implementation, here.
9 |
10 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.services/index.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.services](./index.md)
2 |
3 | ## Package com.dhirajgupta.multicam.services
4 |
5 | ### Types
6 |
7 | | Name | Summary |
8 | |---|---|
9 | | [ManagedCamera](-managed-camera/index.md) | `class ManagedCamera` This class is heavily inspired from Google's Camera2Basic sample at https://github.com/googlesamples/android-Camera2Basic Heavy refactoring has been carried out to move all the code from the Fragment in the sample to a self contained [ManagedCamera](-managed-camera/index.md) class that can take care of it's own threads and is almost fully self sufficient. By modularizing the Camera in this way we are able to easily create multiple instances (two in this case) while the implementation code remains common between both the cameras. |
10 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.utils/-compare-sizes-by-area/-init-.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.utils](../index.md) / [CompareSizesByArea](index.md) / [<init>](./-init-.md)
2 |
3 | # <init>
4 |
5 | `CompareSizesByArea()`
6 |
7 | Compares two `Size`s based on their areas.
8 |
9 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.utils/-compare-sizes-by-area/compare.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.utils](../index.md) / [CompareSizesByArea](index.md) / [compare](./compare.md)
2 |
3 | # compare
4 |
5 | `fun compare(lhs: `[`Size`](https://developer.android.com/reference/android/util/Size.html)`, rhs: `[`Size`](https://developer.android.com/reference/android/util/Size.html)`): `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.utils/-compare-sizes-by-area/index.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.utils](../index.md) / [CompareSizesByArea](./index.md)
2 |
3 | # CompareSizesByArea
4 |
5 | `class CompareSizesByArea : `[`Comparator`](https://developer.android.com/reference/java/util/Comparator.html)`<`[`Size`](https://developer.android.com/reference/android/util/Size.html)`>`
6 |
7 | Compares two `Size`s based on their areas.
8 |
9 | ### Constructors
10 |
11 | | Name | Summary |
12 | |---|---|
13 | | [<init>](-init-.md) | `CompareSizesByArea()` Compares two `Size`s based on their areas. |
14 |
15 | ### Functions
16 |
17 | | Name | Summary |
18 | |---|---|
19 | | [compare](compare.md) | `fun compare(lhs: `[`Size`](https://developer.android.com/reference/android/util/Size.html)`, rhs: `[`Size`](https://developer.android.com/reference/android/util/Size.html)`): `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) |
20 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.utils/index.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.utils](./index.md)
2 |
3 | ## Package com.dhirajgupta.multicam.utils
4 |
5 | ### Types
6 |
7 | | Name | Summary |
8 | |---|---|
9 | | [CompareSizesByArea](-compare-sizes-by-area/index.md) | `class CompareSizesByArea : `[`Comparator`](https://developer.android.com/reference/java/util/Comparator.html)`<`[`Size`](https://developer.android.com/reference/android/util/Size.html)`>` Compares two `Size`s based on their areas. |
10 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.views/-auto-fit-texture-view/-init-.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.views](../index.md) / [AutoFitTextureView](index.md) / [<init>](./-init-.md)
2 |
3 | # <init>
4 |
5 | `AutoFitTextureView(context: `[`Context`](https://developer.android.com/reference/android/content/Context.html)`, attrs: `[`AttributeSet`](https://developer.android.com/reference/android/util/AttributeSet.html)`? = null, defStyle: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0)`
6 |
7 | A [TextureView](https://developer.android.com/reference/android/view/TextureView.html) that can be adjusted to a specified aspect ratio.
8 |
9 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.views/-auto-fit-texture-view/index.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.views](../index.md) / [AutoFitTextureView](./index.md)
2 |
3 | # AutoFitTextureView
4 |
5 | `class AutoFitTextureView : `[`TextureView`](https://developer.android.com/reference/android/view/TextureView.html)
6 |
7 | A [TextureView](https://developer.android.com/reference/android/view/TextureView.html) that can be adjusted to a specified aspect ratio.
8 |
9 | ### Constructors
10 |
11 | | Name | Summary |
12 | |---|---|
13 | | [<init>](-init-.md) | `AutoFitTextureView(context: `[`Context`](https://developer.android.com/reference/android/content/Context.html)`, attrs: `[`AttributeSet`](https://developer.android.com/reference/android/util/AttributeSet.html)`? = null, defStyle: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` = 0)` A [TextureView](https://developer.android.com/reference/android/view/TextureView.html) that can be adjusted to a specified aspect ratio. |
14 |
15 | ### Functions
16 |
17 | | Name | Summary |
18 | |---|---|
19 | | [onMeasure](on-measure.md) | `fun onMeasure(widthMeasureSpec: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, heightMeasureSpec: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
20 | | [setAspectRatio](set-aspect-ratio.md) | `fun setAspectRatio(width: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, height: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) Sets the aspect ratio for this view. The size of the view will be measured based on the ratio calculated from the parameters. Note that the actual sizes of parameters don't matter, that is, calling setAspectRatio(2, 3) and setAspectRatio(4, 6) make the same result. |
21 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.views/-auto-fit-texture-view/on-measure.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.views](../index.md) / [AutoFitTextureView](index.md) / [onMeasure](./on-measure.md)
2 |
3 | # onMeasure
4 |
5 | `protected fun onMeasure(widthMeasureSpec: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, heightMeasureSpec: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.views/-auto-fit-texture-view/set-aspect-ratio.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam.views](../index.md) / [AutoFitTextureView](index.md) / [setAspectRatio](./set-aspect-ratio.md)
2 |
3 | # setAspectRatio
4 |
5 | `fun setAspectRatio(width: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, height: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | Sets the aspect ratio for this view. The size of the view will be measured based on the ratio
8 | calculated from the parameters. Note that the actual sizes of parameters don't matter, that
9 | is, calling setAspectRatio(2, 3) and setAspectRatio(4, 6) make the same result.
10 |
11 | ### Parameters
12 |
13 | `width` - Relative horizontal size
14 |
15 | `height` - Relative vertical size
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam.views/index.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam.views](./index.md)
2 |
3 | ## Package com.dhirajgupta.multicam.views
4 |
5 | ### Types
6 |
7 | | Name | Summary |
8 | |---|---|
9 | | [AutoFitTextureView](-auto-fit-texture-view/index.md) | `class AutoFitTextureView : `[`TextureView`](https://developer.android.com/reference/android/view/TextureView.html) A [TextureView](https://developer.android.com/reference/android/view/TextureView.html) that can be adjusted to a specified aspect ratio. |
10 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam/-app/-init-.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [App](index.md) / [<init>](./-init-.md)
2 |
3 | # <init>
4 |
5 | `App()`
6 |
7 | Standard Android App subclass that is useful for most Apps. By providing the shared instance of the App object,
8 | we are able to access the Application Context anywhere that it is useful. In this particular project we're using
9 | Application Context to ask [MediaScannerConnection](https://developer.android.com/reference/android/media/MediaScannerConnection.html) to scan our newly saved images so that it appears in the user's
10 | Photo Gallery application.
11 |
12 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam/-app/index.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [App](./index.md)
2 |
3 | # App
4 |
5 | `class App : `[`Application`](https://developer.android.com/reference/android/app/Application.html)
6 |
7 | Standard Android App subclass that is useful for most Apps. By providing the shared instance of the App object,
8 | we are able to access the Application Context anywhere that it is useful. In this particular project we're using
9 | Application Context to ask [MediaScannerConnection](https://developer.android.com/reference/android/media/MediaScannerConnection.html) to scan our newly saved images so that it appears in the user's
10 | Photo Gallery application.
11 |
12 | ### Constructors
13 |
14 | | Name | Summary |
15 | |---|---|
16 | | [<init>](-init-.md) | `App()` Standard Android App subclass that is useful for most Apps. By providing the shared instance of the App object, we are able to access the Application Context anywhere that it is useful. In this particular project we're using Application Context to ask [MediaScannerConnection](https://developer.android.com/reference/android/media/MediaScannerConnection.html) to scan our newly saved images so that it appears in the user's Photo Gallery application. |
17 |
18 | ### Functions
19 |
20 | | Name | Summary |
21 | |---|---|
22 | | [onCreate](on-create.md) | `fun onCreate(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
23 |
24 | ### Companion Object Properties
25 |
26 | | Name | Summary |
27 | |---|---|
28 | | [instance](instance.md) | `lateinit var instance: `[`App`](./index.md) |
29 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam/-app/instance.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [App](index.md) / [instance](./instance.md)
2 |
3 | # instance
4 |
5 | `lateinit var instance: `[`App`](index.md)
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam/-app/on-create.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [App](index.md) / [onCreate](./on-create.md)
2 |
3 | # onCreate
4 |
5 | `fun onCreate(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam/-main-activity/-init-.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [<init>](./-init-.md)
2 |
3 | # <init>
4 |
5 | `MainActivity()`
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam/-main-activity/-p-e-r-m-r-e-q_-c-a-m-e-r-a.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [PERMREQ_CAMERA](./-p-e-r-m-r-e-q_-c-a-m-e-r-a.md)
2 |
3 | # PERMREQ_CAMERA
4 |
5 | `val PERMREQ_CAMERA: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
6 |
7 | Request code for Camera permission request
8 |
9 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam/-main-activity/all-permissions-granted.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [allPermissionsGranted](./all-permissions-granted.md)
2 |
3 | # allPermissionsGranted
4 |
5 | `fun allPermissionsGranted(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | All the required permissions have been granted, so we can now do the sensitive operations that require these
8 | permissions, namely initing the cameras and also creating the storage folder that will house saved images
9 |
10 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam/-main-activity/ask-all-required-permissions.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [askAllRequiredPermissions](./ask-all-required-permissions.md)
2 |
3 | # askAllRequiredPermissions
4 |
5 | `fun askAllRequiredPermissions(): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
6 |
7 | Utility function to ask for any of our required permission
8 | If the function did not ask for any permission, because all of them are granted already, returns false
9 | else it asks for the required permissions and returns true
10 |
11 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam/-main-activity/camera-status-handler.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [cameraStatusHandler](./camera-status-handler.md)
2 |
3 | # cameraStatusHandler
4 |
5 | `val cameraStatusHandler: `[`ManagedCameraStatus`](../../com.dhirajgupta.multicam.interfaces/-managed-camera-status/index.md)
6 |
7 | Implementation of Custom interface to handle communication from [ManagedCamera](../../com.dhirajgupta.multicam.services/-managed-camera/index.md) back to [MainActivity](index.md).
8 |
9 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam/-main-activity/camera0.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [camera0](./camera0.md)
2 |
3 | # camera0
4 |
5 | `var camera0: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`?`
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam/-main-activity/camera1.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [camera1](./camera1.md)
2 |
3 | # camera1
4 |
5 | `var camera1: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`?`
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam/-main-activity/index.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](./index.md)
2 |
3 | # MainActivity
4 |
5 | `class MainActivity : AppCompatActivity`
6 |
7 | ### Constructors
8 |
9 | | Name | Summary |
10 | |---|---|
11 | | [<init>](-init-.md) | `MainActivity()` |
12 |
13 | ### Properties
14 |
15 | | Name | Summary |
16 | |---|---|
17 | | [camera0](camera0.md) | `var camera0: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`?` |
18 | | [camera1](camera1.md) | `var camera1: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`?` |
19 | | [cameraStatusHandler](camera-status-handler.md) | `val cameraStatusHandler: `[`ManagedCameraStatus`](../../com.dhirajgupta.multicam.interfaces/-managed-camera-status/index.md) Implementation of Custom interface to handle communication from [ManagedCamera](../../com.dhirajgupta.multicam.services/-managed-camera/index.md) back to [MainActivity](./index.md). |
20 | | [PERMREQ_CAMERA](-p-e-r-m-r-e-q_-c-a-m-e-r-a.md) | `val PERMREQ_CAMERA: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) Request code for Camera permission request |
21 |
22 | ### Functions
23 |
24 | | Name | Summary |
25 | |---|---|
26 | | [allPermissionsGranted](all-permissions-granted.md) | `fun allPermissionsGranted(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) All the required permissions have been granted, so we can now do the sensitive operations that require these permissions, namely initing the cameras and also creating the storage folder that will house saved images |
27 | | [askAllRequiredPermissions](ask-all-required-permissions.md) | `fun askAllRequiredPermissions(): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) Utility function to ask for any of our required permission If the function did not ask for any permission, because all of them are granted already, returns false else it asks for the required permissions and returns true |
28 | | [initCameras](init-cameras.md) | `fun initCameras(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) Checks available cameras and inits them. At least one camera is required, else the app will quit |
29 | | [onCreate](on-create.md) | `fun onCreate(savedInstanceState: `[`Bundle`](https://developer.android.com/reference/android/os/Bundle.html)`?): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
30 | | [onPause](on-pause.md) | `fun onPause(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) We must save the state of the app, including which cameras were operational and then, relinquish control on the camera(s) so that the OS can allocate them as required |
31 | | [onRequestPermissionsResult](on-request-permissions-result.md) | `fun onRequestPermissionsResult(requestCode: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, permissions: `[`Array`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)`, grantResults: `[`IntArray`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int-array/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) Handle Activity permission request responses |
32 | | [onResumeFragments](on-resume-fragments.md) | `fun onResumeFragments(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) Even though we're not using Fragments, *right now*, we will ultimately do so in the future, so it makes sense to override onResumeFragments instead of onResume We will perform on-foreground steps in this method, and open the camera(s) that were operating in last session, or if [MainActivity](./index.md) was just created, then the first Camera only |
33 | | [toggleCamera](toggle-camera.md) | `fun toggleCamera(camera: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`?): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) Simple function that sets the [ManagedCamera.isPreviewing](../../com.dhirajgupta.multicam.services/-managed-camera/is-previewing.md) to the opposite of whatever it is, currently, and then asks the camera to update it's preview status. As the status of the camera changes, the appropriate callbacks will be called to update [MainActivity](./index.md) labels. |
34 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam/-main-activity/init-cameras.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [initCameras](./init-cameras.md)
2 |
3 | # initCameras
4 |
5 | `fun initCameras(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | Checks available cameras and inits them. At least one camera is required, else the app will quit
8 |
9 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam/-main-activity/on-create.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [onCreate](./on-create.md)
2 |
3 | # onCreate
4 |
5 | `protected fun onCreate(savedInstanceState: `[`Bundle`](https://developer.android.com/reference/android/os/Bundle.html)`?): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam/-main-activity/on-pause.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [onPause](./on-pause.md)
2 |
3 | # onPause
4 |
5 | `protected fun onPause(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | We must save the state of the app, including which cameras were operational and then,
8 | relinquish control on the camera(s) so that the OS can allocate them as required
9 |
10 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam/-main-activity/on-request-permissions-result.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [onRequestPermissionsResult](./on-request-permissions-result.md)
2 |
3 | # onRequestPermissionsResult
4 |
5 | `fun onRequestPermissionsResult(requestCode: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, permissions: `[`Array`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html)`, grantResults: `[`IntArray`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int-array/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | Handle Activity permission request responses
8 |
9 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam/-main-activity/on-resume-fragments.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [onResumeFragments](./on-resume-fragments.md)
2 |
3 | # onResumeFragments
4 |
5 | `protected fun onResumeFragments(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | Even though we're not using Fragments, *right now*, we will ultimately do so in the future,
8 | so it makes sense to override onResumeFragments instead of onResume
9 | We will perform on-foreground steps in this method, and open the camera(s) that were operating
10 | in last session, or if [MainActivity](index.md) was just created, then the first Camera only
11 |
12 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam/-main-activity/toggle-camera.md:
--------------------------------------------------------------------------------
1 | [app](../../index.md) / [com.dhirajgupta.multicam](../index.md) / [MainActivity](index.md) / [toggleCamera](./toggle-camera.md)
2 |
3 | # toggleCamera
4 |
5 | `fun toggleCamera(camera: `[`ManagedCamera`](../../com.dhirajgupta.multicam.services/-managed-camera/index.md)`?): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
6 |
7 | Simple function that sets the [ManagedCamera.isPreviewing](../../com.dhirajgupta.multicam.services/-managed-camera/is-previewing.md) to the opposite of whatever it is, currently, and
8 | then asks the camera to update it's preview status.
9 | As the status of the camera changes, the appropriate callbacks will be called to update [MainActivity](index.md) labels.
10 |
11 |
--------------------------------------------------------------------------------
/javadoc/app/com.dhirajgupta.multicam/index.md:
--------------------------------------------------------------------------------
1 | [app](../index.md) / [com.dhirajgupta.multicam](./index.md)
2 |
3 | ## Package com.dhirajgupta.multicam
4 |
5 | ### Types
6 |
7 | | Name | Summary |
8 | |---|---|
9 | | [App](-app/index.md) | `class App : `[`Application`](https://developer.android.com/reference/android/app/Application.html) Standard Android App subclass that is useful for most Apps. By providing the shared instance of the App object, we are able to access the Application Context anywhere that it is useful. In this particular project we're using Application Context to ask [MediaScannerConnection](https://developer.android.com/reference/android/media/MediaScannerConnection.html) to scan our newly saved images so that it appears in the user's Photo Gallery application. |
10 | | [MainActivity](-main-activity/index.md) | `class MainActivity : AppCompatActivity` |
11 |
--------------------------------------------------------------------------------
/javadoc/app/index.md:
--------------------------------------------------------------------------------
1 | [app](./index.md)
2 |
3 | ### Packages
4 |
5 | | Name | Summary |
6 | |---|---|
7 | | [com.dhirajgupta.multicam](com.dhirajgupta.multicam/index.md) | |
8 | | [com.dhirajgupta.multicam.interfaces](com.dhirajgupta.multicam.interfaces/index.md) | |
9 | | [com.dhirajgupta.multicam.services](com.dhirajgupta.multicam.services/index.md) | |
10 | | [com.dhirajgupta.multicam.utils](com.dhirajgupta.multicam.utils/index.md) | |
11 | | [com.dhirajgupta.multicam.views](com.dhirajgupta.multicam.views/index.md) | |
12 |
13 | ### Index
14 |
15 | [All Types](alltypes/index.md)
--------------------------------------------------------------------------------
/javadoc/app/package-list:
--------------------------------------------------------------------------------
1 | $dokka.format:gfm
2 | $dokka.linkExtension:md
3 |
4 | com.dhirajgupta.multicam
5 | com.dhirajgupta.multicam.interfaces
6 | com.dhirajgupta.multicam.services
7 | com.dhirajgupta.multicam.utils
8 | com.dhirajgupta.multicam.views
9 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------