mirror of
https://github.com/ShaYmez/xlxd.git
synced 2024-12-23 01:55:49 -05:00
104 lines
3.5 KiB
C
104 lines
3.5 KiB
C
|
//
|
||
|
// main.h
|
||
|
// ambedtest
|
||
|
//
|
||
|
// Created by Jean-Luc Deltombe (LX3JL) on 31/10/2015.
|
||
|
// Copyright © 2015 Jean-Luc Deltombe (LX3JL). All rights reserved.
|
||
|
//
|
||
|
// ----------------------------------------------------------------------------
|
||
|
// This file is part of xlxd.
|
||
|
//
|
||
|
// xlxd is free software: you can redistribute it and/or modify
|
||
|
// it under the terms of the GNU General Public License as published by
|
||
|
// the Free Software Foundation, either version 3 of the License, or
|
||
|
// (at your option) any later version.
|
||
|
//
|
||
|
// xlxd 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 General Public License for more details.
|
||
|
//
|
||
|
// You should have received a copy of the GNU General Public License
|
||
|
// along with Foobar. If not, see <http://www.gnu.org/licenses/>.
|
||
|
// ----------------------------------------------------------------------------
|
||
|
|
||
|
#ifndef main_h
|
||
|
#define main_h
|
||
|
|
||
|
#include <vector>
|
||
|
#include <array>
|
||
|
#include <map>
|
||
|
#include <queue>
|
||
|
#include <chrono>
|
||
|
#include <thread>
|
||
|
#include <mutex>
|
||
|
#include <atomic>
|
||
|
#include <condition_variable>
|
||
|
#include <ctime>
|
||
|
#include <cctype>
|
||
|
#include <iostream>
|
||
|
#include <iomanip>
|
||
|
#include <fstream>
|
||
|
#include <algorithm>
|
||
|
#include <arpa/inet.h>
|
||
|
|
||
|
////////////////////////////////////////////////////////////////////////////////////////
|
||
|
// defines
|
||
|
|
||
|
// version -----------------------------------------------------
|
||
|
|
||
|
#define VERSION_MAJOR 1
|
||
|
#define VERSION_MINOR 0
|
||
|
#define VERSION_REVISION 0
|
||
|
|
||
|
// global ------------------------------------------------------
|
||
|
|
||
|
|
||
|
// Transcoder server --------------------------------------------
|
||
|
|
||
|
#define TRANSCODER_PORT 10100 // UDP port
|
||
|
#define TRANSCODER_KEEPALIVE_PERIOD 5 // in seconds
|
||
|
#define TRANSCODER_KEEPALIVE_TIMEOUT 30 // in seconds
|
||
|
#define TRANSCODER_AMBEPACKET_TIMEOUT 400 // in ms
|
||
|
|
||
|
// codec --------------------------------------------------------
|
||
|
|
||
|
#define CODEC_NONE 0
|
||
|
#define CODEC_AMBEPLUS 1 // DStar
|
||
|
#define CODEC_AMBE2PLUS 2 // DMR
|
||
|
|
||
|
|
||
|
|
||
|
// system constants ---------------------------------------------
|
||
|
|
||
|
|
||
|
////////////////////////////////////////////////////////////////////////////////////////
|
||
|
// typedefs
|
||
|
|
||
|
typedef unsigned char uint8;
|
||
|
typedef unsigned short uint16;
|
||
|
typedef unsigned int uint32;
|
||
|
typedef unsigned int uint;
|
||
|
|
||
|
|
||
|
////////////////////////////////////////////////////////////////////////////////////////
|
||
|
// macros
|
||
|
|
||
|
#define MIN(a,b) ((a) < (b))?(a):(b)
|
||
|
#define MAX(a,b) ((a) > (b))?(a):(b)
|
||
|
#define MAKEWORD(low, high) ((uint16)(((uint8)(low)) | (((uint16)((uint8)(high))) << 8)))
|
||
|
#define MAKEDWORD(low, high) ((uint32)(((uint16)(low)) | (((uint32)((uint16)(high))) << 16)))
|
||
|
#define LOBYTE(w) ((uint8)(uint16)(w & 0x00FF))
|
||
|
#define HIBYTE(w) ((uint8)((((uint16)(w)) >> 8) & 0xFF))
|
||
|
#define LOWORD(dw) ((uint16)(uint32)(dw & 0x0000FFFF))
|
||
|
#define HIWORD(dw) ((uint16)((((uint32)(dw)) >> 16) & 0xFFFF))
|
||
|
|
||
|
////////////////////////////////////////////////////////////////////////////////////////
|
||
|
// global objects
|
||
|
|
||
|
class CTranscoder;
|
||
|
extern CTranscoder g_Transcoder;
|
||
|
|
||
|
////////////////////////////////////////////////////////////////////////////////////////
|
||
|
#endif /* main_h */
|