mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-10 13:30:05 -05:00
examples: warn when texture locking fails
New SDL seems to fail when locking YUY2 now.
This commit is contained in:
parent
4e0545aa04
commit
7662a01f85
6 changed files with 21 additions and 6 deletions
|
|
@ -304,7 +304,8 @@ static int port_set_format(void *object,
|
|||
SDL_TEXTUREACCESS_STREAMING,
|
||||
d->format.size.width,
|
||||
d->format.size.height);
|
||||
SDL_LockTexture(d->texture, NULL, &dest, &d->stride);
|
||||
if (SDL_LockTexture(d->texture, NULL, &dest, &d->stride) < 0)
|
||||
return -EINVAL;
|
||||
SDL_UnlockTexture(d->texture);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,7 +210,8 @@ static int port_set_format(void *object, enum spa_direction direction, uint32_t
|
|||
SDL_TEXTUREACCESS_STREAMING,
|
||||
d->format.size.width,
|
||||
d->format.size.height);
|
||||
SDL_LockTexture(d->texture, NULL, &dest, &d->stride);
|
||||
if (SDL_LockTexture(d->texture, NULL, &dest, &d->stride) < 0)
|
||||
return -EINVAL;
|
||||
SDL_UnlockTexture(d->texture);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -332,7 +332,10 @@ on_stream_param_changed(void *_data, uint32_t id, const struct spa_pod *param)
|
|||
SDL_TEXTUREACCESS_STREAMING,
|
||||
data->size.width,
|
||||
data->size.height);
|
||||
SDL_LockTexture(data->texture, NULL, &d, &data->stride);
|
||||
if (SDL_LockTexture(data->texture, NULL, &d, &data->stride) < 0) {
|
||||
pw_stream_set_error(stream, -EINVAL, "invalid texture format");
|
||||
return;
|
||||
}
|
||||
SDL_UnlockTexture(data->texture);
|
||||
|
||||
/* a SPA_TYPE_OBJECT_ParamBuffers object defines the acceptable size,
|
||||
|
|
|
|||
|
|
@ -382,7 +382,10 @@ on_stream_param_changed(void *_data, uint32_t id, const struct spa_pod *param)
|
|||
SDL_TEXTUREACCESS_STREAMING,
|
||||
data->size.width,
|
||||
data->size.height);
|
||||
SDL_LockTexture(data->texture, NULL, &d, &data->stride);
|
||||
if (SDL_LockTexture(data->texture, NULL, &d, &data->stride) < 0) {
|
||||
pw_stream_set_error(stream, -EINVAL, "invalid texture format");
|
||||
return;
|
||||
}
|
||||
SDL_UnlockTexture(data->texture);
|
||||
|
||||
switch(sdl_format) {
|
||||
|
|
|
|||
|
|
@ -225,7 +225,10 @@ on_stream_param_changed(void *_data, uint32_t id, const struct spa_pod *param)
|
|||
SDL_TEXTUREACCESS_STREAMING,
|
||||
data->size.width,
|
||||
data->size.height);
|
||||
SDL_LockTexture(data->texture, NULL, &d, &data->stride);
|
||||
if (SDL_LockTexture(data->texture, NULL, &d, &data->stride) < 0) {
|
||||
pw_stream_set_error(stream, -EINVAL, "invalid texture format");
|
||||
return;
|
||||
}
|
||||
SDL_UnlockTexture(data->texture);
|
||||
|
||||
/* a SPA_TYPE_OBJECT_ParamBuffers object defines the acceptable size,
|
||||
|
|
|
|||
|
|
@ -348,7 +348,11 @@ on_stream_param_changed(void *_data, uint32_t id, const struct spa_pod *param)
|
|||
SDL_TEXTUREACCESS_STREAMING,
|
||||
data->size.width,
|
||||
data->size.height);
|
||||
SDL_LockTexture(data->texture, NULL, &d, &data->stride);
|
||||
if (SDL_LockTexture(data->texture, NULL, &d, &data->stride) < 0) {
|
||||
fprintf(stderr, "Couldn't lock texture: %s\n", SDL_GetError());
|
||||
pw_stream_set_error(stream, -EINVAL, "invalid format");
|
||||
return;
|
||||
}
|
||||
SDL_UnlockTexture(data->texture);
|
||||
|
||||
switch(sdl_format) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue