Valkka  1.6.1
OpenSource Video Management
codec.h
Go to the documentation of this file.
1 #ifndef codec_HEADER_GUARD
2 #define codec_HEADER_GUARD
3 /*
4  * codec.h : Codec definitions (slightly outdated)
5  *
6  * (c) Copyright 2017-2024 Sampsa Riikonen
7  *
8  * Authors: Sampsa Riikonen <sampsa.riikonen@iki.fi>
9  *
10  * This file is part of the Valkka library.
11  *
12  * Valkka is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License as
14  * published by the Free Software Foundation, either version 3 of the
15  * License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * along with this program. If not, see <https://www.gnu.org/licenses/>
24  *
25  */
26 
40 enum class MediaType {
41  none,
42  video,
43  audio
44 };
45 
49 enum class Codec {
50  none,
51  h264,
52  yuv,
53  rgb,
54  pcmu
55 };
56 
57 
62 namespace H264SliceType {
63  static const unsigned none =0;
64  static const unsigned sps =7;
65  static const unsigned pps =8;
66  static const unsigned i =5;
67  static const unsigned pb =1;
68 };
69 
70 
71 struct H264Pars {
72  H264Pars() : slice_type(H264SliceType::none) {};
73  short unsigned slice_type;
74 };
75 inline std::ostream &operator<<(std::ostream &os, H264Pars const &m) {
76  return os << "H264: slice_type="<<m.slice_type;
77 }
78 
79 
80 struct SetupPars {
81  // AVCodecID codec_id; //https://ffmpeg.org/doxygen/3.0/group__lavc__core.html#gaadca229ad2c20e060a14fec08a5cc7ce
82  SetupPars() : mediatype(MediaType::none), codec(Codec::none) {};
83  MediaType mediatype;
84  Codec codec;
85 };
86 inline std::ostream &operator<<(std::ostream &os, SetupPars const &m) {
87  return os << "Setup: mediatype="<< int(m.mediatype) << " codec="<< int(m.codec);
88 }
89 
90 #endif
MediaType
Outdated.
Definition: codec.h:40
Codec
Outdated.
Definition: codec.h:49
Various H264 frame types.
Definition: codec.h:62
Definition: codec.h:71
H264Pars()
< H264 parameters
Definition: codec.h:72
Definition: codec.h:80
SetupPars()
< Setup parameters for decoders and muxers (outdated)
Definition: codec.h:82