Skip to content

Commit 4f7dea2

Browse files
committed
Improve documentation
1 parent 50f2fb6 commit 4f7dea2

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

kos/include/libvideo/gfx/buffer.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,9 @@ __CXXDECL_BEGIN
605605

606606
struct video_buffer {
607607
struct video_buffer_ops const *vb_ops; /* [1..1][const] Buffer operations. */
608-
struct video_domain const *vb_domain; /* [1..1][const] Buffer domain. */
608+
struct video_domain const *vb_domain; /* [1..1][const] Buffer domain (generic wrappers use `video_ramdomain()',
609+
* meaning a different value here implies that the buffer was created by
610+
* that domain's `video_domain_newbuffer()' or `video_domain_formem()') */
609611
struct video_format vb_format; /* [const] Buffer format. */
610612
video_dim_t vb_xdim; /* Buffer dimension in X (in pixels) */
611613
video_dim_t vb_ydim; /* Buffer dimension in Y (in pixels) */
@@ -679,7 +681,11 @@ __CXXDECL_END
679681
__DEFINE_REFCNT_FUNCTIONS(struct video_buffer, vb_refcnt, video_buffer_destroy)
680682

681683

682-
/* Convert `__self' into the specified domain and format. */
684+
/* Convert `__self' into the specified domain and format.
685+
* @return: * : The converted video buffer.
686+
* @return: NULL: [errno=ENOMEM] Insufficient memory (either regular RAM, or V-RAM)
687+
* @return: NULL: [errno=ENOTSUP] Given `__format->vf_codec' is not supported by `__domain ?: __self->vb_domain'
688+
* @return: NULL: [errno=*] Failed to convert buffer for some reason (s.a. `errno') */
683689
typedef __ATTR_WUNUSED_T __ATTR_INOUT_T(1) __ATTR_NONNULL_T((2)) __ATTR_IN_T(3) __REF struct video_buffer *
684690
(LIBVIDEO_GFX_CC *PVIDEO_BUFFER_CONVERT)(struct video_buffer *__restrict __self,
685691
struct video_domain const *__domain,

kos/src/libvideo/gfx/buffer.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ NOTHROW(FCC libvideo_buffer_generic_unlockregion)(struct video_buffer *__restric
100100

101101

102102

103-
/* Convert `self' into the specified domain and format. */
103+
/* Convert `self' into the specified domain and format.
104+
* @return: * : The converted video buffer.
105+
* @return: NULL: [errno=ENOMEM] Insufficient memory (either regular RAM, or V-RAM)
106+
* @return: NULL: [errno=ENOTSUP] Given `format->vf_codec' is not supported by `domain ?: self->vb_domain'
107+
* @return: NULL: [errno=*] Failed to convert buffer for some reason (s.a. `errno') */
104108
DEFINE_PUBLIC_ALIAS(video_buffer_convert, libvideo_buffer_convert);
105109
INTERN WUNUSED ATTR_INOUT(1) NONNULL((2)) ATTR_IN(3) REF struct video_buffer *CC
106110
libvideo_buffer_convert(struct video_buffer *__restrict self,

kos/src/libvideo/gfx/buffer.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,11 @@ NOTHROW(FCC libvideo_buffer_generic_unlockregion)(struct video_buffer *__restric
117117

118118

119119

120-
/* Convert `self' into the specified domain and format. */
120+
/* Convert `self' into the specified domain and format.
121+
* @return: * : The converted video buffer.
122+
* @return: NULL: [errno=ENOMEM] Insufficient memory (either regular RAM, or V-RAM)
123+
* @return: NULL: [errno=ENOTSUP] Given `format->vf_codec' is not supported by `domain ?: self->vb_domain'
124+
* @return: NULL: [errno=*] Failed to convert buffer for some reason (s.a. `errno') */
121125
INTDEF WUNUSED ATTR_INOUT(1) NONNULL((2)) ATTR_IN(3) REF struct video_buffer *CC
122126
libvideo_buffer_convert(struct video_buffer *__restrict self,
123127
struct video_domain const *domain,

0 commit comments

Comments
 (0)