mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-02 06:46:36 -04:00
gst: skip invalid crop metadata in pipewiresrc
META_VideoCrop is present on every buffer negotiated through the
adapter, even when the producer never sets a meaningful crop
region. Before commit c634ef961, gst_buffer_get_video_crop_meta
returned NULL on new GstBuffers so the zero values were never
applied. After that commit, gst_buffer_add_video_crop_meta always
succeeds, and an invalid crop produces black frames.
Without this, the following produces black frames,
Producer:
gst-launch-1.0 videotestsrc is-live=true ! \
video/x-raw,format=I420,width=1280,height=720,framerate=24/1 ! \
pipewiresink mode=provide \
stream-properties="properties,media.class=Video/Source,media.role=Camera" \
client-name=VirtualCam
Consumer:
gst-launch-1.0 pipewiresrc path=<id> ! videoconvert ! autovideosink
This commit is contained in:
parent
2953f48d9b
commit
17e61256c5
1 changed files with 1 additions and 1 deletions
|
|
@ -781,7 +781,7 @@ static GstBuffer *dequeue_buffer(GstPipeWireSrc *pwsrc)
|
|||
}
|
||||
|
||||
crop = data->crop;
|
||||
if (crop) {
|
||||
if (crop && spa_meta_region_is_valid(crop)) {
|
||||
GstVideoCropMeta *meta = gst_buffer_add_video_crop_meta(buf);
|
||||
if (meta) {
|
||||
meta->x = crop->region.position.x;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue