[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-datatype-cvs
Subject: [Datatype-cvs] flash/flv/fileformat flv_file_format.cpp,
From: yuanzhang () helixcommunity ! org
Date: 2011-08-29 7:54:45
Message-ID: 201108290755.p7T7t9Dj026231 () mailer ! progressive-comp ! com
[Download RAW message or body]
Update of /cvsroot/datatype/flash/flv/fileformat
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv11077
Modified Files:
Tag: hxclient_3_6_1_atlas
flv_file_format.cpp flv_interleave_payload.cpp
flv_local_payload.cpp flv_payload.cpp flvfflib
Log Message:
Overview:
The logic, which determine if a packet should be dropped make wrong decision, most \
of video packets are dropped.
finished refactoring code and merge code from head into 361 to fix this bug.
current bugs fixed on 361 are not impacted.
Index: flv_interleave_payload.cpp
===================================================================
RCS file: /cvsroot/datatype/flash/flv/fileformat/flv_interleave_payload.cpp,v
retrieving revision 1.1.18.2
retrieving revision 1.1.18.3
diff -u -d -r1.1.18.2 -r1.1.18.3
--- flv_interleave_payload.cpp 24 Aug 2011 03:44:25 -0000 1.1.18.2
+++ flv_interleave_payload.cpp 29 Aug 2011 07:54:42 -0000 1.1.18.3
@@ -100,7 +100,7 @@
if (m_ulStreamCount == 1 && m_pContext && usStreamNum == 0)
{
- retVal = m_pFF->PrepareVideoStreamHeader(0, rpHdr);
+ retVal = m_pFF->PrepareInterleavedStreamHeader(0, rpHdr);
if (SUCCEEDED(retVal))
{
@@ -182,7 +182,7 @@
if (SUCCEEDED(retVal))
{
// Get the timestamp
- UINT32 ulInterleavedTimeStamp = tagHeader.GetTimeStamp();
+ UINT32 ulInterleavedTimeStamp = tagHeader.GetTimeStamp() - \
m_ulStartupOffset; // Make sure this timestamp is at least as great as the
// last interleaved timestamp. Some apps (like RealPlayer)
// will append application-specific FLV tags onto the
Index: flv_payload.cpp
===================================================================
RCS file: /cvsroot/datatype/flash/flv/fileformat/flv_payload.cpp,v
retrieving revision 1.2.4.2
retrieving revision 1.2.4.3
diff -u -d -r1.2.4.2 -r1.2.4.3
--- flv_payload.cpp 24 Aug 2011 03:42:04 -0000 1.2.4.2
+++ flv_payload.cpp 29 Aug 2011 07:54:42 -0000 1.2.4.3
@@ -79,6 +79,7 @@
, m_usVideoStreamNum(HX_INVALID_STREAM)
, m_ulFrameWidth(0)
, m_ulFrameHeight(0)
+ , m_ulStartupOffset(0)
{
HX_ADDREF(m_pContext);
}
Index: flv_local_payload.cpp
===================================================================
RCS file: /cvsroot/datatype/flash/flv/fileformat/flv_local_payload.cpp,v
retrieving revision 1.3.4.2
retrieving revision 1.3.4.3
diff -u -d -r1.3.4.2 -r1.3.4.3
--- flv_local_payload.cpp 24 Aug 2011 03:47:48 -0000 1.3.4.2
+++ flv_local_payload.cpp 29 Aug 2011 07:54:42 -0000 1.3.4.3
@@ -251,7 +251,7 @@
break;
case HX_FLV_AUDIO_TYPE_ADPCM:
{
- pszMimeType = "audio/pcma";
+ pszMimeType = "aduio/flash-ima-adcpm";
pszCodec = "ADPCM";
}
break;
@@ -498,7 +498,7 @@
// composition timestamp by adding
// for the IHXPacket time and the composition timestamp
// for the RTP time.
- UINT32 ulDecodingTS = tagHeader.GetTimeStamp();
+ UINT32 ulDecodingTS = tagHeader.GetTimeStamp() - \
m_ulStartupOffset;
UINT32 ulCompositionTS = ulDecodingTS + \
ulAVCCompositionTimeOffset; retVal = pRTPPacket->SetRTP(pAVCBuffer,
ulDecodingTS, // IHXPacket time
@@ -547,7 +547,7 @@
if (SUCCEEDED(retVal))
{
// Set the packet values
- retVal = pPacket->Set(pBuffer, tagHeader.GetTimeStamp(),
+ retVal = pPacket->Set(pBuffer, tagHeader.GetTimeStamp() - \
m_ulStartupOffset,
m_usVideoStreamNum, ucASMFlags, usRuleNum);
}
}
@@ -575,7 +575,7 @@
// Save the last keyframe video time
if (bKeyFrame)
{
- m_ulLastVideoKeyFrameTimeStamp = tagHeader.GetTimeStamp();
+ m_ulLastVideoKeyFrameTimeStamp = tagHeader.GetTimeStamp() - \
m_ulStartupOffset; }
// Do we have a last video packet?
@@ -612,7 +612,7 @@
// what to set for it.
retVal = pRTPPacket->SetRTP(pBuffer,
m_ulLastVideoKeyFrameTimeStamp, // \
IHXPacket time
- tagHeader.GetTimeStamp(), // RTP \
time + tagHeader.GetTimeStamp() - \
m_ulStartupOffset, // RTP time
m_usVideoStreamNum, // \
stream number
ucASMFlags, // ASM \
flags
0); // ASM \
rule @@ -695,7 +695,7 @@
m_pContext);
if (SUCCEEDED(retVal))
{
- retVal = pPacket->Set(pAACBuffer, tagHeader.GetTimeStamp(),
+ retVal = pPacket->Set(pAACBuffer, tagHeader.GetTimeStamp() - \
m_ulStartupOffset, m_usAudioStreamNum, ucASMFlags, usRuleNum);
}
HX_RELEASE(pAACBuffer);
@@ -703,7 +703,7 @@
else
{
// Set the packet values
- retVal = pPacket->Set(pBuffer, tagHeader.GetTimeStamp(),
+ retVal = pPacket->Set(pBuffer, tagHeader.GetTimeStamp() - \
m_ulStartupOffset, m_usAudioStreamNum, ucASMFlags, usRuleNum);
}
}
Index: flvfflib
===================================================================
RCS file: /cvsroot/datatype/flash/flv/fileformat/flvfflib,v
retrieving revision 1.3.2.3
retrieving revision 1.3.2.3.6.1
diff -u -d -r1.3.2.3 -r1.3.2.3.6.1
--- flvfflib 20 May 2009 13:46:04 -0000 1.3.2.3
+++ flvfflib 29 Aug 2011 07:54:42 -0000 1.3.2.3.6.1
@@ -71,6 +71,9 @@
"datatype/flash/flv/common/pub")
project.AddSources("flv_file_format.cpp")
+project.AddSources("flv_payload.cpp")
+project.AddSources("flv_local_payload.cpp")
+project.AddSources("flv_interleave_payload.cpp")
LibraryTarget("flvfflib")
Index: flv_file_format.cpp
===================================================================
RCS file: /cvsroot/datatype/flash/flv/fileformat/flv_file_format.cpp,v
retrieving revision 1.9.2.25.2.11
retrieving revision 1.9.2.25.2.12
diff -u -d -r1.9.2.25.2.11 -r1.9.2.25.2.12
--- flv_file_format.cpp 25 Aug 2011 02:28:18 -0000 1.9.2.25.2.11
+++ flv_file_format.cpp 29 Aug 2011 07:54:42 -0000 1.9.2.25.2.12
@@ -55,26 +55,27 @@
*
* ***** END LICENSE BLOCK ***** */
-#include "flv_file_format.ver"
#include "hxtypes.h"
#include "hxcom.h"
#include "hxfiles.h"
-#include "hxtlogutil.h"
#include "hxver.h"
#include "flvparse.h"
#include "hxslist.h"
[...2201 lines suppressed...]
+ // We are not re-timestamping. Therefore, since we know
+ // that FLV video packets always increase in time (no
+ // two packets have the same timestamp, then number
+ // of packets is same as number of time units). So
+ // we can increase the number of time units read.
+ m_pStreamInfo[m_usVideoStreamNum].m_ulNumTimeUnitsRead++;
+ // Do we know the time
+ // of the last video packet?
+ if ((m_bHaveVideoDuration &&
+ pPacket->GetTime() == m_ulVideoDuration) ||
+ (m_ulProcessTimeUnits &&
+ \
m_pStreamInfo[m_usVideoStreamNum].m_ulNumTimeUnitsRead >= m_ulProcessTimeUnits)) + \
{ + // This was the last video packet, so terminate
+ // the video stream in the merge sorter
+ m_pMergeSorter->Terminate(m_usVideoStreamNum);
+ }
+ }
+
+#endif
_______________________________________________
Datatype-cvs mailing list
Datatype-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/datatype-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic