StreamFormat.hpp 1.97 KB
Newer Older
1
2
3
/*
 * StreamFormat.hpp
 *****************************************************************************
4
 * Copyright (C) 2015 - VideoLAN and VLC authors
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 *
 * 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 STREAMFORMAT_HPP
#define STREAMFORMAT_HPP

23
24
#include <string>

25
namespace adaptive
26
27
28
29
30
{

    class StreamFormat
    {
        public:
31
32
33
34
35
36
37
38
39
            enum class Type
            {
                Unsupported,
                MPEG2TS,
                MP4,
                WebM,
                WebVTT,
                TTML,
                PackedAAC,
40
41
                PackedMP3,
                PackedAC3,
42
43
                Unknown,
            };
44
            static const unsigned PEEK_SIZE   = 4096;
45

46
            StreamFormat( Type = Type::Unsupported );
47
            explicit StreamFormat( const std::string &mime );
48
            StreamFormat( const void *, size_t );
49
            ~StreamFormat();
50
            operator Type() const;
51
            std::string str() const;
52
53
            bool operator==(Type) const;
            bool operator!=(Type) const;
54
            bool operator==(const StreamFormat &) const;
55
            bool operator!=(const StreamFormat &) const;
56
57

        private:
58
            Type type;
59
60
61
62
63
    };

}

#endif // STREAMFORMAT_HPP