2009-05-16 19:23:34 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* vlc_subpicture.h: subpicture definitions
|
|
|
|
*****************************************************************************
|
LGPL
Re-license almost all of libVLC and libVLCcore to LGPLv2.1+
This move was authorized by the developers, either:
- by e-mail,
- by vote at the VideoLAN Dev Days 2011,
- on the license website,
- in a contract, oral or written.
No objection was raised, so far.
The developers agreeing are:
Justus Piater
Alexis Ballier
Alexander Bethke
Mohammed Adnène Trojette
Alex Converse
Alexey Sokolov
Alexis de Lattre
Andre Pang
Anthony Loiseau
Cyril Deguet
André Weber
Boris Dorès
Brieuc Jeunhomme
Benjamin Drung
Hugo Beauzée-Luyssen
Benoit Steiner
Benjamin Pracht
Bernie Purcell
Przemyslaw Fiala
Arnaud de Bossoreille de Ribou
Brad Smith
Nick Briggs
Christopher Rath
Christophe Courtaut
Christopher Mueller
Clement Chesnin
Andres Krapf
Damien Fouilleul
David Flynn
Sebastien Zwickert
Antoine Cellerier
Jérôme Decoodt
Jérome Decoodt
Dylan Yudaken
Eduard Babayan
Eugenio Jarosiewicz
Elliot Murphy
Eric Petit
Erwan Tulou
Etienne Membrives
Ludovic Fauvet
Fabio Ritrovato
Tobias Güntner
Jakub Wieczorek
Frédéric Crozat
Francois Cartegnie
Laurent Aimar
Florian G. Pflug
Felix Paul Kühne
Frank Enderle
Rafaël Carré
Simon Latapie
Gildas Bazin
Geoffroy Couprie
Julien / Gellule
Gildas Bazin
Arnaud Schauly
Toralf Niebuhr
Vicente Jimenez Aguilar
Derk-Jan Hartman
Henri Fallon
Ilkka Ollakka
Olivier Teulière
Rémi Duraffort
Jakob Leben
Jean-Baptiste Kempf
Jean-Paul Saman
Jean-Philippe Grimaldi
Jean-François Massol
Gaël Hendryckx
Jakob Leben
Jean-Marc Dressler
Jai Menon
Johan Bilien
Johann Ransay
Joris van Rooij
JP Dinger
Jean-Philippe André
Adrien Grand
Juha Jeronen
Juho Vähä-Herttua
Kaarlo Raiha
Kaarlo Raiha
Kamil Baldyga
Keary Griffin
Ken Self
KO Myung-Hun
Pierre Ynard
Filippo Carone
Loïc Minier
Luca Barbato
Lucas C. Villa Real
Lukas Durfina
Adrien Maglo
Marc Ariberti
Mark Lee
Mark Moriarty
Martin Storsjö
Christophe Massiot
Michel Kaempf
Marian Ďurkovič
Mirsal Ennaime
Carlo Calabrò
Damien Lucas
Naohiro Koriyama
Basos G
Pierre Baillet
Vincent Penquerc'h
Olivier Aubert
Pankaj Yadav
Paul Corke
Pierre d'Herbemont
Philippe Morin
Antoine Lejeune
Michael Ploujnikov
Jean-Marc Dressler
Michael Hanselmann
Rafaël Carré
Ramiro Polla
Rémi Denis-Courmont
Renaud Dartus
Richard Shepherd
Faustino Osuna
Arnaud Vallat
Rob Jonson
Robert Jedrzejczyk
Steve Lhomme
Rocky Bernstein
Romain Goyet
Rov Juvano
Sam Hocevar
Martin T. H. Sandsmark
Sebastian Birk
Sébastien Escudier
Vincent Seguin
Fabio Ritrovato
Sigmund Augdal Helberg
Casian Andrei
Srikanth Raju
Hannes Domani
Stéphane Borel
Stephan Krempel
Stephan Assmus
Tony Castley
Pavlov Konstantin
Eric Petit
Tanguy Krotoff
Dennis van Amerongen
Michel Lespinasse
Can Wu
Xavier Marchesini
Sébastien Toque
Christophe Mutricy
Yoann Peronneau
Yohann Martineau
Yuval Tze
Scott Caudle
Clément Stenac
It is possible, that some minor piece of code was badly tracked, for
some reasons (SVN, mainly) or that some small developers did not answer.
However, as an "œuvre collective", defined as in "CPI 113-2 alinéa 3",
and seeing "Cour. Cass. 17 Mai 1978", and seeing that the editor and
the very vast majority of developers have agreed (> 99.99% of the code,
> 99% of developers), we are fine here.
2011-11-27 21:44:15 +01:00
|
|
|
* Copyright (C) 1999 - 2009 VLC authors and VideoLAN
|
2009-05-16 19:23:34 +02:00
|
|
|
*
|
|
|
|
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
|
|
|
* Samuel Hocevar <sam@via.ecp.fr>
|
|
|
|
* Olivier Aubert <oaubert 47 videolan d07 org>
|
|
|
|
*
|
LGPL
Re-license almost all of libVLC and libVLCcore to LGPLv2.1+
This move was authorized by the developers, either:
- by e-mail,
- by vote at the VideoLAN Dev Days 2011,
- on the license website,
- in a contract, oral or written.
No objection was raised, so far.
The developers agreeing are:
Justus Piater
Alexis Ballier
Alexander Bethke
Mohammed Adnène Trojette
Alex Converse
Alexey Sokolov
Alexis de Lattre
Andre Pang
Anthony Loiseau
Cyril Deguet
André Weber
Boris Dorès
Brieuc Jeunhomme
Benjamin Drung
Hugo Beauzée-Luyssen
Benoit Steiner
Benjamin Pracht
Bernie Purcell
Przemyslaw Fiala
Arnaud de Bossoreille de Ribou
Brad Smith
Nick Briggs
Christopher Rath
Christophe Courtaut
Christopher Mueller
Clement Chesnin
Andres Krapf
Damien Fouilleul
David Flynn
Sebastien Zwickert
Antoine Cellerier
Jérôme Decoodt
Jérome Decoodt
Dylan Yudaken
Eduard Babayan
Eugenio Jarosiewicz
Elliot Murphy
Eric Petit
Erwan Tulou
Etienne Membrives
Ludovic Fauvet
Fabio Ritrovato
Tobias Güntner
Jakub Wieczorek
Frédéric Crozat
Francois Cartegnie
Laurent Aimar
Florian G. Pflug
Felix Paul Kühne
Frank Enderle
Rafaël Carré
Simon Latapie
Gildas Bazin
Geoffroy Couprie
Julien / Gellule
Gildas Bazin
Arnaud Schauly
Toralf Niebuhr
Vicente Jimenez Aguilar
Derk-Jan Hartman
Henri Fallon
Ilkka Ollakka
Olivier Teulière
Rémi Duraffort
Jakob Leben
Jean-Baptiste Kempf
Jean-Paul Saman
Jean-Philippe Grimaldi
Jean-François Massol
Gaël Hendryckx
Jakob Leben
Jean-Marc Dressler
Jai Menon
Johan Bilien
Johann Ransay
Joris van Rooij
JP Dinger
Jean-Philippe André
Adrien Grand
Juha Jeronen
Juho Vähä-Herttua
Kaarlo Raiha
Kaarlo Raiha
Kamil Baldyga
Keary Griffin
Ken Self
KO Myung-Hun
Pierre Ynard
Filippo Carone
Loïc Minier
Luca Barbato
Lucas C. Villa Real
Lukas Durfina
Adrien Maglo
Marc Ariberti
Mark Lee
Mark Moriarty
Martin Storsjö
Christophe Massiot
Michel Kaempf
Marian Ďurkovič
Mirsal Ennaime
Carlo Calabrò
Damien Lucas
Naohiro Koriyama
Basos G
Pierre Baillet
Vincent Penquerc'h
Olivier Aubert
Pankaj Yadav
Paul Corke
Pierre d'Herbemont
Philippe Morin
Antoine Lejeune
Michael Ploujnikov
Jean-Marc Dressler
Michael Hanselmann
Rafaël Carré
Ramiro Polla
Rémi Denis-Courmont
Renaud Dartus
Richard Shepherd
Faustino Osuna
Arnaud Vallat
Rob Jonson
Robert Jedrzejczyk
Steve Lhomme
Rocky Bernstein
Romain Goyet
Rov Juvano
Sam Hocevar
Martin T. H. Sandsmark
Sebastian Birk
Sébastien Escudier
Vincent Seguin
Fabio Ritrovato
Sigmund Augdal Helberg
Casian Andrei
Srikanth Raju
Hannes Domani
Stéphane Borel
Stephan Krempel
Stephan Assmus
Tony Castley
Pavlov Konstantin
Eric Petit
Tanguy Krotoff
Dennis van Amerongen
Michel Lespinasse
Can Wu
Xavier Marchesini
Sébastien Toque
Christophe Mutricy
Yoann Peronneau
Yohann Martineau
Yuval Tze
Scott Caudle
Clément Stenac
It is possible, that some minor piece of code was badly tracked, for
some reasons (SVN, mainly) or that some small developers did not answer.
However, as an "œuvre collective", defined as in "CPI 113-2 alinéa 3",
and seeing "Cour. Cass. 17 Mai 1978", and seeing that the editor and
the very vast majority of developers have agreed (> 99.99% of the code,
> 99% of developers), we are fine here.
2011-11-27 21:44:15 +01:00
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU Lesser General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2.1 of the License, or
|
2009-05-16 19:23:34 +02:00
|
|
|
* (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
|
LGPL
Re-license almost all of libVLC and libVLCcore to LGPLv2.1+
This move was authorized by the developers, either:
- by e-mail,
- by vote at the VideoLAN Dev Days 2011,
- on the license website,
- in a contract, oral or written.
No objection was raised, so far.
The developers agreeing are:
Justus Piater
Alexis Ballier
Alexander Bethke
Mohammed Adnène Trojette
Alex Converse
Alexey Sokolov
Alexis de Lattre
Andre Pang
Anthony Loiseau
Cyril Deguet
André Weber
Boris Dorès
Brieuc Jeunhomme
Benjamin Drung
Hugo Beauzée-Luyssen
Benoit Steiner
Benjamin Pracht
Bernie Purcell
Przemyslaw Fiala
Arnaud de Bossoreille de Ribou
Brad Smith
Nick Briggs
Christopher Rath
Christophe Courtaut
Christopher Mueller
Clement Chesnin
Andres Krapf
Damien Fouilleul
David Flynn
Sebastien Zwickert
Antoine Cellerier
Jérôme Decoodt
Jérome Decoodt
Dylan Yudaken
Eduard Babayan
Eugenio Jarosiewicz
Elliot Murphy
Eric Petit
Erwan Tulou
Etienne Membrives
Ludovic Fauvet
Fabio Ritrovato
Tobias Güntner
Jakub Wieczorek
Frédéric Crozat
Francois Cartegnie
Laurent Aimar
Florian G. Pflug
Felix Paul Kühne
Frank Enderle
Rafaël Carré
Simon Latapie
Gildas Bazin
Geoffroy Couprie
Julien / Gellule
Gildas Bazin
Arnaud Schauly
Toralf Niebuhr
Vicente Jimenez Aguilar
Derk-Jan Hartman
Henri Fallon
Ilkka Ollakka
Olivier Teulière
Rémi Duraffort
Jakob Leben
Jean-Baptiste Kempf
Jean-Paul Saman
Jean-Philippe Grimaldi
Jean-François Massol
Gaël Hendryckx
Jakob Leben
Jean-Marc Dressler
Jai Menon
Johan Bilien
Johann Ransay
Joris van Rooij
JP Dinger
Jean-Philippe André
Adrien Grand
Juha Jeronen
Juho Vähä-Herttua
Kaarlo Raiha
Kaarlo Raiha
Kamil Baldyga
Keary Griffin
Ken Self
KO Myung-Hun
Pierre Ynard
Filippo Carone
Loïc Minier
Luca Barbato
Lucas C. Villa Real
Lukas Durfina
Adrien Maglo
Marc Ariberti
Mark Lee
Mark Moriarty
Martin Storsjö
Christophe Massiot
Michel Kaempf
Marian Ďurkovič
Mirsal Ennaime
Carlo Calabrò
Damien Lucas
Naohiro Koriyama
Basos G
Pierre Baillet
Vincent Penquerc'h
Olivier Aubert
Pankaj Yadav
Paul Corke
Pierre d'Herbemont
Philippe Morin
Antoine Lejeune
Michael Ploujnikov
Jean-Marc Dressler
Michael Hanselmann
Rafaël Carré
Ramiro Polla
Rémi Denis-Courmont
Renaud Dartus
Richard Shepherd
Faustino Osuna
Arnaud Vallat
Rob Jonson
Robert Jedrzejczyk
Steve Lhomme
Rocky Bernstein
Romain Goyet
Rov Juvano
Sam Hocevar
Martin T. H. Sandsmark
Sebastian Birk
Sébastien Escudier
Vincent Seguin
Fabio Ritrovato
Sigmund Augdal Helberg
Casian Andrei
Srikanth Raju
Hannes Domani
Stéphane Borel
Stephan Krempel
Stephan Assmus
Tony Castley
Pavlov Konstantin
Eric Petit
Tanguy Krotoff
Dennis van Amerongen
Michel Lespinasse
Can Wu
Xavier Marchesini
Sébastien Toque
Christophe Mutricy
Yoann Peronneau
Yohann Martineau
Yuval Tze
Scott Caudle
Clément Stenac
It is possible, that some minor piece of code was badly tracked, for
some reasons (SVN, mainly) or that some small developers did not answer.
However, as an "œuvre collective", defined as in "CPI 113-2 alinéa 3",
and seeing "Cour. Cass. 17 Mai 1978", and seeing that the editor and
the very vast majority of developers have agreed (> 99.99% of the code,
> 99% of developers), we are fine here.
2011-11-27 21:44:15 +01:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License for more details.
|
2009-05-16 19:23:34 +02:00
|
|
|
*
|
LGPL
Re-license almost all of libVLC and libVLCcore to LGPLv2.1+
This move was authorized by the developers, either:
- by e-mail,
- by vote at the VideoLAN Dev Days 2011,
- on the license website,
- in a contract, oral or written.
No objection was raised, so far.
The developers agreeing are:
Justus Piater
Alexis Ballier
Alexander Bethke
Mohammed Adnène Trojette
Alex Converse
Alexey Sokolov
Alexis de Lattre
Andre Pang
Anthony Loiseau
Cyril Deguet
André Weber
Boris Dorès
Brieuc Jeunhomme
Benjamin Drung
Hugo Beauzée-Luyssen
Benoit Steiner
Benjamin Pracht
Bernie Purcell
Przemyslaw Fiala
Arnaud de Bossoreille de Ribou
Brad Smith
Nick Briggs
Christopher Rath
Christophe Courtaut
Christopher Mueller
Clement Chesnin
Andres Krapf
Damien Fouilleul
David Flynn
Sebastien Zwickert
Antoine Cellerier
Jérôme Decoodt
Jérome Decoodt
Dylan Yudaken
Eduard Babayan
Eugenio Jarosiewicz
Elliot Murphy
Eric Petit
Erwan Tulou
Etienne Membrives
Ludovic Fauvet
Fabio Ritrovato
Tobias Güntner
Jakub Wieczorek
Frédéric Crozat
Francois Cartegnie
Laurent Aimar
Florian G. Pflug
Felix Paul Kühne
Frank Enderle
Rafaël Carré
Simon Latapie
Gildas Bazin
Geoffroy Couprie
Julien / Gellule
Gildas Bazin
Arnaud Schauly
Toralf Niebuhr
Vicente Jimenez Aguilar
Derk-Jan Hartman
Henri Fallon
Ilkka Ollakka
Olivier Teulière
Rémi Duraffort
Jakob Leben
Jean-Baptiste Kempf
Jean-Paul Saman
Jean-Philippe Grimaldi
Jean-François Massol
Gaël Hendryckx
Jakob Leben
Jean-Marc Dressler
Jai Menon
Johan Bilien
Johann Ransay
Joris van Rooij
JP Dinger
Jean-Philippe André
Adrien Grand
Juha Jeronen
Juho Vähä-Herttua
Kaarlo Raiha
Kaarlo Raiha
Kamil Baldyga
Keary Griffin
Ken Self
KO Myung-Hun
Pierre Ynard
Filippo Carone
Loïc Minier
Luca Barbato
Lucas C. Villa Real
Lukas Durfina
Adrien Maglo
Marc Ariberti
Mark Lee
Mark Moriarty
Martin Storsjö
Christophe Massiot
Michel Kaempf
Marian Ďurkovič
Mirsal Ennaime
Carlo Calabrò
Damien Lucas
Naohiro Koriyama
Basos G
Pierre Baillet
Vincent Penquerc'h
Olivier Aubert
Pankaj Yadav
Paul Corke
Pierre d'Herbemont
Philippe Morin
Antoine Lejeune
Michael Ploujnikov
Jean-Marc Dressler
Michael Hanselmann
Rafaël Carré
Ramiro Polla
Rémi Denis-Courmont
Renaud Dartus
Richard Shepherd
Faustino Osuna
Arnaud Vallat
Rob Jonson
Robert Jedrzejczyk
Steve Lhomme
Rocky Bernstein
Romain Goyet
Rov Juvano
Sam Hocevar
Martin T. H. Sandsmark
Sebastian Birk
Sébastien Escudier
Vincent Seguin
Fabio Ritrovato
Sigmund Augdal Helberg
Casian Andrei
Srikanth Raju
Hannes Domani
Stéphane Borel
Stephan Krempel
Stephan Assmus
Tony Castley
Pavlov Konstantin
Eric Petit
Tanguy Krotoff
Dennis van Amerongen
Michel Lespinasse
Can Wu
Xavier Marchesini
Sébastien Toque
Christophe Mutricy
Yoann Peronneau
Yohann Martineau
Yuval Tze
Scott Caudle
Clément Stenac
It is possible, that some minor piece of code was badly tracked, for
some reasons (SVN, mainly) or that some small developers did not answer.
However, as an "œuvre collective", defined as in "CPI 113-2 alinéa 3",
and seeing "Cour. Cass. 17 Mai 1978", and seeing that the editor and
the very vast majority of developers have agreed (> 99.99% of the code,
> 99% of developers), we are fine here.
2011-11-27 21:44:15 +01:00
|
|
|
* You should have received a copy of the GNU Lesser 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.
|
2009-05-16 19:23:34 +02:00
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef VLC_SUBPICTURE_H
|
|
|
|
#define VLC_SUBPICTURE_H 1
|
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <vlc_picture.h>
|
2010-05-04 20:10:13 +02:00
|
|
|
#include <vlc_text_style.h>
|
2009-05-16 19:23:34 +02:00
|
|
|
|
|
|
|
/**
|
2015-06-14 18:00:16 +02:00
|
|
|
* \defgroup subpicture Video sub-pictures
|
|
|
|
* \ingroup video_output
|
2009-05-16 19:23:34 +02:00
|
|
|
* Subpictures are pictures that should be displayed on top of the video, like
|
|
|
|
* subtitles and OSD
|
|
|
|
* @{
|
2015-06-14 18:00:16 +02:00
|
|
|
* \file
|
|
|
|
* Subpictures functions
|
2009-05-16 19:23:34 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Video subtitle region spu core private
|
|
|
|
*/
|
|
|
|
typedef struct subpicture_region_private_t subpicture_region_private_t;
|
2018-07-13 14:50:15 +02:00
|
|
|
typedef struct vlc_spu_highlight_t vlc_spu_highlight_t;
|
2019-09-17 14:56:37 +02:00
|
|
|
typedef struct filter_t vlc_blender_t;
|
2009-05-16 19:23:34 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Video subtitle region
|
|
|
|
*
|
|
|
|
* A subtitle region is defined by a picture (graphic) and its rendering
|
|
|
|
* coordinates.
|
|
|
|
* Subtitles contain a list of regions.
|
|
|
|
*/
|
|
|
|
struct subpicture_region_t
|
|
|
|
{
|
|
|
|
video_format_t fmt; /**< format of the picture */
|
|
|
|
picture_t *p_picture; /**< picture comprising this region */
|
|
|
|
|
2017-05-31 11:35:51 +02:00
|
|
|
int i_x; /**< position of region, relative to alignment */
|
|
|
|
int i_y; /**< position of region, relative to alignment */
|
2017-10-23 10:17:50 +02:00
|
|
|
int i_align; /**< alignment flags of region */
|
2009-05-16 19:23:34 +02:00
|
|
|
int i_alpha; /**< transparency */
|
|
|
|
|
2017-10-23 10:17:50 +02:00
|
|
|
/* Parameters for text regions (p_picture to be rendered) */
|
2015-04-06 18:44:40 +02:00
|
|
|
text_segment_t *p_text; /**< subtitle text, made of a list of segments */
|
2017-10-23 10:17:50 +02:00
|
|
|
int i_text_align; /**< alignment flags of region content */
|
2015-08-24 11:11:28 +02:00
|
|
|
bool b_noregionbg; /**< render background under text only */
|
2015-08-17 15:19:02 +02:00
|
|
|
bool b_gridmode; /** if the decoder sends row/cols based output */
|
2017-06-26 14:09:02 +02:00
|
|
|
bool b_balanced_text; /** try to balance wrapped text lines */
|
2017-11-12 14:54:35 +01:00
|
|
|
int i_max_width; /** horizontal rendering/cropping target/limit */
|
|
|
|
int i_max_height; /** vertical rendering/cropping target/limit */
|
2009-05-16 19:23:34 +02:00
|
|
|
|
2018-11-22 13:30:02 +01:00
|
|
|
vlc_rational_t zoom_h;
|
|
|
|
vlc_rational_t zoom_v;
|
|
|
|
|
2009-05-16 19:23:34 +02:00
|
|
|
subpicture_region_t *p_next; /**< next region in the list */
|
|
|
|
subpicture_region_private_t *p_private; /**< Private data for spu_t *only* */
|
|
|
|
};
|
|
|
|
|
2018-07-13 14:50:15 +02:00
|
|
|
struct vlc_spu_highlight_t
|
|
|
|
{
|
|
|
|
int x_start;
|
|
|
|
int x_end;
|
|
|
|
int y_start;
|
|
|
|
int y_end;
|
|
|
|
video_palette_t palette;
|
|
|
|
};
|
|
|
|
|
2009-05-16 19:23:34 +02:00
|
|
|
/* Subpicture region position flags */
|
2015-04-06 14:39:21 +02:00
|
|
|
#define SUBPICTURE_ALIGN_LEFT 0x1
|
|
|
|
#define SUBPICTURE_ALIGN_RIGHT 0x2
|
|
|
|
#define SUBPICTURE_ALIGN_TOP 0x4
|
|
|
|
#define SUBPICTURE_ALIGN_BOTTOM 0x8
|
2009-05-16 19:23:34 +02:00
|
|
|
#define SUBPICTURE_ALIGN_MASK ( SUBPICTURE_ALIGN_LEFT|SUBPICTURE_ALIGN_RIGHT| \
|
2017-10-23 10:17:50 +02:00
|
|
|
SUBPICTURE_ALIGN_TOP |SUBPICTURE_ALIGN_BOTTOM )
|
2009-05-16 19:23:34 +02:00
|
|
|
/**
|
|
|
|
* This function will create a new subpicture region.
|
|
|
|
*
|
|
|
|
* You must use subpicture_region_Delete to destroy it.
|
|
|
|
*/
|
2011-05-07 13:06:21 +02:00
|
|
|
VLC_API subpicture_region_t * subpicture_region_New( const video_format_t *p_fmt );
|
2009-05-16 19:23:34 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This function will destroy a subpicture region allocated by
|
|
|
|
* subpicture_region_New.
|
|
|
|
*
|
|
|
|
* You may give it NULL.
|
|
|
|
*/
|
2011-05-07 13:06:21 +02:00
|
|
|
VLC_API void subpicture_region_Delete( subpicture_region_t *p_region );
|
2009-05-16 19:23:34 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This function will destroy a list of subpicture regions allocated by
|
|
|
|
* subpicture_region_New.
|
|
|
|
*
|
|
|
|
* Provided for convenience.
|
|
|
|
*/
|
2011-05-07 13:06:21 +02:00
|
|
|
VLC_API void subpicture_region_ChainDelete( subpicture_region_t *p_head );
|
2009-05-16 19:23:34 +02:00
|
|
|
|
2015-04-06 18:49:15 +02:00
|
|
|
/**
|
|
|
|
* This function will copy a subpicture region to a new allocated one
|
|
|
|
* and transfer all the properties
|
|
|
|
*
|
|
|
|
* Provided for convenience.
|
|
|
|
*/
|
|
|
|
VLC_API subpicture_region_t *subpicture_region_Copy( subpicture_region_t *p_region );
|
|
|
|
|
2010-04-29 21:16:25 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
typedef struct
|
|
|
|
{
|
2017-01-11 14:01:35 +01:00
|
|
|
/** Optional pre update callback, usually useful on video format change.
|
|
|
|
* Will skip pf_update on VLC_SUCCESS, or will delete every region before
|
|
|
|
* the call to pf_update */
|
2010-04-29 21:16:25 +02:00
|
|
|
int (*pf_validate)( subpicture_t *,
|
|
|
|
bool has_src_changed, const video_format_t *p_fmt_src,
|
|
|
|
bool has_dst_changed, const video_format_t *p_fmt_dst,
|
2018-06-22 13:19:24 +02:00
|
|
|
vlc_tick_t);
|
2017-01-11 14:01:35 +01:00
|
|
|
/** Mandatory callback called after pf_validate and doing
|
|
|
|
* the main job of creating the subpicture regions for the
|
|
|
|
* current video_format */
|
2010-04-29 21:16:25 +02:00
|
|
|
void (*pf_update) ( subpicture_t *,
|
|
|
|
const video_format_t *p_fmt_src,
|
|
|
|
const video_format_t *p_fmt_dst,
|
2018-06-22 13:19:24 +02:00
|
|
|
vlc_tick_t );
|
2017-01-11 14:01:35 +01:00
|
|
|
/** Optional callback for subpicture private data cleanup */
|
2010-04-29 21:16:25 +02:00
|
|
|
void (*pf_destroy) ( subpicture_t * );
|
2018-05-14 20:56:36 +02:00
|
|
|
void *p_sys;
|
2010-04-29 21:16:25 +02:00
|
|
|
} subpicture_updater_t;
|
|
|
|
|
|
|
|
typedef struct subpicture_private_t subpicture_private_t;
|
|
|
|
|
2009-05-16 19:23:34 +02:00
|
|
|
/**
|
|
|
|
* Video subtitle
|
|
|
|
*
|
|
|
|
* Any subtitle destined to be displayed by a video output thread should
|
|
|
|
* be stored in this structure from it's creation to it's effective display.
|
|
|
|
* Subtitle type and flags should only be modified by the output thread. Note
|
|
|
|
* that an empty subtitle MUST have its flags set to 0.
|
|
|
|
*/
|
|
|
|
struct subpicture_t
|
|
|
|
{
|
|
|
|
/** \name Channel ID */
|
|
|
|
/**@{*/
|
2019-06-03 15:11:30 +02:00
|
|
|
ssize_t i_channel; /**< subpicture channel ID */
|
2009-05-16 19:23:34 +02:00
|
|
|
/**@}*/
|
|
|
|
|
|
|
|
/** \name Type and flags
|
|
|
|
Should NOT be modified except by the vout thread */
|
|
|
|
/**@{*/
|
|
|
|
int64_t i_order; /** an increasing unique number */
|
|
|
|
subpicture_t * p_next; /**< next subtitle to be displayed */
|
|
|
|
/**@}*/
|
|
|
|
|
2009-12-22 15:46:54 +01:00
|
|
|
subpicture_region_t *p_region; /**< region list composing this subtitle */
|
|
|
|
|
2009-05-16 19:23:34 +02:00
|
|
|
/** \name Date properties */
|
|
|
|
/**@{*/
|
2018-06-22 13:19:24 +02:00
|
|
|
vlc_tick_t i_start; /**< beginning of display date */
|
|
|
|
vlc_tick_t i_stop; /**< end of display date */
|
2009-05-16 19:23:34 +02:00
|
|
|
bool b_ephemer; /**< If this flag is set to true the subtitle
|
2016-04-02 16:50:31 +02:00
|
|
|
will be displayed until the next one appear */
|
2009-05-16 19:23:34 +02:00
|
|
|
bool b_fade; /**< enable fading */
|
|
|
|
/**@}*/
|
|
|
|
|
|
|
|
/** \name Display properties
|
|
|
|
* These properties are only indicative and may be
|
|
|
|
* changed by the video output thread, or simply ignored depending of the
|
|
|
|
* subtitle type. */
|
|
|
|
/**@{*/
|
|
|
|
bool b_subtitle; /**< the picture is a movie subtitle */
|
|
|
|
bool b_absolute; /**< position is absolute */
|
2009-12-22 15:46:54 +01:00
|
|
|
int i_original_picture_width; /**< original width of the movie */
|
|
|
|
int i_original_picture_height;/**< original height of the movie */
|
2009-05-16 19:23:34 +02:00
|
|
|
int i_alpha; /**< transparency */
|
|
|
|
/**@}*/
|
|
|
|
|
2010-04-29 21:16:25 +02:00
|
|
|
subpicture_updater_t updater;
|
2009-05-16 19:23:34 +02:00
|
|
|
|
2010-04-29 21:16:25 +02:00
|
|
|
subpicture_private_t *p_private; /* Reserved to the core */
|
2009-05-16 19:23:34 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This function create a new empty subpicture.
|
|
|
|
*
|
|
|
|
* You must use subpicture_Delete to destroy it.
|
|
|
|
*/
|
2011-05-07 13:06:21 +02:00
|
|
|
VLC_API subpicture_t * subpicture_New( const subpicture_updater_t * );
|
2009-05-16 19:23:34 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This function delete a subpicture created by subpicture_New.
|
|
|
|
* You may give it NULL.
|
|
|
|
*/
|
2011-05-07 13:06:21 +02:00
|
|
|
VLC_API void subpicture_Delete( subpicture_t *p_subpic );
|
2009-05-16 19:23:34 +02:00
|
|
|
|
2009-05-30 23:07:10 +02:00
|
|
|
/**
|
|
|
|
* This function will create a subpicture having one region in the requested
|
|
|
|
* chroma showing the given picture.
|
|
|
|
*
|
|
|
|
* The picture_t given is not released nor used inside the
|
|
|
|
* returned subpicture_t.
|
|
|
|
*/
|
2011-05-07 13:06:21 +02:00
|
|
|
VLC_API subpicture_t * subpicture_NewFromPicture( vlc_object_t *, picture_t *, vlc_fourcc_t i_chroma );
|
2009-05-30 23:07:10 +02:00
|
|
|
|
2010-05-31 20:28:55 +02:00
|
|
|
/**
|
|
|
|
* This function will update the content of a subpicture created with
|
|
|
|
* a non NULL subpicture_updater_t.
|
|
|
|
*/
|
2018-06-22 13:19:24 +02:00
|
|
|
VLC_API void subpicture_Update( subpicture_t *, const video_format_t *src, const video_format_t *, vlc_tick_t );
|
2010-05-31 20:28:55 +02:00
|
|
|
|
2015-06-24 19:22:25 +02:00
|
|
|
/**
|
|
|
|
* This function will blend a given subpicture onto a picture.
|
|
|
|
*
|
|
|
|
* The subpicture and all its region must:
|
|
|
|
* - be absolute.
|
|
|
|
* - not be ephemere.
|
|
|
|
* - not have the fade flag.
|
|
|
|
* - contains only picture (no text rendering).
|
2016-04-02 16:50:31 +02:00
|
|
|
* \return the number of region(s) successfully blent
|
2015-06-24 19:22:25 +02:00
|
|
|
*/
|
2019-09-17 14:56:37 +02:00
|
|
|
VLC_API unsigned picture_BlendSubpicture( picture_t *, vlc_blender_t *, subpicture_t * );
|
2015-06-24 19:22:25 +02:00
|
|
|
|
2009-05-16 19:23:34 +02:00
|
|
|
/**@}*/
|
|
|
|
|
2018-04-26 11:33:01 +02:00
|
|
|
#endif /* _VLC_SUBPICTURE_H */
|