Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gstreamer gstreamer
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 712
    • Issues 712
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 368
    • Merge requests 368
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GStreamer
  • gstreamergstreamer
  • Merge requests
  • !2475

v4l2: Reset transfer in gst_v4l2_object_acquire_format()

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Qi Hou requested to merge hq/gstreamer:transfer into main May 24, 2022
  • Overview 2
  • Commits 1
  • Pipelines 4
  • Changes 1

I met pipeline hang when running one rtp streaming case. Here is the test command:

`Server:

gst-launch-1.0 v4l2src device=/dev/video3 ! "video/x-raw,format=YUY2,width=1920,height=1080" ! v4l2h264enc output-io-mode=dmabuf-import ! h264parse ! rtph264pay ! udpsink host=192.168.101.34

Client:

gst-launch-1.0 -e udpsrc ! application/x-rtp ! rtph264depay ! h264parse ! v4l2h264dec ! queue ! v4l2h264enc ! h264parse ! matroskamux ! filesink location=./001_H264_webcamera.mkv`

Client pipeline hang as decoder chosen caps is always null after negotiation with encoder, and capture setup got dead loop.

Here is the analysis:

  1. First negotiation between decoder and encoder, decoder capture set format with bt601 where info.colorimetry.transfer = GST_VIDEO_TRANSFER_BT601(enum is 16). It makes v4l2object->transfer to be also 16.
  2. driver reports source change event to client. Capture get format with fmt.fmt.pix.colorspace/quantition/ycbcr_enc/xfer_func=3:2:2:1 which is got by parsing the encoded stream from server.
  3. In acquire_format(), fmt.fmt.pix.xfer_func=1 makes cinfo->transfer = v4l2object->transfer = 16 in get_colorspace(). So get_colorspace() map pix colorimetry 3:2:2:1 to gstreamer colorimetry 2:3:16:1. It's not acceptable by encoder sink caps.

Resolution:

Reset v4l2object->transfer in acquire_format() to avoid get_colorspace() use the old transfer.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: transfer