vlc | branch: master | Francois Cartegnie <[email protected]> | Fri Sep 4 13:23:52 2015 +0200| [0e6eebdfe90c1497b17ce74b6937665d840019c2] | committer: Francois Cartegnie
demux: adaptative: add FakeEsOutID > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0e6eebdfe90c1497b17ce74b6937665d840019c2 --- modules/demux/Makefile.am | 2 + modules/demux/adaptative/plumbing/FakeESOutID.cpp | 52 +++++++++++++++++++++ modules/demux/adaptative/plumbing/FakeESOutID.hpp | 46 ++++++++++++++++++ 3 files changed, 100 insertions(+) diff --git a/modules/demux/Makefile.am b/modules/demux/Makefile.am index a3598c8..52f6d38 100644 --- a/modules/demux/Makefile.am +++ b/modules/demux/Makefile.am @@ -298,6 +298,8 @@ libadaptative_plugin_la_SOURCES = \ demux/adaptative/http/HTTPConnectionManager.h \ demux/adaptative/http/Sockets.hpp \ demux/adaptative/http/Sockets.cpp \ + demux/adaptative/plumbing/FakeESOutID.cpp \ + demux/adaptative/plumbing/FakeESOutID.hpp \ demux/adaptative/plumbing/StreamOutput.cpp \ demux/adaptative/plumbing/StreamOutput.hpp \ demux/adaptative/PlaylistManager.cpp \ diff --git a/modules/demux/adaptative/plumbing/FakeESOutID.cpp b/modules/demux/adaptative/plumbing/FakeESOutID.cpp new file mode 100644 index 0000000..6728e08 --- /dev/null +++ b/modules/demux/adaptative/plumbing/FakeESOutID.cpp @@ -0,0 +1,52 @@ +/* + * FakeESOutID.cpp + ***************************************************************************** + * Copyright © 2015 VideoLAN and VLC Authors + * + * 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 + * (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 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * 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. + *****************************************************************************/ +#include "FakeESOutID.hpp" + +using namespace adaptative; + +FakeESOutID::FakeESOutID( FakeESOut *fakeesout_, const es_format_t *p_fmt ) +{ + p_real_es_id = NULL; + fakeesout = fakeesout_; + es_format_Init( &fmt, 0, 0 ); + es_format_Copy( &fmt, p_fmt ); +} + +FakeESOutID::~FakeESOutID() +{ + es_format_Clean( &fmt ); +} + +void FakeESOutID::setRealESID( es_out_id_t *real_es_id ) +{ + p_real_es_id = real_es_id; +} + +es_out_id_t * FakeESOutID::realESID() +{ + return p_real_es_id; +} + +bool FakeESOutID::isCompatible( const es_format_t *p_fmt ) const +{ + return es_format_IsSimilar( p_fmt, &fmt ) && + p_fmt->i_extra == fmt.i_extra && + !memcmp( p_fmt->p_extra, fmt.p_extra, p_fmt->i_extra ); +} diff --git a/modules/demux/adaptative/plumbing/FakeESOutID.hpp b/modules/demux/adaptative/plumbing/FakeESOutID.hpp new file mode 100644 index 0000000..8449657 --- /dev/null +++ b/modules/demux/adaptative/plumbing/FakeESOutID.hpp @@ -0,0 +1,46 @@ +/* + * FakeESOutID.hpp + ***************************************************************************** + * Copyright © 2015 VideoLAN and VLC Authors + * + * 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 + * (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 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * 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. + *****************************************************************************/ +#ifndef FAKEESOUTID_HPP +#define FAKEESOUTID_HPP + +#include <vlc_common.h> +#include <vlc_es.h> + +namespace adaptative +{ + class FakeESOut; + + class FakeESOutID + { + public: + FakeESOutID( FakeESOut *, const es_format_t * ); + ~FakeESOutID(); + void setRealESID( es_out_id_t * ); + es_out_id_t * realESID(); + bool isCompatible( const es_format_t * ) const; + + private: + FakeESOut *fakeesout; + es_out_id_t *p_real_es_id; + es_format_t fmt; + }; +} + +#endif // FAKEESOUTID_HPP _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
