Commit fe32c1c6 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: adaptative: merge streamformats

only handling them should differ. adds debugging
parent 916065b0
...@@ -367,8 +367,7 @@ libadaptative_dash_SOURCES = \ ...@@ -367,8 +367,7 @@ libadaptative_dash_SOURCES = \
demux/dash/DASHManager.cpp \ demux/dash/DASHManager.cpp \
demux/dash/DASHManager.h \ demux/dash/DASHManager.h \
demux/dash/DASHStream.cpp \ demux/dash/DASHStream.cpp \
demux/dash/DASHStream.hpp \ demux/dash/DASHStream.hpp
demux/dash/DASHStreamFormat.hpp
libadaptative_hls_SOURCES = \ libadaptative_hls_SOURCES = \
demux/hls/playlist/M3U8.hpp \ demux/hls/playlist/M3U8.hpp \
...@@ -383,7 +382,6 @@ libadaptative_hls_SOURCES = \ ...@@ -383,7 +382,6 @@ libadaptative_hls_SOURCES = \
demux/hls/playlist/Tags.cpp \ demux/hls/playlist/Tags.cpp \
demux/hls/HLSManager.hpp \ demux/hls/HLSManager.hpp \
demux/hls/HLSManager.cpp \ demux/hls/HLSManager.cpp \
demux/hls/HLSStreamFormat.hpp \
demux/hls/HLSStreams.hpp \ demux/hls/HLSStreams.hpp \
demux/hls/HLSStreams.cpp demux/hls/HLSStreams.cpp
...@@ -404,7 +402,6 @@ libadaptative_smooth_SOURCES = \ ...@@ -404,7 +402,6 @@ libadaptative_smooth_SOURCES = \
demux/smooth/playlist/SmoothSegment.cpp \ demux/smooth/playlist/SmoothSegment.cpp \
demux/smooth/SmoothManager.hpp \ demux/smooth/SmoothManager.hpp \
demux/smooth/SmoothManager.cpp \ demux/smooth/SmoothManager.cpp \
demux/smooth/SmoothStreamFormat.hpp \
demux/smooth/SmoothStream.hpp \ demux/smooth/SmoothStream.hpp \
demux/smooth/SmoothStream.cpp demux/smooth/SmoothStream.cpp
libadaptative_smooth_SOURCES += mux/mp4/libmp4mux.c mux/mp4/libmp4mux.h \ libadaptative_smooth_SOURCES += mux/mp4/libmp4mux.c mux/mp4/libmp4mux.h \
......
...@@ -26,6 +26,26 @@ StreamFormat::operator unsigned() const ...@@ -26,6 +26,26 @@ StreamFormat::operator unsigned() const
return formatid; return formatid;
} }
std::string StreamFormat::str() const
{
switch(formatid)
{
case MPEG2TS:
return "TS";
case MP4:
return "MP4";
case WEBVTT:
return "WebVTT";
case TTML:
return "Timed Text";
case PACKEDAAC:
return "Packed AAC";
default:
case UNKNOWN:
return "Unknown";
}
}
StreamFormat::StreamFormat( unsigned formatid_ ) StreamFormat::StreamFormat( unsigned formatid_ )
{ {
formatid = formatid_; formatid = formatid_;
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#ifndef STREAMFORMAT_HPP #ifndef STREAMFORMAT_HPP
#define STREAMFORMAT_HPP #define STREAMFORMAT_HPP
#include <string>
namespace adaptative namespace adaptative
{ {
...@@ -27,10 +29,17 @@ namespace adaptative ...@@ -27,10 +29,17 @@ namespace adaptative
{ {
public: public:
static const unsigned UNSUPPORTED = 0; static const unsigned UNSUPPORTED = 0;
static const unsigned MPEG2TS = 1;
static const unsigned MP4 = 2;
static const unsigned WEBVTT = 3;
static const unsigned TTML = 4;
static const unsigned PACKEDAAC = 5;
static const unsigned UNKNOWN = 0xFF; /* will probe */
StreamFormat( unsigned = UNSUPPORTED ); StreamFormat( unsigned = UNSUPPORTED );
~StreamFormat(); ~StreamFormat();
operator unsigned() const; operator unsigned() const;
std::string str() const;
bool operator==(const StreamFormat &) const; bool operator==(const StreamFormat &) const;
bool operator!=(const StreamFormat &) const; bool operator!=(const StreamFormat &) const;
......
...@@ -381,8 +381,8 @@ void AbstractStream::trackerEvent(const SegmentTrackerEvent &event) ...@@ -381,8 +381,8 @@ void AbstractStream::trackerEvent(const SegmentTrackerEvent &event)
if(*event.u.format.f != format) if(*event.u.format.f != format)
{ {
/* Format has changed between segments, we need to drain and change demux */ /* Format has changed between segments, we need to drain and change demux */
msg_Info(p_realdemux, "Changing stream format %u->%u", msg_Info(p_realdemux, "Changing stream format %s -> %s",
(unsigned)format, (unsigned)*event.u.format.f); format.str().c_str(), event.u.format.f->str().c_str());
format = *event.u.format.f; format = *event.u.format.f;
/* This is an implict discontinuity */ /* This is an implict discontinuity */
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#include "DASHStream.hpp" #include "DASHStream.hpp"
#include "DASHStreamFormat.hpp"
using namespace dash; using namespace dash;
...@@ -37,19 +36,19 @@ AbstractDemuxer * DASHStream::createDemux(const StreamFormat &format) ...@@ -37,19 +36,19 @@ AbstractDemuxer * DASHStream::createDemux(const StreamFormat &format)
AbstractDemuxer *ret = NULL; AbstractDemuxer *ret = NULL;
switch((unsigned)format) switch((unsigned)format)
{ {
case DASHStreamFormat::MP4: case StreamFormat::MP4:
ret = new Demuxer(p_realdemux, "mp4", fakeesout->getEsOut(), demuxersource); ret = new Demuxer(p_realdemux, "mp4", fakeesout->getEsOut(), demuxersource);
break; break;
case DASHStreamFormat::MPEG2TS: case StreamFormat::MPEG2TS:
ret = new Demuxer(p_realdemux, "ts", fakeesout->getEsOut(), demuxersource); ret = new Demuxer(p_realdemux, "ts", fakeesout->getEsOut(), demuxersource);
break; break;
case DASHStreamFormat::WEBVTT: case StreamFormat::WEBVTT:
ret = new SlaveDemuxer(p_realdemux, "subtitle", fakeesout->getEsOut(), demuxersource); ret = new SlaveDemuxer(p_realdemux, "subtitle", fakeesout->getEsOut(), demuxersource);
break; break;
case DASHStreamFormat::TTML: case StreamFormat::TTML:
ret = new SlaveDemuxer(p_realdemux, "ttml", fakeesout->getEsOut(), demuxersource); ret = new SlaveDemuxer(p_realdemux, "ttml", fakeesout->getEsOut(), demuxersource);
break; break;
......
/*
* DASHStreamFormat.hpp
*****************************************************************************
* Copyright (C) 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 DASHSTREAMFORMAT_HPP
#define DASHSTREAMFORMAT_HPP
#include "../adaptative/StreamFormat.hpp"
#include <string>
namespace dash
{
using namespace adaptative;
class DASHStreamFormat : public StreamFormat
{
public:
static const unsigned MPEG2TS = StreamFormat::UNSUPPORTED + 1;
static const unsigned MP4 = StreamFormat::UNSUPPORTED + 2;
static const unsigned WEBVTT = StreamFormat::UNSUPPORTED + 3;
static const unsigned TTML = StreamFormat::UNSUPPORTED + 4;
static StreamFormat mimeToFormat(const std::string &mime)
{
std::string::size_type pos = mime.find("/");
if(pos != std::string::npos)
{
std::string tail = mime.substr(pos + 1);
if(tail == "mp4")
return StreamFormat(DASHStreamFormat::MP4);
else if (tail == "mp2t")
return StreamFormat(DASHStreamFormat::MPEG2TS);
else if (tail == "vtt")
return StreamFormat(DASHStreamFormat::WEBVTT);
else if (tail == "ttml+xml")
return StreamFormat(DASHStreamFormat::TTML);
}
return StreamFormat();
}
};
}
#endif // DASHSTREAMFORMAT_HPP
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "AdaptationSet.h" #include "AdaptationSet.h"
#include "Representation.h" #include "Representation.h"
#include "Period.h" #include "Period.h"
#include "../DASHStreamFormat.hpp" #include "MPD.h"
using namespace dash::mpd; using namespace dash::mpd;
...@@ -43,7 +43,7 @@ AdaptationSet::~AdaptationSet() ...@@ -43,7 +43,7 @@ AdaptationSet::~AdaptationSet()
StreamFormat AdaptationSet::getStreamFormat() const StreamFormat AdaptationSet::getStreamFormat() const
{ {
if(!getMimeType().empty()) if(!getMimeType().empty())
return DASHStreamFormat::mimeToFormat(getMimeType()); return MPD::mimeToFormat(getMimeType());
else else
return BaseAdaptationSet::getStreamFormat(); return BaseAdaptationSet::getStreamFormat();
} }
......
...@@ -28,11 +28,13 @@ ...@@ -28,11 +28,13 @@
#include "DASHCommonAttributesElements.h" #include "DASHCommonAttributesElements.h"
#include "ContentDescription.h" #include "ContentDescription.h"
#include "../adaptative/StreamFormat.hpp"
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_arrays.h> #include <vlc_arrays.h>
using namespace dash::mpd; using namespace dash::mpd;
using namespace adaptative;
DASHCommonAttributesElements::DASHCommonAttributesElements() : DASHCommonAttributesElements::DASHCommonAttributesElements() :
parX( 1 ), parX( 1 ),
......
...@@ -62,6 +62,24 @@ Profile MPD::getProfile() const ...@@ -62,6 +62,24 @@ Profile MPD::getProfile() const
return profile; return profile;
} }
StreamFormat MPD::mimeToFormat(const std::string &mime)
{
std::string::size_type pos = mime.find("/");
if(pos != std::string::npos)
{
std::string tail = mime.substr(pos + 1);
if(tail == "mp4")
return StreamFormat(StreamFormat::MP4);
else if (tail == "mp2t")
return StreamFormat(StreamFormat::MPEG2TS);
else if (tail == "vtt")
return StreamFormat(StreamFormat::WEBVTT);
else if (tail == "ttml+xml")
return StreamFormat(StreamFormat::TTML);
}
return StreamFormat();
}
void MPD::debug() void MPD::debug()
{ {
msg_Dbg(stream, "MPD profile=%s mediaPresentationDuration=%" PRId64 msg_Dbg(stream, "MPD profile=%s mediaPresentationDuration=%" PRId64
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#define MPD_H_ #define MPD_H_
#include "../adaptative/playlist/AbstractPlaylist.hpp" #include "../adaptative/playlist/AbstractPlaylist.hpp"
#include "../adaptative/StreamFormat.hpp"
#include "Profile.hpp" #include "Profile.hpp"
namespace dash namespace dash
...@@ -33,6 +34,7 @@ namespace dash ...@@ -33,6 +34,7 @@ namespace dash
namespace mpd namespace mpd
{ {
using namespace adaptative::playlist; using namespace adaptative::playlist;
using namespace adaptative;
class ProgramInformation; class ProgramInformation;
...@@ -46,6 +48,8 @@ namespace dash ...@@ -46,6 +48,8 @@ namespace dash
virtual bool isLive() const; virtual bool isLive() const;
virtual void debug(); virtual void debug();
static StreamFormat mimeToFormat(const std::string &);
Property<ProgramInformation *> programInfo; Property<ProgramInformation *> programInfo;
private: private:
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include "TrickModeType.h" #include "TrickModeType.h"
#include "../adaptative/playlist/SegmentTemplate.h" #include "../adaptative/playlist/SegmentTemplate.h"
#include "../adaptative/playlist/SegmentTimeline.h" #include "../adaptative/playlist/SegmentTimeline.h"
#include "../DASHStreamFormat.hpp"
using namespace dash::mpd; using namespace dash::mpd;
...@@ -52,9 +51,9 @@ Representation::~Representation () ...@@ -52,9 +51,9 @@ Representation::~Representation ()
StreamFormat Representation::getStreamFormat() const StreamFormat Representation::getStreamFormat() const
{ {
if(getMimeType().empty()) if(getMimeType().empty())
return DASHStreamFormat::mimeToFormat(adaptationSet->getMimeType()); return MPD::mimeToFormat(adaptationSet->getMimeType());
else else
return DASHStreamFormat::mimeToFormat(getMimeType()); return MPD::mimeToFormat(getMimeType());
} }
TrickModeType* Representation::getTrickModeType () const TrickModeType* Representation::getTrickModeType () const
......
/*
* HLSStreamFormat.hpp
*****************************************************************************
* Copyright (C) 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 HLSSTREAMFORMAT_HPP
#define HLSSTREAMFORMAT_HPP
#include "../adaptative/StreamFormat.hpp"
#include <string>
namespace hls
{
using namespace adaptative;
class HLSStreamFormat : public StreamFormat
{
public:
static const unsigned UNKNOWN = StreamFormat::UNSUPPORTED + 1; /* will probe */
static const unsigned MPEG2TS = StreamFormat::UNSUPPORTED + 2;
static const unsigned PACKEDAAC = StreamFormat::UNSUPPORTED + 3;
};
}
#endif // HLSSTREAMFORMAT_HPP
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#include "HLSStreams.hpp" #include "HLSStreams.hpp"
#include "HLSStreamFormat.hpp"
#include <vlc_demux.h> #include <vlc_demux.h>
using namespace hls; using namespace hls;
...@@ -55,15 +54,15 @@ AbstractDemuxer * HLSStream::createDemux(const StreamFormat &format) ...@@ -55,15 +54,15 @@ AbstractDemuxer * HLSStream::createDemux(const StreamFormat &format)
AbstractDemuxer *ret = NULL; AbstractDemuxer *ret = NULL;
switch((unsigned)format) switch((unsigned)format)
{ {
case HLSStreamFormat::UNKNOWN: case StreamFormat::UNKNOWN:
ret = new Demuxer(p_realdemux, "any", fakeesout->getEsOut(), demuxersource); ret = new Demuxer(p_realdemux, "any", fakeesout->getEsOut(), demuxersource);
break; break;
case HLSStreamFormat::PACKEDAAC: case StreamFormat::PACKEDAAC:
ret = new Demuxer(p_realdemux, "avformat", fakeesout->getEsOut(), demuxersource); ret = new Demuxer(p_realdemux, "avformat", fakeesout->getEsOut(), demuxersource);
break; break;
case HLSStreamFormat::MPEG2TS: case StreamFormat::MPEG2TS:
ret = new Demuxer(p_realdemux, "ts", fakeesout->getEsOut(), demuxersource); ret = new Demuxer(p_realdemux, "ts", fakeesout->getEsOut(), demuxersource);
break; break;
...@@ -85,7 +84,7 @@ AbstractDemuxer * HLSStream::createDemux(const StreamFormat &format) ...@@ -85,7 +84,7 @@ AbstractDemuxer * HLSStream::createDemux(const StreamFormat &format)
void HLSStream::prepareFormatChange() void HLSStream::prepareFormatChange()
{ {
AbstractStream::prepareFormatChange(); AbstractStream::prepareFormatChange();
if((unsigned)format == HLSStreamFormat::PACKEDAAC) if((unsigned)format == StreamFormat::PACKEDAAC)
{ {
fakeesout->setTimestampOffset( i_aac_offset ); fakeesout->setTimestampOffset( i_aac_offset );
} }
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "HLSSegment.hpp" #include "HLSSegment.hpp"
#include "../adaptative/playlist/SegmentChunk.hpp" #include "../adaptative/playlist/SegmentChunk.hpp"
#include "../adaptative/playlist/BaseRepresentation.h" #include "../adaptative/playlist/BaseRepresentation.h"
#include "../HLSStreamFormat.hpp"
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_block.h> #include <vlc_block.h>
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "../adaptative/playlist/SegmentList.h" #include "../adaptative/playlist/SegmentList.h"
#include "../adaptative/tools/Retrieve.hpp" #include "../adaptative/tools/Retrieve.hpp"
#include "../adaptative/tools/Helper.h" #include "../adaptative/tools/Helper.h"
#include "../HLSStreamFormat.hpp"
#include "M3U8.hpp" #include "M3U8.hpp"
#include "Tags.hpp" #include "Tags.hpp"
...@@ -95,11 +94,11 @@ void M3U8Parser::setFormatFromCodecs(Representation *rep, const std::string code ...@@ -95,11 +94,11 @@ void M3U8Parser::setFormatFromCodecs(Representation *rep, const std::string code
std::string codec = codecs.front(); std::string codec = codecs.front();
transform(codec.begin(), codec.end(), codec.begin(), (int (*)(int))std::tolower); transform(codec.begin(), codec.end(), codec.begin(), (int (*)(int))std::tolower);
if(codec == "mp4a") if(codec == "mp4a")
rep->streamFormat = StreamFormat(HLSStreamFormat::PACKEDAAC); rep->streamFormat = StreamFormat(StreamFormat::PACKEDAAC);
} }
else else
{ {
rep->streamFormat = StreamFormat(HLSStreamFormat::MPEG2TS); rep->streamFormat = StreamFormat(StreamFormat::MPEG2TS);
} }
} }
} }
...@@ -113,11 +112,11 @@ void M3U8Parser::setFormatFromExtension(Representation *rep, const std::string & ...@@ -113,11 +112,11 @@ void M3U8Parser::setFormatFromExtension(Representation *rep, const std::string &
transform(extension.begin(), extension.end(), extension.begin(), (int (*)(int))std::tolower); transform(extension.begin(), extension.end(), extension.begin(), (int (*)(int))std::tolower);
if(extension == "aac") if(extension == "aac")
{ {
rep->streamFormat = StreamFormat(HLSStreamFormat::PACKEDAAC); rep->streamFormat = StreamFormat(StreamFormat::PACKEDAAC);
} }
else if(extension == "ts" || extension == "mp2t" || extension == "mpeg") else if(extension == "ts" || extension == "mp2t" || extension == "mpeg")
{ {
rep->streamFormat = StreamFormat(HLSStreamFormat::MPEG2TS); rep->streamFormat = StreamFormat(StreamFormat::MPEG2TS);
} }
} }
} }
...@@ -256,7 +255,7 @@ void M3U8Parser::parseSegments(vlc_object_t *p_obj, Representation *rep, const s ...@@ -256,7 +255,7 @@ void M3U8Parser::parseSegments(vlc_object_t *p_obj, Representation *rep, const s
break; break;
segment->setSourceUrl(uritag->getValue().value); segment->setSourceUrl(uritag->getValue().value);
if((unsigned)rep->getStreamFormat() == HLSStreamFormat::UNKNOWN) if((unsigned)rep->getStreamFormat() == StreamFormat::UNKNOWN)
setFormatFromExtension(rep, uritag->getValue().value); setFormatFromExtension(rep, uritag->getValue().value);
if(ctx_extinf) if(ctx_extinf)
...@@ -455,7 +454,7 @@ M3U8 * M3U8Parser::parse(stream_t *p_stream, const std::string &playlisturl) ...@@ -455,7 +454,7 @@ M3U8 * M3U8Parser::parse(stream_t *p_stream, const std::string &playlisturl)
if(pair.second->getAttributeByName("TYPE")->value != "AUDIO" && if(pair.second->getAttributeByName("TYPE")->value != "AUDIO" &&
pair.second->getAttributeByName("TYPE")->value != "VIDEO") pair.second->getAttributeByName("TYPE")->value != "VIDEO")
{ {
rep->streamFormat = StreamFormat(HLSStreamFormat::UNSUPPORTED); rep->streamFormat = StreamFormat(StreamFormat::UNSUPPORTED);
} }
if(pair.second->getAttributeByName("LANGUAGE")) if(pair.second->getAttributeByName("LANGUAGE"))
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "../adaptative/playlist/BasePeriod.h" #include "../adaptative/playlist/BasePeriod.h"
#include "../adaptative/playlist/BaseAdaptationSet.h" #include "../adaptative/playlist/BaseAdaptationSet.h"
#include "../adaptative/playlist/SegmentList.h" #include "../adaptative/playlist/SegmentList.h"
#include "../HLSStreamFormat.hpp"
#include <ctime> #include <ctime>
...@@ -43,7 +42,7 @@ Representation::Representation ( BaseAdaptationSet *set ) : ...@@ -43,7 +42,7 @@ Representation::Representation ( BaseAdaptationSet *set ) :
b_loaded = false; b_loaded = false;
switchpolicy = SegmentInformation::SWITCH_SEGMENT_ALIGNED; /* FIXME: based on streamformat */ switchpolicy = SegmentInformation::SWITCH_SEGMENT_ALIGNED; /* FIXME: based on streamformat */
nextPlaylistupdate = 0; nextPlaylistupdate = 0;
streamFormat = HLSStreamFormat::UNKNOWN; streamFormat = StreamFormat::UNKNOWN;
} }
Representation::~Representation () Representation::~Representation ()
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include "../adaptative/playlist/BaseRepresentation.h" #include "../adaptative/playlist/BaseRepresentation.h"
#include "../adaptative/tools/Properties.hpp" #include "../adaptative/tools/Properties.hpp"
#include "../HLSStreamFormat.hpp" #include "../adaptative/StreamFormat.hpp"
namespace hls namespace hls
{ {
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#include "SmoothStream.hpp" #include "SmoothStream.hpp"
#include "SmoothStreamFormat.hpp"
#include <vlc_demux.h> #include <vlc_demux.h>
using namespace smooth; using namespace smooth;
...@@ -33,7 +32,7 @@ AbstractDemuxer * SmoothStream::createDemux(const StreamFormat &format) ...@@ -33,7 +32,7 @@ AbstractDemuxer * SmoothStream::createDemux(const StreamFormat &format)
AbstractDemuxer *ret = NULL; AbstractDemuxer *ret = NULL;
switch((unsigned)format) switch((unsigned)format)
{ {
case SmoothStreamFormat::MP4: case StreamFormat::MP4:
ret = new Demuxer(p_realdemux, "mp4", fakeesout->getEsOut(), demuxersource); ret = new Demuxer(p_realdemux, "mp4", fakeesout->getEsOut(), demuxersource);
break; break;
......
/*
* SmoothStreamFormat.hpp
*****************************************************************************
* Copyright (C) 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 SMOOTHSTREAMFORMAT_HPP
#define SMOOTHSTREAMFORMAT_HPP
#include "../adaptative/StreamFormat.hpp"
namespace smooth
{
using namespace adaptative;
class SmoothStreamFormat : public StreamFormat
{
public:
static const unsigned MP4 = StreamFormat::UNSUPPORTED + 1;
};
}
#endif // SMOOTHSTREAMFORMAT_HPP
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include "../adaptative/playlist/SegmentTemplate.h" #include "../adaptative/playlist/SegmentTemplate.h"
#include "../adaptative/playlist/SegmentTimeline.h" #include "../adaptative/playlist/SegmentTimeline.h"
#include "../adaptative/playlist/BaseAdaptationSet.h" #include "../adaptative/playlist/BaseAdaptationSet.h"
#include "../SmoothStreamFormat.hpp"
using namespace smooth::playlist; using namespace smooth::playlist;
...@@ -38,7 +37,7 @@ Representation::~Representation () ...@@ -38,7 +37,7 @@ Representation::~Representation ()
StreamFormat Representation::getStreamFormat() const StreamFormat Representation::getStreamFormat() const
{ {
return StreamFormat(SmoothStreamFormat::MP4); return StreamFormat(StreamFormat::MP4);
} }
std::string Representation::contextualize(size_t number, const std::string &component, std::string Representation::contextualize(size_t number, const std::string &component,
......
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