gstreamer/subprojects/gst-plugins-bad/gst/dvdspu/gstspu-common.h
Arnaud Vrac b0ce390d50 dvdspu: render to AYUV overlay
Instead of only supporting writing SPU data directly to YUV frames,
render the SPU data to an intermediate AYUV overlay buffer. The overlay
data is then blended to the video frame.

For the PGS format, the overlay buffer size is set to the size of the
Composition Window, and its position in the overlay composition is set
to the window position. The objects to render are now cropped when the
cropping flag is set.

For the Vobsub format, the overlay buffer size is set to the size of the
Display Area.

Once rendered, the overlay composition rectangle is now moved and scaled
to fit the video output size, to avoid clipping.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5827>
2024-01-02 14:13:03 +00:00

60 lines
1.5 KiB
C

/* GStreamer DVD Sub-Picture Unit
* Copyright (C) 2007 Fluendo S.A. <info@fluendo.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GSTSPU_COMMON_H__
#define __GSTSPU_COMMON_H__
#include <glib.h>
#include <gst/video/video.h>
G_BEGIN_DECLS
/* FIXME: Move this back to gstdvdspu.h when the renderers no longer use it: */
typedef struct _GstDVDSpu GstDVDSpu;
typedef struct SpuState SpuState;
typedef struct SpuColour SpuColour;
typedef struct SpuRect SpuRect;
/* Describe the limits of a rectangle */
struct SpuRect {
gint16 left;
gint16 top;
gint16 right;
gint16 bottom;
};
/* Store a pre-multiplied YUV colour value */
struct SpuColour {
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
guint8 A;
guint8 Y;
guint8 U;
guint8 V;
#else
guint8 V;
guint8 U;
guint8 Y;
guint8 A;
#endif
};
G_END_DECLS
#endif /* __GSTSPU_COMMON_H__ */