1
mirror of https://code.videolan.org/videolan/vlc synced 2024-09-24 20:48:52 +02:00
vlc/include/vlc_input.h

199 lines
5.6 KiB
C
Raw Normal View History

2004-06-22 21:29:37 +02:00
/*****************************************************************************
* vlc_input.h: Core input structures
2004-06-22 21:29:37 +02:00
*****************************************************************************
* Copyright (C) 1999-2015 VLC authors and VideoLAN
2004-06-22 21:29:37 +02:00
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Laurent Aimar <fenrir@via.ecp.fr>
*
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
2004-06-22 21:29:37 +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.
2004-06-22 21:29:37 +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.
2004-06-22 21:29:37 +02:00
*****************************************************************************/
2010-02-07 11:47:41 +01:00
#ifndef VLC_INPUT_H
#define VLC_INPUT_H 1
2004-06-22 21:29:37 +02:00
2008-08-11 17:31:57 +02:00
/**
* \defgroup input Input
* \ingroup vlc
* Input thread
* @{
2008-08-11 17:31:57 +02:00
* \file
* Input thread interface
2008-08-11 17:31:57 +02:00
*/
#include <vlc_es.h>
#include <vlc_meta.h>
2007-03-23 20:55:17 +01:00
#include <vlc_epg.h>
#include <vlc_input_item.h>
2017-06-23 12:33:37 +02:00
#include <vlc_vout.h>
#include <vlc_vout_osd.h>
#include <string.h>
typedef struct input_resource_t input_resource_t;
2004-06-22 21:29:37 +02:00
/*****************************************************************************
* Seek point: (generalisation of chapters)
*****************************************************************************/
struct seekpoint_t
{
vlc_tick_t i_time_offset;
2004-06-22 21:29:37 +02:00
char *psz_name;
};
static inline seekpoint_t *vlc_seekpoint_New( void )
{
seekpoint_t *point = (seekpoint_t*)malloc( sizeof( seekpoint_t ) );
2015-04-28 15:09:57 +02:00
if( !point )
return NULL;
point->i_time_offset = -1;
2004-06-22 21:29:37 +02:00
point->psz_name = NULL;
return point;
}
static inline void vlc_seekpoint_Delete( seekpoint_t *point )
{
if( !point ) return;
free( point->psz_name );
2004-06-22 21:29:37 +02:00
free( point );
}
2010-03-09 22:48:58 +01:00
static inline seekpoint_t *vlc_seekpoint_Duplicate( const seekpoint_t *src )
2004-06-22 21:29:37 +02:00
{
seekpoint_t *point = vlc_seekpoint_New();
if( likely(point) )
{
if( src->psz_name ) point->psz_name = strdup( src->psz_name );
point->i_time_offset = src->i_time_offset;
}
2004-06-22 21:29:37 +02:00
return point;
}
/*****************************************************************************
* Title:
*****************************************************************************/
/* input_title_t.i_flags field */
#define INPUT_TITLE_MENU 0x01 /* Menu title */
#define INPUT_TITLE_INTERACTIVE 0x02 /* Interactive title. Playback position has no meaning. */
#define INPUT_TITLE_MAIN 0x04 /* Main title */
typedef struct input_title_t
2004-06-22 21:29:37 +02:00
{
char *psz_name;
vlc_tick_t i_length; /* Length(microsecond) if known, else 0 */
2004-06-22 21:29:37 +02:00
unsigned i_flags; /* Is it a menu or a normal entry */
2004-06-22 21:29:37 +02:00
/* Title seekpoint */
int i_seekpoint;
seekpoint_t **seekpoint;
} input_title_t;
2006-10-21 19:28:22 +02:00
static inline input_title_t *vlc_input_title_New(void)
2004-06-22 21:29:37 +02:00
{
input_title_t *t = (input_title_t*)malloc( sizeof( input_title_t ) );
2015-04-28 15:09:57 +02:00
if( !t )
return NULL;
2004-06-22 21:29:37 +02:00
t->psz_name = NULL;
t->i_flags = 0;
2004-06-22 21:29:37 +02:00
t->i_length = 0;
t->i_seekpoint = 0;
t->seekpoint = NULL;
return t;
}
2004-06-22 21:29:37 +02:00
static inline void vlc_input_title_Delete( input_title_t *t )
{
int i;
if( t == NULL )
return;
free( t->psz_name );
2004-06-22 21:29:37 +02:00
for( i = 0; i < t->i_seekpoint; i++ )
vlc_seekpoint_Delete( t->seekpoint[i] );
free( t->seekpoint );
2004-06-22 21:29:37 +02:00
free( t );
}
2010-06-12 07:52:59 +02:00
static inline input_title_t *vlc_input_title_Duplicate( const input_title_t *t )
2004-06-22 21:29:37 +02:00
{
input_title_t *dup = vlc_input_title_New( );
if( dup == NULL) return NULL;
2004-06-22 21:29:37 +02:00
if( t->psz_name ) dup->psz_name = strdup( t->psz_name );
dup->i_flags = t->i_flags;
2004-06-22 21:29:37 +02:00
dup->i_length = t->i_length;
if( t->i_seekpoint > 0 )
{
2017-11-12 11:42:13 +01:00
dup->seekpoint = (seekpoint_t**)vlc_alloc( t->i_seekpoint, sizeof(seekpoint_t*) );
if( likely(dup->seekpoint) )
2004-06-22 21:29:37 +02:00
{
2016-06-22 11:55:35 +02:00
for( int i = 0; i < t->i_seekpoint; i++ )
dup->seekpoint[i] = vlc_seekpoint_Duplicate( t->seekpoint[i] );
dup->i_seekpoint = t->i_seekpoint;
2004-06-22 21:29:37 +02:00
}
}
return dup;
}
2008-06-14 10:00:42 +02:00
/*****************************************************************************
* Attachments
*****************************************************************************/
struct input_attachment_t
{
char *psz_name;
char *psz_mime;
char *psz_description;
2004-06-22 21:29:37 +02:00
size_t i_data;
void *p_data;
};
2008-06-14 10:00:42 +02:00
VLC_API void vlc_input_attachment_Release( input_attachment_t *a );
VLC_API input_attachment_t *vlc_input_attachment_New( const char *psz_name,
const char *psz_mime,
const char *psz_description,
const void *p_data,
size_t i_data );
VLC_API input_attachment_t *vlc_input_attachment_Hold( input_attachment_t *a );
2008-06-14 10:00:42 +02:00
/**
* Input rate.
*
* It is an float used by the variable "rate" in the
* range [INPUT_RATE_MIN, INPUT_RATE_MAX]
* the default value being 1.f. It represents the ratio of playback speed to
* nominal speed (bigger is faster).
*/
/**
* Minimal rate value
*/
#define INPUT_RATE_MIN 0.03125f
/**
* Maximal rate value
*/
#define INPUT_RATE_MAX 31.25f
/** @} */
2004-06-22 21:29:37 +02:00
#endif