Hidden Camera 3 APIs in Android 4.4 (KitKat)Balwinder Kaur
Android 4.4 (KitKat) shipped with some hidden Java APIs for the new Camera 3 APIs. This slide deck was presented at AnDevCon 2013 held in Burlingame, CA. It covers the history of the new Camera Framework, hidden APIs and some basics of the Camera Platform Framework.
https://github.com/lbk003/Cam3HiddenAPIs
Slides from Android Builder's Summit 2014 in San Jose, CA
In this talk I describe the internal workings of the Android graphics stack from the Application layer down through the stack to pixels on the screen. It is a fairly complex journey, taking in two different 2D rendering engines, applications calling OpenGL ES directory, passing buffers on to the system compositor, SurfaceFlinger, and then down to the display controller or frame buffer.
Hidden Camera 3 APIs in Android 4.4 (KitKat)Balwinder Kaur
Android 4.4 (KitKat) shipped with some hidden Java APIs for the new Camera 3 APIs. This slide deck was presented at AnDevCon 2013 held in Burlingame, CA. It covers the history of the new Camera Framework, hidden APIs and some basics of the Camera Platform Framework.
https://github.com/lbk003/Cam3HiddenAPIs
Slides from Android Builder's Summit 2014 in San Jose, CA
In this talk I describe the internal workings of the Android graphics stack from the Application layer down through the stack to pixels on the screen. It is a fairly complex journey, taking in two different 2D rendering engines, applications calling OpenGL ES directory, passing buffers on to the system compositor, SurfaceFlinger, and then down to the display controller or frame buffer.
Google Firebase on Android is a mobile platform that lets you develop high-quality maintainable apps, improve apps quality, increase user engagement, and grow your business to earn more money. In this presentation, Firebase on Android: The Big Picture, attendees will learn foundational knowledge of why and when to use Google Firebase in their Android application. They will first explore core Firebase functionalities to develop and maintain high-quality apps. Next, they will discover how they can leverage the power of Firebase to improve apps quality while in production and therefore learn how to use Firebase to grow their business. Finally, they will explore how to integrate Firebase in their Android application. At the end of my presentation, attendees will get a clear picture of why and when to use Firebase to develop, and maintain high-quality apps to flourish their business.
What all will be covered in the session?
- Explore core Firebase features available to build high-quality Android apps such as Authentication, Cloud Firestore, Realtime Database, Cloud Storage, and Cloud Functions.
- Realise the importance of Firebase features such as Crashlytics, Performance Monitoring , and Test Lab to get insights into potential bugs and fix it to improve the quality of apps.
- Explore various Firebase tools such as Google Analytics, In-App Messaging, Cloud Messaging, Remote Config, A/B Testing , and Predictions to drive user engagement, grow user base, increase user retention, and make more money.
- Integrate Firebase SDK in your Android project using Android Studio and explore the various aspects of the Firebase console.
Custom SRP and graphics workflows - Unite Copenhagen 2019Unity Technologies
Battle Planet - Judgement Day is a unique game in the sense that it's played entirely on a single sphere (the planet). Levels are fully procedural and fully destructible. This structure created a few big challenges in terms of rendering, which were solved by writing a custom Scriptable Render Pipeline for the game. This session provides an overview of the game's rendering features and how they were implemented using SRP. It includes a few examples of how performance issues influenced the design of the pipeline as well as a discussion about shader programming and design patterns.
Speaker:
Henning Steinbock - Threaks
Session available here: https://youtu.be/91zUwJwkXNQ
This is the first part of the presentation series on one of the powerful open sources libraries, the opencv. this presentation is about the introduction, installation, some basic functions on images and some basic image processing on the images
A presentation on the Unreal Engine, a game engine used for developing games for various platforms like PC, PS4, Xbox1, etc.
For more visit: http://paradoxland.com and http://funfactsabout.net
Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019Unity Technologies
In these slides, you will learn the basics to help you get started with ray tracing in Unity 2019.3.
Speakers:
Soner Sen - Unity
Kate McFadden - Unity
Dany Ayoub - Unity
NDC21_게임테스트자동화5년의기록_NCSOFT_김종원.pdfJongwon Kim
NDC 2021에서 발표하였던 '게임 테스트 자동화 5년의 기록'이라는 주제로 NCSOFT에서 5년 동안 진행했던 게임 테스트 자동화에 대한 내용을 정리한 회고 내용입니다.
영상은 https://youtu.be/ckqUzRyIPoA 에 올라와 있습니다.
* 문서에 적용된 폰트나 아이콘 등의 문서 형식에 대한 권리는 Nexon에 있으니 배포 시 유의하시기 바랍니다
Google Firebase on Android is a mobile platform that lets you develop high-quality maintainable apps, improve apps quality, increase user engagement, and grow your business to earn more money. In this presentation, Firebase on Android: The Big Picture, attendees will learn foundational knowledge of why and when to use Google Firebase in their Android application. They will first explore core Firebase functionalities to develop and maintain high-quality apps. Next, they will discover how they can leverage the power of Firebase to improve apps quality while in production and therefore learn how to use Firebase to grow their business. Finally, they will explore how to integrate Firebase in their Android application. At the end of my presentation, attendees will get a clear picture of why and when to use Firebase to develop, and maintain high-quality apps to flourish their business.
What all will be covered in the session?
- Explore core Firebase features available to build high-quality Android apps such as Authentication, Cloud Firestore, Realtime Database, Cloud Storage, and Cloud Functions.
- Realise the importance of Firebase features such as Crashlytics, Performance Monitoring , and Test Lab to get insights into potential bugs and fix it to improve the quality of apps.
- Explore various Firebase tools such as Google Analytics, In-App Messaging, Cloud Messaging, Remote Config, A/B Testing , and Predictions to drive user engagement, grow user base, increase user retention, and make more money.
- Integrate Firebase SDK in your Android project using Android Studio and explore the various aspects of the Firebase console.
Custom SRP and graphics workflows - Unite Copenhagen 2019Unity Technologies
Battle Planet - Judgement Day is a unique game in the sense that it's played entirely on a single sphere (the planet). Levels are fully procedural and fully destructible. This structure created a few big challenges in terms of rendering, which were solved by writing a custom Scriptable Render Pipeline for the game. This session provides an overview of the game's rendering features and how they were implemented using SRP. It includes a few examples of how performance issues influenced the design of the pipeline as well as a discussion about shader programming and design patterns.
Speaker:
Henning Steinbock - Threaks
Session available here: https://youtu.be/91zUwJwkXNQ
This is the first part of the presentation series on one of the powerful open sources libraries, the opencv. this presentation is about the introduction, installation, some basic functions on images and some basic image processing on the images
A presentation on the Unreal Engine, a game engine used for developing games for various platforms like PC, PS4, Xbox1, etc.
For more visit: http://paradoxland.com and http://funfactsabout.net
Getting started with Ray Tracing in Unity 2019.3 - Unite Copenhagen 2019Unity Technologies
In these slides, you will learn the basics to help you get started with ray tracing in Unity 2019.3.
Speakers:
Soner Sen - Unity
Kate McFadden - Unity
Dany Ayoub - Unity
NDC21_게임테스트자동화5년의기록_NCSOFT_김종원.pdfJongwon Kim
NDC 2021에서 발표하였던 '게임 테스트 자동화 5년의 기록'이라는 주제로 NCSOFT에서 5년 동안 진행했던 게임 테스트 자동화에 대한 내용을 정리한 회고 내용입니다.
영상은 https://youtu.be/ckqUzRyIPoA 에 올라와 있습니다.
* 문서에 적용된 폰트나 아이콘 등의 문서 형식에 대한 권리는 Nexon에 있으니 배포 시 유의하시기 바랍니다
The Mobile Vision API provides a framework for recognizing objects in photos and videos. The framework includes detectors, which locate and describe visual objects in images or video frames, and an event-driven API that tracks the position of those objects in video.
How to create a camera2
more detail blog: http://vinta.ws/booch/?p=30
reference:
Camera 2
Google I/o video:https://www.youtube.com/watch?v=92fgcUNCHic#t=1758
Camera basic demo code: https://developer.android.com/preview/samples.html
Camera2 sdk reference (Need download 60mb): http://storage.googleapis.com/androiddevelopers/preview/l-developer-preview-reference.zip
Set up android l: https://developer.android.com/preview/setup-sdk.html
Camera
HAL3:https://source.android.com/devices/camera/camera3.html
HAL Subsystem https://source.android.com/devices/camera/camera3_requests_hal.html
https://source.android.com/devices/camera/camera.html
Until now camera development has been very painful within android development. Although Camera2 API solved some of the problems in the original Camera API, however there were still lots of difficulties existed to write camera features. With the recent launch of JetPack CameraX support library, it aims to make camera app development easier by providing consistency and easy-to-use API that works on devices running Lollipop API-21 or above. In this talk, we will review main uses cases of CameraX Api which are preview, image analysis and image capture. We will also explore device-specific extensions such as portrait, HDR, night and beauty mode
Android Lab Test : Using the camera preview (english)Bruno Delb
Android Lab Test : Using the camera preview (english)
Video of tutorial on : https://www.youtube.com/playlist?list=PLL2Z3bzdO25yHwIV3XdMzKs61At0Ldh6L
Visit http://www.AndroidLabTest.com
This presentation that we're going to talk about how to use CameraKit to implement high performance real-time camera app. We also will cover the tips that you should know when you implement customized camera feature in your app.
With recent advances in wearable technology, it's now possible to create novel fitness experiences without building custom hardware. In this talk we take you through creating a fitness tracker in C# on Android Wear, covering Google Play Services and watch-faces along the way. If this piques your interest, you can build your own Android Wear-based fitness tracker in our code lab!
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...OdessaJS Conf
Are you ready for production? Are you sure? Is your application prefetchable? Is it readable for search engine robots? Will it fit into Content Delivery Network? Do you want to make it even faster? Meet the Server-Side Rendering concept. Learn how to bring first meaningful paint immediately, work with server-side Angular code, optimize API calls and more!
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Crescat
Crescat is industry-trusted event management software, built by event professionals for event professionals. Founded in 2017, we have three key products tailored for the live event industry.
Crescat Event for concert promoters and event agencies. Crescat Venue for music venues, conference centers, wedding venues, concert halls and more. And Crescat Festival for festivals, conferences and complex events.
With a wide range of popular features such as event scheduling, shift management, volunteer and crew coordination, artist booking and much more, Crescat is designed for customisation and ease-of-use.
Over 125,000 events have been planned in Crescat and with hundreds of customers of all shapes and sizes, from boutique event agencies through to international concert promoters, Crescat is rigged for success. What's more, we highly value feedback from our users and we are constantly improving our software with updates, new features and improvements.
If you plan events, run a venue or produce festivals and you're looking for ways to make your life easier, then we have a solution for you. Try our software for free or schedule a no-obligation demo with one of our product specialists today at crescat.io
AI Genie Review: World’s First Open AI WordPress Website CreatorGoogle
AI Genie Review: World’s First Open AI WordPress Website Creator
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-genie-review
AI Genie Review: Key Features
✅Creates Limitless Real-Time Unique Content, auto-publishing Posts, Pages & Images directly from Chat GPT & Open AI on WordPress in any Niche
✅First & Only Google Bard Approved Software That Publishes 100% Original, SEO Friendly Content using Open AI
✅Publish Automated Posts and Pages using AI Genie directly on Your website
✅50 DFY Websites Included Without Adding Any Images, Content Or Doing Anything Yourself
✅Integrated Chat GPT Bot gives Instant Answers on Your Website to Visitors
✅Just Enter the title, and your Content for Pages and Posts will be ready on your website
✅Automatically insert visually appealing images into posts based on keywords and titles.
✅Choose the temperature of the content and control its randomness.
✅Control the length of the content to be generated.
✅Never Worry About Paying Huge Money Monthly To Top Content Creation Platforms
✅100% Easy-to-Use, Newbie-Friendly Technology
✅30-Days Money-Back Guarantee
See My Other Reviews Article:
(1) TubeTrivia AI Review: https://sumonreview.com/tubetrivia-ai-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
#AIGenieApp #AIGenieBonus #AIGenieBonuses #AIGenieDemo #AIGenieDownload #AIGenieLegit #AIGenieLiveDemo #AIGenieOTO #AIGeniePreview #AIGenieReview #AIGenieReviewandBonus #AIGenieScamorLegit #AIGenieSoftware #AIGenieUpgrades #AIGenieUpsells #HowDoesAlGenie #HowtoBuyAIGenie #HowtoMakeMoneywithAIGenie #MakeMoneyOnline #MakeMoneywithAIGenie
E-commerce Application Development Company.pdfHornet Dynamics
Your business can reach new heights with our assistance as we design solutions that are specifically appropriate for your goals and vision. Our eCommerce application solutions can digitally coordinate all retail operations processes to meet the demands of the marketplace while maintaining business continuity.
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
Utilocate offers a comprehensive solution for locate ticket management by automating and streamlining the entire process. By integrating with Geospatial Information Systems (GIS), it provides accurate mapping and visualization of utility locations, enhancing decision-making and reducing the risk of errors. The system's advanced data analytics tools help identify trends, predict potential issues, and optimize resource allocation, making the locate ticket management process smarter and more efficient. Additionally, automated ticket management ensures consistency and reduces human error, while real-time notifications keep all relevant personnel informed and ready to respond promptly.
The system's ability to streamline workflows and automate ticket routing significantly reduces the time taken to process each ticket, making the process faster and more efficient. Mobile access allows field technicians to update ticket information on the go, ensuring that the latest information is always available and accelerating the locate process. Overall, Utilocate not only enhances the efficiency and accuracy of locate ticket management but also improves safety by minimizing the risk of utility damage through precise and timely locates.
Atelier - Innover avec l’IA Générative et les graphes de connaissancesNeo4j
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Allez au-delà du battage médiatique autour de l’IA et découvrez des techniques pratiques pour utiliser l’IA de manière responsable à travers les données de votre organisation. Explorez comment utiliser les graphes de connaissances pour augmenter la précision, la transparence et la capacité d’explication dans les systèmes d’IA générative. Vous partirez avec une expérience pratique combinant les relations entre les données et les LLM pour apporter du contexte spécifique à votre domaine et améliorer votre raisonnement.
Amenez votre ordinateur portable et nous vous guiderons sur la mise en place de votre propre pile d’IA générative, en vous fournissant des exemples pratiques et codés pour démarrer en quelques minutes.
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppGoogle
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-fusion-buddy-review
AI Fusion Buddy Review: Key Features
✅Create Stunning AI App Suite Fully Powered By Google's Latest AI technology, Gemini
✅Use Gemini to Build high-converting Converting Sales Video Scripts, ad copies, Trending Articles, blogs, etc.100% unique!
✅Create Ultra-HD graphics with a single keyword or phrase that commands 10x eyeballs!
✅Fully automated AI articles bulk generation!
✅Auto-post or schedule stunning AI content across all your accounts at once—WordPress, Facebook, LinkedIn, Blogger, and more.
✅With one keyword or URL, generate complete websites, landing pages, and more…
✅Automatically create & sell AI content, graphics, websites, landing pages, & all that gets you paid non-stop 24*7.
✅Pre-built High-Converting 100+ website Templates and 2000+ graphic templates logos, banners, and thumbnail images in Trending Niches.
✅Say goodbye to wasting time logging into multiple Chat GPT & AI Apps once & for all!
✅Save over $5000 per year and kick out dependency on third parties completely!
✅Brand New App: Not available anywhere else!
✅ Beginner-friendly!
✅ZERO upfront cost or any extra expenses
✅Risk-Free: 30-Day Money-Back Guarantee!
✅Commercial License included!
See My Other Reviews Article:
(1) AI Genie Review: https://sumonreview.com/ai-genie-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
#AIFusionBuddyReview,
#AIFusionBuddyFeatures,
#AIFusionBuddyPricing,
#AIFusionBuddyProsandCons,
#AIFusionBuddyTutorial,
#AIFusionBuddyUserExperience
#AIFusionBuddyforBeginners,
#AIFusionBuddyBenefits,
#AIFusionBuddyComparison,
#AIFusionBuddyInstallation,
#AIFusionBuddyRefundPolicy,
#AIFusionBuddyDemo,
#AIFusionBuddyMaintenanceFees,
#AIFusionBuddyNewbieFriendly,
#WhatIsAIFusionBuddy?,
#HowDoesAIFusionBuddyWorks
Mobile App Development Company In Noida | Drona InfotechDrona Infotech
Looking for a reliable mobile app development company in Noida? Look no further than Drona Infotech. We specialize in creating customized apps for your business needs.
Visit Us For : https://www.dronainfotech.com/mobile-application-development/
GraphSummit Paris - The art of the possible with Graph TechnologyNeo4j
Sudhir Hasbe, Chief Product Officer, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteGoogle
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-pilot-review/
AI Pilot Review: Key Features
✅Deploy AI expert bots in Any Niche With Just A Click
✅With one keyword, generate complete funnels, websites, landing pages, and more.
✅More than 85 AI features are included in the AI pilot.
✅No setup or configuration; use your voice (like Siri) to do whatever you want.
✅You Can Use AI Pilot To Create your version of AI Pilot And Charge People For It…
✅ZERO Manual Work With AI Pilot. Never write, Design, Or Code Again.
✅ZERO Limits On Features Or Usages
✅Use Our AI-powered Traffic To Get Hundreds Of Customers
✅No Complicated Setup: Get Up And Running In 2 Minutes
✅99.99% Up-Time Guaranteed
✅30 Days Money-Back Guarantee
✅ZERO Upfront Cost
See My Other Reviews Article:
(1) TubeTrivia AI Review: https://sumonreview.com/tubetrivia-ai-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
Graspan: A Big Data System for Big Code AnalysisAftab Hussain
We built a disk-based parallel graph system, Graspan, that uses a novel edge-pair centric computation model to compute dynamic transitive closures on very large program graphs.
We implement context-sensitive pointer/alias and dataflow analyses on Graspan. An evaluation of these analyses on large codebases such as Linux shows that their Graspan implementations scale to millions of lines of code and are much simpler than their original implementations.
These analyses were used to augment the existing checkers; these augmented checkers found 132 new NULL pointer bugs and 1308 unnecessary NULL tests in Linux 4.4.0-rc5, PostgreSQL 8.3.9, and Apache httpd 2.2.18.
- Accepted in ASPLOS ‘17, Xi’an, China.
- Featured in the tutorial, Systemized Program Analyses: A Big Data Perspective on Static Analysis Scalability, ASPLOS ‘17.
- Invited for presentation at SoCal PLS ‘16.
- Invited for poster presentation at PLDI SRC ‘16.
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Mind IT Systems
Healthcare providers often struggle with the complexities of chronic conditions and remote patient monitoring, as each patient requires personalized care and ongoing monitoring. Off-the-shelf solutions may not meet these diverse needs, leading to inefficiencies and gaps in care. It’s here, custom healthcare software offers a tailored solution, ensuring improved care and effectiveness.
5. Camera2 API (android.hardware.camera2)
- Introduced in Lollipop 5.0 (API 21) / Nov. 12, 2014: almost 4 years ago
- New devices can use both Camera2 API (android.hardware.camera2) and
deprecated Camera API (android.hardware.camera)
- To reduce confusion, we’ll call the deprecated one as ‘Camera1’
15. So is it worth using?
- Camera1 is deprecated
- Camera2 has some serious professional features for a camera app, and it’s
generally way faster compared to Camera1 when implemented right
- API 21+ (>87%, as of July 2018) can benefit from it
- But we have to make 2 logics (for devices not fully supporting and/or
acting strange on Camera2)
28. The pipeline
But the aspect ratio has to be
same across all sizes
(at least to support Galaxy
devices)
29. The pipeline
Example CaptureRequest for camera previewing
// Preview request is built with builder pattern
previewRequestBuilder = cameraDevice?.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW) ?: return
// We can set multiple targets, i.e. show multiple previews
previewRequestBuilder.addTarget(Surface(imageTexture))
// Setting camera preferences
previewRequestBuilder[CaptureRequest.CONTROL_AF_MODE] = CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE
previewRequestBuilder[CaptureRequest.FLASH_MODE] = CaptureRequest.FLASH_MODE_OFF
previewRequest = previewRequestBuilder.build()
// Sending a PreviewRequest to current camera session
// The session will handle given PreviewRequest appropriately
captureSession?.setRepeatingRequest(previewRequest, captureCallback, backgroundHandler)
30. The pipeline
Notice the backgroundHandler?
the API manages all the background stuff for us
// Preview request is built with builder pattern
previewRequestBuilder = cameraDevice?.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW) ?: return
// We can set multiple targets, i.e. show multiple previews
previewRequestBuilder.addTarget(Surface(imageTexture))
// Setting camera preferences
previewRequestBuilder[CaptureRequest.CONTROL_AF_MODE] = CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE
previewRequestBuilder[CaptureRequest.FLASH_MODE] = CaptureRequest.FLASH_MODE_OFF
previewRequest = previewRequestBuilder.build()
// Sending a PreviewRequest to current camera session
// The session will handle given PreviewRequest appropriately
captureSession?.setRepeatingRequest(previewRequest, captureCallback, backgroundHandler)
32. Setting Up Preview / Connecting to Surface
camera = Camera.open(id) // This is the camera val callback = object: CameraDevice.StateCallback() {
override fun onOpened(camera: CameraDevice?) {
cameraDevice = camera // This is the cameraDevice
}
...
}
cameraManager.openCamera(id, callback, backgroundHandler)
Straightforward, is blocking current thread Gets device by callback, does its job by backgroundHandler
33. Setting Up Preview / Connecting to Surface
(camera ?: return).let {
it.setPreviewTexture(imageTexture)
// or you can do
// it.setPreviewDisplay(surfaceHolder)
it.startPreview()
}
val surface = Surface(imageTexture)
previewRequestBuilder = cameraDevice!!
.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW)
previewRequestBuilder.addTarget(surface)
cameraDevice!!.createCaptureSession(
listOf(surface, imageReader!!.surface),
object : CameraCaptureSession.StateCallback() {
override fun onConfigured(
session: CameraCaptureSession?) {
captureSession = session // This is the session
previewRequest = previewRequestBuilder.build()
captureSession?
.setRepeatingRequest(previewRequest, captureCallback,
backgroundHandler)
}
...
}
}, backgroundHandler)
Again, straightforward, is blocking current thread.
We have to manually set preview size to match
the surface’s size.
Gets session by callback, and we can start preview by calling
setRepeatingRequest.
Preview size is automatically chosen by the API to match the surface size.
34. Properties vs. CameraCharacteristics
Properties (Camera1)
- Mixed mutable/immutable properties
- things like previewSize are mutable;
things like supportedPreviewSizes are not
- You CAN call camera.setProperties() to
update camera settings
- You NEED to open a camera to use this
CameraCharacteristics (Camera2)
- Immutable properties only
- like the name says, you can only get the
characteristics of a CameraDevice
- You CAN’T update camera settings with
this class; it’s used only for checking
device features
- You DON’T NEED to open a camera
36. Setting Parameters
camera!!.parameters = camera!!.parameters.apply {
flashMode = Camera.Parameters.FLASH_MODE_ON
zoom = 125 // Sets zoom to x1.25, if supported
}
previewRequestBuilder[CaptureRequest.LENS_FOCUS_DISTANCE] = 9.50f
previewRequestBuilder[CaptureRequest.SENSOR_EXPOSURE_TIME] = 1000000000L / 30
previewRequest = previewRequestBuilder.build()
captureSession?.stopRepeating()
captureSession?.setRepeatingRequest(previewRequest, captureCallback,
backgroundHandler)
Sets parameters directly
When given unsupported values, it’ll throw an
error
Sets parameters by builder pattern
When given unsupported values, it’ll try its best to fit into supported values,
by rounding or clamping, etc
37. Setting Parameters
camera!!.parameters = camera!!.parameters.apply {
flashMode = Camera.Parameters.FLASH_MODE_ON
zoom = 125 // Sets zoom to x1.25, if supported
}
private fun <T> setPreviewOptions(
vararg options: Pair<CaptureRequest.Key<in T>, T>,
postProcess: () -> Unit = {}) {
for (option in options) {
previewRequestBuilder[option.first] = option.second
}
postProcess()
previewRequest = previewRequestBuilder.build()
captureSession?.stopRepeating()
captureSession?.setRepeatingRequest(
previewRequest, captureCallback, backgroundHandler)
}
...
setPreivewOptions(
CaptureRequest.LENS_FOCUS_DISTANCE to 9.50f,
CaptureRequest.SENSOR_EXPOSURE_TIME to 1000000000L / 30
)
Sets parameters directly
When given unsupported values, it’ll throw an
error
We can make an extension function to simplify this
38. Setting Parameters
camera!!.parameters = camera!!.parameters.apply {
flashMode = Camera.Parameters.FLASH_MODE_ON
zoom = 125 // Sets zoom to x1.25, if supported
}
It can be rather frustrating because only some
specific values are supported by the camera, so if I
request x1.25, the app will likely to crash on
Galaxy S9+
But Camera2 handles similar cases appropriately -
like what would we expect
Example supported zoom ratios (by Samsung Galaxy S9+ Camera)
Check out my Camera1-based OSP here :
https://github.com/shiftpsh/sensor-tester/releases
39. Setting parameters in Camera1 vs. 2
Camera1
- Parameters are global
- If we want to make a change, then it’s
changed globally. But since image
processing takes time, the API waits until
last image finishes processing and finally
change the settings
Camera2
- Parameters are set per request
- Image processing stages gets parameters
per request - the API don’t have to care
about the last image or whatsoever,
resulting improved frame rates
40. Setting parameters in Camera1
1234567
processing stages
request
params A
params B
current params: A
result
41. Setting parameters in Camera1
1234567
processing stages
request
params A
params B
If we change settings... It get mixed
current params: B
result
42. Setting parameters in Camera1
1222223
processing stages
request
params A
params B
current params: A
So Camera1 does this way … one by one
result
43. Setting parameters in Camera2
1 / A2 / A3 / A4 / B5 / B6 / B7 / B
processing stages
request
params A
params B
But in Camera2, parameters are baked into the requests
result
44. Setting parameters in Camera1 vs. 2
Camera1
Camera2
result
… resulting much higher speed
47. Taking Pictures
camera!!.takePicture(null, null) { bytes, _ ->
process(bytes)
}
imageReader = ImageReader.newInstance(largestSize.width, largestSize.height,
ImageFormat.JPEG, 2)
val onImageAvailableListener = ImageReader.OnImageAvailableListener { reader ->
process(image)
}
imageReader!!.setOnImageAvailableListener(
onImageAvailableListener, backgroundHandler)
val captureBuilder = cameraDevice!!
.createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE)
captureBuilder.addTarget(imageReader!!.surface)
...
val captureCallback = object : CameraCaptureSession.CaptureCallback() {
override fun onCaptureCompleted(...) {...}
}
captureSession?.stopRepeating()
captureSession?.abortCaptures()
captureSession?.capture(
captureBuilder.build(), captureCallback, backgroundHandler)
One of the few functions that uses a callback.
Returns a ByteArray - RGB format
It uses an imageReader to capture image. Also uses a callback.
Returns an Image - YUV format (typically)
49. API may be different but the flow is same
Open Camera Connect to Surface
Start Preview /
Repeating Request
Apply Filter, etc..
Capture Image
Close Camera
50. Speed comparison
Device Camera1 Camera2 Improvement
Google Pixel 2 (9) 87.7ms 35.1ms 150%
Samsung Galaxy S9+ (8.0) 71.7ms 27.9ms 157%
LG G7 ThinQ (8.0) 37.3ms 11.5ms 224%
Opening the camera
* Averaged result of 10 runs
51. Speed comparison
Device Camera1 Camera2 Improvement
Google Pixel 2 (9) 810.3ms 406.2ms 99%
Samsung Galaxy S9+ (8.0) 477.2ms 351.1ms 36%
LG G7 ThinQ (8.0) 616.4ms 382.9ms 61%
Taking a single full resolution picture
* Averaged result of 10 runs, right after callback
52. Migration Strategy
- Not all devices work well with Camera2, even if its API level ≥ 21
- It’s up to vendors - if they wrote good enough HAL(hardware abstraction
layer) for Camera2 then it’ll work well, otherwise not
53. Migration Strategy
- We can test some devices if they supports
Camera2 well and make a whitelist
- Or we can ask our users to opt-in, like
putting an option to enable advanced
camera in ‘experimental’ section like many
other apps do