PPS的patch文件已经发布

Totem,mplayer,sopcast,realplayer,bmp
回复
yuu1010
帖子: 185
注册时间: 2008-04-11 23:31

PPS的patch文件已经发布

#1

帖子 yuu1010 » 2009-08-25 0:01

PPS Linux版中MPlayer的patch文件已经发布,去PPS官网下载最新的安装包,解压后就可看到。
附件内即为patch文件,gz后缀是我加的,删掉即可。
附件
pps_for_mplayer.patch.gz
(21.4 KiB) 已下载 133 次
头像
mickeywaley
帖子: 1427
注册时间: 2009-03-19 9:19
系统: ubuntu
来自: 江苏
联系:

Re: PPS的patch文件已经发布

#2

帖子 mickeywaley » 2009-08-25 1:12

:em11

代码: 全选

diff -uprN MPlayer-1.0rc2.orig/configure MPlayer-1.0rc2/configure
--- MPlayer-1.0rc2.orig/configure	2007-10-08 03:49:33.000000000 +0800
+++ MPlayer-1.0rc2/configure	2009-08-24 11:06:17.000000000 +0800
@@ -668,6 +668,7 @@ _enca=auto
 _inet6=auto
 _gethostbyname2=auto
 _ftp=yes
+_pps=no
 _musepack=auto
 _vstream=auto
 _pthreads=auto
@@ -1103,6 +1104,8 @@ for ac_option do
   --disable-unrarlib)	_unrarlib=no	;;
   --enable-ftp)         _ftp=yes        ;;
   --disable-ftp)        _ftp=no         ;;
+  --enable-pps)		_pps=yes	;;
+  --disable-pps)	_pps=no		;;
   --enable-vstream)     _vstream=yes    ;;
   --disable-vstream)    _vstream=no     ;;
   --enable-pthreads)    _pthreads=yes   ;;
@@ -7013,6 +7016,16 @@ else
 fi
 echores "$_ftp"
 
+echocheck "ppstream"
+if not beos && test "$_pps" = yes ; then
+  _def_ftp='#define HAVE_PPS 1'
+  _inputmodules="pps $_inputmodules"
+else
+  _noinputmodules="pps $_noinputmodules"
+  _def_ftp='#undef HAVE_PPS'
+fi
+echores "$_pps"
+
 echocheck "vstream client"
 if test "$_vstream" = auto ; then
   _vstream=no
@@ -7468,8 +7481,12 @@ if test "$_dvdread_internal" = yes || te
   CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
 fi
 
+topdir="`dirname $0`"
+if test "`echo \"$topdir\" | cut -c 1`" != "/" ; then
+  topdir="`pwd`/$topdir"
+fi
+
 CFLAGS="-I. -I.. -I../libavutil $CFLAGS"
-CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
 
 cat > $TMPC << EOF
 int main() { return 0; }
@@ -7553,6 +7570,7 @@ EXESUF = $_exesuf
 
 MPLAYER_NETWORK = $_network
 FTP = $_ftp
+PPS = $_pps
 STREAMING_LIVE555 = $_live
 LIBNEMESI = $_nemesi
 NATIVE_RTSP = $_native_rtsp
diff -uprN MPlayer-1.0rc2.orig/mplayer.c MPlayer-1.0rc2/mplayer.c
--- MPlayer-1.0rc2.orig/mplayer.c	2007-10-08 03:49:33.000000000 +0800
+++ MPlayer-1.0rc2/mplayer.c	2009-08-24 18:32:23.000000000 +0800
@@ -36,6 +36,10 @@
 
 #include <errno.h>
 
+#ifdef HAVE_PPS
+#include "pps.h"
+#endif
+
 #include "version.h"
 
 #include "mp_msg.h"
@@ -377,6 +381,96 @@ static unsigned int inited_flags=0;
 
 #define mp_basename2(s) (strrchr(s,'/')==NULL?(char*)s:(strrchr(s,'/')+1))
 
