3 *****************************************************************************
4 * Copyright (C) 2014 - VideoLAN authors
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published
8 * by the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19 *****************************************************************************/
28 #include <vlc_common.h>
29 #include "StreamsType.hpp"
30 #include "adaptationlogic/AbstractAdaptationLogic.h"
31 #include "http/HTTPConnectionManager.h"
32 #include "http/Chunk.h"
40 class AbstractStreamOutput;
45 Stream(const std::string &mime);
46 Stream(const Type, const Format);
48 bool operator==(const Stream &) const;
49 static Type mimeToType(const std::string &mime);
50 static Format mimeToFormat(const std::string &mime);
51 void create(demux_t *, logic::AbstractAdaptationLogic *, SegmentTracker *);
53 mtime_t getPCR() const;
56 bool seekAble() const;
57 size_t read(http::HTTPConnectionManager *);
58 bool setPosition(mtime_t, bool);
61 http::Chunk *getChunk();
62 void init(const Type, const Format);
65 AbstractStreamOutput *output;
66 logic::AbstractAdaptationLogic *adaptationLogic;
67 SegmentTracker *segmentTracker;
68 http::Chunk *currentChunk;
72 class AbstractStreamOutput
75 AbstractStreamOutput(demux_t *);
76 virtual ~AbstractStreamOutput();
78 virtual void pushBlock(block_t *);
79 mtime_t getPCR() const;
82 bool seekAble() const;
83 void setPosition(mtime_t);
89 es_out_t *fakeesout; /* to intercept/proxy what is sent from demuxstream */
90 stream_t *demuxstream;
95 static es_out_id_t *esOutAdd(es_out_t *, const es_format_t *);
96 static int esOutSend(es_out_t *, es_out_id_t *, block_t *);
97 static void esOutDel(es_out_t *, es_out_id_t *);
98 static int esOutControl(es_out_t *, int, va_list);
99 static void esOutDestroy(es_out_t *);
102 class MP4StreamOutput : public AbstractStreamOutput
105 MP4StreamOutput(demux_t *);
106 virtual ~MP4StreamOutput(){}
109 class MPEG2TSStreamOutput : public AbstractStreamOutput
112 MPEG2TSStreamOutput(demux_t *);
113 virtual ~MPEG2TSStreamOutput(){}
117 #endif // STREAMS_HPP