mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-02 05:28:48 +00:00
Add GstVaapiPoint & GstVaapiRectangle data structures.
This commit is contained in:
parent
dba6645641
commit
873d5b7a04
9 changed files with 101 additions and 31 deletions
|
@ -11,6 +11,7 @@
|
|||
|
||||
<chapter>
|
||||
<title>GStreamer VA-API Plugins Library</title>
|
||||
<xi:include href="xml/gstvaapitypes.xml"/>
|
||||
<xi:include href="xml/gstvaapidisplay.xml"/>
|
||||
<xi:include href="xml/gstvaapidisplay_x11.xml"/>
|
||||
<xi:include href="xml/gstvaapiwindow.xml"/>
|
||||
|
|
|
@ -154,6 +154,13 @@ GST_VAAPI_IS_VIDEO_BUFFER_CLASS
|
|||
GST_VAAPI_VIDEO_BUFFER_GET_CLASS
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gstvaapitypes</FILE>
|
||||
<TITLE>Basic data structures</TITLE>
|
||||
GstVaapiPoint
|
||||
GstVaapiRectangle
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gstvaapiwindow</FILE>
|
||||
<TITLE>GstVaapiWindow</TITLE>
|
||||
|
|
|
@ -29,6 +29,7 @@ libgstvaapi_source_h = \
|
|||
gstvaapisubpicture.h \
|
||||
gstvaapisurface.h \
|
||||
gstvaapisurfacepool.h \
|
||||
gstvaapitypes.h \
|
||||
gstvaapivideobuffer.h \
|
||||
gstvaapivideopool.h \
|
||||
gstvaapivideosink.h \
|
||||
|
|
60
gst-libs/gst/vaapi/gstvaapitypes.h
Normal file
60
gst-libs/gst/vaapi/gstvaapitypes.h
Normal file
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* gstvaapitypes.h - Misc types
|
||||
*
|
||||
* gstreamer-vaapi (C) 2010 Splitted-Desktop Systems
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef GST_VAAPI_TYPES_H
|
||||
#define GST_VAAPI_TYPES_H
|
||||
|
||||
#include <glib/gtypes.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* GstVaapiPoint:
|
||||
* @x: X coordinate
|
||||
* @y: Y coordinate
|
||||
*
|
||||
* A location within a surface.
|
||||
*/
|
||||
typedef struct _GstVaapiPoint GstVaapiPoint;
|
||||
struct _GstVaapiPoint {
|
||||
guint32 x;
|
||||
guint32 y;
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVaapiRectangle:
|
||||
* @x: X coordinate
|
||||
* @y: Y coordinate
|
||||
* @width: region width
|
||||
* @height: region height
|
||||
*
|
||||
* A rectangle region within a surface.
|
||||
*/
|
||||
typedef struct _GstVaapiRectangle GstVaapiRectangle;
|
||||
struct _GstVaapiRectangle {
|
||||
guint32 x;
|
||||
guint32 y;
|
||||
guint32 width;
|
||||
guint32 height;
|
||||
};
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* GST_VAAPI_TYPES_H */
|
|
@ -349,27 +349,27 @@ gst_vaapi_window_set_size(GstVaapiWindow *window, guint width, guint height)
|
|||
}
|
||||
|
||||
static inline void
|
||||
get_surface_rect(GstVaapiSurface *surface, GstVideoRectangle *rect)
|
||||
get_surface_rect(GstVaapiSurface *surface, GstVaapiRectangle *rect)
|
||||
{
|
||||
guint width, height;
|
||||
|
||||
gst_vaapi_surface_get_size(surface, &width, &height);
|
||||
rect->x = 0;
|
||||
rect->y = 0;
|
||||
rect->w = width;
|
||||
rect->h = height;
|
||||
rect->width = width;
|
||||
rect->height = height;
|
||||
}
|
||||
|
||||
static inline void
|
||||
get_window_rect(GstVaapiWindow *window, GstVideoRectangle *rect)
|
||||
get_window_rect(GstVaapiWindow *window, GstVaapiRectangle *rect)
|
||||
{
|
||||
guint width, height;
|
||||
|
||||
gst_vaapi_window_get_size(window, &width, &height);
|
||||
rect->x = 0;
|
||||
rect->y = 0;
|
||||
rect->w = width;
|
||||
rect->h = height;
|
||||
rect->width = width;
|
||||
rect->height = height;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -394,12 +394,12 @@ gboolean
|
|||
gst_vaapi_window_put_surface(
|
||||
GstVaapiWindow *window,
|
||||
GstVaapiSurface *surface,
|
||||
const GstVideoRectangle *src_rect,
|
||||
const GstVideoRectangle *dst_rect,
|
||||
const GstVaapiRectangle *src_rect,
|
||||
const GstVaapiRectangle *dst_rect,
|
||||
guint flags
|
||||
)
|
||||
{
|
||||
GstVideoRectangle src_rect_default, dst_rect_default;
|
||||
GstVaapiRectangle src_rect_default, dst_rect_default;
|
||||
|
||||
g_return_val_if_fail(GST_VAAPI_IS_WINDOW(window), FALSE);
|
||||
g_return_val_if_fail(window->priv->is_constructed, FALSE);
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#define GST_VAAPI_WINDOW_H
|
||||
|
||||
#include <gst/video/gstvideosink.h>
|
||||
#include <gst/vaapi/gstvaapitypes.h>
|
||||
#include <gst/vaapi/gstvaapidisplay.h>
|
||||
#include <gst/vaapi/gstvaapisurface.h>
|
||||
|
||||
|
@ -92,8 +93,8 @@ struct _GstVaapiWindowClass {
|
|||
gboolean (*resize) (GstVaapiWindow *window, guint width, guint height);
|
||||
gboolean (*render) (GstVaapiWindow *window,
|
||||
GstVaapiSurface *surface,
|
||||
const GstVideoRectangle *src_rect,
|
||||
const GstVideoRectangle *dst_rect,
|
||||
const GstVaapiRectangle *src_rect,
|
||||
const GstVaapiRectangle *dst_rect,
|
||||
guint flags);
|
||||
};
|
||||
|
||||
|
@ -131,8 +132,8 @@ gboolean
|
|||
gst_vaapi_window_put_surface(
|
||||
GstVaapiWindow *window,
|
||||
GstVaapiSurface *surface,
|
||||
const GstVideoRectangle *src_rect,
|
||||
const GstVideoRectangle *dst_rect,
|
||||
const GstVaapiRectangle *src_rect,
|
||||
const GstVaapiRectangle *dst_rect,
|
||||
guint flags
|
||||
);
|
||||
|
||||
|
|
|
@ -279,8 +279,8 @@ static gboolean
|
|||
gst_vaapi_window_x11_render(
|
||||
GstVaapiWindow *window,
|
||||
GstVaapiSurface *surface,
|
||||
const GstVideoRectangle *src_rect,
|
||||
const GstVideoRectangle *dst_rect,
|
||||
const GstVaapiRectangle *src_rect,
|
||||
const GstVaapiRectangle *dst_rect,
|
||||
guint flags
|
||||
)
|
||||
{
|
||||
|
@ -303,12 +303,12 @@ gst_vaapi_window_x11_render(
|
|||
GST_VAAPI_WINDOW_X11(window)->priv->xid,
|
||||
src_rect->x,
|
||||
src_rect->y,
|
||||
src_rect->w,
|
||||
src_rect->h,
|
||||
src_rect->width,
|
||||
src_rect->height,
|
||||
dst_rect->x,
|
||||
dst_rect->y,
|
||||
dst_rect->w,
|
||||
dst_rect->h,
|
||||
dst_rect->width,
|
||||
dst_rect->height,
|
||||
NULL, 0,
|
||||
get_PutSurface_flags_from_GstVaapiSurfaceRenderFlags(flags)
|
||||
);
|
||||
|
|
|
@ -141,7 +141,7 @@ gst_vaapisink_set_caps(GstBaseSink *base_sink, GstCaps *caps)
|
|||
{
|
||||
GstVaapiSink * const sink = GST_VAAPISINK(base_sink);
|
||||
GstStructure * const structure = gst_caps_get_structure(caps, 0);
|
||||
GstVideoRectangle * const win_rect = &sink->window_rect;
|
||||
GstVaapiRectangle * const win_rect = &sink->window_rect;
|
||||
guint num, den;
|
||||
guint win_width, win_height;
|
||||
guint display_width, display_height, display_par_n, display_par_d;
|
||||
|
@ -209,8 +209,8 @@ gst_vaapisink_set_caps(GstBaseSink *base_sink, GstCaps *caps)
|
|||
win_rect->x = 0;
|
||||
win_rect->y = 0;
|
||||
}
|
||||
win_rect->w = win_width;
|
||||
win_rect->h = win_height;
|
||||
win_rect->width = win_width;
|
||||
win_rect->height = win_height;
|
||||
|
||||
if (sink->window)
|
||||
gst_vaapi_window_set_size(sink->window, win_width, win_height);
|
||||
|
|
|
@ -62,7 +62,7 @@ struct _GstVaapiSink {
|
|||
gchar *display_name;
|
||||
GstVaapiDisplay *display;
|
||||
GstVaapiWindow *window;
|
||||
GstVideoRectangle window_rect;
|
||||
GstVaapiRectangle window_rect;
|
||||
guint fullscreen : 1;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue