summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rw-r--r--device.c31
-rw-r--r--device.h13
-rw-r--r--frontend.c17
-rw-r--r--frontend.h12
-rw-r--r--frontend_local.c8
-rw-r--r--frontend_local.h4
-rw-r--r--frontend_svr.c72
-rw-r--r--frontend_svr.h18
-rw-r--r--mpg2c.c6
-rw-r--r--tools/cxsocket.h4
-rw-r--r--tools/udp_pes_scheduler.c7
-rw-r--r--xine_fbfe_frontend.c10
-rw-r--r--xine_frontend.c9
-rw-r--r--xine_frontend.h10
-rw-r--r--xine_frontend_main.c4
-rw-r--r--xine_input_vdr.c80
-rw-r--r--xine_sxfe_frontend.c8
18 files changed, 181 insertions, 140 deletions
diff --git a/Makefile b/Makefile
index f2f6cd5f..0ba7f71c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
#
# Makefile for a Video Disk Recorder plugin
#
-# $Id: Makefile,v 1.1 2006-06-03 09:44:41 phintuka Exp $
+# $Id: Makefile,v 1.2 2006-06-04 11:00:04 phintuka Exp $
# The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin.
@@ -291,14 +291,12 @@ xine_sxfe_frontend_standalone.o: xine_sxfe_frontend.c xine_frontend.c \
xine_frontend.h xine_input_vdr.h xine_osd_command.h \
xine/post.h logdefs.h xine_frontend_main.c xine_frontend_lirc.c \
xine_frontend_lirc.c xineliboutput.c
- $(CC) $(CFLAGS) -c $(DEFINES) -DFE_STANDALONE $(INCLUDES) $(OPTFLAGS) \
- xine_sxfe_frontend.c -o $@
+ $(CC) $(CFLAGS) -c $(DEFINES) -DFE_STANDALONE $(INCLUDES) $(OPTFLAGS) xine_sxfe_frontend.c -o $@
xine_fbfe_frontend_standalone.o: xine_fbfe_frontend.c xine_frontend.c \
xine_frontend.h xine_input_vdr.h xine_osd_command.h \
xine/post.h logdefs.h xine_frontend_main.c xine_frontend_lirc.c \
xine_frontend_lirc.c xineliboutput.c
- $(CC) $(CFLAGS) -c $(DEFINES) -DFE_STANDALONE $(INCLUDES) $(OPTFLAGS) \
- xine_fbfe_frontend.c -o $@
+ $(CC) $(CFLAGS) -c $(DEFINES) -DFE_STANDALONE $(INCLUDES) $(OPTFLAGS) xine_fbfe_frontend.c -o $@
#
# targets
diff --git a/device.c b/device.c
index 01a25f6e..c4942a90 100644
--- a/device.c
+++ b/device.c
@@ -4,10 +4,13 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c,v 1.1 2006-06-03 10:01:17 phintuka Exp $
+ * $Id: device.c,v 1.2 2006-06-04 11:00:04 phintuka Exp $
*
*/
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
+
#include <vdr/config.h>
#include <vdr/thread.h>
#include <vdr/dvbspu.h>
@@ -374,7 +377,11 @@ void cXinelibDevice::ConfigureOSD(bool prescale_osd, bool unscaled_osd)
m_server->ConfigureOSD(prescale_osd, unscaled_osd);
}
-void cXinelibDevice::ConfigurePostprocessing(char *deinterlace_method, int audio_delay, int audio_compression, int *audio_equalizer, int audio_surround)
+void cXinelibDevice::ConfigurePostprocessing(const char *deinterlace_method,
+ int audio_delay,
+ int audio_compression,
+ const int *audio_equalizer,
+ int audio_surround)
{
TRACEF("cXinelibDevice::ConfigurePostprocessing");
@@ -389,7 +396,8 @@ void cXinelibDevice::ConfigurePostprocessing(char *deinterlace_method, int audio
audio_surround);
}
-void cXinelibDevice::ConfigurePostprocessing(char *name, bool on, char *args)
+void cXinelibDevice::ConfigurePostprocessing(const char *name, bool on,
+ const char *args)
{
TRACEF("cXinelibDevice::ConfigurePostprocessing");
@@ -425,8 +433,9 @@ void cXinelibDevice::ConfigureDecoder(int pes_buffers, int priority)
}
void cXinelibDevice::ConfigureWindow(int fullscreen, int width, int height,
- int modeswitch, char *modeline,
- int aspect, int scale_video, int field_order)
+ int modeswitch, const char *modeline,
+ int aspect, int scale_video,
+ int field_order)
{
TRACEF("cXinelibDevice::ConfigureWindow");
@@ -839,15 +848,15 @@ int cXinelibDevice::PlayAny(const uchar *buf, int length)
m_TrickSpeedPts = pts;
if(ScanVideoPacket(buf, length, PictureType) > 0)
;
- LOGMSG("TrickSpeed: VIDEO PTS %lld (%s)", pts,
+ LOGMSG("TrickSpeed: VIDEO PTS %" PRId64 " (%s)", pts,
PictureTypeStr(PictureType));
}
} else if(Audio) {
- LOGMSG("TrickSpeed: AUDIO PTS %lld", pts);
+ LOGMSG("TrickSpeed: AUDIO PTS %" PRId64, pts);
} else if(pts > 0LL) {
if(ScanVideoPacket(buf, length, PictureType) > 0)
;
- LOGMSG("TrickSpeed: VIDEO PTS DIFF %lld (%s)", pts - m_TrickSpeedPts,
+ LOGMSG("TrickSpeed: VIDEO PTS DIFF %" PRId64 " (%s)", pts - m_TrickSpeedPts,
PictureTypeStr(PictureType));
//m_TrickSpeedPts += (int64_t)(40*90 * m_TrickSpeed); /* 40ms * 90kHz */
//pes_change_pts((uchar *)buf, length);
@@ -910,11 +919,13 @@ int cXinelibDevice::PlayVideo(const uchar *buf, int length)
if(!switchingIframe) {
int64_t now = cTimeMs::Now();
switchingIframe = true;
- LOGMSG("Channel switch: off -> on %lld ms, on -> 1. I-frame %lld ms",
+ LOGMSG("Channel switch: off -> on %" PRId64 " ms, "
+ "on -> 1. I-frame %" PRId64 " ms",
switchtimeOn-switchtimeOff, now-switchtimeOn);
} else {
int64_t now = cTimeMs::Now();
- LOGMSG("Channel switch: on -> 2. I-frame %lld ms, Total %lld ms",
+ LOGMSG("Channel switch: on -> 2. I-frame %" PRId64 " ms, "
+ "Total %" PRId64 " ms",
now-switchtimeOn, now-switchtimeOff);
switchtimeOff = 0LL;
switchtimeOn = 0LL;
diff --git a/device.h b/device.h
index 87971491..960bc832 100644
--- a/device.h
+++ b/device.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: device.h,v 1.1 2006-06-03 09:50:54 phintuka Exp $
+ * $Id: device.h,v 1.2 2006-06-04 11:00:04 phintuka Exp $
*
*/
@@ -94,14 +94,17 @@ class cXinelibDevice : public cDevice
// Configuration
void ConfigureOSD(bool prescale_osd, bool unscaled_osd);
- void ConfigurePostprocessing(char *deinterlace_method, int audio_delay,
- int audio_compression, int *audio_equalizer,
+ void ConfigurePostprocessing(const char *deinterlace_method,
+ int audio_delay,
+ int audio_compression,
+ const int *audio_equalizer,
int audio_surround);
- void ConfigurePostprocessing(char *name, bool on=true, char *args=NULL);
+ void ConfigurePostprocessing(const char *name, bool on=true,
+ const char *args=NULL);
void ConfigureVideo(int hue, int saturation, int brightness, int contrast);
// local mode:
void ConfigureWindow(int fullscreen, int width, int height,
- int modeswitch, char *modeline,
+ int modeswitch, const char *modeline,
int aspect, int scale_video, int field_order);
void ConfigureDecoder(int pes_buffers, int priority);
// remote mode:
diff --git a/frontend.c b/frontend.c
index efc8e2fe..072410cd 100644
--- a/frontend.c
+++ b/frontend.c
@@ -4,10 +4,13 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: frontend.c,v 1.2 2006-06-04 08:18:18 phintuka Exp $
+ * $Id: frontend.c,v 1.3 2006-06-04 11:00:04 phintuka Exp $
*
*/
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
+
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -482,11 +485,11 @@ int cXinelibThread::Xine_Control(const char *cmd, int p1)
int cXinelibThread::Xine_Control(const char *cmd, int64_t p1)
{
char buf[128];
- sprintf(buf, "%s %lld", cmd, p1);
+ sprintf(buf, "%s %" PRId64, cmd, p1);
return Xine_Control(buf);
}
-int cXinelibThread::Xine_Control(const char *cmd, char *p1)
+int cXinelibThread::Xine_Control(const char *cmd, const char *p1)
{
char buf[128];
sprintf(buf, "%s %s", cmd, p1);
@@ -536,8 +539,10 @@ int cXinelibThread::ConfigureOSD(bool prescale_osd, bool unscaled_osd)
return Xine_Control(s);
}
-int cXinelibThread::ConfigurePostprocessing(char *deinterlace_method, int audio_delay,
- int audio_compression, int *audio_equalizer,
+int cXinelibThread::ConfigurePostprocessing(const char *deinterlace_method,
+ int audio_delay,
+ int audio_compression,
+ const int *audio_equalizer,
int audio_surround)
{
char tmp[255];
@@ -572,7 +577,7 @@ int cXinelibThread::ConfigurePostprocessing(char *deinterlace_method, int audio_
return r;
}
-int cXinelibThread::ConfigurePostprocessing(char *name, bool on, char *args)
+int cXinelibThread::ConfigurePostprocessing(const char *name, bool on, const char *args)
{
char tmp[1024];
if(!name) name = "0";
diff --git a/frontend.h b/frontend.h
index 3dea600c..cc84a791 100644
--- a/frontend.h
+++ b/frontend.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: frontend.h,v 1.2 2006-06-04 08:18:18 phintuka Exp $
+ * $Id: frontend.h,v 1.3 2006-06-04 11:00:04 phintuka Exp $
*
*/
@@ -57,7 +57,7 @@ class cXinelibThread : public cThread, public cListObject
void SpuStreamChanged(int StreamId);
protected:
- int Xine_Control(const char *cmd, char *p1);
+ int Xine_Control(const char *cmd, const char *p1);
int Xine_Control(const char *cmd, int p1);
int Xine_Control(const char *cmd, int64_t p1);
@@ -106,17 +106,17 @@ class cXinelibThread : public cThread, public cListObject
public:
virtual int ConfigureOSD(bool prescale_osd=false, bool unscaled_osd=false);
- virtual int ConfigurePostprocessing(char *deinterlace_method,
+ virtual int ConfigurePostprocessing(const char *deinterlace_method,
int audio_delay,
int audio_compression,
- int *audio_equalizer,
+ const int *audio_equalizer,
int audio_surround);
- virtual int ConfigurePostprocessing(char *name, bool on, char *args);
+ virtual int ConfigurePostprocessing(const char *name, bool on, const char *args);
virtual int ConfigureVideo(int hue, int saturation,
int brightness, int contrast);
// Local frontend:
virtual void ConfigureWindow(int fullscreen, int width, int height,
- int modeswitch, char *modeline,
+ int modeswitch, const char *modeline,
int aspect, int scale_video,
int field_order) {};
virtual void ConfigureDecoder(int pes_buffers, int priority) {};
diff --git a/frontend_local.c b/frontend_local.c
index 4a78f162..13f8f0b0 100644
--- a/frontend_local.c
+++ b/frontend_local.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: frontend_local.c,v 1.2 2006-06-04 08:18:18 phintuka Exp $
+ * $Id: frontend_local.c,v 1.3 2006-06-04 11:00:04 phintuka Exp $
*
*/
@@ -118,8 +118,8 @@ void cXinelibLocal::OsdCmd(void *cmd)
}
uchar *cXinelibLocal::GrabImage(int &Size, bool Jpeg,
- int Quality, int SizeX,
- int SizeY)
+ int Quality, int SizeX,
+ int SizeY)
{
uchar *data;
LOCK_FE;
@@ -151,7 +151,7 @@ int64_t cXinelibLocal::GetSTC()
//
void cXinelibLocal::ConfigureWindow(int fullscreen, int width, int height,
- int modeswitch, char *modeline,
+ int modeswitch, const char *modeline,
int aspect, int scale_video,
int field_order)
{
diff --git a/frontend_local.h b/frontend_local.h
index a7975e3c..8e1250ad 100644
--- a/frontend_local.h
+++ b/frontend_local.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: frontend_local.h,v 1.1 2006-06-03 09:50:54 phintuka Exp $
+ * $Id: frontend_local.h,v 1.2 2006-06-04 11:00:04 phintuka Exp $
*
*/
@@ -47,7 +47,7 @@ class cXinelibLocal : public cXinelibThread
// Configuration
virtual void ConfigureWindow(int fullscreen, int width, int height,
- int modeswitch, char *modeline,
+ int modeswitch, const char *modeline,
int aspect, int scale_video, int field_order);
virtual void ConfigureDecoder(int pes_buffers, int priority);
diff --git a/frontend_svr.c b/frontend_svr.c
index d372e28e..d76ba02d 100644
--- a/frontend_svr.c
+++ b/frontend_svr.c
@@ -4,10 +4,13 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: frontend_svr.c,v 1.2 2006-06-04 05:54:50 phintuka Exp $
+ * $Id: frontend_svr.c,v 1.3 2006-06-04 11:00:04 phintuka Exp $
*
*/
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
+
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -195,31 +198,42 @@ void cXinelibServer::OsdCmd(void *cmd_gen)
#endif
/* -> network order */
- if(0x12345678 != htonl(0x12345678)) {
- cmd->cmd = htonl(cmd->cmd);
- cmd->wnd = htonl(cmd->wnd);
- cmd->pts = htonll(cmd->pts);
- cmd->delay_ms = htonl(cmd->delay_ms);
- cmd->x = htons(cmd->x);
- cmd->y = htons(cmd->y);
- cmd->w = htons(cmd->w);
- cmd->h = htons(cmd->h);
+ osd_command_t cmdnet;
+
+ if(ntohl(0x12345678) != 0x12345678) {
+ cmdnet.cmd = htonl(cmd->cmd);
+ cmdnet.wnd = htonl(cmd->wnd);
+ cmdnet.pts = htonll(cmd->pts);
+ cmdnet.delay_ms = htonl(cmd->delay_ms);
+ cmdnet.x = htons(cmd->x);
+ cmdnet.y = htons(cmd->y);
+ cmdnet.w = htons(cmd->w);
+ cmdnet.h = htons(cmd->h);
+ cmdnet.datalen = htonl(cmd->datalen);
+ cmdnet.colors = htonl(cmd->colors);
if(cmd->data) {
+ cmdnet.data = (xine_rle_elem_t*)malloc(cmd->datalen);
for(unsigned int i=0; i<cmd->datalen/4; i++) {
- cmd->data[i].len = htons(cmd->data[i].len);
- cmd->data[i].color = htons(cmd->data[i].color);
+ cmdnet.data[i].len = htons(cmd->data[i].len);
+ cmdnet.data[i].color = htons(cmd->data[i].color);
}
+ } else {
+ cmdnet.data = NULL;
}
- cmd->datalen = htonl(cmd->datalen);
- cmd->colors = htonl(cmd->colors);
+ cmdnet.palette = cmd->palette;
+ } else {
+ memcpy(&cmdnet, cmd, sizeof(osd_command_t));
}
-
+
for(i=0; i<MAXCLIENTS; i++)
if(fd_control[i] >= 0 &&
- !write_osd_command(fd_control[i], (osd_command_t*)cmd_gen)) {
+ !write_osd_command(fd_control[i], &cmdnet)) {
LOGMSG("Send OSD command failed");
CloseConnection(i);
}
+
+ if(ntohl(0x12345678) != 0x12345678 && cmdnet.data)
+ free(cmdnet.data);
}
}
@@ -397,7 +411,7 @@ bool cXinelibServer::Flush(int TimeoutMs)
if(result) {
char tmp[64];
- sprintf(tmp, "FLUSH %d %lld", TimeoutMs, m_StreamPos);
+ sprintf(tmp, "FLUSH %d %" PRIu64, TimeoutMs, m_StreamPos);
result = (PlayFileCtrl(tmp)) <= 0 && result;
}
return result;
@@ -663,7 +677,7 @@ uchar *cXinelibServer::GrabImage(int &Size, bool Jpeg,
delete m_Writer[cli]; \
m_Writer[cli] = new cBackgroundWriter(fd);
-void cXinelibServer::Handle_Control_PIPE(int cli, char *arg)
+void cXinelibServer::Handle_Control_PIPE(int cli, const char *arg)
{
char buf[256];
LOGDBG("Trying PIPE connection ...");
@@ -726,7 +740,7 @@ void cXinelibServer::Handle_Control_PIPE(int cli, char *arg)
}
-void cXinelibServer::Handle_Control_DATA(int cli, char *arg)
+void cXinelibServer::Handle_Control_DATA(int cli, const char *arg)
{
LOGDBG("Data connection (TCP) requested");
@@ -762,7 +776,7 @@ void cXinelibServer::Handle_Control_DATA(int cli, char *arg)
CloseConnection(cli);
}
-void cXinelibServer::Handle_Control_RTP(int cli, char *arg)
+void cXinelibServer::Handle_Control_RTP(int cli, const char *arg)
{
if(xc.remote_usertp && fd_multicast>=0) {
char buf[256];
@@ -802,7 +816,7 @@ void cXinelibServer::Handle_Control_RTP(int cli, char *arg)
}
}
-void cXinelibServer::Handle_Control_UDP(int cli, char *arg)
+void cXinelibServer::Handle_Control_UDP(int cli, const char *arg)
{
LOGDBG("Trying UDP connection ...");
@@ -835,7 +849,7 @@ void cXinelibServer::Handle_Control_UDP(int cli, char *arg)
m_Scheduler->AddHandle(fd);
}
-void cXinelibServer::Handle_Control_KEY(int cli, char *arg)
+void cXinelibServer::Handle_Control_KEY(int cli, const char *arg)
{
char buf[256], buf2[256];
bool repeat=false, release=false;
@@ -905,7 +919,7 @@ void cXinelibServer::Handle_Control_CONFIG(int cli)
}
}
-void cXinelibServer::Handle_Control_UDP_RESEND(int cli, char *arg)
+void cXinelibServer::Handle_Control_UDP_RESEND(int cli, const char *arg)
{
unsigned int seq1, seq2;
uint64_t pos;
@@ -916,7 +930,7 @@ void cXinelibServer::Handle_Control_UDP_RESEND(int cli, char *arg)
return;
}
- if(3 == sscanf(arg, "%d-%d %lld", &seq1, &seq2, &pos)) {
+ if(3 == sscanf(arg, "%d-%d %" PRIu64, &seq1, &seq2, &pos)) {
if(seq1 <= UDP_SEQ_MASK && seq2 <= UDP_SEQ_MASK && pos <= m_StreamPos) {
@@ -925,15 +939,17 @@ void cXinelibServer::Handle_Control_UDP_RESEND(int cli, char *arg)
else
m_Scheduler->ReSend(fd_multicast, pos, seq1, seq2);
} else {
- LOGMSG("Invalid re-send request: %s (send pos=%lld)", arg, m_StreamPos);
+ LOGMSG("Invalid re-send request: %s (send pos=%" PRIu64 ")",
+ arg, m_StreamPos);
}
} else {
- LOGMSG("Invalid re-send request: %s (send pos=%lld)", arg, m_StreamPos);
+ LOGMSG("Invalid re-send request: %s (send pos=%" PRIu64 ")",
+ arg, m_StreamPos);
}
}
-void cXinelibServer::Handle_Control(int cli, char *cmd)
+void cXinelibServer::Handle_Control(int cli, const char *cmd)
{
TRACEF("cXinelibServer::Handle_Control");
@@ -979,7 +995,7 @@ void cXinelibServer::Handle_Control(int cli, char *cmd)
} else if(!strncasecmp(cmd, "STC ", 4)) {
int64_t pts = -1;
- if(1 == sscanf(cmd, "STC %lld", &pts))
+ if(1 == sscanf(cmd, "STC %" PRId64, &pts))
m_StcFuture->Set(pts);
} else if(!strncasecmp(cmd, "ENDOFSTREAM", 11)) {
diff --git a/frontend_svr.h b/frontend_svr.h
index f4caa061..642ecbd8 100644
--- a/frontend_svr.h
+++ b/frontend_svr.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: frontend_svr.h,v 1.1 2006-06-03 09:50:54 phintuka Exp $
+ * $Id: frontend_svr.h,v 1.2 2006-06-04 11:00:04 phintuka Exp $
*
*/
@@ -68,14 +68,14 @@ protected:
void Handle_ClientConnected(int fd);
void Read_Control(int cli);
- void Handle_Control(int cli, char *cmd);
-
- void Handle_Control_PIPE(int cli, char *arg);
- void Handle_Control_RTP(int cli, char *arg);
- void Handle_Control_UDP(int cli, char *arg);
- void Handle_Control_DATA(int cli, char *arg);
- void Handle_Control_KEY(int cli, char *arg);
- void Handle_Control_UDP_RESEND(int cli, char *arg);
+ void Handle_Control(int cli, const char *cmd);
+
+ void Handle_Control_PIPE(int cli, const char *arg);
+ void Handle_Control_RTP(int cli, const char *arg);
+ void Handle_Control_UDP(int cli, const char *arg);
+ void Handle_Control_DATA(int cli, const char *arg);
+ void Handle_Control_KEY(int cli, const char *arg);
+ void Handle_Control_UDP_RESEND(int cli, const char *arg);
void Handle_Control_CONFIG(int cli);
void CloseConnection(int cli);
diff --git a/mpg2c.c b/mpg2c.c
index 5847b353..50c1e25a 100644
--- a/mpg2c.c
+++ b/mpg2c.c
@@ -6,7 +6,7 @@
*
* mpg2.c:
*
- * $Id: mpg2c.c,v 1.2 2006-06-04 08:18:18 phintuka Exp $
+ * $Id: mpg2c.c,v 1.3 2006-06-04 11:00:04 phintuka Exp $
*
*/
@@ -32,7 +32,7 @@ int main(int argc, char *argv[])
printf("Error opening files\n");
return -1;
}
- fprintf(fo, "const unsigned char v_mpg_%s[] = \n \"", argv[1]);
+ fprintf(fo, "extern const unsigned char v_mpg_%s[] = \n \"", argv[1]);
while(EOF != (ch = fgetc(fi))) {
fprintf(fo, "\\x%02x", ch);
if(pos++ > LINELEN) {
@@ -40,7 +40,7 @@ int main(int argc, char *argv[])
pos=1;
}
}
- fprintf(fo, "\";\n\nconst int v_mpg_%s_length = sizeof(v_mpg_%s);\n\n",
+ fprintf(fo, "\";\n\nextern const int v_mpg_%s_length = sizeof(v_mpg_%s);\n\n",
argv[1], argv[1]);
fclose(fi);
diff --git a/tools/cxsocket.h b/tools/cxsocket.h
index 3c5c73a3..612919ed 100644
--- a/tools/cxsocket.h
+++ b/tools/cxsocket.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: cxsocket.h,v 1.2 2006-06-04 08:18:18 phintuka Exp $
+ * $Id: cxsocket.h,v 1.3 2006-06-04 11:00:04 phintuka Exp $
*
*/
@@ -136,7 +136,7 @@ static inline int write_osd_command(int fd, osd_command_t *cmd)
}
if(cmd->palette && cmd->colors &&
(ssize_t)(sizeof(xine_clut_t)*ntohl(cmd->colors)) !=
- timed_write(fd, cmd->palette, (int)(sizeof(xine_clut_t)*ntohl(cmd->colors)), 200)) {
+ timed_write(fd, cmd->palette, sizeof(xine_clut_t)*ntohl(cmd->colors), 200)) {
LOGDBG("write_osd_command: write (palette) failed");
return 0;
}
diff --git a/tools/udp_pes_scheduler.c b/tools/udp_pes_scheduler.c
index 5da4be74..61e37467 100644
--- a/tools/udp_pes_scheduler.c
+++ b/tools/udp_pes_scheduler.c
@@ -4,10 +4,13 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: udp_pes_scheduler.c,v 1.1 2006-06-03 10:04:28 phintuka Exp $
+ * $Id: udp_pes_scheduler.c,v 1.2 2006-06-04 11:00:04 phintuka Exp $
*
*/
+#define __STDC_FORMAT_MACROS
+#include <inttypes.h>
+
#include <stdint.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -587,7 +590,7 @@ void cUdpScheduler::ReSend(int fd, uint64_t Pos, int Seq1, int Seq2)
((stream_udp_header_t *)udp_ctrl)->seq);
#endif
sprintf((udp_ctrl+sizeof(stream_udp_header_t)),
- "UDP MISSING %d-%d %lld",
+ "UDP MISSING %d-%d %" PRIu64,
Seq1, Seq1, Pos);
send(fd, udp_ctrl, 64, 0);
diff --git a/xine_fbfe_frontend.c b/xine_fbfe_frontend.c
index 5f51b057..8157293b 100644
--- a/xine_fbfe_frontend.c
+++ b/xine_fbfe_frontend.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_fbfe_frontend.c,v 1.1 2006-06-03 10:01:18 phintuka Exp $
+ * $Id: xine_fbfe_frontend.c,v 1.2 2006-06-04 11:00:04 phintuka Exp $
*
*/
@@ -118,9 +118,9 @@ static void fbfe_update_display_size(frontend_t *this_gen)
* fbfe_display_open
*/
static int fbfe_display_open(frontend_t *this_gen, int width, int height, int fullscreen,
- int modeswitch, char *modeline, int aspect,
- fe_keypress_f keyfunc, char *video_port,
- int scale_video, int field_order)
+ int modeswitch, const char *modeline, int aspect,
+ fe_keypress_f keyfunc, const char *video_port,
+ int scale_video, int field_order)
{
fe_t *this = (fe_t*)this_gen;
@@ -165,7 +165,7 @@ static int fbfe_display_open(frontend_t *this_gen, int width, int height, int fu
* configure windows
*/
static int fbfe_display_config(frontend_t *this_gen, int width, int height, int fullscreen,
- int modeswitch, char *modeline, int aspect,
+ int modeswitch, const char *modeline, int aspect,
int scale_video, int field_order)
{
fe_t *this = (fe_t*)this_gen;
diff --git a/xine_frontend.c b/xine_frontend.c
index 82f8d988..93c3a689 100644
--- a/xine_frontend.c
+++ b/xine_frontend.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_frontend.c,v 1.2 2006-06-04 08:18:18 phintuka Exp $
+ * $Id: xine_frontend.c,v 1.3 2006-06-04 11:00:04 phintuka Exp $
*
*/
@@ -922,8 +922,8 @@ static void *fe_control(void *fe_handle, const char *cmd)
/*LOGDBG("fe_control(\"%s\")", cmd);*/
if(!strncmp(cmd, "SLAVE 0x", 8)) {
- unsigned int pt;
- if(1 == sscanf(cmd, "SLAVE 0x%x", &pt)) {
+ unsigned long pt;
+ if(1 == sscanf(cmd, "SLAVE 0x%lx", &pt)) {
xine_stream_t *slave_stream = (xine_stream_t*)pt;
if(posts->slave_stream != slave_stream) {
fe_post_unwire(this);
@@ -943,7 +943,8 @@ static void *fe_control(void *fe_handle, const char *cmd)
this->video_port);
LOGMSG(" PIP %d: %dx%d @ (%d,%d)", pid & 0xf0, w, h, x, y);
LOGMSG("create pip stream done");
- sprintf(mrl, "xvdr:slave:0x%x#nocache;demux:mpeg_block",(int)this);
+ sprintf(mrl, "xvdr:slave:0x%lx#nocache;demux:mpeg_block",
+ (unsigned long int)this);
if(!xine_open(posts->pip_stream, mrl) ||
!xine_play(posts->pip_stream, 0, 0)) {
LOGERR(" pip stream open/play failed");
diff --git a/xine_frontend.h b/xine_frontend.h
index 9151fd3e..6aee00a4 100644
--- a/xine_frontend.h
+++ b/xine_frontend.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_frontend.h,v 1.2 2006-06-04 08:18:18 phintuka Exp $
+ * $Id: xine_frontend.h,v 1.3 2006-06-04 11:00:04 phintuka Exp $
*
*/
@@ -52,13 +52,13 @@ struct frontend_config_s {
struct frontend_s {
/* Display */
int (*fe_display_open)(frontend_t*, int winwidth, int winheight,
- int fullscreen,
- int modeswitch, char *modeline, int aspect,
- fe_keypress_f keypresshandler, char *video_port,
+ int fullscreen, int modeswitch, const char *modeline,
+ int aspect, fe_keypress_f keypresshandler,
+ const char *video_port,
int scale_video, int field_order);
int (*fe_display_config)(frontend_t *, int width, int height,
int fullscreen,
- int modeswitch, char *modeline,
+ int modeswitch, const char *modeline,
int aspect, int scale_video, int field_order);
void (*fe_display_close)(frontend_t*);
diff --git a/xine_frontend_main.c b/xine_frontend_main.c
index 48c13971..b265958c 100644
--- a/xine_frontend_main.c
+++ b/xine_frontend_main.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_frontend_main.c,v 1.1 2006-06-03 10:01:18 phintuka Exp $
+ * $Id: xine_frontend_main.c,v 1.2 2006-06-04 11:00:04 phintuka Exp $
*
*/
@@ -75,7 +75,7 @@ void *kbd_receiver_thread(void *fe)
break;
} //else {
- snprintf(str, sizeof(str), "%016LX", code);
+ snprintf(str, sizeof(str), "%016" PRIX64, code);
if(find_input((fe_t*)fe))
process_xine_keypress(((fe_t*)fe)->input, "KBD", str, 0, 0);
}
diff --git a/xine_input_vdr.c b/xine_input_vdr.c
index 361f0f1c..9fc9b102 100644
--- a/xine_input_vdr.c
+++ b/xine_input_vdr.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_input_vdr.c,v 1.2 2006-06-04 08:18:18 phintuka Exp $
+ * $Id: xine_input_vdr.c,v 1.3 2006-06-04 11:00:04 phintuka Exp $
*
*/
@@ -207,11 +207,11 @@ typedef struct vdr_input_plugin_s {
fifo_buffer_t *block_buffer; /* blocks to be demuxed */
fifo_buffer_t *buffer_pool; /* stream's video fifo */
fifo_buffer_t *big_buffer; /* for jumbo PES */
- off_t discard_index; /* index of next byte to feed to demux;
+ uint64_t discard_index; /* index of next byte to feed to demux;
all data before this offset will
be discarded */
- off_t guard_index; /* data before this offset will not be discarded */
- off_t curpos; /* current position (demux side) */
+ uint64_t guard_index; /* data before this offset will not be discarded */
+ uint64_t curpos; /* current position (demux side) */
int max_buffers; /* max no. of non-demuxed buffers */
int read_delay; /* usec to wait at next read call */
@@ -1113,11 +1113,11 @@ static input_plugin_t *fifo_class_get_instance (input_class_t *cls_gen,
const char *data)
{
fifo_input_plugin_t *slave = (fifo_input_plugin_t *) xine_xmalloc (sizeof(fifo_input_plugin_t));
- unsigned int imaster;
+ unsigned long int imaster;
vdr_input_plugin_t *master;
LOGDBG("fifo_class_get_instance");
- sscanf(data+4+1+5+1, "%x", &imaster);
+ sscanf(data+4+1+5+1, "%lx", &imaster);
master = (vdr_input_plugin_t*)imaster;
memset(slave, 0, sizeof(fifo_input_plugin_t));
@@ -1650,7 +1650,8 @@ static void vdr_x_demux_flush_engine (xine_stream_t *stream, vdr_input_plugin_t
if(this->curpos > this->discard_index) {
#if 0
#warning Check this
- LOGMSG("Possibly flushing too much !!! (diff=%lld bytes, guard @%lld)",
+ LOGMSG("Possibly flushing too much !!! (diff=%"PRIu64" bytes, "
+ "guard @%" PRIu64 ")",
this->curpos - this->discard_index, this->guard_index);
#endif
if(this->curpos < this->guard_index) {
@@ -1968,8 +1969,8 @@ static int handle_control_playfile(vdr_input_plugin_t *this, const char *cmd)
set_playback_speed(this, 1);
if(this->funcs.fe_control) {
char tmp[128];
- sprintf(tmp, "SLAVE 0x%x\r\n", (int)this->slave_stream);
- (*(this->funcs.fe_control))(this->funcs.fe_handle, tmp);
+ sprintf(tmp, "SLAVE 0x%lx\r\n", (unsigned long int)this->slave_stream);
+ this->funcs.fe_control(this->funcs.fe_handle, tmp);
}
} else {
LOGMSG("Error playing file ! (File not found ? Unknown format ?)");
@@ -1985,7 +1986,7 @@ static int handle_control_playfile(vdr_input_plugin_t *this, const char *cmd)
this->slave_event_queue = NULL;
}
if(this->funcs.fe_control)
- (*(this->funcs.fe_control))(this->funcs.fe_handle, "SLAVE 0x0\r\n");
+ this->funcs.fe_control(this->funcs.fe_handle, "SLAVE 0x0\r\n");
xine_stop(this->slave_stream);
xine_close(this->slave_stream);
xine_dispose(this->slave_stream);
@@ -2009,7 +2010,7 @@ static int handle_control_substream(vdr_input_plugin_t *this, const char *cmd)
if(!this->pip_stream) {
LOGMSG("create pip stream %s", cmd);
this->pip_stream =
- (*(this->funcs.fe_control))(this->funcs.fe_handle, cmd);
+ this->funcs.fe_control(this->funcs.fe_handle, cmd);
LOGMSG(" pip stream created");
}
} else {
@@ -2018,7 +2019,7 @@ LOGMSG(" pip stream created");
LOGMSG("close pip stream");
this->pip_stream = NULL;
- (*(this->funcs.fe_control))(this->funcs.fe_handle, cmd);
+ this->funcs.fe_control(this->funcs.fe_handle, cmd);
/* xine_stop(this->pip_stream); */
/* xine_close(this->pip_stream); */
/* xine_dispose(this->pip_stream); */
@@ -2250,7 +2251,7 @@ static int vdr_plugin_flush_remote(vdr_input_plugin_t *this, int timeout_ms, uin
pthread_mutex_unlock(&this->lock);
while(this->curpos < offset && timeout_ms > 0) {
- LOGDBG("FLUSH: wait position (%lld ; need %lld)",
+ LOGDBG("FLUSH: wait position (%" PRIu64 " ; need %" PRIu64 ")",
this->curpos, offset);
xine_usec_sleep(3*1000);
timeout_ms -= 3;
@@ -2294,8 +2295,8 @@ static int vdr_plugin_parse_control(input_plugin_t *this_gen, const char *cmd)
{
vdr_input_plugin_t *this = (vdr_input_plugin_t *) this_gen;
int err = CONTROL_OK, i, j;
- int32_t tmp32 = 0;
- int64_t tmp64 = 0LL;
+ int /*int32_t*/ tmp32 = 0;
+ uint64_t tmp64 = 0ULL;
xine_stream_t *stream = this->stream;
static const char *str_poll = "POLL";
@@ -2355,7 +2356,7 @@ static int vdr_plugin_parse_control(input_plugin_t *this_gen, const char *cmd)
signal_buffer_pool_not_empty(this);
} else if(!strncasecmp(cmd, "DISCARD ", 8)) {
- if(1 == sscanf(cmd, "DISCARD %lld", &tmp64)) {
+ if(1 == sscanf(cmd, "DISCARD %" PRIu64, &tmp64)) {
pthread_mutex_lock(&this->lock);
this->discard_index = tmp64;
vdr_flush_engine(this);
@@ -2365,7 +2366,7 @@ static int vdr_plugin_parse_control(input_plugin_t *this_gen, const char *cmd)
err = CONTROL_PARAM_ERROR;
} else if(!strncasecmp(cmd, "STREAMPOS ", 10)) {
- if(1 == sscanf(cmd, "STREAMPOS %lld", &tmp64)) {
+ if(1 == sscanf(cmd, "STREAMPOS %" PRIu64, &tmp64)) {
pthread_mutex_lock(&this->lock);
vdr_flush_engine(this);
this->curpos = tmp64;
@@ -2490,7 +2491,7 @@ LOGDBG("SPU channel selected: %d", tmp32);
stream->metronom->get_option(stream->metronom,
METRONOM_VPTS_OFFSET);
if(this->fd_control >= 0) {
- printf_control(this, "STC %lld\r\n", pts);
+ printf_control(this, "STC %" PRId64 "\r\n", pts);
} else {
*((int64_t *)cmd) = pts;
}
@@ -2500,7 +2501,7 @@ LOGDBG("SPU channel selected: %d", tmp32);
if(this->fd_control >= 0) {
tmp64 = 0ULL;
tmp32 = 0;
- sscanf(cmd, "FLUSH %d %lld", &tmp32, &tmp64);
+ sscanf(cmd, "FLUSH %d %" PRIu64, &tmp32, &tmp64);
err = vdr_plugin_flush_remote(this, tmp32, tmp64);
} else {
err = vdr_plugin_flush(this, tmp32);
@@ -2518,7 +2519,7 @@ LOGDBG("SPU channel selected: %d", tmp32);
if(!this->funcs.fe_control)
LOGERR("ERROR - no fe_control set ! (%s failed)", cmd);
else
- err = (int) (*(this->funcs.fe_control))(this->funcs.fe_handle, cmd);
+ this->funcs.fe_control(this->funcs.fe_handle, cmd);
} else if(!strncasecmp(cmd, "PLAYFILE ", 9)) {
err = handle_control_playfile(this, cmd);
@@ -2566,7 +2567,7 @@ LOGDBG("SPU channel selected: %d", tmp32);
int vpos = 0;
if(1 == sscanf(cmd, "SUBTITLES %d", &vpos))
stream->xine->config->update_num(stream->xine->config,
- "subtitles.separate.vertical_offset",vpos);
+ "subtitles.separate.vertical_offset", vpos);
else
err = CONTROL_PARAM_ERROR;
}
@@ -2867,7 +2868,8 @@ static int vdr_plugin_poll(vdr_input_plugin_t *this, int timeout_ms)
pthread_mutex_unlock(&this->vdr_entry_lock);
pthread_mutex_lock (&this->buffer_pool->buffer_pool_mutex);
while(result <= 5) {
- TRACE("vdr_plugin_poll waiting (max %d ms), %d bufs free (rd pos=%lld)",
+ TRACE("vdr_plugin_poll waiting (max %d ms), "
+ "%d bufs free (rd pos=%" PRIu64 ")",
timeout_ms, this->buffer_pool->buffer_pool_num_free, this->curpos);
if(pthread_cond_timedwait (&this->buffer_pool->buffer_pool_cond_not_empty,
&this->buffer_pool->buffer_pool_mutex,
@@ -2956,7 +2958,7 @@ static int vdr_plugin_flush(vdr_input_plugin_t *this, int timeout_ms)
pthread_mutex_lock(&pool->buffer_pool_mutex);
while(result > 0 && waitresult != ETIMEDOUT) {
TRACE("vdr_plugin_flush waiting (max %d ms), %d+%d buffers used, "
- "%d frames (rd pos=%lld)\n", timeout_ms,
+ "%d frames (rd pos=%" PRIu64 ")\n", timeout_ms,
pool->fifo_size, this->block_buffer->fifo_size,
(int)this->stream->video_out->get_property(this->stream->video_out,
VO_PROP_BUFS_IN_FIFO),
@@ -3207,7 +3209,7 @@ static int vdr_plugin_read_net_udp(vdr_input_plugin_t *this)
/* Re-send failed */
int seq1 = 0, seq2 = 0;
uint64_t rpos = 0ULL;
- sscanf((char*)pkt_data, "UDP MISSING %d-%d %llu",
+ sscanf((char*)pkt_data, "UDP MISSING %d-%d %" PRIu64,
&seq1, &seq2, &rpos);
read_buffer->size = sizeof(stream_udp_header_t);
read_buffer->type = BUF_MAJOR_MASK;
@@ -3323,7 +3325,7 @@ static int vdr_plugin_read_net_udp(vdr_input_plugin_t *this)
while(!udp->queue[current_seq] && --max_req > 0)
INCSEQ(current_seq);
- printf_control(this, "UDP RESEND %d-%d %lld\r\n",
+ printf_control(this, "UDP RESEND %d-%d %" PRIu64 "\r\n",
udp->next_seq, PREVSEQ(current_seq), udp->queue_input_pos);
udp->resend_requested =
(current_seq + (UDP_SEQ_MASK+1) - udp->next_seq) & UDP_SEQ_MASK;
@@ -3486,7 +3488,7 @@ LOGMSG(" pip substream: no stream !");
LOGMSG("vdr_plugin_write: jumbo PES (%d bytes), "
"not enough free buffers !", len);
LOGMSG("vdr_plugin_write: buffer overflow ! "
- "(rd pos=%lld) block_buffer=%du/%df,buffer_pool=%du/%df",
+ "(rd pos=%" PRIu64 ") block_buffer=%du/%df,buffer_pool=%du/%df",
this->curpos, this->block_buffer->size(this->block_buffer),
this->block_buffer->num_free(this->block_buffer),
this->buffer_pool->size(this->buffer_pool),
@@ -3552,7 +3554,7 @@ static off_t vdr_plugin_read (input_plugin_t *this_gen,
return 0;
}
- TRACE("vdr_plugin_read: reading %lld bytes...", len);
+ TRACE("vdr_plugin_read: reading %" PRIu64 " bytes...", (uint64_t)len);
while (total<len) {
@@ -3581,11 +3583,11 @@ static off_t vdr_plugin_read (input_plugin_t *this_gen,
}
pthread_mutex_unlock(&this->lock);
- TRACE("vdr_plugin_read: got %lld bytes (%lld/%lld bytes read)",
- n, total, len);
+ TRACE("vdr_plugin_read: got %" PRIu64 " bytes (%" PRIu64 "/%" PRIu64 " bytes read)",
+ (uint64_t)n, (uint64_t)total, (uint64_t)len);
}
- TRACE("vdr_plugin_read returns %lld bytes",total);
+ TRACE("vdr_plugin_read returns %" PRIu64 " bytes", (uint64_t)total);
return total;
}
@@ -3687,15 +3689,17 @@ static buf_element_t *vdr_plugin_read_block (input_plugin_t *this_gen,
this->curpos += buf->size;
if(this->discard_index > this->curpos && this->guard_index < this->curpos) {
pthread_mutex_unlock(&this->lock);
- TRACE("DISCARD: curpos=%lld, discard_index=%lld",
- this->curpos,this->discard_index);
+ TRACE("DISCARD: curpos=%" PRIu64 ", discard_index=%" PRIu64,
+ this->curpos, this->discard_index);
buf->free_buffer(buf);
buf = NULL;
} else {
#if 0
-if(this->guard_index >= this->curpos)
- LOGMSG("guard index: %lld, discard index: %lld, pos: %lld, diff: %d",
- this->discard_index, this->guard_index, this->curpos, this->discard_index-this->guard_index);
+ if(this->guard_index >= this->curpos)
+ LOGMSG("guard index: %" PRIu64 ", discard index: %" PRIu64 ", "
+ "pos: %" PRIu64" , diff: %" PRIu64,
+ this->discard_index, this->guard_index,
+ this->curpos, this->discard_index-this->guard_index);
#endif
if(this->stream_start)
this->send_pts = 1;
@@ -3744,7 +3748,7 @@ if(this->guard_index >= this->curpos)
}
#endif
- TRACE("vdr_plugin_read_block: return data, pos end = %lld", this->curpos);
+ TRACE("vdr_plugin_read_block: return data, pos end = %" PRIu64, this->curpos);
buf->type = BUF_DEMUX_BLOCK;
return buf;
}
@@ -3755,7 +3759,7 @@ static off_t vdr_plugin_seek (input_plugin_t *this_gen, off_t offset,
#if 0
vdr_input_plugin_t *this = (vdr_input_plugin_t *) this_gen;
- TRACE("Seek %lld bytes, origin %d", offset, origin);
+ TRACE("Seek %" PRIu64 " bytes, origin %d", (uint64_t)offset, origin);
/* only relative forward-seeking is implemented */
pthread_mutex_lock(&this->lock);
@@ -3828,7 +3832,7 @@ static void vdr_plugin_dispose (input_plugin_t *this_gen)
if (this->slave_stream) {
if(this->funcs.fe_control)
- (*(this->funcs.fe_control))(this->funcs.fe_handle, "SLAVE 0x0\r\n");
+ this->funcs.fe_control(this->funcs.fe_handle, "SLAVE 0x0\r\n");
xine_stop(this->slave_stream);
xine_close(this->slave_stream);
xine_dispose(this->slave_stream);
diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c
index 49e2b632..ff2fe1d5 100644
--- a/xine_sxfe_frontend.c
+++ b/xine_sxfe_frontend.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_sxfe_frontend.c,v 1.1 2006-06-03 10:01:18 phintuka Exp $
+ * $Id: xine_sxfe_frontend.c,v 1.2 2006-06-04 11:00:04 phintuka Exp $
*
*/
@@ -167,8 +167,8 @@ static void fe_dest_size_cb (void *data,
*/
static int sxfe_display_open(frontend_t *this_gen, int width, int height, int fullscreen,
- int modeswitch, char *modeline, int aspect,
- fe_keypress_f keyfunc, char *video_port,
+ int modeswitch, const char *modeline, int aspect,
+ fe_keypress_f keyfunc, const char *video_port,
int scale_video, int field_order)
{
sxfe_t *this = (sxfe_t*)this_gen;
@@ -364,7 +364,7 @@ static int sxfe_display_open(frontend_t *this_gen, int width, int height, int fu
*/
static int sxfe_display_config(frontend_t *this_gen,
int width, int height, int fullscreen,
- int modeswitch, char *modeline,
+ int modeswitch, const char *modeline,
int aspect, int scale_video,
int field_order)
{