libeplayer3-arm: Code formatting

This commit is contained in:
max_10
2018-01-06 22:02:22 +01:00
committed by Thilo Graf
parent 0cdc859110
commit f72e8edc2e
48 changed files with 249 additions and 191 deletions

View File

@@ -35,7 +35,7 @@
static short debug_level = 0;
#define container_printf(level, x...) do { \
if (debug_level >= level) printf(x); } while (0)
if (debug_level >= level) printf(x); } while (0)
#else
#define container_printf(level, x...)
#endif
@@ -98,11 +98,12 @@ static int32_t selectContainer(Context_t *context, char *extension)
return ret;
}
static int Command(void *_context, ContainerCmd_t command, void *argument)
static int Command(void *_context, ContainerCmd_t command, void *argument)
{
Context_t *context = (Context_t *) _context;
int ret = 0;
container_printf(10, "%s::%s\n", __FILE__, __FUNCTION__);
switch (command)
{
case CONTAINER_ADD:

View File

@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
@@ -40,7 +41,6 @@
#include <sys/poll.h>
#include <pthread.h>
#include <sys/prctl.h>
#include <stdint.h>
#include <libavutil/avutil.h>
#include <libavutil/time.h>
@@ -84,7 +84,7 @@
static short debug_level = 1;
#define ffmpeg_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define ffmpeg_printf(level, fmt, x...)
#endif
@@ -115,7 +115,7 @@ static short debug_level = 1;
typedef enum {RTMP_NATIVE, RTMP_LIBRTMP, RTMP_NONE} eRTMPProtoImplType;
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static pthread_mutex_t mutex;
@@ -438,8 +438,8 @@ static char *Codec2Encoding(int32_t codec_id, int32_t media_type, uint8_t *extra
case AV_CODEC_ID_MOV_TEXT:
case AV_CODEC_ID_HDMV_PGS_SUBTITLE:
case AV_CODEC_ID_DVB_TELETEXT:
// case CODEC_ID_DVB_TELETEXT:
// return "S_TEXT/SRT"; /* fixme */
// case CODEC_ID_DVB_TELETEXT:
// return "S_TEXT/SRT"; /* fixme */
case AV_CODEC_ID_TEXT: ///< raw UTF-8 text
return "S_TEXT/UTF-8";
case AV_CODEC_ID_SRT:
@@ -2644,9 +2644,9 @@ static int container_ffmpeg_get_metadata(Context_t * context, char ***p)
return cERR_CONTAINER_FFMPEG_NO_ERROR;
}
static int32_t Command(void *_context, ContainerCmd_t command, void *argument)
static int32_t Command(void *_context, ContainerCmd_t command, void *argument)
{
Context_t *context = (Context_t *) _context;
Context_t *context = (Context_t *) _context;
int ret = cERR_CONTAINER_FFMPEG_NO_ERROR;
ffmpeg_printf(50, "Command %d\n", command);
if (command != CONTAINER_SET_BUFFER_SEEK_TIME &&

View File

@@ -34,8 +34,8 @@ typedef struct Track_s
int32_t AVIdx;
/* new field for ffmpeg - add at the end so no problem
* can occur with not changed srt saa container
*/
* can occur with not changed srt saa container
*/
char *language;
/* length of track */

View File

@@ -86,4 +86,5 @@ Writer_t *getDefaultVideoWriter();
Writer_t *getDefaultAudioWriter();
ssize_t write_with_retry(int fd, const void *buf, size_t size);
ssize_t writev_with_retry(int fd, const struct iovec *iov, size_t ic);
#endif

View File

@@ -31,6 +31,7 @@
/* ***************************** */
/* Makros/Constants */
/* ***************************** */
#define TRACKWRAP 20
//#define SAM_WITH_DEBUG
@@ -45,7 +46,7 @@
static short debug_level = 40;
#define audio_mgr_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] \n" fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] \n" fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define audio_mgr_printf(level, x...)
#endif
@@ -67,7 +68,7 @@ static const char FILENAME[] = __FILE__;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static Track_t *Tracks = NULL;
@@ -82,7 +83,7 @@ static int CurrentTrack = 0; //TRACK[0] as default.
/* Functions */
/* ***************************** */
static int ManagerAdd(Context_t *context, Track_t track)
static int ManagerAdd(Context_t *context, Track_t track)
{
audio_mgr_printf(10, "%s::%s name=\"%s\" encoding=\"%s\" id=%d\n", FILENAME, __FUNCTION__, track.Name, track.Encoding, track.Id);
if (Tracks == NULL)
@@ -213,9 +214,9 @@ static int ManagerDel(Context_t *context)
return cERR_AUDIO_MGR_NO_ERROR;
}
static int Command(void *_context, ManagerCmd_t command, void *argument)
static int Command(void *_context, ManagerCmd_t command, void *argument)
{
Context_t *context = (Context_t *) _context;
Context_t *context = (Context_t *) _context;
int ret = cERR_AUDIO_MGR_NO_ERROR;
audio_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
switch (command)

View File

@@ -61,7 +61,7 @@ static const char FILENAME[] = __FILE__;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static Track_t *Tracks = NULL;

View File

@@ -34,7 +34,7 @@
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
extern Manager_t AudioManager;
@@ -58,6 +58,7 @@ ManagerHandler_t ManagerHandler =
/* ***************************** */
/* Functions */
/* ***************************** */
void copyTrack(Track_t *to, Track_t *from)
{
if (NULL != to && NULL != from)

View File

@@ -30,6 +30,7 @@
/* ***************************** */
/* Makros/Constants */
/* ***************************** */
#define TRACKWRAP 20
//#define SAM_WITH_DEBUG

View File

@@ -30,6 +30,7 @@
/* ***************************** */
/* Makros/Constants */
/* ***************************** */
#define TRACKWRAP 4
#ifdef SAM_WITH_DEBUG
@@ -43,7 +44,7 @@
static short debug_level = 0;
#define video_mgr_printf(level, x...) do { \
if (debug_level >= level) printf(x); } while (0)
if (debug_level >= level) printf(x); } while (0)
#else
#define video_mgr_printf(level, x...)
#endif
@@ -65,7 +66,7 @@ static const char FILENAME[] = __FILE__;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static Track_t *Tracks = NULL;
@@ -73,6 +74,7 @@ static int TrackCount = 0;
static int CurrentTrack = 0; //TRACK[0] as default.
static void (* updatedTrackInfoFnc)(void) = NULL;
/* ***************************** */
/* Prototypes */
/* ***************************** */
@@ -81,7 +83,7 @@ static void (* updatedTrackInfoFnc)(void) = NULL;
/* Functions */
/* ***************************** */
static int ManagerAdd(Context_t *context, Track_t track)
static int ManagerAdd(Context_t *context, Track_t track)
{
video_mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
if (Tracks == NULL)
@@ -125,7 +127,7 @@ static int ManagerAdd(Context_t *context, Track_t track)
return cERR_VIDEO_MGR_NO_ERROR;
}
static char **ManagerList(Context_t * context __attribute__((unused)))
static char **ManagerList(Context_t *context __attribute__((unused)))
{
int i = 0, j = 0;
char **tracklist = NULL;
@@ -181,7 +183,7 @@ static int ManagerDel(Context_t *context)
return cERR_VIDEO_MGR_NO_ERROR;
}
static int Command(void *_context, ManagerCmd_t command, void *argument)
static int Command(void *_context, ManagerCmd_t command, void *argument)
{
Context_t *context = (Context_t *) _context;
int ret = cERR_VIDEO_MGR_NO_ERROR;

View File

@@ -48,6 +48,7 @@
/* ***************************** */
/* Makros/Constants */
/* ***************************** */
// SULGE DEBUG
//#define SAM_WITH_DEBUG
@@ -63,7 +64,7 @@ static const char FILENAME[] = __FILE__;
#ifdef LINUXDVB_DEBUG
#define linuxdvb_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x ); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x ); } while (0)
#else
#define linuxdvb_printf(level, fmt, x...)
#endif
@@ -77,11 +78,11 @@ static const char FILENAME[] = __FILE__;
#define cERR_LINUXDVB_NO_ERROR 0
#define cERR_LINUXDVB_ERROR -1
static const char VIDEODEV[] = "/dev/dvb/adapter0/video0";
static const char AUDIODEV[] = "/dev/dvb/adapter0/audio0";
static const char VIDEODEV[] = "/dev/dvb/adapter0/video0";
static const char AUDIODEV[] = "/dev/dvb/adapter0/audio0";
static int videofd = -1;
static int audiofd = -1;
static int videofd = -1;
static int audiofd = -1;
struct DVBApiVideoInfo_s
{
@@ -99,10 +100,11 @@ pthread_mutex_t LinuxDVBmutex;
/* ***************************** */
/* Prototypes */
/* ***************************** */
int LinuxDvbStop(Context_t *context, char *type);
int LinuxDvbStop(Context_t *context, char *type);
/* ***************************** */
/* MISC Functions */
/* Functions */
/* ***************************** */
void getLinuxDVBMutex(const char *filename __attribute__((unused)), const char *function __attribute__((unused)), int line __attribute__((unused)))
@@ -127,7 +129,7 @@ static int LinuxDvbMapBypassMode(int bypass)
return bypass;
}
int LinuxDvbOpen(Context_t *context __attribute__((unused)), char *type)
int LinuxDvbOpen(Context_t *context __attribute__((unused)), char *type)
{
unsigned char video = !strcmp("video", type);
unsigned char audio = !strcmp("audio", type);
@@ -185,7 +187,7 @@ int LinuxDvbOpen(Context_t *context __attribute__((unused)), char *type)
return cERR_LINUXDVB_NO_ERROR;
}
int LinuxDvbClose(Context_t *context, char *type)
int LinuxDvbClose(Context_t *context, char *type)
{
unsigned char video = !strcmp("video", type);
unsigned char audio = !strcmp("audio", type);
@@ -210,7 +212,7 @@ int LinuxDvbClose(Context_t *context, char *type)
return cERR_LINUXDVB_NO_ERROR;
}
int LinuxDvbPlay(Context_t *context, char *type)
int LinuxDvbPlay(Context_t *context, char *type)
{
int ret = cERR_LINUXDVB_NO_ERROR;
Writer_t *writer;
@@ -313,7 +315,7 @@ int LinuxDvbPlay(Context_t *context, char *type)
return 0;
}
int LinuxDvbStop(Context_t *context __attribute__((unused)), char *type)
int LinuxDvbStop(Context_t *context __attribute__((unused)), char *type)
{
int ret = cERR_LINUXDVB_NO_ERROR;
unsigned char video = !strcmp("video", type);
@@ -362,7 +364,7 @@ int LinuxDvbStop(Context_t *context __attribute__((unused)), char *type)
return ret;
}
int LinuxDvbPause(Context_t *context __attribute__((unused)), char *type)
int LinuxDvbPause(Context_t *context __attribute__((unused)), char *type)
{
int ret = cERR_LINUXDVB_NO_ERROR;
unsigned char video = !strcmp("video", type);
@@ -391,7 +393,7 @@ int LinuxDvbPause(Context_t *context __attribute__((unused)), char *type)
return ret;
}
int LinuxDvbContinue(Context_t *context __attribute__((unused)), char *type)
int LinuxDvbContinue(Context_t *context __attribute__((unused)), char *type)
{
int ret = cERR_LINUXDVB_NO_ERROR;
unsigned char video = !strcmp("video", type);
@@ -419,7 +421,7 @@ int LinuxDvbContinue(Context_t *context __attribute__((unused)), char *type)
return ret;
}
int LinuxDvbReverseDiscontinuity(Context_t *context __attribute__((unused)), int *surplus)
int LinuxDvbReverseDiscontinuity(Context_t *context __attribute__((unused)), int *surplus)
{
int ret = cERR_LINUXDVB_NO_ERROR;
// int dis_type = VIDEO_DISCONTINUITY_CONTINUOUS_REVERSE | *surplus;
@@ -433,7 +435,7 @@ int LinuxDvbReverseDiscontinuity(Context_t *context __attribute__((unused)), in
return ret;
}
int LinuxDvbAudioMute(Context_t *context __attribute__((unused)), char *flag)
int LinuxDvbAudioMute(Context_t *context __attribute__((unused)), char *flag)
{
int ret = cERR_LINUXDVB_NO_ERROR;
linuxdvb_printf(10, "\n");
@@ -468,7 +470,7 @@ int LinuxDvbAudioMute(Context_t *context __attribute__((unused)), char *flag)
return ret;
}
int LinuxDvbFlush(Context_t *context __attribute__((unused)), char *type)
int LinuxDvbFlush(Context_t *context __attribute__((unused)), char *type)
{
// unsigned char video = !strcmp("video", type);
// unsigned char audio = !strcmp("audio", type);
@@ -496,7 +498,7 @@ int LinuxDvbFlush(Context_t *context __attribute__((unused)), char *type)
}
#ifndef use_set_speed_instead_ff
int LinuxDvbFastForward(Context_t *context, char *type)
int LinuxDvbFastForward(Context_t *context, char *type)
{
int ret = cERR_LINUXDVB_NO_ERROR;
unsigned char video = !strcmp("video", type);
@@ -527,7 +529,7 @@ static unsigned int SpeedList[] =
125, 250, 500, 700, 800, 900
};
int LinuxDvbFastForward(Context_t *context, char *type)
int LinuxDvbFastForward(Context_t *context, char *type)
{
int ret = cERR_LINUXDVB_NO_ERROR;
int speedIndex;
@@ -565,13 +567,13 @@ int LinuxDvbFastForward(Context_t *context, char *type)
}
#endif
int LinuxDvbReverse(Context_t *context __attribute__((unused)), char *type __attribute__((unused)))
int LinuxDvbReverse(Context_t *context __attribute__((unused)), char *type __attribute__((unused)))
{
int ret = cERR_LINUXDVB_NO_ERROR;
return ret;
}
int LinuxDvbSlowMotion(Context_t *context, char *type)
int LinuxDvbSlowMotion(Context_t *context, char *type)
{
int ret = cERR_LINUXDVB_NO_ERROR;
unsigned char video = !strcmp("video", type);
@@ -595,7 +597,7 @@ int LinuxDvbSlowMotion(Context_t *context, char *type)
return ret;
}
int LinuxDvbAVSync(Context_t *context, char *type __attribute__((unused)))
int LinuxDvbAVSync(Context_t *context, char *type __attribute__((unused)))
{
int ret = cERR_LINUXDVB_NO_ERROR;
/* konfetti: this one is dedicated to audiofd so we
@@ -618,7 +620,7 @@ int LinuxDvbAVSync(Context_t *context, char *type __attribute__((unused)))
return ret;
}
int LinuxDvbClear(Context_t *context __attribute__((unused)), char *type)
int LinuxDvbClear(Context_t *context __attribute__((unused)), char *type)
{
int32_t ret = cERR_LINUXDVB_NO_ERROR;
uint8_t video = !strcmp("video", type);
@@ -651,7 +653,7 @@ int LinuxDvbClear(Context_t *context __attribute__((unused)), char *type)
return ret;
}
int LinuxDvbPts(Context_t *context __attribute__((unused)), unsigned long long int *pts)
int LinuxDvbPts(Context_t *context __attribute__((unused)), unsigned long long int *pts)
{
int ret = cERR_LINUXDVB_ERROR;
linuxdvb_printf(50, "\n");
@@ -691,7 +693,7 @@ int LinuxDvbGetFrameCount(Context_t *context __attribute__((unused)), unsigned
return ret;
}
int LinuxDvbSwitch(Context_t *context, char *type)
int LinuxDvbSwitch(Context_t *context, char *type)
{
unsigned char audio = !strcmp("audio", type);
unsigned char video = !strcmp("video", type);
@@ -801,7 +803,7 @@ int LinuxDvbSwitch(Context_t *context, char *type)
return cERR_LINUXDVB_NO_ERROR;
}
static int Write(void *_context, void *_out)
static int Write(void *_context, void *_out)
{
Context_t *context = (Context_t *) _context;
AudioVideoOut_t *out = (AudioVideoOut_t *) _out;
@@ -953,10 +955,10 @@ static int Write(void *_context, void *_out)
return ret;
}
static int reset(Context_t *context)
static int reset(Context_t *context)
{
int ret = cERR_LINUXDVB_NO_ERROR;
Writer_t *writer;
Writer_t *writer;
char *Encoding = NULL;
context->manager->video->Command(context, MANAGER_GETENCODING, &Encoding);
writer = getWriter(Encoding);
@@ -985,7 +987,7 @@ static int reset(Context_t *context)
return ret;
}
static int Command(void *_context, OutputCmd_t command, void *argument)
static int Command(void *_context, OutputCmd_t command, void *argument)
{
Context_t *context = (Context_t *) _context;
int ret = cERR_LINUXDVB_NO_ERROR;

View File

@@ -59,7 +59,7 @@ static const char FILENAME[] = __FILE__;
#ifdef LINUXDVB_DEBUG
#define linuxdvb_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x ); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x ); } while (0)
#else
#define linuxdvb_printf(x...)
#endif
@@ -73,11 +73,11 @@ static const char FILENAME[] = __FILE__;
#define cERR_LINUXDVB_NO_ERROR 0
#define cERR_LINUXDVB_ERROR -1
static const char VIDEODEV[] = "/dev/dvb/adapter0/video0";
static const char AUDIODEV[] = "/dev/dvb/adapter0/audio0";
static const char VIDEODEV[] = "/dev/dvb/adapter0/video0";
static const char AUDIODEV[] = "/dev/dvb/adapter0/audio0";
static int videofd = -1;
static int audiofd = -1;
static int videofd = -1;
static int audiofd = -1;
struct DVBApiVideoInfo_s
{
@@ -95,10 +95,11 @@ pthread_mutex_t LinuxDVBmutex;
/* ***************************** */
/* Prototypes */
/* ***************************** */
int LinuxDvbStop(Context_t *context, char *type);
int LinuxDvbStop(Context_t *context, char *type);
/* ***************************** */
/* MISC Functions */
/* Functions */
/* ***************************** */
void getLinuxDVBMutex(const char *filename __attribute__((unused)), const char *function __attribute__((unused)), int line __attribute__((unused)))
@@ -114,7 +115,7 @@ void releaseLinuxDVBMutex(const char *filename __attribute__((unused)), const ch
linuxdvb_printf(250, "released mutex\n");
}
int LinuxDvbOpen(Context_t *context __attribute__((unused)), char *type)
int LinuxDvbOpen(Context_t *context __attribute__((unused)), char *type)
{
unsigned char video = !strcmp("video", type);
unsigned char audio = !strcmp("audio", type);
@@ -179,7 +180,7 @@ int LinuxDvbOpen(Context_t *context __attribute__((unused)), char *type)
return cERR_LINUXDVB_NO_ERROR;
}
int LinuxDvbClose(Context_t *context, char *type)
int LinuxDvbClose(Context_t *context, char *type)
{
unsigned char video = !strcmp("video", type);
unsigned char audio = !strcmp("audio", type);
@@ -204,7 +205,7 @@ int LinuxDvbClose(Context_t *context, char *type)
return cERR_LINUXDVB_NO_ERROR;
}
int LinuxDvbPlay(Context_t *context, char *type)
int LinuxDvbPlay(Context_t *context, char *type)
{
int ret = cERR_LINUXDVB_NO_ERROR;
Writer_t *writer;
@@ -282,7 +283,7 @@ int LinuxDvbPlay(Context_t *context, char *type)
return ret;
}
int LinuxDvbStop(Context_t *context __attribute__((unused)), char *type)
int LinuxDvbStop(Context_t *context __attribute__((unused)), char *type)
{
int ret = cERR_LINUXDVB_NO_ERROR;
unsigned char video = !strcmp("video", type);
@@ -333,7 +334,7 @@ int LinuxDvbStop(Context_t *context __attribute__((unused)), char *type)
return ret;
}
int LinuxDvbPause(Context_t *context __attribute__((unused)), char *type)
int LinuxDvbPause(Context_t *context __attribute__((unused)), char *type)
{
int ret = cERR_LINUXDVB_NO_ERROR;
unsigned char video = !strcmp("video", type);
@@ -362,7 +363,7 @@ int LinuxDvbPause(Context_t *context __attribute__((unused)), char *type)
return ret;
}
int LinuxDvbContinue(Context_t *context __attribute__((unused)), char *type)
int LinuxDvbContinue(Context_t *context __attribute__((unused)), char *type)
{
int ret = cERR_LINUXDVB_NO_ERROR;
unsigned char video = !strcmp("video", type);
@@ -390,7 +391,7 @@ int LinuxDvbContinue(Context_t *context __attribute__((unused)), char *type)
return ret;
}
int LinuxDvbReverseDiscontinuity(Context_t *context __attribute__((unused)), int *surplus)
int LinuxDvbReverseDiscontinuity(Context_t *context __attribute__((unused)), int *surplus)
{
int ret = cERR_LINUXDVB_NO_ERROR;
int dis_type = VIDEO_DISCONTINUITY_CONTINUOUS_REVERSE | *surplus;
@@ -404,7 +405,7 @@ int LinuxDvbReverseDiscontinuity(Context_t *context __attribute__((unused)), in
return ret;
}
int LinuxDvbAudioMute(Context_t *context __attribute__((unused)), char *flag)
int LinuxDvbAudioMute(Context_t *context __attribute__((unused)), char *flag)
{
int ret = cERR_LINUXDVB_NO_ERROR;
linuxdvb_printf(10, "\n");
@@ -439,7 +440,7 @@ int LinuxDvbAudioMute(Context_t *context __attribute__((unused)), char *flag)
return ret;
}
int LinuxDvbFlush(Context_t *context __attribute__((unused)), char *type)
int LinuxDvbFlush(Context_t *context __attribute__((unused)), char *type)
{
unsigned char video = !strcmp("video", type);
unsigned char audio = !strcmp("audio", type);
@@ -470,7 +471,7 @@ int LinuxDvbFlush(Context_t *context __attribute__((unused)), char *type)
}
#ifndef use_set_speed_instead_ff
int LinuxDvbFastForward(Context_t *context, char *type)
int LinuxDvbFastForward(Context_t *context, char *type)
{
int ret = cERR_LINUXDVB_NO_ERROR;
unsigned char video = !strcmp("video", type);
@@ -501,7 +502,7 @@ static unsigned int SpeedList[] =
125, 250, 500, 700, 800, 900
};
int LinuxDvbFastForward(Context_t *context, char *type)
int LinuxDvbFastForward(Context_t *context, char *type)
{
int ret = cERR_LINUXDVB_NO_ERROR;
int speedIndex;
@@ -539,13 +540,13 @@ int LinuxDvbFastForward(Context_t *context, char *type)
}
#endif
int LinuxDvbReverse(Context_t *context __attribute__((unused)), char *type __attribute__((unused)))
int LinuxDvbReverse(Context_t *context __attribute__((unused)), char *type __attribute__((unused)))
{
int ret = cERR_LINUXDVB_NO_ERROR;
return ret;
}
int LinuxDvbSlowMotion(Context_t *context, char *type)
int LinuxDvbSlowMotion(Context_t *context, char *type)
{
int ret = cERR_LINUXDVB_NO_ERROR;
unsigned char video = !strcmp("video", type);
@@ -569,7 +570,7 @@ int LinuxDvbSlowMotion(Context_t *context, char *type)
return ret;
}
int LinuxDvbAVSync(Context_t *context, char *type __attribute__((unused)))
int LinuxDvbAVSync(Context_t *context, char *type __attribute__((unused)))
{
int ret = cERR_LINUXDVB_NO_ERROR;
/* konfetti: this one is dedicated to audiofd so we
@@ -592,7 +593,7 @@ int LinuxDvbAVSync(Context_t *context, char *type __attribute__((unused)))
return ret;
}
int LinuxDvbClear(Context_t *context __attribute__((unused)), char *type)
int LinuxDvbClear(Context_t *context __attribute__((unused)), char *type)
{
int32_t ret = cERR_LINUXDVB_NO_ERROR;
uint8_t video = !strcmp("video", type);
@@ -625,7 +626,7 @@ int LinuxDvbClear(Context_t *context __attribute__((unused)), char *type)
return ret;
}
int LinuxDvbPts(Context_t *context __attribute__((unused)), unsigned long long int *pts)
int LinuxDvbPts(Context_t *context __attribute__((unused)), unsigned long long int *pts)
{
int ret = cERR_LINUXDVB_ERROR;
linuxdvb_printf(50, "\n");
@@ -659,7 +660,7 @@ int LinuxDvbPts(Context_t *context __attribute__((unused)), unsigned long long
return ret;
}
int LinuxDvbGetFrameCount(Context_t *context __attribute__((unused)), unsigned long long int *frameCount)
int LinuxDvbGetFrameCount(Context_t *context __attribute__((unused)), unsigned long long int *frameCount)
{
int ret = cERR_LINUXDVB_NO_ERROR;
dvb_play_info_t playInfo;
@@ -695,7 +696,7 @@ int LinuxDvbGetFrameCount(Context_t *context __attribute__((unused)), unsigned
return ret;
}
int LinuxDvbSwitch(Context_t *context, char *type)
int LinuxDvbSwitch(Context_t *context, char *type)
{
unsigned char audio = !strcmp("audio", type);
unsigned char video = !strcmp("video", type);
@@ -805,7 +806,7 @@ int LinuxDvbSwitch(Context_t *context, char *type)
return cERR_LINUXDVB_NO_ERROR;
}
static int Write(void *_context, void *_out)
static int Write(void *_context, void *_out)
{
Context_t *context = (Context_t *) _context;
AudioVideoOut_t *out = (AudioVideoOut_t *) _out;
@@ -957,10 +958,10 @@ static int Write(void *_context, void *_out)
return ret;
}
static int reset(Context_t *context)
static int reset(Context_t *context)
{
int ret = cERR_LINUXDVB_NO_ERROR;
Writer_t *writer;
Writer_t *writer;
char *Encoding = NULL;
context->manager->video->Command(context, MANAGER_GETENCODING, &Encoding);
writer = getWriter(Encoding);
@@ -989,7 +990,7 @@ static int reset(Context_t *context)
return ret;
}
static int Command(void *_context, OutputCmd_t command, void *argument)
static int Command(void *_context, OutputCmd_t command, void *argument)
{
Context_t *context = (Context_t *) _context;
int ret = cERR_LINUXDVB_NO_ERROR;

View File

@@ -42,7 +42,7 @@
static short debug_level = 0;
#define output_printf(level, x...) do { \
if (debug_level >= level) fprintf(stderr, x); } while (0)
if (debug_level >= level) fprintf(stderr, x); } while (0)
#else
#define output_printf(level, x...)
#endif
@@ -64,7 +64,7 @@ static const char *FILENAME = "output.c";
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static Output_t *AvailableOutput[] =
@@ -79,7 +79,7 @@ static Output_t *AvailableOutput[] =
/* ***************************** */
/* ***************************** */
/* MISC Functions */
/* Functions */
/* ***************************** */
static void printOutputCapabilities()
@@ -102,7 +102,7 @@ static void printOutputCapabilities()
/* Output Functions */
/* ***************************** */
static void OutputAdd(Context_t *context, char *port)
static void OutputAdd(Context_t *context, char *port)
{
int i, j;
output_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
@@ -132,7 +132,7 @@ static void OutputAdd(Context_t *context, char *port)
}
}
static void OutputDel(Context_t *context, char *port)
static void OutputDel(Context_t *context, char *port)
{
output_printf(10, "%s::%s\n", FILENAME, __FUNCTION__);
if (!strcmp("audio", port))
@@ -149,7 +149,7 @@ static void OutputDel(Context_t *context, char *port)
}
}
static int Command(void *_context, OutputCmd_t command, void *argument)
static int Command(void *_context, OutputCmd_t command, void *argument)
{
Context_t *context = (Context_t *) _context;
int ret = cERR_OUTPUT_NO_ERROR;

View File

@@ -53,7 +53,7 @@
static short debug_level = 0;
#define subtitle_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define subtitle_printf(level, fmt, x...)
#endif
@@ -85,7 +85,7 @@ Number, Style, Name,, MarginL, MarginR, MarginV, Effect,, Text
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static pthread_mutex_t mutex;
@@ -96,8 +96,9 @@ static int isSubtitleOpened = 0;
/* ***************************** */
/* ***************************** */
/* MISC Functions */
/* Functions */
/* ***************************** */
static void getMutex(int line)
{
subtitle_printf(100, "%d requesting mutex\n", line);
@@ -258,7 +259,7 @@ static int32_t subtitle_Close(Context_t *context __attribute__((unused)))
return cERR_SUBTITLE_NO_ERROR;
}
static int Command(void *_context, OutputCmd_t command, void *argument)
static int Command(void *_context, OutputCmd_t command, void *argument)
{
Context_t *context = (Context_t *) _context;
int ret = cERR_SUBTITLE_NO_ERROR;

View File

@@ -70,7 +70,7 @@
static short debug_level = 0;
#define aac_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define aac_printf(level, fmt, x...)
#endif
@@ -86,7 +86,7 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
/// ** AAC ADTS format **
@@ -125,7 +125,7 @@ ADTS = streaming format called Audio Data Transport Stream (ADTS)
LOAS = Low Overhead Audio Stream (LOAS), a self-synchronizing streaming format
*/
static unsigned char DefaultAACHeader[] =
static unsigned char DefaultAACHeader[] =
{
0xff,
0xf1,
@@ -143,7 +143,7 @@ LATMContext *pLATMCtx = NULL;
/* ***************************** */
/* ***************************** */
/* MISC Functions */
/* Functions */
/* ***************************** */
static int reset()

View File

@@ -61,7 +61,7 @@
static short debug_level = 0;
#define ac3_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define ac3_printf(level, fmt, x...)
#endif
@@ -77,8 +77,9 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
unsigned char AC3_SYNC_HEADER[] = {0x80, 0x01, 0x00, 0x01};
/* ***************************** */

View File

@@ -64,7 +64,7 @@
static short debug_level = 0;
#define amr_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define amr_printf(level, fmt, x...)
#endif
@@ -80,7 +80,7 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
/* ***************************** */

View File

@@ -52,6 +52,7 @@
/* ***************************** */
/* Makros/Constants */
/* ***************************** */
#define B_GET_BITS(w,e,b) (((w)>>(b))&(((unsigned)(-1))>>((sizeof(unsigned))*8-(e+1-b))))
#define B_SET_BITS(name,v,e,b) (((unsigned)(v))<<(b))
@@ -66,7 +67,7 @@
static short debug_level = 0;
#define divx_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define divx_printf(level, fmt, x...)
#endif
@@ -82,8 +83,9 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static uint8_t initialHeader = 1;
static uint8_t brcm_divx311_sequence_header[] =
{
@@ -115,7 +117,7 @@ static int writeData(void *_call)
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
unsigned char PesHeader[PES_MAX_HEADER_SIZE + 4];
unsigned char Version = 5;
unsigned int FakeStartCode = (Version << 8) | PES_VERSION_FAKE_START_CODE;
unsigned int FakeStartCode = (Version << 8) | PES_VERSION_FAKE_START_CODE;
divx_printf(10, "\n");
if (call == NULL)
{

View File

@@ -68,7 +68,7 @@
static int16_t debug_level = 0;
#define dts_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define dts_printf(level, fmt, x...)
#endif
@@ -84,7 +84,7 @@ static int16_t debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
/* ***************************** */
@@ -94,6 +94,7 @@ static int16_t debug_level = 0;
/* ***************************** */
/* MISC Functions */
/* ***************************** */
static int32_t reset()
{
return 0;

View File

@@ -59,7 +59,7 @@
static short debug_level = 0;
#define h263_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define h263_printf(level, fmt, x...)
#endif
@@ -74,7 +74,7 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
/* ***************************** */

View File

@@ -61,7 +61,7 @@
static short debug_level = 0;
#define h264_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define h264_printf(level, fmt, x...)
#endif
@@ -79,14 +79,16 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static unsigned char Head[] = {0, 0, 0, 1};
static int initialHeader = 1;
static unsigned int NalLengthBytes = 1;
static unsigned char *CodecData = NULL;
static unsigned int CodecDataLen = 0;
static int avc3 = 0;
/* ***************************** */
/* Prototypes */
/* ***************************** */

View File

@@ -61,7 +61,7 @@
static short debug_level = 10;
#define h264_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define h264_printf(level, fmt, x...)
#endif
@@ -79,13 +79,15 @@ static short debug_level = 10;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static unsigned char Head[] = {0, 0, 0, 1};
static int initialHeader = 1;
static unsigned int NalLengthBytes = 1;
static unsigned char *CodecData = NULL;
static unsigned int CodecDataLen = 0;
/* ***************************** */
/* Prototypes */
/* ***************************** */

View File

@@ -57,7 +57,9 @@
/* ***************************** */
/* Makros/Constants */
/* ***************************** */
//#define SAM_WITH_DEBUG
#ifdef SAM_WITH_DEBUG
#define LPCM_DEBUG
#else
@@ -69,7 +71,7 @@
static uint16_t debug_level = 1;
#define lpcm_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define lpcm_printf(level, fmt, x...)
#endif
@@ -87,8 +89,9 @@ static uint16_t debug_level = 1;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static uint8_t PesHeader[PES_MAX_HEADER_SIZE];
static uint8_t initialHeader = 1;

View File

@@ -59,7 +59,7 @@
static short debug_level = 0;
#define mp3_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define mp3_printf(level, fmt, x...)
#endif
@@ -75,7 +75,7 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
/* ***************************** */

View File

@@ -60,7 +60,7 @@
static short debug_level = 0;
#define mpeg2_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define mpeg2_printf(level, fmt, x...)
#endif
@@ -76,7 +76,7 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
/* ***************************** */
@@ -118,7 +118,7 @@ static int writeData(void *_call)
while (Position < call->len)
{
int PacketLength = (call->len - Position) <= MAX_PES_PACKET_SIZE ?
(call->len - Position) : MAX_PES_PACKET_SIZE;
(call->len - Position) : MAX_PES_PACKET_SIZE;
int Remaining = call->len - Position - PacketLength;
mpeg2_printf(20, "PacketLength=%d, Remaining=%d, Position=%d\n", PacketLength, Remaining, Position);
struct iovec iov[2];

View File

@@ -65,7 +65,7 @@
static short debug_level = 0;
#define mpeg4_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define mpeg4_printf(level, fmt, x...)
#endif
@@ -81,8 +81,9 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static int initialHeader = 1;
/* ***************************** */
@@ -92,6 +93,7 @@ static int initialHeader = 1;
/* ***************************** */
/* MISC Functions */
/* ***************************** */
static int reset()
{
initialHeader = 1;

View File

@@ -55,6 +55,9 @@
/* ***************************** */
/* Makros/Constants */
/* ***************************** */
//#define SAM_WITH_DEBUG
#ifdef SAM_WITH_DEBUG
#define PCM_DEBUG
#else
@@ -66,7 +69,7 @@
static uint16_t debug_level = 0;
#define pcm_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define pcm_printf(level, fmt, x...)
#endif
@@ -82,8 +85,9 @@ static uint16_t debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static uint8_t initialHeader = 1;
static uint8_t codec_data[18];
static uint64_t fixed_buffertimestamp;

View File

@@ -20,7 +20,7 @@
*/
/* ***************************** */
/* Includes */
/* Includes */
/* ***************************** */
#include <stdio.h>
@@ -50,9 +50,10 @@
#include "writer.h"
/* ***************************** */
/* Makros/Constants */
/* Makros/Constants */
/* ***************************** */
#define VC1_SEQUENCE_LAYER_METADATA_START_CODE 0x80
#define VC1_SEQUENCE_LAYER_METADATA_START_CODE 0x80
#define VC1_FRAME_START_CODE 0x0d
#define SAM_WITH_DEBUG
@@ -67,7 +68,7 @@
static short debug_level = 10;
#define vc1_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define vc1_printf(level, fmt, x...)
#endif
@@ -82,12 +83,13 @@ static short debug_level = 10;
/* Types */
/* ***************************** */
static const unsigned char SequenceLayerStartCode[] = {0x00, 0x00, 0x01, VC1_SEQUENCE_LAYER_METADATA_START_CODE};
static const uint8_t Vc1FrameStartCode[] = {0, 0, 1, VC1_FRAME_START_CODE};
static const unsigned char SequenceLayerStartCode[] = {0x00, 0x00, 0x01, VC1_SEQUENCE_LAYER_METADATA_START_CODE};
static const uint8_t Vc1FrameStartCode[] = {0, 0, 1, VC1_FRAME_START_CODE};
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static int initialHeader = 1;
static video_codec_data_t videocodecdata = {0, 0};

View File

@@ -20,7 +20,7 @@
*/
/* ***************************** */
/* Includes */
/* Includes */
/* ***************************** */
#include <stdio.h>
@@ -50,9 +50,11 @@
#include "writer.h"
/* ***************************** */
/* Makros/Constants */
/* Makros/Constants */
/* ***************************** */
//#define SAM_WITH_DEBUG
#ifdef SAM_WITH_DEBUG
#define VP_DEBUG
#else
@@ -64,7 +66,7 @@
static short debug_level = 10;
#define vp_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define vp_printf(level, fmt, x...)
#endif
@@ -80,7 +82,7 @@ static short debug_level = 10;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
/* ***************************** */
@@ -90,6 +92,7 @@ static short debug_level = 10;
/* ***************************** */
/* MISC Functions */
/* ***************************** */
static int reset()
{
return 0;

View File

@@ -53,6 +53,8 @@
/* Makros/Constants */
/* ***************************** */
//#define SAM_WITH_DEBUG
#ifdef SAM_WITH_DEBUG
#define WMA_DEBUG
#else
@@ -64,7 +66,7 @@
static short debug_level = 0;
#define wma_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define wma_printf(level, fmt, x...)
#endif
@@ -80,7 +82,7 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static int initialHeader = 1;

View File

@@ -67,7 +67,7 @@
static short debug_level = 10;
#define wmv_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define wmv_printf(level, fmt, x...)
#endif
@@ -85,8 +85,9 @@ static short debug_level = 10;
static const uint8_t Vc1FrameStartCode[] = {0, 0, 1, WMV_FRAME_START_CODE};
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static int initialHeader = 1;
static video_codec_data_t videocodecdata = {0, 0};

View File

@@ -41,7 +41,7 @@
static short debug_level = 0;
#define writer_printf(level, x...) do { \
if (debug_level >= level) printf(x); } while (0)
if (debug_level >= level) printf(x); } while (0)
#else
#define writer_printf(level, x...)
#endif
@@ -57,7 +57,7 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static Writer_t *AvailableWriter[] =

View File

@@ -68,7 +68,7 @@
static short debug_level = 0;
#define aac_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define aac_printf(level, fmt, x...)
#endif
@@ -84,7 +84,7 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
/// ** AAC ADTS format **
@@ -123,7 +123,7 @@ ADTS = streaming format called Audio Data Transport Stream (ADTS)
LOAS = Low Overhead Audio Stream (LOAS), a self-synchronizing streaming format
*/
static unsigned char DefaultAACHeader[] =
static unsigned char DefaultAACHeader[] =
{
0xff,
0xf1,

View File

@@ -63,7 +63,7 @@
static short debug_level = 0;
#define ac3_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define ac3_printf(level, fmt, x...)
#endif
@@ -79,7 +79,7 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
/* ***************************** */

View File

@@ -62,7 +62,7 @@
static short debug_level = 0;
#define divx_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define divx_printf(level, fmt, x...)
#endif
@@ -78,8 +78,9 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static int initialHeader = 1;
/* ***************************** */
@@ -89,6 +90,7 @@ static int initialHeader = 1;
/* ***************************** */
/* MISC Functions */
/* ***************************** */
static int reset()
{
initialHeader = 1;

View File

@@ -62,7 +62,7 @@
static short debug_level = 0;
#define divx_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define divx_printf(level, fmt, x...)
#endif
@@ -78,8 +78,9 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static int initialHeader = 1;
/* ***************************** */
@@ -89,6 +90,7 @@ static int initialHeader = 1;
/* ***************************** */
/* MISC Functions */
/* ***************************** */
static int reset()
{
initialHeader = 1;

View File

@@ -50,6 +50,7 @@
/* ***************************** */
/* Makros/Constants */
/* ***************************** */
#define PES_AUDIO_PRIVATE_HEADER_SIZE 16 // consider maximum private header size.
#define PES_AUDIO_HEADER_SIZE (32 + PES_AUDIO_PRIVATE_HEADER_SIZE)
#define PES_AUDIO_PACKET_SIZE 2028
@@ -66,7 +67,7 @@
static short debug_level = 0;
#define dts_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define dts_printf(level, fmt, x...)
#endif
@@ -82,7 +83,7 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
/* ***************************** */
@@ -92,6 +93,7 @@ static short debug_level = 0;
/* ***************************** */
/* MISC Functions */
/* ***************************** */
static int reset()
{
return 0;

View File

@@ -50,6 +50,7 @@
/* ***************************** */
/* Makros/Constants */
/* ***************************** */
#ifdef SAM_WITH_DEBUG
#define H263_DEBUG
#else
@@ -61,7 +62,7 @@ static short debug_level = 0;
static const char *FILENAME = "h263.c";
#define h263_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, FILENAME, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, FILENAME, __FUNCTION__, ## x); } while (0)
#else
#define h263_printf(level, fmt, x...)
#endif
@@ -71,12 +72,13 @@ static const char *FILENAME = "h263.c";
#else
#define h263_err(fmt, x...)
#endif
/* ***************************** */
/* Types */
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
/* ***************************** */

View File

@@ -63,7 +63,7 @@
static short debug_level = 0;
#define h264_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define h264_printf(level, fmt, x...)
#endif
@@ -92,12 +92,14 @@ typedef struct avcC_s
} avcC_t;
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
const uint8_t Head[] = {0, 0, 0, 1};
static int32_t initialHeader = 1;
static uint32_t NalLengthBytes = 1;
static int avc3 = 0;
/* ***************************** */
/* Prototypes */
/* ***************************** */

View File

@@ -50,6 +50,7 @@
/* ***************************** */
/* Makros/Constants */
/* ***************************** */
#ifdef SAM_WITH_DEBUG
#define MP3_DEBUG
#else
@@ -61,7 +62,7 @@
static short debug_level = 0;
#define mp3_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define mp3_printf(level, fmt, x...)
#endif
@@ -77,7 +78,7 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
/* ***************************** */
@@ -96,7 +97,7 @@ static int reset()
static int writeData(void *_call)
{
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
mp3_printf(10, "\n");
if (call == NULL)
{

View File

@@ -50,6 +50,7 @@
/* ***************************** */
/* Makros/Constants */
/* ***************************** */
#ifdef SAM_WITH_DEBUG
#define MPEG2_DEBUG
#else
@@ -61,7 +62,7 @@
static short debug_level = 0;
#define mpeg2_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define mpeg2_printf(level, fmt, x...)
#endif
@@ -77,7 +78,7 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
/* ***************************** */
@@ -96,7 +97,7 @@ static int reset()
static int writeData(void *_call)
{
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
int len = 0;
unsigned int Position = 0;
mpeg2_printf(10, "\n");

View File

@@ -53,6 +53,7 @@
/* ***************************** */
/* Makros/Constants */
/* ***************************** */
#ifdef SAM_WITH_DEBUG
#define PCM_DEBUG
#else
@@ -64,7 +65,7 @@
static short debug_level = 0;
#define pcm_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define pcm_printf(level, fmt, x...)
#endif
@@ -80,7 +81,7 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static int32_t initialHeader = 1;

View File

@@ -55,7 +55,7 @@
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
/* ***************************** */

View File

@@ -20,7 +20,7 @@
*/
/* ***************************** */
/* Includes */
/* Includes */
/* ***************************** */
#include <stdio.h>
@@ -48,7 +48,7 @@
#include "writer.h"
/* ***************************** */
/* Makros/Constants */
/* Makros/Constants */
/* ***************************** */
#define WMV3_PRIVATE_DATA_LENGTH 4
@@ -72,7 +72,7 @@
static short debug_level = 0;
#define vc1_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define vc1_printf(level, fmt, x...)
#endif
@@ -105,6 +105,7 @@ static const unsigned char Metadata[] =
/* ***************************** */
/* Varaibles */
/* ***************************** */
static int initialHeader = 1;
static unsigned char FrameHeaderSeen = 0;
@@ -115,6 +116,7 @@ static unsigned char FrameHeaderSeen = 0;
/* ***************************** */
/* MISC Functions */
/* ***************************** */
static int reset()
{
initialHeader = 1;

View File

@@ -49,6 +49,9 @@
/* ***************************** */
/* Makros/Constants */
/* ***************************** */
//#define SAM_WITH_DEBUG
#ifdef SAM_WITH_DEBUG
#define VORBIS_DEBUG
#else
@@ -60,7 +63,7 @@
static short debug_level = 1;
#define vorbis_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define vorbis_printf(level, fmt, x...)
#endif
@@ -76,7 +79,7 @@ static short debug_level = 1;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
/* ***************************** */
@@ -95,7 +98,7 @@ static int reset()
static int writeData(void *_call)
{
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
unsigned char PesHeader[PES_MAX_HEADER_SIZE];
vorbis_printf(10, "\n");
if (call == NULL)
{

View File

@@ -51,6 +51,8 @@
/* Makros/Constants */
/* ***************************** */
//#define SAM_WITH_DEBUG
#ifdef SAM_WITH_DEBUG
#define WMA_DEBUG
#else
@@ -62,7 +64,7 @@
static short debug_level = 0;
#define wma_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define wma_printf(level, fmt, x...)
#endif
@@ -78,7 +80,7 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static int initialHeader = 1;

View File

@@ -69,7 +69,7 @@
static short debug_level = 0;
#define wmv_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define wmv_printf(level, fmt, x...)
#endif
@@ -106,8 +106,9 @@ static const unsigned char Metadata[] =
};
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static int initialHeader = 1;
/* ***************************** */
@@ -117,6 +118,7 @@ static int initialHeader = 1;
/* ***************************** */
/* MISC Functions */
/* ***************************** */
static int reset()
{
initialHeader = 1;

View File

@@ -43,7 +43,7 @@
static short debug_level = 0;
#define writer_printf(level, x...) do { \
if (debug_level >= level) printf(x); } while (0)
if (debug_level >= level) printf(x); } while (0)
#else
#define writer_printf(level, x...)
#endif
@@ -59,7 +59,7 @@ static short debug_level = 0;
/* ***************************** */
/* ***************************** */
/* Varaibles */
/* Variables */
/* ***************************** */
static Writer_t *AvailableWriter[] =

View File

@@ -40,7 +40,7 @@ static short debug_level = 20;
#ifdef PLAYBACK_DEBUG
#define playback_printf(level, fmt, x...) do { \
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0)
#else
#define playback_printf(level, fmt, x...)
#endif
@@ -67,7 +67,7 @@ static int hasThreadStarted = 0;
/* ***************************** */
/* Prototypes */
/* ***************************** */
static int32_t PlaybackTerminate(Context_t *context);
static int32_t PlaybackTerminate(Context_t *context);
/* ***************************** */
/* MISC Functions */
@@ -107,9 +107,9 @@ static void SupervisorThread(Context_t *context)
/* Functions */
/* ***************************** */
static int PlaybackStop(Context_t *context);
static int PlaybackStop(Context_t *context);
static int PlaybackOpen(Context_t *context, PlayFiles_t *pFiles)
static int PlaybackOpen(Context_t *context, PlayFiles_t *pFiles)
{
if (context->playback->isPlaying)
{
@@ -186,7 +186,7 @@ static int PlaybackOpen(Context_t *context, PlayFiles_t *pFiles)
return cERR_PLAYBACK_NO_ERROR;
}
static int PlaybackClose(Context_t *context)
static int PlaybackClose(Context_t *context)
{
int ret = cERR_PLAYBACK_NO_ERROR;
playback_printf(10, "\n");
@@ -212,7 +212,7 @@ static int PlaybackClose(Context_t *context)
return ret;
}
static int PlaybackPlay(Context_t *context)
static int PlaybackPlay(Context_t *context)
{
pthread_attr_t attr;
int ret = cERR_PLAYBACK_NO_ERROR;
@@ -277,7 +277,7 @@ static int PlaybackPlay(Context_t *context)
return ret;
}
static int PlaybackPause(Context_t *context)
static int PlaybackPause(Context_t *context)
{
int ret = cERR_PLAYBACK_NO_ERROR;
playback_printf(10, "\n");
@@ -302,7 +302,7 @@ static int PlaybackPause(Context_t *context)
return ret;
}
static int32_t PlaybackContinue(Context_t *context)
static int32_t PlaybackContinue(Context_t *context)
{
int32_t ret = cERR_PLAYBACK_NO_ERROR;
playback_printf(10, "\n");
@@ -329,7 +329,7 @@ static int32_t PlaybackContinue(Context_t *context)
return ret;
}
static int32_t PlaybackStop(Context_t *context)
static int32_t PlaybackStop(Context_t *context)
{
int32_t ret = cERR_PLAYBACK_NO_ERROR;
int wait_time = 20;
@@ -365,7 +365,7 @@ static int32_t PlaybackStop(Context_t *context)
return ret;
}
static int32_t PlaybackTerminate(Context_t *context)
static int32_t PlaybackTerminate(Context_t *context)
{
int32_t ret = cERR_PLAYBACK_NO_ERROR;
int wait_time = 20;
@@ -409,7 +409,7 @@ static int32_t PlaybackTerminate(Context_t *context)
return ret;
}
static int32_t PlaybackSeek(Context_t *context, int64_t *pos, uint8_t absolute)
static int32_t PlaybackSeek(Context_t *context, int64_t *pos, uint8_t absolute)
{
int32_t ret = cERR_PLAYBACK_NO_ERROR;
playback_printf(10, "pos: %lldd\n", *pos);
@@ -436,7 +436,7 @@ static int32_t PlaybackSeek(Context_t *context, int64_t *pos, uint8_t absolute)
return ret;
}
static int32_t PlaybackPts(Context_t *context, int64_t *pts)
static int32_t PlaybackPts(Context_t *context, int64_t *pts)
{
int32_t ret = cERR_PLAYBACK_NO_ERROR;
playback_printf(20, "\n");
@@ -454,7 +454,7 @@ static int32_t PlaybackPts(Context_t *context, int64_t *pts)
return ret;
}
static int32_t PlaybackGetFrameCount(Context_t *context, int64_t *frameCount)
static int32_t PlaybackGetFrameCount(Context_t *context, int64_t *frameCount)
{
int ret = cERR_PLAYBACK_NO_ERROR;
playback_printf(20, "\n");
@@ -472,7 +472,7 @@ static int32_t PlaybackGetFrameCount(Context_t *context, int64_t *frameCount)
return ret;
}
static int32_t PlaybackLength(Context_t *context, int64_t *length)
static int32_t PlaybackLength(Context_t *context, int64_t *length)
{
int32_t ret = cERR_PLAYBACK_NO_ERROR;
playback_printf(20, "\n");
@@ -493,7 +493,7 @@ static int32_t PlaybackLength(Context_t *context, int64_t *length)
return ret;
}
static int32_t PlaybackSwitchAudio(Context_t *context, int32_t *track)
static int32_t PlaybackSwitchAudio(Context_t *context, int32_t *track)
{
int32_t ret = cERR_PLAYBACK_NO_ERROR;
int32_t curtrackid = 0;
@@ -535,7 +535,7 @@ static int32_t PlaybackSwitchAudio(Context_t *context, int32_t *track)
return ret;
}
static int32_t PlaybackSwitchSubtitle(Context_t *context, int32_t *track)
static int32_t PlaybackSwitchSubtitle(Context_t *context, int32_t *track)
{
int32_t ret = cERR_PLAYBACK_NO_ERROR;
int32_t curtrackid = -1;
@@ -575,7 +575,7 @@ static int32_t PlaybackSwitchSubtitle(Context_t *context, int32_t *track)
return ret;
}
static int32_t PlaybackInfo(Context_t *context, char **infoString)
static int32_t PlaybackInfo(Context_t *context, char **infoString)
{
int32_t ret = cERR_PLAYBACK_NO_ERROR;
playback_printf(10, "\n");
@@ -592,7 +592,7 @@ static int32_t PlaybackInfo(Context_t *context, char **infoString)
return ret;
}
static int PlaybackMetadata(Context_t * context, char ***metadata)
static int PlaybackMetadata(Context_t *context, char ***metadata)
{
int ret = cERR_PLAYBACK_NO_ERROR;