Skip to content

UdpCamera2 replaceView will hang the stream #2053

@lestofante

Description

@lestofante

Describe the bug
I run the UdpCamera2 inside of a Service.
From the main activity i click on a "preview" flag that should replace the View from the Service to the OpenGLView, and back.
When i do print on the OpenGLView, the Stream hang. Note, when i tested with all in the main activity, all seemed to work properly

To Reproduce

  // call this funciton is called in the context of the Main Application (UI thread)
  fun setPreview(view: OpenGlView?) {
        if (view != null) {
            udpCamera2.replaceView(view)
        } else {
            udpCamera2.replaceView(this) // this is a Service, foregorund
        }
    }

Expected behavior
Both openglview and stream works

Screenshots
Only stream or openview works

Smartphone (please complete the following information):

  • Library version #166a330d9b
  • Device: Redmi note 9s
  • OS: Android15
  • Class used: UdpCamera1, Service, AppCompatActivity

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions