AVPKit
IStreamCoder.cpp
1 /*******************************************************************************
2  * Copyright (c) 2024, 2026, Olivier Ayache. All rights reserved.
3  *
4  * This file is part of AVPKit.
5  *
6  * AVPKit is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * AVPKit 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.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with AVPKit. If not, see <http://www.gnu.org/licenses/>.
18  *******************************************************************************/
19 
20 #include "IStreamCoder.h"
21 #include "Global.h"
22 #include "StreamCoder.h"
23 #include "Codec.h"
24 namespace com { namespace avpkit { namespace core
25 {
26 
27  IStreamCoder :: IStreamCoder()
28  {
29  }
30 
31  IStreamCoder :: ~IStreamCoder()
32  {
33  }
34 
35  IStreamCoder*
37  {
38  Global::init();
39  return IStreamCoder::make(direction, (ICodec*)0);
40  }
41 
44  {
45  Global::init();
46  return StreamCoder::make(direction, coder);
47  }
48 
51  {
52  Global::init();
53  return StreamCoder::make(direction, dynamic_cast<Codec*>(codec));
54  }
55 
58  {
59  Global::init();
60  return StreamCoder::make(direction, id);
61  }
62 
63 }}}
static void init()
Internal Only.
Definition: Global.cpp:157
A "key" to an IStreamCoder that tells it how to encode or decode data.
Definition: ICodec.h:53
ID
These are the codecs this library currently supports.
Definition: ICodec.h:61
The work horse of the AVPKit: Takes IPacket data from an IContainer (representing an IStream) and an ...
Definition: IStreamCoder.h:45
static IStreamCoder * make(Direction direction)
Direction
The Direction in which this StreamCoder will work.
Definition: IStreamCoder.h:52
static StreamCoder * make(Direction direction)
This method creates a StreamCoder that is not tied to any container or stream.
WARNING: Do not use logging in this class, and do not set any static file variables to values other t...