Cleanup a bunch of the code and the interface itself

This commit is contained in:
Cameron Gutman
2014-01-20 19:11:25 -05:00
parent 3b057e4a6b
commit d6c77b0323
18 changed files with 473 additions and 126 deletions
+19 -29
View File
@@ -1,8 +1,6 @@
#pragma once
#include "Platform.h"
#include "PlatformSockets.h"
#include "Video.h"
#define IP_ADDRESS unsigned int
typedef struct _STREAM_CONFIGURATION {
int width;
@@ -10,11 +8,22 @@ typedef struct _STREAM_CONFIGURATION {
int fps;
} STREAM_CONFIGURATION, *PSTREAM_CONFIGURATION;
typedef void (*DecoderRendererSetup)(int width, int height, int redrawRate, void* context, int drFlags);
typedef void (*DecoderRendererStart)(void);
typedef void (*DecoderRendererStop)(void);
typedef void (*DecoderRendererRelease)(void);
typedef void (*DecoderRendererSubmitDecodeUnit)(PDECODE_UNIT decodeUnit);
typedef struct _LENTRY {
struct _LENTRY *next;
char* data;
int length;
} LENTRY, *PLENTRY;
typedef struct _DECODE_UNIT {
int fullLength;
PLENTRY bufferList;
} DECODE_UNIT, *PDECODE_UNIT;
typedef void(*DecoderRendererSetup)(int width, int height, int redrawRate, void* context, int drFlags);
typedef void(*DecoderRendererStart)(void);
typedef void(*DecoderRendererStop)(void);
typedef void(*DecoderRendererRelease)(void);
typedef void(*DecoderRendererSubmitDecodeUnit)(PDECODE_UNIT decodeUnit);
typedef struct _DECODER_RENDERER_CALLBACKS {
DecoderRendererSetup setup;
@@ -24,24 +33,5 @@ typedef struct _DECODER_RENDERER_CALLBACKS {
DecoderRendererSubmitDecodeUnit submitDecodeUnit;
} DECODER_RENDERER_CALLBACKS, *PDECODER_RENDERER_CALLBACKS;
#include <stdio.h>
#define Limelog printf
char* allocateConfigDataForStreamConfig(PSTREAM_CONFIGURATION streamConfig);
int getConfigDataSize(PSTREAM_CONFIGURATION streamConfig);
int initializeControlStream(IP_ADDRESS host, PSTREAM_CONFIGURATION streamConfig);
int startControlStream(void);
int stopControlStream(void);
void requestIdrFrame(void);
int performHandshake(IP_ADDRESS host);
void initializeVideoDepacketizer(void);
void processRtpPayload(PNV_VIDEO_PACKET videoPacket, int length);
PDECODE_UNIT getNextDecodeUnit(void);
void freeDecodeUnit(PDECODE_UNIT decodeUnit);
void queueRtpPacket(PRTP_PACKET rtpPacket, int length);
void initializeVideoStream(IP_ADDRESS host, PSTREAM_CONFIGURATION streamConfig, PDECODER_RENDERER_CALLBACKS drCallbacks);
int startVideoStream(void* rendererContext, int drFlags);
int LiStartConnection(IP_ADDRESS host, PSTREAM_CONFIGURATION streamConfig, PDECODER_RENDERER_CALLBACKS drCallbacks);
void LiStopConnection(void);