Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gst-plugins-base
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
George Kiagiadakis
gst-plugins-base
Commits
c64dae3e
Commit
c64dae3e
authored
Feb 25, 2016
by
Tim-Philipp Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
video: flesh out docs for gst_video_frame_map()
parent
e23b12b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
1 deletion
+38
-1
gst-libs/gst/video/video-frame.c
gst-libs/gst/video/video-frame.c
+38
-1
No files found.
gst-libs/gst/video/video-frame.c
View file @
c64dae3e
...
...
@@ -186,11 +186,48 @@ invalid_size:
* @buffer: the buffer to map
* @flags: #GstMapFlags
*
* Use @info and @buffer to fill in the values of @frame.
* Use @info and @buffer to fill in the values of @frame. @frame is usually
* allocated on the stack, and you will pass the address to the #GstVideoFrame
* structure allocated on the stack; gst_video_frame_map() will then fill in
* the structures with the various video-specific information you need to access
* the pixels of the video buffer. You can then use accessor macros such as
* GST_VIDEO_FRAME_COMP_DATA(), GST_VIDEO_FRAME_PLANE_DATA(),
* GST_VIDEO_FRAME_COMP_STRIDE(), GST_VIDEO_FRAME_PLANE_STRIDE() etc.
* to get to the pixels.
*
* |[<!-- language="C" -->
* GstVideoFrame vframe;
* ...
* // set RGB pixels to black one at a time
* if (gst_video_frame_map (&vframe, video_info, video_buffer)) {
* guint8 *pixels = GST_VIDEO_FRAME_PLANE_DATA (vframe, 0);
* guint stride = GST_VIDEO_FRAME_PLANE_STRIDE (vframe, 0);
* guint pixel_stride = GST_VIDEO_FRAME_PLANE_PSTRIDE (vframe, 0);
*
* for (h = 0; h < height; ++h) {
* for (w = 0; w < width; ++w) {
* guint8 *pixel = pixels + h * stride + w * pixel_stride;
*
* memset (pixel, 0, pixel_stride);
* }
* }
* }
* ...
* ]|
*
* All video planes of @buffer will be mapped and the pointers will be set in
* @frame->data.
*
* The purpose of this function is to make it easy for you to get to the video
* pixels in a generic way, without you having to worry too much about details
* such as whether the video data is allocated in one contiguous memory chunk
* or multiple memory chunks (e.g. one for each plane); or if custom strides
* and custom plane offsets are used or not (as signalled by GstVideoMeta on
* each buffer). This function will just fill the #GstVideoFrame structure
* with the right values and if you use the accessor macros everything will
* just work and you can access the data easily. It also maps the underlying
* memory chunks for you.
*
* Returns: %TRUE on success.
*/
gboolean
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment