整理代码

This commit is contained in:
xiongzilaing
2017-04-25 11:35:41 +08:00
parent 5ae69f6e57
commit 0eb82e4627
75 changed files with 260 additions and 252 deletions

View File

@@ -2,22 +2,18 @@
#define __rtmp_h
#include <netinet/in.h>
#include "Util/util.h"
#include <string>
#include <memory>
#include <string>
#include "Util/util.h"
#include "Util/logger.h"
using namespace std;
using namespace ZL::Util;
#define PORT 1935
#define DEFAULT_CHUNK_LEN 128
#define PACKED __attribute__((packed))
#define HANDSHAKE_PLAINTEXT 0x03
#define RANDOM_LEN (1536 - 8)
#define MSG_SET_CHUNK 1 /*Set Chunk Size (1)*/
@@ -36,7 +32,6 @@ using namespace ZL::Util;
#define MSG_OBJECT 19 /*Shared Object Message (19, 16) AMF0*/
#define MSG_AGGREGATE 22 /*Aggregate Message (22)*/
#define CONTROL_STREAM_BEGIN 0
#define CONTROL_STREAM_EOF 1
#define CONTROL_STREAM_DRY 2
@@ -45,7 +40,6 @@ using namespace ZL::Util;
#define CONTROL_PING_REQUEST 6
#define CONTROL_PING_RESPONSE 7
#define STREAM_CONTROL 0
#define STREAM_MEDIA 1

View File

@@ -7,8 +7,8 @@
#include "RtmpMediaSource.h"
#include "MedaiFile/MediaReader.h"
using namespace ZL::MediaFile;
using namespace ZL::MediaFile;
namespace ZL {
namespace Rtmp {

View File

@@ -8,24 +8,23 @@
#ifndef SRC_RTMP_RTMPMEDIASOURCE_H_
#define SRC_RTMP_RTMPMEDIASOURCE_H_
#include "config.h"
#include <netinet/in.h>
#include "Util/NoticeCenter.h"
#include "Util/ResourcePool.h"
#include <mutex>
#include <memory>
#include <string>
#include <functional>
#include <memory>
#include "Util/RingBuffer.hpp"
#include <unordered_map>
#include <mutex>
#include "Util/logger.h"
#include "Thread/ThreadPool.hpp"
#include "Util/TimeTicker.h"
#include "amf.h"
#include "Rtmp.h"
#include "Util/util.h"
#include "config.h"
#include "MediaSender.h"
#include <mutex>
#include "Util/util.h"
#include "Util/logger.h"
#include "Util/RingBuffer.h"
#include "Util/TimeTicker.h"
#include "Util/ResourcePool.h"
#include "Util/NoticeCenter.h"
#include "Thread/ThreadPool.h"
using namespace std;
using namespace ZL::Util;

View File

@@ -8,16 +8,18 @@
#ifndef SRC_RTMP_RTMPPARSER_H_
#define SRC_RTMP_RTMPPARSER_H_
#include "Rtmp.h"
#include "amf.h"
#include "Player/Player.h"
#include <unordered_map>
#include "Util/TimeTicker.h"
#include <functional>
#include <unordered_map>
#include "amf.h"
#include "Rtmp.h"
#include "Player/Player.h"
#include "Util/TimeTicker.h"
#include "Player/PlayerBase.h"
using namespace std;
using namespace ZL::Util;
using namespace ZL::Player;
namespace ZL {
namespace Rtmp {

View File

@@ -6,11 +6,12 @@
*/
#include "RtmpPlayer.h"
#include "Thread/ThreadPool.hpp"
#include "Rtsp/Rtsp.h"
#include "Rtmp/utils.h"
#include "Util/util.h"
#include "Util/onceToken.h"
#include "Rtmp/utils.h"
#include "Rtsp/Rtsp.h"
#include "Thread/ThreadPool.h"
using namespace ZL::Util;
namespace ZL {

View File

@@ -9,18 +9,18 @@
#define SRC_RTMP_RtmpPlayer2_H_
#include <netinet/in.h>
#include "Player/PlayerBase.h"
#include <string>
#include "Util/logger.h"
#include "Util/util.h"
#include "Network/Socket.hpp"
#include "Network/TcpClient.h"
#include "Util/TimeTicker.h"
#include <functional>
#include "Rtmp.h"
#include <memory>
#include <string>
#include <functional>
#include "amf.h"
#include "Rtmp.h"
#include "RtmpProtocol.h"
#include "Player/PlayerBase.h"
#include "Util/util.h"
#include "Util/logger.h"
#include "Util/TimeTicker.h"
#include "Network/Socket.h"
#include "Network/TcpClient.h"
using namespace std;
using namespace ZL::Util;

View File

@@ -8,13 +8,13 @@
#ifndef SRC_RTMP_RTMPPLAYERIMP_H_
#define SRC_RTMP_RTMPPLAYERIMP_H_
#include <functional>
#include <memory>
#include <functional>
#include "config.h"
#include "RtmpPlayer.h"
#include "RtmpParser.h"
#include "config.h"
#include "Poller/Timer.h"
#include "Util/TimeTicker.h"
#include "Poller/Timer.hpp"
using namespace std;
using namespace ZL::Util;

View File

@@ -6,11 +6,12 @@
*/
#include "RtmpProtocol.h"
#include "Thread/ThreadPool.hpp"
#include "Rtsp/Rtsp.h"
#include "Rtmp/utils.h"
#include "Util/util.h"
#include "Util/onceToken.h"
#include "Rtmp/utils.h"
#include "Rtsp/Rtsp.h"
#include "Thread/ThreadPool.h"
using namespace ZL::Util;
namespace ZL {

View File

@@ -9,15 +9,15 @@
#define SRC_RTMP_RTMPPROTOCOL_H_
#include <netinet/in.h>
#include <string>
#include "Util/logger.h"
#include "Util/util.h"
#include "Network/Socket.hpp"
#include "Util/TimeTicker.h"
#include <functional>
#include "Rtmp.h"
#include <memory>
#include <string>
#include <functional>
#include "amf.h"
#include "Rtmp.h"
#include "Util/util.h"
#include "Util/logger.h"
#include "Util/TimeTicker.h"
#include "Network/Socket.h"
using namespace std;
using namespace ZL::Util;

View File

@@ -6,11 +6,11 @@
*/
#include "RtmpPusher.h"
#include "Thread/ThreadPool.hpp"
#include "Util/util.h"
#include "Util/onceToken.h"
#include "Rtmp/utils.h"
#include "Rtsp/Rtsp.h"
#include "Util/util.h"
#include "Util/onceToken.h"
#include "Thread/ThreadPool.h"
using namespace ZL::Util;

View File

@@ -9,8 +9,8 @@
#define SRC_RTMP_RTMPPUSHER_H_
#include "RtmpProtocol.h"
#include "Network/TcpClient.h"
#include "RtmpMediaSource.h"
#include "Network/TcpClient.h"
namespace ZL {
namespace Rtmp {

View File

@@ -10,15 +10,14 @@
#include <netinet/in.h>
#include <unordered_map>
#include "amf.h"
#include "Rtmp.h"
#include "utils.h"
#include "config.h"
#include "Util/util.h"
#include "Util/TimeTicker.h"
#include "RtmpProtocol.h"
#include "RtmpToRtspMediaSource.h"
#include "Util/util.h"
#include "Util/TimeTicker.h"
#include "Network/TcpLimitedSession.h"
using namespace ZL::Util;

View File

@@ -5,12 +5,12 @@
* Author: xzl
*/
#include "Network/sockutil.h"
#include "config.h"
#include "RtmpToRtspMediaSource.h"
#include "Util/util.h"
#include "Device/base64.h"
#include "Network/sockutil.h"
#include "config.h"
using namespace ZL::Util;
using namespace ZL::Network;

View File

@@ -7,23 +7,23 @@
#ifndef SRC_RTMP_RTMPTORTSPMEDIASOURCE_H_
#define SRC_RTMP_RTMPTORTSPMEDIASOURCE_H_
#include <string>
#include <functional>
#include <memory>
#include <unordered_map>
#include <mutex>
#include "Util/logger.h"
#include <string>
#include <memory>
#include <functional>
#include <unordered_map>
#include "amf.h"
#include "Rtmp.h"
#include "Util/util.h"
#include <mutex>
#include "RtmpParser.h"
#include "RtmpMediaSource.h"
#include "Rtsp/RtspMediaSource.h"
#include "RTP/RtpMakerH264.h"
#include "RTP/RtpMakerAAC.h"
#include "MedaiFile/MediaRecorder.h"
#include "Rtsp/RtpParser.h"
#include "RtmpParser.h"
#include "Rtsp/RtspMediaSource.h"
#include "MedaiFile/MediaRecorder.h"
#include "Util/util.h"
#include "Util/logger.h"
using namespace std;
using namespace ZL::Util;

View File

@@ -1,10 +1,11 @@
#include <string.h>
#include <stdexcept>
#include <arpa/inet.h>
#include "amf.h"
#include "utils.h"
#include <stdexcept>
#include <string.h>
#include <arpa/inet.h>
#include "Util/logger.h"
#include "Util/util.h"
using namespace ZL::Util;
/////////////////////AMFValue/////////////////////////////

View File

@@ -1,10 +1,11 @@
#ifndef __amf_h
#define __amf_h
#include <string>
#include <unordered_map>
#include <assert.h>
#include <string>
#include <vector>
#include <unordered_map>
enum AMFType {
AMF_NUMBER,
AMF_INTEGER,