+#ifdef HAVE_PPS
+int pps_event_proc(int index, pps_event event)
+{
+	int eventid = event.id;
+
+	switch (eventid)
+	{
+		case EPPS_SERVER_TIMEOUT:
+			printf("[pps_callback]: server connecting timeout.\n");
+			break;
+		case EPPS_NO_SERVER:
+			printf("[pps_callback]: can not find server. \n");
+			break;
+		case EPPS_SERVER_NO_RESPONSE:
+			printf("[pps_callback]: no response from server. \n");
+			break;
+		case EPPS_SERVER_INVALID:
+			printf("[pps_callback]: server invalid. \n");
+			break;
+		case EPPS_VERSION_LOW:
+			printf("[pps_callback]: client version too low. \n");
+			break;
+		case EPPS_CLIENT_NAME:
+			printf("[pps_callback]: client name error.\n");
+			break;
+		case EPPS_URL_INVALID:
+			printf("[pps_callback]: url not found.\n");
+			break;
+		case EPPS_NO_SERVICE:
+			printf("[pps_callback]: service does not exist.\n");
+			break;
+		case EPPS_OUT_OF_SERVICE:
+			printf("[pps_callback]: out of service area.\n");
+			break;
+		case EPPS_MEDIA_INFO_ERROR:
+			printf("[pps_callback]: loading media info error.\n");
+			break;
+		case EPPS_INDEX_INFO_ERROR:
+			printf("[pps_callback]: index info error.\n");
+			break;
+		case EPPS_NO_INDEX:
+			printf("[pps_callback]: no index.\n");
+			break;
+		case EPPS_NO_MEIDIA:
+			printf("[pps_callback]: no media found.\n");
+			break;
+		case EPPS_MULTI_INSTANCE:
+			printf("[pps_callback]: multi instance running.\n");
+			break;
+		case EPPS_PREPARE_MEDIA_INFO:
+			printf("[pps_callback]: preparing media info %d%%.\n", event.wparam);
+			break;
+		case EPPS_GETTING_MEDIA_INFO:
+			printf("[pps_callback]: requesting media info %d%%.\n", event.wparam);
+			break;
+		case EPPS_GETTING_INDEX_INFO:
+			printf("[pps_callback]: requesting index info %d%%.\n", event.wparam);
+			break;
+		case EPPS_PLAYING:
+			printf("[pps_callback]: playing.\n");
+			break;
+		case EPPS_BUFFERING:
+			printf("[pps_callback]: buffering %d%%...\n", event.wparam);
+			break;
+		case EPPS_CONNECTING:
+			printf("[pps_callback]: connecting to server...\n");
+			break;
+		case EPPS_MEDIA_READY:
+			printf("[pps_callback]: media is ready.\n");
+			break;
+		case EPPS_PARSING_SERVER:
+			printf("[pps_callback]: parsing server info.\n");
+			break;
+		case EPPS_GET_MEDIA_INFO:
+			printf("[pps_callback]: get media info successfully.\n");
+			break;
+		case EPPS_BUFFERED:
+			printf("[pps_callback]: buffing done.\n");
+			break;
+		case EPPS_PREPARE_MEDIA:
+			printf("[pps_callback]: prepare media.\n");
+			break;
+		default:
+			printf("[pps_callback]: unknown event.\n");
+			break;
+	}
+	return 0;
+}
+#endif
+
 void *mpctx_get_video_out(MPContext *mpctx)
 {
     return mpctx->video_out;
@@ -700,6 +794,10 @@ void exit_player_with_rc(const char* how
   if(how) mp_msg(MSGT_CPLAYER,MSGL_INFO,MSGTR_ExitingHow,how);
   mp_msg(MSGT_CPLAYER,MSGL_DBG2,"max framesize was %d bytes\n",max_framesize);
 
+#ifdef HAVE_PPS
+ppsvod_destroy();
+#endif
+
   exit(rc);
 }
 
@@ -1099,6 +1197,20 @@ static void sadd_hhmmssf(char *buf, unsi
  */
 static void print_status(float a_pos, float a_v, float corr)
 {
+#ifdef HAVE_PPS
+	ppsvod_iteminfo *pti = NULL;
+	static unsigned long long i = 0ull;
+
+	if ((i % 5ull) == 0)
+	{
+		if ((pti = ppsvod_get_item_info(mpctx->stream->fd)) == NULL)
+			return;
+
+		printf("##filesize:%10u, down:%8d, peer:%3d, percent:%3d%%\r", pti->file_size, pti->down_speed, pti->peer_count, pti->progress);
+		ppsvod_free_item_info(pti);
+	}
+	i++;
+#else
   sh_video_t * const sh_video = mpctx->sh_video;
   int width;
   char *line;
@@ -1183,6 +1295,8 @@ static void print_status(float a_pos, fl
     mp_msg(MSGT_STATUSLINE, MSGL_STATUS, "%s\r", line);
   }
   free(line);
+
+#endif // HAVE_PPS
 }
 
 /**
@@ -2499,9 +2613,11 @@ if(!codecs_file || !parse_codec_cfg(code
 
     if(!filename && !player_idle_mode){
       if(!use_gui){
+#ifndef HAVE_PPS
 	// no file/vcd/dvd -> show HELP:
 	mp_msg(MSGT_CPLAYER, MSGL_INFO, help_text);
         exit_player_with_rc(NULL, 0);
+#endif
       } else gui_no_filename=1;
     }
 
@@ -2667,6 +2783,15 @@ current_module = NULL;
   }
 #endif
 
+#ifdef HAVE_PPS
+// =================== Init pps ==============================
+    if (ppsvod_create("ppstream", "demo", "ppsdemo001", pps_event_proc) < 0)
+	{
+		printf("ppsvod_create falied\n");
+		return -1;
+	}
+#endif
+
 // ******************* Now, let's see the per-file stuff ********************
 
 play_next_file:
@@ -3689,7 +3814,6 @@ if(use_gui || mpctx->playtree_iter != NU
   goto play_next_file;
 }
 
-
 exit_player_with_rc(MSGTR_Exit_eof, 0);
 
 return 1;
diff -uprN MPlayer-1.0rc2.orig/pps.h MPlayer-1.0rc2/pps.h
--- MPlayer-1.0rc2.orig/pps.h	1970-01-01 08:00:00.000000000 +0800
+++ MPlayer-1.0rc2/pps.h	2009-08-24 14:49:23.000000000 +0800
@@ -0,0 +1,201 @@
+#ifndef __PPS_H__
+#define __PPS_H__
+
+
+#ifndef HASH_VALUE_LENGTH
+#define HASH_VALUE_LENGTH  20
+#endif
+
+#define PPS_EXTRA_MSG_LEN  64
+
+typedef unsigned long long uint64_t;
+typedef long long          int64_t;
+
+typedef enum pps_event_id
+{
+	EPPS_SERVER_TIMEOUT,            // 0,  连接服务器超时,停止播放
+	EPPS_NO_SERVER,                 // 1,  找不到服务器,停止播放
+	EPPS_SERVER_NO_RESPONSE,        // 2,  服务器未响应,停止播放
+	EPPS_SERVER_INVALID,            // 3,  解析服务器域名失败.
+	EPPS_VERSION_LOW,               // 4,  客户端版本号太低,退出网络
+	EPPS_CLIENT_NAME,               // 5,  客户端名称或引用页不正确,退出播放
+	EPPS_URL_INVALID,               // 6,  播放的文件不存在或网址错误
+	EPPS_NO_SERVICE,                // 7,  服务不存在,停止播放
+	EPPS_OUT_OF_SERVICE,            // 8,  不在服务区.    
+	EPPS_MEDIA_INFO_ERROR,          // 9,  媒体信息加载时错误..
+	EPPS_INDEX_INFO_ERROR,          // 10, 媒体索引信息错误
+	EPPS_NO_INDEX,                  // 11, 没有获取到媒体索引信息,不能拖动播放位置
+	EPPS_NO_MEIDIA,                 // 12, 找不到媒体
+	EPPS_MULTI_INSTANCE,            // 13, 请确定是否有另一个实例正在播放此文件
+	EPPS_PREPARE_MEDIA_INFO,        // 14, 正在准备媒体信息
+	EPPS_GETTING_MEDIA_INFO,        // 15, 正在获取媒体信息
+	EPPS_GETTING_INDEX_INFO,        // 16, 正在获取媒体索引信息
+	EPPS_PLAYING,                   // 17, 正在播放
+	EPPS_BUFFERING,                 // 18, 正在缓冲数据
+	EPPS_CONNECTING,                // 19, 正在连入网络
+	EPPS_MEDIA_READY,               // 20, 准备媒体就绪
+	EPPS_PARSING_SERVER,            // 21, 正在解析服务器域名..
+	EPPS_GET_MEDIA_INFO,            // 22, 已成功获取到媒体信息.
+	EPPS_BUFFERED,                  // 23, 数据缓冲完毕.
+	EPPS_PREPARE_MEDIA,             // 24, 准备媒体
+	EPPS_STORAGE_ERROR,             // 25. 访问存储器失败
+	EPPS_QUIT,                      // 26. 程序退出
+
+	EPPS_DATA_TIMEOUT,              // 27, 等待数据超时
+
+	EPPS_UPDATING,                  // 28, 正在升级
+	EPPS_UPDATE_FAILED,             // 29, 升级失败
+	EPPS_UPDATE_OK,                 // 30, 升级成功
+}pps_event_id;
+
+typedef struct pps_event
+{
+	pps_event_id id;
+	unsigned int wparam;
+	unsigned int lparam;
+	char         extra[PPS_EXTRA_MSG_LEN];
+}pps_event;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef int (*pps_callback)(int index, pps_event event); 
+
+#ifdef __cplusplus
+}
+#endif
+
+
+typedef struct ppsvod_iteminfo
+{
+	int          index;
+	char         hash_id[HASH_VALUE_LENGTH];        // task hash id
+	char        *file_name;                         // save name
+	unsigned int file_size;                         // total file size
+	int          progress;                          // download percent 
+	int          down_speed;                        // download speed (byte/s)
+	int          up_speed;                          // upload speed (byte/s)
+	int          peer_count;                        // peer count has connected
+	int          status;                            // has the task been started?
+}ppsvod_iteminfo;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Description: ppsvod initialization, must be called before all.
+ * param:       Datatype               Param name      In/Out     Comment
+ *              const char *           oem_name        in
+ *              const char *           terminal_type   in
+ *              const char *           device_id       in
+ *              pps_callback           pcallback       in         callback function pointer
+ * return:      int    return 0 if success; -1 if failed.
+ */
+int ppsvod_create(const char *oem_name, 
+                const char * terminal_type, 
+                const char *device_id, 
+                pps_callback pcallback);
+
+/*
+ * Description: uninitialize ppsvod, call this fuction when you want to exit ppsvod.
+ * param:       Datatype     Param name      In/Out     Comment
+ *              void
+ * return:      int    return 0 if success; -1 if failed
+ */
+int ppsvod_destroy(void);
+
+/*
+ * Description: Add an item into ppsvod internal list.
+ * param:       Datatype     Param name      In/Out     Comment
+ *              char *       url             In         url to add
+ *              int          vip_flag        In         flag for vip items
+ * return:      int    return a file descriptor if success; -1 if failed.
+ */
+int ppsvod_add_item(char *url, int vip_flag);
+
+/*
+ * Description: Remove an item from ppsvod internal list.
+ * param:       Datatype     Param name      In/Out     Comment
+ *              int          fd              In         file descriptor
+ * return:      int    return 0 if success; -1 if failed.
+ */
+int ppsvod_remove_item(int fd);
+
+/*
+ * Description: start to play a file.
+ * param:       Datatype     Param name      In/Out     Comment
+ *              int          fd              In         file descriptor
+ *              const char*  validcode       In         
+ * return:      int    return 0 if success; -1 if failed.
+ */
+int  ppsvod_play_item(int fd, const char * validcode);
+
+/*
+ * Description: stop the playing url.
+ * param:       Datatype     Param name      In/Out     Comment
+ *              int          fd              In         file descriptor
+ * return:      int    return 0 if success; -1 if failed; -3 means validcode error.
+ */
+int ppsvod_stop_item(int fd);
+
+/*
+ * Description: read data.
+ * param:       Datatype     Param name      In/Out     Comment
+ *              int            fd              In       file descriptor
+ *              char *         buffer          Out      buffer to store data
+ *              unsigned int   length          In       data length
+ *              unsigned int   position        In       from where to read.
+ *              struct timeval* wait_time      In       time length that read() can block
+ * return:      int    return length of data if success; -1 if failed(errno
+ *                     is set to EAGAIN if data is temporarily unavailable; etherwise,
+ *                     some error happens or EOF reaches). 
+ */
+int ppsvod_read(int fd, char *buffer, unsigned int length, unsigned int position, struct      timeval *wait_time);
+
+/*
+ * Description: Drop read operation
+ * param:       Datatype     Param name      In/Out     Comment
+ *              int            fd              In       file descriptor
+ */
+void ppsvod_drop_read(int fd);
+
+/*
+ * Description: seeking within a playing url.
+ * param:       Datatype     Param name      In/Out     Comment
+ *              int           fd              In        file descriptor
+ *              unsigned int  position        In        seeking destination
+ * return:      int    return 0 if success; -1 if failed.
+ */
+int  ppsvod_seek(int fd, unsigned int position);
+
+/*
+ * Description: get total file length
+ * param:       Datatype     Param name      In/Out     Comment
+ *              int          fd              In         file descriptor
+ * return:      int    return file length if success; -1 if failed.
+ */
+int  ppsvod_get_file_length(int fd);
+
+/*
+ * Description: Get information for a playing file.
+ * param:       Datatype     Param name      In/Out     Comment
+ *              int          fd              In         file descriptor
+ * return:      ppsvod_iteminfo*   return a pointer to ppsvod_iteminfo if success; 
+ *                                 NULL if failed.
+ */
+ppsvod_iteminfo *ppsvod_get_item_info(int fd);
+
+/*
+ * Description: Free memory of a ppsvod_iteminfo* pointer
+ * param:       Datatype         Param name      In/Out     Comment
+ *              ppsvod_iteminfo* piteminfo       In         pointer returned by ppsvod_get_item_info
+ * return:      void
+ */
+void ppsvod_free_item_info(ppsvod_iteminfo *piteminfo);
+
+#ifdef __cplusplus
+}
+#endif
+#endif	// __PPS_H__
diff -uprN MPlayer-1.0rc2.orig/stream/Makefile MPlayer-1.0rc2/stream/Makefile
--- MPlayer-1.0rc2.orig/stream/Makefile	2007-10-08 03:49:26.000000000 +0800
+++ MPlayer-1.0rc2/stream/Makefile	2009-08-24 10:51:32.000000000 +0800
@@ -10,6 +10,7 @@ SRCS_COMMON = open.c \
               stream_null.c \
               url.c \
 
+SRCS_COMMON-$(PPS)		 += stream_pps.c
 SRCS_COMMON-$(CDDA)              += stream_cdda.c cdinfo.c
 SRCS_COMMON-$(CDDB)              += stream_cddb.c
 SRCS_COMMON-$(DVBIN)             += dvb_tune.c stream_dvb.c
diff -uprN MPlayer-1.0rc2.orig/stream/stream.c MPlayer-1.0rc2/stream/stream.c
--- MPlayer-1.0rc2.orig/stream/stream.c	2007-10-08 03:49:26.000000000 +0800
+++ MPlayer-1.0rc2/stream/stream.c	2009-08-24 10:51:01.000000000 +0800
@@ -87,8 +87,14 @@ extern stream_info_t stream_info_file;
 #ifdef USE_DVDREAD
 extern stream_info_t stream_info_dvd;
 #endif
+#ifdef HAVE_PPS
+extern stream_info_t stream_info_pps;
+#endif
 
 stream_info_t* auto_open_streams[] = {
+#ifdef HAVE_PPS
+  &stream_info_pps,
+#endif
 #ifdef HAVE_VCD
   &stream_info_vcd,
 #endif
diff -uprN MPlayer-1.0rc2.orig/stream/stream_pps.c MPlayer-1.0rc2/stream/stream_pps.c
--- MPlayer-1.0rc2.orig/stream/stream_pps.c	1970-01-01 08:00:00.000000000 +0800
+++ MPlayer-1.0rc2/stream/stream_pps.c	2009-08-24 12:33:35.000000000 +0800
@@ -0,0 +1,242 @@
+
+#include "config.h"
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "mp_msg.h"
+#include "stream.h"
+#include "help_mp.h"
+#include "m_option.h"
+#include "m_struct.h"
+
+#include "../pps.h"
+
+static struct stream_priv_s {
+  char* filename;
+  char *filename2;
+} stream_priv_dflts = {
+  NULL, NULL
+};
+
+#define ST_OFF(f) M_ST_OFF(struct stream_priv_s,f)
+/// URL definition
+static m_option_t stream_opts_fields[] = {
+  {"string", ST_OFF(filename), CONF_TYPE_STRING, 0, 0 ,0, NULL},
+  {"filename", ST_OFF(filename2), CONF_TYPE_STRING, 0, 0 ,0, NULL},
+  { NULL, NULL, 0, 0, 0, 0,  NULL }
+};
+static struct m_struct_st stream_opts = {
+  "pps",
+  sizeof(struct stream_priv_s),
+  &stream_priv_dflts,
+  stream_opts_fields
+};  
+
+static int pps_fill_buffer(stream_t *s, char* buffer, int max_len){
+#if 0
+  int r = 0;
+  r = ppsvod_read(s->fd, buffer, max_len, s->pos);
+  while(r == -1 && errno == EAGAIN)
+  {
+    usleep(50000);
+    r = ppsvod_read(s->fd, buffer, max_len, s->pos);
+  }
+  return (r <= 0) ? -1 : r;
+#else
+  int r = 0;
+  struct timeval block_time;
+
+  block_time.tv_sec = 40;
+  block_time.tv_usec = 0; //800ms
+  r = ppsvod_read(s->fd, buffer, max_len, s->pos, &block_time);
+  return (r <= 0) ? -1 : r;
+#endif
+}
+
+static int pps_seek(stream_t *s,off_t newpos) {
+  s->pos = newpos;
+#if 0
+  if(ppsvod_seek(s->fd, s->pos) < 0) {
+    s->eof=1;
+    return 0;
+  }
+#endif
+  return 1;
+}
+
+static int pps_seek_forward(stream_t *s,off_t newpos) {
+  if(newpos<s->pos){
+    mp_msg(MSGT_STREAM,MSGL_INFO,"Cannot seek backward in linear streams!\n");
+    return 0;
+  }
+  while(s->pos<newpos){
+    int len=s->fill_buffer(s,(char *)s->buffer,STREAM_BUFFER_SIZE);
+    if(len<=0){ s->eof=1; s->buf_pos=s->buf_len=0; break; } // EOF
+    s->buf_pos=0;
+    s->buf_len=len;
+    s->pos+=len;
+  }
+  return 1;
+}
+
+static int pps_control(stream_t *s, int cmd, void *arg) {
+  switch(cmd) {
+    case STREAM_CTRL_GET_SIZE: {
+      off_t size;
+#if 0
+      size = ppsvod_getlength(s->fd);
+#else
+	ppsvod_iteminfo *pti = NULL;
+	if ((pti = ppsvod_get_item_info(s->fd)) == NULL)
+		return STREAM_UNSUPPORTED;
+	size = pti->file_size;
+	ppsvod_free_item_info(pti);
+#endif
+      if(size != (off_t)-1) {
+        *((off_t*)arg) = size;
+        return 1;
+      }
+    }
+  }
+  return STREAM_UNSUPPORTED;
+}
+static void pps_close(stream_t *s) {
+#if 0
+  ppsvod_stop(s->url);
+#else
+  if (ppsvod_stop_item(s->fd) < 0)
+	  printf("stop task %d failed.\n", s->fd);
+  if (ppsvod_remove_item(s->fd) < 0)
+	  printf("remove task %d failed.\n", s->fd);
+#endif
+  s->fd = 0;
+}
+static int open_f(stream_t *stream,int mode, void* opts, int* file_format) {
+  int f;
+  mode_t m = 0;
+  off_t len;
+  char *filename;
+  struct stream_priv_s* p = (struct stream_priv_s*)opts;
+
+  char *localname = NULL;
+#if 1
+  ppsvod_iteminfo *pti = NULL;
+#endif
+  if(mode == STREAM_READ)
+    m = O_RDONLY;
+  else if(mode == STREAM_WRITE)
+    m = O_RDWR|O_CREAT|O_TRUNC;
+  else {
+    mp_msg(MSGT_OPEN,MSGL_ERR, "[file] Unknown open mode %d\n",mode);
+    m_struct_free(&stream_opts,opts);
+    return STREAM_UNSUPPORTED;
+  }
+
+  if(p->filename)
+    filename = p->filename;
+  else if(p->filename2)
+    filename = p->filename2;
+  else
+    filename = NULL;
+  if(!filename) {
+    mp_msg(MSGT_OPEN,MSGL_ERR, "[file] No filename\n");
+    m_struct_free(&stream_opts,opts);
+    return STREAM_ERROR;
+  }
+#if 0
+  if (ppsvod_checkurl(stream->url) < 0)
+  {
+		mp_msg(MSGT_OPEN,MSGL_ERR, "[file] filename error 1, not pps file\n");
+		m_struct_free(&stream_opts,opts);
+		return STREAM_ERROR;
+  }
+#endif
+
+#if defined(__CYGWIN__)|| defined(__MINGW32__)
+  m |= O_BINARY;
+#endif    
+
+  if(!strcmp(filename,"-")){
+    if(mode == STREAM_READ) {
+      // read from stdin
+      mp_msg(MSGT_OPEN,MSGL_INFO,MSGTR_ReadSTDIN);
+      f=0; // 0=stdin
+#ifdef __MINGW32__
+	  setmode(fileno(stdin),O_BINARY);
+#endif
+    } else {
+      mp_msg(MSGT_OPEN,MSGL_INFO,"Writing to stdout\n");
+      f=1;
+#ifdef __MINGW32__
+	  setmode(fileno(stdout),O_BINARY);
+#endif
+    }
+  } else {
+#if 0
+	  f = ppsvod_play(stream->url);
+#else
+	  f = ppsvod_add_item(stream->url, 0);
+#endif
+	  if (f < 0) {
+		  mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_FileNotFound,stream->url);
+		  m_struct_free(&stream_opts,opts);
+		  return STREAM_ERROR;
+	  }
+#if 1
+	  if (ppsvod_play_item(f, NULL) < 0)
+	  {
+		  printf("ppsvod_play_item failed\n");
+		  return STREAM_ERROR;
+	  }
+#endif
+  }
+
+#if 0
+  len = ppsvod_getlength(f);
+#else
+
+	if ((pti = ppsvod_get_item_info(f)) == NULL)
+		return STREAM_UNSUPPORTED;
+	len = pti->file_size;
+	ppsvod_free_item_info(pti);
+#endif
+
+#ifdef __MINGW32__
+  if(f==0 || len == -1) {
+#else
+  if(len == -1) {
+#endif
+    if(mode == STREAM_READ) stream->seek = pps_seek_forward;
+    stream->type = STREAMTYPE_STREAM; // Must be move to STREAMTYPE_FILE
+    stream->flags |= STREAM_SEEK_FW;
+  } else if(len >= 0) {
+    stream->seek = pps_seek;
+    stream->end_pos = len;
+    stream->type = STREAMTYPE_FILE;
+  }
+
+  mp_msg(MSGT_OPEN,MSGL_V,"[file] File size is %lld bytes\n", (int64_t)len);
+
+  stream->fd = f;
+  stream->fill_buffer = pps_fill_buffer;
+  stream->control = pps_control;
+  stream->close = pps_close;
+  m_struct_free(&stream_opts,opts);
+  return STREAM_OK;
+}
+
+stream_info_t stream_info_pps = {
+  "PPS",
+  "pps",
+  "PPStream",
+  "based on the code from stream_file.c",
+  open_f,
+  { "tvod", NULL },
+  &stream_opts,
+  1 // Urls are an option string
+};
头像
gcell
帖子: 429
注册时间: 2007-04-30 2:25
来自: 湖南湘潭
联系:

Re: PPS的patch文件已经发布

#3

帖子 gcell » 2009-08-25 1:28

听说是为了规避GPL……
孰能浊静之以徐清,孰能安动之以馀生!
gcell -- http://gcell.blog.163.com/
头像
lerosua
论坛版主
帖子: 8455
注册时间: 2007-11-29 9:41
联系:

Re: PPS的patch文件已经发布

#4

帖子 lerosua » 2009-08-25 13:32

我关心的是,解决root播放的问题没
头像
skyx
论坛版主
帖子: 9202
注册时间: 2006-12-23 13:46
来自: Azores Islands
联系:

Re: PPS的patch文件已经发布

#5

帖子 skyx » 2009-08-25 14:15

lerosua 写了:我关心的是,解决root播放的问题没
斗蓬关心的,正是大家都关心的问题
no security measure is worth anything if an attacker has physical access to the machine
头像
lerosua
论坛版主
帖子: 8455
注册时间: 2007-11-29 9:41
联系:

Re: PPS的patch文件已经发布

#6

帖子 lerosua » 2009-08-25 14:44

放出源码,表明pps官方是有诚意的。但诚意有点不够啊,解决root播放的问题嘛
头像
gcell
帖子: 429
注册时间: 2007-04-30 2:25
来自: 湖南湘潭
联系:

Re: PPS的patch文件已经发布

#7

帖子 gcell » 2009-08-25 17:30

斗篷兄,我顶你!
孰能浊静之以徐清,孰能安动之以馀生!
gcell -- http://gcell.blog.163.com/
头像
xiooli
帖子: 6956
注册时间: 2007-11-19 21:51
来自: 成都
联系:

Re: PPS的patch文件已经发布

#8

帖子 xiooli » 2009-08-25 17:35

不解决root问题。不敢用啊。
头像
HuntXu
帖子: 5776
注册时间: 2007-09-29 3:09

Re: PPS的patch文件已经发布

#9

帖子 HuntXu » 2009-08-25 17:51

root播放问题是啥,还没用过不知道情况?
HUNT Unfortunately No Talent...
头像
INUYASHA
帖子: 366
注册时间: 2007-03-16 15:42

Re: PPS的patch文件已经发布

#10

帖子 INUYASHA » 2009-08-25 19:15

pps 官方用的mplayer的版本也太旧了亚
svn版的mplayer用这补丁打不了 :em20
头像
INUYASHA
帖子: 366
注册时间: 2007-03-16 15:42

Re: PPS的patch文件已经发布

#11

帖子 INUYASHA » 2009-08-25 21:16

貌似svn版的mplayer 不能指定--with-extralibdir了
头像
eagle5678
帖子: 1865
注册时间: 2006-07-08 14:07

Re: PPS的patch文件已经发布

#12

帖子 eagle5678 » 2009-08-29 15:09

INUYASHA 写了:pps 官方用的mplayer的版本也太旧了亚
svn版的mplayer用这补丁打不了 :em20
MPlayer 1.0rc2的补丁,可以打得过,X64系统,不懂怎编译32的 :em20 pps的库进不去

代码: 全选

ppsmplayer -ao help
MPlayer 1.0rc2-4.3.2 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) 64 Processor 3200+ (Family: 15, Model: 47, Stepping: 2)
3DNow supported but disabled
3DNowExt supported but disabled
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2
Warning unknown option subfont-autoscale at line 6
Available audio output drivers:
	oss	OSS/ioctl audio output
	mpegpes	Mpeg-PES audio output
	null	Null audio output
	pcm	RAW PCM/WAVE file writer audio output

参数太少了,OSS没声音,有谁重新编译下打开alsa或pulse

代码: 全选

mplayer -ao help
MPlayer 1.0rc2-4.3.2 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) 64 Processor 3200+ (Family: 15, Model: 47, Stepping: 2)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
Available audio output drivers:
	oss	OSS/ioctl audio output
	alsa	ALSA-0.9.x-1.x audio output
	arts	aRts audio output
	esd	EsounD audio output
	pulse	PulseAudio audio output
	jack	JACK audio output
	nas	NAS audio output
	sdl	SDLlib audio output
	openal	OpenAL audio output
	mpegpes	DVB audio output
	v4l2	V4L2 MPEG Audio Decoder output
	null	Null audio output
	pcm	RAW PCM/WAVE file writer audio output
回复