Commit 5120a54b authored by Jean-Paul Saman's avatar Jean-Paul Saman

Here comes a big commit. It consists of largely 3 pieces:

1) Finally added documentation for dynamic configuration and trickplay assignment to inputs.

2) This commit makes architectural changes in the VLS core code. It makes implementation of different Trickplay strategies possible. Currently only one is supported, the default "normal" trickplay. It works just like the old code. For files this code works correctly. Unfortunately I have not been able to test v4l, dvb and video inputs thoroughly, so expect this commit to breaks things in that area. Please do some additional testing.

3) Support for reading large files >2GB has been extended with new compile options and using 64 bits integers explicitly throughout the affected code.

I also did some cleanup with respect to printfs. There are still a lot in this code, they NEED to be eliminated and replaced by Log(hlog, LOG_XXXX, ....) statements.
parent 21794322
......@@ -2,7 +2,7 @@
# vls (VideoLAN Server) main Makefile
#-------------------------------------------------------------------------------
# (c)1999-2001 VideoLAN
# $Id: Makefile,v 1.106 2003/02/16 15:41:28 tooney Exp $
# $Id: Makefile,v 1.107 2003/06/02 19:50:35 jpsaman Exp $
################################################################################
......@@ -74,6 +74,7 @@ SRC+= src/mpeg/ts.cpp \
src/mpeg/streamdescr.cpp \
src/mpeg/reader.cpp \
src/mpeg/converter.cpp \
src/mpeg/trickplay.cpp \
endif
......@@ -103,13 +104,14 @@ MODULE_LIST:= filereader \
localinput \
videoinput \
dvbinput \
dvbreader \
dvbreader \
v4linput \
v4lreader \
dummyinterface \
telnetinterface \
nativeinterface \
normaltrickplay \
BUILTINSTARGETS:=$(BUILTINS:%:bin/%.a)
PLUGINSTARGETS:=$(PLUGINS:%:bin/%.so)
......
......@@ -72,6 +72,9 @@ DCFLAGS+=-Wall
DCFLAGS+=-MM
CCFLAGS+=-Wall
CCFLAGS+=-D_REENTRANT
# See /usr/include/features.h for the meaning of these macros.
CCFLAGS+=-D_LARGEFILE_SOURCE
CCFLAGS+=-D_LARGEFILE64_SOURCE
CCFLAGS+=-D_FILE_OFFSET_BITS=64
LCFLAGS+=-D_REENTRANT
......
......@@ -6211,7 +6211,7 @@ esac
ARCH=${target_cpu}
BUILTINS="${BUILTINS} filechannel netchannel filereader ts2ts ps2ts localinput videoinput dummyinterface telnetinterface nativeinterface"
BUILTINS="${BUILTINS} filechannel netchannel filereader ts2ts ps2ts localinput videoinput dummyinterface telnetinterface nativeinterface normaltrickplay"
DEBUG=0
# Check whether --enable-debug or --disable-debug was given.
......
......@@ -240,7 +240,7 @@ ARCH=${target_cpu}
dnl
dnl default modules
dnl
BUILTINS="${BUILTINS} filechannel netchannel filereader ts2ts ps2ts localinput videoinput dummyinterface telnetinterface nativeinterface"
BUILTINS="${BUILTINS} filechannel netchannel filereader ts2ts ps2ts localinput videoinput dummyinterface telnetinterface nativeinterface normaltrickplay"
dnl
dnl Debugging mode
......
......@@ -8,7 +8,7 @@
url="mailto:asmax@via.ecp.fr" name="<asmax@via.ecp.fr>">
<date>
$Id: vls-guide.sgml,v 1.27 2003/01/31 14:18:40 tooney Exp $
$Id: vls-guide.sgml,v 1.28 2003/06/02 19:50:35 jpsaman Exp $
</date>
<abstract>
This document describes how to install, configure, and run the VideoLAN Server
......@@ -361,11 +361,11 @@ address !
<p>
The <tt/manager/ controls the way streams are broadcasted. Through an
<tt/administration interface/, you can tell the manager to start, stop,
suspend or resume the different programs. You can also get a list of all
programs available in the Program Table. The manager gets this table from
the vls configuration file (<tt/vls.cfg/), so it cannot be changed once vls
has been started. At the moment, you cannot ask the manager whether a given
stream is being broadcasted, but you will get an error message if you try
suspend, resume, forward or rewind the different programs. You can also get
a list of all programs available in the Program Table. The manager gets this
table from the vls configuration file (<tt/vls.cfg/), so it cannot be changed
once vls has been started. At the moment, you cannot ask the manager whether a
given stream is being broadcasted, but you will get an error message if you try
to stop a stream that was not broadcasted.
</sect2>
</sect1>
......@@ -473,7 +473,7 @@ you must add a line in the following format:
<tscreen>
This adds a group "groupname", the users of which are allowed to execute
command1, command2, and so on. At the moment, the available commands are:
help, browse, start, suspend, resume, stop, shutdown, logout.
help, browse, start, suspend, resume, forward, rewind, stop, shutdown, logout.
</tscreen>
</tscreen>
......@@ -481,7 +481,7 @@ Example:
<tscreen><verb>
BEGIN "Groups"
monitor = "help|browse|logout"
master = "help|browse|start|resume|suspend|stop|shutdown|logout"
master = "help|browse|start|resume|suspend|forward|rewind|stop|shutdown|logout"
END
</verb></tscreen>
</sect2>
......@@ -580,7 +580,21 @@ For each input declared in the "Inputs" section, excepted "local" inputs", you
must add a section with the same name as the corresponding input. For instance, if you declared an input "kfir", there should be one section named "kfir" too.
The syntax of such sections depends on the type of the corresponding input.
To configure a local input, you don't have to do anything:
To configure a local input, you don't have to do anything. Except when another trickplay strategy
must be used:
<tscreen>
<verb>
BEGIN "Local1"
ProgramCount = "1"
TrickPlay = "normal"
END
</verb>
<tscreen>
"Local1" is the name of the local input you want to configure.
"ProgramCount" is the number of programs assigned to this input. "TrickPlay" is the
trickplay strategy that is used by this input (default is "normal").
</tscreen>
</tscreen>
To configure a video input, add a section in the following format:
<tscreen>
......@@ -628,6 +642,7 @@ END
BEGIN "dvb"
DeviceNumber = "0"
TrickPlay = "normal"
END
</verb></tscreen>
</sect2>
......@@ -934,13 +949,12 @@ details about how to use the specified command.
it through the specified channel. The option "--loop" makes the program being
repeated indefinitely. The option "--rtp" makes the TS packet to be send
through the RTP protocol, as defined in RFC 1889 and RFC 2250.
<tag/stop/ Usage: stop &lt;input&gt; &lt;program&gt;
<tag/stop/ Usage: stop &lt;channel&gt;
"stop" ends the broadcast of the specified program of the specified input.
<tag/suspend/ Usage: suspend &lt;input&gt; &lt;program&gt;
"stop" ends the broadcast of the specified channel.
<tag/suspend/ Usage: suspend &lt;channel&gt;
"suspend" suspends the broadcast of the specified program of the specified
input.
"suspend" suspends the broadcast of the specified channel.
<tag/shutdown/ Usage: shutdown
"shutdown" stops all the programs and then the VideoLAN Server stops.
......@@ -951,9 +965,20 @@ Called with one argument, "browse" gives all programs of inputs. Called with
one argument it only gives the programs of the specified input. Each program is
given with its status.
<tag/resume/ Usage: resume &lt;input&gt; &lt;program&gt;
<tag/resume/ Usage: resume &lt;channel&gt;
"resume" resumes the broadcast of the specified channel.
<tag/forward/ Usage: forward &lt;channel&gt; &lt;speed&gt;
"forward" forwards the channel with the given speed. This does not work when reading
directly from a hardware device like an MPEG encoder card or DVB card.
<tag/rewind/ Usage: rewind &lt;channel&gt; &lt;speed&gt;
"rewind" rewinds the channel with the given speed. This does not work when reading
directly from a hardware device like an MPEG encoder card or DVB card.
"resume" resumes the broadcast of the specified program of the specified input.
</descrip>
</sect1>
......
......@@ -2,7 +2,7 @@
* common.h: common definitions
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: common.h,v 1.5 2002/07/12 18:09:36 massiot Exp $
* $Id: common.h,v 1.6 2003/06/02 19:50:35 jpsaman Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
*
......@@ -41,9 +41,10 @@
#define GEN_ERR -1
#define FILE_ERR -2
#define FILE_EOF -3
#define NET_ERR -4
#define MUTEX_ERR -5
#define SYNC_ERR -6
#define FILE_BOF -4
#define NET_ERR -5
#define MUTEX_ERR -6
#define SYNC_ERR -7
// Status code: always > 0
#define BUFFER_FULL 1
......
......@@ -2,7 +2,7 @@
* file.cpp: File management
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: file.cpp,v 1.4 2002/04/10 10:47:18 asmax Exp $
* $Id: file.cpp,v 1.5 2003/06/02 19:50:35 jpsaman Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -138,13 +138,13 @@ void C_File::Close()
// reached so that no data could be read.
// Throws a FileException if an error occurred.
//------------------------------------------------------------------------------
int C_File::Read(byte* pBuff, int iSize)
s64 C_File::Read(byte* pBuff, s64 iSize)
{
ASSERT(m_hFd); // Make sure that the file has been opened
ASSERT(pBuff);
ASSERT(iSize > 0);
int iRc = fread(pBuff, sizeof(byte), iSize, m_hFd);
s64 iRc = fread(pBuff, sizeof(byte), iSize, m_hFd);
if(iRc != iSize)
{
if(feof(m_hFd) && iRc == 0)
......@@ -171,13 +171,13 @@ int C_File::Read(byte* pBuff, int iSize)
// Returns the number of byte written.
// Throws a FileException if an error occurred.
//------------------------------------------------------------------------------
int C_File::Write(const byte* pData, int iSize)
s64 C_File::Write(const byte* pData, s64 iSize)
{
ASSERT(m_hFd); // Make sure that the file has been opened
ASSERT(pData);
ASSERT(iSize > 0);
int iRc = fwrite(pData, sizeof(byte), iSize, m_hFd);
s64 iRc = fwrite(pData, sizeof(byte), iSize, m_hFd);
if(iRc != iSize)
{
ASSERT(!feof(m_hFd));
......@@ -220,11 +220,11 @@ s64 C_File::GetPos()
// Set the position for the file
// Throws a FileException if an error occurred.
//------------------------------------------------------------------------------
int C_File::Seek(s64 iOffset, int iStartPos)
s64 C_File::Seek(s64 iOffset, s64 iStartPos)
{
ASSERT(m_hFd);
int iRc = fseek(m_hFd, iOffset, iStartPos);
s64 iRc = fseek(m_hFd, iOffset, iStartPos);
if(iRc < 0)
{
throw E_File("Could not seek in file '" + m_strPath + "': " +
......@@ -366,10 +366,10 @@ void C_LinkedFile::Close()
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
int C_LinkedFile::Read(byte* pBuff, int iSize)
s64 C_LinkedFile::Read(byte* pBuff, s64 iSize)
{
int iRc = 0;
int iByteRead = 0;
s64 iRc = 0;
s64 iByteRead = 0;
while((iByteRead != iSize) && (iRc != FILE_EOF))
{
......@@ -421,7 +421,7 @@ s64 C_LinkedFile::GetPos()
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
int C_LinkedFile::Seek(s64 iOffset, int bStartPos)
s64 C_LinkedFile::Seek(s64 iOffset, s64 bStartPos)
{
switch(bStartPos)
{
......
......@@ -2,7 +2,7 @@
* File.h: File class definition
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: file.h,v 1.3 2002/03/25 01:57:43 asmax Exp $
* $Id: file.h,v 1.4 2003/06/02 19:50:35 jpsaman Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -73,12 +73,12 @@ public:
void Open(const C_String& strMode, int iPermissions = FILE_DEFAULT_RIGHTS);
void Close();
int Read(byte* pBuff, int iSize);
int Write(const byte* pData, int iSize);
s64 Read(byte* pBuff, s64 iSize);
s64 Write(const byte* pData, s64 iSize);
s64 GetPos();
int Seek(s64 iOffset, int bStartPos);
s64 Seek(s64 iOffset, s64 bStartPos);
bool Exists() const;
C_String GetName() const;
......@@ -101,10 +101,10 @@ public:
void Open(const C_String& strMode, int iPermissions = FILE_DEFAULT_RIGHTS);
void Close();
int Read(byte* pBuff, int iSize);
s64 Read(byte* pBuff, s64 iSize);
s64 GetPos();
int Seek(s64 iOffset, int bStartPos);
s64 Seek(s64 iOffset, s64 bStartPos);
private:
unsigned int m_iFileCount;
......
......@@ -2,7 +2,7 @@
* log.cpp: Logging method
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: log.cpp,v 1.8 2003/04/03 12:27:11 jpsaman Exp $
* $Id: log.cpp,v 1.9 2003/06/02 19:50:35 jpsaman Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
*
......@@ -305,7 +305,7 @@ void C_Log::Append(handle hModule, u8 iLevel, const C_String& strMsg)
// Append the buffer to the logfile and discards errors
const char* pszBuff = strBuff.GetString();
int iLen = strBuff.Length();
s64 iLen = strBuff.Length();
try
{
m_pLogFile->Write((const byte*)pszBuff, iLen);
......
......@@ -2,7 +2,7 @@
* parsers.cpp: Command line and configuration files parsers
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: parsers.cpp,v 1.15 2003/06/02 09:22:45 nitrox Exp $
* $Id: parsers.cpp,v 1.16 2003/06/02 19:50:35 jpsaman Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -437,10 +437,10 @@ void C_CfgFileParser::AddCmdLineTarget(C_String sTarget, C_String sTags)
C_File fFile = C_File(sFile);
fFile.Open("r");
byte bFormat;
fFile.Read(&bFormat, 1);
fFile.Read(&bFormat,(s64) 1);
if(bFormat==0x47) m_pCallBack->OnProperty("Type", "MPEG2-TS");
fFile.Seek(4+1, SEEK_CUR);
fFile.Read(&bFormat, 1);
fFile.Seek((s64)(4+1), SEEK_CUR);
fFile.Read(&bFormat, (s64) 1);
if(bFormat==0x01) m_pCallBack->OnProperty("Type", "MPEG1-PS");
else if(bFormat==0x04) m_pCallBack->OnProperty("Type", "MPEG2-PS");
fFile.Close();
......
......@@ -2,7 +2,7 @@
* dummyinterface.cpp:
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: dummyinterface.cpp,v 1.3 2003/06/02 14:10:44 nitrox Exp $
* $Id: dummyinterface.cpp,v 1.4 2003/06/02 19:50:35 jpsaman Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -115,7 +115,8 @@ C_DummyInterface::C_DummyInterface(C_Module* pModule,
//------------------------------------------------------------------------------
int C_DummyInterface::Init()
{
return 0;
int iRc = NO_ERR;
return iRc;
}
......
......@@ -2,7 +2,7 @@
* dvbinput.cpp: DVB streams
*-------------------------------------------------------------------------------
* (c)1999-2002 VideoLAN
* $Id: dvbinput.cpp,v 1.23 2003/02/18 12:40:40 nitrox Exp $
* $Id: dvbinput.cpp,v 1.24 2003/06/02 19:50:35 jpsaman Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* Damien Lucas <nitrox@videolan.org>
......@@ -66,6 +66,7 @@
#include "../../server/tsstreamer.h"
#include "../../mpeg/reader.h"
#include "../../mpeg/trickplay.h"
#include "../../mpeg/converter.h"
#include "../../mpeg/tsdemux.h"
#include "../../mpeg/dvbpsi.h"
......@@ -118,6 +119,7 @@ C_DvbInput::C_DvbInput(C_Module* pModule,
m_iDemuxUsageCount = 0; // Nothing using the demux yet
m_bIgnoreTimeout = false;
m_pConverter = NULL;
m_pTrickPlay = NULL;
for(int i =0; i < 512; i++)
m_iDemuxes[i] = -1;
}
......@@ -147,6 +149,7 @@ void C_DvbInput::OnInit()
ASSERT(pApp);
iNumber = pApp->GetSetting(GetName() + ".DeviceNumber", "0").ToInt();
m_strTrickPlayType = pApp->GetSetting(GetName() + ".TrickPlay", "Normal").ToLower();
m_iSendMethod = pApp->GetSetting(GetName() + ".SendMethod", "0").ToInt();
m_bIgnoreTimeout = pApp->GetSetting(GetName()+".IgnoreTimeout", "0").ToInt();
dvbrc = pApp->GetSetting(GetName()+ ".Dvbrc", "");
......@@ -229,6 +232,32 @@ void C_DvbInput::OnInit()
cConfig.m_pEventHandler = this;
m_pConverter = pConverterModule->NewMpegConverter(cConfig);
ASSERT(m_pConverter);
// Create the TrickPlay
C_TrickPlayModule* pTrickPlayModule = (C_TrickPlayModule*)
C_Application::GetModuleManager()
->GetModule("trickplay",
m_strTrickPlayType);
if (pTrickPlayModule)
{
C_TrickPlayConfig cTrickPlayConfig;
cTrickPlayConfig.m_hLog = m_hLog;
cTrickPlayConfig.m_pBroadcast = &m_cInputBroadcast;
cTrickPlayConfig.m_pReader = m_pReader;
cTrickPlayConfig.m_pHandler = this;
cTrickPlayConfig.m_iInitFill = 0;
cTrickPlayConfig.m_pEventHandler = this;
cTrickPlayConfig.m_pTsProvider = m_pTsProvider;
cTrickPlayConfig.m_pConverter = m_pConverter;
m_pTrickPlay = pTrickPlayModule->NewTrickPlay(cTrickPlayConfig);
ASSERT(m_pTrickPlay);
}
else
{
throw E_Exception(GEN_ERR, "Module TrickPlay:" + m_strTrickPlayType +
" not present");
}
}
......@@ -241,24 +270,28 @@ void C_DvbInput::OnDestroy()
// PAT Decoder destruction
m_cPatDecoder.Detach();
if(m_pConverter)
try
{
// Stop the input converter if necessary
if(m_pConverter->IsRunning())
if(m_pConverter)
{
try
// Stop the input converter if necessary
if(m_pConverter->IsRunning())
{
m_pConverter->Stop();
}
catch(E_Exception e)
{
m_cEndInit.Release();
delete m_pConverter;
throw e;
}
delete m_pConverter;
}
delete m_pConverter;
if(m_pTrickPlay)
{
m_pTrickPlay->Stop();
delete m_pTrickPlay;
}
catch(E_Exception e)
{
m_cEndInit.Release();
if (m_pConverter) delete m_pConverter;
if (m_pTrickPlay) delete m_pTrickPlay;
throw e;
}
m_cEndInit.Release();
......@@ -412,18 +445,19 @@ void C_DvbInput::OnDvbPsiPatEvent(int iEvent)
dvbpsi_pat_t *pLLPat = m_pCurrentPat->GetLowLevelPat();
dvbpsi_pat_program_t* p_program = pLLPat->p_first_program;
printf( "\n");
printf( "New PAT\n");
printf( " transport_stream_id : %d\n", pLLPat->i_ts_id);
printf( " version_number : %d\n", pLLPat->i_version);
printf( " | program_number @ [NIT|PMT]_PID\n");
Log(m_hLog, LOG_NOTE, C_String("New PAT\n") );
Log(m_hLog, LOG_NOTE, C_String(" transport_stream_id : ") + pLLPat->i_ts_id);
Log(m_hLog, LOG_NOTE, C_String(" version_number : ") + pLLPat->i_version);
Log(m_hLog, LOG_NOTE, C_String(" | program_number @ [NIT|PMT]_PID"));
while(p_program)
{
printf(" | %14d @ 0x%x (%d)\n",
p_program->i_number, p_program->i_pid, p_program->i_pid);
// Log(m_hLog, LOG_NOTE, " | %14d @ 0x%x (%d)\n",
// p_program->i_number, p_program->i_pid, p_program->i_pid);
Log(m_hLog, LOG_NOTE, C_String(" | ") + p_program->i_number +
C_String(" @ 0x") +p_program->i_pid + C_String(" (") + p_program->i_pid + C_String(")") );
p_program = p_program->p_next;
}
printf( " active : %d\n", pLLPat->b_current_next);
Log(m_hLog, LOG_NOTE, " active : " + pLLPat->b_current_next);
C_DvbPsiPat DiffPatSub(0, 0, false);
C_DvbPsiPat DiffPatAdd(0, 0, false);
......@@ -439,22 +473,26 @@ void C_DvbInput::OnDvbPsiPatEvent(int iEvent)
pLLPat = DiffPatSub.GetLowLevelPat();
p_program = pLLPat->p_first_program;
printf( "\n");
printf( "Deleted programs\n");
Log(m_hLog, LOG_NOTE, "\n");
Log(m_hLog, LOG_NOTE, "Deleted programs\n");
while(p_program)
{
printf(" | %14d @ 0x%x (%d)\n",
p_program->i_number, p_program->i_pid, p_program->i_pid);
// Log(m_hLog, LOG_NOTE, " | %14d @ 0x%x (%d)\n",
// p_program->i_number, p_program->i_pid, p_program->i_pid);
Log(m_hLog, LOG_NOTE, C_String(" | ") + p_program->i_number +
C_String(" @ 0x") +p_program->i_pid + C_String(" (") + p_program->i_pid + C_String(")") );
p_program = p_program->p_next;
}
pLLPat = DiffPatAdd.GetLowLevelPat();
p_program = pLLPat->p_first_program;
printf( "\n");
printf( "Added programs\n");
Log(m_hLog, LOG_NOTE, "\n");
Log(m_hLog, LOG_NOTE, "Added programs\n");
while(p_program)
{
printf(" | %14d @ 0x%x (%d)\n",
p_program->i_number, p_program->i_pid, p_program->i_pid);
// Log(m_hLog, LOG_NOTE, " | %14d @ 0x%x (%d)\n",
// p_program->i_number, p_program->i_pid, p_program->i_pid);
Log(m_hLog, LOG_NOTE, C_String(" | ") + p_program->i_number +
C_String(" @ 0x") +p_program->i_pid + C_String(" (") + p_program->i_pid + C_String(")") );
p_program = p_program->p_next;
}
......@@ -493,6 +531,7 @@ void C_DvbInput::OnStartStreaming(C_Broadcast* pBroadcast)
//Launch the demux
m_pConverter->Create();
m_pTrickPlay->Create();
// Add a filter for PAT
SelectPid(&m_cPatDecoder, 0x0000, TS_TYPE_NULL);
......@@ -528,34 +567,26 @@ void C_DvbInput::OnStartStreaming(C_Broadcast* pBroadcast)
// And launch the streaming line
if(pProgram)
{
{
C_SyncFifo* pBuffer =
new C_SyncFifo(2 * pBroadcast->GetChannel()->GetBuffCapacity());
C_TsStreamer *pStreamer = new C_TsStreamer(m_hLog, pBroadcast,
m_pTsProvider, pBuffer,
m_pEventHandler, false, false);
C_TsMux *pMux = new C_TsMux(m_pTsProvider, this, pBuffer);
try
{
u16 iNumber = pBroadcast->GetProgram()->GetName().ToInt();
pStreamer->Create();
pMux->Attach();
pMux->AttachProgram(pProgram->i_number, pProgram->i_pid);
m_cMuxes.Add(iNumber, pMux);
m_cStreamers.Add(iNumber, pStreamer);
}
catch(E_Exception e)
{
......@@ -563,7 +594,6 @@ void C_DvbInput::OnStartStreaming(C_Broadcast* pBroadcast)
delete pMux;
throw e;
}
}
else
{
......@@ -591,6 +621,19 @@ void C_DvbInput::OnSuspendStreaming(C_Broadcast* pBroadcast)
{
}
//------------------------------------------------------------------------------
// Forward the reception of the given program
//------------------------------------------------------------------------------
void C_DvbInput::OnForwardStreaming(C_Broadcast* pBroadcast, int speed)
{
}
//------------------------------------------------------------------------------
// Rewind the reception of the given program
//------------------------------------------------------------------------------
void C_DvbInput::OnRewindStreaming(C_Broadcast* pBroadcast, int speed)
{
}
//------------------------------------------------------------------------------
// Stop the reception of the given program
......@@ -610,8 +653,8 @@ void C_DvbInput::OnStopStreaming(C_Broadcast* pBroadcast)
//Unset the filter on PAT
UnselectPid(&m_cPatDecoder, 0x0000);
m_pConverter->Stop();
m_pTrickPlay->Stop();
}
m_cDemuxUsageM.UnLock();
u16 iNumber = pBroadcast->GetProgram()->GetName().ToInt();
......
......@@ -2,7 +2,7 @@
* dvbinput.h: DVB Input class definition
*-------------------------------------------------------------------------------
* (c)1999-2002 VideoLAN
* $Id: dvbinput.h,v 1.13 2003/02/03 11:47:32 nitrox Exp $
* $Id: dvbinput.h,v 1.14 2003/06/02 19:50:35 jpsaman Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -47,6 +47,8 @@ protected:
virtual void OnStartStreaming(C_Broadcast* pBroadcast);
virtual void OnResumeStreaming(C_Broadcast* pBroadcast);
virtual void OnSuspendStreaming(C_Broadcast* pBroadcast);
virtual void OnForwardStreaming(C_Broadcast* pBroadcast,int speed);
virtual void OnRewindStreaming(C_Broadcast* pBroadcast, int speed);
virtual void OnStopStreaming(C_Broadcast* pBroadcast);
virtual void OnUpdateProgram(C_String strProgram,
C_String strFileName, C_String strType);
......@@ -105,6 +107,10 @@ private:
C_MpegReader *m_pReader;
C_MpegConverter *m_pConverter;
// TrickPlay Module
C_TrickPlay *m_pTrickPlay;
C_String m_strTrickPlayType;
// PAT decoder
C_DvbPsiPatDecoder m_cPatDecoder;
......
......@@ -2,7 +2,7 @@
* dvbreader.cpp: file reader
*-------------------------------------------------------------------------------
* (c)1999-2002 VideoLAN
* $Id: dvbreader.cpp,v 1.3 2003/02/03 11:47:32 nitrox Exp $
* $Id: dvbreader.cpp,v 1.4 2003/06/02 19:50:35 jpsaman Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* Tristan Leteurtre <tooney@videolan.org>
......@@ -111,10 +111,10 @@ void C_DvbMpegReader::Close()
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
int C_DvbMpegReader::Read(byte* pBuff, int iSize)
s64 C_DvbMpegReader::Read(byte* pBuff, s64 iSize)
{
struct pollfd pfd[1];
int iRc;
s64 iRc;
pfd[0].fd=m_hFd;
pfd[0].events=POLLIN;
......@@ -129,7 +129,7 @@ int C_DvbMpegReader::Read(byte* pBuff, int iSize)
}
else if (!m_bIgnoreTimeout)
{
printf("Time out !\n");
Log(m_hLog, LOG_NOTE, "Time out !\n");
return MPEG_STREAMERROR;
}
......@@ -141,9 +141,9 @@ int C_DvbMpegReader::Read(byte* pBuff, int iSize)
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
int C_DvbMpegReader::Seek(s64 iOffset, int bStartPos)
s64 C_DvbMpegReader::Seek(s64 iOffset, s64 bStartPos)
{
return 0;
return (s64)0;
}
......
......@@ -2,7 +2,7 @@
* dvbreader.h: file reader
*-------------------------------------------------------------------------------
* (c)1999-2002 VideoLAN
* $Id: dvbreader.h,v 1.6 2003/04/21 00:54:16 titer Exp $
* $Id: dvbreader.h,v 1.7 2003/06/02 19:50:35 jpsaman Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* Tristan Leteutre <tooney@videolan.org>
......@@ -44,8 +44,8 @@ public:
virtual void Init();
virtual void Close();
virtual int Read(byte* pBuff, int iSize);
virtual int Seek(s64 iOffset, int bStartPos);
virtual s64 Read(byte* pBuff, s64 iSize);
virtual s64 Seek(s64 iOffset, s64 bStartPos);
virtual int GetFrame(byte ** pBuff ,int iSize) { return 0;};
virtual int GetAudioFD() { return 0; }
......
......@@ -2,7 +2,7 @@
* dvdreader.cpp: DVD reader
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: dvdreader.cpp,v 1.6 2002/09/04 10:56:34 jpsaman Exp $