mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-27 23:44:47 +00:00
vaapisink: re-indent all GstVaapiSink related source code.
This commit is contained in:
parent
30c59af0a0
commit
1824a80957
2 changed files with 907 additions and 957 deletions
|
@ -71,8 +71,8 @@ GST_DEBUG_CATEGORY_STATIC(gst_debug_vaapisink);
|
|||
/* Default template */
|
||||
static const char gst_vaapisink_sink_caps_str[] =
|
||||
#if GST_CHECK_VERSION(1,1,0)
|
||||
GST_VIDEO_CAPS_MAKE_WITH_FEATURES(
|
||||
GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE, "{ ENCODED, NV12, I420, YV12 }") ";"
|
||||
GST_VIDEO_CAPS_MAKE_WITH_FEATURES (GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE,
|
||||
"{ ENCODED, NV12, I420, YV12 }") ";"
|
||||
GST_VIDEO_CAPS_MAKE (GST_VIDEO_FORMATS_ALL);
|
||||
#else
|
||||
#if GST_CHECK_VERSION(1,0,0)
|
||||
|
@ -86,8 +86,7 @@ static const char gst_vaapisink_sink_caps_str[] =
|
|||
#endif
|
||||
|
||||
static GstStaticPadTemplate gst_vaapisink_sink_factory =
|
||||
GST_STATIC_PAD_TEMPLATE(
|
||||
"sink",
|
||||
GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS (gst_vaapisink_sink_caps_str));
|
||||
|
@ -101,15 +100,15 @@ gst_vaapisink_has_interface(GstVaapiPluginBase *plugin, GType type)
|
|||
static void
|
||||
gst_vaapisink_video_overlay_iface_init (GstVideoOverlayInterface * iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE(
|
||||
GstVaapiSink,
|
||||
G_DEFINE_TYPE_WITH_CODE (GstVaapiSink,
|
||||
gst_vaapisink,
|
||||
GST_TYPE_VIDEO_SINK,
|
||||
GST_VAAPI_PLUGIN_BASE_INIT_INTERFACES
|
||||
G_IMPLEMENT_INTERFACE (GST_TYPE_VIDEO_OVERLAY,
|
||||
gst_vaapisink_video_overlay_iface_init))
|
||||
gst_vaapisink_video_overlay_iface_init));
|
||||
|
||||
enum {
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
|
||||
PROP_DISPLAY_TYPE,
|
||||
|
@ -123,7 +122,7 @@ enum {
|
|||
#define DEFAULT_DISPLAY_TYPE GST_VAAPI_DISPLAY_TYPE_ANY
|
||||
#define DEFAULT_ROTATION GST_VAAPI_ROTATION_0
|
||||
|
||||
static inline gboolean
|
||||
static gboolean
|
||||
gst_vaapisink_ensure_display (GstVaapiSink * sink);
|
||||
|
||||
/* GstVideoOverlay interface */
|
||||
|
@ -135,7 +134,8 @@ static gboolean
|
|||
gst_vaapisink_reconfigure_window (GstVaapiSink * sink);
|
||||
|
||||
static void
|
||||
gst_vaapisink_set_event_handling(GstVideoOverlay *overlay, gboolean handle_events);
|
||||
gst_vaapisink_set_event_handling (GstVideoOverlay * overlay,
|
||||
gboolean handle_events);
|
||||
|
||||
static GstFlowReturn
|
||||
gst_vaapisink_show_frame (GstBaseSink * base_sink, GstBuffer * buffer);
|
||||
|
@ -145,7 +145,8 @@ gst_vaapisink_put_surface(GstVaapiSink *sink, GstVaapiSurface *surface,
|
|||
const GstVaapiRectangle * surface_rect, guint flags);
|
||||
|
||||
static gboolean
|
||||
gst_vaapisink_ensure_render_rect(GstVaapiSink *sink, guint width, guint height);
|
||||
gst_vaapisink_ensure_render_rect (GstVaapiSink * sink, guint width,
|
||||
guint height);
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* --- DRM Backend --- */
|
||||
|
@ -164,8 +165,9 @@ gst_vaapisink_drm_create_window(GstVaapiSink *sink, guint width, guint height)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_vaapisink_drm_render_surface(GstVaapiSink *sink, GstVaapiSurface *surface,
|
||||
const GstVaapiRectangle *surface_rect, guint flags)
|
||||
gst_vaapisink_drm_render_surface (GstVaapiSink * sink,
|
||||
GstVaapiSurface * surface, const GstVaapiRectangle * surface_rect,
|
||||
guint flags)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -191,7 +193,8 @@ gst_vaapisink_backend_drm(void)
|
|||
|
||||
/* Checks whether a ConfigureNotify event is in the queue */
|
||||
typedef struct _ConfigureNotifyEventPendingArgs ConfigureNotifyEventPendingArgs;
|
||||
struct _ConfigureNotifyEventPendingArgs {
|
||||
struct _ConfigureNotifyEventPendingArgs
|
||||
{
|
||||
Window window;
|
||||
guint width;
|
||||
guint height;
|
||||
|
@ -230,11 +233,8 @@ configure_notify_event_pending(GstVaapiSink *sink, Window window,
|
|||
args.match = FALSE;
|
||||
|
||||
/* XXX: don't use XPeekIfEvent() because it might block */
|
||||
XCheckIfEvent(
|
||||
gst_vaapi_display_x11_get_display(display),
|
||||
&xev,
|
||||
configure_notify_event_pending_cb, (XPointer)&args
|
||||
);
|
||||
XCheckIfEvent (gst_vaapi_display_x11_get_display (display),
|
||||
&xev, configure_notify_event_pending_cb, (XPointer) & args);
|
||||
return args.match;
|
||||
}
|
||||
|
||||
|
@ -255,7 +255,8 @@ gst_vaapisink_x11_create_window(GstVaapiSink *sink, guint width, guint height)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_vaapisink_x11_create_window_from_handle(GstVaapiSink *sink, guintptr window)
|
||||
gst_vaapisink_x11_create_window_from_handle (GstVaapiSink * sink,
|
||||
guintptr window)
|
||||
{
|
||||
GstVaapiDisplay *display;
|
||||
Window rootwin;
|
||||
|
@ -268,12 +269,9 @@ gst_vaapisink_x11_create_window_from_handle(GstVaapiSink *sink, guintptr window)
|
|||
display = GST_VAAPI_PLUGIN_BASE_DISPLAY (sink);
|
||||
|
||||
gst_vaapi_display_lock (display);
|
||||
XGetGeometry(
|
||||
gst_vaapi_display_x11_get_display(GST_VAAPI_DISPLAY_X11(display)),
|
||||
xid,
|
||||
&rootwin,
|
||||
&x, &y, &width, &height, &border_width, &depth
|
||||
);
|
||||
XGetGeometry (gst_vaapi_display_x11_get_display (GST_VAAPI_DISPLAY_X11
|
||||
(display)), xid, &rootwin, &x, &y, &width, &height, &border_width,
|
||||
&depth);
|
||||
gst_vaapi_display_unlock (display);
|
||||
|
||||
if ((width != sink->window_width || height != sink->window_height) &&
|
||||
|
@ -284,8 +282,9 @@ gst_vaapisink_x11_create_window_from_handle(GstVaapiSink *sink, guintptr window)
|
|||
sink->window_height = height;
|
||||
}
|
||||
|
||||
if (!sink->window || gst_vaapi_window_x11_get_xid(
|
||||
GST_VAAPI_WINDOW_X11(sink->window)) != xid) {
|
||||
if (!sink->window
|
||||
|| gst_vaapi_window_x11_get_xid (GST_VAAPI_WINDOW_X11 (sink->window)) !=
|
||||
xid) {
|
||||
gst_vaapi_window_replace (&sink->window, NULL);
|
||||
sink->window = gst_vaapi_window_x11_new_with_xid (display, xid);
|
||||
if (!sink->window)
|
||||
|
@ -361,8 +360,7 @@ gst_vaapisink_x11_pre_stop_event_thread(GstVaapiSink *sink)
|
|||
|
||||
if (sink->window) {
|
||||
XSelectInput (gst_vaapi_display_x11_get_display (display),
|
||||
gst_vaapi_window_x11_get_xid(GST_VAAPI_WINDOW_X11(sink->window)),
|
||||
0);
|
||||
gst_vaapi_window_x11_get_xid (GST_VAAPI_WINDOW_X11 (sink->window)), 0);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -448,13 +446,8 @@ gst_vaapisink_video_overlay_set_window_handle(GstVideoOverlay *overlay,
|
|||
}
|
||||
|
||||
static void
|
||||
gst_vaapisink_video_overlay_set_render_rectangle(
|
||||
GstVideoOverlay *overlay,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height
|
||||
)
|
||||
gst_vaapisink_video_overlay_set_render_rectangle (GstVideoOverlay * overlay,
|
||||
gint x, gint y, gint width, gint height)
|
||||
{
|
||||
GstVaapiSink *const sink = GST_VAAPISINK (overlay);
|
||||
GstVaapiRectangle *const display_rect = &sink->display_rect;
|
||||
|
@ -535,8 +528,7 @@ gst_vaapisink_set_event_handling(GstVideoOverlay *overlay,
|
|||
sink->event_thread_cancel = FALSE;
|
||||
sink->event_thread = g_thread_try_new ("vaapisink-events",
|
||||
(GThreadFunc) gst_vaapisink_event_thread, sink, NULL);
|
||||
}
|
||||
else if (!handle_events && sink->event_thread) {
|
||||
} else if (!handle_events && sink->event_thread) {
|
||||
GST_DEBUG ("stopping xevent thread");
|
||||
if (sink->backend->pre_stop_event_thread)
|
||||
sink->backend->pre_stop_event_thread (sink);
|
||||
|
@ -559,7 +551,8 @@ static void
|
|||
gst_vaapisink_video_overlay_iface_init (GstVideoOverlayInterface * iface)
|
||||
{
|
||||
iface->set_window_handle = gst_vaapisink_video_overlay_set_window_handle;
|
||||
iface->set_render_rectangle = gst_vaapisink_video_overlay_set_render_rectangle;
|
||||
iface->set_render_rectangle =
|
||||
gst_vaapisink_video_overlay_set_render_rectangle;
|
||||
iface->expose = gst_vaapisink_video_overlay_expose;
|
||||
iface->handle_events = gst_vaapisink_set_event_handling;
|
||||
}
|
||||
|
@ -584,7 +577,7 @@ get_display_type_name(GstVaapiDisplayType display_type)
|
|||
return "<unknown-type>";
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
static gboolean
|
||||
gst_vaapisink_ensure_display (GstVaapiSink * sink)
|
||||
{
|
||||
return gst_vaapi_plugin_base_ensure_display (GST_VAAPI_PLUGIN_BASE (sink));
|
||||
|
@ -647,7 +640,8 @@ gst_vaapisink_ensure_uploader(GstVaapiSink *sink)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_vaapisink_ensure_render_rect(GstVaapiSink *sink, guint width, guint height)
|
||||
gst_vaapisink_ensure_render_rect (GstVaapiSink * sink, guint width,
|
||||
guint height)
|
||||
{
|
||||
GstVaapiRectangle *const display_rect = &sink->display_rect;
|
||||
guint num, den, display_par_n, display_par_d;
|
||||
|
@ -672,19 +666,13 @@ gst_vaapisink_ensure_render_rect(GstVaapiSink *sink, guint width, guint height)
|
|||
|
||||
GST_DEBUG ("ensure render rect within %ux%u bounds", width, height);
|
||||
|
||||
gst_vaapi_display_get_pixel_aspect_ratio(
|
||||
GST_VAAPI_PLUGIN_BASE_DISPLAY(sink),
|
||||
&display_par_n, &display_par_d
|
||||
);
|
||||
GST_DEBUG("display pixel-aspect-ratio %d/%d",
|
||||
display_par_n, display_par_d);
|
||||
gst_vaapi_display_get_pixel_aspect_ratio (GST_VAAPI_PLUGIN_BASE_DISPLAY
|
||||
(sink), &display_par_n, &display_par_d);
|
||||
GST_DEBUG ("display pixel-aspect-ratio %d/%d", display_par_n, display_par_d);
|
||||
|
||||
success = gst_video_calculate_display_ratio(
|
||||
&num, &den,
|
||||
success = gst_video_calculate_display_ratio (&num, &den,
|
||||
sink->video_width, sink->video_height,
|
||||
sink->video_par_n, sink->video_par_d,
|
||||
display_par_n, display_par_d
|
||||
);
|
||||
sink->video_par_n, sink->video_par_d, display_par_n, display_par_d);
|
||||
if (!success)
|
||||
return FALSE;
|
||||
GST_DEBUG ("video size %dx%d, calculated ratio %d/%d",
|
||||
|
@ -694,14 +682,13 @@ gst_vaapisink_ensure_render_rect(GstVaapiSink *sink, guint width, guint height)
|
|||
if (display_rect->width <= width) {
|
||||
GST_DEBUG ("keeping window height");
|
||||
display_rect->height = height;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
GST_DEBUG ("keeping window width");
|
||||
display_rect->width = width;
|
||||
display_rect->height =
|
||||
gst_util_uint64_scale_int(width, den, num);
|
||||
display_rect->height = gst_util_uint64_scale_int (width, den, num);
|
||||
}
|
||||
GST_DEBUG("scaling video to %ux%u", display_rect->width, display_rect->height);
|
||||
GST_DEBUG ("scaling video to %ux%u", display_rect->width,
|
||||
display_rect->height);
|
||||
|
||||
g_assert (display_rect->width <= width);
|
||||
g_assert (display_rect->height <= height);
|
||||
|
@ -716,7 +703,8 @@ gst_vaapisink_ensure_render_rect(GstVaapiSink *sink, guint width, guint height)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_vaapisink_ensure_window_size(GstVaapiSink *sink, guint *pwidth, guint *pheight)
|
||||
gst_vaapisink_ensure_window_size (GstVaapiSink * sink, guint * pwidth,
|
||||
guint * pheight)
|
||||
{
|
||||
GstVaapiDisplay *const display = GST_VAAPI_PLUGIN_BASE_DISPLAY (sink);
|
||||
GstVideoRectangle src_rect, dst_rect, out_rect;
|
||||
|
@ -736,17 +724,12 @@ gst_vaapisink_ensure_window_size(GstVaapiSink *sink, guint *pwidth, guint *pheig
|
|||
return;
|
||||
}
|
||||
|
||||
gst_vaapi_display_get_pixel_aspect_ratio(
|
||||
display,
|
||||
&display_par_n, &display_par_d
|
||||
);
|
||||
gst_vaapi_display_get_pixel_aspect_ratio (display,
|
||||
&display_par_n, &display_par_d);
|
||||
|
||||
success = gst_video_calculate_display_ratio(
|
||||
&num, &den,
|
||||
success = gst_video_calculate_display_ratio (&num, &den,
|
||||
sink->video_width, sink->video_height,
|
||||
sink->video_par_n, sink->video_par_d,
|
||||
display_par_n, display_par_d
|
||||
);
|
||||
sink->video_par_n, sink->video_par_d, display_par_n, display_par_d);
|
||||
if (!success) {
|
||||
num = sink->video_par_n;
|
||||
den = sink->video_par_d;
|
||||
|
@ -773,7 +756,8 @@ gst_vaapisink_ensure_window(GstVaapiSink *sink, guint width, guint height)
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_vaapisink_ensure_rotation(GstVaapiSink *sink, gboolean recalc_display_rect)
|
||||
gst_vaapisink_ensure_rotation (GstVaapiSink * sink,
|
||||
gboolean recalc_display_rect)
|
||||
{
|
||||
GstVaapiDisplay *const display = GST_VAAPI_PLUGIN_BASE_DISPLAY (sink);
|
||||
gboolean success = FALSE;
|
||||
|
@ -866,11 +850,9 @@ gst_vaapisink_get_caps(GstBaseSink *base_sink, GstCaps *filter)
|
|||
|
||||
caps = gst_vaapisink_get_caps_impl (base_sink);
|
||||
if (caps && filter) {
|
||||
out_caps = gst_caps_intersect_full(caps, filter,
|
||||
GST_CAPS_INTERSECT_FIRST);
|
||||
out_caps = gst_caps_intersect_full (caps, filter, GST_CAPS_INTERSECT_FIRST);
|
||||
gst_caps_unref (caps);
|
||||
}
|
||||
else
|
||||
} else
|
||||
out_caps = caps;
|
||||
return out_caps;
|
||||
}
|
||||
|
@ -882,11 +864,9 @@ static void
|
|||
update_colorimetry (GstVaapiSink * sink, GstVideoColorimetry * cinfo)
|
||||
{
|
||||
#if GST_CHECK_VERSION(1,0,0)
|
||||
if (gst_video_colorimetry_matches(cinfo,
|
||||
GST_VIDEO_COLORIMETRY_BT601))
|
||||
if (gst_video_colorimetry_matches (cinfo, GST_VIDEO_COLORIMETRY_BT601))
|
||||
sink->color_standard = GST_VAAPI_COLOR_STANDARD_ITUR_BT_601;
|
||||
else if (gst_video_colorimetry_matches(cinfo,
|
||||
GST_VIDEO_COLORIMETRY_BT709))
|
||||
else if (gst_video_colorimetry_matches (cinfo, GST_VIDEO_COLORIMETRY_BT709))
|
||||
sink->color_standard = GST_VAAPI_COLOR_STANDARD_ITUR_BT_709;
|
||||
else if (gst_video_colorimetry_matches (cinfo,
|
||||
GST_VIDEO_COLORIMETRY_SMPTE240M))
|
||||
|
@ -933,8 +913,7 @@ gst_vaapisink_set_caps(GstBaseSink *base_sink, GstCaps *caps)
|
|||
if (sink->window) {
|
||||
if (!sink->foreign_window || sink->fullscreen)
|
||||
gst_vaapi_window_set_size (sink->window, win_width, win_height);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
gst_vaapi_display_lock (display);
|
||||
gst_video_overlay_prepare_window_handle (GST_VIDEO_OVERLAY (sink));
|
||||
gst_vaapi_display_unlock (display);
|
||||
|
@ -945,7 +924,8 @@ gst_vaapisink_set_caps(GstBaseSink *base_sink, GstCaps *caps)
|
|||
gst_vaapi_window_set_fullscreen (sink->window, sink->fullscreen);
|
||||
gst_vaapi_window_show (sink->window);
|
||||
gst_vaapi_window_get_size (sink->window, &win_width, &win_height);
|
||||
gst_vaapisink_set_event_handling(GST_VIDEO_OVERLAY(sink), sink->handle_events);
|
||||
gst_vaapisink_set_event_handling (GST_VIDEO_OVERLAY (sink),
|
||||
sink->handle_events);
|
||||
}
|
||||
sink->window_width = win_width;
|
||||
sink->window_height = win_height;
|
||||
|
@ -955,12 +935,9 @@ gst_vaapisink_set_caps(GstBaseSink *base_sink, GstCaps *caps)
|
|||
}
|
||||
|
||||
static inline gboolean
|
||||
gst_vaapisink_put_surface(
|
||||
GstVaapiSink *sink,
|
||||
gst_vaapisink_put_surface (GstVaapiSink * sink,
|
||||
GstVaapiSurface * surface,
|
||||
const GstVaapiRectangle *surface_rect,
|
||||
guint flags
|
||||
)
|
||||
const GstVaapiRectangle * surface_rect, guint flags)
|
||||
{
|
||||
if (!sink->window)
|
||||
return FALSE;
|
||||
|
@ -1097,8 +1074,9 @@ static GstFlowReturn
|
|||
gst_vaapisink_buffer_alloc (GstBaseSink * base_sink, guint64 offset, guint size,
|
||||
GstCaps * caps, GstBuffer ** outbuf_ptr)
|
||||
{
|
||||
return gst_vaapi_plugin_base_allocate_input_buffer(
|
||||
GST_VAAPI_PLUGIN_BASE(base_sink), caps, outbuf_ptr);
|
||||
return
|
||||
gst_vaapi_plugin_base_allocate_input_buffer (GST_VAAPI_PLUGIN_BASE
|
||||
(base_sink), caps, outbuf_ptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1128,12 +1106,8 @@ gst_vaapisink_finalize(GObject *object)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_vaapisink_set_property(
|
||||
GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec
|
||||
)
|
||||
gst_vaapisink_set_property (GObject * object,
|
||||
guint prop_id, const GValue * value, GParamSpec * pspec)
|
||||
{
|
||||
GstVaapiSink *const sink = GST_VAAPISINK (object);
|
||||
|
||||
|
@ -1165,12 +1139,8 @@ gst_vaapisink_set_property(
|
|||
}
|
||||
|
||||
static void
|
||||
gst_vaapisink_get_property(
|
||||
GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec
|
||||
)
|
||||
gst_vaapisink_get_property (GObject * object,
|
||||
guint prop_id, GValue * value, GParamSpec * pspec)
|
||||
{
|
||||
GstVaapiSink *const sink = GST_VAAPISINK (object);
|
||||
|
||||
|
@ -1248,16 +1218,13 @@ gst_vaapisink_class_init(GstVaapiSinkClass *klass)
|
|||
|
||||
element_class->set_bus = gst_vaapisink_set_bus;
|
||||
gst_element_class_set_static_metadata (element_class,
|
||||
"VA-API sink",
|
||||
"Sink/Video",
|
||||
GST_PLUGIN_DESC,
|
||||
"VA-API sink", "Sink/Video", GST_PLUGIN_DESC,
|
||||
"Gwenole Beauchesne <gwenole.beauchesne@intel.com>");
|
||||
|
||||
pad_template = gst_static_pad_template_get (&gst_vaapisink_sink_factory);
|
||||
gst_element_class_add_pad_template (element_class, pad_template);
|
||||
|
||||
g_object_class_install_property
|
||||
(object_class,
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_DISPLAY_TYPE,
|
||||
g_param_spec_enum ("display",
|
||||
"display type",
|
||||
|
@ -1266,53 +1233,45 @@ gst_vaapisink_class_init(GstVaapiSinkClass *klass)
|
|||
GST_VAAPI_DISPLAY_TYPE_ANY,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_property
|
||||
(object_class,
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_DISPLAY_NAME,
|
||||
g_param_spec_string ("display-name",
|
||||
"display name",
|
||||
"display name to use",
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_property
|
||||
(object_class,
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_FULLSCREEN,
|
||||
g_param_spec_boolean ("fullscreen",
|
||||
"Fullscreen",
|
||||
"Requests window in fullscreen state",
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
/**
|
||||
* GstVaapiSink:rotation:
|
||||
*
|
||||
* The VA display rotation mode, expressed as a #GstVaapiRotation.
|
||||
*/
|
||||
g_object_class_install_property
|
||||
(object_class,
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_ROTATION,
|
||||
g_param_spec_enum (GST_VAAPI_DISPLAY_PROP_ROTATION,
|
||||
"rotation",
|
||||
"The display rotation mode",
|
||||
GST_VAAPI_TYPE_ROTATION,
|
||||
DEFAULT_ROTATION,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
DEFAULT_ROTATION, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
/**
|
||||
* GstVaapiSink:force-aspect-ratio:
|
||||
*
|
||||
* When enabled, scaling respects video aspect ratio; when disabled, the
|
||||
* video is distorted to fit the window.
|
||||
* When enabled, scaling respects video aspect ratio; when disabled,
|
||||
* the video is distorted to fit the window.
|
||||
*/
|
||||
g_object_class_install_property
|
||||
(object_class,
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_FORCE_ASPECT_RATIO,
|
||||
g_param_spec_boolean ("force-aspect-ratio",
|
||||
"Force aspect ratio",
|
||||
"When enabled, scaling will respect original aspect ratio",
|
||||
TRUE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
/**
|
||||
* GstVaapiSink:view-id:
|
||||
|
@ -1322,14 +1281,12 @@ gst_vaapisink_class_init(GstVaapiSinkClass *klass)
|
|||
* other number will indicate the desire to display the supplied
|
||||
* view-id only.
|
||||
*/
|
||||
g_object_class_install_property
|
||||
(object_class,
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_VIEW_ID,
|
||||
g_param_spec_int ("view-id",
|
||||
"View ID",
|
||||
"ID of the view component of interest to display",
|
||||
-1, G_MAXINT32, -1,
|
||||
G_PARAM_READWRITE));
|
||||
-1, G_MAXINT32, -1, G_PARAM_READWRITE));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -33,27 +33,16 @@ G_BEGIN_DECLS
|
|||
|
||||
#define GST_TYPE_VAAPISINK \
|
||||
(gst_vaapisink_get_type ())
|
||||
|
||||
#define GST_VAAPISINK(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj), \
|
||||
GST_TYPE_VAAPISINK, \
|
||||
GstVaapiSink))
|
||||
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPISINK, GstVaapiSink))
|
||||
#define GST_VAAPISINK_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass), \
|
||||
GST_TYPE_VAAPISINK, \
|
||||
GstVaapiSinkClass))
|
||||
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPISINK, GstVaapiSinkClass))
|
||||
#define GST_IS_VAAPISINK(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPISINK))
|
||||
|
||||
#define GST_IS_VAAPISINK_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VAAPISINK))
|
||||
|
||||
#define GST_VAAPISINK_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS((obj), \
|
||||
GST_TYPE_VAAPISINK, \
|
||||
GstVaapiSinkClass))
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPISINK, GstVaapiSinkClass))
|
||||
|
||||
typedef struct _GstVaapiSink GstVaapiSink;
|
||||
typedef struct _GstVaapiSinkClass GstVaapiSinkClass;
|
||||
|
@ -64,12 +53,14 @@ typedef gboolean (*GstVaapiSinkCreateWindowFunc)(GstVaapiSink *sink,
|
|||
typedef gboolean (*GstVaapiSinkCreateWindowFromHandleFunc) (GstVaapiSink * sink,
|
||||
guintptr window);
|
||||
typedef gboolean (*GstVaapiSinkRenderSurfaceFunc) (GstVaapiSink * sink,
|
||||
GstVaapiSurface *surface, const GstVaapiRectangle *surface_rect, guint flags);
|
||||
GstVaapiSurface * surface, const GstVaapiRectangle * surface_rect,
|
||||
guint flags);
|
||||
typedef gboolean (*GstVaapiSinkHandleEventsFunc) (GstVaapiSink * sink);
|
||||
typedef gboolean (*GstVaapiSinkPreStartEventThreadFunc) (GstVaapiSink * sink);
|
||||
typedef gboolean (*GstVaapiSinkPreStopEventThreadFunc) (GstVaapiSink * sink);
|
||||
|
||||
struct _GstVaapiSinkBackend {
|
||||
struct _GstVaapiSinkBackend
|
||||
{
|
||||
GstVaapiSinkCreateWindowFunc create_window;
|
||||
GstVaapiSinkCreateWindowFromHandleFunc create_window_from_handle;
|
||||
GstVaapiSinkRenderSurfaceFunc render_surface;
|
||||
|
@ -81,7 +72,8 @@ struct _GstVaapiSinkBackend {
|
|||
GstVaapiSinkPreStopEventThreadFunc pre_stop_event_thread;
|
||||
};
|
||||
|
||||
struct _GstVaapiSink {
|
||||
struct _GstVaapiSink
|
||||
{
|
||||
/*< private >*/
|
||||
GstVaapiPluginBase parent_instance;
|
||||
|
||||
|
@ -112,7 +104,8 @@ struct _GstVaapiSink {
|
|||
guint keep_aspect : 1;
|
||||
};
|
||||
|
||||
struct _GstVaapiSinkClass {
|
||||
struct _GstVaapiSinkClass
|
||||
{
|
||||
/*< private >*/
|
||||
GstVaapiPluginBaseClass parent_class;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue