* ALL: the first libvlc commit.
As for video output 4, this breaks almost everything, but I'll slowly
do what remains to be fixed during the weekend.
Changes in vlc:
===============
* vlc is now a very small program (20 lines) which uses the libvlc API;
it is quite simple for the moment but can be extended in the future.
* interfaces, decoders, video outputs, etc. are now almost the same
objects (yes, I know, this is C++ redone in C) and are structured in
a tree. More about this later, but basically it allows the following
nice features:
- several interfaces
- several playlists with several outputs
- input plugins spawning helper interfaces (will be used for DVD menus)
- anything spawning anything; I swear there are useful uses for this!
* libvlc can be used in other programs; I'm currently writing a Mozilla
plugin for my employer.
Things currently broken:
========================
* most interfaces, most ports
* the playlist handling (almost finished rewriting this though). This means
no file can be played from the GUI, you need to use the commandline. This
also means it segfaults at EOF, when exiting the program, and it sometimes
refuses to open a file when asked to.
2002-06-01 14:32:02 +02:00
|
|
|
/*****************************************************************************
|
2008-05-31 21:30:46 +02:00
|
|
|
* libvlc.c: libvlc instances creation and deletion, interfaces handling
|
* ALL: the first libvlc commit.
As for video output 4, this breaks almost everything, but I'll slowly
do what remains to be fixed during the weekend.
Changes in vlc:
===============
* vlc is now a very small program (20 lines) which uses the libvlc API;
it is quite simple for the moment but can be extended in the future.
* interfaces, decoders, video outputs, etc. are now almost the same
objects (yes, I know, this is C++ redone in C) and are structured in
a tree. More about this later, but basically it allows the following
nice features:
- several interfaces
- several playlists with several outputs
- input plugins spawning helper interfaces (will be used for DVD menus)
- anything spawning anything; I swear there are useful uses for this!
* libvlc can be used in other programs; I'm currently writing a Mozilla
plugin for my employer.
Things currently broken:
========================
* most interfaces, most ports
* the playlist handling (almost finished rewriting this though). This means
no file can be played from the GUI, you need to use the commandline. This
also means it segfaults at EOF, when exiting the program, and it sometimes
refuses to open a file when asked to.
2002-06-01 14:32:02 +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
|
|
|
* Copyright (C) 1998-2008 VLC authors and VideoLAN
|
* ALL: the first libvlc commit.
As for video output 4, this breaks almost everything, but I'll slowly
do what remains to be fixed during the weekend.
Changes in vlc:
===============
* vlc is now a very small program (20 lines) which uses the libvlc API;
it is quite simple for the moment but can be extended in the future.
* interfaces, decoders, video outputs, etc. are now almost the same
objects (yes, I know, this is C++ redone in C) and are structured in
a tree. More about this later, but basically it allows the following
nice features:
- several interfaces
- several playlists with several outputs
- input plugins spawning helper interfaces (will be used for DVD menus)
- anything spawning anything; I swear there are useful uses for this!
* libvlc can be used in other programs; I'm currently writing a Mozilla
plugin for my employer.
Things currently broken:
========================
* most interfaces, most ports
* the playlist handling (almost finished rewriting this though). This means
no file can be played from the GUI, you need to use the commandline. This
also means it segfaults at EOF, when exiting the program, and it sometimes
refuses to open a file when asked to.
2002-06-01 14:32:02 +02:00
|
|
|
*
|
|
|
|
* Authors: Vincent Seguin <seguin@via.ecp.fr>
|
|
|
|
* Samuel Hocevar <sam@zoy.org>
|
2004-09-26 19:54:56 +02:00
|
|
|
* Gildas Bazin <gbazin@videolan.org>
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
* Derk-Jan Hartman <hartman at videolan dot org>
|
2019-09-04 21:10:51 +02:00
|
|
|
* Rémi Denis-Courmont
|
* ALL: the first libvlc commit.
As for video output 4, this breaks almost everything, but I'll slowly
do what remains to be fixed during the weekend.
Changes in vlc:
===============
* vlc is now a very small program (20 lines) which uses the libvlc API;
it is quite simple for the moment but can be extended in the future.
* interfaces, decoders, video outputs, etc. are now almost the same
objects (yes, I know, this is C++ redone in C) and are structured in
a tree. More about this later, but basically it allows the following
nice features:
- several interfaces
- several playlists with several outputs
- input plugins spawning helper interfaces (will be used for DVD menus)
- anything spawning anything; I swear there are useful uses for this!
* libvlc can be used in other programs; I'm currently writing a Mozilla
plugin for my employer.
Things currently broken:
========================
* most interfaces, most ports
* the playlist handling (almost finished rewriting this though). This means
no file can be played from the GUI, you need to use the commandline. This
also means it segfaults at EOF, when exiting the program, and it sometimes
refuses to open a file when asked to.
2002-06-01 14:32:02 +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
|
|
|
* 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
|
* ALL: the first libvlc commit.
As for video output 4, this breaks almost everything, but I'll slowly
do what remains to be fixed during the weekend.
Changes in vlc:
===============
* vlc is now a very small program (20 lines) which uses the libvlc API;
it is quite simple for the moment but can be extended in the future.
* interfaces, decoders, video outputs, etc. are now almost the same
objects (yes, I know, this is C++ redone in C) and are structured in
a tree. More about this later, but basically it allows the following
nice features:
- several interfaces
- several playlists with several outputs
- input plugins spawning helper interfaces (will be used for DVD menus)
- anything spawning anything; I swear there are useful uses for this!
* libvlc can be used in other programs; I'm currently writing a Mozilla
plugin for my employer.
Things currently broken:
========================
* most interfaces, most ports
* the playlist handling (almost finished rewriting this though). This means
no file can be played from the GUI, you need to use the commandline. This
also means it segfaults at EOF, when exiting the program, and it sometimes
refuses to open a file when asked to.
2002-06-01 14:32:02 +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.
|
* ALL: the first libvlc commit.
As for video output 4, this breaks almost everything, but I'll slowly
do what remains to be fixed during the weekend.
Changes in vlc:
===============
* vlc is now a very small program (20 lines) which uses the libvlc API;
it is quite simple for the moment but can be extended in the future.
* interfaces, decoders, video outputs, etc. are now almost the same
objects (yes, I know, this is C++ redone in C) and are structured in
a tree. More about this later, but basically it allows the following
nice features:
- several interfaces
- several playlists with several outputs
- input plugins spawning helper interfaces (will be used for DVD menus)
- anything spawning anything; I swear there are useful uses for this!
* libvlc can be used in other programs; I'm currently writing a Mozilla
plugin for my employer.
Things currently broken:
========================
* most interfaces, most ports
* the playlist handling (almost finished rewriting this though). This means
no file can be played from the GUI, you need to use the commandline. This
also means it segfaults at EOF, when exiting the program, and it sometimes
refuses to open a file when asked to.
2002-06-01 14:32:02 +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.
|
* ALL: the first libvlc commit.
As for video output 4, this breaks almost everything, but I'll slowly
do what remains to be fixed during the weekend.
Changes in vlc:
===============
* vlc is now a very small program (20 lines) which uses the libvlc API;
it is quite simple for the moment but can be extended in the future.
* interfaces, decoders, video outputs, etc. are now almost the same
objects (yes, I know, this is C++ redone in C) and are structured in
a tree. More about this later, but basically it allows the following
nice features:
- several interfaces
- several playlists with several outputs
- input plugins spawning helper interfaces (will be used for DVD menus)
- anything spawning anything; I swear there are useful uses for this!
* libvlc can be used in other programs; I'm currently writing a Mozilla
plugin for my employer.
Things currently broken:
========================
* most interfaces, most ports
* the playlist handling (almost finished rewriting this though). This means
no file can be played from the GUI, you need to use the commandline. This
also means it segfaults at EOF, when exiting the program, and it sometimes
refuses to open a file when asked to.
2002-06-01 14:32:02 +02:00
|
|
|
*****************************************************************************/
|
|
|
|
|
2008-05-31 21:30:46 +02:00
|
|
|
/** \file
|
|
|
|
* This file contains functions to create and destroy libvlc instances
|
|
|
|
*/
|
* ALL: the first libvlc commit.
As for video output 4, this breaks almost everything, but I'll slowly
do what remains to be fixed during the weekend.
Changes in vlc:
===============
* vlc is now a very small program (20 lines) which uses the libvlc API;
it is quite simple for the moment but can be extended in the future.
* interfaces, decoders, video outputs, etc. are now almost the same
objects (yes, I know, this is C++ redone in C) and are structured in
a tree. More about this later, but basically it allows the following
nice features:
- several interfaces
- several playlists with several outputs
- input plugins spawning helper interfaces (will be used for DVD menus)
- anything spawning anything; I swear there are useful uses for this!
* libvlc can be used in other programs; I'm currently writing a Mozilla
plugin for my employer.
Things currently broken:
========================
* most interfaces, most ports
* the playlist handling (almost finished rewriting this though). This means
no file can be played from the GUI, you need to use the commandline. This
also means it segfaults at EOF, when exiting the program, and it sometimes
refuses to open a file when asked to.
2002-06-01 14:32:02 +02:00
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* Preamble
|
|
|
|
*****************************************************************************/
|
2008-01-23 22:50:58 +01:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2008-05-31 20:56:22 +02:00
|
|
|
#include <vlc_common.h>
|
2011-08-30 22:40:14 +02:00
|
|
|
#include "../lib/libvlc_internal.h"
|
* ALL: the first libvlc commit.
As for video output 4, this breaks almost everything, but I'll slowly
do what remains to be fixed during the weekend.
Changes in vlc:
===============
* vlc is now a very small program (20 lines) which uses the libvlc API;
it is quite simple for the moment but can be extended in the future.
* interfaces, decoders, video outputs, etc. are now almost the same
objects (yes, I know, this is C++ redone in C) and are structured in
a tree. More about this later, but basically it allows the following
nice features:
- several interfaces
- several playlists with several outputs
- input plugins spawning helper interfaces (will be used for DVD menus)
- anything spawning anything; I swear there are useful uses for this!
* libvlc can be used in other programs; I'm currently writing a Mozilla
plugin for my employer.
Things currently broken:
========================
* most interfaces, most ports
* the playlist handling (almost finished rewriting this though). This means
no file can be played from the GUI, you need to use the commandline. This
also means it segfaults at EOF, when exiting the program, and it sometimes
refuses to open a file when asked to.
2002-06-01 14:32:02 +02:00
|
|
|
|
2008-05-31 21:30:46 +02:00
|
|
|
#include "modules/modules.h"
|
|
|
|
#include "config/configuration.h"
|
2018-06-25 17:45:25 +02:00
|
|
|
#include "preparser/preparser.h"
|
2018-05-17 11:37:56 +02:00
|
|
|
#include "media_source/media_source.h"
|
2006-09-15 18:18:08 +02:00
|
|
|
|
2008-05-31 21:30:46 +02:00
|
|
|
#include <stdio.h> /* sprintf() */
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h> /* free() */
|
2013-12-28 17:46:52 +01:00
|
|
|
#include <errno.h>
|
2006-09-15 18:18:08 +02:00
|
|
|
|
2010-02-28 14:25:17 +01:00
|
|
|
#include "config/vlc_getopt.h"
|
2002-08-20 20:08:51 +02:00
|
|
|
|
2018-09-27 11:07:03 +02:00
|
|
|
#include <vlc_playlist.h>
|
2008-05-31 21:30:46 +02:00
|
|
|
#include <vlc_interface.h>
|
Changes to the libvlc API:
* ./include/vlc/vlc.h: changed the naming conventions for libvlc. Now
exported functions start with VLC_ instead of vlc_ to avoid conflicts.
* ./include/vlc/vlc.h: removed the vlc_object_t, vlc_list_t, vlc_error_t
and vlc_t types; they are now internal types only.
* ./include/vlc/vlc.h: merged the reentrant and non-reentrant libvlc
calls. In non-reentrant mode, we just use 0 as the first argument. In
reentrant mode, we use an object's ID. (see below)
Internal changes:
* ./src/libvlc.c, ./src/misc/objects.c: instead of manipulating vlc_object_t
pointers, we manipulate their i_object_id. When needed, an object is
retrieved using vlc_object_get (I hope the lookup isn't too expensive,
that's why I designed the pp_objects layout to allow log2(n) seeks).
* ./src/misc/objects.c: activated the per-object variable storage. Unused
yet, unless you want to try "getfoo" and "setfoo blablah" in vlc -I rc.
* ./include/vlc_objects.h: moved the vlc_object_t and vlc_list_t definitions
here.
Misc:
* ./src/vlc.c, ./mozilla/vlcshell.cpp: removed inclusion of config.h in
code portions not part of libvlc; it was just required for the
COPYRIGHT_MESSAGE string which is now available from VLC_Version().
2002-10-12 00:32:56 +02:00
|
|
|
|
2017-08-03 15:10:36 +02:00
|
|
|
#include <vlc_actions.h>
|
2008-05-31 21:30:46 +02:00
|
|
|
#include <vlc_charset.h>
|
2016-02-04 11:40:38 +01:00
|
|
|
#include <vlc_dialog.h>
|
2016-02-24 11:14:05 +01:00
|
|
|
#include <vlc_keystore.h>
|
2010-02-07 14:18:02 +01:00
|
|
|
#include <vlc_fs.h>
|
2009-09-22 17:21:14 +02:00
|
|
|
#include <vlc_cpu.h>
|
2009-10-05 21:58:46 +02:00
|
|
|
#include <vlc_url.h>
|
2010-07-27 21:11:58 +02:00
|
|
|
#include <vlc_modules.h>
|
2018-06-18 15:19:53 +02:00
|
|
|
#include <vlc_media_library.h>
|
2018-10-04 17:10:16 +02:00
|
|
|
#include <vlc_thumbnailer.h>
|
src/libvlc.c,include/vlc/vlc.h, include/variables.h: added a new a API to libvlc called VLC_VariableType, this API allows to retrieve the type of a VLC variable. this API is very useful for binding with highlevel languages, such as javascript, VBScript, etc... which allow for weakly typed variables such as Javascript. in order to support the VLC_VariableType API, i've had to move the variable type definitions from variables.h to vlc/vlc.h
vlccontrol.cpp, axvlc.idl, axvlc.tlb, axvlc_idl.h: added a getVariable and setVariable to provide support for VLC_GetVariable and VLC_SetVariable respectively,and requires the new VLC_VariableType API.
main.cpp, viewobject.h, viewobject.cpp: support for advise on viewobject
2005-05-11 18:56:46 +02:00
|
|
|
|
2008-05-31 21:30:46 +02:00
|
|
|
#include "libvlc.h"
|
src/libvlc.c,include/vlc/vlc.h, include/variables.h: added a new a API to libvlc called VLC_VariableType, this API allows to retrieve the type of a VLC variable. this API is very useful for binding with highlevel languages, such as javascript, VBScript, etc... which allow for weakly typed variables such as Javascript. in order to support the VLC_VariableType API, i've had to move the variable type definitions from variables.h to vlc/vlc.h
vlccontrol.cpp, axvlc.idl, axvlc.tlb, axvlc_idl.h: added a getVariable and setVariable to provide support for VLC_GetVariable and VLC_SetVariable respectively,and requires the new VLC_VariableType API.
main.cpp, viewobject.h, viewobject.cpp: support for advise on viewobject
2005-05-11 18:56:46 +02:00
|
|
|
|
2008-05-31 21:30:46 +02:00
|
|
|
#include <vlc_vlm.h>
|
2006-09-15 18:18:08 +02:00
|
|
|
|
2008-05-31 21:30:46 +02:00
|
|
|
#include <assert.h>
|
2006-09-15 18:18:08 +02:00
|
|
|
|
2004-01-06 09:50:20 +01:00
|
|
|
/*****************************************************************************
|
2008-05-31 21:30:46 +02:00
|
|
|
* Local prototypes
|
2004-01-06 09:50:20 +01:00
|
|
|
*****************************************************************************/
|
2010-03-29 22:41:32 +02:00
|
|
|
static void GetFilenames ( libvlc_int_t *, unsigned, const char *const [] );
|
2008-10-05 10:28:32 +02:00
|
|
|
|
2008-05-31 21:30:46 +02:00
|
|
|
/**
|
2014-05-12 20:14:49 +02:00
|
|
|
* Allocate a blank libvlc instance, also setting the exit handler.
|
|
|
|
* Vlc's threading system must have been initialized first
|
2008-05-31 21:30:46 +02:00
|
|
|
*/
|
|
|
|
libvlc_int_t * libvlc_InternalCreate( void )
|
|
|
|
{
|
|
|
|
libvlc_int_t *p_libvlc;
|
|
|
|
libvlc_priv_t *priv;
|
|
|
|
|
|
|
|
/* Allocate a libvlc instance object */
|
2017-02-06 21:46:21 +01:00
|
|
|
p_libvlc = (vlc_custom_create)( NULL, sizeof (*priv), "libvlc" );
|
2008-05-31 21:30:46 +02:00
|
|
|
if( p_libvlc == NULL )
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
priv = libvlc_priv (p_libvlc);
|
2019-03-19 12:25:05 +01:00
|
|
|
vlc_mutex_init(&priv->lock);
|
2019-03-08 18:31:30 +01:00
|
|
|
priv->interfaces = NULL;
|
2018-09-27 11:07:03 +02:00
|
|
|
priv->main_playlist = NULL;
|
2008-05-31 21:30:46 +02:00
|
|
|
priv->p_vlm = NULL;
|
2018-05-17 11:37:56 +02:00
|
|
|
priv->media_source_provider = NULL;
|
2008-05-31 21:30:46 +02:00
|
|
|
|
2010-05-30 19:17:27 +02:00
|
|
|
vlc_ExitInit( &priv->exit );
|
2008-05-31 21:30:46 +02:00
|
|
|
|
|
|
|
return p_libvlc;
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-05-31 21:30:46 +02:00
|
|
|
* Initialize a libvlc instance
|
|
|
|
* This function initializes a previously allocated libvlc instance:
|
|
|
|
* - CPU detection
|
|
|
|
* - gettext initialization
|
|
|
|
* - message queue, module bank and playlist initialization
|
|
|
|
* - configuration and commandline parsing
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
*/
|
2008-05-31 21:30:46 +02:00
|
|
|
int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
|
2011-05-01 20:06:15 +02:00
|
|
|
const char *ppsz_argv[] )
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
{
|
2008-05-31 21:30:46 +02:00
|
|
|
libvlc_priv_t *priv = libvlc_priv (p_libvlc);
|
|
|
|
char * psz_modules = NULL;
|
|
|
|
char * psz_parser = NULL;
|
|
|
|
char * psz_control = NULL;
|
2009-09-25 12:47:28 +02:00
|
|
|
char *psz_val;
|
2016-09-20 16:56:35 +02:00
|
|
|
int i_ret = VLC_EGENERIC;
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
|
2018-11-18 15:50:30 +01:00
|
|
|
if (unlikely(vlc_LogPreinit(p_libvlc)))
|
|
|
|
return VLC_ENOMEM;
|
|
|
|
|
2008-05-31 21:30:46 +02:00
|
|
|
/* System specific initialization code */
|
2011-06-15 06:29:25 +02:00
|
|
|
system_Init();
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
|
2008-05-31 21:30:46 +02:00
|
|
|
/* Initialize the module bank and load the configuration of the
|
2013-12-07 00:57:11 +01:00
|
|
|
* core module. We need to do this at this stage to be able to display
|
|
|
|
* a short help if required by the user. (short help == core module
|
2008-05-31 21:30:46 +02:00
|
|
|
* options) */
|
2011-08-15 21:16:51 +02:00
|
|
|
module_InitBank ();
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
|
2011-08-21 13:13:40 +02:00
|
|
|
/* Get command line options that affect module loading. */
|
2010-03-29 22:52:21 +02:00
|
|
|
if( config_LoadCmdLine( p_libvlc, i_argc, ppsz_argv, NULL ) )
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
{
|
2011-08-15 21:16:51 +02:00
|
|
|
module_EndBank (false);
|
2008-05-31 21:30:46 +02:00
|
|
|
return VLC_EGENERIC;
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
}
|
2011-08-21 13:13:40 +02:00
|
|
|
|
2012-09-10 16:43:26 +02:00
|
|
|
vlc_threads_setup (p_libvlc);
|
2011-08-21 13:13:40 +02:00
|
|
|
|
|
|
|
/* Load the builtins and plugins into the module_bank.
|
|
|
|
* We have to do it before config_Load*() because this also gets the
|
|
|
|
* list of configuration options exported by each module and loads their
|
|
|
|
* default values. */
|
2018-03-10 21:15:36 +01:00
|
|
|
module_LoadPlugins (p_libvlc);
|
2011-08-21 13:13:40 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Override default configuration with config file settings
|
|
|
|
*/
|
|
|
|
if( !var_InheritBool( p_libvlc, "ignore-config" ) )
|
|
|
|
{
|
|
|
|
if( var_InheritBool( p_libvlc, "reset-config" ) )
|
|
|
|
config_SaveConfigFile( p_libvlc ); /* Save default config */
|
|
|
|
else
|
|
|
|
config_LoadConfigFile( p_libvlc );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Override configuration with command line settings
|
|
|
|
*/
|
|
|
|
int vlc_optind;
|
|
|
|
if( config_LoadCmdLine( p_libvlc, i_argc, ppsz_argv, &vlc_optind ) )
|
2016-09-20 16:56:35 +02:00
|
|
|
goto error;
|
2011-08-21 13:13:40 +02:00
|
|
|
|
2015-02-07 18:28:45 +01:00
|
|
|
vlc_LogInit(p_libvlc);
|
|
|
|
|
2011-08-21 13:19:24 +02:00
|
|
|
/*
|
|
|
|
* Support for gettext
|
|
|
|
*/
|
|
|
|
#if defined( ENABLE_NLS ) \
|
|
|
|
&& ( defined( HAVE_GETTEXT ) || defined( HAVE_INCLUDED_GETTEXT ) )
|
|
|
|
vlc_bindtextdomain (PACKAGE_NAME);
|
|
|
|
#endif
|
2009-04-18 02:32:46 +02:00
|
|
|
/*xgettext: Translate "C" to the language code: "fr", "en_GB", "nl", "ru"... */
|
2008-12-28 21:15:22 +01:00
|
|
|
msg_Dbg( p_libvlc, "translation test: code is \"%s\"", _("C") );
|
2008-12-28 21:06:14 +01:00
|
|
|
|
2011-08-22 19:06:12 +02:00
|
|
|
if (config_PrintHelp (VLC_OBJECT(p_libvlc)))
|
2011-08-21 13:30:11 +02:00
|
|
|
{
|
2016-09-20 16:56:35 +02:00
|
|
|
libvlc_InternalCleanup (p_libvlc);
|
2012-12-02 09:17:51 +01:00
|
|
|
exit(0);
|
2008-05-31 21:30:46 +02:00
|
|
|
}
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
|
2011-08-21 13:30:11 +02:00
|
|
|
#ifdef HAVE_DAEMON
|
|
|
|
/* Check for daemon mode */
|
|
|
|
if( var_InheritBool( p_libvlc, "daemon" ) )
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
{
|
2011-08-21 13:30:11 +02:00
|
|
|
if( daemon( 1, 0) != 0 )
|
|
|
|
{
|
|
|
|
msg_Err( p_libvlc, "Unable to fork vlc to daemon mode" );
|
2016-09-20 16:56:35 +02:00
|
|
|
goto error;
|
2011-08-21 13:30:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* lets check if we need to write the pidfile */
|
2014-01-01 17:38:19 +01:00
|
|
|
char *pidfile = var_InheritString( p_libvlc, "pidfile" );
|
|
|
|
if( pidfile != NULL )
|
2011-08-21 13:30:11 +02:00
|
|
|
{
|
2014-01-01 17:38:19 +01:00
|
|
|
FILE *stream = vlc_fopen( pidfile, "w" );
|
|
|
|
if( stream != NULL )
|
2011-08-21 13:30:11 +02:00
|
|
|
{
|
2014-01-01 17:38:19 +01:00
|
|
|
fprintf( stream, "%d", (int)getpid() );
|
|
|
|
fclose( stream );
|
|
|
|
msg_Dbg( p_libvlc, "written PID file %s", pidfile );
|
2011-08-21 13:30:11 +02:00
|
|
|
}
|
|
|
|
else
|
2014-01-01 17:38:19 +01:00
|
|
|
msg_Err( p_libvlc, "cannot write PID file %s: %s",
|
|
|
|
pidfile, vlc_strerror_c(errno) );
|
|
|
|
free( pidfile );
|
2011-08-21 13:30:11 +02:00
|
|
|
}
|
2014-01-01 17:38:19 +01:00
|
|
|
}
|
2011-08-21 13:30:11 +02:00
|
|
|
#endif
|
2008-05-31 21:30:46 +02:00
|
|
|
|
2016-09-20 16:56:35 +02:00
|
|
|
i_ret = VLC_ENOMEM;
|
|
|
|
|
2016-02-19 15:09:40 +01:00
|
|
|
if( libvlc_InternalDialogInit( p_libvlc ) != VLC_SUCCESS )
|
2016-09-20 16:56:35 +02:00
|
|
|
goto error;
|
2016-02-24 11:14:05 +01:00
|
|
|
if( libvlc_InternalKeystoreInit( p_libvlc ) != VLC_SUCCESS )
|
|
|
|
msg_Warn( p_libvlc, "memory keystore init failed" );
|
2016-02-04 11:40:38 +01:00
|
|
|
|
2011-08-19 22:15:08 +02:00
|
|
|
vlc_CPU_dump( VLC_OBJECT(p_libvlc) );
|
2008-05-31 21:30:46 +02:00
|
|
|
|
2018-06-18 15:19:53 +02:00
|
|
|
if( var_InheritBool( p_libvlc, "media-library") )
|
|
|
|
{
|
|
|
|
priv->p_media_library = libvlc_MlCreate( p_libvlc );
|
|
|
|
if ( priv->p_media_library == NULL )
|
|
|
|
msg_Warn( p_libvlc, "Media library initialization failed" );
|
|
|
|
}
|
|
|
|
|
2018-10-04 17:10:16 +02:00
|
|
|
priv->p_thumbnailer = vlc_thumbnailer_Create( VLC_OBJECT( p_libvlc ) );
|
|
|
|
if ( priv->p_thumbnailer == NULL )
|
|
|
|
msg_Warn( p_libvlc, "Failed to instantiate VLC thumbnailer" );
|
|
|
|
|
2008-05-31 21:30:46 +02:00
|
|
|
/*
|
|
|
|
* Initialize hotkey handling
|
|
|
|
*/
|
2017-08-03 15:10:36 +02:00
|
|
|
if( libvlc_InternalActionsInit( p_libvlc ) != VLC_SUCCESS )
|
2016-09-20 16:56:35 +02:00
|
|
|
goto error;
|
2008-05-31 21:30:46 +02:00
|
|
|
|
2013-12-31 19:25:21 +01:00
|
|
|
/*
|
|
|
|
* Meta data handling
|
|
|
|
*/
|
2018-06-25 17:45:25 +02:00
|
|
|
priv->parser = input_preparser_New(VLC_OBJECT(p_libvlc));
|
2016-09-20 16:56:35 +02:00
|
|
|
if( !priv->parser )
|
|
|
|
goto error;
|
2013-12-31 19:25:21 +01:00
|
|
|
|
2018-05-17 11:37:56 +02:00
|
|
|
priv->media_source_provider = vlc_media_source_provider_New( VLC_OBJECT( p_libvlc ) );
|
|
|
|
if( !priv->media_source_provider )
|
|
|
|
goto error;
|
|
|
|
|
2009-08-19 20:58:07 +02:00
|
|
|
/* variables for signalling creation of new files */
|
|
|
|
var_Create( p_libvlc, "snapshot-file", VLC_VAR_STRING );
|
|
|
|
var_Create( p_libvlc, "record-file", VLC_VAR_STRING );
|
|
|
|
|
2010-07-08 21:45:43 +02:00
|
|
|
/* some default internal settings */
|
2010-07-08 18:52:30 +02:00
|
|
|
var_Create( p_libvlc, "window", VLC_VAR_STRING );
|
2013-06-16 10:29:22 +02:00
|
|
|
/* NOTE: Because the playlist and interfaces start before this function
|
|
|
|
* returns control to the application (DESIGN BUG!), all these variables
|
|
|
|
* must be created (in place of libvlc_new()) and set to VLC defaults
|
|
|
|
* (in place of VLC main()) *here*. */
|
2010-07-08 21:45:43 +02:00
|
|
|
var_Create( p_libvlc, "user-agent", VLC_VAR_STRING );
|
2013-06-16 10:29:22 +02:00
|
|
|
var_SetString( p_libvlc, "user-agent",
|
|
|
|
"VLC media player (LibVLC "VERSION")" );
|
|
|
|
var_Create( p_libvlc, "http-user-agent", VLC_VAR_STRING );
|
|
|
|
var_SetString( p_libvlc, "http-user-agent",
|
|
|
|
"VLC/"PACKAGE_VERSION" LibVLC/"PACKAGE_VERSION );
|
2013-06-16 10:11:22 +02:00
|
|
|
var_Create( p_libvlc, "app-icon-name", VLC_VAR_STRING );
|
|
|
|
var_SetString( p_libvlc, "app-icon-name", PACKAGE_NAME );
|
|
|
|
var_Create( p_libvlc, "app-id", VLC_VAR_STRING );
|
|
|
|
var_SetString( p_libvlc, "app-id", "org.VideoLAN.VLC" );
|
|
|
|
var_Create( p_libvlc, "app-version", VLC_VAR_STRING );
|
|
|
|
var_SetString( p_libvlc, "app-version", PACKAGE_VERSION );
|
2010-07-08 18:52:30 +02:00
|
|
|
|
2010-03-05 22:14:56 +01:00
|
|
|
/* System specific configuration */
|
2010-03-29 22:49:08 +02:00
|
|
|
system_Configure( p_libvlc, i_argc - vlc_optind, ppsz_argv + vlc_optind );
|
2010-03-05 22:14:56 +01:00
|
|
|
|
2008-07-17 21:25:18 +02:00
|
|
|
#ifdef ENABLE_VLM
|
2008-05-31 21:30:46 +02:00
|
|
|
/* Initialize VLM if vlm-conf is specified */
|
2018-05-31 21:00:34 +02:00
|
|
|
psz_parser = var_InheritString( p_libvlc, "vlm-conf" );
|
2009-12-10 17:44:20 +01:00
|
|
|
if( psz_parser )
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
{
|
2018-05-31 21:00:34 +02:00
|
|
|
priv->p_vlm = vlm_New( p_libvlc, psz_parser );
|
2008-05-31 21:30:46 +02:00
|
|
|
if( !priv->p_vlm )
|
|
|
|
msg_Err( p_libvlc, "VLM initialization failed" );
|
2018-05-31 21:00:34 +02:00
|
|
|
free( psz_parser );
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
}
|
2008-05-31 21:30:46 +02:00
|
|
|
#endif
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
|
2008-05-31 21:30:46 +02:00
|
|
|
/*
|
|
|
|
* Load background interfaces
|
|
|
|
*/
|
2018-05-31 21:02:46 +02:00
|
|
|
psz_modules = var_InheritString( p_libvlc, "extraintf" );
|
|
|
|
psz_control = var_InheritString( p_libvlc, "control" );
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
|
2009-12-10 17:44:20 +01:00
|
|
|
if( psz_modules && psz_control )
|
2008-05-31 21:30:46 +02:00
|
|
|
{
|
2009-01-26 16:10:54 +01:00
|
|
|
char* psz_tmp;
|
|
|
|
if( asprintf( &psz_tmp, "%s:%s", psz_modules, psz_control ) != -1 )
|
|
|
|
{
|
|
|
|
free( psz_modules );
|
|
|
|
psz_modules = psz_tmp;
|
|
|
|
}
|
2008-05-31 21:30:46 +02:00
|
|
|
}
|
2009-12-10 17:44:20 +01:00
|
|
|
else if( psz_control )
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
{
|
2008-05-31 21:30:46 +02:00
|
|
|
free( psz_modules );
|
|
|
|
psz_modules = strdup( psz_control );
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
}
|
|
|
|
|
2008-05-31 21:30:46 +02:00
|
|
|
psz_parser = psz_modules;
|
|
|
|
while ( psz_parser && *psz_parser )
|
|
|
|
{
|
|
|
|
char *psz_module, *psz_temp;
|
|
|
|
psz_module = psz_parser;
|
|
|
|
psz_parser = strchr( psz_module, ':' );
|
|
|
|
if ( psz_parser )
|
|
|
|
{
|
|
|
|
*psz_parser = '\0';
|
|
|
|
psz_parser++;
|
|
|
|
}
|
2008-10-29 19:39:22 +01:00
|
|
|
if( asprintf( &psz_temp, "%s,none", psz_module ) != -1)
|
2008-05-31 21:30:46 +02:00
|
|
|
{
|
2014-01-01 18:08:21 +01:00
|
|
|
libvlc_InternalAddIntf( p_libvlc, psz_temp );
|
2008-05-31 21:30:46 +02:00
|
|
|
free( psz_temp );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free( psz_modules );
|
|
|
|
free( psz_control );
|
|
|
|
|
2010-01-17 20:51:15 +01:00
|
|
|
if( var_InheritBool( p_libvlc, "network-synchronisation") )
|
2014-01-01 18:08:21 +01:00
|
|
|
libvlc_InternalAddIntf( p_libvlc, "netsync,none" );
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
|
2010-07-08 18:49:38 +02:00
|
|
|
#ifdef __APPLE__
|
2008-05-31 21:30:46 +02:00
|
|
|
var_Create( p_libvlc, "drawable-view-top", VLC_VAR_INTEGER );
|
|
|
|
var_Create( p_libvlc, "drawable-view-left", VLC_VAR_INTEGER );
|
|
|
|
var_Create( p_libvlc, "drawable-view-bottom", VLC_VAR_INTEGER );
|
|
|
|
var_Create( p_libvlc, "drawable-view-right", VLC_VAR_INTEGER );
|
|
|
|
var_Create( p_libvlc, "drawable-clip-top", VLC_VAR_INTEGER );
|
|
|
|
var_Create( p_libvlc, "drawable-clip-left", VLC_VAR_INTEGER );
|
|
|
|
var_Create( p_libvlc, "drawable-clip-bottom", VLC_VAR_INTEGER );
|
|
|
|
var_Create( p_libvlc, "drawable-clip-right", VLC_VAR_INTEGER );
|
2011-02-05 16:07:19 +01:00
|
|
|
var_Create( p_libvlc, "drawable-nsobject", VLC_VAR_ADDRESS );
|
2010-07-08 18:49:38 +02:00
|
|
|
#endif
|
2008-05-31 21:30:46 +02:00
|
|
|
|
|
|
|
/*
|
2010-03-29 22:41:32 +02:00
|
|
|
* Get input filenames given as commandline arguments.
|
|
|
|
* We assume that the remaining parameters are filenames
|
|
|
|
* and their input options.
|
2008-05-31 21:30:46 +02:00
|
|
|
*/
|
2010-03-29 22:41:32 +02:00
|
|
|
GetFilenames( p_libvlc, i_argc - vlc_optind, ppsz_argv + vlc_optind );
|
2008-05-31 21:30:46 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Get --open argument
|
|
|
|
*/
|
2010-01-30 23:46:58 +01:00
|
|
|
psz_val = var_InheritString( p_libvlc, "open" );
|
2009-12-10 17:46:22 +01:00
|
|
|
if ( psz_val != NULL )
|
2008-05-31 21:30:46 +02:00
|
|
|
{
|
2014-01-06 09:23:43 +01:00
|
|
|
intf_InsertItem( p_libvlc, psz_val, 0, NULL, 0 );
|
2010-01-30 23:46:58 +01:00
|
|
|
free( psz_val );
|
2008-05-31 21:30:46 +02:00
|
|
|
}
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
|
2018-11-21 12:56:20 +01:00
|
|
|
/* Callbacks between interfaces */
|
|
|
|
|
|
|
|
/* Create a variable for showing the right click menu */
|
|
|
|
var_Create(p_libvlc, "intf-popupmenu", VLC_VAR_BOOL);
|
|
|
|
|
|
|
|
/* Create a variable for showing the fullscreen interface */
|
|
|
|
var_Create(p_libvlc, "intf-toggle-fscontrol", VLC_VAR_VOID);
|
|
|
|
|
|
|
|
/* Create a variable for the Boss Key */
|
|
|
|
var_Create(p_libvlc, "intf-boss", VLC_VAR_VOID);
|
|
|
|
|
|
|
|
/* Create a variable for showing the main interface */
|
|
|
|
var_Create(p_libvlc, "intf-show", VLC_VAR_VOID);
|
|
|
|
|
2008-05-31 21:30:46 +02:00
|
|
|
return VLC_SUCCESS;
|
2016-09-20 16:56:35 +02:00
|
|
|
|
|
|
|
error:
|
|
|
|
libvlc_InternalCleanup( p_libvlc );
|
|
|
|
return i_ret;
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2008-05-31 21:30:46 +02:00
|
|
|
* Cleanup a libvlc instance. The instance is not completely deallocated
|
|
|
|
* \param p_libvlc the instance to clean
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
*/
|
2009-01-17 21:09:40 +01:00
|
|
|
void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
{
|
2008-12-22 18:22:09 +01:00
|
|
|
libvlc_priv_t *priv = libvlc_priv (p_libvlc);
|
2004-06-05 18:09:00 +02:00
|
|
|
|
2017-03-22 15:57:25 +01:00
|
|
|
if (priv->parser != NULL)
|
2018-06-25 17:45:25 +02:00
|
|
|
input_preparser_Deactivate(priv->parser);
|
2017-03-22 15:57:25 +01:00
|
|
|
|
2008-05-31 21:30:46 +02:00
|
|
|
/* Ask the interfaces to stop and destroy them */
|
|
|
|
msg_Dbg( p_libvlc, "removing all interfaces" );
|
2009-05-23 19:45:24 +02:00
|
|
|
intf_DestroyAll( p_libvlc );
|
2008-05-31 21:30:46 +02:00
|
|
|
|
2018-10-05 13:23:00 +02:00
|
|
|
if ( priv->p_thumbnailer )
|
|
|
|
vlc_thumbnailer_Release( priv->p_thumbnailer );
|
|
|
|
|
2018-06-18 15:19:53 +02:00
|
|
|
if ( priv->p_media_library )
|
|
|
|
libvlc_MlRelease( priv->p_media_library );
|
|
|
|
|
2018-05-17 11:37:56 +02:00
|
|
|
if( priv->media_source_provider )
|
|
|
|
vlc_media_source_provider_Delete( priv->media_source_provider );
|
|
|
|
|
2016-02-19 15:09:40 +01:00
|
|
|
libvlc_InternalDialogClean( p_libvlc );
|
2016-02-24 11:14:05 +01:00
|
|
|
libvlc_InternalKeystoreClean( p_libvlc );
|
2016-02-04 11:40:38 +01:00
|
|
|
|
2008-07-17 21:25:18 +02:00
|
|
|
#ifdef ENABLE_VLM
|
2008-05-31 21:30:46 +02:00
|
|
|
/* Destroy VLM if created in libvlc_InternalInit */
|
|
|
|
if( priv->p_vlm )
|
|
|
|
{
|
|
|
|
vlm_Delete( priv->p_vlm );
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-06-05 15:41:18 +02:00
|
|
|
#if !defined( _WIN32 ) && !defined( __OS2__ )
|
2014-01-01 17:38:19 +01:00
|
|
|
char *pidfile = var_InheritString( p_libvlc, "pidfile" );
|
|
|
|
if( pidfile != NULL )
|
2008-05-31 21:30:46 +02:00
|
|
|
{
|
2014-01-01 17:38:19 +01:00
|
|
|
msg_Dbg( p_libvlc, "removing PID file %s", pidfile );
|
|
|
|
if( unlink( pidfile ) )
|
|
|
|
msg_Warn( p_libvlc, "cannot remove PID file %s: %s",
|
|
|
|
pidfile, vlc_strerror_c(errno) );
|
|
|
|
free( pidfile );
|
2008-05-31 21:30:46 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-06-16 22:33:07 +02:00
|
|
|
if (priv->parser != NULL)
|
2018-06-25 17:45:25 +02:00
|
|
|
input_preparser_Delete(priv->parser);
|
2016-06-16 22:33:07 +02:00
|
|
|
|
2018-09-27 11:07:03 +02:00
|
|
|
if (priv->main_playlist)
|
|
|
|
vlc_playlist_Delete(priv->main_playlist);
|
|
|
|
|
2017-08-03 15:10:36 +02:00
|
|
|
libvlc_InternalActionsClean( p_libvlc );
|
2013-03-18 20:41:40 +01:00
|
|
|
|
2011-05-02 18:33:35 +02:00
|
|
|
/* Save the configuration */
|
|
|
|
if( !var_InheritBool( p_libvlc, "ignore-config" ) )
|
|
|
|
config_AutoSaveConfigFile( VLC_OBJECT(p_libvlc) );
|
|
|
|
|
2019-02-19 19:40:48 +01:00
|
|
|
vlc_LogDestroy(p_libvlc->obj.logger);
|
2008-05-31 21:30:46 +02:00
|
|
|
/* Free module bank. It is refcounted, so we call this each time */
|
2015-02-07 23:02:45 +01:00
|
|
|
module_EndBank (true);
|
2013-06-05 15:41:18 +02:00
|
|
|
#if defined(_WIN32) || defined(__OS2__)
|
2012-09-06 11:40:40 +02:00
|
|
|
system_End( );
|
|
|
|
#endif
|
2009-01-17 21:14:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroy everything.
|
|
|
|
* This function requests the running threads to finish, waits for their
|
|
|
|
* termination, and destroys their structure.
|
|
|
|
* It stops the thread systems: no instance can run after this has run
|
|
|
|
* \param p_libvlc the instance to destroy
|
|
|
|
*/
|
|
|
|
void libvlc_InternalDestroy( libvlc_int_t *p_libvlc )
|
|
|
|
{
|
|
|
|
libvlc_priv_t *priv = libvlc_priv( p_libvlc );
|
2008-05-31 21:30:46 +02:00
|
|
|
|
2010-05-30 19:17:27 +02:00
|
|
|
vlc_ExitDestroy( &priv->exit );
|
2008-05-31 21:30:46 +02:00
|
|
|
|
2019-03-19 12:25:05 +01:00
|
|
|
vlc_mutex_destroy(&priv->lock);
|
2019-03-06 19:15:18 +01:00
|
|
|
vlc_object_delete(p_libvlc);
|
* WARNING: Libvlc API change
- VLC_Set VLC_Get were changed to VLC_VariableGet VLC_VariableSet
- VLC_ClearPlaylist was changed to VLC_PlaylistClear
- Added a lot of new calls:
VLC_PositionGet, VLC_PositionSet, VLC_TimeGet, VLC_TimeSet,
VLC_LengthGet, VLC_SpeedFaster, VLC_SpeedSlower, VLC_PlaylistIndex,
VLC_PlaylistNumberOfItems, VLC_PlaylistNext, VLC_PlaylistPrev,
VLC_VolumeGet, VLC_VolumeSet, VLC_VolumeMute.
- everything doxygenized.
- There are NO mozilla functions of these additions yet. (someone else please?)
2004-06-06 15:02:26 +02:00
|
|
|
}
|
|
|
|
|
2008-05-31 21:30:46 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* GetFilenames: parse command line options which are not flags
|
|
|
|
*****************************************************************************
|
|
|
|
* Parse command line for input files as well as their associated options.
|
|
|
|
* An option always follows its associated input and begins with a ":".
|
|
|
|
*****************************************************************************/
|
2010-03-29 22:41:32 +02:00
|
|
|
static void GetFilenames( libvlc_int_t *p_vlc, unsigned n,
|
|
|
|
const char *const args[] )
|
2008-05-31 21:30:46 +02:00
|
|
|
{
|
2010-03-29 22:41:32 +02:00
|
|
|
while( n > 0 )
|
2008-05-31 21:30:46 +02:00
|
|
|
{
|
|
|
|
/* Count the input options */
|
2010-03-29 22:41:32 +02:00
|
|
|
unsigned i_options = 0;
|
|
|
|
|
|
|
|
while( args[--n][0] == ':' )
|
2008-05-31 21:30:46 +02:00
|
|
|
{
|
|
|
|
i_options++;
|
2010-03-29 22:41:32 +02:00
|
|
|
if( n == 0 )
|
|
|
|
{
|
|
|
|
msg_Warn( p_vlc, "options %s without item", args[n] );
|
|
|
|
return; /* syntax!? */
|
|
|
|
}
|
2008-05-31 21:30:46 +02:00
|
|
|
}
|
|
|
|
|
2012-08-20 19:31:05 +02:00
|
|
|
char *mrl = NULL;
|
|
|
|
if( strstr( args[n], "://" ) == NULL )
|
|
|
|
{
|
|
|
|
mrl = vlc_path2uri( args[n], NULL );
|
|
|
|
if( !mrl )
|
|
|
|
continue;
|
|
|
|
}
|
2008-05-31 21:30:46 +02:00
|
|
|
|
2014-01-06 09:23:43 +01:00
|
|
|
intf_InsertItem( p_vlc, (mrl != NULL) ? mrl : args[n], i_options,
|
2012-08-20 19:31:05 +02:00
|
|
|
( i_options ? &args[n + 1] : NULL ),
|
2014-01-06 09:23:43 +01:00
|
|
|
VLC_INPUT_OPTION_TRUSTED );
|
2009-10-05 21:58:46 +02:00
|
|
|
free( mrl );
|
2008-05-31 21:30:46 +02:00
|
|
|
}
|
2002-09-29 20:19:53 +02:00
|
|
|
}
|
2013-12-31 19:25:21 +01:00
|
|
|
|
2018-07-25 04:06:38 +02:00
|
|
|
int vlc_MetadataRequest(libvlc_int_t *libvlc, input_item_t *item,
|
|
|
|
input_item_meta_request_option_t i_options,
|
2018-08-10 15:39:16 +02:00
|
|
|
const input_preparser_callbacks_t *cbs,
|
|
|
|
void *cbs_userdata,
|
2018-07-25 04:06:38 +02:00
|
|
|
int timeout, void *id)
|
|
|
|
{
|
|
|
|
libvlc_priv_t *priv = libvlc_priv(libvlc);
|
|
|
|
|
|
|
|
if (unlikely(priv->parser == NULL))
|
|
|
|
return VLC_ENOMEM;
|
|
|
|
|
2018-08-10 15:39:16 +02:00
|
|
|
input_preparser_Push( priv->parser, item, i_options, cbs, cbs_userdata, timeout, id );
|
2018-07-25 04:06:38 +02:00
|
|
|
return VLC_SUCCESS;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-12-31 19:25:21 +01:00
|
|
|
/**
|
|
|
|
* Requests extraction of the meta data for an input item (a.k.a. preparsing).
|
2016-06-01 11:29:12 +02:00
|
|
|
* The actual extraction is asynchronous. It can be cancelled with
|
|
|
|
* libvlc_MetadataCancel()
|
2013-12-31 19:25:21 +01:00
|
|
|
*/
|
2016-06-01 11:59:09 +02:00
|
|
|
int libvlc_MetadataRequest(libvlc_int_t *libvlc, input_item_t *item,
|
|
|
|
input_item_meta_request_option_t i_options,
|
2018-08-10 15:39:16 +02:00
|
|
|
const input_preparser_callbacks_t *cbs,
|
|
|
|
void *cbs_userdata,
|
2016-06-01 11:59:09 +02:00
|
|
|
int timeout, void *id)
|
2013-12-31 19:25:21 +01:00
|
|
|
{
|
|
|
|
libvlc_priv_t *priv = libvlc_priv(libvlc);
|
2019-08-22 13:59:07 +02:00
|
|
|
assert(i_options & META_REQUEST_OPTION_SCOPE_ANY);
|
2013-12-31 19:25:21 +01:00
|
|
|
|
|
|
|
if (unlikely(priv->parser == NULL))
|
|
|
|
return VLC_ENOMEM;
|
|
|
|
|
2015-03-25 15:46:25 +01:00
|
|
|
vlc_mutex_lock( &item->lock );
|
|
|
|
if( item->i_preparse_depth == 0 )
|
|
|
|
item->i_preparse_depth = 1;
|
|
|
|
vlc_mutex_unlock( &item->lock );
|
2018-07-25 04:06:39 +02:00
|
|
|
|
2018-08-10 15:39:16 +02:00
|
|
|
return vlc_MetadataRequest(libvlc, item, i_options, cbs, cbs_userdata, timeout, id);
|
2013-12-31 19:25:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Requests retrieving/downloading art for an input item.
|
|
|
|
* The retrieval is performed asynchronously.
|
|
|
|
*/
|
2014-05-14 01:04:33 +02:00
|
|
|
int libvlc_ArtRequest(libvlc_int_t *libvlc, input_item_t *item,
|
2018-08-14 15:38:55 +02:00
|
|
|
input_item_meta_request_option_t i_options,
|
|
|
|
const input_fetcher_callbacks_t *cbs,
|
|
|
|
void *cbs_userdata)
|
2013-12-31 19:25:21 +01:00
|
|
|
{
|
|
|
|
libvlc_priv_t *priv = libvlc_priv(libvlc);
|
2019-08-22 13:59:07 +02:00
|
|
|
assert(i_options & META_REQUEST_OPTION_FETCH_ANY);
|
2013-12-31 19:25:21 +01:00
|
|
|
|
|
|
|
if (unlikely(priv->parser == NULL))
|
|
|
|
return VLC_ENOMEM;
|
|
|
|
|
2019-08-22 13:59:07 +02:00
|
|
|
input_preparser_fetcher_Push(priv->parser, item, i_options,
|
|
|
|
cbs, cbs_userdata);
|
2013-12-31 19:25:21 +01:00
|
|
|
return VLC_SUCCESS;
|
|
|
|
}
|
2016-06-01 11:29:12 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Cancels extraction of the meta data for an input item.
|
|
|
|
*
|
|
|
|
* This does nothing if the input item is already processed or if it was not
|
|
|
|
* added with libvlc_MetadataRequest()
|
|
|
|
*/
|
|
|
|
void libvlc_MetadataCancel(libvlc_int_t *libvlc, void *id)
|
|
|
|
{
|
|
|
|
libvlc_priv_t *priv = libvlc_priv(libvlc);
|
|
|
|
|
|
|
|
if (unlikely(priv->parser == NULL))
|
|
|
|
return;
|
|
|
|
|
2018-06-25 17:45:25 +02:00
|
|
|
input_preparser_Cancel(priv->parser, id);
|
2016-06-01 11:29:12 +02:00
|
|
|
}
|