Instrument Neutral Distributed Interface INDI  2.0.2
encodermanager.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2017 by Jasem Mutlaq <mutlaqja@ikarustech.com>
3 
4  Encoder Manager
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) any later version.
10 
11  This library 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 GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with this library; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 
20 */
21 
22 #include "encodermanager.h"
23 #include "rawencoder.h"
24 #include "mjpegencoder.h"
25 
26 namespace INDI
27 {
28 
30 {
31  encoder_list.push_back(new RawEncoder());
32  encoder_list.push_back(new MJPEGEncoder());
34 }
35 
37 {
38  std::vector<EncoderInterface *>::iterator it;
39  for (it = encoder_list.begin(); it != encoder_list.end(); it++)
40  {
41  delete (*it);
42  }
43  encoder_list.clear();
44 }
45 
46 std::vector<EncoderInterface *> EncoderManager::getEncoderList()
47 {
48  return encoder_list;
49 }
50 
52 {
53  return current_encoder;
54 }
55 
57 {
58  return default_encoder;
59 }
60 
62 {
63  current_encoder = encoder;
64 }
65 
66 }
The EncoderInterface class is the base class for video streaming encoders.
void setEncoder(EncoderInterface *encoder)
EncoderInterface * current_encoder
EncoderInterface * default_encoder
EncoderInterface * getDefaultEncoder()
EncoderInterface * getEncoder()
std::vector< EncoderInterface * > encoder_list
std::vector< EncoderInterface * > getEncoderList()
The MJPEGEncoder class encodes frames in JPEG format before transmitting them to the client.
Definition: mjpegencoder.h:35
The RawEncoder class sends the image as-is (lossless) to the client.
Definition: rawencoder.h:35
Namespace to encapsulate INDI client, drivers, and mediator classes.