Commit 21ffd8e3 authored by Tristan Leteurtre's avatar Tristan Leteurtre

. Fixes of the previous commit

parent d38a204a
......@@ -2,7 +2,7 @@
# vls (VideoLAN Server) main Makefile
#-------------------------------------------------------------------------------
# (c)1999-2001 VideoLAN
# $Id: Makefile,v 1.102 2002/12/08 15:55:29 nitrox Exp $
# $Id: Makefile,v 1.103 2002/12/11 23:02:23 tooney Exp $
################################################################################
......@@ -71,6 +71,7 @@ endif
ifeq ($(NEEDSRC_mpegbase),1)
SRC+= src/mpeg/ts.cpp \
src/mpeg/rtp.cpp \
src/mpeg/pes.cpp \
src/mpeg/streamdescr.cpp \
src/mpeg/reader.cpp \
src/mpeg/converter.cpp \
......@@ -97,13 +98,15 @@ MODULE_LIST:= filereader \
dvdreader \
ts2ts \
ps2ts \
raw2ts \
filechannel \
netchannel \
localinput \
videoinput \
dvbinput \
dvbreader \
v4linput \
v4lreader \
BUILTINSTARGETS:=$(BUILTINS:%:bin/%.a)
PLUGINSTARGETS:=$(PLUGINS:%:bin/%.so)
......
......@@ -2,7 +2,7 @@
* v4linput.cpp: Veading from a v4l device (WebCam, tv tuner)
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: v4linput.cpp,v 1.1 2002/12/11 17:32:58 tooney Exp $
* $Id: v4linput.cpp,v 1.2 2002/12/11 23:02:23 tooney Exp $
*
* Authors: Tristan Leteurtre <tooney@videolan.org>
*
......@@ -98,13 +98,7 @@ C_v4lInput::~C_v4lInput()
//------------------------------------------------------------------------------
void C_v4lInput::OnInit()
{
C_Settings m_cSettings;
C_Application* pApp = C_Application::GetApp();
ASSERT(pApp);
// Build the program list
C_String* pStr = new C_String("video");
m_vProgramNames.Add(pStr);
}
......
......@@ -2,7 +2,7 @@
* reader.h: Stream readers
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: reader.h,v 1.2 2002/07/12 14:38:56 jpsaman Exp $
* $Id: reader.h,v 1.3 2002/12/11 23:02:23 tooney Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -58,6 +58,9 @@ public:
virtual int Read(byte* pBuff, int iSize) = 0;
virtual int Seek(s64 iOffset, int bStartPos) = 0;
virtual int GetFrame(byte ** pBuff ,int iSize) = 0;
virtual s64 Size() = 0;
virtual s64 GetPos() = 0;
......
......@@ -2,7 +2,7 @@
* ts.cpp: TS packet manipulation
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: ts.cpp,v 1.2 2002/03/17 23:20:22 bozo Exp $
* $Id: ts.cpp,v 1.3 2002/12/11 23:02:23 tooney Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
*
......@@ -216,16 +216,25 @@ u8 C_TsPacket::BuildAdaptionField(u64 iPCR)
bData[3] |= 0x20;
// Adaption field length
bData[4] = 1+6;
bData[4] = 1 + 6 /*PCR*/;
// PCR_base is the only extension present in the adaption field
bData[5] = 0x10;
// PCR_base value
SET_U32_TO(bData[6], (iPCR >> 1) & 0xFFFFFFFF);
bData[10] = (iPCR & 0x1);
bData[11] = (iPCR & 0x1);
return 4+2+6;
}
u8 C_TsPacket::FillWith(byte * pBuff, int iBeginning, int iBuffLength)
{
ASSERT(iBeginning + iBuffLength <= TS_PACKET_LEN);
memcpy(bData + iBeginning, pBuff, iBuffLength);
return 0;
}
//------------------------------------------------------------------------------
// AddStuffingBytes: Add stuff to complete the TS packet
......@@ -274,7 +283,6 @@ u8 C_TsPacket::AddStuffingBytes(u8 iPayloadLen)
}
//******************************************************************************
// C_PsiSection class
//******************************************************************************
......@@ -644,3 +652,50 @@ void C_Pmt::Write(C_TsPacket* pPacket)
IncrementCounter();
}
void C_TsPacket::BuildPAT()
{
bData[4] = 0x00;
bData[0+5] = 0x00;
bData[1+5] = 0x80;
bData[2+5] = 0x0D;
bData[3+5] = 0x00;
bData[4+5] = 0x00;
bData[5+5] = 0xFF;
bData[6+5] = 0x00;
bData[7+5] = 0x00;
bData[8+5] = 0x12;
bData[9+5] = 0x12;
bData[10+5] = 0;
bData[11+5] = 0x12;
bData[12+5] = 0x8A;
bData[13+5] = 0x42;
bData[14+5] = 0x52;
bData[15+5] = 0x80;
}
void C_TsPacket::BuildPMT()
{
bData[4] = 0x00;
bData[0+5] = 0x02;
bData[1+5] = 0x80;
bData[2+5] = 0x12;
bData[3+5] = 0x12;
bData[4+5] = 0x12;
bData[5+5] = 0xff;
bData[6+5] = 0;
bData[7+5] = 0;
bData[8+5] = 0xe0; //reserved bit : 111
bData[9+5] = 0xE0;
bData[10+5] = 0xf0; //reserved bit : 1111
bData[11+5] = 0;
bData[12+5] = 1;
bData[13+5] = 0xE0;//reserved bit : 111
bData[14+5] = 0xE0; //pid
bData[15+5] = 0xF0; //reserved bit : 1111
bData[16+5] = 0;
bData[17+5] = 0x87;
bData[18+5] = 0x80;
bData[19+5] = 0x8C;
bData[20+5] = 0xAA;
}
......@@ -2,7 +2,7 @@
* ts.h: TsPacket class definition
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: ts.h,v 1.5 2002/08/09 13:42:32 tooney Exp $
* $Id: ts.h,v 1.6 2002/12/11 23:02:23 tooney Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
*
......@@ -43,11 +43,15 @@ class C_TsPacket
u8 BuildHeader(u16 iPid, bool bUnitStart, u8 iCounter);
u8 BuildAdaptionField(u64 iPCR);
u8 AddStuffingBytes(u8 iPayloadLen);
u8 FillWith(byte * pBuff, int iBeginning, int iEnd);
// Packet modifications
void IncrementCounter();
void SetErrorFlag(bool bError = true);
bool SetDiscontinuityFlag(bool bDiscontinuity = true);
void BuildPAT();
void BuildPMT();
// Packet decoding
u16 GetPid() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment