mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
Use errno for result errors
Make new enumeration for data transport status and use errno style error numbers for errors.
This commit is contained in:
parent
dda28b1589
commit
6fb0f580ea
86 changed files with 2019 additions and 1988 deletions
|
|
@ -17,6 +17,8 @@
|
|||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
typedef enum {
|
||||
GRAY = 0,
|
||||
YELLOW,
|
||||
|
|
@ -135,21 +137,21 @@ static int drawing_data_init(DrawingData * dd, struct impl *this, char *data)
|
|||
|
||||
if ((format->media_type != this->type.media_type.video) ||
|
||||
(format->media_subtype != this->type.media_subtype.raw))
|
||||
return SPA_RESULT_NOT_IMPLEMENTED;
|
||||
return -ENOTSUP;
|
||||
|
||||
if (format->info.raw.format == this->type.video_format.RGB) {
|
||||
dd->draw_pixel = draw_pixel_rgb;
|
||||
} else if (format->info.raw.format == this->type.video_format.UYVY) {
|
||||
dd->draw_pixel = draw_pixel_uyvy;
|
||||
} else
|
||||
return SPA_RESULT_NOT_IMPLEMENTED;
|
||||
return -ENOTSUP;
|
||||
|
||||
dd->line = data;
|
||||
dd->width = size->width;
|
||||
dd->height = size->height;
|
||||
dd->stride = this->stride;
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void draw_pixels(DrawingData * dd, int offset, Color color, int length)
|
||||
|
|
@ -264,8 +266,7 @@ static int draw(struct impl *this, char *data)
|
|||
|
||||
init_colors();
|
||||
|
||||
res = drawing_data_init(&dd, this, data);
|
||||
if (res != SPA_RESULT_OK)
|
||||
if ((res = drawing_data_init(&dd, this, data)) < 0)
|
||||
return res;
|
||||
|
||||
pattern = this->props.pattern;
|
||||
|
|
@ -274,7 +275,7 @@ static int draw(struct impl *this, char *data)
|
|||
else if (pattern == this->type.pattern_snow)
|
||||
draw_snow(&dd);
|
||||
else
|
||||
return SPA_RESULT_NOT_IMPLEMENTED;
|
||||
return -ENOTSUP;
|
||||
|
||||
return SPA_RESULT_OK;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue