From c621be2247f07239bb419d76661691fc83b6bfac Mon Sep 17 00:00:00 2001 From: winlin Date: Sat, 16 Nov 2013 23:11:16 +0800 Subject: [PATCH] add ts_info.cpp for HLS research --- trunk/{ => research}/players/index.html | 0 .../players/jwplayer5/index.html | 0 .../players/jwplayer5/jwplayer.js | 0 .../players/jwplayer5/player5.swf | Bin .../players/jwplayer6/index.html | 0 .../players/jwplayer6/jwplayer.flash.swf | Bin .../players/jwplayer6/jwplayer.html5.js | 0 .../players/jwplayer6/jwplayer.js | 0 .../players/osmf/AdobeFlashPlayerInstall.swf | Bin .../players/osmf/StrobeMediaPlayback.swf | Bin trunk/{ => research}/players/osmf/index.html | 0 .../{ => research}/players/osmf/swfobject.js | 0 .../players/rtmp/AdobeFlashPlayerInstall.swf | Bin .../players/rtmp/RtmpPlayer.swf | Bin trunk/{ => research}/players/rtmp/index.html | 0 .../players/rtmp/rtmp.player.js | 0 trunk/research/ts_info.cpp | 50 ++++++++++++++++++ 17 files changed, 50 insertions(+) rename trunk/{ => research}/players/index.html (100%) rename trunk/{ => research}/players/jwplayer5/index.html (100%) rename trunk/{ => research}/players/jwplayer5/jwplayer.js (100%) rename trunk/{ => research}/players/jwplayer5/player5.swf (100%) rename trunk/{ => research}/players/jwplayer6/index.html (100%) rename trunk/{ => research}/players/jwplayer6/jwplayer.flash.swf (100%) rename trunk/{ => research}/players/jwplayer6/jwplayer.html5.js (100%) rename trunk/{ => research}/players/jwplayer6/jwplayer.js (100%) rename trunk/{ => research}/players/osmf/AdobeFlashPlayerInstall.swf (100%) rename trunk/{ => research}/players/osmf/StrobeMediaPlayback.swf (100%) rename trunk/{ => research}/players/osmf/index.html (100%) rename trunk/{ => research}/players/osmf/swfobject.js (100%) rename trunk/{ => research}/players/rtmp/AdobeFlashPlayerInstall.swf (100%) rename trunk/{ => research}/players/rtmp/RtmpPlayer.swf (100%) rename trunk/{ => research}/players/rtmp/index.html (100%) rename trunk/{ => research}/players/rtmp/rtmp.player.js (100%) create mode 100644 trunk/research/ts_info.cpp diff --git a/trunk/players/index.html b/trunk/research/players/index.html similarity index 100% rename from trunk/players/index.html rename to trunk/research/players/index.html diff --git a/trunk/players/jwplayer5/index.html b/trunk/research/players/jwplayer5/index.html similarity index 100% rename from trunk/players/jwplayer5/index.html rename to trunk/research/players/jwplayer5/index.html diff --git a/trunk/players/jwplayer5/jwplayer.js b/trunk/research/players/jwplayer5/jwplayer.js similarity index 100% rename from trunk/players/jwplayer5/jwplayer.js rename to trunk/research/players/jwplayer5/jwplayer.js diff --git a/trunk/players/jwplayer5/player5.swf b/trunk/research/players/jwplayer5/player5.swf similarity index 100% rename from trunk/players/jwplayer5/player5.swf rename to trunk/research/players/jwplayer5/player5.swf diff --git a/trunk/players/jwplayer6/index.html b/trunk/research/players/jwplayer6/index.html similarity index 100% rename from trunk/players/jwplayer6/index.html rename to trunk/research/players/jwplayer6/index.html diff --git a/trunk/players/jwplayer6/jwplayer.flash.swf b/trunk/research/players/jwplayer6/jwplayer.flash.swf similarity index 100% rename from trunk/players/jwplayer6/jwplayer.flash.swf rename to trunk/research/players/jwplayer6/jwplayer.flash.swf diff --git a/trunk/players/jwplayer6/jwplayer.html5.js b/trunk/research/players/jwplayer6/jwplayer.html5.js similarity index 100% rename from trunk/players/jwplayer6/jwplayer.html5.js rename to trunk/research/players/jwplayer6/jwplayer.html5.js diff --git a/trunk/players/jwplayer6/jwplayer.js b/trunk/research/players/jwplayer6/jwplayer.js similarity index 100% rename from trunk/players/jwplayer6/jwplayer.js rename to trunk/research/players/jwplayer6/jwplayer.js diff --git a/trunk/players/osmf/AdobeFlashPlayerInstall.swf b/trunk/research/players/osmf/AdobeFlashPlayerInstall.swf similarity index 100% rename from trunk/players/osmf/AdobeFlashPlayerInstall.swf rename to trunk/research/players/osmf/AdobeFlashPlayerInstall.swf diff --git a/trunk/players/osmf/StrobeMediaPlayback.swf b/trunk/research/players/osmf/StrobeMediaPlayback.swf similarity index 100% rename from trunk/players/osmf/StrobeMediaPlayback.swf rename to trunk/research/players/osmf/StrobeMediaPlayback.swf diff --git a/trunk/players/osmf/index.html b/trunk/research/players/osmf/index.html similarity index 100% rename from trunk/players/osmf/index.html rename to trunk/research/players/osmf/index.html diff --git a/trunk/players/osmf/swfobject.js b/trunk/research/players/osmf/swfobject.js similarity index 100% rename from trunk/players/osmf/swfobject.js rename to trunk/research/players/osmf/swfobject.js diff --git a/trunk/players/rtmp/AdobeFlashPlayerInstall.swf b/trunk/research/players/rtmp/AdobeFlashPlayerInstall.swf similarity index 100% rename from trunk/players/rtmp/AdobeFlashPlayerInstall.swf rename to trunk/research/players/rtmp/AdobeFlashPlayerInstall.swf diff --git a/trunk/players/rtmp/RtmpPlayer.swf b/trunk/research/players/rtmp/RtmpPlayer.swf similarity index 100% rename from trunk/players/rtmp/RtmpPlayer.swf rename to trunk/research/players/rtmp/RtmpPlayer.swf diff --git a/trunk/players/rtmp/index.html b/trunk/research/players/rtmp/index.html similarity index 100% rename from trunk/players/rtmp/index.html rename to trunk/research/players/rtmp/index.html diff --git a/trunk/players/rtmp/rtmp.player.js b/trunk/research/players/rtmp/rtmp.player.js similarity index 100% rename from trunk/players/rtmp/rtmp.player.js rename to trunk/research/players/rtmp/rtmp.player.js diff --git a/trunk/research/ts_info.cpp b/trunk/research/ts_info.cpp new file mode 100644 index 000000000..59d1532b2 --- /dev/null +++ b/trunk/research/ts_info.cpp @@ -0,0 +1,50 @@ +/** +g++ -o ts_info ts_info.cpp -g -O0 -ansi +*/ +#include +#include +#include +#include +#include +#include + +/** +ISO/IEC 13818-1:2000(E) +Introduction +SECTION 1 ¨C GENERAL +SECTION 2 ¨C TECHNICAL ELEMENTS + 2.4 Transport Stream bitstream requirements + 2.5 Program Stream bitstream requirements + 2.6 Program and program element descriptors + 2.7 Restrictions on the multiplexed stream semantics +Annex A ¨C CRC Decoder Model +*/ + +#define trace(msg, ...) printf(msg"\n", ##__VA_ARGS__); + +int main(int /*argc*/, char** /*argv*/) +{ + const char* file = "livestream-1347.ts"; + int fd = open(file, O_RDONLY); + + trace("demuxer+read packet count offset P+0 P+1 P+2 P+x P+L2 P+L1 P+L0"); + for (int i = 0, offset = 0; ; i++) { + unsigned char PES[188]; + memset(PES, 0, sizeof(PES)); + + int ret = read(fd, PES, sizeof(PES)); + if (ret == 0) { + trace("demuxer+read EOF, read completed, offset: %07d.", offset); + break; + } + trace("demuxer+read packet %04d %07d 0x%02x 0x%02x 0x%02x ... 0x%02x 0x%02x 0x%02x", + i, offset, PES[0], PES[1], PES[2], PES[185], PES[186], PES[187]); + + + offset += ret; + } + + close(fd); + return 0; +} +