Skip to content
This repository was archived by the owner on Jul 10, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f3c4aa5
Capture and recording support with supported resolutions
JeevakaPrabu Sep 18, 2019
67b1e7a
Set audio source and profile for video recording with audio
JeevakaPrabu Sep 20, 2019
e4cf786
Fix for Multi-camera preview and recording issues
nikumbx Oct 3, 2019
c1997be
Add advance features in MultiCamera app
nikumbx Nov 26, 2019
a5fc3eb
Merge pull request #2 from muhammadaksar/camera_latest_Nov25
JeevakaPrabu Nov 27, 2019
97db9f1
Add Video resolutions based on Camera capabilities
nikumbx Nov 27, 2019
33f2fe6
MultiCAmeraApp: Extend Video recording duration
nikumbx Dec 26, 2019
4d989dd
knocwork critical issues
sadashivarao Feb 19, 2020
c8e304f
Licence change for code match
kbillore Mar 2, 2020
cb8f467
Patch to enable USB hotplugging
kbillore Mar 9, 2020
7ac943c
Prevent access to Android components for SDL
kbillore Mar 17, 2020
1c25359
camera back and front switching implementation
kbillore Apr 30, 2020
02557a1
Fix null pointer dereference kw error
shivasku82 May 20, 2020
d732101
Fix crash seen with front camera video recording
kbillore Jun 1, 2020
10afd37
Crash when app is closed after video playback from gallery
kbillore Jun 10, 2020
84f94b6
Photo delete second time from gallery
kbillore Jun 10, 2020
156a95a
Show application close dialog on USB camera hot plug
kbillore Jul 1, 2020
f42aa84
Handle USB_HEADSET device type to fix no audio on video recording
JeevakaPrabu Jun 19, 2020
56465e3
show camera close popup only when USB camera connected
kbillore Jul 17, 2020
c4a5f9e
Fix for front camera video recording with fixed resolution
kbillore Jul 31, 2020
038f6d7
handle settings button in single view and hide in multiview
kbillore Aug 7, 2020
99a5341
change video resolution and switch between front and
kbillore Oct 14, 2020
f2671f1
Retry camera preview if it fail to configure
kbillore Oct 19, 2020
eae70aa
kill camera application when user click on USB popup
kbillore Oct 20, 2020
58e2619
crash occured on closing settings
shivasku82 Dec 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 151 additions & 0 deletions camera/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
---
Language: Java
BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 8
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- 'c++'
- 'C++'
CanonicalDelimiter: ''
BasedOnStyle: google
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
EnclosingFunctions:
- EqualsProto
- EquivToProto
- PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO
- PARSE_TEXT_PROTO
- ParseTextOrDie
- ParseTextProtoOrDie
CanonicalDelimiter: ''
BasedOnStyle: google
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseTab: Never
...

41 changes: 30 additions & 11 deletions camera/MultiCameraApplication/Android.mk
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional
LOCAL_CERTIFICATE := platform
LOCAL_SDK_VERSION := current
LOCAL_PACKAGE_NAME := MultiCameraApp
LOCAL_MODULE_TAGS := optional
LOCAL_DEX_PREOPT := false
LOCAL_CERTIFICATE := platform
LOCAL_SDK_VERSION := current
LOCAL_MIN_SDK_VERSION := 27

LOCAL_RESOURCE_DIR += $(LOCAL_PATH)/res
LOCAL_SRC_FILES := \
$(call all-java-files-under, java)
LOCAL_DEX_PREOPT := false
LOCAL_PACKAGE_NAME := MultiCameraApp
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res \

include $(BUILD_PACKAGE)
LOCAL_SRC_FILES := $(call all-java-files-under, java)


LOCAL_AIDL_INCLUDES := \
frameworks/native/aidl/gui

include $(call all-makefiles-under, $(LOCAL_PATH))
#LOCAL_PROGUARD_FLAG_FILES := ../../../frameworks/support/design/proguard-rules.pro

LOCAL_USE_AAPT2 := true

LOCAL_STATIC_JAVA_LIBRARIES = \
androidx-constraintlayout_constraintlayout-solver

LOCAL_PROPRIETARY_MODULE := true

LOCAL_STATIC_ANDROID_LIBRARIES := \
androidx-constraintlayout_constraintlayout \
androidx.preference_preference \
androidx.cardview_cardview \
com.google.android.material_material \
androidx.legacy_legacy-support-v13 \
androidx.legacy_legacy-support-v4 \
androidx.appcompat_appcompat

include $(BUILD_PACKAGE)
89 changes: 62 additions & 27 deletions camera/MultiCameraApplication/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.intel.multicamera">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.camera2.full" />

</manifest>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.intel.multicamera">

<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="28"/>

<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<uses-feature android:name="android.hardware.camera2.full"/>
<uses-feature android:name="android.hardware.usb.host" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:requestLegacyExternalStorage="true">
<activity android:name=".MultiViewActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
/>
<activity android:name=".SingleCameraActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
/>
<activity
android:name=".CtsCameraIntentsActivity"
android:excludeFromRecents="true"
android:exported="false"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.media.action.IMAGE_CAPTURE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.media.action.VIDEO_CAPTURE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<activity
android:name=".FullScreenActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

</activity>

<activity
android:name=".PermissionsActivity"
android:label="@string/app_name" />
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* Copyright 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.intel.multicamera;

import android.content.Context;
import android.util.AttributeSet;
import android.view.TextureView;

/**
* A {@link TextureView} that can be adjusted to a specified aspect ratio.
*/
public class AutoFitTextureView extends TextureView {
private int mRatioWidth = 0;
private int mRatioHeight = 0;

public AutoFitTextureView(Context context) {
this(context, null);
}

public AutoFitTextureView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}

public AutoFitTextureView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}

/**
* 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.
*
* @param width Relative horizontal size
* @param height Relative vertical size
*/
public void setAspectRatio(int width, int height) {
if (width < 0 || height < 0) {
throw new IllegalArgumentException("Size cannot be negative.");
}
mRatioWidth = width;
mRatioHeight = height;
requestLayout();
}

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int width = MeasureSpec.getSize(widthMeasureSpec);
int height = MeasureSpec.getSize(heightMeasureSpec);
if (0 == mRatioWidth || 0 == mRatioHeight) {
setMeasuredDimension(width, height);
} else {
if (width < height * mRatioWidth / mRatioHeight) {
setMeasuredDimension(width, width * mRatioHeight / mRatioWidth);
} else {
setMeasuredDimension(height * mRatioWidth / mRatioHeight, height);
}
}
}
}
Loading