Android Camera2 API Video App - Part 3 Adding TextureView for displaying the preview

preview_player
Показать описание

Android tutorial series which describes how to create an android video application using the android camera2 API.

Part 3 describes how to add the TextureView and attach a surface texture listener to be notified of when the TextureView is available.

Github details:

or you can run this command

In this tutorial we will cover:
- Padding in RelativeLayouts
- Adding a TextureView to a RelativeLayout
- Creating a TextureView
- Creating a SurfaceTextureListener
- Checking the availability of the TextureView
- Checking whether the surface texture listener creation was successful

API's covered
- TextureView
- TextureView.SurfaceTextureListener
- findViewById

For much more information checkout

The previous tutorials were aimed at beginners to android but over time have been getting more complex as the original camera_intent app has developed.
This tutorial series is more aimed towards the intermediate developers thought for those who have been following the previous tutorial series, feel free to watch this android performance series.

Android studio (1.5) is the editor of choice (IDE) for this tutorial series.

This tutorial series is the start of what I expect to be many so I encourage comments and feedback to improve the quality and viewing experience.
Рекомендации по теме
Комментарии
Автор

What is the value of the height/width params to the callback? Aren't the values the same as the height/width of the TextureView?

stevenbroshar
Автор

How to implement button clicks auto flash on

alltimemasti
Автор

Hey Nigel, you have very descriptive, amazing videos. Can you briefly explain why we need a TextureView, and the difference between a TextureView and a SurfaceView?

vinitsoni
Автор

* TextureView
A TextureView can be used to display a content stream. Such a content stream can for instance be a video or an OpenGL scene.

* SurfaceTexture
Captures frames from an image stream as an OpenGL ES texture. The image stream may come from either camera preview or video decode.

* Surface
A Surface created from a SurfaceTexture can be used as an output destination for the android.hardware.camera2

lovefamilychildrenhappines
Автор

Thank you so much you save my day sir 😊

nakata
Автор

Hi, sir, my doubt is in old camera api after take picture my app will freeze, what is the solution ?kindly write me

krishnakini
Автор

I am getting this error that TextureView Cannot be cast to android.view.ViewGroup

abhithakur
Автор

Is there any way to use the Camera2 API without showing the preview to the user via a Texture View?

ravindufernando
Автор

some one can help me? with rule of var naming, why var mTextureView start from letter m

RostyslavShynlov
Автор

Is there gonna be a Kotlin version of this tutorial?

pablolozano
Автор

Thank you so much you save my day sir 😊

nakata
welcome to shbcf.ru