Changeset 105 for trunk/sources/thelib/src/protocols/ts/innettsstream.cpp
- Timestamp:
- 08/25/10 19:30:12 (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/thelib/src/protocols/ts/innettsstream.cpp
r56 r105 47 47 _feedTime = 0; 48 48 _cursor = 0; 49 50 _firstNAL = true; 49 51 } 50 52 … … 150 152 } 151 153 } 154 155 //#define HandleVideoData HandleVideoData_version1 156 #define HandleVideoData HandleVideoData_version2 152 157 153 158 if (isAudio) … … 277 282 } 278 283 279 bool InNetTSStream::HandleVideoData (uint8_t *pBuffer, uint32_t length,284 bool InNetTSStream::HandleVideoData_version1(uint8_t *pBuffer, uint32_t length, 280 285 double timestamp, bool packetStart) { 281 286 //1. Store the data inside our buffer … … 327 332 } 328 333 334 bool InNetTSStream::HandleVideoData_version2(uint8_t *pBuffer, uint32_t length, 335 double timestamp, bool packetStart) { 336 //1. Store the data inside our buffer 337 _currentNal.ReadFromBuffer(pBuffer, length); 338 339 uint32_t size = GETAVAILABLEBYTESCOUNT(_currentNal); 340 if (size < 4) 341 return true; 342 343 uint8_t *pNalBuffer = GETIBPOINTER(_currentNal); 344 345 _cursor = 0; 346 if (_firstNAL) { 347 while (_cursor < size - 4) { 348 if (ntohlp(pNalBuffer + _cursor) == 1) { 349 _currentNal.Ignore(_cursor + 4); 350 _firstNAL = false; 351 _cursor += 4; 352 break; 353 } 354 _cursor++; 355 } 356 } 357 358 while (_cursor < size - 4) { 359 if (ntohlp(pNalBuffer + _cursor) == 1) { 360 if (!ProcessNal(timestamp)) { 361 FATAL("Unable to process NALU"); 362 return false; 363 } 364 _currentNal.Ignore(_cursor + 4); 365 pNalBuffer = GETIBPOINTER(_currentNal); 366 size = GETAVAILABLEBYTESCOUNT(_currentNal); 367 _cursor = 0; 368 if (size < 4) 369 break; 370 } else { 371 _cursor++; 372 } 373 } 374 375 return true; 376 } 377 329 378 bool InNetTSStream::ProcessNal(double timestamp) { 330 379 InitializeVideoCapabilities(GETIBPOINTER(_currentNal), _cursor);
Note: See TracChangeset
for help on using the changeset viewer.
