Commit 0e6eebdf authored by Francois Cartegnie's avatar Francois Cartegnie

demux: adaptative: add FakeEsOutID

parent 40971ae5
......@@ -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 \
......
/*
* 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 );
}
/*
* 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment