diff --git a/aio-grab-aarch64 b/aio-grab-aarch64 deleted file mode 120000 index 9888457..0000000 --- a/aio-grab-aarch64 +++ /dev/null @@ -1 +0,0 @@ -aio-grab-arm \ No newline at end of file diff --git a/aio-grab-mips b/aio-grab-mips deleted file mode 120000 index 9888457..0000000 --- a/aio-grab-mips +++ /dev/null @@ -1 +0,0 @@ -aio-grab-arm \ No newline at end of file diff --git a/aio-grab-sh4/AUTHORS b/aio-grab-sh4/AUTHORS deleted file mode 100644 index e69de29..0000000 diff --git a/aio-grab-sh4/ChangeLog b/aio-grab-sh4/ChangeLog deleted file mode 100644 index e69de29..0000000 diff --git a/aio-grab-sh4/Makefile.am b/aio-grab-sh4/Makefile.am deleted file mode 100644 index 2345997..0000000 --- a/aio-grab-sh4/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -bin_PROGRAMS = grab - -grab_SOURCES = main.c - -grab_LDADD = -ljpeg -lpng -lz diff --git a/aio-grab-sh4/NEWS b/aio-grab-sh4/NEWS deleted file mode 100644 index e69de29..0000000 diff --git a/aio-grab-sh4/README b/aio-grab-sh4/README deleted file mode 100644 index e69de29..0000000 diff --git a/aio-grab-sh4/autogen.sh b/aio-grab-sh4/autogen.sh deleted file mode 100755 index 2b6ca9c..0000000 --- a/aio-grab-sh4/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-aio-grab-sh4" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/aio-grab-sh4/configure.ac b/aio-grab-sh4/configure.ac deleted file mode 100644 index ce1ea21..0000000 --- a/aio-grab-sh4/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT([grab],[1.0],[],[grab]) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_OUTPUT([ -Makefile -]) diff --git a/aio-grab-sh4/main.c b/aio-grab-sh4/main.c deleted file mode 100644 index 4857b2e..0000000 --- a/aio-grab-sh4/main.c +++ /dev/null @@ -1,1973 +0,0 @@ -/* -AiO stb screengrabber - -Based on the work of Seddi -Contact: seddi@ihad.tv / http://www.ihad.tv - -This standalone binary will grab the video-picture convert it from -yuv to rgb and resize it, if neccesary, to the same size as the framebuffer or -vice versa. For the DM7025 (Xilleon) and DM800/DM8000/DM500HD (Broadcom) the video will be -grabbed directly from the decoder memory. -It also grabs the framebuffer picture in 32Bit, 16Bit or in 8Bit mode with the -correct colortable in 8Bit mode from the main graphics memory, because the -FBIOGETCMAP is buggy on Vulcan/Pallas boxes and didnt give you the correct color -map. -Finally it will combine the pixmaps to one final picture by using the framebuffer -alphamap and save it as bmp, jpeg or png file. So you will get the same picture -as you can see on your TV Screen. - -There are a few command line switches, use "grab -h" to get them listed. - -A special Thanx to tmbinc and ghost for the needed decoder memory information and -the great support. - -Feel free to use the code for your own projects. See LICENSE file for details. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "png.h" -#include "jpeglib.h" - -#define CLAMP(x) ((x < 0) ? 0 : ((x > 255) ? 255 : x)) -#define SWAP(x,y) { x ^= y; y ^= x; x ^= y; } - -#define RED565(x) ((((x) >> (11 )) & 0x1f) << 3) -#define GREEN565(x) ((((x) >> (5 )) & 0x3f) << 2) -#define BLUE565(x) ((((x) >> (0)) & 0x1f) << 3) - -#define YFB(x) ((((x) >> (10)) & 0x3f) << 2) -#define CBFB(x) ((((x) >> (6)) & 0xf) << 4) -#define CRFB(x) ((((x) >> (2)) & 0xf) << 4) -#define BFFB(x) ((((x) >> (0)) & 0x3) << 6) - -#define VIDEO_DEV "/dev/video" - -// dont change SPARE_RAM and DMA_BLOCKSIZE until you really know what you are doing !!! -#define SPARE_RAM 252*1024*1024 // the last 4 MB is enough... -#define DMA_BLOCKSIZE 0x3FF000 // should be big enough to hold a complete YUV 1920x1080 HD picture, otherwise it will not work properly on DM8000 - - -#define OUT(x) \ - out[OUTITER]=(unsigned char)*(decode_surface + x)&0xFF; \ - OUTITER+=OUTINC; - -#define OUT4(x) \ - OUT(x + 0x03); \ - OUT(x + 0x02); \ - OUT(x + 0x01); \ - OUT(x + 0x00); - -#define OUT8(x) \ - OUT4(x + 0x04); \ - OUT4(x + 0x00); - -#define OUT_LU_16A(x) \ - OUT8(x); \ - OUT8(x + 0x40); - -#define OUT_CH_8A(x) \ - OUT4(x); \ - OUT4(x + 0x20); - -//pppppppppppppppp -//x: macroblock address -//l: line 0-15 -#define OUT_LU_16(x,l) \ - OUT_LU_16A(x + (l/4) * 0x10 + (l%2) * 0x80 + ((l/2)%2?0x00:0x08)); - -//pppppppp -//x: macroblock address -//l: line 0-7 -//b: 0=cr 1=cb -#define OUT_CH_8(x,l,b) \ - OUT_CH_8A(x + (l/4) * 0x10 + (l%2) * 0x40 + ((l/2)%2?0x00:0x08) + (b?0x04:0x00)); - -int timeval_subtract(struct timeval *result, struct timeval *x, struct timeval *y) -{ - /* Perform the carry for the later subtraction by updating y. */ - if (x->tv_usec < y->tv_usec) - { - int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1; - y->tv_usec -= 1000000 * nsec; - y->tv_sec += nsec; - } - if (x->tv_usec - y->tv_usec > 1000000) - { - int nsec = (x->tv_usec - y->tv_usec) / 1000000; - y->tv_usec += 1000000 * nsec; - y->tv_sec -= nsec; - } - - /* Compute the time remaining to wait. - tv_usec is certainly positive. */ - result->tv_sec = x->tv_sec - y->tv_sec; - result->tv_usec = x->tv_usec - y->tv_usec; - - /* Return 1 if result is negative. */ - return x->tv_sec < y->tv_sec; -} - -// static lookup tables for faster yuv2rgb conversion -static const int yuv2rgbtable_y[256] = -{ - 0xFFED5EA0, 0xFFEE88B6, 0xFFEFB2CC, 0xFFF0DCE2, 0xFFF206F8, 0xFFF3310E, 0xFFF45B24, 0xFFF5853A, 0xFFF6AF50, 0xFFF7D966, 0xFFF9037C, 0xFFFA2D92, 0xFFFB57A8, 0xFFFC81BE, 0xFFFDABD4, 0xFFFED5EA, 0x0, 0x12A16, 0x2542C, 0x37E42, 0x4A858, 0x5D26E, 0x6FC84, 0x8269A, 0x950B0, 0xA7AC6, 0xBA4DC, 0xCCEF2, 0xDF908, 0xF231E, 0x104D34, 0x11774A, 0x12A160, 0x13CB76, 0x14F58C, 0x161FA2, 0x1749B8, 0x1873CE, 0x199DE4, 0x1AC7FA, 0x1BF210, 0x1D1C26, 0x1E463C, 0x1F7052, 0x209A68, 0x21C47E, 0x22EE94, 0x2418AA, 0x2542C0, 0x266CD6, 0x2796EC, 0x28C102, 0x29EB18, 0x2B152E, 0x2C3F44, 0x2D695A, 0x2E9370, 0x2FBD86, 0x30E79C, 0x3211B2, 0x333BC8, 0x3465DE, 0x358FF4, 0x36BA0A, 0x37E420, 0x390E36, 0x3A384C, 0x3B6262, 0x3C8C78, 0x3DB68E, 0x3EE0A4, 0x400ABA, 0x4134D0, 0x425EE6, 0x4388FC, 0x44B312, 0x45DD28, 0x47073E, 0x483154, 0x495B6A, 0x4A8580, 0x4BAF96, 0x4CD9AC, 0x4E03C2, 0x4F2DD8, 0x5057EE, 0x518204, 0x52AC1A, 0x53D630, 0x550046, 0x562A5C, 0x575472, 0x587E88, 0x59A89E, 0x5AD2B4, 0x5BFCCA, 0x5D26E0, 0x5E50F6, 0x5F7B0C, 0x60A522, 0x61CF38, 0x62F94E, 0x642364, 0x654D7A, 0x667790, 0x67A1A6, 0x68CBBC, 0x69F5D2, 0x6B1FE8, 0x6C49FE, 0x6D7414, 0x6E9E2A, 0x6FC840, 0x70F256, 0x721C6C, 0x734682, 0x747098, 0x759AAE, 0x76C4C4, 0x77EEDA, 0x7918F0, 0x7A4306, 0x7B6D1C, 0x7C9732, 0x7DC148, 0x7EEB5E, 0x801574, 0x813F8A, 0x8269A0, 0x8393B6, 0x84BDCC, 0x85E7E2, 0x8711F8, 0x883C0E, 0x896624, 0x8A903A, 0x8BBA50, 0x8CE466, 0x8E0E7C, 0x8F3892, 0x9062A8, 0x918CBE, 0x92B6D4, 0x93E0EA, 0x950B00, 0x963516, 0x975F2C, 0x988942, 0x99B358, 0x9ADD6E, 0x9C0784, 0x9D319A, 0x9E5BB0, 0x9F85C6, 0xA0AFDC, 0xA1D9F2, 0xA30408, 0xA42E1E, 0xA55834, 0xA6824A, 0xA7AC60, 0xA8D676, 0xAA008C, 0xAB2AA2, 0xAC54B8, 0xAD7ECE, 0xAEA8E4, 0xAFD2FA, 0xB0FD10, 0xB22726, 0xB3513C, 0xB47B52, 0xB5A568, 0xB6CF7E, 0xB7F994, 0xB923AA, 0xBA4DC0, 0xBB77D6, 0xBCA1EC, 0xBDCC02, 0xBEF618, 0xC0202E, 0xC14A44, 0xC2745A, 0xC39E70, 0xC4C886, 0xC5F29C, 0xC71CB2, 0xC846C8, 0xC970DE, 0xCA9AF4, 0xCBC50A, 0xCCEF20, 0xCE1936, 0xCF434C, 0xD06D62, 0xD19778, 0xD2C18E, 0xD3EBA4, 0xD515BA, 0xD63FD0, 0xD769E6, 0xD893FC, 0xD9BE12, 0xDAE828, 0xDC123E, 0xDD3C54, 0xDE666A, 0xDF9080, 0xE0BA96, 0xE1E4AC, 0xE30EC2, 0xE438D8, 0xE562EE, 0xE68D04, 0xE7B71A, 0xE8E130, 0xEA0B46, 0xEB355C, 0xEC5F72, 0xED8988, 0xEEB39E, 0xEFDDB4, 0xF107CA, 0xF231E0, 0xF35BF6, 0xF4860C, 0xF5B022, 0xF6DA38, 0xF8044E, 0xF92E64, 0xFA587A, 0xFB8290, 0xFCACA6, 0xFDD6BC, 0xFF00D2, 0x1002AE8, 0x10154FE, 0x1027F14, 0x103A92A, 0x104D340, 0x105FD56, 0x107276C, 0x1085182, 0x1097B98, 0x10AA5AE, 0x10BCFC4, 0x10CF9DA, 0x10E23F0, 0x10F4E06, 0x110781C, 0x111A232, 0x112CC48, 0x113F65E, 0x1152074, 0x1164A8A -}; -static const int yuv2rgbtable_ru[256] = -{ - 0xFEFDA500, 0xFEFFA9B6, 0xFF01AE6C, 0xFF03B322, 0xFF05B7D8, 0xFF07BC8E, 0xFF09C144, 0xFF0BC5FA, 0xFF0DCAB0, 0xFF0FCF66, 0xFF11D41C, 0xFF13D8D2, 0xFF15DD88, 0xFF17E23E, 0xFF19E6F4, 0xFF1BEBAA, 0xFF1DF060, 0xFF1FF516, 0xFF21F9CC, 0xFF23FE82, 0xFF260338, 0xFF2807EE, 0xFF2A0CA4, 0xFF2C115A, 0xFF2E1610, 0xFF301AC6, 0xFF321F7C, 0xFF342432, 0xFF3628E8, 0xFF382D9E, 0xFF3A3254, 0xFF3C370A, 0xFF3E3BC0, 0xFF404076, 0xFF42452C, 0xFF4449E2, 0xFF464E98, 0xFF48534E, 0xFF4A5804, 0xFF4C5CBA, 0xFF4E6170, 0xFF506626, 0xFF526ADC, 0xFF546F92, 0xFF567448, 0xFF5878FE, 0xFF5A7DB4, 0xFF5C826A, 0xFF5E8720, 0xFF608BD6, 0xFF62908C, 0xFF649542, 0xFF6699F8, 0xFF689EAE, 0xFF6AA364, 0xFF6CA81A, 0xFF6EACD0, 0xFF70B186, 0xFF72B63C, 0xFF74BAF2, 0xFF76BFA8, 0xFF78C45E, 0xFF7AC914, 0xFF7CCDCA, 0xFF7ED280, 0xFF80D736, 0xFF82DBEC, 0xFF84E0A2, 0xFF86E558, 0xFF88EA0E, 0xFF8AEEC4, 0xFF8CF37A, 0xFF8EF830, 0xFF90FCE6, 0xFF93019C, 0xFF950652, 0xFF970B08, 0xFF990FBE, 0xFF9B1474, 0xFF9D192A, 0xFF9F1DE0, 0xFFA12296, 0xFFA3274C, 0xFFA52C02, 0xFFA730B8, 0xFFA9356E, 0xFFAB3A24, 0xFFAD3EDA, 0xFFAF4390, 0xFFB14846, 0xFFB34CFC, 0xFFB551B2, 0xFFB75668, 0xFFB95B1E, 0xFFBB5FD4, 0xFFBD648A, 0xFFBF6940, 0xFFC16DF6, 0xFFC372AC, 0xFFC57762, 0xFFC77C18, 0xFFC980CE, 0xFFCB8584, 0xFFCD8A3A, 0xFFCF8EF0, 0xFFD193A6, 0xFFD3985C, 0xFFD59D12, 0xFFD7A1C8, 0xFFD9A67E, 0xFFDBAB34, 0xFFDDAFEA, 0xFFDFB4A0, 0xFFE1B956, 0xFFE3BE0C, 0xFFE5C2C2, 0xFFE7C778, 0xFFE9CC2E, 0xFFEBD0E4, 0xFFEDD59A, 0xFFEFDA50, 0xFFF1DF06, 0xFFF3E3BC, 0xFFF5E872, 0xFFF7ED28, 0xFFF9F1DE, 0xFFFBF694, 0xFFFDFB4A, 0x0, 0x204B6, 0x4096C, 0x60E22, 0x812D8, 0xA178E, 0xC1C44, 0xE20FA, 0x1025B0, 0x122A66, 0x142F1C, 0x1633D2, 0x183888, 0x1A3D3E, 0x1C41F4, 0x1E46AA, 0x204B60, 0x225016, 0x2454CC, 0x265982, 0x285E38, 0x2A62EE, 0x2C67A4, 0x2E6C5A, 0x307110, 0x3275C6, 0x347A7C, 0x367F32, 0x3883E8, 0x3A889E, 0x3C8D54, 0x3E920A, 0x4096C0, 0x429B76, 0x44A02C, 0x46A4E2, 0x48A998, 0x4AAE4E, 0x4CB304, 0x4EB7BA, 0x50BC70, 0x52C126, 0x54C5DC, 0x56CA92, 0x58CF48, 0x5AD3FE, 0x5CD8B4, 0x5EDD6A, 0x60E220, 0x62E6D6, 0x64EB8C, 0x66F042, 0x68F4F8, 0x6AF9AE, 0x6CFE64, 0x6F031A, 0x7107D0, 0x730C86, 0x75113C, 0x7715F2, 0x791AA8, 0x7B1F5E, 0x7D2414, 0x7F28CA, 0x812D80, 0x833236, 0x8536EC, 0x873BA2, 0x894058, 0x8B450E, 0x8D49C4, 0x8F4E7A, 0x915330, 0x9357E6, 0x955C9C, 0x976152, 0x996608, 0x9B6ABE, 0x9D6F74, 0x9F742A, 0xA178E0, 0xA37D96, 0xA5824C, 0xA78702, 0xA98BB8, 0xAB906E, 0xAD9524, 0xAF99DA, 0xB19E90, 0xB3A346, 0xB5A7FC, 0xB7ACB2, 0xB9B168, 0xBBB61E, 0xBDBAD4, 0xBFBF8A, 0xC1C440, 0xC3C8F6, 0xC5CDAC, 0xC7D262, 0xC9D718, 0xCBDBCE, 0xCDE084, 0xCFE53A, 0xD1E9F0, 0xD3EEA6, 0xD5F35C, 0xD7F812, 0xD9FCC8, 0xDC017E, 0xDE0634, 0xE00AEA, 0xE20FA0, 0xE41456, 0xE6190C, 0xE81DC2, 0xEA2278, 0xEC272E, 0xEE2BE4, 0xF0309A, 0xF23550, 0xF43A06, 0xF63EBC, 0xF84372, 0xFA4828, 0xFC4CDE, 0xFE5194, 0x100564A -}; -static const int yuv2rgbtable_gu[256] = -{ - 0xFFCDD300, 0xFFCE375A, 0xFFCE9BB4, 0xFFCF000E, 0xFFCF6468, 0xFFCFC8C2, 0xFFD02D1C, 0xFFD09176, 0xFFD0F5D0, 0xFFD15A2A, 0xFFD1BE84, 0xFFD222DE, 0xFFD28738, 0xFFD2EB92, 0xFFD34FEC, 0xFFD3B446, 0xFFD418A0, 0xFFD47CFA, 0xFFD4E154, 0xFFD545AE, 0xFFD5AA08, 0xFFD60E62, 0xFFD672BC, 0xFFD6D716, 0xFFD73B70, 0xFFD79FCA, 0xFFD80424, 0xFFD8687E, 0xFFD8CCD8, 0xFFD93132, 0xFFD9958C, 0xFFD9F9E6, 0xFFDA5E40, 0xFFDAC29A, 0xFFDB26F4, 0xFFDB8B4E, 0xFFDBEFA8, 0xFFDC5402, 0xFFDCB85C, 0xFFDD1CB6, 0xFFDD8110, 0xFFDDE56A, 0xFFDE49C4, 0xFFDEAE1E, 0xFFDF1278, 0xFFDF76D2, 0xFFDFDB2C, 0xFFE03F86, 0xFFE0A3E0, 0xFFE1083A, 0xFFE16C94, 0xFFE1D0EE, 0xFFE23548, 0xFFE299A2, 0xFFE2FDFC, 0xFFE36256, 0xFFE3C6B0, 0xFFE42B0A, 0xFFE48F64, 0xFFE4F3BE, 0xFFE55818, 0xFFE5BC72, 0xFFE620CC, 0xFFE68526, 0xFFE6E980, 0xFFE74DDA, 0xFFE7B234, 0xFFE8168E, 0xFFE87AE8, 0xFFE8DF42, 0xFFE9439C, 0xFFE9A7F6, 0xFFEA0C50, 0xFFEA70AA, 0xFFEAD504, 0xFFEB395E, 0xFFEB9DB8, 0xFFEC0212, 0xFFEC666C, 0xFFECCAC6, 0xFFED2F20, 0xFFED937A, 0xFFEDF7D4, 0xFFEE5C2E, 0xFFEEC088, 0xFFEF24E2, 0xFFEF893C, 0xFFEFED96, 0xFFF051F0, 0xFFF0B64A, 0xFFF11AA4, 0xFFF17EFE, 0xFFF1E358, 0xFFF247B2, 0xFFF2AC0C, 0xFFF31066, 0xFFF374C0, 0xFFF3D91A, 0xFFF43D74, 0xFFF4A1CE, 0xFFF50628, 0xFFF56A82, 0xFFF5CEDC, 0xFFF63336, 0xFFF69790, 0xFFF6FBEA, 0xFFF76044, 0xFFF7C49E, 0xFFF828F8, 0xFFF88D52, 0xFFF8F1AC, 0xFFF95606, 0xFFF9BA60, 0xFFFA1EBA, 0xFFFA8314, 0xFFFAE76E, 0xFFFB4BC8, 0xFFFBB022, 0xFFFC147C, 0xFFFC78D6, 0xFFFCDD30, 0xFFFD418A, 0xFFFDA5E4, 0xFFFE0A3E, 0xFFFE6E98, 0xFFFED2F2, 0xFFFF374C, 0xFFFF9BA6, 0x0, 0x645A, 0xC8B4, 0x12D0E, 0x19168, 0x1F5C2, 0x25A1C, 0x2BE76, 0x322D0, 0x3872A, 0x3EB84, 0x44FDE, 0x4B438, 0x51892, 0x57CEC, 0x5E146, 0x645A0, 0x6A9FA, 0x70E54, 0x772AE, 0x7D708, 0x83B62, 0x89FBC, 0x90416, 0x96870, 0x9CCCA, 0xA3124, 0xA957E, 0xAF9D8, 0xB5E32, 0xBC28C, 0xC26E6, 0xC8B40, 0xCEF9A, 0xD53F4, 0xDB84E, 0xE1CA8, 0xE8102, 0xEE55C, 0xF49B6, 0xFAE10, 0x10126A, 0x1076C4, 0x10DB1E, 0x113F78, 0x11A3D2, 0x12082C, 0x126C86, 0x12D0E0, 0x13353A, 0x139994, 0x13FDEE, 0x146248, 0x14C6A2, 0x152AFC, 0x158F56, 0x15F3B0, 0x16580A, 0x16BC64, 0x1720BE, 0x178518, 0x17E972, 0x184DCC, 0x18B226, 0x191680, 0x197ADA, 0x19DF34, 0x1A438E, 0x1AA7E8, 0x1B0C42, 0x1B709C, 0x1BD4F6, 0x1C3950, 0x1C9DAA, 0x1D0204, 0x1D665E, 0x1DCAB8, 0x1E2F12, 0x1E936C, 0x1EF7C6, 0x1F5C20, 0x1FC07A, 0x2024D4, 0x20892E, 0x20ED88, 0x2151E2, 0x21B63C, 0x221A96, 0x227EF0, 0x22E34A, 0x2347A4, 0x23ABFE, 0x241058, 0x2474B2, 0x24D90C, 0x253D66, 0x25A1C0, 0x26061A, 0x266A74, 0x26CECE, 0x273328, 0x279782, 0x27FBDC, 0x286036, 0x28C490, 0x2928EA, 0x298D44, 0x29F19E, 0x2A55F8, 0x2ABA52, 0x2B1EAC, 0x2B8306, 0x2BE760, 0x2C4BBA, 0x2CB014, 0x2D146E, 0x2D78C8, 0x2DDD22, 0x2E417C, 0x2EA5D6, 0x2F0A30, 0x2F6E8A, 0x2FD2E4, 0x30373E, 0x309B98, 0x30FFF2, 0x31644C, 0x31C8A6 -}; -static const int yuv2rgbtable_gv[256] = -{ - 0xFF97E900, 0xFF98B92E, 0xFF99895C, 0xFF9A598A, 0xFF9B29B8, 0xFF9BF9E6, 0xFF9CCA14, 0xFF9D9A42, 0xFF9E6A70, 0xFF9F3A9E, 0xFFA00ACC, 0xFFA0DAFA, 0xFFA1AB28, 0xFFA27B56, 0xFFA34B84, 0xFFA41BB2, 0xFFA4EBE0, 0xFFA5BC0E, 0xFFA68C3C, 0xFFA75C6A, 0xFFA82C98, 0xFFA8FCC6, 0xFFA9CCF4, 0xFFAA9D22, 0xFFAB6D50, 0xFFAC3D7E, 0xFFAD0DAC, 0xFFADDDDA, 0xFFAEAE08, 0xFFAF7E36, 0xFFB04E64, 0xFFB11E92, 0xFFB1EEC0, 0xFFB2BEEE, 0xFFB38F1C, 0xFFB45F4A, 0xFFB52F78, 0xFFB5FFA6, 0xFFB6CFD4, 0xFFB7A002, 0xFFB87030, 0xFFB9405E, 0xFFBA108C, 0xFFBAE0BA, 0xFFBBB0E8, 0xFFBC8116, 0xFFBD5144, 0xFFBE2172, 0xFFBEF1A0, 0xFFBFC1CE, 0xFFC091FC, 0xFFC1622A, 0xFFC23258, 0xFFC30286, 0xFFC3D2B4, 0xFFC4A2E2, 0xFFC57310, 0xFFC6433E, 0xFFC7136C, 0xFFC7E39A, 0xFFC8B3C8, 0xFFC983F6, 0xFFCA5424, 0xFFCB2452, 0xFFCBF480, 0xFFCCC4AE, 0xFFCD94DC, 0xFFCE650A, 0xFFCF3538, 0xFFD00566, 0xFFD0D594, 0xFFD1A5C2, 0xFFD275F0, 0xFFD3461E, 0xFFD4164C, 0xFFD4E67A, 0xFFD5B6A8, 0xFFD686D6, 0xFFD75704, 0xFFD82732, 0xFFD8F760, 0xFFD9C78E, 0xFFDA97BC, 0xFFDB67EA, 0xFFDC3818, 0xFFDD0846, 0xFFDDD874, 0xFFDEA8A2, 0xFFDF78D0, 0xFFE048FE, 0xFFE1192C, 0xFFE1E95A, 0xFFE2B988, 0xFFE389B6, 0xFFE459E4, 0xFFE52A12, 0xFFE5FA40, 0xFFE6CA6E, 0xFFE79A9C, 0xFFE86ACA, 0xFFE93AF8, 0xFFEA0B26, 0xFFEADB54, 0xFFEBAB82, 0xFFEC7BB0, 0xFFED4BDE, 0xFFEE1C0C, 0xFFEEEC3A, 0xFFEFBC68, 0xFFF08C96, 0xFFF15CC4, 0xFFF22CF2, 0xFFF2FD20, 0xFFF3CD4E, 0xFFF49D7C, 0xFFF56DAA, 0xFFF63DD8, 0xFFF70E06, 0xFFF7DE34, 0xFFF8AE62, 0xFFF97E90, 0xFFFA4EBE, 0xFFFB1EEC, 0xFFFBEF1A, 0xFFFCBF48, 0xFFFD8F76, 0xFFFE5FA4, 0xFFFF2FD2, 0x0, 0xD02E, 0x1A05C, 0x2708A, 0x340B8, 0x410E6, 0x4E114, 0x5B142, 0x68170, 0x7519E, 0x821CC, 0x8F1FA, 0x9C228, 0xA9256, 0xB6284, 0xC32B2, 0xD02E0, 0xDD30E, 0xEA33C, 0xF736A, 0x104398, 0x1113C6, 0x11E3F4, 0x12B422, 0x138450, 0x14547E, 0x1524AC, 0x15F4DA, 0x16C508, 0x179536, 0x186564, 0x193592, 0x1A05C0, 0x1AD5EE, 0x1BA61C, 0x1C764A, 0x1D4678, 0x1E16A6, 0x1EE6D4, 0x1FB702, 0x208730, 0x21575E, 0x22278C, 0x22F7BA, 0x23C7E8, 0x249816, 0x256844, 0x263872, 0x2708A0, 0x27D8CE, 0x28A8FC, 0x29792A, 0x2A4958, 0x2B1986, 0x2BE9B4, 0x2CB9E2, 0x2D8A10, 0x2E5A3E, 0x2F2A6C, 0x2FFA9A, 0x30CAC8, 0x319AF6, 0x326B24, 0x333B52, 0x340B80, 0x34DBAE, 0x35ABDC, 0x367C0A, 0x374C38, 0x381C66, 0x38EC94, 0x39BCC2, 0x3A8CF0, 0x3B5D1E, 0x3C2D4C, 0x3CFD7A, 0x3DCDA8, 0x3E9DD6, 0x3F6E04, 0x403E32, 0x410E60, 0x41DE8E, 0x42AEBC, 0x437EEA, 0x444F18, 0x451F46, 0x45EF74, 0x46BFA2, 0x478FD0, 0x485FFE, 0x49302C, 0x4A005A, 0x4AD088, 0x4BA0B6, 0x4C70E4, 0x4D4112, 0x4E1140, 0x4EE16E, 0x4FB19C, 0x5081CA, 0x5151F8, 0x522226, 0x52F254, 0x53C282, 0x5492B0, 0x5562DE, 0x56330C, 0x57033A, 0x57D368, 0x58A396, 0x5973C4, 0x5A43F2, 0x5B1420, 0x5BE44E, 0x5CB47C, 0x5D84AA, 0x5E54D8, 0x5F2506, 0x5FF534, 0x60C562, 0x619590, 0x6265BE, 0x6335EC, 0x64061A, 0x64D648, 0x65A676, 0x6676A4, 0x6746D2 -}; -static const int yuv2rgbtable_bv[256] = -{ - 0xFF33A280, 0xFF353B3B, 0xFF36D3F6, 0xFF386CB1, 0xFF3A056C, 0xFF3B9E27, 0xFF3D36E2, 0xFF3ECF9D, 0xFF406858, 0xFF420113, 0xFF4399CE, 0xFF453289, 0xFF46CB44, 0xFF4863FF, 0xFF49FCBA, 0xFF4B9575, 0xFF4D2E30, 0xFF4EC6EB, 0xFF505FA6, 0xFF51F861, 0xFF53911C, 0xFF5529D7, 0xFF56C292, 0xFF585B4D, 0xFF59F408, 0xFF5B8CC3, 0xFF5D257E, 0xFF5EBE39, 0xFF6056F4, 0xFF61EFAF, 0xFF63886A, 0xFF652125, 0xFF66B9E0, 0xFF68529B, 0xFF69EB56, 0xFF6B8411, 0xFF6D1CCC, 0xFF6EB587, 0xFF704E42, 0xFF71E6FD, 0xFF737FB8, 0xFF751873, 0xFF76B12E, 0xFF7849E9, 0xFF79E2A4, 0xFF7B7B5F, 0xFF7D141A, 0xFF7EACD5, 0xFF804590, 0xFF81DE4B, 0xFF837706, 0xFF850FC1, 0xFF86A87C, 0xFF884137, 0xFF89D9F2, 0xFF8B72AD, 0xFF8D0B68, 0xFF8EA423, 0xFF903CDE, 0xFF91D599, 0xFF936E54, 0xFF95070F, 0xFF969FCA, 0xFF983885, 0xFF99D140, 0xFF9B69FB, 0xFF9D02B6, 0xFF9E9B71, 0xFFA0342C, 0xFFA1CCE7, 0xFFA365A2, 0xFFA4FE5D, 0xFFA69718, 0xFFA82FD3, 0xFFA9C88E, 0xFFAB6149, 0xFFACFA04, 0xFFAE92BF, 0xFFB02B7A, 0xFFB1C435, 0xFFB35CF0, 0xFFB4F5AB, 0xFFB68E66, 0xFFB82721, 0xFFB9BFDC, 0xFFBB5897, 0xFFBCF152, 0xFFBE8A0D, 0xFFC022C8, 0xFFC1BB83, 0xFFC3543E, 0xFFC4ECF9, 0xFFC685B4, 0xFFC81E6F, 0xFFC9B72A, 0xFFCB4FE5, 0xFFCCE8A0, 0xFFCE815B, 0xFFD01A16, 0xFFD1B2D1, 0xFFD34B8C, 0xFFD4E447, 0xFFD67D02, 0xFFD815BD, 0xFFD9AE78, 0xFFDB4733, 0xFFDCDFEE, 0xFFDE78A9, 0xFFE01164, 0xFFE1AA1F, 0xFFE342DA, 0xFFE4DB95, 0xFFE67450, 0xFFE80D0B, 0xFFE9A5C6, 0xFFEB3E81, 0xFFECD73C, 0xFFEE6FF7, 0xFFF008B2, 0xFFF1A16D, 0xFFF33A28, 0xFFF4D2E3, 0xFFF66B9E, 0xFFF80459, 0xFFF99D14, 0xFFFB35CF, 0xFFFCCE8A, 0xFFFE6745, 0x0, 0x198BB, 0x33176, 0x4CA31, 0x662EC, 0x7FBA7, 0x99462, 0xB2D1D, 0xCC5D8, 0xE5E93, 0xFF74E, 0x119009, 0x1328C4, 0x14C17F, 0x165A3A, 0x17F2F5, 0x198BB0, 0x1B246B, 0x1CBD26, 0x1E55E1, 0x1FEE9C, 0x218757, 0x232012, 0x24B8CD, 0x265188, 0x27EA43, 0x2982FE, 0x2B1BB9, 0x2CB474, 0x2E4D2F, 0x2FE5EA, 0x317EA5, 0x331760, 0x34B01B, 0x3648D6, 0x37E191, 0x397A4C, 0x3B1307, 0x3CABC2, 0x3E447D, 0x3FDD38, 0x4175F3, 0x430EAE, 0x44A769, 0x464024, 0x47D8DF, 0x49719A, 0x4B0A55, 0x4CA310, 0x4E3BCB, 0x4FD486, 0x516D41, 0x5305FC, 0x549EB7, 0x563772, 0x57D02D, 0x5968E8, 0x5B01A3, 0x5C9A5E, 0x5E3319, 0x5FCBD4, 0x61648F, 0x62FD4A, 0x649605, 0x662EC0, 0x67C77B, 0x696036, 0x6AF8F1, 0x6C91AC, 0x6E2A67, 0x6FC322, 0x715BDD, 0x72F498, 0x748D53, 0x76260E, 0x77BEC9, 0x795784, 0x7AF03F, 0x7C88FA, 0x7E21B5, 0x7FBA70, 0x81532B, 0x82EBE6, 0x8484A1, 0x861D5C, 0x87B617, 0x894ED2, 0x8AE78D, 0x8C8048, 0x8E1903, 0x8FB1BE, 0x914A79, 0x92E334, 0x947BEF, 0x9614AA, 0x97AD65, 0x994620, 0x9ADEDB, 0x9C7796, 0x9E1051, 0x9FA90C, 0xA141C7, 0xA2DA82, 0xA4733D, 0xA60BF8, 0xA7A4B3, 0xA93D6E, 0xAAD629, 0xAC6EE4, 0xAE079F, 0xAFA05A, 0xB13915, 0xB2D1D0, 0xB46A8B, 0xB60346, 0xB79C01, 0xB934BC, 0xBACD77, 0xBC6632, 0xBDFEED, 0xBF97A8, 0xC13063, 0xC2C91E, 0xC461D9, 0xC5FA94, 0xC7934F, 0xC92C0A, 0xCAC4C5 -}; - -void getvideo(unsigned char *video, int *xres, int *yres); -void getosd(unsigned char *osd, int *xres, int *yres); -void smooth_resize(const unsigned char *source, unsigned char *dest, int xsource, int ysource, int xdest, int ydest, int colors); -void fast_resize(const unsigned char *source, unsigned char *dest, int xsource, int ysource, int xdest, int ydest, int colors); -void (*resize)(const unsigned char *source, unsigned char *dest, int xsource, int ysource, int xdest, int ydest, int colors); -void combine(unsigned char *output, const unsigned char *video, const unsigned char *osd, int vleft, int vtop, int vwidth, int vheight, int xres, int yres); - -static enum {UNKNOWN, AZBOX863x, AZBOX865x, ST, PALLAS, VULCAN, XILLEON, BRCM7400, BRCM7401, BRCM7405, BRCM7325, BRCM7335, BRCM7346, BRCM7358, BRCM7362, BRCM7241, BRCM7356, BRCM7424, BRCM7425} stb_type = UNKNOWN; - -static int chr_luma_stride = 0x40; -static int chr_luma_register_offset = 0; -static unsigned int registeroffset = 0; -static unsigned int mem2memdma_register = 0; -static int quiet = 0; - -// main program - -int main(int argc, char **argv) -{ - int xres_v, yres_v, xres_o, yres_o, xres, yres, aspect; - int c, osd_only, video_only, use_osd_res, width, use_png, use_jpg, jpg_quality, no_aspect, use_letterbox; - - // we use fast resize as standard now - resize = &fast_resize; - - osd_only = video_only = use_osd_res = width = use_png = use_jpg = no_aspect = use_letterbox = 0; - jpg_quality = 50; - aspect = 1; - - int dst_left = 0, dst_top = 0, dst_width = 0, dst_height = 0; - - unsigned char *video, *osd, *output; - int output_bytes = 3; - - const char *filename = "/tmp/screenshot.bmp"; - - // detect STB - char buf[256]; - FILE *fp = fopen("/proc/fb", "r"); - if (!fp) - { - fprintf(stderr, "No framebuffer, unknown STB .. quit.\n"); - return 1; - } - - while (fgets(buf, sizeof(buf), fp)) - { - if (strcasestr(buf, "VULCAN")) stb_type = VULCAN; - if (strcasestr(buf, "PALLAS")) stb_type = PALLAS; - if (strcasestr(buf, "XILLEON")) stb_type = XILLEON; - if (strcasestr(buf, "EM863x")) stb_type = AZBOX863x; - if (strcasestr(buf, "EM865x")) stb_type = AZBOX865x; - if (strcasestr(buf, "STi") || strcasestr(buf, "STx")) stb_type = ST; - } - fclose(fp); - - if (stb_type == UNKNOWN) - { - FILE *file = fopen("/proc/stb/info/chipset", "r"); - if (file) - { - char buf[32]; - while (fgets(buf, sizeof(buf), file)) - { - if (strstr(buf, "7400")) - { - stb_type = BRCM7400; - break; - } - else if (strstr(buf, "7401")) - { - stb_type = BRCM7401; - break; - } - else if (strstr(buf, "7403")) - { - stb_type = BRCM7401; - break; - } - else if (strstr(buf, "7405")) - { - stb_type = BRCM7405; - break; - } - else if (strstr(buf, "7413")) - { - stb_type = BRCM7405; - break; - } - else if (strstr(buf, "7335")) - { - stb_type = BRCM7335; - break; - } - else if (strstr(buf, "7325")) - { - stb_type = BRCM7325; - break; - } - else if (strstr(buf, "7346")) - { - stb_type = BRCM7346; - break; - } - else if (strstr(buf, "7358")) - { - stb_type = BRCM7358; - break; - } - else if (strstr(buf, "7362")) - { - stb_type = BRCM7362; - break; - } - else if (strstr(buf, "7241")) - { - stb_type = BRCM7241; - break; - } - else if (strstr(buf, "7356")) - { - stb_type = BRCM7356; - break; - } - else if (strstr(buf, "7424")) - { - stb_type = BRCM7424; - break; - } - else if (strstr(buf, "7425")) - { - stb_type = BRCM7425; - break; - } - } - fclose(file); - } - } - - if (stb_type == UNKNOWN) - { - FILE *file = fopen("/proc/stb/info/model", "r"); - if (file) - { - char buf[32]; - while (fgets(buf, sizeof(buf), file)) - { - if (strcasestr(buf, "DM500HD") || strcasestr(buf, "DM800SE") || strcasestr(buf, "DM7020HD")) - { - stb_type = BRCM7405; - break; - } - else if (strcasestr(buf, "DM8000")) - { - stb_type = BRCM7400; - break; - } - else if (strcasestr(buf, "DM800")) - { - stb_type = BRCM7401; - break; - } - } - fclose(file); - } - } - - if (stb_type == UNKNOWN) - { - fprintf(stderr, "unknown stb type\n"); - return -1; - } - - switch (stb_type) - { - case BRCM7400: - registeroffset = 0x10100000; - chr_luma_stride = 0x40; - chr_luma_register_offset = 0x20; - mem2memdma_register = 0x10c02000; - break; - case BRCM7401: - registeroffset = 0x10100000; - chr_luma_stride = 0x40; - chr_luma_register_offset = 0x20; - mem2memdma_register = 0; - break; - case BRCM7405: - registeroffset = 0x10100000; - chr_luma_stride = 0x80; - chr_luma_register_offset = 0x20; - mem2memdma_register = 0; - break; - case BRCM7325: - registeroffset = 0x10100000; - chr_luma_stride = 0x80; - chr_luma_register_offset = 0x20; - mem2memdma_register = 0; - break; - case BRCM7335: - registeroffset = 0x10100000; - chr_luma_stride = 0x40; - chr_luma_register_offset = 0x20; - mem2memdma_register = 0x10c01000; - break; - case BRCM7358: - registeroffset = 0x10600000; - chr_luma_stride = 0x40; - chr_luma_register_offset = 0x34; - mem2memdma_register = 0; - break; - case BRCM7362: - registeroffset = 0x10600000; - chr_luma_stride = 0x40; - chr_luma_register_offset = 0x34; - mem2memdma_register = 0; - break; - case BRCM7241: - case BRCM7346: - case BRCM7356: - case BRCM7424: - case BRCM7425: - registeroffset = 0x10600000; - chr_luma_stride = 0x80; - chr_luma_register_offset = 0x34; - mem2memdma_register = 0; - break; - default: - break; - } - - // process command line - while ((c = getopt(argc, argv, "dhj:lbnopqr:sv")) != -1) - { - switch (c) - { - case 'h': - case '?': - fprintf(stderr, - "Usage: grab [commands] [filename]\n\n" - "command:\n" - "-o only grab osd (framebuffer) when using this with png or bmp\n" - " fileformat you will get a 32bit pic with alphachannel\n" - "-v only grab video\n" - "-d always use osd resolution (good for skinshots)\n" - "-n dont correct 16:9 aspect ratio\n" - "-r (size) resize to a fixed width, maximum: 1920\n" - "-l always 4:3, create letterbox if 16:9\n" - "-b use bicubic picture resize (slow but smooth)\n" - "-j (quality) produce jpg files instead of bmp (quality 0-100)\n" - "-p produce png files instead of bmp\n" - "-q Quiet mode, don't output debug messages\n" - "-s write to stdout instead of a file\n" - "-h this help screen\n\n" - "If no command is given the complete picture will be grabbed.\n" - "If no filename is given /tmp/screenshot.[bmp/jpg/png] will be used.\n"); - return 1; - case 'o': // OSD only - osd_only = 1; - video_only = 0; - break; - case 'v': // Video only - video_only = 1; - osd_only = 0; - break; - case 'd': // always use OSD resolution - use_osd_res = 1; - no_aspect = 1; - break; - case 'q': // quiet - ++quiet; - break; - case 'r': // use given resolution - width = atoi(optarg); - if (width > 1920) - { - fprintf(stderr, "Error: -r (size) ist limited to 1920 pixel !\n"); - return 1; - } - break; - case 's': // stdout - filename = NULL; - break; - case 'l': // create letterbox - use_letterbox = 1; - break; - case 'b': // use bicubic resizing - resize = &smooth_resize; - break; - case 'p': // use png file format - use_png = 1; - use_jpg = 0; - if (filename) - filename = "/tmp/screenshot.png"; - break; - case 'j': // use jpg file format - use_jpg = 1; - use_png = 0; - jpg_quality = atoi(optarg); - if (filename) - filename = "/tmp/screenshot.jpg"; - break; - case 'n': - no_aspect = 1; - break; - } - } - if (optind < argc) // filename - filename = argv[optind]; - - int mallocsize = 1920 * 1080; - - if (stb_type == VULCAN || stb_type == PALLAS) - mallocsize = 720 * 576; - - video = (unsigned char *)malloc(mallocsize * 3); - osd = (unsigned char *)malloc(mallocsize * 4); - - if ((stb_type == VULCAN || stb_type == PALLAS) && width > 720) - mallocsize = width * (width * 0.8 + 1); - - output = (unsigned char *)malloc(mallocsize * 4); - - // get osd - if (!video_only) - getosd(osd, &xres_o, &yres_o); - - // get video - if (!osd_only) - { - if (!quiet) - fprintf(stderr, "Grabbing Video ...\n"); - getvideo(video, &xres_v, &yres_v); - } - - // get aspect ratio - if (stb_type == VULCAN || stb_type == PALLAS) - { - fp = fopen("/proc/bus/bitstream", "r"); - if (fp) - { - while (fgets(buf, sizeof(buf), fp)) - sscanf(buf, "A_RATIO: %d", &aspect); - fclose(fp); - } - } - else - { - fp = fopen("/proc/stb/vmpeg/0/aspect", "r"); - if (fp) - { - while (fgets(buf, sizeof(buf), fp)) - sscanf(buf, "%x", &aspect); - fclose(fp); - } - fp = fopen("/proc/stb/vmpeg/0/dst_width", "r"); - if (fp) - { - while (fgets(buf, sizeof(buf), fp)) - sscanf(buf, "%x", &dst_width); - fclose(fp); - } - fp = fopen("/proc/stb/vmpeg/0/dst_height", "r"); - if (fp) - { - while (fgets(buf, sizeof(buf), fp)) - sscanf(buf, "%x", &dst_height); - fclose(fp); - } - fp = fopen("/proc/stb/vmpeg/0/dst_top", "r"); - if (fp) - { - while (fgets(buf, sizeof(buf), fp)) - sscanf(buf, "%x", &dst_top); - fclose(fp); - } - fp = fopen("/proc/stb/vmpeg/0/dst_left", "r"); - if (fp) - { - while (fgets(buf, sizeof(buf), fp)) - sscanf(buf, "%x", &dst_left); - fclose(fp); - } - if (dst_width == 720) dst_width = 0; - if (dst_height == 576) dst_height = 0; - } - - // resizing - if (video_only) - { - xres = xres_v; - yres = yres_v; - } - else if (osd_only) - { - xres = xres_o; - yres = yres_o; - } - else if (xres_o == xres_v && yres_o == yres_v && !dst_top && !dst_left && !dst_width && !dst_height) - { - xres = xres_v; - yres = yres_v; - } - else - { - if (xres_v > xres_o && !use_osd_res && (width == 0 || width > xres_o)) - { - // resize osd to video size - xres = xres_v; - yres = yres_v; - } - else - { - // resize video to osd size - xres = xres_o; - yres = yres_o; - } - if (dst_top || dst_left || dst_width || dst_height) - { - if (dst_width == 0) dst_width = 720; - if (dst_height == 0) dst_height = 576; - dst_top *= yres; - dst_top /= 576; - dst_height *= yres; - dst_height /= 576; - dst_left *= xres; - dst_left /= 720; - dst_width *= xres; - dst_width /= 720; - } - else - { - dst_width = xres; - dst_height = yres; - } - if (xres_o != xres || yres_o != yres) - { - if (!quiet) - fprintf(stderr, "Resizing OSD to : %d x %d \n", xres, yres); - resize(osd, output, xres_o, yres_o, xres, yres, 4); - memcpy(osd, output, xres * yres * 4); - } - if (xres_v != dst_width || yres_v != dst_height) - { - if (!quiet) - fprintf(stderr, "Resizing Video to %d x %d ...\n", dst_width, dst_height); - resize(video, output, xres_v, yres_v, dst_width, dst_height, 3); - memset(video, 0, xres_v * yres_v * 3); - memcpy(video, output, dst_width * dst_height * 3); - } - } - - // merge video and osd if neccessary - if (osd_only) - { - memcpy(output, osd, xres * yres * 4); - output_bytes = 4; - } - else if (video_only) - { - memcpy(output, video, xres * yres * 3); - } - else - { - if (!quiet) - fprintf(stderr, "Merge Video with Framebuffer ...\n"); - combine(output, video, osd, dst_left, dst_top, dst_width ? dst_width : xres, dst_height ? dst_height : yres, xres, yres); - } - - // resize to specific width ? - if (width) - { - if (!quiet) - fprintf(stderr, "Resizing Screenshot to %d x %d ...\n", width, yres * width / xres); - resize(output, osd, xres, yres, width, (yres * width / xres), output_bytes); - yres = yres * width / xres; - xres = width; - memcpy(output, osd, xres * yres * output_bytes); - } - - // correct aspect ratio - if (!no_aspect && aspect == 3 && ((float)xres / (float)yres) < 1.5) - { - if (!quiet) - fprintf(stderr, "Correct aspect ratio to 16:9 ...\n"); - resize(output, osd, xres, yres, xres, yres / 1.42, output_bytes); - yres /= 1.42; - memcpy(output, osd, xres * yres * output_bytes); - } - - // use letterbox ? - if (use_letterbox && xres * 0.8 != yres && xres * 0.8 <= 1080) - { - int yres_neu; - yres_neu = xres * 0.8; - if (!quiet) - fprintf(stderr, "Create letterbox %d x %d ...\n", xres, yres_neu); - if (yres_neu > yres) - { - int ofs; - ofs = (yres_neu - yres) >> 1; - memmove(output + ofs * xres * output_bytes, output, xres * yres * output_bytes); - memset(output, 0, ofs * xres * output_bytes); - memset(output + ofs * xres * 3 + xres * yres * output_bytes, 0, ofs * xres * output_bytes); - } - yres = yres_neu; - } - - // saving picture - if (!quiet) - fprintf(stderr, "Saving %d bit %s ...\n", (use_jpg ? 3 * 8 : output_bytes * 8), filename ? filename : ""); - FILE *fd2; - if (filename) - { - fd2 = fopen(filename, "wr"); - if (!fd2) - { - fprintf(stderr, "Failed to open '%s' for output\n", filename); - return 1; - } - } - else - fd2 = stdout; - - if (!use_png && !use_jpg) - { - // write bmp - unsigned char hdr[14 + 40]; - int i = 0; -#define PUT32(x) hdr[i++] = ((x)&0xFF); hdr[i++] = (((x)>>8)&0xFF); hdr[i++] = (((x)>>16)&0xFF); hdr[i++] = (((x)>>24)&0xFF); -#define PUT16(x) hdr[i++] = ((x)&0xFF); hdr[i++] = (((x)>>8)&0xFF); -#define PUT8(x) hdr[i++] = ((x)&0xFF); - PUT8('B'); - PUT8('M'); - PUT32((((xres * yres) * 3 + 3) & ~ 3) + 14 + 40); - PUT16(0); - PUT16(0); - PUT32(14 + 40); - PUT32(40); - PUT32(xres); - PUT32(yres); - PUT16(1); - PUT16(output_bytes * 8); // bits - PUT32(0); - PUT32(0); - PUT32(0); - PUT32(0); - PUT32(0); - PUT32(0); -#undef PUT32 -#undef PUT16 -#undef PUT8 - fwrite(hdr, 1, i, fd2); - - int y; - for (y = yres - 1; y >= 0 ; y -= 1) - fwrite(output + (y * xres * output_bytes), xres * output_bytes, 1, fd2); - } - else if (use_png) - { - // write png - png_bytep *row_pointers; - png_structp png_ptr; - png_infop info_ptr; - - png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, (png_voidp)NULL, (png_error_ptr)NULL, (png_error_ptr)NULL); - info_ptr = png_create_info_struct(png_ptr); - png_init_io(png_ptr, fd2); - - row_pointers = (png_bytep *)malloc(sizeof(png_bytep) * yres); - - int y; - for (y = 0; y < yres; y++) - row_pointers[y] = output + (y * xres * output_bytes); - - png_set_bgr(png_ptr); - png_set_IHDR(png_ptr, info_ptr, xres, yres, 8, ((output_bytes < 4) ? PNG_COLOR_TYPE_RGB : PNG_COLOR_TYPE_RGBA) , PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); - png_write_info(png_ptr, info_ptr); - png_write_image(png_ptr, row_pointers); - png_write_end(png_ptr, info_ptr); - png_destroy_write_struct(&png_ptr, &info_ptr); - - free(row_pointers); - } - else - { - const int row_stride = xres * output_bytes; - // write jpg - if (output_bytes == 3) // swap bgr<->rgb - { - int y; - #pragma omp parallel for shared(output) - for (y = 0; y < yres; y++) - { - int xres1 = y * xres * 3; - int xres2 = xres1 + 2; - int x; - for (x = 0; x < xres; x++) - { - int x2 = x * 3; - SWAP(output[x2 + xres1], output[x2 + xres2]); - } - } - } - else // swap bgr<->rgb and eliminate alpha channel jpgs are always saved with 24bit without alpha channel - { - int y; - #pragma omp parallel for shared(output) - for (y = 0; y < yres; y++) - { - unsigned char *scanline = output + (y * row_stride); - int x; - for (x = 0; x < xres; x++) - { - const int xs = x * 4; - const int xd = x * 3; - scanline[xd + 0] = scanline[xs + 2]; - scanline[xd + 1] = scanline[xs + 1]; - scanline[xd + 2] = scanline[xs + 0]; - } - } - } - - struct jpeg_compress_struct cinfo; - struct jpeg_error_mgr jerr; - JSAMPROW row_pointer[1]; - cinfo.err = jpeg_std_error(&jerr); - - jpeg_create_compress(&cinfo); - jpeg_stdio_dest(&cinfo, fd2); - cinfo.image_width = xres; - cinfo.image_height = yres; - cinfo.input_components = 3; - cinfo.in_color_space = JCS_RGB; - cinfo.dct_method = JDCT_IFAST; - jpeg_set_defaults(&cinfo); - jpeg_set_quality(&cinfo, jpg_quality, TRUE); - jpeg_start_compress(&cinfo, TRUE); - while (cinfo.next_scanline < cinfo.image_height) - { - row_pointer[0] = & output[cinfo.next_scanline * row_stride]; - (void) jpeg_write_scanlines(&cinfo, row_pointer, 1); - } - jpeg_finish_compress(&cinfo); - jpeg_destroy_compress(&cinfo); - } - - if (filename) - fclose(fd2); - - // Thats all folks - if (!quiet) - fprintf(stderr, "... Done !\n"); - - // clean up - free(video); - free(osd); - free(output); - - return 0; -} - -// grabing the video picture - -void getvideo(unsigned char *video, int *xres, int *yres) -{ - int mem_fd; - //unsigned char *memory; - void *memory; - if ((mem_fd = open("/dev/mem", O_RDWR | O_SYNC)) < 0) - { - fprintf(stderr, "Mainmemory: can't open /dev/mem \n"); - return; - } - - unsigned char *luma, *chroma, *memory_tmp; - luma = (unsigned char *)malloc(1); // real malloc will be done later - chroma = (unsigned char *)malloc(1); // this is just to be sure it get initialized and free() will not segfaulting - memory_tmp = (unsigned char *)malloc(1); - int t, stride, res; - res = stride = 0; - char buf[256]; - FILE *fp; - - if (stb_type > XILLEON) - { - // grab bcm pic from decoder memory - const unsigned char *data = (unsigned char *)mmap(0, 100, PROT_READ, MAP_SHARED, mem_fd, registeroffset); - if (!data) - { - fprintf(stderr, "Mainmemory: \n"); - return; - } - - int adr, adr2, ofs, ofs2, offset, pageoffset; - int xtmp, xsub, ytmp, t2, dat1; - - ofs = data[chr_luma_register_offset + 8] << 4; /* luma lines */ - ofs2 = data[chr_luma_register_offset + 12] << 4; /* chroma lines */ - adr2 = data[chr_luma_register_offset + 3] << 24 | data[chr_luma_register_offset + 2] << 16 | data[chr_luma_register_offset + 1] << 8; - stride = data[0x15] << 8 | data[0x14]; - adr = data[0x1f] << 24 | data[0x1e] << 16 | data[0x1d] << 8; /* start of videomem */ - offset = adr2 - adr; - pageoffset = adr & 0xfff; - adr -= pageoffset; - adr2 -= pageoffset; - - munmap((void *)data, 100); - - fp = fopen("/proc/stb/vmpeg/0/yres", "r"); - while (fgets(buf, sizeof(buf), fp)) - sscanf(buf, "%x", &res); - fclose(fp); - - if (!adr || !adr2) - { - *xres = stride; - *yres = res; - memset(video, 0, *xres * *yres * 3); - return; - } - - //fprintf(stderr, "Stride: %d Res: %d\n",stride,res); - //fprintf(stderr, "Adr: %X Adr2: %X OFS: %d %d\n",adr,adr2,ofs,ofs2); - - luma = (unsigned char *)malloc(stride * (ofs)); - chroma = (unsigned char *)malloc(stride * ofs2); - - int memory_tmp_size = 0; - // grabbing luma & chroma plane from the decoder memory - if (!mem2memdma_register) - { - // we have direct access to the decoder memory - memory_tmp_size = offset + (stride + chr_luma_stride) * ofs2; - if (!(memory_tmp = (unsigned char *)mmap(0, memory_tmp_size, PROT_READ, MAP_SHARED, mem_fd, adr))) - { - fprintf(stderr, "Mainmemory: \n"); - return; - } - - usleep(50000); // we try to get a full picture, its not possible to get a sync from the decoder so we use a delay - // and hope we get a good timing. dont ask me why, but every DM800 i tested so far produced a good - // result with a 50ms delay - - } - else - { - int tmp_size = offset + (stride + chr_luma_stride) * ofs2; - if (tmp_size > 2 * DMA_BLOCKSIZE) - { - fprintf(stderr, "Got invalid stride value from the decoder: %d\n", stride); - return; - } - memory_tmp_size = DMA_BLOCKSIZE + 0x1000; - if (!(memory_tmp = (unsigned char *)mmap(0, memory_tmp_size, PROT_READ | PROT_WRITE, MAP_SHARED, mem_fd, SPARE_RAM))) - { - fprintf(stderr, "Mainmemory: \n"); - return; - } - volatile unsigned long *mem_dma; - if (!(mem_dma = (volatile unsigned long *)mmap(0, 0x1000, PROT_READ | PROT_WRITE, MAP_SHARED, mem_fd, mem2memdma_register))) - { - fprintf(stderr, "Mainmemory: \n"); - return; - } - - int i = 0; - int tmp_len = DMA_BLOCKSIZE; - for (i = 0; i < tmp_size; i += DMA_BLOCKSIZE) - { - - unsigned long *descriptor = (void *)memory_tmp; - - if (i + DMA_BLOCKSIZE > tmp_size) - tmp_len = tmp_size - i; - - //fprintf(stderr, "DMACopy: %x (%d) size: %d\n", adr+i, i, tmp_len); - - descriptor[0] = /* READ */ adr + i; - descriptor[1] = /* WRITE */ SPARE_RAM + 0x1000; - descriptor[2] = 0x40000000 | /* LEN */ tmp_len; - descriptor[3] = 0; - descriptor[4] = 0; - descriptor[5] = 0; - descriptor[6] = 0; - descriptor[7] = 0; - mem_dma[1] = /* FIRST_DESCRIPTOR */ SPARE_RAM; - mem_dma[3] = /* DMA WAKE CTRL */ 3; - mem_dma[2] = 1; - while (mem_dma[5] == 1) - usleep(2); - mem_dma[2] = 0; - - } - - munmap((void *)mem_dma, 0x1000); - /* unmap the dma descriptor page, we won't need it anymore */ - munmap((void *)memory_tmp, 0x1000); - /* adjust start and size of the remaining memory_tmp mmap */ - memory_tmp += 0x1000; - memory_tmp_size -= 0x1000; - } - - t = t2 = dat1 = 0; - - xsub = chr_luma_stride; - // decode luma & chroma plane or lets say sort it - for (xtmp = 0; xtmp < stride; xtmp += chr_luma_stride) - { - if ((stride - xtmp) <= chr_luma_stride) - xsub = stride - xtmp; - - dat1 = xtmp; - for (ytmp = 0; ytmp < ofs; ytmp++) - { - memcpy(luma + dat1, memory_tmp + pageoffset + t, xsub); // luma - t += chr_luma_stride; - dat1 += stride; - } - } - // Hmm apparently lumastride == chromastride? - xsub = chr_luma_stride; - for (xtmp = 0; xtmp < stride; xtmp += chr_luma_stride) - { - if ((stride - xtmp) <= chr_luma_stride) - xsub = stride - xtmp; - - dat1 = xtmp; - for (ytmp = 0; ytmp < ofs2; ytmp++) - { - memcpy(chroma + dat1, memory_tmp + pageoffset + offset + t2, xsub); // chroma - t2 += chr_luma_stride; - dat1 += stride; - } - } - munmap(memory_tmp, memory_tmp_size); - - int count = (stride * ofs) >> 2; - #pragma omp parallel for - for (t = 0; t < count; ++t) - { - unsigned char *p = luma + (4 * t); - unsigned char t; - SWAP(p[0], p[3]); - SWAP(p[1], p[2]); - } - count = (stride * ofs2) >> 2; - #pragma omp parallel for - for (t = 0; t < count; ++t) - { - unsigned char *p = chroma + (4 * t); - unsigned char t; - SWAP(p[0], p[3]); - SWAP(p[1], p[2]); - } - } - else if (stb_type == AZBOX863x || stb_type == AZBOX865x) - { - - unsigned char *infos = 0 , *lyuv = 0, *ptr; - int fd, len = 0, x, y; - unsigned int chroma_w, chroma_h; - unsigned int luma_w, luma_h; - unsigned int luma_width, chroma_width; - unsigned int luma_size_tile, chroma_size_tile; - unsigned char *pluma; - unsigned char *pchroma; - - fd = open("/dev/frameyuv", O_RDWR); - if (!fd) - { - perror("/dev/frameyuv"); - return; - } - - infos = malloc(1920 * 1080 * 4); - len = read(fd, infos, 1920 * 1080 * 4); - - if (len <= 0) - { - fprintf(stderr, "No picture info %d\n", len); - free(infos); - close(fd); - return; - } - - luma_w = (infos[0] << 24) | (infos[1] << 16) | (infos[2] << 8) | (infos[3]); - luma_h = (infos[4] << 24) | (infos[5] << 16) | (infos[6] << 8) | (infos[7]); - luma_width = (infos[8] << 24) | (infos[9] << 16) | (infos[10] << 8) | (infos[11]); - chroma_w = (infos[12] << 24) | (infos[13] << 16) | (infos[14] << 8) | (infos[15]); - chroma_h = (infos[16] << 24) | (infos[17] << 16) | (infos[18] << 8) | (infos[19]); - chroma_width = (infos[20] << 24) | (infos[21] << 16) | (infos[22] << 8) | (infos[23]); - - if (stb_type == AZBOX863x) - { - luma_size_tile = (((luma_w + 127) / 128) * 128) * (((luma_h + 31) / 32) * 32); - chroma_size_tile = (((chroma_w + 127) / 128) * 128) * (((chroma_h + 31) / 32) * 32); - } - else - { - luma_size_tile = (((luma_w + 255) / 256) * 256) * (((luma_h + 31) / 32) * 32); - chroma_size_tile = (((chroma_w + 255) / 256) * 256) * (((chroma_h + 31) / 32) * 32); - } - - pluma = infos + 24; - pchroma = infos + 24 + luma_size_tile; - - luma = (unsigned char *)malloc(luma_w * luma_h); - chroma = (unsigned char *)malloc(chroma_w * chroma_h * 2); - - stride = luma_w; - res = luma_h; - - ptr = luma; - if (stb_type == AZBOX863x) - { - /* save the luma buffer Y */ - for (y = 0 ; y < luma_h ; y++) - { - for (x = 0 ; x < luma_w ; x++) - { - unsigned char *pixel = (pluma + \ - (x / 128) * 4096 + (y / 32) * luma_width * 32 + (x % 128) + (y % 32) * 128); - *ptr++ = *pixel; - } - } - - ptr = chroma; - - /* break chroma buffer into U & V components */ - for (y = 0 ; y < chroma_h ; y++) - { - for (x = 0 ; x < chroma_w * 2 ; x++) - { - unsigned char *pixel = (pchroma + \ - (x / 128) * 4096 + (y / 32) * chroma_width * 32 + (x % 128) + (y % 32) * 128); - *ptr++ = *pixel; - } - } - } - else if (stb_type == AZBOX865x) - { - /* save the luma buffer Y */ - for (y = 0 ; y < luma_h ; y++) - { - for (x = 0 ; x < luma_w ; x++) - { - unsigned char *pixel = (pluma + \ - (x / 256) * 8192 + (y / 32) * luma_width * 32 + (x % 256) + (y % 32) * 256); - *ptr++ = *pixel; - } - } - - ptr = chroma; - - /* break chroma buffer into U & V components */ - for (y = 0 ; y < chroma_h ; y++) - { - for (x = 0 ; x < chroma_w * 2 ; x++) - { - unsigned char *pixel = (pchroma + \ - (x / 256) * 8192 + (y / 32) * chroma_width * 32 + (x % 256) + (y % 32) * 256); - *ptr++ = *pixel; - } - } - } - free(infos); - close(fd); - } - else if (stb_type == ST) - { - int yblock, xblock, iyblock, ixblock, yblockoffset, offset, layer_offset, OUTITER, OUTINC, OUTITERoffset; - int stride_half; - unsigned char *out; - unsigned char even, cr; - int fd_bpa; - int ioctlres; - BPAMemMapMemData bpa_data; - char bpa_mem_device[30]; - char *decode_surface; - int delay; - - fp = fopen("/proc/stb/vmpeg/0/xres", "r"); - if (fp) - { - while (fgets(buf, sizeof(buf), fp)) - { - sscanf(buf, "%x", &stride); - } - fclose(fp); - } - fp = fopen("/proc/stb/vmpeg/0/yres", "r"); - if (fp) - { - while (fgets(buf, sizeof(buf), fp)) - { - sscanf(buf, "%x", &res); - } - fclose(fp); - } - - //if stride and res is zero than this is most probably a stillpicture - if (stride == 0) - stride = 1280; - if (res == 0) - res = 720; - - stride_half = stride / 2; - - luma = (unsigned char *)malloc(stride * res); - chroma = (unsigned char *)malloc(stride * res / 2); - char *temp = (unsigned char *)malloc(4 * 1024 * 1024); - if (NULL == temp) - { - printf("can not allocate memory\n"); - return; - } - - memset(chroma, 0x80, stride * res / 2); - memset(luma, 0x00, stride * res); /* just to invalidate the page */ - memset(temp, 0x00, 4 * 1024 * 1024); /* just to invalidate the page */ - - fd_bpa = open("/dev/bpamem0", O_RDWR); - if (fd_bpa < 0) - { - fprintf(stderr, "cannot access /dev/bpamem0! err = %d\n", fd_bpa); - return; - } - bpa_data.bpa_part = "LMI_VID"; - bpa_data.phys_addr = 0x00000000; - bpa_data.mem_size = 0; - - fp = fopen("/proc/bpa2", "r"); - if (fp) - { - unsigned char found_part = 0; - unsigned long mem_size = 0; - unsigned long phys_addr = 0; - while (fgets(buf, sizeof(buf), fp)) - { - if (found_part || strstr(buf, bpa_data.bpa_part) != NULL) - { - found_part = 1; - if (sscanf(buf, "- %lu B at %lx", &mem_size, &phys_addr) == 2) - { - if (mem_size > bpa_data.mem_size) - { - bpa_data.mem_size = mem_size; - bpa_data.phys_addr = phys_addr; - } - } - } - } - fclose(fp); - } - - if (!quiet) - fprintf(stderr, "Using bpa2 part : %s - 0x%lx %lu\n", bpa_data.bpa_part, bpa_data.phys_addr, bpa_data.mem_size); - - //bpa_data.phys_addr = 0x4a824000; - //bpa_data.mem_size = 28311552; - - ioctlres = ioctl(fd_bpa, BPAMEMIO_MAPMEM, &bpa_data); // request memory from bpamem - if (ioctlres) - { - fprintf(stderr, "cannot map required mem\n"); - return; - } - - sprintf(bpa_mem_device, "/dev/bpamem%d", bpa_data.device_num); - close(fd_bpa); - - fd_bpa = open(bpa_mem_device, O_RDWR); - - // if somebody forgot to add all bpamem devs then this gets really bad here - if (fd_bpa < 0) - { - fprintf(stderr, "cannot access %s! err = %d\n", bpa_mem_device, fd_bpa); - return; - } - - char *decode_map = (char *)mmap(0, bpa_data.mem_size, PROT_WRITE | PROT_READ, MAP_SHARED, fd_bpa, 0); - - if (decode_map == MAP_FAILED) - { - fprintf(stderr, "could not map bpa mem\n"); - close(fd_bpa); - return; - } - - if (!quiet) - fprintf(stderr, "decode surface size : %d\n", bpa_data.mem_size); - - //luma - layer_offset = 0; - - //we do not have to round that every luma res will be a multiple of 16 - yblock = res / 16; //45 - xblock = stride / 16; //80 - - //thereby yblockoffset does also not to be rounded up - yblockoffset = xblock * 256/*16x16px*/ * 2/*2 block rows*/; //0xA000 for 1280 - - //printf("yblock: %u xblock:%u yblockoffset:0x%x\n", yblock, xblock, yblockoffset); - - OUTITER = 0; - OUTITERoffset = 0; - OUTINC = 1; /*no spaces between pixel*/ - out = luma; - - struct timeval start_tv; - struct timeval stop_tv; - struct timeval result_tv; - - //wait_for_frame_sync - { - unsigned char old_frame[0x800]; /*first 2 luma blocks, 0:0 - 32:64*/ - memcpy(old_frame, decode_map, 0x800); - gettimeofday(&start_tv, NULL); - memcmp(decode_map, old_frame, 0x800); - gettimeofday(&stop_tv, NULL); - for (delay = 0; delay < 500/*ms*/; delay++) - { - if (memcmp(decode_map, old_frame, 0x800) != 0) - break; - usleep(100); - } - } - //gettimeofday(&start_tv, NULL); - memcpy(temp, decode_map, 4 * 1024 * 1024); - //gettimeofday(&stop_tv, NULL); - decode_surface = temp; - - //now we have 16,6ms(60hz) to 50ms(20hz) to get the whole picture - for (even = 0; even < 2; even++) - { - offset = layer_offset + (even << 8 /* * 0x100*/); - OUTITERoffset = even * xblock << 8 /* * 256=16x16px*/; - - for (iyblock = even; iyblock < yblock; iyblock += 2) - { - for (ixblock = 0; ixblock < xblock; ixblock++) - { - int line; - - OUTITER = OUTITERoffset; - for (line = 0; line < 16; line++) - { - OUT_LU_16(offset, line); - OUTITER += (stride - 16 /*we have already incremented by 16*/); - } - //0x00, 0x200, ... - offset += 0x200; - OUTITERoffset += 16; - } - OUTITERoffset += (stride << 5) - stride /* * 31*/; - } - } - - //chroma - layer_offset = ((stride * res + (yblockoffset >> 1 /* /2*/ /*round up*/)) / yblockoffset) * yblockoffset; - - //cb - //we do not have to round that every chroma y res will be a multiple of 16 - //and every chroma x res /2 will be a multiple of 8 - yblock = res >> 4 /* /16*/; //45 - xblock = stride_half >> 3 /* /8*/; //no roundin - - //if xblock is not even than we will have to move to the next even value an - yblockoffset = (((xblock + 1) >> 1 /* / 2*/) << 1 /* * 2*/) << 8 /* * 64=8x8px * 2=2 block rows * 2=cr cb*/; - - //printf("yblock: %u xblock:%u yblockoffset:0x%x\n", yblock, xblock, yblockoffset); - - OUTITER = 0; - OUTITERoffset = 0; - OUTINC = 2; - out = chroma; - - for (cr = 0; cr < 2; cr++) - { - for (even = 0; even < 2; even++) - { - offset = layer_offset + (even << 8 /* * 0x100*/); - OUTITERoffset = even * (xblock << 7 /* * 128=8x8px * 2*/) + cr; - - for (iyblock = even; iyblock < yblock; iyblock += 2) - { - for (ixblock = 0; ixblock < xblock; ixblock++) - { - int line; - OUTITER = OUTITERoffset; - - for (line = 0; line < 8; line++) - { - OUT_CH_8(offset, line, !cr); - OUTITER += (stride - 16 /*we have already incremented by OUTINC*8=16*/); - } - - //0x00 0x80 0x200 0x280, ... - offset += (offset % 0x100 ? 0x180/*80->200*/ : 0x80/*0->80*/); - OUTITERoffset += 16/*OUTINC*8=16*/; - } - OUTITERoffset += (stride << 4) - stride /* * 15*/; - } - } - } - timeval_subtract(&result_tv, &stop_tv, &start_tv); - - if (!quiet) - { - fprintf(stderr, "framesync after : %dms\n", delay); - fprintf(stderr, "frame copy duration : %fms\n", (((float)result_tv.tv_sec) * 1000.0f + ((float)result_tv.tv_usec) / 1000.0f)); - } - - munmap(decode_map, bpa_data.mem_size); - - ioctlres = ioctl(fd_bpa, BPAMEMIO_UNMAPMEM); // request memory from bpamem - if (ioctlres) - { - fprintf(stderr, "cannot unmap required mem\n"); - close(fd_bpa); - return; - } - close(fd_bpa); - } - else if (stb_type == XILLEON) - { - // grab xilleon pic from decoder memory - fp = fopen("/proc/stb/vmpeg/0/xres", "r"); - if (fp) - { - while (fgets(buf, sizeof(buf), fp)) - { - sscanf(buf, "%x", &stride); - } - fclose(fp); - } - fp = fopen("/proc/stb/vmpeg/0/yres", "r"); - if (fp) - { - while (fgets(buf, sizeof(buf), fp)) - { - sscanf(buf, "%x", &res); - } - fclose(fp); - } - - if (!(memory = (unsigned char *)mmap(0, 1920 * 1152 * 6, PROT_READ, MAP_SHARED, mem_fd, 0x6000000))) - { - fprintf(stderr, "Mainmemory: \n"); - return; - } - - luma = (unsigned char *)malloc(1920 * 1152); - chroma = (unsigned char *)malloc(1920 * 576); - - int offset = 1920 * 1152 * 5; // offset for chroma buffer - - const unsigned char *frame_l = memory; // luma frame from video decoder - const unsigned char *frame_c = memory + offset; // chroma frame from video decoder - - int xtmp, ytmp, ysub, xsub; - const int ypart = 32; - const int xpart = 128; - int oe2 = 0; - int ysubcount = res / 32; - int ysubchromacount = res / 64; - - // "decode" luma/chroma, there are 128x32pixel blocks inside the decoder mem - for (ysub = 0; ysub <= ysubcount; ysub++) - { - for (xsub = 0; xsub < 15; xsub++) // 1920/128=15 - { - // Even lines - for (ytmp = 0; ytmp < ypart; ytmp++) - { - int extraoffset = (stride * (ytmp + (ysub * ypart))); - int destx = xsub * xpart; - int overflow = (destx + xpart) - stride; - if (overflow <= 0) - { - // We copy a bit too much... - memcpy(luma + destx + extraoffset, frame_l, xpart); - } - else if (overflow < xpart) - { - memcpy(luma + destx + extraoffset, frame_l, overflow); - } - frame_l += xpart; - } - } - ++ysub; // dirty... - for (xsub = 0; xsub < 15; xsub++) // 1920/128=15 - { - // Odd lines (reverts 64 byte block?) - // Only luminance - for (ytmp = 0; ytmp < ypart; ytmp++) - { - int extraoffset = (stride * (ytmp + (ysub * ypart))); - int destx = xsub * xpart; - int overflow = (destx + xpart) - stride; - if (overflow <= 0) - { - // We copy a bit too much... - memcpy(luma + destx + extraoffset + 64, frame_l, 64); - memcpy(luma + destx + extraoffset, frame_l + 64, 64); - } - else if (overflow < xpart) - { - if (overflow > 64) - { - memcpy(luma + destx + extraoffset + 64, frame_l, overflow - 64); - memcpy(luma + destx + extraoffset, frame_l + 64, 64); - } - else - { - memcpy(luma + destx + extraoffset, frame_l + 64, overflow); - } - } - frame_l += xpart; - } - } - } - - // Chrominance (half resolution) - ysubcount /= 2; - for (ysub = 0; ysub <= ysubcount; ysub++) - { - for (xsub = 0; xsub < 15; xsub++) // 1920/128=15 - { - // Even lines - for (ytmp = 0; ytmp < ypart; ytmp++) - { - int extraoffset = (stride * (ytmp + (ysub * ypart))); - int destx = xsub * xpart; - int overflow = (destx + xpart) - stride; - if (overflow <= 0) - { - memcpy(chroma + destx + extraoffset, frame_c, xpart); - } - else if (overflow < xpart) - { - memcpy(chroma + destx + extraoffset, frame_c, overflow); - } - frame_c += xpart; - } - } - ++ysub; // dirty... - for (xsub = 0; xsub < 15; xsub++) // 1920/128=15 - { - // Odd lines (reverts 64 byte block?) - // Only luminance - for (ytmp = 0; ytmp < ypart; ytmp++) - { - int extraoffset = (stride * (ytmp + (ysub * ypart))); - int destx = xsub * xpart; - int overflow = (destx + xpart) - stride; - if (overflow <= 0) - { - // We copy a bit too much... - memcpy(chroma + destx + extraoffset + 64, frame_c, 64); - memcpy(chroma + destx + extraoffset, frame_c + 64, 64); - } - else if (overflow < xpart) - { - if (overflow > 64) - { - memcpy(chroma + destx + extraoffset + 64, frame_c, overflow - 64); - memcpy(chroma + destx + extraoffset, frame_c + 64, 64); - } - else - { - memcpy(chroma + destx + extraoffset, frame_c + 64, overflow); - } - } - frame_c += xpart; - } - } - } - munmap(memory, 1920 * 1152 * 6); - } - else if (stb_type == VULCAN || stb_type == PALLAS) - { - // grab via v4l device (ppc boxes) - - memory_tmp = (unsigned char *)malloc(720 * 576 * 3 + 16); - - int fd_video = open(VIDEO_DEV, O_RDONLY); - if (fd_video < 0) - { - fprintf(stderr, "could not open /dev/video"); - return; - } - - int r = read(fd_video, memory_tmp, 720 * 576 * 3 + 16); - if (r < 16) - { - fprintf(stderr, "read failed\n"); - close(fd_video); - return; - } - close(fd_video); - - int *size = (int *)memory_tmp; - stride = size[0]; - res = size[1]; - - luma = (unsigned char *)malloc(stride * res); - chroma = (unsigned char *)malloc(stride * res); - - memcpy(luma, memory_tmp + 16, stride * res); - memcpy(chroma, memory_tmp + 16 + stride * res, stride * res); - - free(memory_tmp); - } - - close(mem_fd); - - // yuv2rgb conversion (4:2:0) - const int rgbstride = stride * 3; - const int scans = res / 2; - int y; - #pragma omp parallel for - for (y = 0; y < scans; ++y) - { - int x; - int out1 = y * rgbstride * 2; - int pos = y * stride * 2; - const unsigned char *chroma_p = chroma + (y * stride); - - for (x = stride; x != 0; x -= 2) - { - int U = *chroma_p++; - int V = *chroma_p++; - - int RU = yuv2rgbtable_ru[U]; // use lookup tables to speedup the whole thing - int GU = yuv2rgbtable_gu[U]; - int GV = yuv2rgbtable_gv[V]; - int BV = yuv2rgbtable_bv[V]; - - switch (stb_type) //on xilleon we use bgr instead of rgb so simply swap the coeffs - { - case XILLEON: - SWAP(RU, BV); - break; - } - - // now we do 4 pixels on each iteration this is more code but much faster - int Y = yuv2rgbtable_y[luma[pos]]; - - video[out1] = CLAMP((Y + RU) >> 16); - video[out1 + 1] = CLAMP((Y - GV - GU) >> 16); - video[out1 + 2] = CLAMP((Y + BV) >> 16); - - Y = yuv2rgbtable_y[luma[stride + pos]]; - - video[out1 + rgbstride] = CLAMP((Y + RU) >> 16); - video[out1 + 1 + rgbstride] = CLAMP((Y - GV - GU) >> 16); - video[out1 + 2 + rgbstride] = CLAMP((Y + BV) >> 16); - - pos++; - out1 += 3; - - Y = yuv2rgbtable_y[luma[pos]]; - - video[out1] = CLAMP((Y + RU) >> 16); - video[out1 + 1] = CLAMP((Y - GV - GU) >> 16); - video[out1 + 2] = CLAMP((Y + BV) >> 16); - - Y = yuv2rgbtable_y[luma[stride + pos]]; - - video[out1 + rgbstride] = CLAMP((Y + RU) >> 16); - video[out1 + 1 + rgbstride] = CLAMP((Y - GV - GU) >> 16); - video[out1 + 2 + rgbstride] = CLAMP((Y + BV) >> 16); - - out1 += 3; - pos++; - } - } - - *xres = stride; - *yres = res; - free(luma); - free(chroma); -} - -// grabing the osd picture - -void getosd(unsigned char *osd, int *xres, int *yres) -{ - int fb, x, y, pos, pos1, pos2, ofs; - unsigned char *lfb; - struct fb_fix_screeninfo fix_screeninfo; - struct fb_var_screeninfo var_screeninfo; - - fb = open("/dev/fb/0", O_RDWR); - if (fb == -1) - { - fb = open("/dev/fb0", O_RDWR); - if (fb == -1) - { - fprintf(stderr, "Framebuffer failed\n"); - return; - } - } - - if (ioctl(fb, FBIOGET_FSCREENINFO, &fix_screeninfo) == -1) - { - fprintf(stderr, "Framebuffer: \n"); - return; - } - - if (ioctl(fb, FBIOGET_VSCREENINFO, &var_screeninfo) == -1) - { - fprintf(stderr, "Framebuffer: \n"); - return; - } - - if (!(lfb = (unsigned char *)mmap(0, fix_screeninfo.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, fb, 0))) - { - fprintf(stderr, "Framebuffer: \n"); - return; - } - - if (var_screeninfo.bits_per_pixel == 32) - { - if (!quiet) - fprintf(stderr, "Grabbing 32bit Framebuffer ...\n"); - - // get 32bit framebuffer - pos = pos1 = pos2 = 0; - ofs = fix_screeninfo.line_length - (var_screeninfo.xres * 4); - - if (ofs == 0) // we have no offset ? so do it the easy and fast way - { - memcpy(osd, lfb, fix_screeninfo.line_length * var_screeninfo.yres); - } - else // DM7025 have an offset, so we have to do it line for line - { - unsigned char *memory; // use additional buffer to speed up especially when using hd skins - memory = (unsigned char *)malloc(fix_screeninfo.line_length * var_screeninfo.yres); - memcpy(memory, lfb, fix_screeninfo.line_length * var_screeninfo.yres); - for (y = 0; y < var_screeninfo.yres; y += 1) - memcpy(osd + y * var_screeninfo.xres * 4, memory + y * fix_screeninfo.line_length, var_screeninfo.xres * 4); - free(memory); - } - } - else if (var_screeninfo.bits_per_pixel == 16) - { - if (!quiet) - fprintf(stderr, "Grabbing 16bit Framebuffer ...\n"); - unsigned short color; - - // get 16bit framebuffer - pos = pos1 = pos2 = 0; - ofs = fix_screeninfo.line_length - (var_screeninfo.xres * 2); - for (y = 0; y < var_screeninfo.yres; y += 1) - { - for (x = 0; x < var_screeninfo.xres; x += 1) - { - color = lfb[pos2] << 8 | lfb[pos2 + 1]; - pos2 += 2; - - osd[pos1++] = BLUE565(color); // b - osd[pos1++] = GREEN565(color); // g - osd[pos1++] = RED565(color); // r - osd[pos1++] = 0x00; // tr - there is no transparency in 16bit mode - } - pos2 += ofs; - } - } - else if (var_screeninfo.bits_per_pixel == 8) - { - if (!quiet) - fprintf(stderr, "Grabbing 8bit Framebuffer ...\n"); - unsigned short color; - - // Read Color Palette directly from the main memory, because the FBIOGETCMAP is buggy on dream and didnt - // gives you the correct colortable ! - int mem_fd; - unsigned char *memory; - unsigned short rd[256], gn[256], bl[256], tr[256]; - - if ((mem_fd = open("/dev/mem", O_RDWR)) < 0) - { - fprintf(stderr, "Mainmemory: can't open /dev/mem \n"); - return; - } - - if (!(memory = (unsigned char *)mmap(0, fix_screeninfo.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, mem_fd, fix_screeninfo.smem_start - 0x1000))) - { - fprintf(stderr, "Mainmemory: \n"); - return; - } - - if (stb_type == VULCAN) // DM500/5620 stores the colors as a 16bit word with yuv values, so we have to convert :( - { - unsigned short yuv; - pos2 = 0; - for (pos1 = 16; pos1 < (256 * 2) + 16; pos1 += 2) - { - - yuv = memory[pos1] << 8 | memory[pos1 + 1]; - - rd[pos2] = CLAMP((76310 * (YFB(yuv) - 16) + 104635 * (CRFB(yuv) - 128)) >> 16); - gn[pos2] = CLAMP((76310 * (YFB(yuv) - 16) - 53294 * (CRFB(yuv) - 128) - 25690 * (CBFB(yuv) - 128)) >> 16); - bl[pos2] = CLAMP((76310 * (YFB(yuv) - 16) + 132278 * (CBFB(yuv) - 128)) >> 16); - - if (yuv == 0) // transparency is a bit tricky, there is a 2 bit blending value BFFB(yuv), but not really used - { - rd[pos2] = gn[pos2] = bl[pos2] = 0; - tr[pos2] = 0x00; - } - else - tr[pos2] = 0xFF; - - pos2++; - } - } - else if (stb_type == PALLAS) // DM70x0 stores the colors in plain rgb values - { - pos2 = 0; - for (pos1 = 32; pos1 < (256 * 4) + 32; pos1 += 4) - { - rd[pos2] = memory[pos1 + 1]; - gn[pos2] = memory[pos1 + 2]; - bl[pos2] = memory[pos1 + 3]; - tr[pos2] = memory[pos1]; - pos2++; - } - } - else - { - fprintf(stderr, "unsupported framebuffermode\n"); - return; - } - close(mem_fd); - - // get 8bit framebuffer - pos = pos1 = pos2 = 0; - ofs = fix_screeninfo.line_length - (var_screeninfo.xres); - for (y = 0; y < var_screeninfo.yres; y += 1) - { - for (x = 0; x < var_screeninfo.xres; x += 1) - { - color = lfb[pos2++]; - - osd[pos1++] = bl[color]; // b - osd[pos1++] = gn[color]; // g - osd[pos1++] = rd[color]; // r - osd[pos1++] = tr[color]; // tr - } - pos2 += ofs; - } - } - close(fb); - - *xres = var_screeninfo.xres; - *yres = var_screeninfo.yres; - if (!quiet) - fprintf(stderr, "Framebuffer-Size : %d x %d\n", *xres, *yres); -} - -// bicubic pixmap resizing - -void smooth_resize(const unsigned char *source, unsigned char *dest, int xsource, int ysource, int xdest, int ydest, int colors) -{ - const unsigned int xs = xsource; // x-resolution source - const unsigned int ys = ysource; // y-resolution source - const unsigned int xd = xdest; // x-resolution destination - const unsigned int yd = ydest; // y-resolution destination - - unsigned int sx1[xd]; - unsigned int sx2[xd]; - // get x scale factor, use bitshifting to get rid of floats - const int fx = ((xs - 1) << 16) / xd; - // get y scale factor, use bitshifting to get rid of floats - const int fy = ((ys - 1) << 16) / yd; - - { - // pre calculating sx1/sx2 for faster resizing - int x; - for (x = 0; x < xd; x++) - { - // first x source pixel for calculating destination pixel - sx1[x] = (fx * x) >> 16; //floor() - - // last x source pixel for calculating destination pixel - sx2[x] = sx1[x] + (fx >> 16); - if (fx & 0x7FFF) //ceil() - sx2[x]++; - } - } - - // Scale - int y; - #pragma omp parallel for shared(sx1, sx2, source, dest) - for (y = 0; y < yd; y++) - { - unsigned int dpixel; - unsigned int c, tmp_i; - int t, t1; - - // first y source pixel for calculating destination pixel - const unsigned int sy1 = (fy * y) >> 16; //floor() - // last y source pixel for calculating destination pixel - unsigned int sy2 = sy1 + (fy >> 16); - if (fy & 0x7FFF) //ceil() - sy2++; - - int x; - for (x = 0; x < xd; x++) - { - // we do this for every color - for (c = 0; c < colors; c++) - { - // calculationg destination pixel - tmp_i = 0; - dpixel = 0; - - for (t1 = sy1; t1 < sy2; t1++) - { - for (t = sx1[x]; t <= sx2[x]; t++) - { - tmp_i += (int)source[(t * colors) + c + (t1 * xs * colors)]; - dpixel++; - } - } - // writing calculated pixel into destination pixmap - dest[(x * colors) + c + (y * xd * colors)] = tmp_i / dpixel; - } - } - } -} - -// "nearest neighbor" pixmap resizing -void fast_resize(const unsigned char *source, unsigned char *dest, int xsource, int ysource, int xdest, int ydest, int colors) -{ - const int x_ratio = (int)((xsource << 16) / xdest) ; - const int y_ratio = (int)((ysource << 16) / ydest) ; - int i; - #pragma omp parallel for shared (dest, source) - for (i = 0; i < ydest; i++) - { - int y2_xsource = ((i * y_ratio) >> 16) * xsource; // do some precalculations - int i_xdest = i * xdest; - int j; - for (j = 0; j < xdest; j++) - { - int x2 = ((j * x_ratio) >> 16) ; - int y2_x2_colors = (y2_xsource + x2) * colors; - int i_x_colors = (i_xdest + j) * colors; - int c; - for (c = 0; c < colors; c++) - dest[i_x_colors + c] = source[y2_x2_colors + c] ; - } - } -} - -// combining pixmaps by using an alphamap -void combine(unsigned char *output, const unsigned char *video, const unsigned char *osd, int vleft, int vtop, int vwidth, int vheight, int xres, int yres) -{ - const int vbottom = vtop + vheight; - const int vright = vleft + vwidth; - int y; - for (y = 0; y < vtop; y++) - { - int pos1 = y * xres * 4; - int vpos1 = y * xres * 3; - int x; - for (x = 0; x < xres; x++) - { - const int apos = pos1 + 3; - output[vpos1++] = ((osd[pos1++] * osd[apos])) >> 8; - output[vpos1++] = ((osd[pos1++] * osd[apos])) >> 8; - output[vpos1++] = ((osd[pos1++] * osd[apos])) >> 8; - pos1++; // skip alpha byte - } - } - #pragma omp parallel for - for (y = vtop; y < vbottom; y++) - { - int pos1 = y * xres * 4; - int vpos1 = y * xres * 3; - int x; - for (x = 0; x < vleft; x++) - { - int apos = pos1 + 3; - output[vpos1++] = ((osd[pos1++] * osd[apos])) >> 8; - output[vpos1++] = ((osd[pos1++] * osd[apos])) >> 8; - output[vpos1++] = ((osd[pos1++] * osd[apos])) >> 8; - pos1++; // skip alpha byte - } - for (x = vleft; x < vright; x++) - { - int apos = pos1 + 3; - int a2 = 0xFF - osd[apos]; - int pixel = ((y - vtop) * vwidth + (x - vleft)) * 3; - output[vpos1++] = ((video[pixel + 0] * a2) + (osd[pos1++] * osd[apos])) >> 8; - output[vpos1++] = ((video[pixel + 1] * a2) + (osd[pos1++] * osd[apos])) >> 8; - output[vpos1++] = ((video[pixel + 2] * a2) + (osd[pos1++] * osd[apos])) >> 8; - pos1++; // skip alpha byte - } - for (x = vright; x < xres; x++) - { - int apos = pos1 + 3; - output[vpos1++] = ((osd[pos1++] * osd[apos])) >> 8; - output[vpos1++] = ((osd[pos1++] * osd[apos])) >> 8; - output[vpos1++] = ((osd[pos1++] * osd[apos])) >> 8; - pos1++; // skip alpha byte - } - } - for (y = vbottom; y < yres; y++) - { - int pos1 = y * xres * 4; - int vpos1 = y * xres * 3; - int x; - for (x = 0; x < xres; x++) - { - int apos = pos1 + 3; - output[vpos1++] = ((osd[pos1++] * osd[apos])) >> 8; - output[vpos1++] = ((osd[pos1++] * osd[apos])) >> 8; - output[vpos1++] = ((osd[pos1++] * osd[apos])) >> 8; - pos1++; // skip alpha byte - } - } -} diff --git a/aio-grab-arm/AUTHORS b/aio-grab/AUTHORS similarity index 100% rename from aio-grab-arm/AUTHORS rename to aio-grab/AUTHORS diff --git a/aio-grab-arm/ChangeLog b/aio-grab/ChangeLog similarity index 100% rename from aio-grab-arm/ChangeLog rename to aio-grab/ChangeLog diff --git a/aio-grab-arm/Makefile.am b/aio-grab/Makefile.am similarity index 100% rename from aio-grab-arm/Makefile.am rename to aio-grab/Makefile.am diff --git a/aio-grab-arm/NEWS b/aio-grab/NEWS similarity index 100% rename from aio-grab-arm/NEWS rename to aio-grab/NEWS diff --git a/aio-grab-arm/README b/aio-grab/README similarity index 100% rename from aio-grab-arm/README rename to aio-grab/README diff --git a/aio-grab-arm/autogen.sh b/aio-grab/autogen.sh similarity index 100% rename from aio-grab-arm/autogen.sh rename to aio-grab/autogen.sh diff --git a/aio-grab-arm/configure.ac b/aio-grab/configure.ac similarity index 100% rename from aio-grab-arm/configure.ac rename to aio-grab/configure.ac diff --git a/aio-grab/grab b/aio-grab/grab new file mode 100755 index 0000000..8d772cb Binary files /dev/null and b/aio-grab/grab differ diff --git a/aio-grab-arm/main.c b/aio-grab/main.c similarity index 100% rename from aio-grab-arm/main.c rename to aio-grab/main.c diff --git a/aio-grab/main.org b/aio-grab/main.org new file mode 100644 index 0000000..e05c78c --- /dev/null +++ b/aio-grab/main.org @@ -0,0 +1,2523 @@ +/* +AiO stb screengrabber + +Based on the work of Seddi +Contact: seddi@ihad.tv / http://www.ihad.tv + +This standalone binary will grab the video-picture convert it from +yuv to rgb and resize it, if neccesary, to the same size as the framebuffer or +vice versa. For the DM7025 (Xilleon) and DM800/DM8000/DM500HD (Broadcom) the video will be +grabbed directly from the decoder memory. +It also grabs the framebuffer picture in 32Bit, 16Bit or in 8Bit mode with the +correct colortable in 8Bit mode from the main graphics memory, because the +FBIOGETCMAP is buggy on Vulcan/Pallas boxes and didnt give you the correct color +map. +Finally it will combine the pixmaps to one final picture by using the framebuffer +alphamap and save it as bmp, jpeg or png file. So you will get the same picture +as you can see on your TV Screen. + +There are a few command line switches, use "grab -h" to get them listed. + +A special Thanx to tmbinc and ghost for the needed decoder memory information and +the great support. + +Feel free to use the code for your own projects. See LICENSE file for details. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(__sh__) +#include +#include +#endif + +#include "png.h" +#include "jpeglib.h" + +#if defined(__sh__) + +#define OUT(x) \ + out[OUTITER]=(unsigned char)*(decode_surface + x)&0xFF; \ + OUTITER+=OUTINC; + +#define OUT4(x) \ + OUT(x + 0x03); \ + OUT(x + 0x02); \ + OUT(x + 0x01); \ + OUT(x + 0x00); + +#define OUT8(x) \ + OUT4(x + 0x04); \ + OUT4(x + 0x00); + +#define OUT_LU_16A(x) \ + OUT8(x); \ + OUT8(x + 0x40); + +#define OUT_CH_8A(x) \ + OUT4(x); \ + OUT4(x + 0x20); + +//pppppppppppppppp +//x: macroblock address +//l: line 0-15 +#define OUT_LU_16(x,l) \ + OUT_LU_16A(x + (l/4) * 0x10 + (l%2) * 0x80 + ((l/2)%2?0x00:0x08)); + +//pppppppp +//x: macroblock address +//l: line 0-7 +//b: 0=cr 1=cb +#define OUT_CH_8(x,l,b) \ + OUT_CH_8A(x + (l/4) * 0x10 + (l%2) * 0x40 + ((l/2)%2?0x00:0x08) + (b?0x04:0x00)); + +#endif + +#define CLAMP(x) ((x < 0) ? 0 : ((x > 255) ? 255 : x)) +#define SWAP(x,y) { x ^= y; y ^= x; x ^= y; } + +#define RED565(x) ((((x) >> (11 )) & 0x1f) << 3) +#define GREEN565(x) ((((x) >> (5 )) & 0x3f) << 2) +#define BLUE565(x) ((((x) >> (0)) & 0x1f) << 3) + +#define YFB(x) ((((x) >> (10)) & 0x3f) << 2) +#define CBFB(x) ((((x) >> (6)) & 0xf) << 4) +#define CRFB(x) ((((x) >> (2)) & 0xf) << 4) +#define BFFB(x) ((((x) >> (0)) & 0x3) << 6) + +#if defined(__sh__) +int timeval_subtract (struct timeval *result, struct timeval *x, struct timeval *y) +{ + /* Perform the carry for the later subtraction by updating y. */ + if (x->tv_usec < y->tv_usec) { + int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1; + y->tv_usec -= 1000000 * nsec; + y->tv_sec += nsec; + } + if (x->tv_usec - y->tv_usec > 1000000) { + int nsec = (x->tv_usec - y->tv_usec) / 1000000; + y->tv_usec += 1000000 * nsec; + y->tv_sec -= nsec; + } + + /* Compute the time remaining to wait. + tv_usec is certainly positive. */ + result->tv_sec = x->tv_sec - y->tv_sec; + result->tv_usec = x->tv_usec - y->tv_usec; + + /* Return 1 if result is negative. */ + return x->tv_sec < y->tv_sec; +} +#endif + +#define VIDEO_DEV "/dev/video" + +// dont change SPARE_RAM and DMA_BLOCKSIZE until you really know what you are doing !!! +#define SPARE_RAM 252*1024*1024 // the last 4 MB is enough... +#define DMA_BLOCKSIZE 0x3FF000 // should be big enough to hold a complete YUV 1920x1080 HD picture, otherwise it will not work properly on DM8000 + +// static lookup tables for faster yuv2rgb conversion +static const int yuv2rgbtable_y[256] = { +0xFFED5EA0, 0xFFEE88B6, 0xFFEFB2CC, 0xFFF0DCE2, 0xFFF206F8, 0xFFF3310E, 0xFFF45B24, 0xFFF5853A, 0xFFF6AF50, 0xFFF7D966, 0xFFF9037C, 0xFFFA2D92, 0xFFFB57A8, 0xFFFC81BE, 0xFFFDABD4, 0xFFFED5EA, 0x0, 0x12A16, 0x2542C, 0x37E42, 0x4A858, 0x5D26E, 0x6FC84, 0x8269A, 0x950B0, 0xA7AC6, 0xBA4DC, 0xCCEF2, 0xDF908, 0xF231E, 0x104D34, 0x11774A, 0x12A160, 0x13CB76, 0x14F58C, 0x161FA2, 0x1749B8, 0x1873CE, 0x199DE4, 0x1AC7FA, 0x1BF210, 0x1D1C26, 0x1E463C, 0x1F7052, 0x209A68, 0x21C47E, 0x22EE94, 0x2418AA, 0x2542C0, 0x266CD6, 0x2796EC, 0x28C102, 0x29EB18, 0x2B152E, 0x2C3F44, 0x2D695A, 0x2E9370, 0x2FBD86, 0x30E79C, 0x3211B2, 0x333BC8, 0x3465DE, 0x358FF4, 0x36BA0A, 0x37E420, 0x390E36, 0x3A384C, 0x3B6262, 0x3C8C78, 0x3DB68E, 0x3EE0A4, 0x400ABA, 0x4134D0, 0x425EE6, 0x4388FC, 0x44B312, 0x45DD28, 0x47073E, 0x483154, 0x495B6A, 0x4A8580, 0x4BAF96, 0x4CD9AC, 0x4E03C2, 0x4F2DD8, 0x5057EE, 0x518204, 0x52AC1A, 0x53D630, 0x550046, 0x562A5C, 0x575472, 0x587E88, 0x59A89E, 0x5AD2B4, 0x5BFCCA, 0x5D26E0, 0x5E50F6, 0x5F7B0C, 0x60A522, 0x61CF38, 0x62F94E, 0x642364, 0x654D7A, 0x667790, 0x67A1A6, 0x68CBBC, 0x69F5D2, 0x6B1FE8, 0x6C49FE, 0x6D7414, 0x6E9E2A, 0x6FC840, 0x70F256, 0x721C6C, 0x734682, 0x747098, 0x759AAE, 0x76C4C4, 0x77EEDA, 0x7918F0, 0x7A4306, 0x7B6D1C, 0x7C9732, 0x7DC148, 0x7EEB5E, 0x801574, 0x813F8A, 0x8269A0, 0x8393B6, 0x84BDCC, 0x85E7E2, 0x8711F8, 0x883C0E, 0x896624, 0x8A903A, 0x8BBA50, 0x8CE466, 0x8E0E7C, 0x8F3892, 0x9062A8, 0x918CBE, 0x92B6D4, 0x93E0EA, 0x950B00, 0x963516, 0x975F2C, 0x988942, 0x99B358, 0x9ADD6E, 0x9C0784, 0x9D319A, 0x9E5BB0, 0x9F85C6, 0xA0AFDC, 0xA1D9F2, 0xA30408, 0xA42E1E, 0xA55834, 0xA6824A, 0xA7AC60, 0xA8D676, 0xAA008C, 0xAB2AA2, 0xAC54B8, 0xAD7ECE, 0xAEA8E4, 0xAFD2FA, 0xB0FD10, 0xB22726, 0xB3513C, 0xB47B52, 0xB5A568, 0xB6CF7E, 0xB7F994, 0xB923AA, 0xBA4DC0, 0xBB77D6, 0xBCA1EC, 0xBDCC02, 0xBEF618, 0xC0202E, 0xC14A44, 0xC2745A, 0xC39E70, 0xC4C886, 0xC5F29C, 0xC71CB2, 0xC846C8, 0xC970DE, 0xCA9AF4, 0xCBC50A, 0xCCEF20, 0xCE1936, 0xCF434C, 0xD06D62, 0xD19778, 0xD2C18E, 0xD3EBA4, 0xD515BA, 0xD63FD0, 0xD769E6, 0xD893FC, 0xD9BE12, 0xDAE828, 0xDC123E, 0xDD3C54, 0xDE666A, 0xDF9080, 0xE0BA96, 0xE1E4AC, 0xE30EC2, 0xE438D8, 0xE562EE, 0xE68D04, 0xE7B71A, 0xE8E130, 0xEA0B46, 0xEB355C, 0xEC5F72, 0xED8988, 0xEEB39E, 0xEFDDB4, 0xF107CA, 0xF231E0, 0xF35BF6, 0xF4860C, 0xF5B022, 0xF6DA38, 0xF8044E, 0xF92E64, 0xFA587A, 0xFB8290, 0xFCACA6, 0xFDD6BC, 0xFF00D2, 0x1002AE8, 0x10154FE, 0x1027F14, 0x103A92A, 0x104D340, 0x105FD56, 0x107276C, 0x1085182, 0x1097B98, 0x10AA5AE, 0x10BCFC4, 0x10CF9DA, 0x10E23F0, 0x10F4E06, 0x110781C, 0x111A232, 0x112CC48, 0x113F65E, 0x1152074, 0x1164A8A +}; +static const int yuv2rgbtable_ru[256] = { +0xFEFDA500, 0xFEFFA9B6, 0xFF01AE6C, 0xFF03B322, 0xFF05B7D8, 0xFF07BC8E, 0xFF09C144, 0xFF0BC5FA, 0xFF0DCAB0, 0xFF0FCF66, 0xFF11D41C, 0xFF13D8D2, 0xFF15DD88, 0xFF17E23E, 0xFF19E6F4, 0xFF1BEBAA, 0xFF1DF060, 0xFF1FF516, 0xFF21F9CC, 0xFF23FE82, 0xFF260338, 0xFF2807EE, 0xFF2A0CA4, 0xFF2C115A, 0xFF2E1610, 0xFF301AC6, 0xFF321F7C, 0xFF342432, 0xFF3628E8, 0xFF382D9E, 0xFF3A3254, 0xFF3C370A, 0xFF3E3BC0, 0xFF404076, 0xFF42452C, 0xFF4449E2, 0xFF464E98, 0xFF48534E, 0xFF4A5804, 0xFF4C5CBA, 0xFF4E6170, 0xFF506626, 0xFF526ADC, 0xFF546F92, 0xFF567448, 0xFF5878FE, 0xFF5A7DB4, 0xFF5C826A, 0xFF5E8720, 0xFF608BD6, 0xFF62908C, 0xFF649542, 0xFF6699F8, 0xFF689EAE, 0xFF6AA364, 0xFF6CA81A, 0xFF6EACD0, 0xFF70B186, 0xFF72B63C, 0xFF74BAF2, 0xFF76BFA8, 0xFF78C45E, 0xFF7AC914, 0xFF7CCDCA, 0xFF7ED280, 0xFF80D736, 0xFF82DBEC, 0xFF84E0A2, 0xFF86E558, 0xFF88EA0E, 0xFF8AEEC4, 0xFF8CF37A, 0xFF8EF830, 0xFF90FCE6, 0xFF93019C, 0xFF950652, 0xFF970B08, 0xFF990FBE, 0xFF9B1474, 0xFF9D192A, 0xFF9F1DE0, 0xFFA12296, 0xFFA3274C, 0xFFA52C02, 0xFFA730B8, 0xFFA9356E, 0xFFAB3A24, 0xFFAD3EDA, 0xFFAF4390, 0xFFB14846, 0xFFB34CFC, 0xFFB551B2, 0xFFB75668, 0xFFB95B1E, 0xFFBB5FD4, 0xFFBD648A, 0xFFBF6940, 0xFFC16DF6, 0xFFC372AC, 0xFFC57762, 0xFFC77C18, 0xFFC980CE, 0xFFCB8584, 0xFFCD8A3A, 0xFFCF8EF0, 0xFFD193A6, 0xFFD3985C, 0xFFD59D12, 0xFFD7A1C8, 0xFFD9A67E, 0xFFDBAB34, 0xFFDDAFEA, 0xFFDFB4A0, 0xFFE1B956, 0xFFE3BE0C, 0xFFE5C2C2, 0xFFE7C778, 0xFFE9CC2E, 0xFFEBD0E4, 0xFFEDD59A, 0xFFEFDA50, 0xFFF1DF06, 0xFFF3E3BC, 0xFFF5E872, 0xFFF7ED28, 0xFFF9F1DE, 0xFFFBF694, 0xFFFDFB4A, 0x0, 0x204B6, 0x4096C, 0x60E22, 0x812D8, 0xA178E, 0xC1C44, 0xE20FA, 0x1025B0, 0x122A66, 0x142F1C, 0x1633D2, 0x183888, 0x1A3D3E, 0x1C41F4, 0x1E46AA, 0x204B60, 0x225016, 0x2454CC, 0x265982, 0x285E38, 0x2A62EE, 0x2C67A4, 0x2E6C5A, 0x307110, 0x3275C6, 0x347A7C, 0x367F32, 0x3883E8, 0x3A889E, 0x3C8D54, 0x3E920A, 0x4096C0, 0x429B76, 0x44A02C, 0x46A4E2, 0x48A998, 0x4AAE4E, 0x4CB304, 0x4EB7BA, 0x50BC70, 0x52C126, 0x54C5DC, 0x56CA92, 0x58CF48, 0x5AD3FE, 0x5CD8B4, 0x5EDD6A, 0x60E220, 0x62E6D6, 0x64EB8C, 0x66F042, 0x68F4F8, 0x6AF9AE, 0x6CFE64, 0x6F031A, 0x7107D0, 0x730C86, 0x75113C, 0x7715F2, 0x791AA8, 0x7B1F5E, 0x7D2414, 0x7F28CA, 0x812D80, 0x833236, 0x8536EC, 0x873BA2, 0x894058, 0x8B450E, 0x8D49C4, 0x8F4E7A, 0x915330, 0x9357E6, 0x955C9C, 0x976152, 0x996608, 0x9B6ABE, 0x9D6F74, 0x9F742A, 0xA178E0, 0xA37D96, 0xA5824C, 0xA78702, 0xA98BB8, 0xAB906E, 0xAD9524, 0xAF99DA, 0xB19E90, 0xB3A346, 0xB5A7FC, 0xB7ACB2, 0xB9B168, 0xBBB61E, 0xBDBAD4, 0xBFBF8A, 0xC1C440, 0xC3C8F6, 0xC5CDAC, 0xC7D262, 0xC9D718, 0xCBDBCE, 0xCDE084, 0xCFE53A, 0xD1E9F0, 0xD3EEA6, 0xD5F35C, 0xD7F812, 0xD9FCC8, 0xDC017E, 0xDE0634, 0xE00AEA, 0xE20FA0, 0xE41456, 0xE6190C, 0xE81DC2, 0xEA2278, 0xEC272E, 0xEE2BE4, 0xF0309A, 0xF23550, 0xF43A06, 0xF63EBC, 0xF84372, 0xFA4828, 0xFC4CDE, 0xFE5194, 0x100564A +}; +static const int yuv2rgbtable_gu[256] = { +0xFFCDD300, 0xFFCE375A, 0xFFCE9BB4, 0xFFCF000E, 0xFFCF6468, 0xFFCFC8C2, 0xFFD02D1C, 0xFFD09176, 0xFFD0F5D0, 0xFFD15A2A, 0xFFD1BE84, 0xFFD222DE, 0xFFD28738, 0xFFD2EB92, 0xFFD34FEC, 0xFFD3B446, 0xFFD418A0, 0xFFD47CFA, 0xFFD4E154, 0xFFD545AE, 0xFFD5AA08, 0xFFD60E62, 0xFFD672BC, 0xFFD6D716, 0xFFD73B70, 0xFFD79FCA, 0xFFD80424, 0xFFD8687E, 0xFFD8CCD8, 0xFFD93132, 0xFFD9958C, 0xFFD9F9E6, 0xFFDA5E40, 0xFFDAC29A, 0xFFDB26F4, 0xFFDB8B4E, 0xFFDBEFA8, 0xFFDC5402, 0xFFDCB85C, 0xFFDD1CB6, 0xFFDD8110, 0xFFDDE56A, 0xFFDE49C4, 0xFFDEAE1E, 0xFFDF1278, 0xFFDF76D2, 0xFFDFDB2C, 0xFFE03F86, 0xFFE0A3E0, 0xFFE1083A, 0xFFE16C94, 0xFFE1D0EE, 0xFFE23548, 0xFFE299A2, 0xFFE2FDFC, 0xFFE36256, 0xFFE3C6B0, 0xFFE42B0A, 0xFFE48F64, 0xFFE4F3BE, 0xFFE55818, 0xFFE5BC72, 0xFFE620CC, 0xFFE68526, 0xFFE6E980, 0xFFE74DDA, 0xFFE7B234, 0xFFE8168E, 0xFFE87AE8, 0xFFE8DF42, 0xFFE9439C, 0xFFE9A7F6, 0xFFEA0C50, 0xFFEA70AA, 0xFFEAD504, 0xFFEB395E, 0xFFEB9DB8, 0xFFEC0212, 0xFFEC666C, 0xFFECCAC6, 0xFFED2F20, 0xFFED937A, 0xFFEDF7D4, 0xFFEE5C2E, 0xFFEEC088, 0xFFEF24E2, 0xFFEF893C, 0xFFEFED96, 0xFFF051F0, 0xFFF0B64A, 0xFFF11AA4, 0xFFF17EFE, 0xFFF1E358, 0xFFF247B2, 0xFFF2AC0C, 0xFFF31066, 0xFFF374C0, 0xFFF3D91A, 0xFFF43D74, 0xFFF4A1CE, 0xFFF50628, 0xFFF56A82, 0xFFF5CEDC, 0xFFF63336, 0xFFF69790, 0xFFF6FBEA, 0xFFF76044, 0xFFF7C49E, 0xFFF828F8, 0xFFF88D52, 0xFFF8F1AC, 0xFFF95606, 0xFFF9BA60, 0xFFFA1EBA, 0xFFFA8314, 0xFFFAE76E, 0xFFFB4BC8, 0xFFFBB022, 0xFFFC147C, 0xFFFC78D6, 0xFFFCDD30, 0xFFFD418A, 0xFFFDA5E4, 0xFFFE0A3E, 0xFFFE6E98, 0xFFFED2F2, 0xFFFF374C, 0xFFFF9BA6, 0x0, 0x645A, 0xC8B4, 0x12D0E, 0x19168, 0x1F5C2, 0x25A1C, 0x2BE76, 0x322D0, 0x3872A, 0x3EB84, 0x44FDE, 0x4B438, 0x51892, 0x57CEC, 0x5E146, 0x645A0, 0x6A9FA, 0x70E54, 0x772AE, 0x7D708, 0x83B62, 0x89FBC, 0x90416, 0x96870, 0x9CCCA, 0xA3124, 0xA957E, 0xAF9D8, 0xB5E32, 0xBC28C, 0xC26E6, 0xC8B40, 0xCEF9A, 0xD53F4, 0xDB84E, 0xE1CA8, 0xE8102, 0xEE55C, 0xF49B6, 0xFAE10, 0x10126A, 0x1076C4, 0x10DB1E, 0x113F78, 0x11A3D2, 0x12082C, 0x126C86, 0x12D0E0, 0x13353A, 0x139994, 0x13FDEE, 0x146248, 0x14C6A2, 0x152AFC, 0x158F56, 0x15F3B0, 0x16580A, 0x16BC64, 0x1720BE, 0x178518, 0x17E972, 0x184DCC, 0x18B226, 0x191680, 0x197ADA, 0x19DF34, 0x1A438E, 0x1AA7E8, 0x1B0C42, 0x1B709C, 0x1BD4F6, 0x1C3950, 0x1C9DAA, 0x1D0204, 0x1D665E, 0x1DCAB8, 0x1E2F12, 0x1E936C, 0x1EF7C6, 0x1F5C20, 0x1FC07A, 0x2024D4, 0x20892E, 0x20ED88, 0x2151E2, 0x21B63C, 0x221A96, 0x227EF0, 0x22E34A, 0x2347A4, 0x23ABFE, 0x241058, 0x2474B2, 0x24D90C, 0x253D66, 0x25A1C0, 0x26061A, 0x266A74, 0x26CECE, 0x273328, 0x279782, 0x27FBDC, 0x286036, 0x28C490, 0x2928EA, 0x298D44, 0x29F19E, 0x2A55F8, 0x2ABA52, 0x2B1EAC, 0x2B8306, 0x2BE760, 0x2C4BBA, 0x2CB014, 0x2D146E, 0x2D78C8, 0x2DDD22, 0x2E417C, 0x2EA5D6, 0x2F0A30, 0x2F6E8A, 0x2FD2E4, 0x30373E, 0x309B98, 0x30FFF2, 0x31644C, 0x31C8A6 +}; +static const int yuv2rgbtable_gv[256] = { +0xFF97E900, 0xFF98B92E, 0xFF99895C, 0xFF9A598A, 0xFF9B29B8, 0xFF9BF9E6, 0xFF9CCA14, 0xFF9D9A42, 0xFF9E6A70, 0xFF9F3A9E, 0xFFA00ACC, 0xFFA0DAFA, 0xFFA1AB28, 0xFFA27B56, 0xFFA34B84, 0xFFA41BB2, 0xFFA4EBE0, 0xFFA5BC0E, 0xFFA68C3C, 0xFFA75C6A, 0xFFA82C98, 0xFFA8FCC6, 0xFFA9CCF4, 0xFFAA9D22, 0xFFAB6D50, 0xFFAC3D7E, 0xFFAD0DAC, 0xFFADDDDA, 0xFFAEAE08, 0xFFAF7E36, 0xFFB04E64, 0xFFB11E92, 0xFFB1EEC0, 0xFFB2BEEE, 0xFFB38F1C, 0xFFB45F4A, 0xFFB52F78, 0xFFB5FFA6, 0xFFB6CFD4, 0xFFB7A002, 0xFFB87030, 0xFFB9405E, 0xFFBA108C, 0xFFBAE0BA, 0xFFBBB0E8, 0xFFBC8116, 0xFFBD5144, 0xFFBE2172, 0xFFBEF1A0, 0xFFBFC1CE, 0xFFC091FC, 0xFFC1622A, 0xFFC23258, 0xFFC30286, 0xFFC3D2B4, 0xFFC4A2E2, 0xFFC57310, 0xFFC6433E, 0xFFC7136C, 0xFFC7E39A, 0xFFC8B3C8, 0xFFC983F6, 0xFFCA5424, 0xFFCB2452, 0xFFCBF480, 0xFFCCC4AE, 0xFFCD94DC, 0xFFCE650A, 0xFFCF3538, 0xFFD00566, 0xFFD0D594, 0xFFD1A5C2, 0xFFD275F0, 0xFFD3461E, 0xFFD4164C, 0xFFD4E67A, 0xFFD5B6A8, 0xFFD686D6, 0xFFD75704, 0xFFD82732, 0xFFD8F760, 0xFFD9C78E, 0xFFDA97BC, 0xFFDB67EA, 0xFFDC3818, 0xFFDD0846, 0xFFDDD874, 0xFFDEA8A2, 0xFFDF78D0, 0xFFE048FE, 0xFFE1192C, 0xFFE1E95A, 0xFFE2B988, 0xFFE389B6, 0xFFE459E4, 0xFFE52A12, 0xFFE5FA40, 0xFFE6CA6E, 0xFFE79A9C, 0xFFE86ACA, 0xFFE93AF8, 0xFFEA0B26, 0xFFEADB54, 0xFFEBAB82, 0xFFEC7BB0, 0xFFED4BDE, 0xFFEE1C0C, 0xFFEEEC3A, 0xFFEFBC68, 0xFFF08C96, 0xFFF15CC4, 0xFFF22CF2, 0xFFF2FD20, 0xFFF3CD4E, 0xFFF49D7C, 0xFFF56DAA, 0xFFF63DD8, 0xFFF70E06, 0xFFF7DE34, 0xFFF8AE62, 0xFFF97E90, 0xFFFA4EBE, 0xFFFB1EEC, 0xFFFBEF1A, 0xFFFCBF48, 0xFFFD8F76, 0xFFFE5FA4, 0xFFFF2FD2, 0x0, 0xD02E, 0x1A05C, 0x2708A, 0x340B8, 0x410E6, 0x4E114, 0x5B142, 0x68170, 0x7519E, 0x821CC, 0x8F1FA, 0x9C228, 0xA9256, 0xB6284, 0xC32B2, 0xD02E0, 0xDD30E, 0xEA33C, 0xF736A, 0x104398, 0x1113C6, 0x11E3F4, 0x12B422, 0x138450, 0x14547E, 0x1524AC, 0x15F4DA, 0x16C508, 0x179536, 0x186564, 0x193592, 0x1A05C0, 0x1AD5EE, 0x1BA61C, 0x1C764A, 0x1D4678, 0x1E16A6, 0x1EE6D4, 0x1FB702, 0x208730, 0x21575E, 0x22278C, 0x22F7BA, 0x23C7E8, 0x249816, 0x256844, 0x263872, 0x2708A0, 0x27D8CE, 0x28A8FC, 0x29792A, 0x2A4958, 0x2B1986, 0x2BE9B4, 0x2CB9E2, 0x2D8A10, 0x2E5A3E, 0x2F2A6C, 0x2FFA9A, 0x30CAC8, 0x319AF6, 0x326B24, 0x333B52, 0x340B80, 0x34DBAE, 0x35ABDC, 0x367C0A, 0x374C38, 0x381C66, 0x38EC94, 0x39BCC2, 0x3A8CF0, 0x3B5D1E, 0x3C2D4C, 0x3CFD7A, 0x3DCDA8, 0x3E9DD6, 0x3F6E04, 0x403E32, 0x410E60, 0x41DE8E, 0x42AEBC, 0x437EEA, 0x444F18, 0x451F46, 0x45EF74, 0x46BFA2, 0x478FD0, 0x485FFE, 0x49302C, 0x4A005A, 0x4AD088, 0x4BA0B6, 0x4C70E4, 0x4D4112, 0x4E1140, 0x4EE16E, 0x4FB19C, 0x5081CA, 0x5151F8, 0x522226, 0x52F254, 0x53C282, 0x5492B0, 0x5562DE, 0x56330C, 0x57033A, 0x57D368, 0x58A396, 0x5973C4, 0x5A43F2, 0x5B1420, 0x5BE44E, 0x5CB47C, 0x5D84AA, 0x5E54D8, 0x5F2506, 0x5FF534, 0x60C562, 0x619590, 0x6265BE, 0x6335EC, 0x64061A, 0x64D648, 0x65A676, 0x6676A4, 0x6746D2 +}; +static const int yuv2rgbtable_bv[256] = { +0xFF33A280, 0xFF353B3B, 0xFF36D3F6, 0xFF386CB1, 0xFF3A056C, 0xFF3B9E27, 0xFF3D36E2, 0xFF3ECF9D, 0xFF406858, 0xFF420113, 0xFF4399CE, 0xFF453289, 0xFF46CB44, 0xFF4863FF, 0xFF49FCBA, 0xFF4B9575, 0xFF4D2E30, 0xFF4EC6EB, 0xFF505FA6, 0xFF51F861, 0xFF53911C, 0xFF5529D7, 0xFF56C292, 0xFF585B4D, 0xFF59F408, 0xFF5B8CC3, 0xFF5D257E, 0xFF5EBE39, 0xFF6056F4, 0xFF61EFAF, 0xFF63886A, 0xFF652125, 0xFF66B9E0, 0xFF68529B, 0xFF69EB56, 0xFF6B8411, 0xFF6D1CCC, 0xFF6EB587, 0xFF704E42, 0xFF71E6FD, 0xFF737FB8, 0xFF751873, 0xFF76B12E, 0xFF7849E9, 0xFF79E2A4, 0xFF7B7B5F, 0xFF7D141A, 0xFF7EACD5, 0xFF804590, 0xFF81DE4B, 0xFF837706, 0xFF850FC1, 0xFF86A87C, 0xFF884137, 0xFF89D9F2, 0xFF8B72AD, 0xFF8D0B68, 0xFF8EA423, 0xFF903CDE, 0xFF91D599, 0xFF936E54, 0xFF95070F, 0xFF969FCA, 0xFF983885, 0xFF99D140, 0xFF9B69FB, 0xFF9D02B6, 0xFF9E9B71, 0xFFA0342C, 0xFFA1CCE7, 0xFFA365A2, 0xFFA4FE5D, 0xFFA69718, 0xFFA82FD3, 0xFFA9C88E, 0xFFAB6149, 0xFFACFA04, 0xFFAE92BF, 0xFFB02B7A, 0xFFB1C435, 0xFFB35CF0, 0xFFB4F5AB, 0xFFB68E66, 0xFFB82721, 0xFFB9BFDC, 0xFFBB5897, 0xFFBCF152, 0xFFBE8A0D, 0xFFC022C8, 0xFFC1BB83, 0xFFC3543E, 0xFFC4ECF9, 0xFFC685B4, 0xFFC81E6F, 0xFFC9B72A, 0xFFCB4FE5, 0xFFCCE8A0, 0xFFCE815B, 0xFFD01A16, 0xFFD1B2D1, 0xFFD34B8C, 0xFFD4E447, 0xFFD67D02, 0xFFD815BD, 0xFFD9AE78, 0xFFDB4733, 0xFFDCDFEE, 0xFFDE78A9, 0xFFE01164, 0xFFE1AA1F, 0xFFE342DA, 0xFFE4DB95, 0xFFE67450, 0xFFE80D0B, 0xFFE9A5C6, 0xFFEB3E81, 0xFFECD73C, 0xFFEE6FF7, 0xFFF008B2, 0xFFF1A16D, 0xFFF33A28, 0xFFF4D2E3, 0xFFF66B9E, 0xFFF80459, 0xFFF99D14, 0xFFFB35CF, 0xFFFCCE8A, 0xFFFE6745, 0x0, 0x198BB, 0x33176, 0x4CA31, 0x662EC, 0x7FBA7, 0x99462, 0xB2D1D, 0xCC5D8, 0xE5E93, 0xFF74E, 0x119009, 0x1328C4, 0x14C17F, 0x165A3A, 0x17F2F5, 0x198BB0, 0x1B246B, 0x1CBD26, 0x1E55E1, 0x1FEE9C, 0x218757, 0x232012, 0x24B8CD, 0x265188, 0x27EA43, 0x2982FE, 0x2B1BB9, 0x2CB474, 0x2E4D2F, 0x2FE5EA, 0x317EA5, 0x331760, 0x34B01B, 0x3648D6, 0x37E191, 0x397A4C, 0x3B1307, 0x3CABC2, 0x3E447D, 0x3FDD38, 0x4175F3, 0x430EAE, 0x44A769, 0x464024, 0x47D8DF, 0x49719A, 0x4B0A55, 0x4CA310, 0x4E3BCB, 0x4FD486, 0x516D41, 0x5305FC, 0x549EB7, 0x563772, 0x57D02D, 0x5968E8, 0x5B01A3, 0x5C9A5E, 0x5E3319, 0x5FCBD4, 0x61648F, 0x62FD4A, 0x649605, 0x662EC0, 0x67C77B, 0x696036, 0x6AF8F1, 0x6C91AC, 0x6E2A67, 0x6FC322, 0x715BDD, 0x72F498, 0x748D53, 0x76260E, 0x77BEC9, 0x795784, 0x7AF03F, 0x7C88FA, 0x7E21B5, 0x7FBA70, 0x81532B, 0x82EBE6, 0x8484A1, 0x861D5C, 0x87B617, 0x894ED2, 0x8AE78D, 0x8C8048, 0x8E1903, 0x8FB1BE, 0x914A79, 0x92E334, 0x947BEF, 0x9614AA, 0x97AD65, 0x994620, 0x9ADEDB, 0x9C7796, 0x9E1051, 0x9FA90C, 0xA141C7, 0xA2DA82, 0xA4733D, 0xA60BF8, 0xA7A4B3, 0xA93D6E, 0xAAD629, 0xAC6EE4, 0xAE079F, 0xAFA05A, 0xB13915, 0xB2D1D0, 0xB46A8B, 0xB60346, 0xB79C01, 0xB934BC, 0xBACD77, 0xBC6632, 0xBDFEED, 0xBF97A8, 0xC13063, 0xC2C91E, 0xC461D9, 0xC5FA94, 0xC7934F, 0xC92C0A, 0xCAC4C5 +}; + +void getvideo(unsigned char *video, int *xres, int *yres); +void getvideo2(unsigned char *video, int *xres, int *yres); +void getosd(unsigned char *osd, int *xres, int *yres); +void smooth_resize(const unsigned char *source, unsigned char *dest, int xsource, int ysource, int xdest, int ydest, int colors); +void fast_resize(const unsigned char *source, unsigned char *dest, int xsource, int ysource, int xdest, int ydest, int colors); +void (*resize)(const unsigned char *source, unsigned char *dest, int xsource, int ysource, int xdest, int ydest, int colors); +void combine(unsigned char *output, const unsigned char *video, const unsigned char *osd, int vleft, int vtop, int vwidth, int vheight, int xres, int yres); + +#if !defined(__sh__) +static enum {UNKNOWN, WETEK, AZBOX863x, AZBOX865x, PALLAS, VULCAN, XILLEON, BRCM7400, BRCM7401, BRCM7405, BRCM7325, BRCM7335, BRCM7346, BRCM7358, BRCM7362, BRCM7241, BRCM7251, BRCM7252, BRCM7252S, BRCM7356, BRCM7424, BRCM7425, BRCM7435, BRCM7444, BRCM7552, BRCM7581, BRCM7583, BRCM7584, BRCM72604VU, BRCM72604, BRCM7278, BRCM75845, BRCM7366, BRCM73625, BRCM73565, BRCM7439DAGS, BRCM7439, HISIL_ARM} stb_type = UNKNOWN; +#else +static enum {UNKNOWN, WETEK, AZBOX863x, AZBOX865x, ST, PALLAS, VULCAN, XILLEON, BRCM7400, BRCM7401, BRCM7405, BRCM7325, BRCM7335, BRCM7346, BRCM7358, BRCM7362, BRCM7241, BRCM7251, BRCM7252, BRCM7252S, BRCM7356, BRCM7424, BRCM7425, BRCM7435, BRCM7444, BRCM7552, BRCM7581, BRCM7583, BRCM7584, BRCM72604VU, BRCM72604, BRCM7278, BRCM75845, BRCM7366, BRCM73625, BRCM73565, BRCM7439DAGS, BRCM7439, HISIL_ARM} stb_type = UNKNOWN; +#endif + +static int chr_luma_stride = 0x40; +static int chr_luma_register_offset = 0; +static unsigned int registeroffset = 0; +static unsigned int mem2memdma_register = 0; +static int quiet = 0; + +// main program + +int main(int argc, char **argv) +{ + int xres_v,yres_v,xres_o,yres_o,xres,yres,aspect; + int c,osd_only,video_only,use_osd_res,width,use_png,use_jpg,jpg_quality,no_aspect,use_letterbox; + + // we use fast resize as standard now + resize = &fast_resize; + + osd_only=video_only=use_osd_res=width=use_png=use_jpg=no_aspect=use_letterbox=0; + jpg_quality=50; + aspect=1; + + int dst_left = 0, dst_top = 0, dst_width = 0, dst_height = 0; + + unsigned char *video, *osd, *output; + int output_bytes=3; + + const char* filename = "/tmp/screenshot.bmp"; + + // detect STB + char buf[256]; + FILE *fp = fopen("/proc/fb","r"); + if (!fp) + { + fprintf(stderr, "No framebuffer, unknown STB .. quit.\n"); + return 1; + } + + while (fgets(buf,sizeof(buf),fp)) + { + if (strcasestr(buf,"VULCAN")) stb_type=VULCAN; + if (strcasestr(buf,"PALLAS")) stb_type=PALLAS; + if (strcasestr(buf,"XILLEON")) stb_type=XILLEON; + if (strcasestr(buf,"EM863x")) stb_type=AZBOX863x; + if (strcasestr(buf,"EM865x")) stb_type=AZBOX865x; +#if defined(__sh__) + if (strcasestr(buf,"STi") || strcasestr(buf,"STx")) stb_type=ST; +#endif + } + fclose(fp); + + if (stb_type == UNKNOWN) + { + FILE *file = fopen("/proc/stb/info/vumodel", "r"); + if (file) + { + char buf[32]; + while (fgets(buf, sizeof(buf), file)) + { + if (strcasestr(buf,"zero4k")) + { + stb_type = BRCM72604VU; + break; + } + } + fclose(file); + } + } + + if (stb_type == UNKNOWN) + { + FILE *file = fopen("/proc/stb/info/boxtype", "r"); + if (file) + { + char buf[32]; + while (fgets(buf, sizeof(buf), file)) + { + if (strcasestr(buf,"osmio4k")) + { + stb_type = BRCM72604VU; + break; + } + } + fclose(file); + } + } + + if (stb_type == UNKNOWN) + { + FILE *file = fopen("/proc/stb/info/hwmodel", "r"); + if (file) + { + char buf[32]; + while (fgets(buf, sizeof(buf), file)) + { + if (strcasestr(buf,"force3")) + { + stb_type = BRCM7439DAGS; + break; + } + if (strcasestr(buf,"force3se")) + { + stb_type = BRCM7439DAGS; + break; + } + if (strcasestr(buf,"force3uhd")) + { + stb_type = BRCM7439DAGS; + break; + } + if (strcasestr(buf,"force3uhdplus")) + { + stb_type = BRCM7439DAGS; + break; + } + if (strcasestr(buf,"tmtwin4k")) + { + stb_type = BRCM7439DAGS; + break; + } + if (strcasestr(buf,"revo4k")) + { + stb_type = BRCM7439DAGS; + break; + } + if (strcasestr(buf,"galaxy4k")) + { + stb_type = BRCM7439DAGS; + break; + } + if (strcasestr(buf,"tm4ksuper")) + { + stb_type = BRCM7439DAGS; + break; + } + if (strcasestr(buf,"lunix3-4k")) + { + stb_type = BRCM7439DAGS; + break; + } + if (strcasestr(buf,"valalinux4k")) + { + stb_type = BRCM7439DAGS; + break; + } + } + fclose(file); + } + } + + if (stb_type == UNKNOWN) + { + FILE *file = fopen("/proc/stb/info/chipset", "r"); + if (file) + { + char buf[32]; + while (fgets(buf, sizeof(buf), file)) + { + if (strstr(buf,"7400")) + { + stb_type = BRCM7400; + break; + } + else if (strstr(buf,"7401")) + { + stb_type = BRCM7401; + break; + } + else if (strstr(buf,"7403")) + { + stb_type = BRCM7401; + break; + } + else if (strstr(buf,"7405")) + { + stb_type = BRCM7405; + break; + } + else if (strstr(buf,"7413")) + { + stb_type = BRCM7405; + break; + } + else if (strstr(buf,"7335")) + { + stb_type = BRCM7335; + break; + } + else if (strstr(buf,"7325")) + { + stb_type = BRCM7325; + break; + } + else if (strstr(buf,"7346")) + { + stb_type = BRCM7346; + break; + } + else if (strstr(buf,"7358")) + { + stb_type = BRCM7358; + break; + } + else if (strstr(buf,"73625")) + { + stb_type = BRCM73625; + break; + } + else if (strstr(buf,"7362")) + { + stb_type = BRCM7362; + break; + } + else if (strstr(buf,"7241")) + { + stb_type = BRCM7241; + break; + } + else if (strstr(buf,"7251")) + { + stb_type = BRCM7251; + break; + } + else if (strstr(buf,"7252")) + { + stb_type = BRCM7252; + break; + } + else if (strstr(buf,"7252S")) + { + stb_type = BRCM7252S; + break; + } + else if (strstr(buf,"7278")) + { + stb_type = BRCM7278; + break; + } + else if (strstr(buf,"73565")) + { + stb_type = BRCM73565; + break; + } + else if (strstr(buf,"7356")) + { + stb_type = BRCM7356; + break; + } + else if (strstr(buf,"7424")) + { + stb_type = BRCM7424; + break; + } + else if (strstr(buf,"7425")) + { + stb_type = BRCM7425; + break; + } + else if (strstr(buf,"7435")) + { + stb_type = BRCM7435; + break; + } + else if (strstr(buf,"7444")) + { + stb_type = BRCM7444; + break; + } + else if (strstr(buf,"7552")) + { + stb_type = BRCM7552; + break; + } + else if (strstr(buf,"7581")) + { + stb_type = BRCM7581; + break; + } + else if (strstr(buf,"7583")) + { + stb_type = BRCM7583; + break; + } + else if (strstr(buf,"72604")) + { + stb_type = BRCM72604; + break; + } + else if (strstr(buf,"75845")) + { + stb_type = BRCM75845; + break; + } + else if (strstr(buf,"7584")) + { + stb_type = BRCM7584; + break; + } + else if (strstr(buf,"7366")) + { + stb_type = BRCM7366; + break; + } + else if (strstr(buf,"7376")) + { + stb_type = BRCM7366; + break; + } + else if (strstr(buf,"hi3798")) + { + stb_type = HISIL_ARM; + break; + } + else if (strstr(buf,"hi3716")) + { + stb_type = HISIL_ARM; + break; + } + else if (strstr(buf,"Meson-6") || strstr(buf,"Meson-64")) + { + stb_type = WETEK; + break; + } + } + fclose(file); + } + } + + if (stb_type == UNKNOWN) + { + FILE *file = fopen("/proc/stb/info/model", "r"); + if (file) + { + char buf[32]; + while (fgets(buf, sizeof(buf), file)) + { + if (strcasestr(buf,"DM500HD") || strcasestr(buf,"DM800SE") || strcasestr(buf,"DM7020HD")) + { + stb_type = BRCM7405; + break; + } + else if (strcasestr(buf,"DM7080") || strcasestr(buf,"DM820")) + { + stb_type = BRCM7435; + break; + } + else if (strcasestr(buf, "DM520") || strcasestr(buf,"DM525")) + { + stb_type = BRCM73625; + break; + } + else if (strcasestr(buf,"DM8000")) + { + stb_type = BRCM7400; + break; + } + else if (strcasestr(buf,"DM800")) + { + stb_type = BRCM7401; + break; + } + else if (strcasestr(buf,"DM900") || strcasestr(buf,"DM920")) + { + stb_type = BRCM7439; + break; + } + } + fclose(file); + } + } + + if (stb_type == UNKNOWN) + { + fprintf(stderr, "unknown stb type we can only capture osd\n"); + osd_only=1; + } + + switch (stb_type) + { + case BRCM7400: + registeroffset = 0x10100000; + chr_luma_stride = 0x40; + chr_luma_register_offset = 0x20; + mem2memdma_register = 0x10c02000; + break; + case BRCM7401: + registeroffset = 0x10100000; + chr_luma_stride = 0x40; + chr_luma_register_offset = 0x20; + mem2memdma_register = 0; + break; + case BRCM7325: + case BRCM7405: + registeroffset = 0x10100000; + chr_luma_stride = 0x80; + chr_luma_register_offset = 0x20; + mem2memdma_register = 0; + break; + case BRCM7335: + registeroffset = 0x10100000; + chr_luma_stride = 0x40; + chr_luma_register_offset = 0x20; + mem2memdma_register = 0x10c01000; + break; + case BRCM7358: + case BRCM7362: + case BRCM73625: + case BRCM7366: + case BRCM7444: + case BRCM7552: + case BRCM7251: + case BRCM7252: + case BRCM7252S: + case BRCM7278: + case BRCM7581: + case BRCM7584: + case BRCM72604VU: + case BRCM75845: + registeroffset = 0x10600000; + chr_luma_stride = 0x40; + chr_luma_register_offset = 0x34; + mem2memdma_register = 0; + break; + case BRCM72604: + case BRCM7439DAGS: + registeroffset = 0xf0600000; + chr_luma_stride = 0x100; + chr_luma_register_offset = 0x34; + mem2memdma_register = 0; + break; + case BRCM7241: + case BRCM7583: + case BRCM7346: + case BRCM7356: + case BRCM73565: + case BRCM7424: + case BRCM7425: + case BRCM7435: + registeroffset = 0x10600000; + chr_luma_stride = 0x80; + chr_luma_register_offset = 0x34; + mem2memdma_register = 0; + break; + case BRCM7439: + registeroffset = 0xf0600000; + chr_luma_stride = 0x80; + chr_luma_register_offset = 0x34; + mem2memdma_register = 0; + break; + default: + break; + } + + // process command line + while ((c = getopt (argc, argv, "dhj:lbnopqr:sv")) != -1) + { + switch (c) + { + case 'h': + case '?': + fprintf(stderr, + "Usage: grab [commands] [filename]\n\n" + "command:\n" + "-o only grab osd (framebuffer) when using this with png or bmp\n" + " fileformat you will get a 32bit pic with alphachannel\n" + "-v only grab video\n" + "-d always use osd resolution (good for skinshots)\n" + "-n dont correct 16:9 aspect ratio\n" + "-r (size) resize to a fixed width, maximum: 1920\n" + "-l always 4:3, create letterbox if 16:9\n" + "-b use bicubic picture resize (slow but smooth)\n" + "-j (quality) produce jpg files instead of bmp (quality 0-100)\n" + "-p produce png files instead of bmp\n" + "-q Quiet mode, don't output debug messages\n" + "-s write to stdout instead of a file\n" + "-h this help screen\n\n" + "If no command is given the complete picture will be grabbed.\n" + "If no filename is given /tmp/screenshot.[bmp/jpg/png] will be used.\n"); + return 1; + case 'o': // OSD only + osd_only=1; + video_only=0; + break; + case 'v': // Video only + video_only=1; + osd_only=0; + break; + case 'd': // always use OSD resolution + use_osd_res=1; + no_aspect=1; + break; + case 'q': // quiet + ++quiet; + break; + case 'r': // use given resolution + width=atoi(optarg); + if (width > 1920) + { + fprintf(stderr, "Error: -r (size) ist limited to 1920 pixel !\n"); + return 1; + } + break; + case 's': // stdout + filename = NULL; + break; + case 'l': // create letterbox + use_letterbox=1; + break; + case 'b': // use bicubic resizing + resize = &smooth_resize; + break; + case 'p': // use png file format + use_png=1; + use_jpg=0; + if (filename) + filename = "/tmp/screenshot.png"; + break; + case 'j': // use jpg file format + use_jpg=1; + use_png=0; + jpg_quality=atoi(optarg); + if (filename) + filename = "/tmp/screenshot.jpg"; + break; + case 'n': + no_aspect=1; + break; + } + } + if (optind < argc) // filename + filename = argv[optind]; + + int mallocsize=1920*1080; + + if (stb_type == VULCAN || stb_type == PALLAS) + mallocsize=720*576; + + video = (unsigned char *)malloc(mallocsize*3); + osd = (unsigned char *)malloc(mallocsize*4); + + if ((stb_type == VULCAN || stb_type == PALLAS) && width > 720) + mallocsize=width*(width * 0.8 + 1); + + output = (unsigned char *)malloc(mallocsize*4); + + // get osd + if (!video_only) + getosd(osd,&xres_o,&yres_o); + + // get video + if (!osd_only) + { + if (!quiet) + fprintf(stderr, "Grabbing Video ...\n"); + if (stb_type == BRCM7366 || stb_type == BRCM7251 || stb_type == BRCM7252 || stb_type == BRCM7252S || stb_type == BRCM7444 || stb_type == BRCM72604VU || stb_type == BRCM7278 || stb_type == HISIL_ARM) + { + getvideo2(video, &xres_v,&yres_v); + } + else + { + getvideo(video,&xres_v,&yres_v); + } + } + + // get aspect ratio + if (stb_type == VULCAN || stb_type == PALLAS) + { + fp = fopen("/proc/bus/bitstream","r"); + if (fp) + { + while (fgets(buf,sizeof(buf),fp)) + sscanf(buf,"A_RATIO: %d",&aspect); + fclose(fp); + } + } + else + { + fp = fopen("/proc/stb/vmpeg/0/aspect", "r"); + if (fp) + { + while (fgets(buf,sizeof(buf), fp)) + sscanf(buf,"%x",&aspect); + fclose(fp); + } + fp = fopen("/proc/stb/vmpeg/0/dst_width", "r"); + if (fp) + { + while (fgets(buf,sizeof(buf), fp)) + sscanf(buf,"%x",&dst_width); + fclose(fp); + } + fp = fopen("/proc/stb/vmpeg/0/dst_height", "r"); + if (fp) + { + while (fgets(buf,sizeof(buf), fp)) + sscanf(buf,"%x",&dst_height); + fclose(fp); + } + fp = fopen("/proc/stb/vmpeg/0/dst_top", "r"); + if (fp) + { + while (fgets(buf,sizeof(buf), fp)) + sscanf(buf,"%x",&dst_top); + fclose(fp); + } + fp = fopen("/proc/stb/vmpeg/0/dst_left", "r"); + if (fp) + { + while (fgets(buf,sizeof(buf), fp)) + sscanf(buf,"%x",&dst_left); + fclose(fp); + } + if (dst_width == 720) dst_width = 0; + if (dst_height == 576) dst_height = 0; + } + + // resizing + if (video_only) + { + xres=xres_v; + yres=yres_v; + } + else if (osd_only) + { + xres=xres_o; + yres=yres_o; + } + else if (xres_o == xres_v && yres_o == yres_v && !dst_top && !dst_left && !dst_width && !dst_height) + { + xres=xres_v; + yres=yres_v; + } + else + { + if (xres_v > xres_o && !use_osd_res && (width == 0 || width > xres_o)) + { + // resize osd to video size + xres = xres_v; + yres = yres_v; + } + else + { + // resize video to osd size + xres = xres_o; + yres = yres_o; + } + if (dst_top || dst_left || dst_width || dst_height) + { + if (dst_width == 0) dst_width = 720; + if (dst_height == 0) dst_height = 576; + dst_top *= yres; + dst_top /= 576; + dst_height *= yres; + dst_height /= 576; + dst_left *= xres; + dst_left /= 720; + dst_width *= xres; + dst_width /= 720; + } + else + { + dst_width = xres; + dst_height = yres; + } + if (xres_o != xres || yres_o != yres) + { + if (!quiet) + fprintf(stderr, "Resizing OSD to %d x %d ...\n", xres, yres); + resize(osd, output, xres_o, yres_o, xres, yres, 4); + memcpy(osd, output, xres * yres * 4); + } + if (xres_v != dst_width || yres_v != dst_height) + { + if (!quiet) + fprintf(stderr, "Resizing Video to %d x %d ...\n", dst_width, dst_height); + resize(video, output, xres_v, yres_v, dst_width, dst_height, 3); + memset(video, 0, xres_v * yres_v * 3); + memcpy(video, output, dst_width * dst_height * 3); + } + } + + // merge video and osd if neccessary + if (osd_only) + { + memcpy(output,osd,xres*yres*4); + output_bytes=4; + } + else if (video_only) + { + memcpy(output,video,xres*yres*3); + } + else + { + if (!quiet) + fprintf(stderr, "Merge Video with Framebuffer ...\n"); + combine(output, video, osd, dst_left, dst_top, dst_width ? dst_width : xres, dst_height ? dst_height : yres, xres, yres); + } + + // resize to specific width ? + if (width) + { + if (!quiet) + fprintf(stderr, "Resizing Screenshot to %d x %d ...\n",width,yres*width/xres); + resize(output,osd,xres,yres,width,(yres*width/xres),output_bytes); + yres=yres*width/xres; + xres=width; + memcpy(output,osd,xres*yres*output_bytes); + } + + // correct aspect ratio + if (!no_aspect && aspect == 3 && ((float)xres/(float)yres)<1.5) + { + if (!quiet) + fprintf(stderr, "Correct aspect ratio to 16:9 ...\n"); + resize(output,osd,xres,yres,xres,yres/1.42,output_bytes); + yres/=1.42; + memcpy(output,osd,xres*yres*output_bytes); + } + + // use letterbox ? + if (use_letterbox && xres*0.8 != yres && xres*0.8 <= 1080) + { + int yres_neu; + yres_neu=xres*0.8; + if (!quiet) + fprintf(stderr, "Create letterbox %d x %d ...\n",xres,yres_neu); + if (yres_neu > yres) + { + int ofs; + ofs=(yres_neu-yres)>>1; + memmove(output+ofs*xres*output_bytes,output,xres*yres*output_bytes); + memset(output,0,ofs*xres*output_bytes); + memset(output+ofs*xres*3+xres*yres*output_bytes,0,ofs*xres*output_bytes); + } + yres=yres_neu; + } + + // saving picture + if (!quiet) + fprintf(stderr, "Saving %d bit %s ...\n",(use_jpg?3*8:output_bytes*8), filename ? filename : ""); + FILE *fd2; + if (filename) + { + fd2 = fopen(filename, "wr"); + if (!fd2) + { + fprintf(stderr, "Failed to open '%s' for output\n", filename); + return 1; + } + } + else + fd2 = stdout; + + if (!use_png && !use_jpg) + { + // write bmp + unsigned char hdr[14 + 40]; + int i = 0; +#define PUT32(x) hdr[i++] = ((x)&0xFF); hdr[i++] = (((x)>>8)&0xFF); hdr[i++] = (((x)>>16)&0xFF); hdr[i++] = (((x)>>24)&0xFF); +#define PUT16(x) hdr[i++] = ((x)&0xFF); hdr[i++] = (((x)>>8)&0xFF); +#define PUT8(x) hdr[i++] = ((x)&0xFF); + PUT8('B'); PUT8('M'); + PUT32((((xres * yres) * 3 + 3) &~ 3) + 14 + 40); + PUT16(0); PUT16(0); PUT32(14 + 40); + PUT32(40); PUT32(xres); PUT32(yres); + PUT16(1); + PUT16(output_bytes*8); // bits + PUT32(0); PUT32(0); PUT32(0); PUT32(0); PUT32(0); PUT32(0); +#undef PUT32 +#undef PUT16 +#undef PUT8 + fwrite(hdr, 1, i, fd2); + + int y; + for (y=yres-1; y>=0 ; y-=1) + fwrite(output+(y*xres*output_bytes),xres*output_bytes,1,fd2); + } + else if (use_png) + { + // write png + png_bytep *row_pointers; + png_structp png_ptr; + png_infop info_ptr; + + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, (png_voidp)NULL, (png_error_ptr)NULL, (png_error_ptr)NULL); + info_ptr = png_create_info_struct(png_ptr); + png_init_io(png_ptr, fd2); + + row_pointers=(png_bytep*)malloc(sizeof(png_bytep)*yres); + + int y; + for (y=0; yrgb + { + int y; + #pragma omp parallel for shared(output) + for (y=0; yrgb and eliminate alpha channel jpgs are always saved with 24bit without alpha channel + { + int y; + #pragma omp parallel for shared(output) + for (y=0; y XILLEON) + { + // grab bcm pic from decoder memory + const unsigned char* data = (unsigned char*)mmap(0, 100, PROT_READ, MAP_SHARED, mem_fd, registeroffset); + if(!data) + { + fprintf(stderr, "Mainmemory: \n"); + return; + } + + int adr, adr2, ofs, ofs2, offset, pageoffset; + int xtmp,xsub,ytmp,t2,dat1; + + if (stb_type == BRCM73565 || stb_type == BRCM73625 || stb_type == BRCM7439DAGS || stb_type == BRCM7439 || stb_type == BRCM75845 || stb_type == BRCM72604) { + chr_luma_register_offset = 0x3c; + + ofs = data[chr_luma_register_offset + 24] << 4; /* luma lines */ + ofs2 = data[chr_luma_register_offset + 28] << 4; /* chroma lines */ + adr2 = data[chr_luma_register_offset + 3] << 24 | data[chr_luma_register_offset + 2] << 16 | data[chr_luma_register_offset + 1] << 8; + stride = data[0x19] << 8 | data[0x18]; + adr = data[0x37] << 24 | data[0x36] << 16 | data[0x35] << 8; /* start of videomem */ + } else { + ofs = data[chr_luma_register_offset + 8] << 4; /* luma lines */ + ofs2 = data[chr_luma_register_offset + 12] << 4; /* chroma lines */ + adr2 = data[chr_luma_register_offset + 3] << 24 | data[chr_luma_register_offset + 2] << 16 | data[chr_luma_register_offset + 1] << 8; + stride = data[0x15] << 8 | data[0x14]; + adr = data[0x1f] << 24 | data[0x1e] << 16 | data[0x1d] << 8; /* start of videomem */ + } + offset = adr2 - adr; + pageoffset = adr & 0xfff; + adr -= pageoffset; + adr2 -= pageoffset; + + munmap((void*)data, 100); + + fp=fopen("/proc/stb/vmpeg/0/yres","r"); + while (fgets(buf,sizeof(buf),fp)) + sscanf(buf,"%x",&res); + fclose(fp); + + if (!adr || !adr2) + { + *xres = stride; + *yres = res; + memset(video, 0, *xres * *yres * 3); + return; + } + + //fprintf(stderr, "Stride: %d Res: %d\n",stride,res); + //fprintf(stderr, "Adr: %X Adr2: %X OFS: %d %d\n",adr,adr2,ofs,ofs2); + + luma = (unsigned char *)malloc(stride*(ofs)); + chroma = (unsigned char *)malloc(stride * ofs2); + + int memory_tmp_size = 0; + // grabbing luma & chroma plane from the decoder memory + if (!mem2memdma_register) + { + // we have direct access to the decoder memory + memory_tmp_size = offset + (stride + chr_luma_stride) * ofs2; + if(!(memory_tmp = (unsigned char*)mmap(0, memory_tmp_size, PROT_READ, MAP_SHARED, mem_fd, adr))) + { + fprintf(stderr, "Mainmemory: \n"); + return; + } + + usleep(50000); // we try to get a full picture, its not possible to get a sync from the decoder so we use a delay + // and hope we get a good timing. dont ask me why, but every DM800 i tested so far produced a good + // result with a 50ms delay + + } + else + { + int tmp_size = offset + (stride + chr_luma_stride) * ofs2; + if (tmp_size > 2 * DMA_BLOCKSIZE) + { + fprintf(stderr, "Got invalid stride value from the decoder: %d\n", stride); + return; + } + memory_tmp_size = DMA_BLOCKSIZE + 0x1000; + if (!(memory_tmp = (unsigned char*)mmap(0, memory_tmp_size, PROT_READ|PROT_WRITE, MAP_SHARED, mem_fd, SPARE_RAM))) + { + fprintf(stderr, "Mainmemory: \n"); + return; + } + volatile unsigned long *mem_dma; + if (!(mem_dma = (volatile unsigned long*)mmap(0, 0x1000, PROT_READ|PROT_WRITE, MAP_SHARED, mem_fd, mem2memdma_register))) + { + fprintf(stderr, "Mainmemory: \n"); + return; + } + + int i = 0; + int tmp_len = DMA_BLOCKSIZE; + for (i=0; i < tmp_size; i += DMA_BLOCKSIZE) + { + + unsigned long *descriptor = (void*)memory_tmp; + + if (i + DMA_BLOCKSIZE > tmp_size) + tmp_len = tmp_size - i; + + //fprintf(stderr, "DMACopy: %x (%d) size: %d\n", adr+i, i, tmp_len); + + descriptor[0] = /* READ */ adr + i; + descriptor[1] = /* WRITE */ SPARE_RAM + 0x1000; + descriptor[2] = 0x40000000 | /* LEN */ tmp_len; + descriptor[3] = 0; + descriptor[4] = 0; + descriptor[5] = 0; + descriptor[6] = 0; + descriptor[7] = 0; + mem_dma[1] = /* FIRST_DESCRIPTOR */ SPARE_RAM; + mem_dma[3] = /* DMA WAKE CTRL */ 3; + mem_dma[2] = 1; + while (mem_dma[5] == 1) + usleep(2); + mem_dma[2] = 0; + + } + + munmap((void *)mem_dma, 0x1000); + /* unmap the dma descriptor page, we won't need it anymore */ + munmap((void *)memory_tmp, 0x1000); + /* adjust start and size of the remaining memory_tmp mmap */ + memory_tmp += 0x1000; + memory_tmp_size -= 0x1000; + } + + t=t2=dat1=0; + + xsub=chr_luma_stride; + // decode luma & chroma plane or lets say sort it + for (xtmp=0; xtmp < stride; xtmp += chr_luma_stride) + { + if ((stride-xtmp) <= chr_luma_stride) + xsub=stride-xtmp; + + dat1=xtmp; + for (ytmp = 0; ytmp < ofs; ytmp++) + { + if (stb_type == BRCM7439) + { + if (t & 0x100) + { + int cp = xsub % 0x20 ?: 0x20; // cp = xsub % 0x20 ? xsub % 0x20 : 0x20; + switch (xsub) + { + case 0x61 ... 0x80: + memcpy(luma + dat1 + 0x60, memory_tmp+pageoffset + t + 0x40, cp); + cp = 0x20; + case 0x41 ... 0x60: + memcpy(luma + dat1 + 0x40, memory_tmp+pageoffset + t + 0x60, cp); + cp = 0x20; + case 0x21 ... 0x40: + memcpy(luma + dat1 + 0x20, memory_tmp+pageoffset + t + 0x00, cp); + cp = 0x20; + default: + memcpy(luma + dat1 + 0x00, memory_tmp+pageoffset + t + 0x20, cp); + } + } + else + { + memcpy(luma+dat1,memory_tmp+pageoffset+t,xsub); // luma + } + } + else if (stb_type == BRCM7439DAGS) + { + if (t & 0x200) + { + int cp = xsub % 0x20 ?: 0x20; // cp = xsub % 0x20 ? xsub % 0x20 : 0x20; + switch (xsub) + { + case 0xe1 ... 0x100: + memcpy(luma + dat1 + 0xe0, memory_tmp+pageoffset + t + 0xc0, cp); + cp = 0x20; + case 0xc1 ... 0xe0: + memcpy(luma + dat1 + 0xc0, memory_tmp+pageoffset + t + 0xe0, cp); + cp = 0x20; + case 0xa1 ... 0xc0: + memcpy(luma + dat1 + 0xa0, memory_tmp+pageoffset + t + 0x80, cp); + cp = 0x20; + case 0x81 ... 0xa0: + memcpy(luma + dat1 + 0x80, memory_tmp+pageoffset + t + 0xa0, cp); + cp = 0x20; + case 0x61 ... 0x80: + memcpy(luma + dat1 + 0x60, memory_tmp+pageoffset + t + 0x40, cp); + cp = 0x20; + case 0x41 ... 0x60: + memcpy(luma + dat1 + 0x40, memory_tmp+pageoffset + t + 0x60, cp); + cp = 0x20; + case 0x21 ... 0x40: + memcpy(luma + dat1 + 0x20, memory_tmp+pageoffset + t + 0x00, cp); + cp = 0x20; + default: + memcpy(luma + dat1 + 0x00, memory_tmp+pageoffset + t + 0x20, cp); + } + } + else + { + memcpy(luma+dat1,memory_tmp+pageoffset+t,xsub); // luma + } + } + else if (stb_type == BRCM72604) + { + if (t & 0x200) + { + int cp = xsub % 0x20 ?: 0x20; // cp = xsub % 0x20 ? xsub % 0x20 : 0x20; + switch (xsub) + { + case 0xe1 ... 0x100: + memcpy(luma + dat1 + 0xe0, memory_tmp+pageoffset + t + 0xc0, cp); + cp = 0x20; + case 0xc1 ... 0xe0: + memcpy(luma + dat1 + 0xc0, memory_tmp+pageoffset + t + 0xe0, cp); + cp = 0x20; + case 0xa1 ... 0xc0: + memcpy(luma + dat1 + 0xa0, memory_tmp+pageoffset + t + 0x80, cp); + cp = 0x20; + case 0x81 ... 0xa0: + memcpy(luma + dat1 + 0x80, memory_tmp+pageoffset + t + 0xa0, cp); + cp = 0x20; + + case 0x61 ... 0x80: + memcpy(luma + dat1 + 0x60, memory_tmp+pageoffset + t + 0x40, cp); + cp = 0x20; + case 0x41 ... 0x60: + memcpy(luma + dat1 + 0x40, memory_tmp+pageoffset + t + 0x60, cp); + cp = 0x20; + case 0x21 ... 0x40: + memcpy(luma + dat1 + 0x20, memory_tmp+pageoffset + t + 0x00, cp); + cp = 0x20; + default: + memcpy(luma + dat1 + 0x00, memory_tmp+pageoffset + t + 0x20, cp); + } + } + else + { + memcpy(luma+dat1,memory_tmp+pageoffset+t,xsub); // luma + } + + int ii; + unsigned char luma_tmp[0x100]; + + for (ii = 0; ii < 0x100; ii+= 0x20) { + memcpy(&luma_tmp[ii + 0x00], luma + dat1 + (ii + 0x1c), 0x4); + memcpy(&luma_tmp[ii + 0x04], luma + dat1 + (ii + 0x18), 0x4); + memcpy(&luma_tmp[ii + 0x08], luma + dat1 + (ii + 0x14), 0x4); + memcpy(&luma_tmp[ii + 0x0c], luma + dat1 + (ii + 0x10), 0x4); + memcpy(&luma_tmp[ii + 0x10], luma + dat1 + (ii + 0x0c), 0x4); + memcpy(&luma_tmp[ii + 0x14], luma + dat1 + (ii + 0x08), 0x4); + memcpy(&luma_tmp[ii + 0x18], luma + dat1 + (ii + 0x04), 0x4); + memcpy(&luma_tmp[ii + 0x1c], luma + dat1 + (ii + 0x00), 0x4); + } + + memcpy(luma + dat1, luma_tmp, xsub); + } + else + { + memcpy(luma+dat1,memory_tmp+pageoffset+t,xsub); // luma + } + dat1+=stride; + t+=chr_luma_stride; + } + } + // Hmm apparently lumastride == chromastride? + xsub=chr_luma_stride; + for (xtmp=0; xtmp < stride; xtmp += chr_luma_stride) + { + if ((stride-xtmp) <= chr_luma_stride) + xsub=stride-xtmp; + + dat1=xtmp; + for (ytmp = 0; ytmp < ofs2; ytmp++) + { + if (stb_type == BRCM7439) + { + if (t2 & 0x100) + { + int cp = xsub % 0x20 ?: 0x20; + switch (xsub) + { + case 0x61 ... 0x80: + memcpy(chroma + dat1 + 0x60,memory_tmp+pageoffset+offset + t2 + 0x40, cp); + cp = 0x20; + case 0x41 ... 0x60: + memcpy(chroma + dat1 + 0x40, memory_tmp+pageoffset+offset + t2 + 0x60, cp); + cp = 0x20; + case 0x21 ... 0x40: + memcpy(chroma + dat1 + 0x20, memory_tmp+pageoffset+offset + t2 + 0x00, cp); + cp = 0x20; + default: + memcpy(chroma + dat1 + 0x00, memory_tmp+pageoffset+offset + t2 + 0x20, cp); + } + } + else + { + memcpy(chroma+dat1,memory_tmp+pageoffset+offset+t2,xsub); // chroma + } + } + if (stb_type == BRCM7439DAGS) + { + if (t2 & 0x200) + { + int cp = xsub % 0x20 ?: 0x20; + switch (xsub) + { + case 0xe1 ... 0x100: + memcpy(chroma + dat1 + 0xe0,memory_tmp+pageoffset+offset + t2 + 0xc0, cp); + cp = 0x20; + case 0xc1 ... 0xe0: + memcpy(chroma + dat1 + 0xc0,memory_tmp+pageoffset+offset + t2 + 0xe0, cp); + cp = 0x20; + case 0xa1 ... 0xc0: + memcpy(chroma + dat1 + 0xa0,memory_tmp+pageoffset+offset + t2 + 0x80, cp); + cp = 0x20; + case 0x81 ... 0xa0: + memcpy(chroma + dat1 + 0x80,memory_tmp+pageoffset+offset + t2 + 0xa0, cp); + cp = 0x20; + case 0x61 ... 0x80: + memcpy(chroma + dat1 + 0x60,memory_tmp+pageoffset+offset + t2 + 0x40, cp); + cp = 0x20; + case 0x41 ... 0x60: + memcpy(chroma + dat1 + 0x40, memory_tmp+pageoffset+offset + t2 + 0x60, cp); + cp = 0x20; + case 0x21 ... 0x40: + memcpy(chroma + dat1 + 0x20, memory_tmp+pageoffset+offset + t2 + 0x00, cp); + cp = 0x20; + default: + memcpy(chroma + dat1 + 0x00, memory_tmp+pageoffset+offset + t2 + 0x20, cp); + } + } + else + { + memcpy(chroma+dat1,memory_tmp+pageoffset+offset+t2,xsub); // chroma + } + } + else if (stb_type == BRCM72604) + { + if (t2 & 0x200) + { + int cp = xsub % 0x20 ?: 0x20; + switch (xsub) + { + case 0xe1 ... 0x100: + memcpy(chroma + dat1 + 0xe0,memory_tmp+pageoffset+offset + t2 + 0xc0, cp); + cp = 0x20; + case 0xc1 ... 0xe0: + memcpy(chroma + dat1 + 0xc0,memory_tmp+pageoffset+offset + t2 + 0xe0, cp); + cp = 0x20; + case 0xa1 ... 0xc0: + memcpy(chroma + dat1 + 0xa0,memory_tmp+pageoffset+offset + t2 + 0x80, cp); + cp = 0x20; + case 0x81 ... 0xa0: + memcpy(chroma + dat1 + 0x80,memory_tmp+pageoffset+offset + t2 + 0xa0, cp); + cp = 0x20; + + case 0x61 ... 0x80: + memcpy(chroma + dat1 + 0x60,memory_tmp+pageoffset+offset + t2 + 0x40, cp); + cp = 0x20; + case 0x41 ... 0x60: + memcpy(chroma + dat1 + 0x40,memory_tmp+pageoffset+offset + t2 + 0x60, cp); + cp = 0x20; + case 0x21 ... 0x40: + memcpy(chroma + dat1 + 0x20,memory_tmp+pageoffset+offset + t2 + 0x00, cp); + cp = 0x20; + default: + memcpy(chroma + dat1 + 0x00,memory_tmp+pageoffset+offset + t2 + 0x20, cp); + } + } + else + { + memcpy(chroma+dat1,memory_tmp+pageoffset+offset+t2,xsub); // chroma + } + + int ii; + unsigned char chroma_tmp[0x100]; + + for (ii = 0; ii < 0x100; ii+= 0x20) { + memcpy(&chroma_tmp[ii + 0x00], chroma + dat1 + (ii + 0x1c), 0x4); + memcpy(&chroma_tmp[ii + 0x04], chroma + dat1 + (ii + 0x18), 0x4); + memcpy(&chroma_tmp[ii + 0x08], chroma + dat1 + (ii + 0x14), 0x4); + memcpy(&chroma_tmp[ii + 0x0c], chroma + dat1 + (ii + 0x10), 0x4); + memcpy(&chroma_tmp[ii + 0x10], chroma + dat1 + (ii + 0x0c), 0x4); + memcpy(&chroma_tmp[ii + 0x14], chroma + dat1 + (ii + 0x08), 0x4); + memcpy(&chroma_tmp[ii + 0x18], chroma + dat1 + (ii + 0x04), 0x4); + memcpy(&chroma_tmp[ii + 0x1c], chroma + dat1 + (ii + 0x00), 0x4); + } + + memcpy(chroma + dat1, chroma_tmp, xsub); + } + else + { + memcpy(chroma+dat1,memory_tmp+pageoffset+offset+t2,xsub); // chroma + } + t2+=chr_luma_stride; + dat1+=stride; + } + } + munmap(memory_tmp, memory_tmp_size); + + int count = (stride*ofs) >> 2; + #pragma omp parallel for + for (t = 0; t < count; ++t) + { + unsigned char* p = luma + (4 * t); + unsigned char t; + SWAP(p[0], p[3]); + SWAP(p[1], p[2]); + } + count = (stride*ofs2) >> 2; + #pragma omp parallel for + for (t = 0; t < count; ++t) + { + unsigned char* p = chroma + (4 * t); + unsigned char t; + SWAP(p[0], p[3]); + SWAP(p[1], p[2]); + } + } + else if (stb_type == WETEK) + { +#define AMVIDEOCAP_IOC_MAGIC 'V' +#define AMVIDEOCAP_IOW_SET_START_CAPTURE _IOW(AMVIDEOCAP_IOC_MAGIC, 0x32, int) + + int fd; + int ret; + char *mbuf; + + // Init output variables + *xres=0; + *yres=0; + + fp = fopen("/proc/stb/vmpeg/0/xres","r"); + if (fp) + { + while (fgets(buf,sizeof(buf),fp)) + { + sscanf(buf,"%x",&stride); + } + fclose(fp); + } + + fp = fopen("/proc/stb/vmpeg/0/yres","r"); + if (fp) + { + while (fgets(buf,sizeof(buf),fp)) + { + sscanf(buf,"%x",&res); + } + fclose(fp); + } + + if((stride == 0) || (res == 0)) return; + + fd = open("/dev/amvideocap0", O_RDWR); + if (fd < 0) + return; + + ioctl(fd, AMVIDEOCAP_IOW_SET_START_CAPTURE, 10000); + mbuf = mmap(NULL, stride * res * 3, PROT_READ, MAP_SHARED, fd, 0); + if(!mbuf) { + close(fd); + fprintf(stderr, "Mainmemory: \n"); + return; + } + memcpy(video, mbuf, stride * res * 3); + munmap(mbuf, stride * res * 3); + close(fd); + *xres=stride; + *yres=res; + return; + + } + else if (stb_type == AZBOX863x || stb_type == AZBOX865x) + { + + unsigned char *infos = 0 ,*lyuv = 0, *ptr; + int fd, len = 0, x, y; + unsigned int chroma_w, chroma_h; + unsigned int luma_w, luma_h; + unsigned int luma_width, chroma_width; + unsigned int luma_size_tile, chroma_size_tile; + unsigned char *pluma; + unsigned char *pchroma; + + fd = open("/dev/frameyuv",O_RDWR); + if(!fd) { + perror("/dev/frameyuv"); + return; + } + + infos = malloc(1920*1080*4); + len = read(fd,infos,1920*1080*4); + + if(len <= 0 ) { + fprintf(stderr,"No picture info %d\n",len); + free(infos); + close(fd); + return; + } + + luma_w = (infos[0]<<24) | (infos[1]<<16) | (infos[2]<<8) | (infos[3]); + luma_h = (infos[4]<<24) | (infos[5]<<16) | (infos[6]<<8) | (infos[7]); + luma_width = (infos[8]<<24) | (infos[9]<<16) | (infos[10]<<8) | (infos[11]); + chroma_w = (infos[12]<<24) | (infos[13]<<16) | (infos[14]<<8) | (infos[15]); + chroma_h = (infos[16]<<24) | (infos[17]<<16) | (infos[18]<<8) | (infos[19]); + chroma_width = (infos[20]<<24) | (infos[21]<<16) | (infos[22]<<8) | (infos[23]); + + if (stb_type == AZBOX863x) { + + luma_size_tile = (((luma_w + 127)/128)*128) * (((luma_h + 31)/32)*32); + + chroma_size_tile = (((chroma_w + 127)/128)*128) * (((chroma_h + 31)/32)*32); + } else { + + luma_size_tile = (((luma_w + 255)/256)*256) * (((luma_h + 31)/32)*32); + + chroma_size_tile = (((chroma_w + 255)/256)*256) * (((chroma_h + 31)/32)*32); + } + + pluma = infos + 24; + pchroma = infos + 24 +luma_size_tile; + + luma = (unsigned char *)malloc(luma_w * luma_h); + chroma = (unsigned char *)malloc(chroma_w * chroma_h * 2); + + stride = luma_w; + res = luma_h; + + ptr = luma; + if (stb_type == AZBOX863x) { + /* save the luma buffer Y */ + for (y = 0 ; y < luma_h ; y++) { + for (x = 0 ; x < luma_w ; x++) { + unsigned char* pixel = (pluma +\ + (x/128) * 4096 + (y/32) * luma_width * 32 + + (x % 128) + (y % 32)*128); + + *ptr++ = *pixel; + } + } + + ptr = chroma; + + /* break chroma buffer into U & V components */ + for (y = 0 ; y < chroma_h ; y++) { + for (x = 0 ; x < chroma_w*2 ; x++) { + unsigned char* pixel = (pchroma +\ + (x/128) * 4096 + (y/32) * chroma_width * 32 + + (x % 128) + (y % 32)*128); + + *ptr++ = *pixel; + } + } + } else if (stb_type == AZBOX865x) { + + /* save the luma buffer Y */ + for (y = 0 ; y < luma_h ; y++) { + for (x = 0 ; x < luma_w ; x++) { + unsigned char* pixel = (pluma +\ + (x/256) * 8192 + (y/32) * luma_width * 32 + + (x % 256) + (y % 32)*256); + + *ptr++ = *pixel; + } + } + + ptr = chroma; + + /* break chroma buffer into U & V components */ + for (y = 0 ; y < chroma_h ; y++) { + for (x = 0 ; x < chroma_w*2 ; x++) { + unsigned char* pixel = (pchroma +\ + (x/256) * 8192 + (y/32) * chroma_width * 32 + + (x % 256) + (y % 32)*256); + + *ptr++ = *pixel; + } + + + } + } + free(infos); + close(fd); + } +#if defined(__sh__) + else if (stb_type == ST) + { + int yblock, xblock, iyblock, ixblock, yblockoffset, offset, layer_offset, OUTITER, OUTINC, OUTITERoffset; + int stride_half; + unsigned char *out; + unsigned char even, cr; + int fd_bpa; + int ioctlres; + BPAMemMapMemData bpa_data; + char bpa_mem_device[30]; + char *decode_surface; + int delay; + + // Init output variables + *xres=0; + *yres=0; + + fp = fopen("/proc/stb/vmpeg/0/xres","r"); + if (fp) + { + while (fgets(buf,sizeof(buf),fp)) + { + sscanf(buf,"%x",&stride); + } + fclose(fp); + } + fp = fopen("/proc/stb/vmpeg/0/yres","r"); + if (fp) + { + while (fgets(buf,sizeof(buf),fp)) + { + sscanf(buf,"%x",&res); + } + fclose(fp); + } + + //if stride and res are zero return (please note that stillpictures will not be captured) + if((stride == 0)&&(res == 0)) return; + + + fd_bpa = open("/dev/bpamem0", O_RDWR); + if(fd_bpa < 0) + { + fprintf(stderr, "cannot access /dev/bpamem0! err = %d\n", fd_bpa); + return; + } + bpa_data.bpa_part = "LMI_VID"; + bpa_data.phys_addr = 0x00000000; + bpa_data.mem_size = 0; + + fp = fopen("/proc/bpa2","r"); + if (fp) + { + unsigned char found_part = 0; + unsigned long mem_size = 0; + unsigned long phys_addr = 0; + while (fgets(buf,sizeof(buf),fp)) + { + if(found_part || strstr(buf, bpa_data.bpa_part) != NULL) + { + found_part = 1; + if (sscanf(buf, "- %lu B at %lx", &mem_size, &phys_addr) == 2) + { + if(mem_size > bpa_data.mem_size) + { + bpa_data.mem_size = mem_size; + bpa_data.phys_addr = phys_addr; + } + } + } + } + fclose(fp); + } + + printf("Using bpa2 part %s - 0x%lx %lu\n", bpa_data.bpa_part, bpa_data.phys_addr, bpa_data.mem_size); + + //bpa_data.phys_addr = 0x4a824000; + //bpa_data.mem_size = 28311552; + + ioctlres = ioctl(fd_bpa, BPAMEMIO_MAPMEM, &bpa_data); // request memory from bpamem + if(ioctlres) + { + fprintf(stderr, "cannot map required mem\n"); + return; + } + + sprintf(bpa_mem_device, "/dev/bpamem%d", bpa_data.device_num); + close(fd_bpa); + + fd_bpa = open(bpa_mem_device, O_RDWR); + + // if somebody forgot to add all bpamem devs then this gets really bad here + if(fd_bpa < 0) + { + fprintf(stderr, "cannot access %s! err = %d\n", bpa_mem_device, fd_bpa); + return; + } + + char *decode_map = (char *)mmap(0, bpa_data.mem_size, PROT_WRITE|PROT_READ, MAP_SHARED, fd_bpa, 0); + if(decode_map == MAP_FAILED) + { + fprintf(stderr, "could not map bpa mem\n"); + close(fd_bpa); + return; + } + + fprintf(stderr, "decode surface size: %d\n", bpa_data.mem_size ); + + //if stride and res is zero than this is most probably a stillpicture + //if(stride == 0) stride = 1280; + //if(res == 0) res = 720; + + stride_half = stride / 2; + + luma = (unsigned char *)malloc(stride * res); + chroma = (unsigned char *)malloc(stride * res / 2); + char *temp = (unsigned char *)malloc(4 * 1024 * 1024); + if( NULL == temp ) { + printf("can not allocate memory\n"); + return; + } + + memset(chroma, 0x80, stride * res / 2); + memset(luma, 0x00, stride * res); /* just to invalidate the page */ + memset(temp, 0x00, 4 * 1024 * 1024); /* just to invalidate the page */ + + //luma + layer_offset = 0; + + //we do not have to round that every luma res will be a multiple of 16 + yblock = res/16; //45 + xblock = stride/16; //80 + + //thereby yblockoffset does also not to be rounded up + yblockoffset = xblock * 256/*16x16px*/ * 2/*2 block rows*/; //0xA000 for 1280 + + //printf("yblock: %u xblock:%u yblockoffset:0x%x\n", yblock, xblock, yblockoffset); + + OUTITER = 0; + OUTITERoffset = 0; + OUTINC = 1; /*no spaces between pixel*/ + out = luma; + + struct timeval start_tv; + struct timeval stop_tv; + struct timeval result_tv; + + + //wait_for_frame_sync + { + unsigned char old_frame[0x800]; /*first 2 luma blocks, 0:0 - 32:64*/ + memcpy(old_frame, decode_map, 0x800); + gettimeofday(&start_tv, NULL); + memcmp(decode_map, old_frame, 0x800); + gettimeofday(&stop_tv, NULL); + for(delay = 0; delay < 500/*ms*/; delay++) + { + if (memcmp(decode_map, old_frame, 0x800) != 0) + break; + usleep(100); + } + } + //gettimeofday(&start_tv, NULL); + memcpy(temp,decode_map,4*1024*1024); + //gettimeofday(&stop_tv, NULL); + decode_surface = temp; + + //now we have 16,6ms(60hz) to 50ms(20hz) to get the whole picture + for(even = 0; even < 2; even++) + { + offset = layer_offset + (even << 8 /* * 0x100*/); + OUTITERoffset = even * xblock << 8 /* * 256=16x16px*/; + + for (iyblock = even; iyblock < yblock; iyblock+=2) + { + for (ixblock = 0; ixblock < xblock; ixblock++) + { + int line; + + OUTITER = OUTITERoffset; + for (line = 0; line < 16; line++) + { + OUT_LU_16(offset, line); + OUTITER += (stride - 16 /*we have already incremented by 16*/); + } + + //0x00, 0x200, ... + offset += 0x200; + OUTITERoffset += 16; + } + OUTITERoffset += (stride << 5) - stride /* * 31*/; + } + } + + //chroma + layer_offset = ((stride*res + (yblockoffset >> 1 /* /2*/ /*round up*/)) / yblockoffset) * yblockoffset; + + //cb + //we do not have to round that every chroma y res will be a multiple of 16 + //and every chroma x res /2 will be a multiple of 8 + yblock = res >> 4 /* /16*/; //45 + xblock = stride_half >> 3 /* /8*/; //no roundin + + //if xblock is not even than we will have to move to the next even value an + yblockoffset = (((xblock + 1) >> 1 /* / 2*/) << 1 /* * 2*/ ) << 8 /* * 64=8x8px * 2=2 block rows * 2=cr cb*/; + + //printf("yblock: %u xblock:%u yblockoffset:0x%x\n", yblock, xblock, yblockoffset); + + OUTITER = 0; + OUTITERoffset = 0; + OUTINC = 2; + out = chroma; + + for(cr = 0; cr < 2; cr++) + { + for(even = 0; even < 2; even++) + { + offset = layer_offset + (even << 8 /* * 0x100*/); + OUTITERoffset = even * (xblock << 7 /* * 128=8x8px * 2*/) + cr; + + for (iyblock = even; iyblock < yblock; iyblock+=2) + { + for (ixblock = 0; ixblock < xblock; ixblock++) + { + int line; + OUTITER = OUTITERoffset; + + for (line = 0; line < 8; line++) + { + OUT_CH_8(offset, line, !cr); + OUTITER += (stride - 16 /*we have already incremented by OUTINC*8=16*/); + } + + //0x00 0x80 0x200 0x280, ... + offset += (offset%0x100?0x180/*80->200*/:0x80/*0->80*/); + OUTITERoffset += 16/*OUTINC*8=16*/; + } + OUTITERoffset += (stride << 4) - stride /* * 15*/; + } + } + } + timeval_subtract(&result_tv,&stop_tv,&start_tv); + printf("framesync after: %dms\n", delay); + printf("frame copy duration: %fms\n", (((float)result_tv.tv_sec)*1000.0f+((float)result_tv.tv_usec)/1000.0f)); + + munmap(decode_map, bpa_data.mem_size); + + ioctlres = ioctl(fd_bpa, BPAMEMIO_UNMAPMEM); // request memory from bpamem + if(ioctlres) + { + fprintf(stderr, "cannot unmap required mem\n"); + close(fd_bpa); + return; + } + + close(fd_bpa); + } +#endif + else if (stb_type == XILLEON) + { + // grab xilleon pic from decoder memory + fp = fopen("/proc/stb/vmpeg/0/xres","r"); + if (fp) + { + while (fgets(buf,sizeof(buf),fp)) + { + sscanf(buf,"%x",&stride); + } + fclose(fp); + } + fp = fopen("/proc/stb/vmpeg/0/yres","r"); + if (fp) + { + while (fgets(buf,sizeof(buf),fp)) + { + sscanf(buf,"%x",&res); + } + fclose(fp); + } + + if(!(memory = (unsigned char*)mmap(0, 1920*1152*6, PROT_READ, MAP_SHARED, mem_fd, 0x6000000))) + { + fprintf(stderr, "Mainmemory: \n"); + return; + } + + luma = (unsigned char *)malloc(1920*1152); + chroma = (unsigned char *)malloc(1920*576); + + int offset=1920*1152*5; // offset for chroma buffer + + const unsigned char* frame_l = memory; // luma frame from video decoder + const unsigned char* frame_c = memory + offset; // chroma frame from video decoder + + int xtmp,ytmp,ysub,xsub; + const int ypart=32; + const int xpart=128; + int oe2=0; + int ysubcount=res/32; + int ysubchromacount=res/64; + + // "decode" luma/chroma, there are 128x32pixel blocks inside the decoder mem + for (ysub=0; ysub<=ysubcount; ysub++) + { + for (xsub=0; xsub<15; xsub++) // 1920/128=15 + { + // Even lines + for (ytmp=0; ytmp 64) + { + memcpy(luma + destx + extraoffset + 64, frame_l, overflow-64); + memcpy(luma + destx + extraoffset, frame_l + 64, 64); + } + else + { + memcpy(luma + destx + extraoffset, frame_l + 64, overflow); + } + } + frame_l += xpart; + } + } + } + + // Chrominance (half resolution) + ysubcount /= 2; + for (ysub=0; ysub<=ysubcount; ysub++) + { + for (xsub=0; xsub<15; xsub++) // 1920/128=15 + { + // Even lines + for (ytmp=0; ytmp 64) + { + memcpy(chroma + destx + extraoffset + 64, frame_c, overflow-64); + memcpy(chroma + destx + extraoffset, frame_c + 64, 64); + } + else + { + memcpy(chroma + destx + extraoffset, frame_c + 64, overflow); + } + } + frame_c += xpart; + } + } + } + + + munmap(memory, 1920*1152*6); + + } + else if (stb_type == VULCAN || stb_type == PALLAS) + { + // grab via v4l device (ppc boxes) + + memory_tmp = (unsigned char *)malloc(720 * 576 * 3 + 16); + + int fd_video = open(VIDEO_DEV, O_RDONLY); + if (fd_video < 0) + { + fprintf(stderr, "could not open /dev/video"); + return; + } + + int r = read(fd_video, memory_tmp, 720 * 576 * 3 + 16); + if (r < 16) + { + fprintf(stderr, "read failed\n"); + close(fd_video); + return; + } + close(fd_video); + + int *size = (int*)memory_tmp; + stride = size[0]; + res = size[1]; + + luma = (unsigned char *)malloc(stride * res); + chroma = (unsigned char *)malloc(stride * res); + + memcpy (luma, memory_tmp + 16, stride * res); + memcpy (chroma, memory_tmp + 16 + stride * res, stride * res); + + free(memory_tmp); + } + + close(mem_fd); + + // yuv2rgb conversion (4:2:0) + const int rgbstride = stride * 3; + const int scans = res / 2; + int y; + #pragma omp parallel for + for (y=0; y < scans; ++y) + { + int x; + int out1 = y * rgbstride * 2; + int pos = y * stride * 2; + const unsigned char* chroma_p = chroma + (y * stride); + + for (x=stride; x != 0; x-=2) + { + int U = *chroma_p++; + int V = *chroma_p++; + + int RU=yuv2rgbtable_ru[U]; // use lookup tables to speedup the whole thing + int GU=yuv2rgbtable_gu[U]; + int GV=yuv2rgbtable_gv[V]; + int BV=yuv2rgbtable_bv[V]; + + switch (stb_type) //on xilleon we use bgr instead of rgb so simply swap the coeffs + { + case XILLEON: + SWAP(RU,BV); + break; + } + + // now we do 4 pixels on each iteration this is more code but much faster + int Y=yuv2rgbtable_y[luma[pos]]; + + video[out1]=CLAMP((Y + RU)>>16); + video[out1+1]=CLAMP((Y - GV - GU)>>16); + video[out1+2]=CLAMP((Y + BV)>>16); + + Y=yuv2rgbtable_y[luma[stride+pos]]; + + video[out1+rgbstride]=CLAMP((Y + RU)>>16); + video[out1+1+rgbstride]=CLAMP((Y - GV - GU)>>16); + video[out1+2+rgbstride]=CLAMP((Y + BV)>>16); + + pos++; + out1+=3; + + Y=yuv2rgbtable_y[luma[pos]]; + + video[out1]=CLAMP((Y + RU)>>16); + video[out1+1]=CLAMP((Y - GV - GU)>>16); + video[out1+2]=CLAMP((Y + BV)>>16); + + Y=yuv2rgbtable_y[luma[stride+pos]]; + + video[out1+rgbstride]=CLAMP((Y + RU)>>16); + video[out1+1+rgbstride]=CLAMP((Y - GV - GU)>>16); + video[out1+2+rgbstride]=CLAMP((Y + BV)>>16); + + out1+=3; + pos++; + } + } + + *xres=stride; + *yres=res; + free(luma); + free(chroma); +} + +// grabing the osd picture + +void getosd(unsigned char *osd, int *xres, int *yres) +{ + int fb,x,y,pos,pos1,pos2,ofs; + unsigned char *lfb; + struct fb_fix_screeninfo fix_screeninfo; + struct fb_var_screeninfo var_screeninfo; + + fb=open(stb_type == WETEK ? "/dev/fb/2" : "/dev/fb/0", O_RDWR); + if (fb == -1) + { + fb=open(stb_type == WETEK ? "/dev/fb2" : "/dev/fb0", O_RDWR); + if (fb == -1) + { + fprintf(stderr, "Framebuffer failed\n"); + return; + } + } + + if(ioctl(fb, FBIOGET_FSCREENINFO, &fix_screeninfo) == -1) + { + fprintf(stderr, "Framebuffer: \n"); + return; + } + + if(ioctl(fb, FBIOGET_VSCREENINFO, &var_screeninfo) == -1) + { + fprintf(stderr, "Framebuffer: \n"); + return; + } + + if(!(lfb = (unsigned char*)mmap(0, fix_screeninfo.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, fb, 0))) + { + fprintf(stderr, "Framebuffer: \n"); + return; + } + + if ( var_screeninfo.bits_per_pixel == 32 ) + { + if (!quiet) + fprintf(stderr, "Grabbing 32bit Framebuffer ...\n"); + + // get 32bit framebuffer + pos=pos1=pos2=0; + ofs=fix_screeninfo.line_length-(var_screeninfo.xres*4); + + if (ofs == 0) // we have no offset ? so do it the easy and fast way + { + memcpy(osd,lfb,fix_screeninfo.line_length*var_screeninfo.yres); + } + else // DM7025 have an offset, so we have to do it line for line + { + unsigned char *memory; // use additional buffer to speed up especially when using hd skins + memory = (unsigned char *)malloc(fix_screeninfo.line_length*var_screeninfo.yres); + memcpy(memory,lfb,fix_screeninfo.line_length*var_screeninfo.yres); + for (y=0; y < var_screeninfo.yres; y+=1) + memcpy(osd+y*var_screeninfo.xres*4,memory+y*fix_screeninfo.line_length,var_screeninfo.xres*4); + free(memory); + } + } else if ( var_screeninfo.bits_per_pixel == 16 ) + { + if (!quiet) + fprintf(stderr, "Grabbing 16bit Framebuffer ...\n"); + unsigned short color; + + // get 16bit framebuffer + pos=pos1=pos2=0; + ofs=fix_screeninfo.line_length-(var_screeninfo.xres*2); + for (y=0; y < var_screeninfo.yres; y+=1) + { + for (x=0; x < var_screeninfo.xres; x+=1) + { + color = lfb[pos2] << 8 | lfb[pos2+1]; + pos2+=2; + + osd[pos1++] = BLUE565(color); // b + osd[pos1++] = GREEN565(color); // g + osd[pos1++] = RED565(color); // r + osd[pos1++]=0x00; // tr - there is no transparency in 16bit mode + } + pos2+=ofs; + } + } + else if ( var_screeninfo.bits_per_pixel == 8 ) + { + if (!quiet) + fprintf(stderr, "Grabbing 8bit Framebuffer ...\n"); + unsigned short color; + + // Read Color Palette directly from the main memory, because the FBIOGETCMAP is buggy on dream and didnt + // gives you the correct colortable ! + int mem_fd; + unsigned char *memory; + unsigned short rd[256], gn[256], bl[256], tr[256]; + + if ((mem_fd = open("/dev/mem", O_RDWR) ) < 0) { + fprintf(stderr, "Mainmemory: can't open /dev/mem \n"); + return; + } + + if(!(memory = (unsigned char*)mmap(0, fix_screeninfo.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, mem_fd, fix_screeninfo.smem_start-0x1000))) + { + fprintf(stderr, "Mainmemory: \n"); + return; + } + + if (stb_type == VULCAN) // DM500/5620 stores the colors as a 16bit word with yuv values, so we have to convert :( + { + unsigned short yuv; + pos2 = 0; + for (pos1=16; pos1<(256*2)+16; pos1+=2) + { + + yuv = memory[pos1] << 8 | memory[pos1+1]; + + rd[pos2]=CLAMP((76310*(YFB(yuv)-16) + 104635*(CRFB(yuv)-128))>>16); + gn[pos2]=CLAMP((76310*(YFB(yuv)-16) - 53294*(CRFB(yuv)-128) - 25690*(CBFB(yuv)-128))>>16); + bl[pos2]=CLAMP((76310*(YFB(yuv)-16) + 132278*(CBFB(yuv)-128))>>16); + + if (yuv == 0) // transparency is a bit tricky, there is a 2 bit blending value BFFB(yuv), but not really used + { + rd[pos2]=gn[pos2]=bl[pos2]=0; + tr[pos2]=0x00; + } else + tr[pos2]=0xFF; + + pos2++; + } + } + else if (stb_type == PALLAS) // DM70x0 stores the colors in plain rgb values + { + pos2 = 0; + for (pos1=32; pos1<(256*4)+32; pos1+=4) + { + rd[pos2]=memory[pos1+1]; + gn[pos2]=memory[pos1+2]; + bl[pos2]=memory[pos1+3]; + tr[pos2]=memory[pos1]; + pos2++; + } + } + else + { + fprintf(stderr, "unsupported framebuffermode\n"); + return; + } + close(mem_fd); + + // get 8bit framebuffer + pos=pos1=pos2=0; + ofs=fix_screeninfo.line_length-(var_screeninfo.xres); + for (y=0; y < var_screeninfo.yres; y+=1) + { + for (x=0; x < var_screeninfo.xres; x+=1) + { + color = lfb[pos2++]; + + osd[pos1++] = bl[color]; // b + osd[pos1++] = gn[color]; // g + osd[pos1++] = rd[color]; // r + osd[pos1++] = tr[color]; // tr + } + pos2+=ofs; + } + } + close(fb); + + *xres=var_screeninfo.xres; + *yres=var_screeninfo.yres; + if (!quiet) + fprintf(stderr, "... Framebuffer-Size: %d x %d\n",*xres,*yres); +} + +// bicubic pixmap resizing + +void smooth_resize(const unsigned char *source, unsigned char *dest, int xsource, int ysource, int xdest, int ydest, int colors) +{ + const unsigned int xs = xsource; // x-resolution source + const unsigned int ys = ysource; // y-resolution source + const unsigned int xd = xdest; // x-resolution destination + const unsigned int yd = ydest; // y-resolution destination + + unsigned int sx1[xd]; + unsigned int sx2[xd]; + // get x scale factor, use bitshifting to get rid of floats + const int fx=((xs-1)<<16)/xd; + // get y scale factor, use bitshifting to get rid of floats + const int fy=((ys-1)<<16)/yd; + + { + // pre calculating sx1/sx2 for faster resizing + int x; + for (x=0; x>16; //floor() + + // last x source pixel for calculating destination pixel + sx2[x]=sx1[x]+(fx>>16); + if (fx & 0x7FFF) //ceil() + sx2[x]++; + } + } + + // Scale + int y; + #pragma omp parallel for shared(sx1, sx2, source, dest) + for (y=0; y>16; //floor() + // last y source pixel for calculating destination pixel + unsigned int sy2=sy1+(fy>>16); + if (fy & 0x7FFF) //ceil() + sy2++; + + int x; + for (x=0; x>16)*xsource; // do some precalculations + int i_xdest = i*xdest; + int j; + for (j=0; j>16) ; + int y2_x2_colors = (y2_xsource+x2)*colors; + int i_x_colors = (i_xdest+j)*colors; + int c; + for (c=0; c>8; + output[vpos1++] = (( osd[pos1++] * osd[apos] ) ) >>8; + output[vpos1++] = (( osd[pos1++] * osd[apos] ) ) >>8; + pos1++; // skip alpha byte + } + } + #pragma omp parallel for + for (y = vtop; y < vbottom; y++) + { + int pos1 = y * xres * 4; + int vpos1 = y * xres * 3; + int x; + for (x = 0; x < vleft; x++) + { + int apos=pos1+3; + output[vpos1++] = (( osd[pos1++] * osd[apos] ) ) >>8; + output[vpos1++] = (( osd[pos1++] * osd[apos] ) ) >>8; + output[vpos1++] = (( osd[pos1++] * osd[apos] ) ) >>8; + pos1++; // skip alpha byte + } + for (x = vleft; x < vright; x++) + { + int apos=pos1+3; + int a2 = 0xFF - osd[apos]; + int pixel = ((y - vtop) * vwidth + (x - vleft)) * 3; + output[vpos1++] = ( ( video[pixel + 0] * a2 ) + ( osd[pos1++] * osd[apos] ) ) >>8; + output[vpos1++] = ( ( video[pixel + 1] * a2 ) + ( osd[pos1++] * osd[apos] ) ) >>8; + output[vpos1++] = ( ( video[pixel + 2] * a2 ) + ( osd[pos1++] * osd[apos] ) ) >>8; + pos1++; // skip alpha byte + } + for (x = vright; x < xres; x++) + { + int apos=pos1+3; + output[vpos1++] = (( osd[pos1++] * osd[apos] ) ) >>8; + output[vpos1++] = (( osd[pos1++] * osd[apos] ) ) >>8; + output[vpos1++] = (( osd[pos1++] * osd[apos] ) ) >>8; + pos1++; // skip alpha byte + } + } + for (y = vbottom; y < yres; y++) + { + int pos1 = y * xres * 4; + int vpos1 = y * xres * 3; + int x; + for (x = 0; x < xres; x++) + { + int apos=pos1+3; + output[vpos1++] = (( osd[pos1++] * osd[apos] ) ) >>8; + output[vpos1++] = (( osd[pos1++] * osd[apos] ) ) >>8; + output[vpos1++] = (( osd[pos1++] * osd[apos] ) ) >>8; + pos1++; // skip alpha byte + } + } +} diff --git a/devinit/Makefile.am b/devinit/Makefile.am deleted file mode 100644 index 604708f..0000000 --- a/devinit/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -bin_PROGRAMS = devinit - -devinit_SOURCES = devinit.c - -AM_CFLAGS = -Wall -Werror diff --git a/devinit/autogen.sh b/devinit/autogen.sh deleted file mode 100755 index 1a3280a..0000000 --- a/devinit/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-devinit" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/devinit/configure.ac b/devinit/configure.ac deleted file mode 100644 index 0cc74f9..0000000 --- a/devinit/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT([devinit],[1.0],[],[devinit]) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_OUTPUT([ -Makefile -]) diff --git a/devinit/devinit.c b/devinit/devinit.c deleted file mode 100644 index ffab0d7..0000000 --- a/devinit/devinit.c +++ /dev/null @@ -1,110 +0,0 @@ -/* $Id: devinit.c,v 1.2 2012/04/13 12:15:01 rhabarber1848 Exp $ - - Helper app to populate the initial /dev directory with the required - devices when they don't exist yet - - Call this instead of init to set up everything for the real init - (using the init-commandline option of the linux kernel) - - Copyright (c) 2005, Carsten Juttner - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -static void exec_init(char **argv, char **envp) -{ - char *const init_name = "init"; - char *const sh_name = "sh"; - - argv[0] = init_name; - execve("/sbin/init", argv, envp); - execve("/etc/init", argv, envp); - execve("/bin/init", argv, envp); - - argv[0] = sh_name; - execve("/bin/sh", argv, envp); - - /* we should never get here... */ - perror("unable to exec init"); -} - -int main(int argc, char **argv, char **envp) -{ - char *const console_dev = "/dev/console"; - char *const null_dev = "/dev/null"; - char *const ttyAS0_dev = "/dev/ttyAS0"; - char *const vfd_dev = "/dev/vfd"; - - if (getpid() == 1) - { - int fh; - mode_t old = umask(0000); - - if (access(console_dev, F_OK)) - { - mknod(console_dev, S_IFCHR | 0600, makedev(5, 1)); - - fh = open(console_dev, O_RDWR); - if (fh) /* descriptor 0 is already open?!? */ - { - close(fh); - } - else /* create stdout/stderr for init */ - { - (void)dup(0); /* 1 */ - (void)dup(0); /* 2 */ - } - } - - if (access(null_dev, F_OK)) - mknod(null_dev, S_IFCHR | 0666, makedev(1, 3)); - - if (access(ttyAS0_dev, F_OK)) - mknod(ttyAS0_dev, S_IFCHR | 0660, makedev(204, 40)); - - if (access(vfd_dev, F_OK)) - mknod(vfd_dev, S_IFCHR | 0660, makedev(147, 0)); - - umask(old); - - /* finally become the real init */ - exec_init(argv, envp); - } - else - { - fprintf(stderr, "This program is supposed to be run by the kernel.\n"); - } - - return 0; -} diff --git a/eplayer4/Makefile.am b/eplayer4/Makefile.am deleted file mode 100644 index 5260a4f..0000000 --- a/eplayer4/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ - -INCLUDES = \ - -I../../../../../tufsbox/cdkroot/usr/include \ - -I../../../../../tufsbox/cdkroot/usr/include/glib-2.0 \ - -I../../../../../tufsbox/cdkroot/usr/include/gstreamer-0.10 \ - -I../../../../../tufsbox/cdkroot/usr/include/libxml2 \ - -I../../../../../tufsbox/cdkroot/usr/lib/glib-2.0/include - -bin_PROGRAMS = eplayer4 -eplayer4_SOURCES = eplayer4.c -eplayer4_LDADD = -lgstreamer-0.10 - diff --git a/eplayer4/eplayer4.c b/eplayer4/eplayer4.c deleted file mode 100644 index 4da50b0..0000000 --- a/eplayer4/eplayer4.c +++ /dev/null @@ -1,260 +0,0 @@ -/* - * eplayer3: command line playback using libeplayer3 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - - -int kbhit(void) -{ - struct timeval tv; - fd_set read_fd; - - tv.tv_sec = 1; - tv.tv_usec = 0; - - FD_ZERO(&read_fd); - FD_SET(0, &read_fd); - - if (select(1, &read_fd, NULL, NULL, &tv) == -1) - return 0; - - if (FD_ISSET(0, &read_fd)) - return 1; - - return 0; -} - -int main(int argc, char *argv[]) -{ - int showInfos = 0, noinput = 0; - char file[255] = {""}; - int speedmap = 0; - gdouble speed = 1.0; - printf("%s >\n", __FILE__); - - if (argc < 2) - { - printf("give me a filename please\n"); - exit(1); - } - - strcat(file, argv[1]); - - printf("File=%s\n", file); - - gst_init(&argc, &argv); - - GstElement *m_gst_playbin; - gchar *uri; - uri = g_filename_to_uri(file, NULL, NULL); - - m_gst_playbin = gst_element_factory_make("playbin2", "playbin"); - - printf("URI=%s\n", uri); - - g_object_set(G_OBJECT(m_gst_playbin), "uri", uri, NULL); - int flags = 0x47; // ( GST_PLAY_FLAG_VIDEO | GST_PLAY_FLAG_AUDIO | GST_PLAY_FLAG_NATIVE_VIDEO | GST_PLAY_FLAG_TEXT ); - g_object_set(G_OBJECT(m_gst_playbin), "flags", flags, NULL); - g_free(uri); - - //GstElement *subsink = gst_element_factory_make("appsink", "subtitle_sink"); - - //gst_bus_set_sync_handler(gst_pipeline_get_bus (GST_PIPELINE (m_gst_playbin)), gstBusSyncHandler, this); - - gst_element_set_state(m_gst_playbin, GST_STATE_PLAYING); - - while (1) - { - int Key = 0; - - if (kbhit()) - if (noinput == 0) - Key = getchar(); - - if (Key == 0 || Key == 0xA) - continue; - - switch (Key) - { - case 'q': //STOP - gst_element_set_state(m_gst_playbin, GST_STATE_NULL); - break; - - case 'c': //CONTINUE - gst_element_set_state(m_gst_playbin, GST_STATE_PLAYING); - - speed = 1.0; - printf("Continue with speed %f\n", speed); - gst_element_seek(m_gst_playbin, speed, GST_FORMAT_TIME, GST_SEEK_FLAG_NONE, - GST_SEEK_TYPE_NONE, 0, - GST_SEEK_TYPE_NONE, -1); - - break; - - case 'p': //PAUSE - gst_element_set_state(m_gst_playbin, GST_STATE_PAUSED); - break; - - case 'k': - { - int Key2 = getchar() - 48; - double sec = 0.0; - - switch (Key2) - { - case 1: - sec = -15.0; - break; - case 4: - sec = -60.0; - break; - case 7: - sec = -300.0; - break; - case 3: - sec = 15.0; - break; - case 6: - sec = 60.0; - break; - case 9: - sec = 300.0; - break; - } - - printf("seconds %d \n", Key2); - gint64 time_nanoseconds; - gint64 pos; - GstFormat fmt = GST_FORMAT_TIME; - gst_element_query_position(m_gst_playbin, &fmt, &pos); - - time_nanoseconds = pos + (sec * 1000000000); - if (time_nanoseconds < 0) time_nanoseconds = 0; - - - double seekTo = 0; - seekTo = time_nanoseconds / 1000000000.0; - printf("SeekTo = %02d:%02d:%02d (%.4f sec)\n", (int)((seekTo / 60) / 60) % 60, (int)(seekTo / 60) % 60, (int)seekTo % 60, seekTo); - - gst_element_seek(m_gst_playbin, 1.0, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH, - GST_SEEK_TYPE_SET, time_nanoseconds, - GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE); - break; - } - - case 'l': - { - double length = 0; - GstFormat fmt = GST_FORMAT_TIME; //Returns time in nanosecs - gint64 len; - gst_element_query_duration(m_gst_playbin, &fmt, &len); - length = len / 1000000000.0; - printf("Length = %02d:%02d:%02d (%.4f sec)\n", (int)((length / 60) / 60) % 60, (int)(length / 60) % 60, (int)length % 60, length); - break; - } - case 'j': - { - double sec = 0; - GstFormat fmt = GST_FORMAT_TIME; //Returns time in nanosecs - gint64 pos; - gst_element_query_position(m_gst_playbin, &fmt, &pos); - sec = pos / 1000000000.0; - printf("Pts = %02d:%02d:%02d (%.4f sec)\n", (int)((sec / 60) / 60) % 60, (int)(sec / 60) % 60, (int)sec % 60, sec); - break; - } - - case 'f': - { - if (speed < 1.0) - speed = 1.0; - - speed++; - - if (speed > 4.0) - speed = 1.0; - - printf("FastForward with speed %f\n", speed); - gst_element_seek(m_gst_playbin, speed, GST_FORMAT_TIME, GST_SEEK_FLAG_NONE, - GST_SEEK_TYPE_NONE, 0, - GST_SEEK_TYPE_NONE, -1); - - break; - } - - case 'b': - { - if (speed >= 1.0) - speed = 0.0; - - speed--; - - if (speed < -4.0) - speed = -1.0; - - printf("Reverse with speed %f\n", speed); - gst_element_seek(m_gst_playbin, speed, GST_FORMAT_TIME, GST_SEEK_FLAG_NONE, - GST_SEEK_TYPE_NONE, 0, - GST_SEEK_TYPE_NONE, -1); - - break; - } - - case 'i': - { - break; - } - - default: - { - printf("Control: %x\n", Key); - printf("al: List audio tracks\n"); - printf("ac: List current audio track\n"); - printf("a[id] Select audio track\n"); - printf("sl: List subtitles\n"); - printf("sc: List current subtitle\n"); - printf("s[id] Select subtitles\n"); - printf("q: Stop\n"); - printf("c: Continue\n"); - printf("p: Pause\n"); - printf("f: Increase speed (Fast forward) (stepwise)\n"); - printf("b: Decrease speed (Fast reverse) (stepwise)\n"); - printf("l: Print duration\n"); - printf("j: Print current PTS\n"); - printf("k[1,4,7]: Jump back [15,60,300] seconds\n"); - printf("k[3,6,9]: Jump forward [15,60,300] seconds\n"); - printf("i: Print Info\n"); - break; - } - } - } - - //printOutputCapabilities(); - - exit(0); -} diff --git a/evremote2/Cuberevo.c b/evremote2/Cuberevo.c deleted file mode 100644 index e3df736..0000000 --- a/evremote2/Cuberevo.c +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Cuberevo.c - * - * (c) 2011 konfetti - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "global.h" -#include "map.h" -#include "remotes.h" -#include "Cuberevo.h" - -/* ***************** some constants **************** */ - -#define rcDeviceName "/dev/rc" -#define cCuberevoCommandLen 2 - -/* ***************** our key assignment **************** */ - -static int version = 0; - -static tLongKeyPressSupport cLongKeyPressSupport = -{ - 10, 140, -}; - -static tButton cButtonCuberevo[] = -{ - {"KEY_F1" , "00", KEY_F1}, - {"KEY_F2" , "01", KEY_F2}, - {"KEY_F3" , "02", KEY_F3}, - {"INFO" , "03", KEY_INFO}, - {"RADIO" , "04", KEY_RADIO}, - {"PREVIOUS" , "05", KEY_PREVIOUS}, - {"EPG" , "06", KEY_EPG}, - {"RECORD" , "07", KEY_RECORD}, - {"FAVORITES" , "08", KEY_FAVORITES}, - {"MEDIA" , "09", KEY_MEDIA}, //fixme - {"STANDBY" , "0A", KEY_POWER}, - {"KEY_F5" , "0B", KEY_F5}, - {"MUTE" , "0C", KEY_MUTE}, - {"ARCHIVE" , "0D", KEY_ARCHIVE}, //fixme - {"0BUTTON" , "10", KEY_0}, - {"1BUTTON" , "11", KEY_1}, - {"2BUTTON" , "12", KEY_2}, - {"3BUTTON" , "13", KEY_3}, - {"4BUTTON" , "14", KEY_4}, - {"5BUTTON" , "15", KEY_5}, - {"6BUTTON" , "16", KEY_6}, - {"7BUTTON" , "17", KEY_7}, - {"8BUTTON" , "18", KEY_8}, - {"9BUTTON" , "19", KEY_9}, - {"UP" , "1A", KEY_UP}, - {"DOWN" , "1B", KEY_DOWN}, - {"RIGHT" , "1C", KEY_RIGHT}, - {"LEFT" , "1D", KEY_LEFT}, - {"REWIND" , "1E", KEY_REWIND}, - {"OK" , "1F", KEY_OK}, - {"PLAY" , "20", KEY_PLAY}, - {"FASTFORWARD" , "21", KEY_FASTFORWARD}, - {"STOP" , "22", KEY_STOP}, - {"SLOW" , "23", KEY_SLOW}, - {"AGAIN" , "24", KEY_AGAIN}, - {"PAUSE" , "25", KEY_PAUSE}, - {"MENU" , "26", KEY_MENU}, - {"EXIT" , "27", KEY_HOME}, - {"KEY_F7" , "28", KEY_F7}, - {"KEY_BOOMARKS" , "29", KEY_BOOKMARKS}, - {"RED" , "2A", KEY_RED}, - {"BLUE" , "2B", KEY_BLUE}, - {"KEY_F8" , "2C", KEY_F8}, - {"GREEN" , "2D", KEY_GREEN}, - {"YELLOW" , "2E", KEY_YELLOW}, - {"AUDIO" , "2F", KEY_AUDIO}, - {"SUBTITLE" , "30", KEY_SUBTITLE}, - {"TEXT" , "31", KEY_TEXT}, - {"CHANNELUP" , "32", KEY_CHANNELUP}, - {"CHANNELDOWN" , "33", KEY_CHANNELDOWN}, - {"VOLUMEUP" , "34", KEY_VOLUMEUP}, - {"VOLUMEDOWN" , "35", KEY_VOLUMEDOWN}, - {"WWW" , "36", KEY_WWW}, - {"" , "" , KEY_NULL}, -}; - -/* ***************** our fp button assignment **************** */ - -typedef struct -{ - char *KeyName; - unsigned short code; - int KeyCode; -} key_table_t; - -key_table_t front_keymap_13grid[] = -{ - { "STANDBY", 0x1000, KEY_POWER }, /* front power */ - { "LEFT" , 0x0002, KEY_LEFT }, /* front left */ - { "RIGHT" , 0x0004, KEY_RIGHT }, /* front right */ - { "UP" , 0x4000, KEY_UP }, /* front up */ - { "FILE" , 0x2000, KEY_MEDIA }, /* front file */ - { "DOWN" , 0x0040, KEY_DOWN }, /* front down */ - { "OK" , 0x0020, KEY_OK }, /* front ok */ - { "HOME" , 0x0010, KEY_HOME }, /* front back */ - { "MENU" , 0x0001, KEY_MENU }, /* front menu */ - { "RELEASE", 0xFFFF, KEY_NULL }, /* release */ - { "" , 0x0000, KEY_NULL }, -}; - -key_table_t front_keymap_7seg[] = -{ - { "STANDBY" , 0x0001, KEY_POWER }, /* front power */ - { "MENU" , 0x0002, KEY_MENU }, /* front menu */ - { "EXIT" , 0x0004, KEY_HOME }, /* front exit */ - { "OK" , 0x0010, KEY_OK }, /* front ok */ - { "LEFT" , 0x0020, KEY_LEFT }, /* front left */ - { "RIGHT" , 0x0040, KEY_RIGHT }, /* front right */ - { "UP" , 0x0080, KEY_UP }, /* front up */ - { "DOWN" , 0x0100, KEY_DOWN }, /* front down */ - { "" , 0x0000, KEY_NULL }, -}; - -key_table_t front_keymap_12dotmatrix[] = -{ - { "STANDBY", (1 << 0), KEY_POWER }, /* front power */ - { "MENU" , (1 << 1), KEY_MENU }, /* front menu */ - { "HOME" , (1 << 2), KEY_HOME }, /* front back */ - { "FILE" , (1 << 3), KEY_MEDIA }, /* front file */ - { "OK" , (1 << 4), KEY_OK }, /* front ok */ - { "LEFT" , (1 << 5), KEY_LEFT }, /* front left */ - { "RIGHT" , (1 << 6), KEY_RIGHT }, /* front right */ - { "UP" , (1 << 7), KEY_UP }, /* front up */ - { "DOWN" , (1 << 8), KEY_DOWN }, /* front down */ - { "RELEASE", 0xFFFF, KEY_NULL }, /* front release */ - { "" , 0x0000, KEY_NULL }, -}; - -int getCuberevoCode(key_table_t *cKeys, unsigned short code) -{ - int vLoop = 0; - - for (vLoop = 0; cKeys[vLoop].KeyCode != KEY_NULL; vLoop++) - { - if (cKeys[vLoop].code == code) - { - printf("%02X - %s\n", cKeys[vLoop].KeyCode, cKeys[vLoop].KeyName); - return cKeys[vLoop].KeyCode; - } - } - - return 0; -} - -static int pInit(Context_t *context, int argc, char *argv[]) -{ - struct micom_ioctl_data micom; - int vFd; - vFd = open(rcDeviceName, O_RDWR); - - if (argc >= 2) - { - cLongKeyPressSupport.period = atoi(argv[1]); - } - - if (argc >= 3) - { - cLongKeyPressSupport.delay = atoi(argv[2]); - } - - printf("period %d, delay %d\n", cLongKeyPressSupport.period, cLongKeyPressSupport.delay); - - if (ioctl(vFd, VFDGETVERSION, &micom) < 0) - { - perror("getVersion: "); - } - - printf("micom version = %d\n", micom.u.version.version); - version = micom.u.version.version; - - return vFd; -} - - -static int pRead(Context_t *context) -{ - unsigned char vData[cCuberevoCommandLen]; - eKeyType vKeyType = RemoteControl; - static int vNextKey = 0; - static int lastCode = 0; - int vCurrentCode = -1; - - //printf("%s >\n", __func__); - - while (1) - { - read(context->fd, vData, cCuberevoCommandLen); - - if (vData[0] == 0xe0) - vKeyType = RemoteControl; - else if (vData[0] == 0xE1) - vKeyType = FrontPanel; - else if (vData[0] == 0xE2) - vKeyType = FrontPanel; - else - continue; - - printf("data[0] 0x%2x, data[1] 0x%2x\n", vData[0], vData[1]); - - if (vKeyType == RemoteControl) - { - if (vData[1] != 0xff) - { - vCurrentCode = - getInternalCodeHex((tButton *)((RemoteControl_t *)context->r)->RemoteControl, vData[1]); - } - else - { - vCurrentCode = lastCode = 0; - } - - if (vCurrentCode != 0) - { - vNextKey = ((vCurrentCode != lastCode) ? vNextKey + 1 : vNextKey) % 0x100; - lastCode = vCurrentCode; - -// printf("nextFlag %d\n", vNextKey); - - vCurrentCode += (vNextKey << 16); - - break; - } - } - else - { - static int front_key; - - if (vData[0] == 0xE1) - { - front_key = vData[1] << 8; - vCurrentCode = 0; - } - else - { - front_key |= vData[1]; - - printf("front_key = 0x%04x\n", front_key); - - /* 12 dot, 12 and 14 segs */ - if ((version == 0) || (version == 2)) - vCurrentCode = getCuberevoCode(front_keymap_12dotmatrix, front_key); - else if (version == 3) - vCurrentCode = getCuberevoCode(front_keymap_7seg, front_key); - else - vCurrentCode = getCuberevoCode(front_keymap_13grid, front_key); - - if (vCurrentCode != 0) - { - vNextKey = ((vCurrentCode != lastCode) ? vNextKey + 1 : vNextKey) % 0x100; - lastCode = vCurrentCode; - - // printf("nextFlag %d\n", vNextKey); - - vCurrentCode += (vNextKey << 16); - - break; - } - -// if (vCurrentCode == 0xffff) /* key release */ -// vCurrentCode = 0x0000; - } - } - } - - printf("%s < %08X\n", __func__, vCurrentCode); - - return vCurrentCode; -} - -static int pNotification(Context_t *context, const int cOn) -{ - - return 0; -} - -static int pShutdown(Context_t *context) -{ - - close(context->fd); - - return 0; -} - -RemoteControl_t Cuberevo_RC = -{ - "Cuberevo RemoteControl", - Cuberevo, - &pInit, - &pShutdown, - &pRead, - &pNotification, - cButtonCuberevo, - NULL, - NULL, - 1, - &cLongKeyPressSupport, -}; - diff --git a/evremote2/Cuberevo.h b/evremote2/Cuberevo.h deleted file mode 100644 index e3c4ab1..0000000 --- a/evremote2/Cuberevo.h +++ /dev/null @@ -1,116 +0,0 @@ -#ifndef _cuberevo_ -#define _cuberevo_ - -/* ioctl numbers ->hacky */ -#define VFDBRIGHTNESS 0xc0425a03 -#define VFDPWRLED 0xc0425a04 -#define VFDDRIVERINIT 0xc0425a08 -#define VFDICONDISPLAYONOFF 0xc0425a0a -#define VFDDISPLAYWRITEONOFF 0xc0425a05 -#define VFDDISPLAYCHARS 0xc0425a00 - -#define VFDCLEARICONS 0xc0425af6 -#define VFDSETRF 0xc0425af7 -#define VFDSETFAN 0xc0425af8 -#define VFDGETWAKEUPMODE 0xc0425af9 -#define VFDGETTIME 0xc0425afa -#define VFDSETTIME 0xc0425afb -#define VFDSTANDBY 0xc0425afc -#define VFDREBOOT 0xc0425afd -#define VFDSETLED 0xc0425afe -#define VFDSETMODE 0xc0425aff - -#define VFDGETWAKEUPTIME 0xc0425b00 -#define VFDGETVERSION 0xc0425b01 - -struct set_brightness_s -{ - int level; -}; - -struct set_led_s -{ - int led_nr; - int on; -}; - -struct set_fan_s -{ - int on; -}; - -struct set_rf_s -{ - int on; -}; - -struct set_icon_s -{ - int icon_nr; - int on; -}; - -/* YYMMDDhhmm */ -struct set_standby_s -{ - char time[10]; -}; - -/* YYMMDDhhmmss */ -struct set_time_s -{ - char time[12]; -}; - -/* YYMMDDhhmmss */ -struct get_time_s -{ - char time[12]; -}; - -struct get_wakeupstatus -{ - char status; -}; - -/* YYMMDDhhmmss */ -struct get_wakeuptime -{ - char time[12]; -}; - -/* this setups the mode temporarily (for one ioctl) - * to the desired mode. currently the "normal" mode - * is the compatible vfd mode - */ -struct set_mode_s -{ - int compat; /* 0 = compatibility mode to vfd driver; 1 = micom mode */ -}; - -/* 0 = 12dot 12seg, 1 = 13grid, 2 = 12 dot 14seg, 3 = 7seg */ -struct get_version_s -{ - int version; -}; - -struct micom_ioctl_data -{ - union - { - struct set_icon_s icon; - struct set_led_s led; - struct set_fan_s fan; - struct set_rf_s rf; - struct set_brightness_s brightness; - struct set_mode_s mode; - struct set_standby_s standby; - struct set_time_s time; - struct get_time_s get_time; - struct get_wakeupstatus status; - struct get_wakeuptime wakeup_time; - struct get_version_s version; - } u; -}; - -#endif diff --git a/evremote2/Fortis.c b/evremote2/Fortis.c deleted file mode 100644 index f3b98e6..0000000 --- a/evremote2/Fortis.c +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Fortis.c - * - * (c) 2009 teamducktales - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "global.h" -#include "map.h" -#include "remotes.h" -#include "Fortis.h" - -/* ***************** some constants **************** */ - -#define rcDeviceName "/dev/rc" -#define cFortisDataLen 128 - -typedef struct -{ -} tFortisPrivate; - -/* ***************** our key assignment **************** */ - -static tLongKeyPressSupport cLongKeyPressSupport = -{ - 10, 140, -}; - -static tButton cButtonFortis[] = -{ - {"MENU" , "04", KEY_MENU}, - {"RED" , "4B", KEY_RED}, - {"GREEN" , "4A", KEY_GREEN}, - {"YELLOW" , "49", KEY_YELLOW}, - {"BLUE" , "48", KEY_BLUE}, - {"EXIT" , "1C", KEY_HOME}, - {"TEXT" , "0D", KEY_TEXT}, - {"EPG" , "08", KEY_EPG}, - {"REWIND" , "58", KEY_REWIND}, - {"FASTFORWARD" , "5C", KEY_FASTFORWARD}, - {"PLAY" , "55", KEY_PLAY}, - {"PAUSE" , "07", KEY_PAUSE}, - {"RECORD" , "56", KEY_RECORD}, - {"STOP" , "54", KEY_STOP}, - {"STANDBY" , "0A", KEY_POWER}, - {"MUTE" , "0C", KEY_MUTE}, - {"CHANNELUP" , "5E", KEY_PAGEUP}, - {"CHANNELDOWN" , "5F", KEY_PAGEDOWN}, - {"VOLUMEUP" , "4E", KEY_VOLUMEUP}, - {"VOLUMEDOWN" , "4F", KEY_VOLUMEDOWN}, - {"INFO" , "06", KEY_INFO}, - {"OK" , "1F", KEY_OK}, - {"UP" , "00", KEY_UP}, - {"RIGHT" , "02", KEY_RIGHT}, - {"DOWN" , "01", KEY_DOWN}, - {"LEFT" , "03", KEY_LEFT}, - {"RECALL" , "09", KEY_HELP}, - {"ZOOM" , "0B", KEY_ZOOM}, - {"VFORMAT" , "0E", KEY_ANGLE}, - {"RESOLUTION" , "0F", KEY_SCREEN}, - {"TVRADIO" , "1A", KEY_MODE}, - {"SLEEP" , "1E", KEY_SLOW}, - {"OPEN" , "40", KEY_DIRECTORY}, - {"FAV" , "41", KEY_FAVORITES}, - {"CHECK" , "42", KEY_SELECT}, - {"UPUP" , "43", KEY_TEEN}, - {"DOWNDOWN" , "44", KEY_TWEN}, - {"NEXT" , "4C", KEY_NEXT}, - {"LAST" , "50", KEY_PREVIOUS}, - {"PIP" , "51", KEY_OPTION}, - {"SWAP" , "52", KEY_GOTO}, - {"LIST" , "53", KEY_SUBTITLE}, - {"0BUTTON" , "10", KEY_0}, - {"1BUTTON" , "11", KEY_1}, - {"2BUTTON" , "12", KEY_2}, - {"3BUTTON" , "13", KEY_3}, - {"4BUTTON" , "14", KEY_4}, - {"5BUTTON" , "15", KEY_5}, - {"6BUTTON" , "16", KEY_6}, - {"7BUTTON" , "17", KEY_7}, - {"8BUTTON" , "18", KEY_8}, - {"9BUTTON" , "19", KEY_9}, - {"" , "" , KEY_NULL} -}; - -/* ***************** our fp button assignment **************** */ - -static tButton cButtonFortisFrontpanel[] = -{ - {"STANDBY" , "00", KEY_POWER}, - {"OK" , "06", KEY_OK}, - {"MENU" , "05", KEY_MENU}, - {"VOLUMEUP" , "03", KEY_VOLUMEUP}, - {"VOLUMEDOWN" , "04", KEY_VOLUMEDOWN}, - {"CHANNELUP" , "01", KEY_PAGEUP}, - {"CHANNELDOWN" , "02", KEY_PAGEDOWN}, - {"" , "" , KEY_NULL} -}; - -static int pInit(Context_t *context, int argc, char *argv[]) -{ - int vFd; - tFortisPrivate *private = malloc(sizeof(tFortisPrivate)); - - ((RemoteControl_t *)context->r)->private = private; - - memset(private, 0, sizeof(tFortisPrivate)); - - vFd = open(rcDeviceName, O_RDWR); - - if (argc >= 2) - { - cLongKeyPressSupport.period = atoi(argv[1]); - } - - if (argc >= 3) - { - cLongKeyPressSupport.delay = atoi(argv[2]); - } - - printf("period %d, delay %d\n", cLongKeyPressSupport.period, cLongKeyPressSupport.delay); - - return vFd; -} - - -static int pRead(Context_t *context) -{ - unsigned char vData[cFortisDataLen]; - eKeyType vKeyType = RemoteControl; - int vCurrentCode = -1; - static int vNextKey = 0; - static char vOldButton = 0; - - while (1) - { -#if 0 - int vLoop; - int n = -#endif - read(context->fd, vData, cFortisDataLen); - -#if 0 - printf("(len %d): ", n); - - for (vLoop = 0; vLoop < n; vLoop++) - printf("0x%02X ", vData[vLoop]); - - printf("\n"); -#endif - - if ((vData[2] != 0x51) && (vData[2] != 0x63) && (vData[2] != 0x80)) - continue; - - if (vData[2] == 0x63) - vKeyType = RemoteControl; - else if (vData[2] == 0x51) - vKeyType = FrontPanel; - else - continue; - - if (vKeyType == RemoteControl) - { - vCurrentCode = getInternalCodeHex((tButton *)((RemoteControl_t *)context->r)->RemoteControl, vData[5] & ~0x80); - - if (vCurrentCode != 0) - { - vNextKey = (vData[5] & (0x80 == 0 ? vNextKey + 1 : vNextKey)) % 0x100; - - /* printf("nextFlag %d\n", vNextKey);*/ - - vCurrentCode += (vNextKey << 16); - break; - } - } - else - { - vCurrentCode = getInternalCodeHex((tButton *)((RemoteControl_t *)context->r)->Frontpanel, vData[3]); - - if (vCurrentCode != 0) - { - vNextKey = (vOldButton != vData[3] ? vNextKey + 1 : vNextKey) % 0x100; - - /* printf("nextFlag %d\n", vNextKey);*/ - - vCurrentCode += (vNextKey << 16); - break; - } - } - } /* for later use we make a dummy while loop here */ - - return vCurrentCode; -} - -static int pNotification(Context_t *context, const int cOn) -{ - /* noop: is handled from fp itself */ - return 0; -} - -static int pShutdown(Context_t *context) -{ - tFortisPrivate *private = (tFortisPrivate *)((RemoteControl_t *)context->r)->private; - - close(context->fd); - free(private); - - return 0; -} - -RemoteControl_t Fortis_RC = -{ - "Fortis RemoteControl", - Fortis, - &pInit, - &pShutdown, - &pRead, - &pNotification, - cButtonFortis, - cButtonFortisFrontpanel, - NULL, - 1, - &cLongKeyPressSupport, -}; diff --git a/evremote2/Fortis.h b/evremote2/Fortis.h deleted file mode 100644 index 3d379d0..0000000 --- a/evremote2/Fortis.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef _fortis_ -#define _fortis_ - -#endif diff --git a/evremote2/Ipbox.c b/evremote2/Ipbox.c deleted file mode 100644 index b30c28b..0000000 --- a/evremote2/Ipbox.c +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Ipbox.c based on Hl101.c - * - * (c) 2010 duckbox project - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "global.h" -#include "map.h" -#include "remotes.h" -#include "Ipbox.h" - -static tLongKeyPressSupport cLongKeyPressSupport = -{ - 10, 120, -}; - -/* Spider Box HL-101 RCU */ -static tButton cButtonsSpideroxIpbox[] = -{ - {"POWER " , "ff", KEY_POWER}, - {"MUTE" , "fd", KEY_MUTE}, - {"TV" , "0f", KEY_TV}, - {"RADIO" , "ad", KEY_RADIO}, - {"VIDEO" , "f9", KEY_VIDEO}, - - - {"0BUTTON" , "8f", KEY_0}, - {"1BUTTON" , "3f", KEY_1}, - {"2BUTTON" , "bf", KEY_2}, - {"3BUTTON" , "7f", KEY_3}, - {"4BUTTON" , "1f", KEY_4}, - {"5BUTTON" , "9f", KEY_5}, - {"6BUTTON" , "5f", KEY_6}, - {"7BUTTON" , "2f", KEY_7}, - {"8BUTTON" , "af", KEY_8}, - {"9BUTTON" , "6f", KEY_9}, - - - {"INFO" , "47", KEY_INFO}, - {"AUDIO" , "29", KEY_AUDIO}, - {"SUBTITLE" , "a9", KEY_SUBTITLE}, - {"TEXT" , "d7", KEY_TEXT}, - {"PROG1" , "e9", KEY_PROG1}, - {"PROG2" , "b7", KEY_PROG2}, - {"ZOOM" , "69", KEY_ZOOM}, - {"DIRECTION" , "6d", KEY_DIRECTION}, - {"EMAIL" , "97", KEY_EMAIL}, - {"HELP" , "87", KEY_HELP}, - {"UNDO" , "07", KEY_UNDO}, - - {"DOWN" , "27", KEY_DOWN}, - {"UP" , "a7", KEY_UP}, - {"RIGHT" , "4f", KEY_RIGHT}, - {"LEFT" , "77", KEY_LEFT}, - {"OK" , "ef", KEY_OK}, - {"MENU" , "67", KEY_MENU}, - {"EPG" , "79", KEY_EPG}, - {"EXIT" , "df", KEY_HOME}, - {"PAGEUP" , "39", KEY_PAGEUP}, - {"PAGEDOWN" , "b9", KEY_PAGEDOWN}, - {"CHANNELUP" , "f7", KEY_CHANNELUP}, - {"CHANNELDOWN" , "59", KEY_CHANNELDOWN}, - {"VOLUMEUP" , "99", KEY_VOLUMEUP}, - {"VOLUMEDOWN" , "19", KEY_VOLUMEDOWN}, - - {"RED" , "f5", KEY_RED}, - {"GREEN" , "d5", KEY_GREEN}, - {"YELLOW" , "7d", KEY_YELLOW}, - {"BLUE" , "75", KEY_BLUE}, - - - {"REWIND" , "d9", KEY_REWIND}, - {"PAUSE" , "b5", KEY_PAUSE}, - {"PLAY" , "17", KEY_PLAY}, - {"FASTFORWARD" , "89", KEY_FASTFORWARD}, - {"RECORD" , "35", KEY_RECORD}, - {"STOP" , "c7", KEY_STOP}, - {"ANGLE" , "8d", KEY_ANGLE}, - {"REFRESH" , "cd", KEY_REFRESH}, - - {"" , "" , KEY_NULL}, -}; -/* fixme: move this to a structure and - * use the private structure of RemoteControl_t - */ -static struct sockaddr_un vAddr; - -static int pInit(Context_t *context, int argc, char *argv[]) -{ - - int vHandle; - - vAddr.sun_family = AF_UNIX; - // in new lircd its moved to /var/run/lirc/lircd by default and need use key to run as old version - - strcpy(vAddr.sun_path, "/var/run/lirc/lircd"); - - vHandle = socket(AF_UNIX, SOCK_STREAM, 0); - - if (vHandle == -1) - { - perror("socket"); - return -1; - } - - if (connect(vHandle, (struct sockaddr *)&vAddr, sizeof(vAddr)) == -1) - { - perror("connect"); - return -1; - } - - return vHandle; -} - -static int pShutdown(Context_t *context) -{ - - close(context->fd); - - return 0; -} - -static int pRead(Context_t *context) -{ - char vBuffer[128]; - char vData[10]; - const int cSize = 128; - int vCurrentCode = -1; - - memset(vBuffer, 0, 128); - //wait for new command - read(context->fd, vBuffer, cSize); - - //parse and send key event - vData[0] = vBuffer[17]; - vData[1] = vBuffer[18]; - vData[2] = '\0'; - - - vData[0] = vBuffer[14]; - vData[1] = vBuffer[15]; - vData[2] = '\0'; - - printf("[RCU] key: %s -> %s\n", vData, &vBuffer[0]); - vCurrentCode = getInternalCode((tButton *)((RemoteControl_t *)context->r)->RemoteControl, vData); - - if (vCurrentCode != 0) - { - static int nextflag = 0; - - if (('0' == vBuffer[17]) && ('0' == vBuffer[18])) - { - nextflag++; - } - - vCurrentCode += (nextflag << 16); - } - - return vCurrentCode; -} - -static int pNotification(Context_t *context, const int cOn) -{ - - struct micom_ioctl_data vfd_data; - int ioctl_fd = -1; - - if (cOn) - { - ioctl_fd = open("/dev/vfd", O_RDONLY); - vfd_data.u.icon.icon_nr = 35; - vfd_data.u.icon.on = 1; - ioctl(ioctl_fd, VFDICONDISPLAYONOFF, &vfd_data); - close(ioctl_fd); - } - else - { - usleep(100000); - ioctl_fd = open("/dev/vfd", O_RDONLY); - vfd_data.u.icon.icon_nr = 35; - vfd_data.u.icon.on = 0; - ioctl(ioctl_fd, VFDICONDISPLAYONOFF, &vfd_data); - close(ioctl_fd); - } - - return 0; -} - -RemoteControl_t Ipbox_RC = -{ - "Ipbox RemoteControl", - Ipbox, - &pInit, - &pShutdown, - &pRead, - &pNotification, - cButtonsSpideroxIpbox, - NULL, - NULL, - 1, - &cLongKeyPressSupport, -}; diff --git a/evremote2/Ipbox.h b/evremote2/Ipbox.h deleted file mode 100644 index 58bbd85..0000000 --- a/evremote2/Ipbox.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef __ipbox__ -#define __ipbox__ - -#define VFDICONDISPLAYONOFF 0xc0425a0a - -/* this setups the mode temporarily (for one ioctl) - * to the desired mode. currently the "normal" mode - * is the compatible vfd mode - */ -struct set_mode_s -{ - int compat; /* 0 = compatibility mode to vfd driver; 1 = nuvoton mode */ -}; - -struct set_brightness_s -{ - int level; -}; - -struct set_icon_s -{ - int icon_nr; - int on; -}; - -struct set_led_s -{ - int led_nr; - int on; -}; - -/* time must be given as follows: - * time[0] & time[1] = mjd ??? - * time[2] = hour - * time[3] = min - * time[4] = sec - */ -struct set_standby_s -{ - char time[5]; -}; - -struct set_time_s -{ - char time[5]; -}; - -struct micom_ioctl_data -{ - union - { - struct set_icon_s icon; - struct set_led_s led; - struct set_brightness_s brightness; - struct set_mode_s mode; - struct set_standby_s standby; - struct set_time_s time; - } u; -}; - -#endif diff --git a/evremote2/LircdName.c b/evremote2/LircdName.c deleted file mode 100755 index f0b9442..0000000 --- a/evremote2/LircdName.c +++ /dev/null @@ -1,449 +0,0 @@ -/* - * LircdName.c - * - * (c) 2014 duckbox project - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "global.h" -#include "map.h" -#include "remotes.h" - -#define REPEATDELAY 130 // ms -#define REPEATFREQ 20 // ms - -static tLongKeyPressSupport cLongKeyPressSupport = -{ - REPEATDELAY, REPEATFREQ /*delay, period*/ -}; - -static long long GetNow(void) -{ -#define MIN_RESOLUTION 1 // ms - static bool initialized = false; - static bool monotonic = false; - struct timespec tp; - - if (!initialized) - { - // check if monotonic timer is available and provides enough accurate resolution: - if (clock_getres(CLOCK_MONOTONIC, &tp) == 0) - { - //long Resolution = tp.tv_nsec; - // require a minimum resolution: - if (tp.tv_sec == 0 && tp.tv_nsec <= MIN_RESOLUTION * 1000000) - { - if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) - { - monotonic = true; - } - } - } - - initialized = true; - } - - if (monotonic) - { - if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) - return (long long)(tp.tv_sec) * 1000 + tp.tv_nsec / 1000000; - - monotonic = false; - // fall back to gettimeofday() - } - - struct timeval t; - - if (gettimeofday(&t, NULL) == 0) - return (long long)(t.tv_sec) * 1000 + t.tv_usec / 1000; - - return 0; -} - - -/* Key is recognized by name of it in lircd.conf */ -static tButton cButtons_LircdName[] = -{ - - {"KEY_OK" , "=>", KEY_OK}, - {"KEY_UP" , "=>", KEY_UP}, - {"KEY_DOWN" , "=>", KEY_DOWN}, - {"KEY_RIGHT" , "=>", KEY_RIGHT}, - {"KEY_LEFT" , "=>", KEY_LEFT}, - - {"KEY_RED" , "=>", KEY_RED}, - {"KEY_GREEN" , "=>", KEY_GREEN}, - {"KEY_YELLOW" , "=>", KEY_YELLOW}, - {"KEY_BLUE" , "=>", KEY_BLUE}, - {"KEY_POWER" , "=>", KEY_POWER}, - - {"KEY_VOLUMEUP" , "=>", KEY_VOLUMEUP}, - {"KEY_VOLUMEDOWN" , "=>", KEY_VOLUMEDOWN}, - {"KEY_MUTE" , "=>", KEY_MUTE}, - {"KEY_PAGEUP" , "=>", KEY_PAGEUP}, - {"KEY_PAGEDOWN" , "=>", KEY_PAGEDOWN}, - - {"KEY_MENU" , "=>", KEY_MENU}, - {"KEY_HOME" , "=>", KEY_HOME}, - {"KEY_OPTION" , "=>", KEY_OPTION}, - {"KEY_EPG" , "=>", KEY_EPG}, - {"KEY_GOTO" , "=>", KEY_GOTO}, - - {"KEY_PROGRAM" , "=>", KEY_PROGRAM}, - {"KEY_TEXT" , "=>", KEY_TEXT}, - {"KEY_HELP" , "=>", KEY_HELP}, - {"KEY_LIST" , "=>", KEY_LIST}, - {"KEY_MEDIA" , "=>", KEY_MEDIA}, - - {"KEY_1" , "=>", KEY_1}, - {"KEY_2" , "=>", KEY_2}, - {"KEY_3" , "=>", KEY_3}, - {"KEY_4" , "=>", KEY_4}, - {"KEY_5" , "=>", KEY_5}, - - {"KEY_6" , "=>", KEY_6}, - {"KEY_7" , "=>", KEY_7}, - {"KEY_8" , "=>", KEY_8}, - {"KEY_9" , "=>", KEY_9}, - {"KEY_0" , "=>", KEY_0}, - - {"KEY_PVR" , "=>", KEY_PVR}, - {"KEY_PLAY" , "=>", KEY_PLAY}, - {"KEY_PAUSE" , "=>", KEY_PAUSE}, - {"KEY_RECORD" , "=>", KEY_RECORD}, - {"KEY_STOP" , "=>", KEY_STOP}, - {"KEY_FASTFORWARD" , "=>", KEY_FASTFORWARD}, - {"KEY_REWIND" , "=>", KEY_REWIND}, - - {"KEY_MODE" , "=>", KEY_MODE}, - {"KEY_SUBTITLE" , "=>", KEY_SUBTITLE}, - {"KEY_V" , "=>", KEY_V}, - {"KEY_AUX" , "=>", KEY_AUX}, - {"KEY_TIME" , "=>", KEY_TIME}, - - {"KEY_TV2" , "=>", KEY_TV2}, - {"KEY_BACK" , "=>", KEY_BACK}, - {"KEY_FIND" , "=>", KEY_FIND}, - {"KEY_ARCHIVE" , "=>", KEY_ARCHIVE}, - {"KEY_INFO" , "=>", KEY_INFO}, - - {"KEY_FAVORITES" , "=>", KEY_FAVORITES}, - {"KEY_SAT" , "=>", KEY_SAT}, - {"KEY_PREVIOUS" , "=>", KEY_PREVIOUS}, - {"KEY_NEXT" , "=>", KEY_NEXT}, - {"KEY_F" , "=>", KEY_F}, - - {"KEY_SLOW" , "=>", KEY_SLOW}, - {"KEY_P" , "=>", KEY_P}, - {"KEY_CLOSE" , "=>", KEY_CLOSE}, - {"KEY_T" , "=>", KEY_T}, - {"KEY_F1" , "=>", KEY_F1}, - - {"KEY_F2" , "=>", KEY_F2}, - {"KEY_F3" , "=>", KEY_F3}, - {"KEY_SELECT" , "=>", KEY_SELECT}, - {"KEY_POWER2" , "=>", KEY_POWER2}, - {"KEY_CLEAR" , "=>", KEY_CLEAR}, - - {"KEY_VENDOR" , "=>", KEY_VENDOR}, - {"KEY_CHANNEL" , "=>", KEY_CHANNEL}, - {"KEY_MHP" , "=>", KEY_MHP}, - {"KEY_LANGUAGE" , "=>", KEY_LANGUAGE}, - {"KEY_TITLE" , "=>", KEY_TITLE}, - - {"KEY_ANGLE" , "=>", KEY_ANGLE}, - {"KEY_ZOOM" , "=>", KEY_ZOOM}, - {"KEY_KEYBOARD" , "=>", KEY_KEYBOARD}, - {"KEY_SCREEN" , "=>", KEY_SCREEN}, - {"KEY_PC" , "=>", KEY_PC}, - - {"KEY_TV" , "=>", KEY_TV}, - {"KEY_VCR" , "=>", KEY_VCR}, - {"KEY_VCR2" , "=>", KEY_VCR2}, - {"KEY_SAT2" , "=>", KEY_SAT2}, - {"KEY_CD" , "=>", KEY_CD}, - - {"KEY_TAPE" , "=>", KEY_TAPE}, - {"KEY_RADIO" , "=>", KEY_RADIO}, - {"KEY_TUNER" , "=>", KEY_TUNER}, - {"KEY_PLAYER" , "=>", KEY_PLAYER}, - {"KEY_DVD" , "=>", KEY_DVD}, - - {"KEY_MP3" , "=>", KEY_MP3}, - {"KEY_AUDIO" , "=>", KEY_AUDIO}, - {"KEY_VIDEO" , "=>", KEY_VIDEO}, - {"KEY_DIRECTORY" , "=>", KEY_DIRECTORY}, - {"KEY_MEMO" , "=>", KEY_MEMO}, - - {"KEY_CALENDAR" , "=>", KEY_CALENDAR}, - {"KEY_CHANNELUP" , "=>", KEY_CHANNELUP}, - {"KEY_CHANNELDOWN" , "=>", KEY_CHANNELDOWN}, - {"KEY_FIRST" , "=>", KEY_FIRST}, - {"KEY_LAST" , "=>", KEY_LAST}, - - {"KEY_AB" , "=>", KEY_AB}, - {"KEY_RESTART" , "=>", KEY_RESTART}, - {"KEY_SHUFFLE" , "=>", KEY_SHUFFLE}, - {"KEY_DIGITS" , "=>", KEY_DIGITS}, - {"KEY_TEEN" , "=>", KEY_TEEN}, - - {"KEY_TWEN" , "=>", KEY_TWEN}, - {"KEY_BREAK" , "=>", KEY_BREAK}, - {"KEY_PLAYPAUSE" , "=>", KEY_PLAYPAUSE}, - {"KEY_EXIT" , "=>", KEY_EXIT}, - {"KEY_SLEEP" , "=>", KEY_SLEEP}, - {"KEY_OPEN" , "=>", KEY_OPEN}, - {"KEY_POWERON" , "=>", KEY_POWERON}, - {"KEY_POWEROFF" , "=>", KEY_POWEROFF}, - {"KEY_STANDBYON" , "=>", KEY_STANDBYON}, - {"KEY_STANDBYOFF" , "=>", KEY_STANDBYOFF}, - {"" , "" , KEY_NULL}, -}; -/* fixme: move this to a structure and - * use the private structure of RemoteControl_t - */ -static struct sockaddr_un vAddr; - -static int LastKeyCode = -1; -static char LastKeyName[30]; -static long long LastKeyPressedTime; -static int LircdBtnDelay = REPEATDELAY; -static int KeyPowerCounter = 0; -static int BlinkingIcon = -1; - -static int pInit(Context_t *context, int argc, char *argv[]) -{ - int vHandle; - - vAddr.sun_family = AF_UNIX; - - if (argc >= 4) - LircdBtnDelay = (atoi(argv[3]) == 0) ? REPEATDELAY : atoi(argv[3]); - if (argc >= 5) - { - BlinkingIcon = (atoi(argv[4]) == 0) ? 0 : atoi(argv[4]); - printf("[LircdName RCU] init delay %d ms, blinking ICON %i\n", LircdBtnDelay, BlinkingIcon); - } - else - printf("[LircdName RCU] init delay %d ms\n", LircdBtnDelay); - - // in new lircd its moved to /var/run/lirc/lircd by default and need use key to run as old version - if (access("/var/run/lirc/lircd", F_OK) == 0) - strcpy(vAddr.sun_path, "/var/run/lirc/lircd"); - else - { - strcpy(vAddr.sun_path, "/dev/lircd"); - } - - vHandle = socket(AF_UNIX, SOCK_STREAM, 0); - - if (vHandle == -1) - { - perror("socket"); - return -1; - } - - if (connect(vHandle, (struct sockaddr *)&vAddr, sizeof(vAddr)) == -1) - { - perror("connect"); - return -1; - } - - return vHandle; -} - -static int pShutdown(Context_t *context) -{ - - close(context->fd); - - return 0; -} - -static int pRead(Context_t *context) -{ - char vBuffer[128]; - char vData[3]; - const int cSize = 128; - int vCurrentCode = -1; - char *buffer; - char KeyName[30]; //For flexibility we use Lircd keys names - int LastKeyNameChar; //for long detection on RCU sending different codes for short/long - int count; - tButton *cButtons = cButtons_LircdName; - - long long LastTime; - - memset(vBuffer, 0, 128); - - //wait for new command - read(context->fd, vBuffer, cSize); - - if (sscanf(vBuffer, "%*x %x %29s", &count, KeyName) != 2) // '29' in '%29s' is LIRC_KEY_BUF-1! - { - printf("[LircdName RCU] Warning: unparseable lirc command: %s\n", vBuffer); - return -1; - } - - //some RCUs send different codes for single click and long push. This breakes e2 LONG detection, because lircd counter starts from beginning - //workarround is to define names for long codes ending '&' in lircd.conf and using this marker to copunt data correctly - LastKeyNameChar = strlen(KeyName) - 1 ; - if (KeyName[LastKeyNameChar] == 0x26) //& - { - //printf("[LircdName RCU] LONG detected\n"); - count += 1; - KeyName[LastKeyNameChar] = 0; - } - - vCurrentCode = getInternalCodeLircKeyName(cButtons, KeyName); - - if (vCurrentCode != 0) - { - static int nextflag = 0; - if (count == 0) - { - //Emergency reboot after 5xPOWER, we count only presses within 2 seconds, not lONGs - if (!strncasecmp(LastKeyName, "KEY_POWER", 9) && !strncasecmp(KeyName, "KEY_POWER", 9) && (GetNow() - LastKeyPressedTime < 2000)) - { - KeyPowerCounter += 1; - printf("[LircdName RCU] KEY_POWER pressed %d time(s)\n", KeyPowerCounter); - if (KeyPowerCounter >= 5) - { - printf("[LircdName RCU] EMERGENCY REBOOT !!!\n"); - fflush(stdout); - system("init 6"); - sleep(4); - reboot(LINUX_REBOOT_CMD_RESTART); - return -1; - } - } - else - KeyPowerCounter = 0; - //time checking - if ((LastKeyCode == vCurrentCode) && (GetNow() - LastKeyPressedTime < LircdBtnDelay)) // (diffMilli(LastKeyPressedTime, CurrKeyPressedTime) <= REPEATDELAY) ) - { - printf("[LircdName RCU] skiping next press of same key coming in too fast %lld ms\n", GetNow() - LastKeyPressedTime); - return -1; - } - else if (GetNow() - LastKeyPressedTime < LircdBtnDelay) - { - printf("[LircdName RCU] skiping different keys coming in too fast %lld ms\n", GetNow() - LastKeyPressedTime); - return -1; - } - else - { - printf("[RCU LircdName] new KeyName: '%s', after %lld ms, LastKey: '%s', count: %i -> %s\n", KeyName, GetNow() - LastKeyPressedTime, LastKeyName, count, &vBuffer[0]); - } - nextflag++; - - } - else - printf("[RCU LircdName] same KeyName: '%s', after %lld ms, LastKey: '%s', count: %i -> %s\n", KeyName, GetNow() - LastKeyPressedTime, LastKeyName, count, &vBuffer[0]); - - LastKeyCode = vCurrentCode; - LastKeyPressedTime = GetNow(); - strcpy(LastKeyName, KeyName); - - vCurrentCode += (nextflag << 16); - } - else - printf("[RCU LircdName] unknown key -> %s\n", &vBuffer[0]); - - return vCurrentCode; - - -} - -static int pNotification(Context_t *context, const int cOn) -{ - if ((BlinkingIcon == -1)) // && (cOn == 1)) - { - printf("[LircdName RCU] << end\n"); - return 0; - } - - //printf("[LircdName RCU] ICON %i %i\n", BlinkingIcon, cOn); - - int file_vfd = -1; - char icon = BlinkingIcon; - - - struct - { - unsigned char start; - unsigned char data[64]; - unsigned char length; - } data; - - struct - { - int icon_nr; - int on; - } vfd_icon; - - data.start = 0x00; - data.data[0] = icon; - data.data[4] = cOn; - data.length = 5; - - vfd_icon.icon_nr = icon; - vfd_icon.on = cOn; - - if ((file_vfd = open("/dev/vfd", O_RDWR)) == -1) - { - printf("[LircdName]: could not open vfd-device!\n"); - } - else - { - ioctl(file_vfd, 0xc0425a0a, &data); //0xc0425a0a = VFDICONDISPLAYONOFF - ioctl(file_vfd, 0xc0425a0a, &vfd_icon); //0xc0425a0a = VFDICONDISPLAYONOFF - close(file_vfd); - } - return 0; -} - -RemoteControl_t LircdName_RC = -{ - "LircdName Universal RemoteControl v.1.2", - LircdName, - &pInit, - &pShutdown, - &pRead, - &pNotification, - cButtons_LircdName, - NULL, - NULL, - 1, - &cLongKeyPressSupport, -}; diff --git a/evremote2/Makefile.am b/evremote2/Makefile.am deleted file mode 100755 index f1976f4..0000000 --- a/evremote2/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -bin_PROGRAMS = evremote2 evtest - -evremote2_SOURCES = \ - evremote.c \ - global.c \ - remotes.c \ - Ufs910_1W.c \ - Ufs910_14W.c \ - Tf7700.c \ - Ufs912.c \ - Spark.c \ - Ufs922.c \ - Fortis.c \ - Cuberevo.c \ - Ipbox.c \ - LircdName.c - -AM_CFLAGS = -Wall -AM_LDFLAGS = -lrt -lpthread - -evtest_SOURCES = \ - evtest.c diff --git a/evremote2/Spark.c b/evremote2/Spark.c deleted file mode 100644 index 3971a55..0000000 --- a/evremote2/Spark.c +++ /dev/null @@ -1,989 +0,0 @@ -/* - * Spark.c - * - * (c) 2010 duckbox project - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "global.h" -#include "map.h" -#include "remotes.h" -#include "Spark.h" - - -#define SPARK_RC04_PREDATA "CC33" -#define SPARK_RC05_PREDATA "11EE" -#define SPARK_RC08_PREDATA "44BB" -#define SPARK_RC09_PREDATA "9966" -#define SPARK_RC12_PREDATA "08F7" -#define SPARK_DEFAULT_PREDATA "A25D" //HOF-12, SAB Unix Triple HD, Sogno Triple -#define SPARK_EDV_RC1 "C43B" -#define SPARK_EDV_RC2 "1CE3" -#define UFS910_RC660_PREDATA "2290" -#define UFS913_RC230_PREDATA "7FB9" -#define SAMSUNG_AA59_PREDATA "E0E0" - -#define STB_ID_GOLDENMEDIA_GM990 "09:00:07" -#define STB_ID_EDISION_PINGULUX "09:00:08" -#define STB_ID_AMIKO_ALIEN_SDH8900 "09:00:0A" -#define STB_ID_GALAXYINNOVATIONS_S8120 "09:00:0B" -#define STB_ID_SOGNO_TRIPLE_HD "0C:00:43" // Sogno Spark Triple -#define STB_ID_SAB_UNIX_TRIPLE_HD "0C:00:0E" // SAB Unix Triple HD (S903) - -char VendorStbId[] = "00:00:00\0"; - -static tLongKeyPressSupport cLongKeyPressSupport = -{ - 10, 120, -}; - -/* Edision argus-spark RCU */ -static tButton cButtonsEdisionSpark[] = -{ - {"STANDBY" , "25", KEY_POWER}, - {"MUTE" , "85", KEY_MUTE}, - {"V.FORMAT" , "ad", KEY_V}, - {"TV/SAT" , "c5", KEY_AUX}, - {"0BUTTON" , "57", KEY_0}, - {"1BUTTON" , "b5", KEY_1}, - {"2BUTTON" , "95", KEY_2}, - {"3BUTTON" , "bd", KEY_3}, - {"4BUTTON" , "f5", KEY_4}, - {"5BUTTON" , "d5", KEY_5}, - {"6BUTTON" , "fd", KEY_6}, - {"7BUTTON" , "35", KEY_7}, - {"8BUTTON" , "15", KEY_8}, - {"9BUTTON" , "3d", KEY_9}, - {"BACK" , "7f", KEY_BACK}, - {"INFO" , "a7", KEY_INFO}, //THIS IS WRONG SHOULD BE KEY_INFO - {"AUDIO" , "35", KEY_AUDIO}, - {"VOL+" , "C7", KEY_VOLUMEUP}, - {"VOL-" , "DD", KEY_VOLUMEDOWN}, - {"PAGE+" , "07", KEY_PAGEUP}, - {"PAGE-" , "5F", KEY_PAGEDOWN}, - {"DOWN" , "0f", KEY_DOWN}, - {"UP" , "27", KEY_UP}, - {"RIGHT" , "af", KEY_RIGHT}, - {"LEFT" , "6d", KEY_LEFT}, - {"OK/LIST" , "2f", KEY_OK}, - {"MENU" , "65", KEY_MENU}, - {"GUIDE" , "8f", KEY_EPG}, - {"EXIT" , "4d", KEY_HOME}, - {"FAV" , "87", KEY_FAVORITES}, - {"RED" , "7d", KEY_RED}, - {"GREEN" , "ff", KEY_GREEN}, - {"YELLOW" , "3f", KEY_YELLOW}, - {"BLUE" , "bf", KEY_BLUE}, - {"REWIND" , "1f", KEY_REWIND}, - {"PAUSE" , "37", KEY_PAUSE}, - {"PLAY" , "b7", KEY_PLAY}, - {"FASTFORWARD" , "97", KEY_FASTFORWARD}, - {"RECORD" , "45", KEY_RECORD}, - {"STOP" , "f7", KEY_STOP}, - {"SLOWMOTION" , "5d", KEY_SLOW}, - {"ARCHIVE" , "75", KEY_ARCHIVE}, - {"SAT" , "1d", KEY_SAT}, - {"STEPBACK" , "55", KEY_PREVIOUS}, - {"STEPFORWARD" , "d7", KEY_NEXT}, - {"MARK" , "8f", KEY_EPG}, - {"TV/RADIO" , "77", KEY_TV2}, //WE USE TV2 AS TV/RADIO SWITCH BUTTON - {"USB" , "95", KEY_CLOSE}, - {"TIMER" , "8d", KEY_TIME}, - {"" , "" , KEY_NULL} -}; - -/* spark RC8 */ -static tButton cButtonsSparkRc08[] = -{ - {"POWER" , "4D", KEY_POWER}, - {"MUTE" , "DD", KEY_MUTE}, - {"TIME" , "ED", KEY_TIME}, - {"V.FORMAT" , "AD", KEY_V}, - {"F1" , "0F", KEY_F1}, - {"TV/SAT" , "37", KEY_AUX}, - {"USB" , "0D", KEY_CLOSE}, - {"FIND" , "35", KEY_FIND}, - {"0BUTTON" , "27", KEY_0}, - {"1BUTTON" , "7D", KEY_1}, - {"2BUTTON" , "3F", KEY_2}, - {"3BUTTON" , "BD", KEY_3}, - {"4BUTTON" , "5D", KEY_4}, - {"5BUTTON" , "1F", KEY_5}, - {"6BUTTON" , "9D", KEY_6}, - {"7BUTTON" , "55", KEY_7}, - {"8BUTTON" , "17", KEY_8}, - {"9BUTTON" , "95", KEY_9}, - {"TV/RADIO" , "65", KEY_TV2}, //WE USE TV2 AS TV/RADIO SWITCHB - {"RECALL" , "A5", KEY_BACK}, - {"MENU" , "5F", KEY_MENU}, - {"INFO" , "1D", KEY_INFO}, - {"UP" , "9F", KEY_UP}, - {"DOWN" , "AF", KEY_DOWN}, - {"LEFT" , "3D", KEY_LEFT}, - {"RIGHT" , "7F", KEY_RIGHT}, - {"OK" , "BF", KEY_OK}, - {"EXIT" , "2D", KEY_HOME}, - {"EPG" , "25", KEY_EPG}, - {"VOL+" , "8D", KEY_VOLUMEUP}, - {"VOL-" , "B5", KEY_VOLUMEDOWN}, - {"REC" , "EF", KEY_RECORD}, - {"PAGE+" , "B7", KEY_PAGEUP}, - {"PAGE-" , "77", KEY_PAGEDOWN}, - {"FOLDER" , "E5", KEY_ARCHIVE}, - {"STOP" , "A7", KEY_STOP}, - {"PLAY" , "75", KEY_PLAY}, - {"PAUSE" , "F5", KEY_PAUSE}, - {"FASTFORWARD" , "CD", KEY_FASTFORWARD}, - {"REWIND" , "D5", KEY_REWIND}, - {"PREV" , "8F", KEY_PREVIOUS}, - {"NEXT" , "57", KEY_NEXT}, - {"Tms" , "4F", KEY_T}, - {"FAST" , "97", KEY_F}, - {"SLOW" , "15", KEY_SLOW}, - {"PLAY_MODE" , "6F", KEY_P}, - {"WHITE" , "67", KEY_W}, - {"RED" , "05", KEY_RED}, - {"GREEN" , "87", KEY_GREEN}, - {"YELLOW" , "C5", KEY_YELLOW}, - {"BLUE" , "47", KEY_BLUE}, - {"FAV" , "F7", KEY_FAVORITES}, - {"SAT" , "2F", KEY_SAT}, - {"TTX" , "DF", KEY_TITLE}, - {"AUDIO" , "D7", KEY_SUBTITLE}, - {"" , "" , KEY_NULL} -}; - -/* Amiko alien-spark RCU */ -static tButton cButtonsSparkRc09[] = -{ - {"POWER" , "25", KEY_POWER}, - {"MUTE" , "85", KEY_MUTE}, - {"TIME" , "8D", KEY_TIME}, - {"V.FORMAT" , "AD", KEY_V}, - {"TV/SAT" , "A5", KEY_AUX}, - {"PICASA" , "E5", KEY_SUBTITLE}, - {"SHOUTCAST" , "ED", KEY_AUDIO}, - {"YOUTUBE" , "CD", KEY_VIDEO}, - {"SPARK" , "C5", KEY_S}, - {"0BUTTON" , "57", KEY_0}, - {"1BUTTON" , "B5", KEY_1}, - {"2BUTTON" , "95", KEY_2}, - {"3BUTTON" , "BD", KEY_3}, - {"4BUTTON" , "F5", KEY_4}, - {"5BUTTON" , "D5", KEY_5}, - {"6BUTTON" , "FD", KEY_6}, - {"7BUTTON" , "35", KEY_7}, - {"8BUTTON" , "15", KEY_8}, - {"9BUTTON" , "3D", KEY_9}, - {"TV/RADIO" , "77", KEY_TV2}, //WE USE TV2 AS TV/RADIO SWITCHB - {"RECALL" , "7F", KEY_BACK}, - {"SAT" , "9D", KEY_SAT}, - {"FAV" , "45", KEY_FAVORITES}, - {"VOL-" , "C7", KEY_VOLUMEDOWN}, - {"VOL+" , "DD", KEY_VOLUMEUP}, - {"PAGE-" , "07", KEY_CHANNELDOWN}, - {"PAGE+" , "5F", KEY_CHANNELUP}, - {"INFO" , "1D", KEY_INFO}, - {"EPG" , "87", KEY_EPG}, - {"MENU" , "65", KEY_MENU}, - {"EXIT" , "A7", KEY_HOME}, - {"UP" , "27", KEY_UP}, - {"DOWN" , "0F", KEY_DOWN}, - {"LEFT" , "6D", KEY_LEFT}, - {"RIGHT" , "AF", KEY_RIGHT}, - {"OK" , "2F", KEY_OK}, - {"FIND" , "4D", KEY_FIND}, - {"REC" , "8F", KEY_RECORD}, - {"RED" , "75", KEY_RED}, - {"GREEN" , "F7", KEY_GREEN}, - {"YELLOW" , "37", KEY_YELLOW}, - {"BLUE" , "B7", KEY_BLUE}, - {"REWIND" , "55", KEY_REWIND}, - {"PLAY" , "D7", KEY_PLAY}, - {"PAUSE" , "17", KEY_PAUSE}, - {"FASTFORWARD" , "97", KEY_FASTFORWARD}, - {"FOLDER" , "5D", KEY_ARCHIVE}, - {"PLAY_MODE" , "DF", KEY_P}, - {"USB" , "1F", KEY_CLOSE}, - {"STOP" , "9F", KEY_STOP}, - {"F1" , "7D", KEY_HELP}, - {"F2" , "FF", KEY_PREVIOUS}, - {"F3" , "3F", KEY_NEXT}, - {"F4" , "BF", KEY_TITLE}, - {"" , "" , KEY_NULL} -}; - -static tButton cButtonsSparkRc12[] = -{ - {"MUTE" , "87", KEY_MUTE}, - {"POWER" , "45", KEY_POWER}, - {"PLAY_MODE" , "A7", KEY_P}, - {"V.FORMAT" , "E5", KEY_V}, - {"TIME" , "C5", KEY_TIME}, - {"USB" , "47", KEY_CLOSE}, - {"FOLDER" , "65", KEY_ARCHIVE}, - {"STOP" , "25", KEY_STOP}, - {"PLAY" , "3D", KEY_PLAY}, - {"PAUSE" , "1D", KEY_PAUSE}, - {"FASTFORWARD" , "C7", KEY_FASTFORWARD}, - {"REWIND" , "FD", KEY_REWIND}, - {"PREV" , "BF", KEY_PREVIOUS}, - {"NEXT" , "E7", KEY_NEXT}, - {"FAST" , "67", KEY_F}, - {"SLOW" , "9F", KEY_SLOW}, - {"MENU" , "DD", KEY_MENU}, - {"Tms" , "BD", KEY_T}, - {"INFO" , "FF", KEY_INFO}, - {"UP" , "5D", KEY_UP}, - {"DOWN" , "55", KEY_DOWN}, - {"LEFT" , "1F", KEY_LEFT}, - {"RIGHT" , "7F", KEY_RIGHT}, - {"OK" , "7D", KEY_OK}, - {"EXIT" , "3F", KEY_HOME}, - {"REC" , "9D", KEY_RECORD}, - {"EPG" , "5F", KEY_EPG}, - {"TV/SAT" , "D5", KEY_AUX}, - {"RECALL" , "DF", KEY_BACK}, - {"FIND" , "95", KEY_FIND}, - {"VOL+" , "17", KEY_VOLUMEUP}, - {"VOL-" , "37", KEY_VOLUMEDOWN}, - {"SAT" , "15", KEY_SAT}, - {"FAV" , "35", KEY_FAVORITES}, - {"PAGE+" , "57", KEY_PAGEUP}, - {"PAGE-" , "D7", KEY_PAGEDOWN}, - {"KEY_0" , "0D", KEY_0}, - {"KEY_1" , "F5", KEY_1}, - {"KEY_2" , "B5", KEY_2}, - {"KEY_3" , "F7", KEY_3}, - {"KEY_4" , "CD", KEY_4}, - {"KEY_5" , "AD", KEY_5}, - {"KEY_6" , "77", KEY_6}, - {"KEY_7" , "0F", KEY_7}, - {"KEY_8" , "8D", KEY_8}, - {"KEY_9" , "4F", KEY_9}, - {"TV/RADIO" , "ED", KEY_TV2}, - {"RED" , "2F", KEY_RED}, - {"GREEN" , "6F", KEY_GREEN}, - {"YELLOW" , "EF", KEY_YELLOW}, - {"BLUE" , "05", KEY_BLUE}, - {"WHITE" , "2D", KEY_W}, - {"" , "" , KEY_NULL} -}; - -/* spark Default */ -static tButton cButtonsSparkDefault[] = -{ - {"KEY_POWER" , "87", KEY_POWER}, - {"KEY_MODE" , "0F", KEY_MODE}, - {"KEY_TEXT" , "2F", KEY_TEXT}, //TV/SAT - {"KEY_SLEEP" , "65", KEY_SLEEP}, - {"KEY_MUTE" , "A5", KEY_MUTE}, - {"KEY_0" , "37", KEY_0}, - {"KEY_1" , "A7", KEY_1}, - {"KEY_2" , "07", KEY_2}, - {"KEY_3" , "E5", KEY_3}, - {"KEY_4" , "97", KEY_4}, - {"KEY_5" , "27", KEY_5}, - {"KEY_6" , "D5", KEY_6}, - {"KEY_7" , "B7", KEY_7}, - {"KEY_8" , "17", KEY_8}, - {"KEY_9" , "F5", KEY_9}, - {"KEY_RADIO" , "CD", KEY_RADIO}, //WE USE TV2 AS TV/RADIO SWITCHB - {"KEY_BACK" , "CF", KEY_BACK}, //RECALL - {"KEY_PAGEUP" , "ED", KEY_PAGEUP}, - {"KEY_PAGEDOWN" , "DD", KEY_PAGEDOWN}, - {"KEY_SEARCH" , "C5", KEY_SEARCH}, - {"KEY_MEDIA" , "67", KEY_MEDIA}, //FOLDER - {"KEY_VOLUMEUP" , "AF", KEY_VOLUMEUP}, - {"KEY_VOLUMEDOWN" , "9F", KEY_VOLUMEDOWN}, - {"KEY_MENU" , "C7", KEY_MENU}, - {"KEY_INFO" , "1F", KEY_INFO}, - {"KEY_UP" , "3F", KEY_UP}, - {"KEY_DOWN" , "85", KEY_DOWN}, - {"KEY_LEFT" , "BF", KEY_LEFT}, - {"KEY_RIGHT" , "FD", KEY_RIGHT}, - {"KEY_OK" , "05", KEY_OK}, - {"KEY_HOME" , "F9", KEY_HOME}, - {"KEY_EPG" , "45", KEY_EPG}, - {"KEY_FAVORITES" , "3D", KEY_FAVORITES}, - {"KEY_EPG" , "25", KEY_EPG}, // Portal - {"KEY_SAT" , "0D", KEY_SAT}, - {"KEY_RED" , "6D", KEY_RED}, - {"KEY_GREEN" , "8D", KEY_GREEN}, - {"KEY_YELLOW" , "77", KEY_YELLOW}, - {"KEY_BLUE" , "AD", KEY_BLUE}, - {"KEY_RECORD" , "F7", KEY_RECORD}, - {"KEY_STOP" , "BB", KEY_STOP}, - {"KEY_PLAY" , "57", KEY_PLAY}, - {"KEY_PAUSE" , "4D", KEY_PAUSE}, - {"KEY_FASTFORWARD" , "35", KEY_FASTFORWARD}, - {"KEY_REWIND" , "7F", KEY_REWIND}, - {"KEY_PREVIOUS" , "FB", KEY_PREVIOUS}, - {"KEY_NEXT" , "3B", KEY_NEXT}, - {"KEY_FAST" , "E7", KEY_F}, - {"KEY_SLOW" , "7B", KEY_SLOW}, - {"KEY_PLAYPAUSE" , "B5", KEY_PLAYPAUSE}, - {"KEY_CLOSE" , "DF", KEY_CLOSE}, //USB - {"KEY_TIME" , "55", KEY_TIME}, - {"KEY_AUDIO" , "95", KEY_AUDIO}, //F1 - {"KEY_SUBTITLE" , "15", KEY_SUBTITLE}, //F2 - {"KEY_LIST" , "D7", KEY_LIST}, //F3 - {"" , "" , KEY_NULL} -}; - -static tButton cButtonsSognoTriplex[] = -{ - {"KEY_POWER" , "10", KEY_POWER}, //# Power - {"KEY_MODE" , "01", KEY_MODE}, //# V.Format - {"KEY_TEXT" , "05", KEY_TEXT}, //# TV/SAT - {"KEY_SLEEP" , "4C", KEY_SLEEP}, //# SLEEP - {"KEY_MUTE" , "54", KEY_MUTE}, //# MUTE - {"KEY_1" , "14", KEY_1}, //# 1 - {"KEY_2" , "00", KEY_2}, //# 2 - {"KEY_3" , "5C", KEY_3}, //# 3 - {"KEY_4" , "12", KEY_4}, //# 4 - {"KEY_5" , "04", KEY_5}, //# 5 - {"KEY_6" , "5A", KEY_6}, //# 6 - {"KEY_7" , "16", KEY_7}, //# 7 - {"KEY_8" , "02", KEY_8}, //# 8 - {"KEY_9" , "5E", KEY_9}, //# 9 - {"KEY_RADIO" , "59", KEY_RADIO}, //# TV/Radio - {"KEY_0" , "06", KEY_0}, //# 0 - {"KEY_BACK" , "19", KEY_BACK}, //# Recall - {"KEY_PAGEUP" , "5D", KEY_PAGEUP}, //# PAGE+ - {"KEY_PAGEDOWN" , "5B", KEY_PAGEDOWN}, //# PAGE- - {"KEY_SEARCH" , "58", KEY_SEARCH}, //# FIND - {"KEY_VOLUMEUP" , "15", KEY_VOLUMEUP}, //# VOL+ - {"KEY_VOLUMEDOWN" , "13", KEY_VOLUMEDOWN}, //# VOL- - {"KEY_MEDIA" , "0C", KEY_MEDIA}, //# FOLDER - {"KEY_MENU" , "18", KEY_MENU}, //# MENU - {"KEY_INFO" , "03", KEY_INFO}, //# INFO - {"KEY_UP" , "07", KEY_UP}, //# UP - {"KEY_LEFT" , "17", KEY_LEFT}, //# LEFT - {"KEY_RIGHT" , "5F", KEY_RIGHT}, //# RIGHT - {"KEY_DOWN" , "50", KEY_DOWN}, //# DOWN - {"KEY_OK" , "40", KEY_OK}, //# OK - {"KEY_HOME" , "DF", KEY_HOME}, //# EXIT - {"KEY_EPG" , "48", KEY_EPG}, //# EPG - {"KEY_FAVORITES" , "47", KEY_FAVORITES}, //# FAV - {"KEY_EPG" , "44", KEY_EPG}, //# Portal - {"KEY_SAT" , "41", KEY_SAT}, //# SAT - {"KEY_RED" , "4D", KEY_RED}, //# RED - {"KEY_GREEN" , "51", KEY_GREEN}, //# GREEN - {"KEY_YELLOW" , "0E", KEY_YELLOW}, //# YELLOW - {"KEY_BLUE" , "55", KEY_BLUE}, //# BLUE - {"KEY_RECORD" , "1E", KEY_RECORD}, //# RECORD - {"KEY_STOP" , "97", KEY_STOP}, //# STOP - {"KEY_PAUSE" , "49", KEY_PAUSE}, //# PAUSE - {"KEY_PLAY" , "0A", KEY_PLAY}, //# PLAY - {"KEY_PREVIOUS" , "9F", KEY_PREVIOUS}, //# PREVIOUS - {"KEY_NEXT" , "87", KEY_NEXT}, //# NEXT - {"KEY_PAGEDOWN" , "0F", KEY_PAGEDOWN}, //# REWIND - {"KEY_PAGEUP" , "46", KEY_PAGEUP}, //# FORWARD - {"KEY_REWIND" , "8F", KEY_REWIND}, //# SLOW - {"KEY_FASTFORWARD" , "1C", KEY_FASTFORWARD}, //# FASTFORWARD - {"KEY_PLAYPAUSE" , "56", KEY_PLAYPAUSE}, //# PLAYMODE - {"KEY_CLOSE" , "1B", KEY_CLOSE}, //# USB - {"KEY_TIME" , "4A", KEY_TIME}, //# Timeshift - {"KEY_AUDIO" , "52", KEY_AUDIO}, //# F1 - {"KEY_SUBTITLE" , "42", KEY_SUBTITLE}, //# F2 - {"KEY_LIST" , "1A", KEY_LIST}, //# F3 - {"" , "" , KEY_NULL} -}; - -static tButton cButtonsUfs910Rc660[] = -{ - {"KEY_0" , "00", KEY_0}, - {"KEY_1" , "01", KEY_1}, - {"KEY_2" , "02", KEY_2}, - {"KEY_3" , "03", KEY_3}, - {"KEY_4" , "04", KEY_4}, - {"KEY_5" , "05", KEY_5}, - {"KEY_6" , "06", KEY_6}, - {"KEY_7" , "07", KEY_7}, - {"KEY_8" , "08", KEY_8}, - {"KEY_9" , "09", KEY_9}, - {"KEY_INFO" , "0F", KEY_INFO}, - {"KEY_OK" , "5C", KEY_OK}, - {"KEY_POWER" , "0C", KEY_POWER}, - {"KEY_MUTE" , "0D", KEY_MUTE}, - {"KEY_RIGHT" , "5B", KEY_RIGHT}, - {"KEY_LEFT" , "5A", KEY_LEFT}, - {"KEY_UP" , "58", KEY_UP}, - {"KEY_DOWN" , "59", KEY_DOWN}, - {"KEY_VOLUMEUP" , "10", KEY_VOLUMEUP}, - {"KEY_VOLUMEDOWN" , "11", KEY_VOLUMEDOWN}, - {"KEY_RED" , "6D", KEY_RED}, - {"KEY_GREEN" , "6E", KEY_GREEN}, - {"KEY_YELLOW" , "6F", KEY_YELLOW}, - {"KEY_BLUE" , "70", KEY_BLUE}, - {"KEY_EPG" , "CC", KEY_EPG}, - {"KEY_HOME" , "55", KEY_HOME}, - {"KEY_MENU" , "54", KEY_MENU}, - {"KEY_PAGEUP" , "1E", KEY_PAGEUP}, - {"KEY_PAGEDOWN" , "1F", KEY_PAGEDOWN}, - {"KEY_PLAY" , "38", KEY_PLAY}, - {"KEY_STOP" , "31", KEY_STOP}, - {"KEY_RECORD" , "37", KEY_RECORD}, - {"KEY_PAUSE" , "39", KEY_PAUSE}, - {"KEY_FASTFORWARD" , "20", KEY_FASTFORWARD}, - {"KEY_REWIND" , "21", KEY_REWIND}, - {"KEY_TEXT" , "3C", KEY_TEXT}, - {"" , "" , KEY_NULL} -}; - -static tButton cButtonsSamsungAA59[] = -{ - {"KEY_POWER" , "BF", KEY_POWER}, - {"KEY_MODE" , "7F", KEY_MODE}, //# SOURCE - {"KEY_SLEEP" , "2E", KEY_SLEEP}, //# HDMI - {"KEY_1" , "DF", KEY_1}, - {"KEY_2" , "5F", KEY_2}, - {"KEY_3" , "9F", KEY_3}, - {"KEY_4" , "EF", KEY_4}, - {"KEY_5" , "6F", KEY_5}, - {"KEY_6" , "AF", KEY_6}, - {"KEY_7" , "CF", KEY_7}, - {"KEY_8" , "4F", KEY_8}, - {"KEY_9" , "8F", KEY_9}, - {"KEY_0" , "77", KEY_0}, - {"KEY_VOLUMEUP" , "1F", KEY_VOLUMEUP}, - {"KEY_VOLUMEDOWN" , "2F", KEY_VOLUMEDOWN}, - {"KEY_PAGEUP" , "B7", KEY_PAGEUP}, - {"KEY_PAGEDOWN" , "F7", KEY_PAGEDOWN}, - {"KEY_MUTE" , "0F", KEY_MUTE}, - {"KEY_TEXT" , "29", KEY_TEXT}, //# CKLIST - {"KEY_MENU" , "A7", KEY_MENU}, - {"KEY_smart" , "61", KEY_ARCHIVE}, //# SMART - {"KEY_EPG" , "0D", KEY_EPG}, //# GUIDE - {"KEY_FAVORITES" , "2D", KEY_FAVORITES}, //# TOOLS - {"KEY_INFO" , "07", KEY_INFO}, - {"KEY_UP" , "F9", KEY_UP}, - {"KEY_DOWN" , "79", KEY_DOWN}, - {"KEY_LEFT" , "59", KEY_LEFT}, - {"KEY_RIGHT" , "B9", KEY_RIGHT}, - {"KEY_OK" , "E9", KEY_OK}, - {"KEY_OK" , "E5", KEY_OK}, //# RETURN - {"KEY_HOME" , "4B", KEY_HOME}, //# EXIT - {"KEY_RED" , "C9", KEY_RED}, - {"KEY_GREEN" , "D7", KEY_GREEN}, - {"KEY_YELLOW" , "57", KEY_YELLOW}, - {"KEY_BLUE" , "97", KEY_BLUE}, - {"KEY_AUDIO" , "D9", KEY_AUDIO}, //# SOCIAL - {"search" , "31", KEY_TIME}, //# SEARCH - {"3d" , "06", KEY_LIST}, //# 3D - {"manual" , "03", KEY_PREVIOUS}, //# MANUAL - {"size" , "83", KEY_NEXT}, //# SIZE - {"subt" , "5B", KEY_SUBTITLE}, - {"KEY_REWIND" , "5D", KEY_REWIND}, - {"KEY_PAUSE" , "AD", KEY_PAUSE}, - {"KEY_FASTFORWARD" , "ED", KEY_FASTFORWARD}, - {"KEY_RECORD" , "6D", KEY_RECORD}, - {"KEY_PLAY" , "1D", KEY_PLAY}, - {"KEY_STOP" , "9D", KEY_STOP}, - {"" , "" , KEY_NULL} -}; - - -static tButton cButtonsUfs913Rc230[] = -{ - {"KEY_MODE" , "7E", KEY_MODE}, - {"KEY_POWER" , "F3", KEY_POWER}, - {"KEY_1" , "FE", KEY_1}, - {"KEY_2" , "FD", KEY_2}, - {"KEY_3" , "FC", KEY_3}, - {"KEY_4" , "FB", KEY_4}, - {"KEY_5" , "FA", KEY_5}, - {"KEY_6" , "F9", KEY_6}, - {"KEY_7" , "F8", KEY_7}, - {"KEY_8" , "F7", KEY_8}, - {"KEY_9" , "F6", KEY_9}, - {"KEY_0" , "FF", KEY_0}, - {"KEY_VOLUMEDOWN" , "EE", KEY_VOLUMEDOWN}, - {"KEY_VOLUMEUP" , "EF", KEY_VOLUMEUP}, - {"KEY_PAGEUP" , "E1", KEY_PAGEUP}, - {"KEY_PAGEDOWN" , "E0", KEY_PAGEDOWN}, - {"KEY_OK" , "A3", KEY_OK}, - {"KEY_MENU" , "AB", KEY_MENU}, - {"KEY_TEXT" , "C3", KEY_TEXT}, - {"KEY_MUTE" , "F2", KEY_MUTE}, - {"KEY_INFO" , "F0", KEY_INFO}, - {"KEY_RED" , "92", KEY_RED}, - {"KEY_GREEN" , "91", KEY_GREEN}, - {"KEY_YELLOW" , "90", KEY_YELLOW}, - {"KEY_BLUE" , "8F", KEY_BLUE}, - {"KEY_EPG" , "33", KEY_EPG}, - {"KEY_MEDIA" , "B9", KEY_MEDIA}, - {"KEY_UP" , "A7", KEY_UP}, - {"KEY_DOWN" , "A6", KEY_DOWN}, - {"KEY_LEFT" , "A5", KEY_LEFT}, - {"KEY_RIGHT" , "A4", KEY_RIGHT}, - {"KEY_HOME" , "AA", KEY_HOME}, - {"KEY_FAVORITES" , "2A", KEY_FAVORITES}, //Portal - {"KEY_REWIND" , "DE", KEY_REWIND}, - {"KEY_FASTFORWARD" , "DF", KEY_FASTFORWARD}, - {"KEY_PLAY" , "C7", KEY_PLAY}, - {"KEY_PAUSE" , "C6", KEY_PAUSE}, - {"KEY_RECORD" , "C8", KEY_RECORD}, - {"KEY_STOP" , "CE", KEY_STOP}, - {"" , "" , KEY_NULL} -}; - -/* spark Default */ -static tButton cButtonsSparkRc04[] = -{ - {"POWER" , "45", KEY_POWER}, - {"V.FORMAT" , "4D", KEY_V}, - {"TIME" , "ED", KEY_TIME}, - {"MUTE" , "8D", KEY_MUTE}, - {"Tms" , "57", KEY_T}, - {"F1" , "37", KEY_F1}, - {"TV/SAT" , "DD", KEY_AUX}, - {"KEY_1" , "3F", KEY_1}, - {"KEY_2" , "07", KEY_2}, - {"KEY_3" , "BD", KEY_3}, - {"KEY_4" , "5D", KEY_4}, - {"KEY_5" , "1F", KEY_5}, - {"KEY_6" , "9D", KEY_6}, - {"KEY_7" , "55", KEY_7}, - {"KEY_8" , "17", KEY_8}, - {"KEY_9" , "95", KEY_9}, - {"KEY_0" , "27", KEY_0}, - {"TV/RADIO" , "65", KEY_TV2}, //WE USE TV2 AS TV/RADIO SWITCHB - {"RECALL" , "A5", KEY_BACK}, - {"FIND" , "75", KEY_FIND}, - {"REC" , "D5", KEY_RECORD}, - {"SAT" , "A7", KEY_SAT}, - {"FAV" , "B5", KEY_FAVORITES}, - {"MENU" , "1D", KEY_MENU}, - {"INFO" , "5F", KEY_INFO}, - {"OK" , "BF", KEY_OK}, - {"UP" , "9F", KEY_UP}, - {"DOWN" , "AF", KEY_DOWN}, - {"LEFT" , "3D", KEY_LEFT}, - {"RIGHT" , "7F", KEY_RIGHT}, - {"EXIT" , "2D", KEY_HOME}, - {"EPG" , "6F", KEY_EPG}, - {"FOLDER" , "0D", KEY_ARCHIVE}, - {"STOP" , "8F", KEY_STOP}, - {"PAUSE" , "CD", KEY_PAUSE}, - {"PLAY" , "4F", KEY_PLAY}, - {"PREV" , "35", KEY_PREVIOUS}, - {"NEXT" , "B7", KEY_NEXT}, - {"FASTFORWARD" , "77", KEY_FASTFORWARD}, - {"REWIND" , "F5", KEY_REWIND}, - {"FAST" , "97", KEY_F}, - {"SLOW" , "15", KEY_SLOW}, - {"PLAY_MODE" , "E5", KEY_P}, - {"USB" , "67", KEY_CLOSE}, - {"UHF" , "0F", KEY_U}, - {"AUDIO" , "25", KEY_SUBTITLE}, - {"RED" , "05", KEY_RED}, - {"GREEN" , "87", KEY_GREEN}, - {"YELLOW" , "C5", KEY_YELLOW}, - {"BLUE" , "47", KEY_BLUE}, - {"" , "" , KEY_NULL} -}; - -/* GALAXY RC */ -static tButton cButtonsGalaxy[] = -{ - {"POWER" , "25", KEY_POWER}, - {"R" , "A5", KEY_R}, - {"V.FORMAT" , "AD", KEY_V}, - {"TIME" , "8D", KEY_TIME}, - {"MUTE" , "85", KEY_MUTE}, - {"TV/SAT" , "C5", KEY_AUX}, - {"Tms" , "E5", KEY_T}, - {"PRESENTATION" , "ED", KEY_PRESENTATION}, - {"F1" , "CD", KEY_F1}, - {"0BUTTON" , "57", KEY_0}, - {"1BUTTON" , "B5", KEY_1}, - {"2BUTTON" , "95", KEY_2}, - {"3BUTTON" , "BD", KEY_3}, - {"4BUTTON" , "F5", KEY_4}, - {"5BUTTON" , "D5", KEY_5}, - {"6BUTTON" , "FD", KEY_6}, - {"7BUTTON" , "35", KEY_7}, - {"8BUTTON" , "15", KEY_8}, - {"9BUTTON" , "3D", KEY_9}, - {"TV/RADIO" , "77", KEY_TV2}, - {"RECALL" , "7F", KEY_BACK}, - {"VOL+" , "C7", KEY_VOLUMEDOWN}, - {"VOL-" , "DD", KEY_VOLUMEUP}, - {"PAGE-" , "5F", KEY_PAGEDOWN}, - {"PAGE+" , "07", KEY_PAGEUP}, - {"FIND" , "9D", KEY_FIND}, - {"SAT" , "1D", KEY_SAT}, - {"REC" , "45", KEY_RECORD}, - {"FAV" , "87", KEY_FAVORITES}, - {"MENU" , "65", KEY_MENU}, - {"INFO" , "A7", KEY_INFO}, - {"EXIT" , "4D", KEY_EXIT}, - {"EPG" , "8F", KEY_EPG}, - {"OK" , "2F", KEY_OK}, - {"UP" , "27", KEY_UP}, - {"DOWN" , "0F", KEY_DOWN}, - {"LEFT" , "6D", KEY_LEFT}, - {"RIGHT" , "AF", KEY_RIGHT}, - {"FOLDER" , "75", KEY_ARCHIVE}, - {"STOP" , "F7", KEY_STOP}, - {"PAUSE" , "37", KEY_PAUSE}, - {"PLAY" , "B7", KEY_PLAY}, - {"PREV" , "55", KEY_PREVIOUS}, - {"NEXT" , "D7", KEY_NEXT}, - {"REWIND" , "17", KEY_REWIND}, - {"FORWARD" , "97", KEY_FORWARD}, - {"USB" , "9F", KEY_CLOSE}, - {"RED" , "7D", KEY_RED}, - {"GREEN" , "FF", KEY_GREEN}, - {"YELLOW" , "3F", KEY_YELLOW}, - {"BLUE" , "BF", KEY_BLUE}, - {"PLAY_MODE" , "1F", KEY_P}, - {"SLOW" , "5D", KEY_SLOW}, - {"FAST" , "DF", KEY_FASTFORWARD}, - {"" , "" , KEY_NULL} -}; - -/* spark Default */ -static tButton cButtonsSparkEdv[] = -{ - {"POWER" , "87", KEY_POWER}, - {"V.FORMAT" , "2f", KEY_V}, - {"TV/SAT" , "95", KEY_AUX}, - {"TIME" , "65", KEY_TIME}, - {"MUTE" , "A5", KEY_MUTE}, - {"0BUTTON" , "37", KEY_0}, - {"1BUTTON" , "A7", KEY_1}, - {"2BUTTON" , "07", KEY_2}, - {"3BUTTON" , "E5", KEY_3}, - {"4BUTTON" , "97", KEY_4}, - {"5BUTTON" , "27", KEY_5}, - {"6BUTTON" , "D5", KEY_6}, - {"7BUTTON" , "B7", KEY_7}, - {"8BUTTON" , "17", KEY_8}, - {"9BUTTON" , "F5", KEY_9}, - {"TV/RADIO" , "CD", KEY_TV2}, //WE USE TV2 AS TV/RADIO SWITCHB - {"RECALL" , "CF", KEY_BACK}, - {"PAGE+" , "ED", KEY_PAGEUP}, - {"PAGE-" , "DD", KEY_PAGEDOWN}, - {"FIND" , "C5", KEY_FIND}, - {"FOLDER" , "67", KEY_ARCHIVE}, - {"VOL+" , "AF", KEY_VOLUMEUP}, - {"VOL-" , "9F", KEY_VOLUMEDOWN}, - {"MENU" , "C7", KEY_MENU}, - {"INFO" , "1F", KEY_INFO}, - {"UP" , "3F", KEY_UP}, - {"DOWN" , "85", KEY_DOWN}, - {"LEFT" , "BF", KEY_LEFT}, - {"RIGHT" , "FD", KEY_RIGHT}, - {"OK" , "05", KEY_OK}, - {"EXIT" , "F9", KEY_HOME}, - {"EPG" , "45", KEY_EPG}, - {"FAV" , "3D", KEY_FAVORITES}, - {"SAT" , "0D", KEY_SAT}, - {"RED" , "6D", KEY_RED}, - {"GREEN" , "8D", KEY_GREEN}, - {"YELLOW" , "77", KEY_YELLOW}, - {"BLUE" , "AD", KEY_BLUE}, - {"REC" , "F7", KEY_RECORD}, - {"STOP" , "BB", KEY_STOP}, - {"PLAY" , "57", KEY_PLAY}, - {"PAUSE" , "4D", KEY_PAUSE}, - {"FASTFORWARD" , "35", KEY_FASTFORWARD}, - {"REWIND" , "7F", KEY_REWIND}, - {"PREV" , "FB", KEY_PREVIOUS}, - {"NEXT" , "3B", KEY_NEXT}, - {"FAST" , "E7", KEY_F}, - {"SLOW" , "7B", KEY_SLOW}, - {"PLAY_MODE" , "B5", KEY_P}, - {"USB" , "DF", KEY_CLOSE}, - {"Tms" , "55", KEY_T}, - {"F1" , "15", KEY_F1}, - {"F2" , "D1", KEY_F2}, - {"" , "" , KEY_NULL} -}; - -/* fixme: move this to a structure and - * use the private structure of RemoteControl_t - */ - -void Get_StbId() -{ - char *pch; - int fn = open("/proc/cmdline", O_RDONLY); - - if (fn > -1) - { - char procCmdLine[1024]; - int len = read(fn, procCmdLine, sizeof(procCmdLine) - 1); - if (len > 0) - { - procCmdLine[len] = 0; - - pch = strstr(procCmdLine, "STB_ID="); - strncpy(VendorStbId, pch + 7, 8); - printf("Vendor STB-ID=%s\n", VendorStbId); - } - close(fn); - } -} - -static struct sockaddr_un vAddr; - -static tButton *pSparkGetButton(char *pData) - -{ - tButton *pButtons = cButtonsEdisionSpark; - - if (!strncasecmp(pData, SPARK_RC05_PREDATA, sizeof(SPARK_RC05_PREDATA))) - { - pButtons = cButtonsEdisionSpark; - } - else if (!strncasecmp(pData, SPARK_RC08_PREDATA, sizeof(SPARK_RC08_PREDATA))) - { - pButtons = cButtonsSparkRc08; - } - else if (!strncasecmp(pData, SPARK_RC09_PREDATA, sizeof(SPARK_RC09_PREDATA))) - { - static tButton *cButtons = NULL; - if (!cButtons) - { - if (strstr(STB_ID_EDISION_PINGULUX, VendorStbId)) - cButtons = cButtonsEdisionSpark; - else if (strstr(STB_ID_GALAXYINNOVATIONS_S8120, VendorStbId)) - cButtons = cButtonsGalaxy; - else - cButtons = cButtonsSparkRc09; /* Amiko Alien 8900 */ - } - return cButtons; -#if 0 - if (!cButtons) - { - int fn = open("/proc/cmdline", O_RDONLY); - - if (fn > -1) - { - char procCmdLine[1024]; - int len = read(fn, procCmdLine, sizeof(procCmdLine) - 1); - - if (len > 0) - { - procCmdLine[len] = 0; - - if (strstr(procCmdLine, "STB_ID=" STB_ID_EDISION_PINGULUX)) - cButtons = cButtonsEdisionSpark; - - if (strstr(procCmdLine, "STB_ID=" STB_ID_GALAXYINNOVATIONS_S8120)) - cButtons = cButtonsGalaxy; - } - - close(fn); - } - - if (!cButtons) - cButtons = cButtonsSparkRc09; /* Amiko Alien 8900 */ - } - - return cButtons; -#endif - } - else if (!strncasecmp(pData, SPARK_DEFAULT_PREDATA, sizeof(SPARK_DEFAULT_PREDATA))) - { - static tButton *cButtons = NULL; - if (!cButtons) - { - if (strstr(STB_ID_SOGNO_TRIPLE_HD, VendorStbId)) - cButtons = cButtonsSognoTriplex; - else if (strstr(STB_ID_SAB_UNIX_TRIPLE_HD, VendorStbId)) - cButtons = cButtonsSparkDefault; - else - cButtons = cButtonsSparkDefault; - } - return cButtons; - } - else if (!strncasecmp(pData, UFS910_RC660_PREDATA, sizeof(UFS910_RC660_PREDATA))) - { - pButtons = cButtonsUfs910Rc660; - } - else if (!strncasecmp(pData, UFS913_RC230_PREDATA, sizeof(UFS913_RC230_PREDATA))) - { - pButtons = cButtonsUfs913Rc230; - } - else if (!strncasecmp(pData, SAMSUNG_AA59_PREDATA, sizeof(SAMSUNG_AA59_PREDATA))) - { - pButtons = cButtonsSamsungAA59; - } - else if (!strncasecmp(pData, SPARK_RC12_PREDATA, sizeof(SPARK_RC12_PREDATA))) - { - pButtons = cButtonsSparkRc12; - } - else if (!strncasecmp(pData, SPARK_RC04_PREDATA, sizeof(SPARK_RC04_PREDATA))) - { - pButtons = cButtonsSparkRc04; - } - else if (!strncasecmp(pData, SPARK_EDV_RC1, sizeof(SPARK_EDV_RC1))) - { - pButtons = cButtonsSparkEdv; - } - else if (!strncasecmp(pData, SPARK_EDV_RC2, sizeof(SPARK_EDV_RC2))) - { - pButtons = cButtonsSparkEdv; - } - - return pButtons; -} - -static int pInit(Context_t *context, int argc, char *argv[]) -{ - int vHandle; - - Get_StbId(); - - vAddr.sun_family = AF_UNIX; - strcpy(vAddr.sun_path, "/var/run/lirc/lircd"); - - vHandle = socket(AF_UNIX, SOCK_STREAM, 0); - - if (vHandle == -1) - { - perror("socket"); - return -1; - } - - if (connect(vHandle, (struct sockaddr *)&vAddr, sizeof(vAddr)) == -1) - { - perror("connect"); - return -1; - } - - return vHandle; -} - -static int pShutdown(Context_t *context) -{ - close(context->fd); - - return 0; -} - -static int pRead(Context_t *context) -{ - char vBuffer[128]; - char vData[10]; - const int cSize = 128; - int vCurrentCode = -1; - int rc; - tButton *cButtons = cButtonsEdisionSpark; - - memset(vBuffer, 0, 128); - //wait for new command - rc = read(context->fd, vBuffer, cSize); - - if (rc <= 0)return -1; - - //parse and send key event - vData[0] = vBuffer[17]; - vData[1] = vBuffer[18]; - vData[2] = '\0'; - - - vData[0] = vBuffer[8]; - vData[1] = vBuffer[9]; - vData[2] = vBuffer[10]; - vData[3] = vBuffer[11]; - vData[4] = '\0'; - cButtons = pSparkGetButton(vData); - - vData[0] = vBuffer[14]; - vData[1] = vBuffer[15]; - vData[2] = '\0'; - - printf("[RCU] key: %s -> %s\n", vData, &vBuffer[0]); - vCurrentCode = getInternalCode(cButtons, vData); - - if (vCurrentCode != 0) - { - static int nextflag = 0; - - if (('0' == vBuffer[17]) && ('0' == vBuffer[18])) - { - nextflag++; - } - - vCurrentCode += (nextflag << 16); - } - - return vCurrentCode; -} - -static int pNotification(Context_t *context, const int cOn) -{ - struct aotom_ioctl_data vfd_data; - int ioctl_fd = -1; - - if (cOn) - { - ioctl_fd = open("/dev/vfd", O_RDONLY); - vfd_data.u.icon.icon_nr = 35; - vfd_data.u.icon.on = 1; - ioctl(ioctl_fd, VFDICONDISPLAYONOFF, &vfd_data); - close(ioctl_fd); - } - else - { - usleep(100000); - ioctl_fd = open("/dev/vfd", O_RDONLY); - vfd_data.u.icon.icon_nr = 35; - vfd_data.u.icon.on = 0; - ioctl(ioctl_fd, VFDICONDISPLAYONOFF, &vfd_data); - close(ioctl_fd); - } - - return 0; -} - -RemoteControl_t Spark_RC = -{ - "Spark RemoteControl", - Spark, - &pInit, - &pShutdown, - &pRead, - &pNotification, - cButtonsEdisionSpark, - NULL, - NULL, - 1, - &cLongKeyPressSupport, -}; - diff --git a/evremote2/Spark.h b/evremote2/Spark.h deleted file mode 100644 index c5a3663..0000000 --- a/evremote2/Spark.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef __spark__ -#define __spark__ - -#define VFDICONDISPLAYONOFF 0xc0425a0a - -/* this sets up the mode temporarily (for one ioctl) - * to the desired mode. currently the "normal" mode - * is the compatible vfd mode - */ -struct set_mode_s -{ - int compat; /* 0 = compatibility mode to vfd driver; 1 = nuvoton mode */ -}; - -struct set_brightness_s -{ - int level; -}; - -struct set_icon_s -{ - int icon_nr; - int on; -}; - -struct set_led_s -{ - int led_nr; - int on; -}; - -/* time must be given as follows: - * time[0] & time[1] = mjd ??? - * time[2] = hour - * time[3] = min - * time[4] = sec - */ -struct set_standby_s -{ - char time[5]; -}; - -struct set_time_s -{ - char time[5]; -}; - -struct aotom_ioctl_data -{ - union - { - struct set_icon_s icon; - struct set_led_s led; - struct set_brightness_s brightness; - struct set_mode_s mode; - struct set_standby_s standby; - struct set_time_s time; - } u; -}; - -#endif diff --git a/evremote2/Tf7700.c b/evremote2/Tf7700.c deleted file mode 100644 index b655a24..0000000 --- a/evremote2/Tf7700.c +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Tf7700.c - * - * (c) 2009 teamducktales - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "global.h" -#include "map.h" -#include "remotes.h" - -/* ***************** our key assignment **************** */ - -static tLongKeyPressSupport cLongKeyPressSupport = -{ - 10, 110, -}; - -static tButton cButtonsTopfield7700HDPVR[] = -{ - {"STANDBY" , "0A", KEY_POWER}, //This is the real power key, but sometimes we only get 0x0C FP - {"MUTE" , "0C", KEY_MUTE}, - - {"V.FORMAT" , "42", KEY_ZOOM}, - {"A/R" , "43", KEY_SCREEN}, - {"AUX" , "08", KEY_AUX}, - - {"0BUTTON" , "10", KEY_0}, - {"1BUTTON" , "11", KEY_1}, - {"2BUTTON" , "12", KEY_2}, - {"3BUTTON" , "13", KEY_3}, - {"4BUTTON" , "14", KEY_4}, - {"5BUTTON" , "15", KEY_5}, - {"6BUTTON" , "16", KEY_6}, - {"7BUTTON" , "17", KEY_7}, - {"8BUTTON" , "18", KEY_8}, - {"9BUTTON" , "19", KEY_9}, - - {"BACK" , "1E", KEY_BACK}, - {"INFO" , "1D", KEY_HELP}, //THIS IS WRONG SHOULD BE KEY_INFO - {"AUDIO" , "05", KEY_LANGUAGE}, - {"SUBTITLE" , "07", KEY_SUBTITLE}, - {"TEXT" , "47", KEY_TEXT}, - - {"DOWN/P-" , "01", KEY_DOWN}, - {"UP/P+" , "00", KEY_UP}, - {"RIGHT/V+" , "02", KEY_RIGHT}, - {"LEFT/V-" , "03", KEY_LEFT}, - {"OK/LIST" , "1F", KEY_OK}, - {"MENU" , "1A", KEY_MENU}, - {"GUIDE" , "1B", KEY_EPG}, - {"EXIT" , "1C", KEY_HOME}, - {"FAV" , "09", KEY_FAVORITES}, - - {"RED" , "4D", KEY_RED}, - {"GREEN" , "0D", KEY_GREEN}, - {"YELLOW" , "0E", KEY_YELLOW}, - {"BLUE" , "0F", KEY_BLUE}, - - {"REWIND" , "45", KEY_REWIND}, - {"PAUSE" , "06", KEY_PAUSE}, - {"PLAY" , "46", KEY_PLAY}, - {"FASTFORWARD" , "48", KEY_FASTFORWARD}, - {"RECORD" , "4B", KEY_RECORD}, - {"STOP" , "4A", KEY_STOP}, - {"SLOWMOTION" , "49", KEY_SLOW}, - {"RECORDLIST" , "51", KEY_LIST}, - {"SAT" , "5E", KEY_SAT}, - {"STEPBACK" , "50", KEY_PREVIOUS}, - {"STEPFORWARD" , "52", KEY_NEXT}, - {"MARK" , "4C", KEY_OPTION}, - {"TV/RADIO" , "04", KEY_TV2}, //WE USE TV2 AS TV/RADIO SWITCH BUTTON - {"USB" , "40", KEY_ARCHIVE}, - {"TIMER" , "44", KEY_TIME}, - {"" , "" , KEY_NULL}, -}; - -/* ***************** our fp button assignment **************** */ - -static tButton cButtonsTopfield7700HDPVRFrontpanel[] = -{ - {"CHANNELDOWN" , "02", KEY_PAGEDOWN}, - {"CHANNELUP" , "03", KEY_PAGEUP}, - - {"VOLUMEDOWN" , "01", KEY_VOLUMEDOWN}, - {"VOLUMEUP" , "06", KEY_VOLUMEUP}, - - {"STANDBY" , "0C", KEY_POWER}, // This is the fake power call - {"" , "" , KEY_NULL}, -}; - - -static int pInit(Context_t *context, int argc, char *argv[]) -{ - - int vFd = open("/dev/rc", O_RDWR); - - if (argc >= 2) - { - cLongKeyPressSupport.period = atoi(argv[1]); - } - - if (argc >= 3) - { - cLongKeyPressSupport.delay = atoi(argv[2]); - } - - printf("period %d, delay %d\n", cLongKeyPressSupport.period, cLongKeyPressSupport.delay); - - return vFd; -} - -static int pShutdown(Context_t *context) -{ - - close(context->fd); - - return 0; -} - -static int gNextKey = 0; - -static int pRead(Context_t *context) -{ - - unsigned char vData[3]; - const int cSize = 3; - eKeyType vKeyType = RemoteControl; - int vCurrentCode = -1; - unsigned char vIsBurst = 0; - //WORKAROUND: Power does not have burst flag - static unsigned char sWasLastKeyPower = 0; - - // wait for new command - read(context->fd, vData, cSize); - - //printf("---> 0x%02X 0x%02X\n", vData[0], vData[1]); - if (vData[0] == 0x61) - vKeyType = RemoteControl; - else if (vData[0] == 0x51) - vKeyType = FrontPanel; - else //Control Sequence - return -1; - - vIsBurst = ((vData[1] & 0x80) == 0x80) ? 1 : 0; - vData[1] = vData[1] & 0x7f; - - if (vKeyType == RemoteControl) - vCurrentCode = getInternalCodeHex((tButton *)((RemoteControl_t *)context->r)->RemoteControl, vData[1]); - else - vCurrentCode = getInternalCodeHex((tButton *)((RemoteControl_t *)context->r)->Frontpanel, vData[1]); - - // We have a problem here, the power key has no burst flag, so a quick hack would be to always - // say its burst. this is not noce and hopefully nobody will notice - if ((vKeyType == FrontPanel) && (vData[1] == 0x0C) && sWasLastKeyPower) - vIsBurst = 1; - - sWasLastKeyPower = ((vKeyType == FrontPanel) && (vData[1] == 0x0C)) ? 1 : 0; - - //printf("vIsBurst=%d Key=0x%02x\n", vIsBurst, vCurrentCode); - - if (vIsBurst == 0) // new key - { - gNextKey++; - gNextKey %= 20; - } - - vCurrentCode += (gNextKey << 16); - - return vCurrentCode; -} - -static int pNotification(Context_t *context, const int cOn) -{ - - //Notification is handeld by the frontpanel - return 0; -} - -RemoteControl_t Tf7700_RC = -{ - "Tf7700 RemoteControl", - Tf7700, - &pInit, - &pShutdown, - &pRead, - &pNotification, - cButtonsTopfield7700HDPVR, - cButtonsTopfield7700HDPVRFrontpanel, - NULL, - 1, - &cLongKeyPressSupport, -}; diff --git a/evremote2/Ufs910_14W.c b/evremote2/Ufs910_14W.c deleted file mode 100644 index e0cd379..0000000 --- a/evremote2/Ufs910_14W.c +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Ufs910_14W.c - * - * (c) 2009 teamducktales - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "global.h" -#include "map.h" -#include "remotes.h" - -static tButton cButtonsKathrein[] = -{ -// {"VFORMAT_FRONT" , "4A", KEY_MENU}, // any idea? - {"MENU" , "54", KEY_MENU}, - {"MENU_FRONT" , "49", KEY_MENU}, - {"RED" , "6D", KEY_RED}, - {"GREEN" , "6E", KEY_GREEN}, - {"YELLOW" , "6F", KEY_YELLOW}, - {"BLUE" , "70", KEY_BLUE}, - {"EXIT" , "55", KEY_HOME}, - {"EXIT_FRONT" , "4B", KEY_HOME}, - {"TEXT" , "3C", KEY_TEXT}, - {"EPG" , "4C", KEY_EPG}, - {"REWIND" , "21", KEY_REWIND}, - {"FASTFORWARD" , "20", KEY_FASTFORWARD}, - {"PLAY" , "38", KEY_PLAY}, - {"PAUSE" , "39", KEY_PAUSE}, - {"RECORD" , "37", KEY_RECORD}, - {"STOP" , "31", KEY_STOP}, - {"STANDBY" , "0C", KEY_POWER}, - {"STANDBY_FRONT" , "48", KEY_POWER}, - {"MUTE" , "0D", KEY_MUTE}, - {"CHANNELUP" , "1E", KEY_PAGEUP}, - {"CHANNELDOWN" , "1F", KEY_PAGEDOWN}, - {"VOLUMEUP" , "10", KEY_VOLUMEUP}, - {"VOLUMEDOWN" , "11", KEY_VOLUMEDOWN}, - {"INFO" , "0F", KEY_INFO}, - {"OPTIONS_FRONT" , "47", KEY_HELP}, - {"OK" , "5C", KEY_OK}, - {"UP" , "58", KEY_UP}, - {"RIGHT" , "5B", KEY_RIGHT}, - {"DOWN" , "59", KEY_DOWN}, - {"LEFT" , "5A", KEY_LEFT}, - {"0BUTTON" , "00", KEY_0}, - {"1BUTTON" , "01", KEY_1}, - {"2BUTTON" , "02", KEY_2}, - {"3BUTTON" , "03", KEY_3}, - {"4BUTTON" , "04", KEY_4}, - {"5BUTTON" , "05", KEY_5}, - {"6BUTTON" , "06", KEY_6}, - {"7BUTTON" , "07", KEY_7}, - {"8BUTTON" , "08", KEY_8}, - {"9BUTTON" , "09", KEY_9}, - - {"LMENU" , "D4", KEY_MENU}, - {"LRED" , "ED", KEY_RED}, - {"LGREEN" , "EE", KEY_GREEN}, - {"LYELLOW" , "EF", KEY_YELLOW}, - {"LBLUE" , "F0", KEY_BLUE}, - {"LEXIT" , "D5", KEY_HOME}, - {"LTEXT" , "BC", KEY_TEXT}, - {"LEPG" , "CC", KEY_EPG}, - {"LREWIND" , "A1", KEY_REWIND}, - {"LFASTFORWARD" , "A0", KEY_FASTFORWARD}, - {"LPLAY" , "B8", KEY_PLAY}, - {"LPAUSE" , "B9", KEY_PAUSE}, - {"LRECORD" , "B7", KEY_RECORD}, - {"LSTOP" , "B1", KEY_STOP}, - {"LSTANDBY" , "8C", KEY_POWER}, - {"LMUTE" , "8D", KEY_MUTE}, - {"LCHANNELUP" , "9E", KEY_PAGEUP}, - {"LCHANNELDOWN" , "9F", KEY_PAGEDOWN}, - {"LVOLUMEUP" , "90", KEY_VOLUMEUP}, - {"LVOLUMEDOWN" , "91", KEY_VOLUMEDOWN}, - {"LINFO" , "8F", KEY_HELP}, //THIS IS WRONG SHOULD BE KEY_INFO - {"LOK" , "DC", KEY_OK}, - {"LUP" , "D8", KEY_UP}, - {"LRIGHT" , "DB", KEY_RIGHT}, - {"LDOWN" , "D9", KEY_DOWN}, - {"LLEFT" , "DA", KEY_LEFT}, - {"L0BUTTON" , "80", KEY_0}, - {"L1BUTTON" , "81", KEY_1}, - {"L2BUTTON" , "82", KEY_2}, - {"L3BUTTON" , "83", KEY_3}, - {"L4BUTTON" , "84", KEY_4}, - {"L5BUTTON" , "85", KEY_5}, - {"L6BUTTON" , "86", KEY_6}, - {"L7BUTTON" , "87", KEY_7}, - {"L8BUTTON" , "88", KEY_8}, - {"L9BUTTON" , "89", KEY_9}, - - {"" , "" , KEY_NULL}, -}; - -/* fixme: move this to a structure and - * use the private structure of RemoteControl_t - */ -static struct sockaddr_un vAddr; -static int vFdLed; - -static int pInit(Context_t *context, int argc, char *argv[]) -{ - - int vHandle; - vFdLed = open("/sys/class/leds/ufs910:green/brightness", O_WRONLY); - - vAddr.sun_family = AF_UNIX; - strcpy(vAddr.sun_path, "/var/run/lirc/lircd"); - - vHandle = socket(AF_UNIX, SOCK_STREAM, 0); - - if (vHandle == -1) - { - perror("socket"); - return -1; - } - - if (connect(vHandle, (struct sockaddr *)&vAddr, sizeof(vAddr)) == -1) - { - perror("connect"); - return -1; - } - - return vHandle; -} - -static int pShutdown(Context_t *context) -{ - - close(context->fd); - - return 0; -} - -static int pRead(Context_t *context) -{ - - char vBuffer[128]; - char vData[10]; - const int cSize = 128; - int vCurrentCode = -1; - - //wait for new command - read(context->fd, vBuffer, cSize); - - //parse and send key event - vData[0] = vBuffer[17]; - vData[1] = vBuffer[18]; - vData[2] = '\0'; - - //prell, we could detect a long press here if we want - if (atoi(vData) % 3 != 0) - return -1; - - vData[0] = vBuffer[14]; - vData[1] = vBuffer[15]; - vData[2] = '\0'; - - vCurrentCode = getInternalCode((tButton *)((RemoteControl_t *)context->r)->RemoteControl, vData); - - return vCurrentCode; -} - -static int pNotification(Context_t *context, const int cOn) -{ - - if (cOn) - { - //activate green led - write(vFdLed, "1", 1); - } - else - { - //deactivate green led - usleep(50000); - write(vFdLed, "0", 1); - } - - return 0; -} - -RemoteControl_t Ufs910_14W_RC = -{ - "Ufs910 14Watt RemoteControl", - Ufs910_14W, - &pInit, - &pShutdown, - &pRead, - &pNotification, - cButtonsKathrein, - NULL, - NULL, - 0, - NULL, -}; diff --git a/evremote2/Ufs910_1W.c b/evremote2/Ufs910_1W.c deleted file mode 100644 index 892ae62..0000000 --- a/evremote2/Ufs910_1W.c +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Ufs910_1W.c - * - * (c) 2009 teamducktales - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "global.h" -#include "map.h" -#include "remotes.h" - -#define UFS910_1W_LONGKEY - -#ifdef UFS910_1W_LONGKEY -static tLongKeyPressSupport cLongKeyPressSupport = -{ - 20, 106, -}; -#endif - -static tButton cButtonsKathrein[] = -{ -// {"VFORMAT_FRONT" , "4A", KEY_MENU}, // any idea? - {"MENU" , "54", KEY_MENU}, - {"MENU_FRONT" , "49", KEY_MENU}, - {"RED" , "6D", KEY_RED}, - {"GREEN" , "6E", KEY_GREEN}, - {"YELLOW" , "6F", KEY_YELLOW}, - {"BLUE" , "70", KEY_BLUE}, - {"EXIT" , "55", KEY_HOME}, - {"EXIT_FRONT" , "4B", KEY_HOME}, - {"TEXT" , "3C", KEY_TEXT}, - {"EPG" , "4C", KEY_EPG}, - {"REWIND" , "21", KEY_REWIND}, - {"FASTFORWARD" , "20", KEY_FASTFORWARD}, - {"PLAY" , "38", KEY_PLAY}, - {"PAUSE" , "39", KEY_PAUSE}, - {"RECORD" , "37", KEY_RECORD}, - {"STOP" , "31", KEY_STOP}, - {"STANDBY" , "0C", KEY_POWER}, - {"STANDBY_FRONT" , "48", KEY_POWER}, - {"MUTE" , "0D", KEY_MUTE}, - {"CHANNELUP" , "1E", KEY_PAGEUP}, - {"CHANNELDOWN" , "1F", KEY_PAGEDOWN}, - {"VOLUMEUP" , "10", KEY_VOLUMEUP}, - {"VOLUMEDOWN" , "11", KEY_VOLUMEDOWN}, - {"INFO" , "0F", KEY_INFO}, - {"OPTIONS_FRONT" , "47", KEY_HELP}, - {"OK" , "5C", KEY_OK}, - {"UP" , "58", KEY_UP}, - {"RIGHT" , "5B", KEY_RIGHT}, - {"DOWN" , "59", KEY_DOWN}, - {"LEFT" , "5A", KEY_LEFT}, - {"0BUTTON" , "00", KEY_0}, - {"1BUTTON" , "01", KEY_1}, - {"2BUTTON" , "02", KEY_2}, - {"3BUTTON" , "03", KEY_3}, - {"4BUTTON" , "04", KEY_4}, - {"5BUTTON" , "05", KEY_5}, - {"6BUTTON" , "06", KEY_6}, - {"7BUTTON" , "07", KEY_7}, - {"8BUTTON" , "08", KEY_8}, - {"9BUTTON" , "09", KEY_9}, - - {"LMENU" , "D4", KEY_MENU}, - {"LRED" , "ED", KEY_RED}, - {"LGREEN" , "EE", KEY_GREEN}, - {"LYELLOW" , "EF", KEY_YELLOW}, - {"LBLUE" , "F0", KEY_BLUE}, - {"LEXIT" , "D5", KEY_HOME}, - {"LTEXT" , "BC", KEY_TEXT}, - {"LEPG" , "CC", KEY_EPG}, - {"LREWIND" , "A1", KEY_REWIND}, - {"LFASTFORWARD" , "A0", KEY_FASTFORWARD}, - {"LPLAY" , "B8", KEY_PLAY}, - {"LPAUSE" , "B9", KEY_PAUSE}, - {"LRECORD" , "B7", KEY_RECORD}, - {"LSTOP" , "B1", KEY_STOP}, - {"LSTANDBY" , "8C", KEY_POWER}, - {"LMUTE" , "8D", KEY_MUTE}, - {"LCHANNELUP" , "9E", KEY_PAGEUP}, - {"LCHANNELDOWN" , "9F", KEY_PAGEDOWN}, - {"LVOLUMEUP" , "90", KEY_VOLUMEUP}, - {"LVOLUMEDOWN" , "91", KEY_VOLUMEDOWN}, - {"LINFO" , "8F", KEY_HELP}, //THIS IS WRONG SHOULD BE KEY_INFO - {"LOK" , "DC", KEY_OK}, - {"LUP" , "D8", KEY_UP}, - {"LRIGHT" , "DB", KEY_RIGHT}, - {"LDOWN" , "D9", KEY_DOWN}, - {"LLEFT" , "DA", KEY_LEFT}, - {"L0BUTTON" , "80", KEY_0}, - {"L1BUTTON" , "81", KEY_1}, - {"L2BUTTON" , "82", KEY_2}, - {"L3BUTTON" , "83", KEY_3}, - {"L4BUTTON" , "84", KEY_4}, - {"L5BUTTON" , "85", KEY_5}, - {"L6BUTTON" , "86", KEY_6}, - {"L7BUTTON" , "87", KEY_7}, - {"L8BUTTON" , "88", KEY_8}, - {"L9BUTTON" , "89", KEY_9}, - - {"" , "" , KEY_NULL}, -}; - - -static int vFd; - - -static int setTemFlagsKathrein(int fd) -{ - struct termios old_io; - struct termios new_io; - - if ((tcgetattr(fd, &old_io)) == 0) - { - new_io = old_io; - - printf("setting new flags\n"); - /* c_iflags ->input flags */ - new_io.c_iflag &= ~(IMAXBEL | BRKINT | ICRNL); - - /* c_lflags ->local flags*/ - new_io.c_lflag &= ~(ECHO | IEXTEN); - - /* c_oflags ->output flags*/ - new_io.c_oflag &= ~(ONLCR); - - /* c_cflags ->constant flags*/ - new_io.c_cflag = B19200; - - tcsetattr(fd, TCSANOW, &new_io); - - } - else - printf("error set raw mode.\n"); - - return 0; -} - - -static int pInit(Context_t *context, int argc, char *argv[]) -{ - - vFd = open("/dev/ttyAS1", O_RDWR); - setTemFlagsKathrein(vFd); - - return vFd; -} - -static int pShutdown(Context_t *context) -{ - - close(vFd); - - return 0; -} - -#ifndef UFS910_1W_LONGKEY -static int pRead(Context_t *context) -{ - - char vData[3]; - const int cSize = 3; - int vCurrentCode = -1; - - //wait for new command - read(vFd, vData, cSize); - - //parse and send key event - vData[2] = '\0'; - - vCurrentCode = getInternalCode((tButton *)((RemoteControl_t *)context->r)->RemoteControl, vData); - - return vCurrentCode; -} -#else - -static int gNextKey = 0; - -static int pRead(Context_t *context) -{ - - char vData[3]; - const int cSize = 3; - int vCurrentCode = -1; - - //wait for new command - read(vFd, vData, cSize); - - //parse and send key event - vData[2] = '\0'; - - vCurrentCode = getInternalCode((tButton *)((RemoteControl_t *)context->r)->RemoteControl, vData); - - if ((vCurrentCode & 0x80) == 0) // new key - { - gNextKey++; - gNextKey %= 20; - } - - vCurrentCode += (gNextKey << 16); - - return vCurrentCode; -} -#endif - -static int pNotification(Context_t *context, const int cOn) -{ - - if (cOn) - write(vFd, "1\n1\n1\n1\n", 8); - else - { - usleep(50000); - write(vFd, "A\nA\nA\nA\n", 8); - } - - return 0; -} - -RemoteControl_t Ufs910_1W_RC = -{ - "Ufs910 1Watt RemoteControl", - Ufs910_1W, - &pInit, - &pShutdown, - &pRead, - &pNotification, - cButtonsKathrein, - NULL, - NULL, -#ifndef UFS910_1W_LONGKEY - 0, - NULL, -#else - 1, - &cLongKeyPressSupport, -#endif -}; diff --git a/evremote2/Ufs912.c b/evremote2/Ufs912.c deleted file mode 100644 index 74c4c5a..0000000 --- a/evremote2/Ufs912.c +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Ufs912.c - * - * (c) 2009 dagobert@teamducktales - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "global.h" -#include "map.h" -#include "remotes.h" -#include "Ufs912.h" - -/* ***************** some constants **************** */ - -#define rcDeviceName "/dev/rc" -#define cUFS912CommandLen 8 - -/* ***************** our key assignment **************** */ - -static tLongKeyPressSupport cLongKeyPressSupport = -{ - 10, 120, 1 -}; - -static tButton cButtonUFS912[] = -{ - {"MEDIA" , "D5", KEY_MEDIA}, - {"ARCHIVE" , "46", KEY_ARCHIVE}, - {"MENU" , "54", KEY_MENU}, - {"RED" , "6D", KEY_RED}, - {"GREEN" , "6E", KEY_GREEN}, - {"YELLOW" , "6F", KEY_YELLOW}, - {"BLUE" , "70", KEY_BLUE}, - {"EXIT" , "55", KEY_HOME}, - {"TEXT" , "3C", KEY_TEXT}, - {"EPG" , "CC", KEY_EPG}, - {"REWIND" , "21", KEY_REWIND}, - {"FASTFORWARD" , "20", KEY_FASTFORWARD}, - {"PLAY" , "38", KEY_PLAY}, - {"PAUSE" , "39", KEY_PAUSE}, - {"RECORD" , "37", KEY_RECORD}, - {"STOP" , "31", KEY_STOP}, - {"STANDBY" , "0C", KEY_POWER}, - {"MUTE" , "0D", KEY_MUTE}, - {"CHANNELUP" , "1E", KEY_PAGEUP}, - {"CHANNELDOWN" , "1F", KEY_PAGEDOWN}, - {"VOLUMEUP" , "10", KEY_VOLUMEUP}, - {"VOLUMEDOWN" , "11", KEY_VOLUMEDOWN}, - {"HELP" , "81", KEY_HELP}, - {"INFO" , "0F", KEY_INFO}, - {"OK" , "5C", KEY_OK}, - {"UP" , "58", KEY_UP}, - {"RIGHT" , "5B", KEY_RIGHT}, - {"DOWN" , "59", KEY_DOWN}, - {"LEFT" , "5A", KEY_LEFT}, - {"0BUTTON" , "00", KEY_0}, - {"1BUTTON" , "01", KEY_1}, - {"2BUTTON" , "02", KEY_2}, - {"3BUTTON" , "03", KEY_3}, - {"4BUTTON" , "04", KEY_4}, - {"5BUTTON" , "05", KEY_5}, - {"6BUTTON" , "06", KEY_6}, - {"7BUTTON" , "07", KEY_7}, - {"8BUTTON" , "08", KEY_8}, - {"9BUTTON" , "09", KEY_9}, - {"" , "" , KEY_NULL} -}; - -/* ***************** our fp button assignment **************** */ - -static tButton cButtonUFS912Frontpanel[] = -{ - {"FP_MEDIA" , "80", KEY_MEDIA}, - {"FP_ON_OFF" , "01", KEY_POWER}, - {"FP_MINUS" , "04", KEY_DOWN}, - {"FP_PLUS" , "02", KEY_UP}, - {"FP_TV_R" , "08", KEY_OK}, - {"" , "" , KEY_NULL} -}; - -static int ufs912SetRemote(unsigned int code) -{ - #define VFDSETRCCODE 0xc0425af6 - int vfd_fd = -1; - struct - { - unsigned char start; - unsigned char data[64]; - unsigned char length; - } data; - - data.start = 0x00; - data.data[0] = code & 0x07; - data.length = 1; - - vfd_fd = open("/dev/vfd", O_RDWR); - if (vfd_fd) - { - ioctl(vfd_fd, VFDSETRCCODE, &data); - close(vfd_fd); - } - return 0; -} - -static int pInit(Context_t *context, int argc, char *argv[]) -{ - int vFd; - vFd = open(rcDeviceName, O_RDWR); - - if (argc >= 2) - { - cLongKeyPressSupport.period = atoi(argv[1]); - } - - if (argc >= 3) - { - cLongKeyPressSupport.delay = atoi(argv[2]); - } - - if (!access("/etc/.rccode", F_OK)) - { - char buf[10]; - int val; - FILE* fd; - fd = fopen("/etc/.rccode", "r"); - if (fd != NULL) - { - if (fgets (buf , sizeof(buf), fd) != NULL) - { - val = atoi(buf); - if (val > 0 && val < 5) - { - cLongKeyPressSupport.rc_code = val; - printf("Selected RC Code: %d\n", cLongKeyPressSupport.rc_code); - ufs912SetRemote(cLongKeyPressSupport.rc_code); - } - } - fclose(fd); - } - } - - printf("period %d, delay %d, rc_code %d\n", cLongKeyPressSupport.period, cLongKeyPressSupport.delay, cLongKeyPressSupport.rc_code); - - return vFd; -} - - -static int pRead(Context_t *context) -{ - unsigned char vData[cUFS912CommandLen]; - eKeyType vKeyType = RemoteControl; - int vCurrentCode = -1; - int rc = 1; - - //printf("%s >\n", __func__); - - while (1) - { - read(context->fd, vData, cUFS912CommandLen); - - if (vData[0] == 0xD2) - vKeyType = RemoteControl; - else if (vData[0] == 0xD1) - vKeyType = FrontPanel; - else - continue; - - if (vKeyType == RemoteControl) - { - /* mask out for rc codes - * possible 0 to 3 for remote controls 1 to 4 - * given in /etc for example via console: echo 2 > /etc/.rccode - * will be read and rc_code = 2 is used ( press then back + 2 simultanessly on remote to fit it there) - * default is rc_code = 1 ( like back + 1 on remote ) */ - rc = ((vData[4] & 0x30) >> 4) + 1; - printf("RC code: %d\n", rc); - if (rc == ((RemoteControl_t *)context->r)->LongKeyPressSupport->rc_code) - vCurrentCode = getInternalCodeHex((tButton *)((RemoteControl_t *)context->r)->RemoteControl, vData[1]); - else - break; - } - else - { - vCurrentCode = getInternalCodeHex((tButton *)((RemoteControl_t *)context->r)->Frontpanel, vData[1]); - } - - if (vCurrentCode != 0) - { - unsigned int vNextKey = vData[4]; - vCurrentCode += (vNextKey << 16); - break; - } - } - - //printf("%s < %08X\n", __func__, vCurrentCode); - - return vCurrentCode; -} - -static int pNotification(Context_t *context, const int cOn) -{ - - return 0; -} - -static int pShutdown(Context_t *context) -{ - - close(context->fd); - - return 0; -} - -RemoteControl_t UFS912_RC = -{ - "Kathrein UFS912 RemoteControl", - Ufs912, - &pInit, - &pShutdown, - &pRead, - &pNotification, - cButtonUFS912, - cButtonUFS912Frontpanel, - NULL, - 1, - &cLongKeyPressSupport, -}; - diff --git a/evremote2/Ufs912.h b/evremote2/Ufs912.h deleted file mode 100644 index 77bbe8b..0000000 --- a/evremote2/Ufs912.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef _ufs912_ -#define _ufs912_ - -#define VFDSETLED 0xc0425afe - -struct set_brightness_s -{ - int level; -}; - -struct set_icon_s -{ - int icon_nr; - int on; -}; - -struct set_led_s -{ - int led_nr; - int on; -}; - -/* this setups the mode temporarily (for one ioctl) - * to the desired mode. currently the "normal" mode - * is the compatible vfd mode - */ -struct set_mode_s -{ - int compat; /* 0 = compatibility mode to vfd driver; 1 = micom mode */ -}; - -struct micom_ioctl_data -{ - union - { - struct set_icon_s icon; - struct set_led_s led; - struct set_brightness_s brightness; - struct set_mode_s mode; - } u; -}; - -#endif diff --git a/evremote2/Ufs922.c b/evremote2/Ufs922.c deleted file mode 100644 index 95a6c11..0000000 --- a/evremote2/Ufs922.c +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Ufs922.c - * - * (c) 2009 dagobert@teamducktales - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "global.h" -#include "map.h" -#include "remotes.h" -#include "Ufs922.h" - -/* ***************** some constants **************** */ - -#define rcDeviceName "/dev/rc" -#define cUFS922CommandLen 8 - -typedef struct -{ - int toggleFeedback; - int disableFeedback; -} tUFS922Private; - -/* ***************** our key assignment **************** */ - -static tLongKeyPressSupport cLongKeyPressSupport = -{ - 10, 120, -}; - -static tButton cButtonUFS922[] = -{ - {"MEDIA" , "D5", KEY_MEDIA}, - {"ARCHIVE" , "46", KEY_ARCHIVE}, - {"MENU" , "54", KEY_MENU}, - {"RED" , "6D", KEY_RED}, - {"GREEN" , "6E", KEY_GREEN}, - {"YELLOW" , "6F", KEY_YELLOW}, - {"BLUE" , "70", KEY_BLUE}, - {"EXIT" , "55", KEY_HOME}, - {"TEXT" , "3C", KEY_TEXT}, -// {"EPG" , "4C", KEY_EPG}, - {"EPG" , "CC", KEY_EPG}, - {"REWIND" , "21", KEY_REWIND}, - {"FASTFORWARD" , "20", KEY_FASTFORWARD}, - {"PLAY" , "38", KEY_PLAY}, - {"PAUSE" , "39", KEY_PAUSE}, - {"RECORD" , "37", KEY_RECORD}, - {"STOP" , "31", KEY_STOP}, - {"STANDBY" , "0C", KEY_POWER}, - {"MUTE" , "0D", KEY_MUTE}, - {"CHANNELUP" , "1E", KEY_PAGEUP}, - {"CHANNELDOWN" , "1F", KEY_PAGEDOWN}, - {"VOLUMEUP" , "10", KEY_VOLUMEUP}, - {"VOLUMEDOWN" , "11", KEY_VOLUMEDOWN}, - {"INFO" , "0F", KEY_INFO}, - {"OK" , "5C", KEY_OK}, - {"UP" , "58", KEY_UP}, - {"RIGHT" , "5B", KEY_RIGHT}, - {"DOWN" , "59", KEY_DOWN}, - {"LEFT" , "5A", KEY_LEFT}, - {"0BUTTON" , "00", KEY_0}, - {"1BUTTON" , "01", KEY_1}, - {"2BUTTON" , "02", KEY_2}, - {"3BUTTON" , "03", KEY_3}, - {"4BUTTON" , "04", KEY_4}, - {"5BUTTON" , "05", KEY_5}, - {"6BUTTON" , "06", KEY_6}, - {"7BUTTON" , "07", KEY_7}, - {"8BUTTON" , "08", KEY_8}, - {"9BUTTON" , "09", KEY_9}, - {"" , "" , KEY_NULL}, -}; - -/* ***************** our fp button assignment **************** */ - -static tButton cButtonUFS922Frontpanel[] = -{ - {"FP_MENU" , "80", KEY_MENU}, - {"FP_EXIT" , "0D", KEY_HOME}, - /* {"FP_AUX" , 0x20, ???}, - {"FP_TV_R" , 0x08, ???}, - */ - {"FP_OK" , "04", KEY_OK}, - {"FP_WHEEL_LEFT" , "0F", KEY_UP}, - {"FP_WHEEL_RIGHT" , "0E", KEY_DOWN}, - {"" , "" , KEY_NULL} - /* is there no power key on frontpanel? */ -}; - -static int pInit(Context_t *context, int argc, char *argv[]) -{ - int vFd; - tUFS922Private *private = malloc(sizeof(tUFS922Private)); - - ((RemoteControl_t *)context->r)->private = private; - - vFd = open(rcDeviceName, O_RDWR); - - memset(private, 0, sizeof(tUFS922Private)); - - if (argc >= 2) - private->toggleFeedback = atoi(argv[1]); - else - private->toggleFeedback = 0; - - if (argc >= 3) - private->disableFeedback = atoi(argv[2]); - else - private->disableFeedback = 0; - - printf("toggle %d, disable %d\n", private->toggleFeedback, private->disableFeedback); - - if (argc >= 4) - { - cLongKeyPressSupport.period = atoi(argv[3]); - } - - if (argc >= 5) - { - cLongKeyPressSupport.delay = atoi(argv[4]); - } - - printf("period %d, delay %d\n", cLongKeyPressSupport.period, cLongKeyPressSupport.delay); - - if (private->toggleFeedback) - { - struct micom_ioctl_data vfd_data; - int ioctl_fd = open("/dev/vfd", O_RDONLY); - - vfd_data.u.led.led_nr = 6; - vfd_data.u.led.on = 1; - ioctl(ioctl_fd, VFDSETLED, &vfd_data); - close(ioctl_fd); - } - - return vFd; -} - - -static int pRead(Context_t *context) -{ - unsigned char vData[cUFS922CommandLen]; - eKeyType vKeyType = RemoteControl; - int vCurrentCode = -1; - - /* printf("%s >\n", __func__); */ - - while (1) - { - int i; - int n = read(context->fd, vData, cUFS922CommandLen); - - if (vData[0] == 0xD2) - vKeyType = RemoteControl; - else if (vData[0] == 0xD1) - vKeyType = FrontPanel; - else - continue; - - if (vKeyType == RemoteControl) - { - vCurrentCode = getInternalCodeHex((tButton *)((RemoteControl_t *)context->r)->RemoteControl, vData[1]); - } - else - { - vCurrentCode = getInternalCodeHex((tButton *)((RemoteControl_t *)context->r)->Frontpanel, vData[1]); - } - - if (vCurrentCode != 0) - { - unsigned int vNextKey = vData[4]; - vCurrentCode += (vNextKey << 16); - break; - } - } - - /* printf("%s <\n", __func__);*/ - - return vCurrentCode; -} - -static int pNotification(Context_t *context, const int cOn) -{ - int ioctl_fd = -1; - struct micom_ioctl_data vfd_data; - tUFS922Private *private = (tUFS922Private *)((RemoteControl_t *)context->r)->private; - - if (private->disableFeedback) - return 0; - - if (cOn) - { - ioctl_fd = open("/dev/vfd", O_RDONLY); - vfd_data.u.led.led_nr = 6; - vfd_data.u.led.on = !private->toggleFeedback; - ioctl(ioctl_fd, VFDSETLED, &vfd_data); - close(ioctl_fd); - } - else - { - usleep(100000); - ioctl_fd = open("/dev/vfd", O_RDONLY); - vfd_data.u.led.led_nr = 6; - vfd_data.u.led.on = private->toggleFeedback; - ioctl(ioctl_fd, VFDSETLED, &vfd_data); - close(ioctl_fd); - } - - return 0; -} - -static int pShutdown(Context_t *context) -{ - tUFS922Private *private = (tUFS922Private *)((RemoteControl_t *)context->r)->private; - - close(context->fd); - - if (private->toggleFeedback) - { - struct micom_ioctl_data vfd_data; - int ioctl_fd = open("/dev/vfd", O_RDONLY); - - vfd_data.u.led.led_nr = 6; - vfd_data.u.led.on = 0; - ioctl(ioctl_fd, VFDSETLED, &vfd_data); - close(ioctl_fd); - } - - free(private); - - return 0; -} - -RemoteControl_t UFS922_RC = -{ - "Kathrein UFS922 RemoteControl", - Ufs922, - &pInit, - &pShutdown, - &pRead, - &pNotification, - cButtonUFS922, - cButtonUFS922Frontpanel, - NULL, - 1, - &cLongKeyPressSupport, -}; diff --git a/evremote2/Ufs922.h b/evremote2/Ufs922.h deleted file mode 100644 index 4107f3a..0000000 --- a/evremote2/Ufs922.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef _ufs922_ -#define _ufs922_ - -#define VFDSETLED 0xc0425afe - -struct set_brightness_s -{ - int level; -}; - -struct set_icon_s -{ - int icon_nr; - int on; -}; - -struct set_led_s -{ - int led_nr; - int on; -}; - -/* this setups the mode temporarily (for one ioctl) - * to the desired mode. currently the "normal" mode - * is the compatible vfd mode - */ -struct set_mode_s -{ - int compat; /* 0 = compatibility mode to vfd driver; 1 = micom mode */ -}; - -struct micom_ioctl_data -{ - union - { - struct set_icon_s icon; - struct set_led_s led; - struct set_brightness_s brightness; - struct set_mode_s mode; - } u; -}; - -#endif diff --git a/evremote2/autogen.sh b/evremote2/autogen.sh deleted file mode 100755 index 4d86f26..0000000 --- a/evremote2/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-evremote2" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/evremote2/configure.ac b/evremote2/configure.ac deleted file mode 100644 index f035fbd..0000000 --- a/evremote2/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT([evremote2],[1.0],[],[evremote2]) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_OUTPUT([ -Makefile -]) diff --git a/evremote2/evremote.c b/evremote2/evremote.c deleted file mode 100755 index 254ef07..0000000 --- a/evremote2/evremote.c +++ /dev/null @@ -1,620 +0,0 @@ -/* - * evremote.c - * - * (c) 2009 donald@teamducktales - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include "global.h" -#include "remotes.h" - -//////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////// - -int processSimple(Context_t *context, int argc, char *argv[]) -{ - - int vCurrentCode = -1; - - if (((RemoteControl_t *)context->r)->Init) - context->fd = (((RemoteControl_t *)context->r)->Init)(context, argc, argv); - else - { - fprintf(stderr, "driver does not support init function\n"); - exit(1); - } - - if (context->fd < 0) - { - fprintf(stderr, "error in device initialization\n"); - exit(1); - } - - while (true) - { - - //wait for new command - if (((RemoteControl_t *)context->r)->Read) - vCurrentCode = ((RemoteControl_t *)context->r)->Read(context); - - if (vCurrentCode <= 0) - continue; - - //activate visual notification - if (((RemoteControl_t *)context->r)->Notification) - ((RemoteControl_t *)context->r)->Notification(context, 1); - - //Check if tuxtxt is running - if (checkTuxTxt(vCurrentCode) == false) - sendInputEvent(vCurrentCode); - - //deactivate visual notification - if (((RemoteControl_t *)context->r)->Notification) - ((RemoteControl_t *)context->r)->Notification(context, 0); - } - - if (((RemoteControl_t *)context->r)->Shutdown) - ((RemoteControl_t *)context->r)->Shutdown(context); - else - close(context->fd); - - return 0; -} - - -//////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////// - -static unsigned int gBtnPeriod = 100; -static unsigned int gBtnDelay = 10; - -static unsigned int cmdBtnPeriod = 0; -static unsigned int cmdBtnDelay = 0; - -static struct timeval profilerLast; - -static unsigned int gKeyCode = 0; -static unsigned int gNextKey = 0; -static unsigned int gNextKeyFlag = 0xFF; - -static sem_t keydown_sem; -static pthread_t keydown_thread; - -static bool countFlag = false; - -#ifdef NITS_SEM_PATCH_WOULD_WORK -// Your patch crashes the long key press detection. -// You know there was a reason why I didn't do it this way. -// Sem_getvaulue and counting sems does not work as someone would initialy expect. -#else -static unsigned char keydown_sem_helper = 1; -#endif -static void sem_up(void) -{ -#ifdef NITS_SEM_PATCH_WOULD_WORK - int sem_val; - sem_getvalue(&keydown_sem, &sem_val); - - if (sem_val <= 0) - { -#else - - if (keydown_sem_helper == 0) - { -#endif - printf("[SEM] UP\n"); - sem_post(&keydown_sem); -#ifdef NITS_SEM_PATCH_WOULD_WORK -#else - keydown_sem_helper = 1; -#endif - } -} - -static void sem_down(void) -{ - printf("[SEM] DOWN\n"); -#ifdef NITS_SEM_PATCH_WOULD_WORK -#else - keydown_sem_helper = 0; -#endif - sem_wait(&keydown_sem); -} - -int -timeval_subtract(result, x, y) -struct timeval *result, *x, *y; -{ - /* Perform the carry for the later subtraction by updating y. */ - if (x->tv_usec < y->tv_usec) - { - int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1; - y->tv_usec -= 1000000 * nsec; - y->tv_sec += nsec; - } - - if (x->tv_usec - y->tv_usec > 1000000) - { - int nsec = (x->tv_usec - y->tv_usec) / 1000000; - y->tv_usec += 1000000 * nsec; - y->tv_sec -= nsec; - } - - /* Compute the time remaining to wait. - tv_usec is certainly positive. */ - result->tv_sec = x->tv_sec - y->tv_sec; - result->tv_usec = x->tv_usec - y->tv_usec; - - /* Return 1 if result is negative. */ - return x->tv_sec < y->tv_sec; -} - -static long diffMilli(struct timeval from, struct timeval to) -{ - struct timeval diff; - timeval_subtract(&diff, &to, &from); - return (long)(diff.tv_sec * 1000 + diff.tv_usec / 1000); -} - - -void *detectKeyUpTask(void *dummy); - -int processComplex(Context_t *context, int argc, char *argv[]) -{ - - int vCurrentCode = -1; - - unsigned int diffTime = 0; - unsigned int waitTime = 0; - int keyCount = 0; - bool newKey = false; - bool startFlag = false; - - printf("%s >\n", __func__); - - if (((RemoteControl_t *)context->r)->Init) - context->fd = (((RemoteControl_t *)context->r)->Init)(context, argc, argv); - else - { - fprintf(stderr, "driver does not support init function\n"); - exit(1); - } - - if (context->fd < 0) - { - fprintf(stderr, "error in device initialization\n"); - exit(1); - } - - if (((RemoteControl_t *)context->r)->LongKeyPressSupport != NULL) - { - tLongKeyPressSupport lkps = *((RemoteControl_t *)context->r)->LongKeyPressSupport; - gBtnPeriod = (cmdBtnPeriod) ? cmdBtnPeriod : lkps.period; - gBtnDelay = (cmdBtnDelay) ? cmdBtnDelay : lkps.delay; - printf("Using period=%d delay=%d\n", gBtnPeriod, gBtnDelay); - } - - if (cmdBtnPeriod && cmdBtnDelay && (cmdBtnPeriod + cmdBtnDelay) < 200) - setInputEventRepeatRate(500, cmdBtnPeriod + cmdBtnDelay); - else - setInputEventRepeatRate(500, 200); - - sem_init(&keydown_sem, 0, 0); - pthread_create(&keydown_thread, NULL, detectKeyUpTask, context); - - struct timeval time; - gettimeofday(&profilerLast, NULL); - - while (true) - { - - //wait for new command - if (((RemoteControl_t *)context->r)->Read) - vCurrentCode = ((RemoteControl_t *)context->r)->Read(context); - - if (vCurrentCode <= 0) - continue; - - gKeyCode = vCurrentCode & 0xFFFF; - unsigned int nextKeyFlag = (vCurrentCode >> 16) & 0xFFFF; - - if (gNextKeyFlag != nextKeyFlag) - { - gNextKey++; - gNextKey %= 20; - gNextKeyFlag = nextKeyFlag; - newKey = true; - } - else - newKey = false; - - gettimeofday(&time, NULL); - diffTime = (unsigned int)diffMilli(profilerLast, time); - printf("**** %12u %d ****\n", diffTime, gNextKey); - profilerLast = time; - - if (countFlag) - waitTime += diffTime; - - if (countFlag && newKey && gKeyCode == 0x74) - { - if (waitTime < 10000) // reboot if pressing 5 times power within 10 seconds - { - keyCount += 1; - printf("Power Count= %d\n", keyCount); - if (keyCount >= 5) - { - countFlag = false; - keyCount = 0; - waitTime = 0; - printf("[evremote2] > Emergency REBOOT !!!\n"); - fflush(stdout); - system("init 6"); - sleep(4); - reboot(LINUX_REBOOT_CMD_RESTART); - } - } - else // release reboot counter - { - countFlag = false; - keyCount = 0; - waitTime = 0; - } - } - else if (countFlag && gKeyCode == 0x74) - countFlag = true; - else - countFlag = false; - - if (startFlag && newKey && gKeyCode == 0x74 && diffTime < 1000) //KEY_POWER > reboot counter enabled - { - countFlag = true; - waitTime = diffTime; - keyCount = 1; - printf("Power Count= %d\n", keyCount); - } - - if (gKeyCode == 0x160) //KEY_OK > initiates reboot counter when pressing power within 1 second - startFlag = true; - else - startFlag = false; - - sem_up(); - - } - - if (((RemoteControl_t *)context->r)->Shutdown) - ((RemoteControl_t *)context->r)->Shutdown(context); - else - close(context->fd); - - printf("%s <\n", __func__); - - return 0; -} - -void *detectKeyUpTask(void *dummy) -{ - Context_t *context = (Context_t *) dummy; - struct timeval time; - - while (1) - { - unsigned int keyCode = 0; - unsigned int nextKey = 0; - sem_down(); // Wait till the next keypress - - while (1) - { - int tux = 0; - - keyCode = gKeyCode; - nextKey = gNextKey; - - //activate visual notification - if (((RemoteControl_t *)context->r)->Notification) - ((RemoteControl_t *)context->r)->Notification(context, 1); - - printf("KEY_PRESS - %02x %d\n", keyCode, nextKey); - - //Check if tuxtxt is running - tux = checkTuxTxt(keyCode); - - if (tux == false && !countFlag) - sendInputEventT(INPUT_PRESS, keyCode); - - //usleep(gBtnDelay*1000); - while (gKeyCode && nextKey == gNextKey) - { - gettimeofday(&time, NULL); - unsigned int sleep = gBtnPeriod + gBtnDelay - diffMilli(profilerLast, time); - - if (sleep > (gBtnPeriod + gBtnDelay)) - sleep = (gBtnPeriod + gBtnDelay); - - printf("++++ %12u ms ++++\n", (unsigned int)diffMilli(profilerLast, time)); - gKeyCode = 0; - usleep(sleep * 1000); - } - - printf("KEY_RELEASE - %02x %02x %d %d CAUSE=%s\n", keyCode, gKeyCode, nextKey, gNextKey, (gKeyCode == 0) ? "Timeout" : "New key"); - - //Check if tuxtxt is running - if (tux == false && !countFlag) - sendInputEventT(INPUT_RELEASE, keyCode); - - //deactivate visual notification - if (((RemoteControl_t *)context->r)->Notification) - ((RemoteControl_t *)context->r)->Notification(context, 0); - - gettimeofday(&time, NULL); - printf("---- %12u ms ----\n", (unsigned int)diffMilli(profilerLast, time)); - - if (nextKey == gNextKey) - break; - } - } - - return 0; -} - - -//////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////// - - -int getKathreinUfs910BoxType() -{ - char vType; - int vFdBox = open("/proc/boxtype", O_RDONLY); - - read(vFdBox, &vType, 1); - - close(vFdBox); - - return vType == '0' ? 0 : vType == '1' || vType == '3' ? 1 : -1; -} - -int getModel() -{ - int vFd = -1; - const int cSize = 128; - char vName[129] = "LircdName"; - int vLen = -1; - eBoxType vBoxType = Unknown; - - vFd = open("/proc/stb/info/model", O_RDONLY); - vLen = read(vFd, vName, cSize); - - close(vFd); - - if (vLen > 0) - { - vName[vLen - 1] = '\0'; - - printf("Model: '%s'\n", vName); - - if (!strncasecmp(vName, "ufs910", 6)) - { - switch (getKathreinUfs910BoxType()) - { - case 0: - vBoxType = Ufs910_1W; - break; - - case 1: - vBoxType = Ufs910_14W; - break; - - default: - vBoxType = Unknown; - break; - } - } - else if (!strncasecmp(vName, "ufs922", 6)) - vBoxType = Ufs922; - else if (!strncasecmp(vName, "tf7700hdpvr", 11)) - vBoxType = Tf7700; - else if ((!strncasecmp(vName, "hdbox", 5)) || - (!strncasecmp(vName, "atevio7500", 10)) || - (!strncasecmp(vName, "octagon1008", 11))) - { - vBoxType = Fortis; - } - else if ((!strncasecmp(vName, "ipbox9900", 9)) || (!strncasecmp(vName, "ipbox99", 7)) || (!strncasecmp(vName, "ipbox55", 7))) - vBoxType = Ipbox; - else if (!strncasecmp(vName, "ufs912", 5)) - vBoxType = Ufs912; - else if (!strncasecmp(vName, "ufs913", 5)) - vBoxType = Ufs912; - else if (!strncasecmp(vName, "spark", 5)) - vBoxType = Spark; - else if (!strncasecmp(vName, "spark7162", 9)) - vBoxType = Spark; - else if ((!strncasecmp(vName, "cuberevo", 8)) || - (!strncasecmp(vName, "cuberevo-mini", 13)) || - (!strncasecmp(vName, "cuberevo-mini2", 14)) || - (!strncasecmp(vName, "cuberevo-250hd", 14)) || - (!strncasecmp(vName, "cuberevo-2000hd", 15)) || - (!strncasecmp(vName, "cuberevo-3000hd", 14))) - { - vBoxType = Cuberevo; - } - - else /* for other boxes we use LircdName driver as a default */ - vBoxType = LircdName; - } - - printf("vBoxType: %d\n", vBoxType); - - return vBoxType; -} - -void ignoreSIGPIPE() -{ - struct sigaction vAction; - - vAction.sa_handler = SIG_IGN; - - sigemptyset(&vAction.sa_mask); - vAction.sa_flags = 0; - sigaction(SIGPIPE, &vAction, (struct sigaction *)NULL); -} - - -int main(int argc, char *argv[]) -{ - eBoxType vBoxType = Unknown; - Context_t context; - - /* Dagobert: if tuxtxt closes the socket while - * we are writing a sigpipe occures which kills - * evremote. so lets ignore it ... - */ - ignoreSIGPIPE(); - - if (argc >= 2 && (!strncmp(argv[1], "-h", 2) || !strncmp(argv[1], "--help", 6))) - { - printf("USAGE:\n"); - printf("evremote2 [[[useLircdName] ] ] ]\n"); - printf("Parameters description:\n"); - printf("useLircdName - using key names defined in lircd.conf.\n Can work with multiple RCs simultaneously.\n"); - printf(" - time of pressing a key.\n"); - printf(" - delay between pressing keys. Increase if RC is too sensitive\n"); - printf(" - Number of blinking Icon\n"); - printf("No parameters - autoselection of RC driver with standard features.\n\n"); - return 0; - } - if (argc >= 2 && !strncmp(argv[1], "useLircdName", 12)) - { - vBoxType = LircdName; - if (argc >= 3) - cmdBtnPeriod = atoi(argv[2]); - if (argc >= 4) - cmdBtnDelay = atoi(argv[3]); - } - else - vBoxType = getModel(); - - if (vBoxType != Unknown) - if (!getEventDevice()) - { - printf("unable to open event device\n"); - return 5; - } - - selectRemote(&context, vBoxType); - - printf("Selected Remote: %s\n", ((RemoteControl_t *)context.r)->Name); - - if (((RemoteControl_t *)context.r)->RemoteControl != NULL) - { - printf("RemoteControl Map:\n"); - printKeyMap((tButton *)((RemoteControl_t *)context.r)->RemoteControl); - } - - if (((RemoteControl_t *)context.r)->Frontpanel != NULL) - { - printf("Frontpanel Map:\n"); - printKeyMap((tButton *)((RemoteControl_t *)context.r)->Frontpanel); - } - - const int cMaxButtonExtension = 128; // Up To 128 Extension Buttons - tButton vButtonExtension[cMaxButtonExtension]; - int vButtonExtensionCounter = 0; - - if (argc == 3 && !strncmp(argv[1], "-r", 2)) - { - char vKeyName[64]; - char vKeyWord[64]; - int vKeyCode; - char *vRemoteFile = argv[2]; - FILE *vRemoteFileD = NULL; - - vRemoteFileD = fopen(vRemoteFile, "r"); - - if (vRemoteFileD != NULL) - { - while (fscanf(vRemoteFileD, "%s %s %d", vKeyName, vKeyWord, &vKeyCode) == 3) - { - strncpy(vButtonExtension[vButtonExtensionCounter].KeyName, vKeyName, 20); - strncpy(vButtonExtension[vButtonExtensionCounter].KeyWord, vKeyWord, 2); - vButtonExtension[vButtonExtensionCounter].KeyCode = vKeyCode; - vButtonExtensionCounter++; - - if (vButtonExtensionCounter + 1 == cMaxButtonExtension) - break; - } - - fclose(vRemoteFileD); - - strncpy(vButtonExtension[vButtonExtensionCounter].KeyName, "\0", 1); - strncpy(vButtonExtension[vButtonExtensionCounter].KeyWord, "\0", 1); - vButtonExtension[vButtonExtensionCounter].KeyCode = KEY_NULL; - - printf("RemoteControl Extension Map:\n"); - printKeyMap(vButtonExtension); - } - } - - if (vButtonExtensionCounter > 0) - ((RemoteControl_t *)context.r)->RemoteControl = vButtonExtension; - - // TODO - //if(((RemoteControl_t*)context.r)->RemoteControl == NULL && vButtonExtensionCounter > 0) - //((RemoteControl_t*)context.r)->RemoteControl = vButtonExtension; - //else if (vButtonExtensionCounter > 0) { - //int vRemoteControlSize = sizeof(((RemoteControl_t*)context.r)->RemoteControl) / sizeof(tButton); - //int vRemoteControlExtSize = vButtonExtensionCounter; - //((RemoteControl_t*)context.r)->RemoteControl = malloc((vRemoteControlSize + vRemoteControlExtSize - 1)*sizeof(tButton)); - //} - - //printf("RemoteControl Map:\n"); - //printKeyMap((tButton*)((RemoteControl_t*)context.r)->RemoteControl); - - printf("Supports Long KeyPress: %d\n", ((RemoteControl_t *)context.r)->supportsLongKeyPress); - - if (((RemoteControl_t *)context.r)->supportsLongKeyPress) - processComplex(&context, argc, argv); - else - processSimple(&context, argc, argv); - - return 0; -} diff --git a/evremote2/evtest.c b/evremote2/evtest.c deleted file mode 100644 index 0167a82..0000000 --- a/evremote2/evtest.c +++ /dev/null @@ -1,418 +0,0 @@ -/* - * $Id: evtest.c,v 1.23 2005/02/06 13:51:42 vojtech Exp $ - * - * Copyright (c) 1999-2000 Vojtech Pavlik - * - * Event device test program - */ - -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Should you need to contact me, the author, you can do so either by - * e-mail - mail your message to , or by paper mail: - * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic - */ - -#include - -#include - -#include -#include -#include -#include - -#ifndef EV_SYN -#define EV_SYN 0 -#endif - -char *events[EV_MAX + 1] = -{ - [0 ... EV_MAX] = NULL, - [EV_SYN] = "Sync", [EV_KEY] = "Key", - [EV_REL] = "Relative", [EV_ABS] = "Absolute", - [EV_MSC] = "Misc", [EV_LED] = "LED", - [EV_SND] = "Sound", [EV_REP] = "Repeat", - [EV_FF] = "ForceFeedback", [EV_PWR] = "Power", - [EV_FF_STATUS] = "ForceFeedbackStatus", -}; - -char *keys[KEY_MAX + 1] = -{ - [0 ... KEY_MAX] = NULL, - [KEY_RESERVED] = "Reserved", [KEY_ESC] = "Esc", - [KEY_1] = "1", [KEY_2] = "2", - [KEY_3] = "3", [KEY_4] = "4", - [KEY_5] = "5", [KEY_6] = "6", - [KEY_7] = "7", [KEY_8] = "8", - [KEY_9] = "9", [KEY_0] = "0", - [KEY_MINUS] = "Minus", [KEY_EQUAL] = "Equal", - [KEY_BACKSPACE] = "Backspace", [KEY_TAB] = "Tab", - [KEY_Q] = "Q", [KEY_W] = "W", - [KEY_E] = "E", [KEY_R] = "R", - [KEY_T] = "T", [KEY_Y] = "Y", - [KEY_U] = "U", [KEY_I] = "I", - [KEY_O] = "O", [KEY_P] = "P", - [KEY_LEFTBRACE] = "LeftBrace", [KEY_RIGHTBRACE] = "RightBrace", - [KEY_ENTER] = "Enter", [KEY_LEFTCTRL] = "LeftControl", - [KEY_A] = "A", [KEY_S] = "S", - [KEY_D] = "D", [KEY_F] = "F", - [KEY_G] = "G", [KEY_H] = "H", - [KEY_J] = "J", [KEY_K] = "K", - [KEY_L] = "L", [KEY_SEMICOLON] = "Semicolon", - [KEY_APOSTROPHE] = "Apostrophe", [KEY_GRAVE] = "Grave", - [KEY_LEFTSHIFT] = "LeftShift", [KEY_BACKSLASH] = "BackSlash", - [KEY_Z] = "Z", [KEY_X] = "X", - [KEY_C] = "C", [KEY_V] = "V", - [KEY_B] = "B", [KEY_N] = "N", - [KEY_M] = "M", [KEY_COMMA] = "Comma", - [KEY_DOT] = "Dot", [KEY_SLASH] = "Slash", - [KEY_RIGHTSHIFT] = "RightShift", [KEY_KPASTERISK] = "KPAsterisk", - [KEY_LEFTALT] = "LeftAlt", [KEY_SPACE] = "Space", - [KEY_CAPSLOCK] = "CapsLock", [KEY_F1] = "F1", - [KEY_F2] = "F2", [KEY_F3] = "F3", - [KEY_F4] = "F4", [KEY_F5] = "F5", - [KEY_F6] = "F6", [KEY_F7] = "F7", - [KEY_F8] = "F8", [KEY_F9] = "F9", - [KEY_F10] = "F10", [KEY_NUMLOCK] = "NumLock", - [KEY_SCROLLLOCK] = "ScrollLock", [KEY_KP7] = "KP7", - [KEY_KP8] = "KP8", [KEY_KP9] = "KP9", - [KEY_KPMINUS] = "KPMinus", [KEY_KP4] = "KP4", - [KEY_KP5] = "KP5", [KEY_KP6] = "KP6", - [KEY_KPPLUS] = "KPPlus", [KEY_KP1] = "KP1", - [KEY_KP2] = "KP2", [KEY_KP3] = "KP3", - [KEY_KP0] = "KP0", [KEY_KPDOT] = "KPDot", - [KEY_ZENKAKUHANKAKU] = "Zenkaku/Hankaku", [KEY_102ND] = "102nd", - [KEY_F11] = "F11", [KEY_F12] = "F12", - [KEY_RO] = "RO", [KEY_KATAKANA] = "Katakana", - [KEY_HIRAGANA] = "HIRAGANA", [KEY_HENKAN] = "Henkan", - [KEY_KATAKANAHIRAGANA] = "Katakana/Hiragana", [KEY_MUHENKAN] = "Muhenkan", - [KEY_KPJPCOMMA] = "KPJpComma", [KEY_KPENTER] = "KPEnter", - [KEY_RIGHTCTRL] = "RightCtrl", [KEY_KPSLASH] = "KPSlash", - [KEY_SYSRQ] = "SysRq", [KEY_RIGHTALT] = "RightAlt", - [KEY_LINEFEED] = "LineFeed", [KEY_HOME] = "Home", - [KEY_UP] = "Up", [KEY_PAGEUP] = "PageUp", - [KEY_LEFT] = "Left", [KEY_RIGHT] = "Right", - [KEY_END] = "End", [KEY_DOWN] = "Down", - [KEY_PAGEDOWN] = "PageDown", [KEY_INSERT] = "Insert", - [KEY_DELETE] = "Delete", [KEY_MACRO] = "Macro", - [KEY_MUTE] = "Mute", [KEY_VOLUMEDOWN] = "VolumeDown", - [KEY_VOLUMEUP] = "VolumeUp", [KEY_POWER] = "Power", - [KEY_KPEQUAL] = "KPEqual", [KEY_KPPLUSMINUS] = "KPPlusMinus", - [KEY_PAUSE] = "Pause", [KEY_KPCOMMA] = "KPComma", - [KEY_HANGUEL] = "Hanguel", [KEY_HANJA] = "Hanja", - [KEY_YEN] = "Yen", [KEY_LEFTMETA] = "LeftMeta", - [KEY_RIGHTMETA] = "RightMeta", [KEY_COMPOSE] = "Compose", - [KEY_STOP] = "Stop", [KEY_AGAIN] = "Again", - [KEY_PROPS] = "Props", [KEY_UNDO] = "Undo", - [KEY_FRONT] = "Front", [KEY_COPY] = "Copy", - [KEY_OPEN] = "Open", [KEY_PASTE] = "Paste", - [KEY_FIND] = "Find", [KEY_CUT] = "Cut", - [KEY_HELP] = "Help", [KEY_MENU] = "Menu", - [KEY_CALC] = "Calc", [KEY_SETUP] = "Setup", - [KEY_SLEEP] = "Sleep", [KEY_WAKEUP] = "WakeUp", - [KEY_FILE] = "File", [KEY_SENDFILE] = "SendFile", - [KEY_DELETEFILE] = "DeleteFile", [KEY_XFER] = "X-fer", - [KEY_PROG1] = "Prog1", [KEY_PROG2] = "Prog2", - [KEY_WWW] = "WWW", [KEY_MSDOS] = "MSDOS", - [KEY_COFFEE] = "Coffee", [KEY_DIRECTION] = "Direction", - [KEY_CYCLEWINDOWS] = "CycleWindows", [KEY_MAIL] = "Mail", - [KEY_BOOKMARKS] = "Bookmarks", [KEY_COMPUTER] = "Computer", - [KEY_BACK] = "Back", [KEY_FORWARD] = "Forward", - [KEY_CLOSECD] = "CloseCD", [KEY_EJECTCD] = "EjectCD", - [KEY_EJECTCLOSECD] = "EjectCloseCD", [KEY_NEXTSONG] = "NextSong", - [KEY_PLAYPAUSE] = "PlayPause", [KEY_PREVIOUSSONG] = "PreviousSong", - [KEY_STOPCD] = "StopCD", [KEY_RECORD] = "Record", - [KEY_REWIND] = "Rewind", [KEY_PHONE] = "Phone", - [KEY_ISO] = "ISOKey", [KEY_CONFIG] = "Config", - [KEY_HOMEPAGE] = "HomePage", [KEY_REFRESH] = "Refresh", - [KEY_EXIT] = "Exit", [KEY_MOVE] = "Move", - [KEY_EDIT] = "Edit", [KEY_SCROLLUP] = "ScrollUp", - [KEY_SCROLLDOWN] = "ScrollDown", [KEY_KPLEFTPAREN] = "KPLeftParenthesis", - [KEY_KPRIGHTPAREN] = "KPRightParenthesis", [KEY_F13] = "F13", - [KEY_F14] = "F14", [KEY_F15] = "F15", - [KEY_F16] = "F16", [KEY_F17] = "F17", - [KEY_F18] = "F18", [KEY_F19] = "F19", - [KEY_F20] = "F20", [KEY_F21] = "F21", - [KEY_F22] = "F22", [KEY_F23] = "F23", - [KEY_F24] = "F24", [KEY_PLAYCD] = "PlayCD", - [KEY_PAUSECD] = "PauseCD", [KEY_PROG3] = "Prog3", - [KEY_PROG4] = "Prog4", [KEY_SUSPEND] = "Suspend", - [KEY_CLOSE] = "Close", [KEY_PLAY] = "Play", - [KEY_FASTFORWARD] = "Fast Forward", [KEY_BASSBOOST] = "Bass Boost", - [KEY_PRINT] = "Print", [KEY_HP] = "HP", - [KEY_CAMERA] = "Camera", [KEY_SOUND] = "Sound", - [KEY_QUESTION] = "Question", [KEY_EMAIL] = "Email", - [KEY_CHAT] = "Chat", [KEY_SEARCH] = "Search", - [KEY_CONNECT] = "Connect", [KEY_FINANCE] = "Finance", - [KEY_SPORT] = "Sport", [KEY_SHOP] = "Shop", - [KEY_ALTERASE] = "Alternate Erase", [KEY_CANCEL] = "Cancel", - [KEY_BRIGHTNESSDOWN] = "Brightness down", [KEY_BRIGHTNESSUP] = "Brightness up", - [KEY_MEDIA] = "Media", [KEY_UNKNOWN] = "Unknown", - [BTN_0] = "Btn0", [BTN_1] = "Btn1", - [BTN_2] = "Btn2", [BTN_3] = "Btn3", - [BTN_4] = "Btn4", [BTN_5] = "Btn5", - [BTN_6] = "Btn6", [BTN_7] = "Btn7", - [BTN_8] = "Btn8", [BTN_9] = "Btn9", - [BTN_LEFT] = "LeftBtn", [BTN_RIGHT] = "RightBtn", - [BTN_MIDDLE] = "MiddleBtn", [BTN_SIDE] = "SideBtn", - [BTN_EXTRA] = "ExtraBtn", [BTN_FORWARD] = "ForwardBtn", - [BTN_BACK] = "BackBtn", [BTN_TASK] = "TaskBtn", - [BTN_TRIGGER] = "Trigger", [BTN_THUMB] = "ThumbBtn", - [BTN_THUMB2] = "ThumbBtn2", [BTN_TOP] = "TopBtn", - [BTN_TOP2] = "TopBtn2", [BTN_PINKIE] = "PinkieBtn", - [BTN_BASE] = "BaseBtn", [BTN_BASE2] = "BaseBtn2", - [BTN_BASE3] = "BaseBtn3", [BTN_BASE4] = "BaseBtn4", - [BTN_BASE5] = "BaseBtn5", [BTN_BASE6] = "BaseBtn6", - [BTN_DEAD] = "BtnDead", [BTN_A] = "BtnA", - [BTN_B] = "BtnB", [BTN_C] = "BtnC", - [BTN_X] = "BtnX", [BTN_Y] = "BtnY", - [BTN_Z] = "BtnZ", [BTN_TL] = "BtnTL", - [BTN_TR] = "BtnTR", [BTN_TL2] = "BtnTL2", - [BTN_TR2] = "BtnTR2", [BTN_SELECT] = "BtnSelect", - [BTN_START] = "BtnStart", [BTN_MODE] = "BtnMode", - [BTN_THUMBL] = "BtnThumbL", [BTN_THUMBR] = "BtnThumbR", - [BTN_TOOL_PEN] = "ToolPen", [BTN_TOOL_RUBBER] = "ToolRubber", - [BTN_TOOL_BRUSH] = "ToolBrush", [BTN_TOOL_PENCIL] = "ToolPencil", - [BTN_TOOL_AIRBRUSH] = "ToolAirbrush", [BTN_TOOL_FINGER] = "ToolFinger", - [BTN_TOOL_MOUSE] = "ToolMouse", [BTN_TOOL_LENS] = "ToolLens", - [BTN_TOUCH] = "Touch", [BTN_STYLUS] = "Stylus", - [BTN_STYLUS2] = "Stylus2", [BTN_TOOL_DOUBLETAP] = "Tool Doubletap", - [BTN_TOOL_TRIPLETAP] = "Tool Tripletap", [BTN_GEAR_DOWN] = "WheelBtn", - [BTN_GEAR_UP] = "Gear up", [KEY_OK] = "Ok", - [KEY_SELECT] = "Select", [KEY_GOTO] = "Goto", - [KEY_CLEAR] = "Clear", [KEY_POWER2] = "Power2", - [KEY_OPTION] = "Option", [KEY_INFO] = "Info", - [KEY_TIME] = "Time", [KEY_VENDOR] = "Vendor", - [KEY_ARCHIVE] = "Archive", [KEY_PROGRAM] = "Program", - [KEY_CHANNEL] = "Channel", [KEY_FAVORITES] = "Favorites", - [KEY_EPG] = "EPG", [KEY_PVR] = "PVR", - [KEY_MHP] = "MHP", [KEY_LANGUAGE] = "Language", - [KEY_TITLE] = "Title", [KEY_SUBTITLE] = "Subtitle", - [KEY_ANGLE] = "Angle", [KEY_ZOOM] = "Zoom", - [KEY_MODE] = "Mode", [KEY_KEYBOARD] = "Keyboard", - [KEY_SCREEN] = "Screen", [KEY_PC] = "PC", - [KEY_TV] = "TV", [KEY_TV2] = "TV2", - [KEY_VCR] = "VCR", [KEY_VCR2] = "VCR2", - [KEY_SAT] = "Sat", [KEY_SAT2] = "Sat2", - [KEY_CD] = "CD", [KEY_TAPE] = "Tape", - [KEY_RADIO] = "Radio", [KEY_TUNER] = "Tuner", - [KEY_PLAYER] = "Player", [KEY_TEXT] = "Text", - [KEY_DVD] = "DVD", [KEY_AUX] = "Aux", - [KEY_MP3] = "MP3", [KEY_AUDIO] = "Audio", - [KEY_VIDEO] = "Video", [KEY_DIRECTORY] = "Directory", - [KEY_LIST] = "List", [KEY_MEMO] = "Memo", - [KEY_CALENDAR] = "Calendar", [KEY_RED] = "Red", - [KEY_GREEN] = "Green", [KEY_YELLOW] = "Yellow", - [KEY_BLUE] = "Blue", [KEY_CHANNELUP] = "ChannelUp", - [KEY_CHANNELDOWN] = "ChannelDown", [KEY_FIRST] = "First", - [KEY_LAST] = "Last", [KEY_AB] = "AB", - [KEY_NEXT] = "Next", [KEY_RESTART] = "Restart", - [KEY_SLOW] = "Slow", [KEY_SHUFFLE] = "Shuffle", - [KEY_BREAK] = "Break", [KEY_PREVIOUS] = "Previous", - [KEY_DIGITS] = "Digits", [KEY_TEEN] = "TEEN", - [KEY_TWEN] = "TWEN", [KEY_DEL_EOL] = "Delete EOL", - [KEY_DEL_EOS] = "Delete EOS", [KEY_INS_LINE] = "Insert line", - [KEY_DEL_LINE] = "Delete line", -}; - -char *absval[5] = { "Value", "Min ", "Max ", "Fuzz ", "Flat " }; - -char *relatives[REL_MAX + 1] = -{ - [0 ... REL_MAX] = NULL, - [REL_X] = "X", [REL_Y] = "Y", - [REL_Z] = "Z", [REL_HWHEEL] = "HWheel", - [REL_DIAL] = "Dial", [REL_WHEEL] = "Wheel", - [REL_MISC] = "Misc", -}; - -char *absolutes[ABS_MAX + 1] = -{ - [0 ... ABS_MAX] = NULL, - [ABS_X] = "X", [ABS_Y] = "Y", - [ABS_Z] = "Z", [ABS_RX] = "Rx", - [ABS_RY] = "Ry", [ABS_RZ] = "Rz", - [ABS_THROTTLE] = "Throttle", [ABS_RUDDER] = "Rudder", - [ABS_WHEEL] = "Wheel", [ABS_GAS] = "Gas", - [ABS_BRAKE] = "Brake", [ABS_HAT0X] = "Hat0X", - [ABS_HAT0Y] = "Hat0Y", [ABS_HAT1X] = "Hat1X", - [ABS_HAT1Y] = "Hat1Y", [ABS_HAT2X] = "Hat2X", - [ABS_HAT2Y] = "Hat2Y", [ABS_HAT3X] = "Hat3X", - [ABS_HAT3Y] = "Hat 3Y", [ABS_PRESSURE] = "Pressure", - [ABS_DISTANCE] = "Distance", [ABS_TILT_X] = "XTilt", - [ABS_TILT_Y] = "YTilt", [ABS_TOOL_WIDTH] = "Tool Width", - [ABS_VOLUME] = "Volume", [ABS_MISC] = "Misc", -}; - -char *misc[MSC_MAX + 1] = -{ - [ 0 ... MSC_MAX] = NULL, - [MSC_SERIAL] = "Serial", [MSC_PULSELED] = "Pulseled", - [MSC_GESTURE] = "Gesture", [MSC_RAW] = "RawData", - [MSC_SCAN] = "ScanCode", -}; - -char *leds[LED_MAX + 1] = -{ - [0 ... LED_MAX] = NULL, - [LED_NUML] = "NumLock", [LED_CAPSL] = "CapsLock", - [LED_SCROLLL] = "ScrollLock", [LED_COMPOSE] = "Compose", - [LED_KANA] = "Kana", [LED_SLEEP] = "Sleep", - [LED_SUSPEND] = "Suspend", [LED_MUTE] = "Mute", - [LED_MISC] = "Misc", -}; - -char *repeats[REP_MAX + 1] = -{ - [0 ... REP_MAX] = NULL, - [REP_DELAY] = "Delay", [REP_PERIOD] = "Period" -}; - -char *sounds[SND_MAX + 1] = -{ - [0 ... SND_MAX] = NULL, - [SND_CLICK] = "Click", [SND_BELL] = "Bell", - [SND_TONE] = "Tone" -}; - -char **names[EV_MAX + 1] = -{ - [0 ... EV_MAX] = NULL, - [EV_SYN] = events, [EV_KEY] = keys, - [EV_REL] = relatives, [EV_ABS] = absolutes, - [EV_MSC] = misc, [EV_LED] = leds, - [EV_SND] = sounds, [EV_REP] = repeats, -}; - -#define BITS_PER_LONG (sizeof(long) * 8) -#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1) -#define OFF(x) ((x)%BITS_PER_LONG) -#define BIT(x) (1UL<> OFF(bit)) & 1) - -int main(int argc, char **argv) -{ - int fd, rd, i, j, k; - struct input_event ev[64]; - int version; - unsigned short id[4]; - unsigned long bit[EV_MAX][NBITS(KEY_MAX)]; - char name[256] = "Unknown"; - int abs[5]; - - if (argc < 2) - { - printf("Usage: evtest /dev/input/eventX\n"); - printf("Where X = input device number\n"); - return 1; - } - - if ((fd = open(argv[argc - 1], O_RDONLY)) < 0) - { - perror("evtest"); - return 1; - } - - if (ioctl(fd, EVIOCGVERSION, &version)) - { - perror("evtest: can't get version"); - return 1; - } - - printf("Input driver version is %d.%d.%d\n", - version >> 16, (version >> 8) & 0xff, version & 0xff); - - ioctl(fd, EVIOCGID, id); - printf("Input device ID: bus 0x%x vendor 0x%x product 0x%x version 0x%x\n", - id[ID_BUS], id[ID_VENDOR], id[ID_PRODUCT], id[ID_VERSION]); - - ioctl(fd, EVIOCGNAME(sizeof(name)), name); - printf("Input device name: \"%s\"\n", name); - - memset(bit, 0, sizeof(bit)); - ioctl(fd, EVIOCGBIT(0, EV_MAX), bit[0]); - printf("Supported events:\n"); - - for (i = 0; i < EV_MAX; i++) - if (test_bit(i, bit[0])) - { - printf(" Event type %d (%s)\n", i, events[i] ? events[i] : "?"); - - if (!i) continue; - - ioctl(fd, EVIOCGBIT(i, KEY_MAX), bit[i]); - - for (j = 0; j < KEY_MAX; j++) - if (test_bit(j, bit[i])) - { - printf(" Event code %d (%s)\n", j, names[i] ? (names[i][j] ? names[i][j] : "?") : "?"); - - if (i == EV_ABS) - { - ioctl(fd, EVIOCGABS(j), abs); - - for (k = 0; k < 5; k++) - if ((k < 3) || abs[k]) - printf(" %s %6d\n", absval[k], abs[k]); - } - } - } - - - printf("Testing ... (interrupt to exit)\n"); - - while (1) - { - rd = read(fd, ev, sizeof(struct input_event) * 64); - - if (rd < (int) sizeof(struct input_event)) - { - printf("yyy\n"); - perror("\nevtest: error reading"); - return 1; - } - - for (i = 0; i < rd / sizeof(struct input_event); i++) - - if (ev[i].type == EV_SYN) - { - printf("Event: time %ld.%06ld, -------------- %s ------------\n", - ev[i].time.tv_sec, ev[i].time.tv_usec, ev[i].code ? "Config Sync" : "Report Sync"); - } - else if (ev[i].type == EV_MSC && (ev[i].code == MSC_RAW || ev[i].code == MSC_SCAN)) - { - printf("Event: time %ld.%06ld, type %d (%s), code %d (%s), value %02x\n", - ev[i].time.tv_sec, ev[i].time.tv_usec, ev[i].type, - events[ev[i].type] ? events[ev[i].type] : "?", - ev[i].code, - names[ev[i].type] ? (names[ev[i].type][ev[i].code] ? names[ev[i].type][ev[i].code] : "?") : "?", - ev[i].value); - } - else - { - printf("Event: time %ld.%06ld, type %d (%s), code %d (%s), value %d\n", - ev[i].time.tv_sec, ev[i].time.tv_usec, ev[i].type, - events[ev[i].type] ? events[ev[i].type] : "?", - ev[i].code, - names[ev[i].type] ? (names[ev[i].type][ev[i].code] ? names[ev[i].type][ev[i].code] : "?") : "?", - ev[i].value); - } - - } -} - diff --git a/evremote2/examples/ufs912_hbbtv.rc b/evremote2/examples/ufs912_hbbtv.rc deleted file mode 100644 index 6bc01fb..0000000 --- a/evremote2/examples/ufs912_hbbtv.rc +++ /dev/null @@ -1,21 +0,0 @@ -KEY_ENTER 5C 28 -KEY_UP 58 103 -KEY_RIGHT 5B 106 -KEY_DOWN 59 108 -KEY_LEFT 5A 105 -KEY_F5 6D 63 -KEY_F6 6E 64 -KEY_F7 6F 65 -KEY_F8 70 66 -KEY_0 00 11 -KEY_1 01 02 -KEY_2 02 03 -KEY_3 03 04 -KEY_4 04 05 -KEY_5 05 06 -KEY_6 06 07 -KEY_7 07 08 -KEY_8 08 09 -KEY_9 09 10 -KEY_TAB 1F 15 - diff --git a/evremote2/examples/ufs912_maelstorm.rc b/evremote2/examples/ufs912_maelstorm.rc deleted file mode 100644 index 11b5480..0000000 --- a/evremote2/examples/ufs912_maelstorm.rc +++ /dev/null @@ -1,23 +0,0 @@ -KEY_P 5C 25 -KEY_C 54 46 -KEY_Q 55 16 -KEY_A 0F 30 -KEY_UP 58 103 -KEY_RIGHT 5B 106 -KEY_DOWN 59 108 -KEY_LEFT 5A 105 -KEY_F1 6D 59 -KEY_F2 6E 60 -KEY_F3 6F 61 -KEY_F4 70 62 -KEY_0 00 11 -KEY_1 01 02 -KEY_2 02 03 -KEY_3 03 04 -KEY_4 04 05 -KEY_5 05 06 -KEY_6 06 07 -KEY_7 07 08 -KEY_8 08 09 -KEY_9 09 10 -KEY_TAB 1F 15 diff --git a/evremote2/global.c b/evremote2/global.c deleted file mode 100644 index be907e6..0000000 --- a/evremote2/global.c +++ /dev/null @@ -1,251 +0,0 @@ -/* - * global.c - * - * (c) 2009 donald@teamducktales - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "global.h" - -#include "map.h" - -#define DEVICENAME "TDT RC event driver" -char eventPath[] = "/dev/input/event0"; - -//Checks with event device is created by simubutton.ko -int getEventDevice() -{ - int vFd = -1; - int vIterator = 0; - bool vDeviceFound = false; - char vName[256] = "Unknown"; - - while (vIterator < 10 && vDeviceFound == false) - { - eventPath[16] = vIterator + 48; - vIterator++; - vFd = open(eventPath, O_RDONLY); - - if (vFd <= 0) - continue; - - ioctl(vFd, EVIOCGNAME(sizeof(vName)), vName); - printf("Input device name: \"%s\"\n", vName); - - if (!strcmp(DEVICENAME, vName)) - vDeviceFound = true; - - close(vFd); - } - - return vDeviceFound; -} - -// Translates internal remote control hex value to known linux input key value -int getInternalCode(tButton *cButtons, const char cCode[3]) -{ - int vLoop = 0; - - for (vLoop = 0; cButtons[vLoop].KeyCode != KEY_NULL; vLoop++) - { - //printf("%20s - %2s - %3d\n", cButtons[vLoop].KeyName, cButtons[vLoop].KeyWord, cButtons[vLoop].KeyCode); - if ((cButtons[vLoop].KeyWord[0] == cCode[0] || cButtons[vLoop].KeyWord[0] == (cCode[0] - 32)) && - (cButtons[vLoop].KeyWord[1] == cCode[1] || cButtons[vLoop].KeyWord[1] == (cCode[1] - 32))) - { - - printf("KEY by code: %02X - %s\n", cButtons[vLoop].KeyCode, cButtons[vLoop].KeyName); - return cButtons[vLoop].KeyCode; - } - } - - return 0; -} - -// Translates lirc key name to known linux input key value -int getInternalCodeLircKeyName(tButton *cButtons, const char cCode[30]) -{ - int vLoop = 0; - - for (vLoop = 0; cButtons[vLoop].KeyCode != KEY_NULL; vLoop++) - { - //printf("%20s - %2s - %3d\n", cButtons[vLoop].KeyName, cButtons[vLoop].KeyWord, cButtons[vLoop].KeyCode); - if (strcmp(cCode, cButtons[vLoop].KeyName) == 0) - { - printf("KEY by name: %02X - %s\n", cButtons[vLoop].KeyCode, cButtons[vLoop].KeyName); - return cButtons[vLoop].KeyCode; - } - } - return 0; -} - -int printKeyMap(tButton *cButtons) -{ - int vLoop = 0; - - for (vLoop = 0; cButtons[vLoop].KeyCode != KEY_NULL; vLoop++) - { - printf("%20s - %2s - %3d\n", cButtons[vLoop].KeyName, cButtons[vLoop].KeyWord, cButtons[vLoop].KeyCode); - } - return 0; -} - -// Translates internal remote control hex value to known linux input key value -int getInternalCodeHex(tButton *cButtons, const unsigned char cCode) -{ - char vCode[3]; - - sprintf(vCode, "%.2hhx", cCode); - vCode[2] = '\0'; - - return getInternalCode(cButtons, vCode); -} - -static int tuxtxt_exit_count = 0; -static int sSockethandle = -1; -#define SocketName "/tmp/rc.socket" - -int checkTuxTxt(const int cCode) -{ - int vTmpO; - - if ((vTmpO = open("/tmp/block.tmp", O_RDONLY)) >= 0) - { - close(vTmpO); - - //workaround if tuxtxt hangs - if (cCode == KEY_HOME) //EXIT - { - tuxtxt_exit_count++; - - if (tuxtxt_exit_count > 1) - { - tuxtxt_exit_count = 0; - system("killall tuxtxt; sleep 3; killall -9 tuxtxt; rm -f /tmp/block.tmp"); - } - } - - fprintf(stderr, "Forwarding to Socket-> %u\n", sSockethandle); - - if (sSockethandle <= 0) - { - struct sockaddr_un vAddr; - vAddr.sun_family = AF_UNIX; - strcpy(vAddr.sun_path, SocketName); - sSockethandle = socket(PF_UNIX, SOCK_STREAM, 0); - - if (sSockethandle <= 0) - { - fprintf(stderr, "No RemoteControlSocket attached!\n"); - return 0; - }; - - if (connect(sSockethandle, (struct sockaddr *)&vAddr, sizeof(vAddr)) != 0) - { - close(sSockethandle); - sSockethandle = -1; - fprintf(stderr, "connect failed!\n"); - return 0; - } - } - - if (sSockethandle > 0) - { - char *vTmpS = (char *) malloc(sizeof("00000000")); - sprintf(vTmpS, "%08d", cCode); - - if (write(sSockethandle, (void *) vTmpS, sizeof("00000000")) <= 0) - fprintf(stderr, "Error while forwarding!\n"); - free(vTmpS); - } - else - fprintf(stderr, "Error while forwarding!\n"); - - return 1; - } - - tuxtxt_exit_count = 0; - - if (sSockethandle != -1) - { - close(sSockethandle); - sSockethandle = -1; - } - - return 0; -} - -void sendInputEvent(const int cCode) -{ - sendInputEventT(INPUT_PRESS, cCode); - sendInputEventT(INPUT_RELEASE, cCode); -} - -void sendInputEventT(const unsigned int type, const int cCode) -{ - int vFd = -1; - struct input_event vInev; - int cSize = sizeof(struct input_event); - - gettimeofday(&vInev.time, NULL); - vInev.type = 1; - vInev.code = cCode; - - vFd = open(eventPath, O_WRONLY); - - vInev.value = type; - write(vFd, &vInev, cSize); - - close(vFd); -} - -void setInputEventRepeatRate(unsigned int delay, unsigned int period) -{ - int vFd = -1; - struct input_event vInev; - - vFd = open(eventPath, O_WRONLY); - - vInev.type = EV_REP; - vInev.code = REP_DELAY; - vInev.value = delay; - - if (write(vFd, &vInev, sizeof(vInev)) == -1) - perror("REP_DELAY"); - - vInev.code = REP_PERIOD; - vInev.value = period; - - if (write(vFd, &vInev, sizeof(vInev)) == -1) - perror("REP_PERIOD"); - - close(vFd); -} diff --git a/evremote2/global.h b/evremote2/global.h deleted file mode 100755 index 2a3dda2..0000000 --- a/evremote2/global.h +++ /dev/null @@ -1,55 +0,0 @@ - -#ifndef GLOBAL_H_ -#define GLOBAL_H_ - -#ifndef bool -#define bool unsigned char -#define true 1 -#define false 0 -#endif - -#include "map.h" - -#define INPUT_PRESS 1 -#define INPUT_RELEASE 0 - -typedef enum {Unknown, Ufs910_1W, Ufs910_14W, Ufs922, Tf7700, Fortis, - Ufs912, Spark, Cuberevo, Ipbox, LircdName - } eBoxType; -typedef enum {RemoteControl, FrontPanel} eKeyType; - -typedef struct Context_s -{ - void * /* RemoteControl_t */ *r; /* instance data */ - int fd; /* filedescriptor of fd */ - -} Context_t; - -typedef struct -{ - unsigned int delay; - unsigned int period; - unsigned int rc_code; - -} tLongKeyPressSupport; - -int getInternalCode(tButton *cButtons, const char cCode[3]); - -int getInternalCodeHex(tButton *cButtons, const unsigned char cCode); - -int getInternalCodeLircKeyName(tButton *cButtons, const char cCode[30]); - -int printKeyMap(tButton *cButtons); - -int checkTuxTxt(const int cCode); - -void sendInputEvent(const int cCode); -void sendInputEventT(const unsigned int type, const int cCode); - -int getEventDevice(); - -int selectRemote(Context_t *context, eBoxType type); - -void setInputEventRepeatRate(unsigned int delay, unsigned int period); - -#endif diff --git a/evremote2/input_extended.h b/evremote2/input_extended.h deleted file mode 100644 index 39f7e2e..0000000 --- a/evremote2/input_extended.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef _INPUT_EXTENDED_H -#define _INPUT_EXTENDED_H - -#include - -#define KEY_NULL 0x000 - -#if !defined(KEY_OK) - -/** - * define some additional remote control keys in case they - * were not already defined above in - */ - -#define KEY_OK 0x160 -#define KEY_SELECT 0x161 -#define KEY_GOTO 0x162 -#define KEY_CLEAR 0x163 -#define KEY_POWER2 0x164 -#define KEY_OPTION 0x165 -#define KEY_INFO 0x166 -#define KEY_TIME 0x167 -#define KEY_VENDOR 0x168 -#define KEY_ARCHIVE 0x169 -#define KEY_PROGRAM 0x16a -#define KEY_CHANNEL 0x16b -#define KEY_FAVORITES 0x16c -#define KEY_EPG 0x16d -#define KEY_PVR 0x16e -#define KEY_MHP 0x16f -#define KEY_LANGUAGE 0x170 -#define KEY_TITLE 0x171 -#define KEY_SUBTITLE 0x172 -#define KEY_ANGLE 0x173 -#define KEY_ZOOM 0x174 -#define KEY_MODE 0x175 -#define KEY_KEYBOARD 0x176 -#define KEY_SCREEN 0x177 -#define KEY_PC 0x178 -#define KEY_TV 0x179 -#define KEY_TV2 0x17a -#define KEY_VCR 0x17b -#define KEY_VCR2 0x17c -#define KEY_SAT 0x17d -#define KEY_SAT2 0x17e -#define KEY_CD 0x17f -#define KEY_TAPE 0x180 -#define KEY_RADIO 0x181 -#define KEY_TUNER 0x182 -#define KEY_PLAYER 0x183 -#define KEY_TEXT 0x184 -#define KEY_DVD 0x185 -#define KEY_AUX 0x186 -#define KEY_MP3 0x187 -#define KEY_AUDIO 0x188 -#define KEY_VIDEO 0x189 -#define KEY_DIRECTORY 0x18a -#define KEY_LIST 0x18b -#define KEY_MEMO 0x18c -#define KEY_CALENDAR 0x18d -#define KEY_RED 0x18e -#define KEY_GREEN 0x18f -#define KEY_YELLOW 0x190 -#define KEY_BLUE 0x191 -#define KEY_CHANNELUP 0x192 -#define KEY_CHANNELDOWN 0x193 -#define KEY_FIRST 0x194 -#define KEY_LAST 0x195 -#define KEY_AB 0x196 -#define KEY_PLAY 0x197 -#define KEY_RESTART 0x198 -#define KEY_SLOW 0x199 -#define KEY_SHUFFLE 0x19a -#define KEY_FASTFORWARD 0x19b -#define KEY_PREVIOUS 0x19c -#define KEY_NEXT 0x19d -#define KEY_DIGITS 0x19e -#define KEY_TEEN 0x19f -#define KEY_TWEN 0x1a0 -#define KEY_BREAK 0x1a1 - -#endif /* !defined(KEY_OK) */ -/* discrete ON/OFF codes being in use by Neutrino */ -#define KEY_POWERON KEY_FN_F1 -#define KEY_POWEROFF KEY_FN_F2 -#define KEY_STANDBYON KEY_FN_F3 -#define KEY_STANDBYOFF KEY_FN_F4 -#endif /* _INPUT_EXTENDED_H */ - - diff --git a/evremote2/map.h b/evremote2/map.h deleted file mode 100644 index 14e5f54..0000000 --- a/evremote2/map.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _MAP_H -#define _MAP_H - -#include "input_extended.h" - -typedef struct -{ - char KeyName[20]; - char KeyWord[2]; - int KeyCode; -} tButton; - - - -#endif //_MAP_H diff --git a/evremote2/remotes.c b/evremote2/remotes.c deleted file mode 100644 index aeb7c6a..0000000 --- a/evremote2/remotes.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * evremote.c - * - * (c) 2009 donald@teamducktales - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include "remotes.h" - -static RemoteControl_t *AvailableRemoteControls[] = -{ - &Ufs910_1W_RC, - &Ufs910_14W_RC, - &Tf7700_RC, - &UFS922_RC, - &Fortis_RC, - &UFS912_RC, - &Spark_RC, - &Cuberevo_RC, - &Ipbox_RC, - &LircdName_RC, - NULL -}; - -int selectRemote(Context_t *context, eBoxType type) -{ - int i; - - for (i = 0; AvailableRemoteControls[i] != 0ull; i++) - - if (AvailableRemoteControls[i]->Type == type) - { - context->r = AvailableRemoteControls[i]; - return 0; - } - - return -1; -} diff --git a/evremote2/remotes.h b/evremote2/remotes.h deleted file mode 100755 index 752978a..0000000 --- a/evremote2/remotes.h +++ /dev/null @@ -1,42 +0,0 @@ - -#ifndef REMOTES_H_ -#define REMOTES_H_ - -#include -#include -#include "global.h" - -#define getRCvalue(context, field) \ - (((RemoteControl_t*) context->r)->field) - -typedef struct RemoteControl_s -{ - char *Name; - eBoxType Type; - int (* Init)(Context_t *context, int argc, char *argv[]); - int (* Shutdown)(Context_t *context); - int (* Read)(Context_t *context); // 00 NN 00 KK - int (* Notification)(Context_t *context, const int on); - - void/*tButton*/ * RemoteControl; - void/*tButton*/ * Frontpanel; - - void *private; - unsigned char supportsLongKeyPress; - tLongKeyPressSupport *LongKeyPressSupport; -} RemoteControl_t; - -extern RemoteControl_t Ufs910_1W_RC; -extern RemoteControl_t Ufs910_14W_RC; -extern RemoteControl_t Tf7700_RC; -extern RemoteControl_t UFS922_RC; -extern RemoteControl_t Fortis_RC; -extern RemoteControl_t UFS912_RC; -extern RemoteControl_t Spark_RC; -extern RemoteControl_t Cuberevo_RC; -extern RemoteControl_t Ipbox_RC; -extern RemoteControl_t LircdName_RC; - -int selectRemote(Context_t *context, eBoxType type); - -#endif diff --git a/flashtool-fup/Makefile.am b/flashtool-fup/Makefile.am deleted file mode 100644 index acddf28..0000000 --- a/flashtool-fup/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -bin_PROGRAMS = fup - -fup_SOURCES = fup.c crc16.c crc32.cpp -fup_LDADD = -lz - -AM_CFLAGS = -std=c99 -DUSE_ZLIB diff --git a/flashtool-fup/autogen.sh b/flashtool-fup/autogen.sh deleted file mode 100755 index 127a39a..0000000 --- a/flashtool-fup/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-flashtool-fup" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/flashtool-fup/configure.ac b/flashtool-fup/configure.ac deleted file mode 100644 index 8a0539e..0000000 --- a/flashtool-fup/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT([fup],[1.0],[],[fup]) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_OUTPUT([ -Makefile -]) diff --git a/flashtool-fup/crc16.c b/flashtool-fup/crc16.c deleted file mode 100644 index 7711217..0000000 --- a/flashtool-fup/crc16.c +++ /dev/null @@ -1,69 +0,0 @@ - -#include - -#include "crc16.h" - -/* - * CRC table for the CRC-16. The poly is 0x8005 (x^16 + x^15 + x^2 + 1) - */ -static const uint16_t crc16_table[256] = -{ - 0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241, - 0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440, - 0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40, - 0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841, - 0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40, - 0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41, - 0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641, - 0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040, - 0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240, - 0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441, - 0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41, - 0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840, - 0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41, - 0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40, - 0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640, - 0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041, - 0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240, - 0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441, - 0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41, - 0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840, - 0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41, - 0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40, - 0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640, - 0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041, - 0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241, - 0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440, - 0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40, - 0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841, - 0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40, - 0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41, - 0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641, - 0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040 -}; - -/* - * crc16_byte - compute the CRC-16 for a byte - * @crc: previous CRC value - * @data: byte value - */ -static inline uint16_t crc16_byte(uint16_t crc, const uint8_t data) -{ - return (crc >> 8) ^ crc16_table[(crc ^ data) & 0xff]; -} - -/* - * crc16 - compute the CRC-16 for the data buffer - * @crc: previous CRC value - * @buffer: data pointer - * @len: number of bytes in the buffer - * - * Returns the updated CRC value. - */ -uint16_t crc16(uint16_t crc, const uint8_t *buffer, uint32_t len) -{ - while (len--) - crc = crc16_byte(crc, *buffer++); - return crc; -} - diff --git a/flashtool-fup/crc16.h b/flashtool-fup/crc16.h deleted file mode 100644 index cf61c07..0000000 --- a/flashtool-fup/crc16.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef __CRC16_H__ -#define __CRC16_H__ - -#include - -uint16_t crc16(uint16_t crc, const uint8_t *buffer, uint32_t len); - -#endif /* __CRC16_H__ */ diff --git a/flashtool-fup/crc32.cpp b/flashtool-fup/crc32.cpp deleted file mode 100644 index 032323b..0000000 --- a/flashtool-fup/crc32.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * This file is derived from crc32.c from the zlib-1.1.3 distribution - * by Jean-loup Gailly and Mark Adler. - */ - -/* crc32.c -- compute the CRC-32 of a data stream - * Copyright (C) 1995-1998 Mark Adler - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -#include - -/* ======================================================================== - * Table of CRC-32's of all single-byte values (made by make_crc_table) - */ -const uint32_t crc_table[256] = -{ - 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, - 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, - 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, - 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, - 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, - 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, - 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, - 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, - 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, - 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, - 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, - 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, - 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, - 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, - 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, - 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, - 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, - 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, - 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, - 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, - 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, - 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, - 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, - 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, - 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, - 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, - 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, - 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, - 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, - 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, - 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, - 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, - 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, - 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, - 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, - 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, - 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, - 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, - 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, - 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, - 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, - 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, - 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, - 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, - 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, - 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, - 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, - 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, - 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, - 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, - 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, - 0x2d02ef8dL -}; - -#define _CRC32_(crc, ch) (crc = (crc >> 8) ^ crc_table[(crc ^ (ch)) & 0xff]) - -uint32_t crc32(uint32_t crc, uint8_t *buf, uint32_t size) -{ - uint8_t *p; - uint32_t len, nr; - crc = crc ^ 0xffffffffL; - len = 0; - nr = size; - for (len += nr, p = buf; nr--; ++p) - { - _CRC32_(crc, *p); - } - return crc ^ 0xffffffffL; -} diff --git a/flashtool-fup/crc32.h b/flashtool-fup/crc32.h deleted file mode 100644 index c05bd5b..0000000 --- a/flashtool-fup/crc32.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CRC32_H_ -#define CRC32_H_ - -#include - -uint32_t crc32(uint32_t crc, uint8_t *buf, uint32_t size); - -#endif /* CRC32_H_ */ diff --git a/flashtool-fup/dummy.h b/flashtool-fup/dummy.h deleted file mode 100644 index 09de4b3..0000000 --- a/flashtool-fup/dummy.h +++ /dev/null @@ -1,8750 +0,0 @@ -#ifndef __DUMMY_H__ -#define __DUMMY_H__ - -#include - -uint32_t dummy_size = 0x20000; -uint8_t dummy[] = -{ - 0x68, 0x73, 0x71, 0x73, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x11, 0x00, 0xc0, 0x01, 0x00, 0xf9, 0xaf, 0x3a, 0x4d, 0x20, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, - 0x75, 0x6d, 0x6d, 0x79, 0x0a, 0x24, 0x00, 0x78, 0xda, 0x73, 0x92, 0x62, 0xf8, 0xff, 0x68, - 0xbd, 0x95, 0x2f, 0x13, 0x03, 0x26, 0x60, 0x03, 0xe2, 0x8b, 0x72, 0x10, 0x79, 0x46, 0x20, - 0x1b, 0xa4, 0x46, 0x0c, 0x2a, 0xc7, 0x0c, 0xc4, 0x00, 0x27, 0x51, 0x07, 0x9e, 0x13, 0x80, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, 0x64, - 0x75, 0x6d, 0x6d, 0x79, 0x10, 0x80, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0b, 0x00, 0x78, 0xda, 0x53, 0x60, 0x40, 0x05, 0x00, 0x02, 0x10, 0x00, 0x21, 0xd2, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x03, 0x00, 0x00, 0xe7, 0x06, 0x6b, 0x91, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00 -}; - -#endif /* DUMMY_H_ */ diff --git a/flashtool-fup/fup.c b/flashtool-fup/fup.c deleted file mode 100644 index 6dd951a..0000000 --- a/flashtool-fup/fup.c +++ /dev/null @@ -1,716 +0,0 @@ -/**************************************************************************/ -/* Name : fup */ -/* */ -/* Author: Schischu */ -/* */ -/* Licence: This file is subject to the terms and conditions of the */ -/* GNU General Public License version 2. */ -/**************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -//#include /* sha1 / crc32 */ -#include - -#include - -#include "crc16.h" -#include "dummy.h" - -#define VERSION "1.7" -#define DATE "25.10.2011" - -//#define USE_ZLIB - -uint16_t blockCounter = 0; -uint16_t blockCounterTotal = 0; - -#define MAX_PART_NUMBER 17 -#define EXTENSION_LEN 32 - -#define PART_SIGN 1 -#define PART_FLASH 2 - -#define DATA_BLOCKSIZE 0x7FFA - -#if 0 -struct -{ - uint32_t Id; - char Extension[EXTENSION_LEN]; - char Description[EXTENSION_LEN]; - uint32_t Offset; - uint32_t Size; - uint32_t Flags; -} tPartition; - -(0x0, ".loader.mtd0", "Loader", 0x00000000, 0x00100000, (PART_FLASH)), -(0x01, ".app.mtd1", "App", 0x00b00000, 0x00700000, (PART_FLASH | PART_SIGN)), -(0x02, ".config0.mtd5", "Config0", 0x02100000, 0x00040000, (PART_FLASH)), -(0x03, ".config4.mtd5", "Config4", 0x02140000, 0x00040000, (PART_FLASH)), -(0x04, ".config8.mtd5", "Config8", 0x02180000, 0x00020000, (PART_FLASH)), -(0x05, ".configA.mtd5", "ConfigA", 0x021A0000, 0x00020000, (PART_FLASH)), - -(0x06, ".kernel.mtd6", "Kernel", 0x00100000, 0x00300000, (PART_FLASH)), -(0x07, ".dev.mtd4", "Loader", 0x00000000, 0x00100000, (PART_FLASH | PART_SIGN)), -(0x08, ".rootfs.mtd8", "Loader", 0x00000000, 0x00100000, (PART_FLASH | PART_SIGN)), -(0x09, ".user.mtd9", "Loader", 0x00000000, 0x00100000, (PART_FLASH)), -(0x10, ".10", "Loader", 0x00000000, 0x00100000, (PART_FLASH)), -#endif - -uint8_t has[MAX_PART_NUMBER]; -FILE *fd[MAX_PART_NUMBER]; -char ext[MAX_PART_NUMBER][EXTENSION_LEN] = -{ - ".loader.mtd0", - ".app.mtd1", - ".config0.mtd5", //F mtd5 offset 0x00000000 - ".config4.mtd5", //E mtd5 offset 0x00040000 - ".config8.mtd5", - ".configA.mtd5", //C mtd5 offset 0x000A0000 - ".kernel.mtd6", - ".dev.mtd4", - ".rootfs.mtd8", - ".user.mtd9", - ".10", - ".11", - ".12", - ".13", - ".14", - ".15", - ".16" -}; - -#if 0 -void fromint16_t(uint8_t **int16_tBuf, uint16_t val) -{ - *int16_tBuf[0] = val >> 8; - *int16_tBuf[1] = val & 0xFF; -} -#endif - -uint16_t toShort(uint8_t int16_tBuf[2]) -{ - return (uint16_t)(int16_tBuf[1] + (int16_tBuf[0] << 8)); -} - -uint16_t extractShort(uint8_t dataBuf[], uint16_t pos) -{ - uint8_t int16_tBuf[2]; - memcpy(int16_tBuf, dataBuf + pos, 2); - return toShort(int16_tBuf); -} - -uint16_t readShort(FILE *file) -{ - uint8_t int16_tBuf[2]; - if (fread(int16_tBuf, 1, 2, file) == 2) - return toShort(int16_tBuf); - else return 0; -} - -int32_t extractAndWrite(FILE *file, uint8_t *buffer, uint16_t len, uint16_t decLen) -{ -#ifdef USE_ZLIB - if (len != decLen) - { - //zlib - z_stream strm; - uint8_t out[decLen]; - strm.zalloc = Z_NULL; - strm.zfree = Z_NULL; - strm.opaque = Z_NULL; - strm.avail_in = 0; - strm.next_in = Z_NULL; - inflateInit(&strm); - strm.avail_in = len; - strm.next_in = buffer; - strm.avail_out = decLen; - strm.next_out = out; - inflate(&strm, Z_NO_FLUSH); - uint16_t have = decLen - strm.avail_out; - inflateEnd(&strm); - fwrite(out, 1, decLen, file); - return decLen; - } - else -#endif - { - fwrite(buffer, 1, len, file); - return len; - } -} - -uint16_t readAndCompress(FILE *file, uint8_t **dataBuf, uint16_t pos, uint16_t *uncompressedDataLen) -{ - uint16_t have = 0; - *uncompressedDataLen = fread((*dataBuf) + pos, 1, *uncompressedDataLen, file); -#ifdef USE_ZLIB - // So now we have to check if zlib can compress this or not - z_stream strm; - uint8_t in[*uncompressedDataLen]; - uint8_t out[*uncompressedDataLen]; - strm.zalloc = Z_NULL; - strm.zfree = Z_NULL; - strm.opaque = Z_NULL; - deflateInit(&strm, Z_DEFAULT_COMPRESSION); - strm.avail_in = *uncompressedDataLen; - memcpy(in, (*dataBuf) + pos, *uncompressedDataLen); - strm.next_in = in; - //do { - strm.avail_out = *uncompressedDataLen; - strm.next_out = out + have; - deflate(&strm, Z_FINISH); - have = *uncompressedDataLen - strm.avail_out; - deflateEnd(&strm); - if (have < *uncompressedDataLen) - { - memcpy((*dataBuf) + pos, out, have); - } - else -#endif - { - have = *uncompressedDataLen; - } - return have; -} - -uint16_t insertint16_t(uint8_t **dataBuf, uint16_t pos, uint16_t value) -{ - (*dataBuf)[pos] = value >> 8; - (*dataBuf)[pos + 1] = value & 0xFF; - return 2; -} - -int32_t writeBlock(FILE *irdFile, FILE *file, uint8_t firstBlock, uint16_t type) -{ - uint16_t blockHeaderPos = 0; - uint16_t nextBlockHeaderPos = 0; - uint16_t compressedDataLen = 0; - uint16_t uncompressedDataLen = DATA_BLOCKSIZE; - uint16_t dataCrc = 0; - uint8_t *blockHeader = (uint8_t *)malloc(4); - uint8_t *dataBuf = (uint8_t *)malloc(DATA_BLOCKSIZE + 4); - if (firstBlock && type == 0x10) - { - // header - uint16_t resellerId = 0x2303; - insertint16_t(&dataBuf, 0, type); - insertint16_t(&dataBuf, 2, resellerId); - insertint16_t(&dataBuf, 4, 0); - insertint16_t(&dataBuf, 6, 0); - insertint16_t(&dataBuf, 8, 0xFFFF); - insertint16_t(&dataBuf, 10, 0); - insertint16_t(&dataBuf, 12, 0); - insertint16_t(&dataBuf, 14, 0); - compressedDataLen = 12; - uncompressedDataLen = compressedDataLen; - } - else - { - compressedDataLen = readAndCompress(file, &dataBuf, 4, &uncompressedDataLen); - insertint16_t(&dataBuf, 0, type); - insertint16_t(&dataBuf, 2, uncompressedDataLen); - } - dataCrc = crc16(dataCrc, dataBuf, compressedDataLen + 4); - insertint16_t(&blockHeader, 0, compressedDataLen + 6); - insertint16_t(&blockHeader, 2, dataCrc); - fwrite(blockHeader, 1, 4, irdFile); - fwrite(dataBuf, 1, compressedDataLen + 4, irdFile); - free(blockHeader); - free(dataBuf); - return uncompressedDataLen; -} - -int32_t readBlock(FILE *file, const char *name, uint8_t firstBlock) -{ - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); - uint16_t len = 0; - uint16_t crc = 0; - uint16_t type = 0; - len = readShort(file); - if (len == 0) return 0; - crc = readShort(file); - printf(" LEN = %X (%d)\n", len, len); - printf(" CRC = %X\n", crc); - uint8_t dataBuf[len - 2/*crc*/]; - if (fread(dataBuf, 1, len - 2/*crc*/, file) != len - 2/*crc*/) - return 0; - uint16_t dataCrc = 0; - dataCrc = crc16(dataCrc, dataBuf, len - 2/*crc*/); - printf(" CALC CRC = %04X\n", dataCrc); - if (crc != dataCrc) - getchar(); - type = extractShort(dataBuf, 0); - printf(" TYPE = %X\n", type); - blockCounterTotal++; - if (firstBlock && type == 0x10) - { - printf("-> header\n"); - { - uint16_t fpVersion = extractShort(dataBuf, 0); - uint16_t systemId1 = extractShort(dataBuf, 2); - uint16_t systemId2 = extractShort(dataBuf, 4); - uint16_t blockcount1 = extractShort(dataBuf, 6); - uint16_t blockcount2 = extractShort(dataBuf, 8); - uint16_t softwareversion1 = extractShort(dataBuf, 10); - uint16_t softwareversion2 = extractShort(dataBuf, 12); - uint16_t softwareversion3 = extractShort(dataBuf, 14); - printf(" fpVersion: %04X systemId: %04X%04X blockcount: %04X%04X\n", fpVersion, systemId1, systemId2, blockcount1, blockcount2); - printf(" softwareVersion: %04X%04X%04X\n", softwareversion1, softwareversion2, softwareversion3); - //[2] - //[4] - } - } - else - { - if (type < MAX_PART_NUMBER) - { - if (!has[type]) - { - blockCounter = 1; - has[type] = 1; - char nameOut[strlen(name) + 1 + strlen(ext[type])]; - strncpy(nameOut, name, strlen(name)); - strncpy(nameOut + strlen(name), ext[type], strlen(ext[type])); - nameOut[strlen(name) + strlen(ext[type])] = '\0'; - fd[type] = fopen(nameOut, "wb"); - printf("-> %s\n", nameOut); - } - printf(" %s (%d)\n", ext[type], blockCounter++); - uint16_t decLen = extractShort(dataBuf, 2); - printf(" LEN = %X (%d)\n", decLen, decLen); - extractAndWrite(fd[type], dataBuf + 4, len - 6, decLen); - } - else - { - getchar(); - } - } - return len; -} - -int32_t main(int32_t argc, char *argv[]) -{ - FILE *file; - int32_t pos = 0; - uint8_t firstBlock = 1; - if (argc == 3 && strlen(argv[1]) == 2 && strncmp(argv[1], "-s", 2) == 0) - { - uint32_t crc = 0; - char signedFileName[128]; - strcpy(signedFileName, argv[2]); - strcat(signedFileName, ".signed"); - FILE *signedFile = fopen(signedFileName, "wb"); - file = fopen(argv[2], "r"); - uint8_t buffer[0x2710]; - while (!feof(file)) - { - int32_t count = fread(buffer, 1, 0x2710, file); //Actually it would be enpugh to fseek and only to read q byte. - fwrite(buffer, 1, count, signedFile); - crc = crc32(crc, buffer, 1/*0x2710*/); - } - printf("Signed footer: %08X\n", crc); - fwrite(&crc, 1, 4, signedFile); - fclose(file); - fclose(signedFile); - } - else if (argc == 3 && strlen(argv[1]) == 2 && strncmp(argv[1], "-t", 2) == 0) - { - uint32_t crc = 0; - uint32_t orgcrc = 0; - file = fopen(argv[2], "r"); - uint8_t buffer[0x2710]; - while (!feof(file)) // Actually we would ned to remove the sign at the end - { - int32_t count = fread(buffer, 1, 0x2710, file); - if (count != 0x2710) - { - orgcrc = (buffer[count - 1] << 24) + (buffer[count - 2] << 16) + (buffer[count - 3] << 8) + (buffer[count - 4]); - } - crc = crc32(crc, buffer, 1/*0x2710*/); - } - printf("Signed footer: %08X\n", crc); - printf("Original Signed footer: %08X\n", orgcrc); - fclose(file); - } - else if (argc == 3 && strlen(argv[1]) == 2 && strncmp(argv[1], "-x", 2) == 0) - { - for (int32_t i = 0; i < MAX_PART_NUMBER; i++) - { - has[i] = 0; - fd[i] = NULL; - } - file = fopen(argv[2], "r"); - while (!feof(file)) - { - pos = ftell(file); - int32_t len = readBlock(file, argv[2], firstBlock); - firstBlock = 0; - if (len > 0) - { - pos += len + 2; - fseek(file, pos, SEEK_SET); - } - else - { - break; - } - } - fclose(file); - for (int32_t i = 0; i < MAX_PART_NUMBER; i++) - { - if (fd[i] != NULL) - { - fclose(fd[i]); - } - } - } - else if (argc == 2 && strlen(argv[1]) == 2 && strncmp(argv[1], "-v", 2) == 0) - { - printf("Version: %s Date: %s\n", VERSION, DATE); - } - else if (argc >= 3 && strlen(argv[1]) == 2 && strncmp(argv[1], "-c", 2) == 0) - { - FILE *irdFile = fopen(argv[2], "w+"); - uint16_t totalBlockCount = 0; - uint16_t headerDataBlockLen = 0; - // Header - headerDataBlockLen = writeBlock(irdFile, NULL, 1, 0x10); - headerDataBlockLen += 4; - uint8_t appendPartCount = argc - 3; - for (int32_t i = 0; i < appendPartCount; i += 2) - { - uint8_t type = 0x01; - if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-feelinglucky", 13) == 0) - { - type = 0x00; - } - else if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-a", 2) == 0) - { - type = 0x01; - } - else if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-1", 2) == 0) - { - type = 0x01; - } - else if (strlen(argv[3 + i]) == 3 && strncmp(argv[3 + i], "-c0", 3) == 0) - { - type = 0x02; - } - else if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-2", 2) == 0) - { - type = 0x02; - } - else if (strlen(argv[3 + i]) == 3 && strncmp(argv[3 + i], "-c4", 3) == 0) - { - type = 0x03; - } - else if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-3", 2) == 0) - { - type = 0x03; - } - else if (strlen(argv[3 + i]) == 3 && strncmp(argv[3 + i], "-c8", 3) == 0) - { - type = 0x04; - } - else if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-4", 2) == 0) - { - type = 0x04; - } - else if (strlen(argv[3 + i]) == 3 && strncmp(argv[3 + i], "-ca", 3) == 0) - { - type = 0x05; - } - else if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-5", 2) == 0) - { - type = 0x05; - } - else if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-k", 2) == 0) - { - type = 0x06; - } - else if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-6", 2) == 0) - { - type = 0x06; - } - else if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-d", 2) == 0) - { - type = 0x07; - } - else if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-7", 2) == 0) - { - type = 0x07; - } - else if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-r", 2) == 0) - { - type = 0x08; - } - else if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-8", 2) == 0) - { - type = 0x08; - } - else if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-u", 2) == 0) - { - type = 0x09; - } - else if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-9", 2) == 0) - { - type = 0x09; - } - else if (strlen(argv[3 + i]) == 3 && strncmp(argv[3 + i], "-10", 3) == 0) - { - type = 0x10; - } - FILE *file = fopen(argv[3 + i + 1], "rb"); - printf("Adding %s\n", argv[3 + i + 1]); - uint16_t partBlocksize = totalBlockCount; - while (writeBlock(irdFile, file, 0, type) == DATA_BLOCKSIZE) - { - totalBlockCount++; - printf("."); - } - totalBlockCount++; - partBlocksize = totalBlockCount - partBlocksize; - printf("\nAdded %d Blocks, total %d\n", partBlocksize, totalBlockCount); - fclose(file); - } - // Refresh Header - uint8_t *dataBuf = (uint8_t *)malloc(headerDataBlockLen); - // Read Header Data Block - fseek(irdFile, 0x04, SEEK_SET); - fread(dataBuf, 1, headerDataBlockLen, irdFile); - // Update Blockcount - insertint16_t(&dataBuf, 8, totalBlockCount); - // Rewrite Header Data Block - fseek(irdFile, 0x04, SEEK_SET); - fwrite(dataBuf, 1, headerDataBlockLen, irdFile); - // Update CRC - uint16_t dataCrc = crc16(0, dataBuf, headerDataBlockLen); - insertint16_t(&dataBuf, 0, dataCrc); - // Rewrite CRC - fseek(irdFile, 0x02, SEEK_SET); - fwrite(dataBuf, 1, 2, irdFile); - free(dataBuf); - fclose(irdFile); - } - else if (argc >= 3 && strlen(argv[1]) == 3 && strncmp(argv[1], "-ce", 3) == 0) - { - FILE *irdFile = fopen(argv[2], "w+"); - uint16_t totalBlockCount = 0; - uint16_t headerDataBlockLen = 0; - //uint8_t * headerDataBloc; - // Header - headerDataBlockLen = writeBlock(irdFile, NULL, 1, 0x10); - headerDataBlockLen += 4; - uint8_t appendPartCount = argc - 3; - for (int32_t i = 0; i < appendPartCount; i += 2) - { - uint8_t type = 0x01; - if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-f", 2) == 0) - { - // Original APP, now FW - type = 0x01; - } - else if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-k", 2) == 0) - { - // KERNEL - type = 0x06; - } - else if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-e", 2) == 0) - { - //Original ROOT, now EXT - type = 0x08; - } - else if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-g", 2) == 0) - { - //Original DEV, now G - type = 0x07; - } - else if (strlen(argv[3 + i]) == 2 && strncmp(argv[3 + i], "-r", 2) == 0) - { - //Original USER, now ROOT - type = 0x09; // 7 if dev, than we need to split the file in 3 files - } - if (type == 0x01 || type == 0x08 || type == 0x07) - { - printf("Adding signed dummy squashfs header"); - FILE *file = fopen("dummy.squash.signed.padded", "w"); - printf("."); - if (file != NULL) - { - printf("."); - fwrite(dummy, 1, dummy_size, file); - printf("."); - fclose(file); - printf("."); - file = fopen("dummy.squash.signed.padded", "rb"); - printf("."); - if (file != NULL) - { - while (writeBlock(irdFile, file, 0, type) == DATA_BLOCKSIZE) - { - printf("."); - totalBlockCount++; - } - totalBlockCount++; - fclose(file); - } - else - printf("\nCould not write signed dummy squashfs header (2)\n"); - remove("dummy.squash.signed.padded"); - } - else - printf("\nCould not write signed dummy squashfs header (1)\n"); - printf("\n"); - } - if (strncmp(argv[3 + i + 1], "foo", 3) != 0) - { - FILE *file = fopen(argv[3 + i + 1], "rb"); - if (file != NULL) - { - /*if(type == 0x07) { // DEV ROOT - // We have to split it onto 3 partitions - // dev 2E0000 2,875MB (300000 - 20000) - // config 100000 1MB - // user 1E00000 30MB - uint8_t buffer[0x1000]; - }*/ - printf("Adding %s", argv[3 + i + 1]); - uint16_t partBlocksize = totalBlockCount; - while (writeBlock(irdFile, file, 0, type) == DATA_BLOCKSIZE) - { - totalBlockCount++; - printf("."); - } - totalBlockCount++; - partBlocksize = totalBlockCount - partBlocksize; - printf("\nAdded %d Blocks, total %d\n", partBlocksize, totalBlockCount); - fclose(file); - } - else - { - printf("\nCould not append %s\n", argv[3 + i + 1]); - printf("\n"); - } - } - else - { - printf("This is a foo partition\n"); - } - } - /// Refresh Header - uint8_t *dataBuf = (uint8_t *)malloc(headerDataBlockLen); - // Read Header Data Block - fseek(irdFile, 0x04, SEEK_SET); - fread(dataBuf, 1, headerDataBlockLen, irdFile); - // Update Blockcount - insertint16_t(&dataBuf, 8, totalBlockCount); - // Rewrite Header Data Block - fseek(irdFile, 0x04, SEEK_SET); - fwrite(dataBuf, 1, headerDataBlockLen, irdFile); - // Update CRC - uint16_t dataCrc = crc16(0, dataBuf, headerDataBlockLen); - insertint16_t(&dataBuf, 0, dataCrc); - // Rewrite CRC - fseek(irdFile, 0x02, SEEK_SET); - fwrite(dataBuf, 1, 2, irdFile); - free(dataBuf); - fclose(irdFile); - } - else if (argc == 4 && strlen(argv[1]) == 2 && strncmp(argv[1], "-r", 2) == 0) - { - uint8_t headerDataBlockLen = 0; - uint32_t resellerId = 0; - sscanf(argv[3], "%x", &resellerId); - FILE *irdFile = fopen(argv[2], "r+"); - if (irdFile == NULL) - { - printf("Error opening %s\n", argv[2]); - } - headerDataBlockLen = readShort(irdFile); - headerDataBlockLen -= 2; - printf("Changing reseller id to %04x\n", resellerId); - /// Refresh Header - uint8_t *dataBuf = (uint8_t *)malloc(headerDataBlockLen); - // Read Header Data Block - fseek(irdFile, 0x04, SEEK_SET); - fread(dataBuf, 1, headerDataBlockLen, irdFile); - // Update Blockcount - insertint16_t(&dataBuf, 2, resellerId & 0xFFFF); - // Rewrite Header Data Block - fseek(irdFile, 0x04, SEEK_SET); - fwrite(dataBuf, 1, headerDataBlockLen, irdFile); - // Update CRC - uint16_t dataCrc = crc16(0, dataBuf, headerDataBlockLen); - insertint16_t(&dataBuf, 0, dataCrc); - // Rewrite CRC - fseek(irdFile, 0x02, SEEK_SET); - fwrite(dataBuf, 1, 2, irdFile); - free(dataBuf); - fclose(irdFile); - } - else //show usage - { -#ifdef USE_ZLIB - uint8_t zlib = 1; -#else - uint8_t zlib = 0; -#endif - printf("\n"); - printf("Version: %s Date: %s USE_ZLIB: %d \n", VERSION, DATE, zlib); - printf("\n"); - printf("Usage: %s -xcstv [] \n", argv[0]); - printf(" -x [update.ird] Extract IRD \n"); - printf(" -c [update.ird] Options Create IRD \n"); - printf(" Options: \n"); - printf(" [file.part] Append Loader (0) 0x00000000 - 0x000FFFFF (1 MB) \n"); - printf(" -k [file.part] Append Kernel (6) 0x00100000 - 0x003FFFFF (3 MB) \n"); - printf(" * -ao [file.part] Append App Org (*) 0x00400000 - 0x00aFFFFF (7 MB) \n"); - printf(" s -a [file.part] Append App (1) 0x00b00000 - 0x011FFFFF (7 MB) \n"); - printf(" s -r [file.part] Append Root (8) 0x01200000 - 0x01dFFFFF (12 MB) \n"); - printf(" s -d [file.part] Append Dev (7) 0x01e00000 - 0x020FFFFF (3 MB) \n"); - printf(" -c0 [file.part] Append Config0 (2) 0x02100000 - 0x0213FFFF (256 KB) \n"); - printf(" -c4 [file.part] Append Config4 (3) 0x02140000 - 0x0217FFFF (256 KB) \n"); - printf(" -c8 [file.part] Append Config8 (4) 0x02180000 - 0x0219FFFF (128 KB) \n"); - printf(" -ca [file.part] Append ConfigA (5) 0x021A0000 - 0x021BFFFF (128 KB) \n"); - printf(" * -cc [file.part] Append ConfigC (*) 0x021C0000 - 0x021FFFFF (256 KB) \n"); - printf(" -u [file.part] Append User (9) 0x02200000 - 0x03FFFFFF (30 MB) \n"); - printf(" -1 [file.part] Append Type 1 (1) \n"); - printf(" ... \n"); - printf(" -10 [file.part] Append Type 10 (10) \n"); - //printf(" -16 [file.part] Append Type 16 (16) \n"); - printf(" -ce [update.ird] Options Create Enigma2 IRD \n"); - printf(" Options: \n"); - printf(" -k [file.part] Append Kernel 0x00100000 - 0x003FFFFF (3 MB)\n"); - printf(" -f [file.part] Append FW 0x00B20000 - 0x011FFFFF (6.875 MB)\n"); - //printf(" -r [file.part] Append Root 0x01E20000 - 0x03FFFFFF (33.875 MB)\n"); - printf(" -r [file.part] Append Root 0x02200000 - 0x03FFFFFF (30 MB)\n"); - printf(" -e [file.part] Append Ext 0x01220000 - 0x01DFFFFF (11.875 MB)\n"); - printf(" -g [file.part] Append G 0x01E20000 - 0x020FFFFF (2.875 MB)\n"); - printf(" -s [unsigned.squashfs] Sign squashfs part \n"); - printf(" -t [signed.squashfs] Test signed squashfs part \n"); - printf(" -r [update.ird] id Change reseller id (e.g. 2303 for atevio 7500) \n"); - printf(" -v Display version \n"); - printf("\n"); - printf("Note: For creating squashfs part. use mksquashfs v3.3 \n"); - printf(" ./mksquashfs squashfs-root flash.rootfs.own.mtd8 -nopad -le \n"); - printf("\n"); - printf("Example: \n"); - printf(" Creating a new IRD file with rootfs and kernel: \n"); - printf(" %s -c my.ird -r flash.rootfs.own.mtd8.signed -k uimage.mtd6 \n", argv[0]); - printf("\n"); - printf(" Extracting a IRD file: \n"); - printf(" %s -x my.ird \n", argv[0]); - printf("\n"); - printf(" Signing a squashfs partition: \n"); - printf(" %s -s my.squashfs \n", argv[0]); - return -1; - } - return 0; -} diff --git a/flashtool-mup/Makefile.am b/flashtool-mup/Makefile.am deleted file mode 100644 index 8ccfb5b..0000000 --- a/flashtool-mup/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -bin_PROGRAMS = mup - -mup_SOURCES = mup.cpp misc.cpp crc32.cpp sh1.cpp swinventory.cpp swpack.cpp swunity.cpp - -AM_CFLAGS = -Wall diff --git a/flashtool-mup/autogen.sh b/flashtool-mup/autogen.sh deleted file mode 100755 index a05f56f..0000000 --- a/flashtool-mup/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-flashtool-mup" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/flashtool-mup/configure.ac b/flashtool-mup/configure.ac deleted file mode 100644 index bdfd554..0000000 --- a/flashtool-mup/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT([mup],[1.0],[],[mup]) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_OUTPUT([ -Makefile -]) diff --git a/flashtool-mup/crc32.cpp b/flashtool-mup/crc32.cpp deleted file mode 100644 index bad79f3..0000000 --- a/flashtool-mup/crc32.cpp +++ /dev/null @@ -1,83 +0,0 @@ -#include -#include "crc32.h" - -/* taken from ufs922 uboot source */ - -uint32_t crc_table[256] = -{ - 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, - 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, - 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, - 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, - 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, - 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, - 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, - 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd, - 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, - 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, - 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, - 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, - 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, - 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, - 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, - 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, - 0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, - 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072, - 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, - 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, - 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, - 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, - 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066, - 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, - 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, - 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692, - 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, - 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, - 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, - 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, - 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, - 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a, - 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, - 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, - 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, - 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53, - 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, - 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b, - 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, - 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, - 0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, - 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b, - 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, - 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3, - 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, - 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, - 0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, - 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3, - 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, - 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, - 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, - 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, - 0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30, - 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, - 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, - 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654, - 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, - 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, - 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, - 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, - 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, - 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c, - 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, - 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4 -}; - -uint32_t crc32(uint8_t *data, uint32_t len) -{ - register uint32_t i; - uint32_t crc = 0xffffffff; - for (i = 0; i < len; i++) - { - crc = (crc << 8) ^ crc_table[((crc >> 24) ^ *data++) & 0xff]; - } - return crc; -} diff --git a/flashtool-mup/crc32.h b/flashtool-mup/crc32.h deleted file mode 100644 index 98fdc98..0000000 --- a/flashtool-mup/crc32.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * crc32.h - * - * Created on: Mar 6, 2010 - * Author: ubuntu - */ - -#ifndef CRC32_H_ -#define CRC32_H_ - -#include - -uint32_t crc32(uint8_t *data, uint32_t len); - -#endif /* CRC32_H_ */ diff --git a/flashtool-mup/misc.cpp b/flashtool-mup/misc.cpp deleted file mode 100644 index 1c222a9..0000000 --- a/flashtool-mup/misc.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include -#include -#include - -#include "misc.h" - -char *strTime(uint32_t /*time_t*/ now) -{ - struct tm *ts; - char buf[80]; - time_t tmp_now = (time_t)now; - ts = localtime(&tmp_now); - strftime(buf, sizeof(buf), "%a %Y-%m-%d %H:%M:%S %Z", ts); - return strdup(buf); -} - -void verboseprintf(const char *printstring) -{ - if (verbose) - { - printf("%s", printstring); - } -} diff --git a/flashtool-mup/misc.h b/flashtool-mup/misc.h deleted file mode 100644 index 42b56c5..0000000 --- a/flashtool-mup/misc.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef MISC_H_ -#define MISC_H_ - -#include -#include -#include - -#define SW_MAGIC_VALUE "MARUSWUP" - -enum -{ - SW_UPDATE_HEADER_SIZE = 512, - SW_UPDATE_CRYPTO_SIZE = 256, - SW_UPDATE_MAGIC_SIZE = 8, - SW_UPDATE_INFO_LENGTH = 128, - SW_UPDATE_FILENAME_LENGTH = 32, - - SW_INVENTORY_SIZE = 64, - MAX_INVENTORY_COUNT = 8, - - SW_UPDATER_VERSION = 100, -}; - -char *strTime(uint32_t /*time_t*/ now); -void verboseprintf(const char *printstring); -extern bool verbose; - -#endif diff --git a/flashtool-mup/mup.cpp b/flashtool-mup/mup.cpp deleted file mode 100644 index 68f69f5..0000000 --- a/flashtool-mup/mup.cpp +++ /dev/null @@ -1,442 +0,0 @@ -/**************************************************************************/ -/* Name : mup */ -/* */ -/* Author: Schischu */ -/* */ -/* Licence: This file is subject to the terms and conditions of the */ -/* GNU General Public License version 2. */ -/**************************************************************************/ - -#include -#include -#include -#include -#include -#include -//#include /* sha1 / crc32 */ -#include - -#include "swpack.h" - -#define VERSION "1.4" - -#define NOR_RAW 0 -#define NAND_RAW 1 -#define NAND_YAFFS2 2 -#define NAND_YAFFS2_ERASE 3 - -bool verbose = true; - -void clear(FILE *fp) -{ - char buf[255]; - while (fgets(buf, 255, fp) != NULL && feof(fp)) - { - /* puts (buf); */ - } -} - -int32_t main(int32_t argc, char *argv[]) -{ - FILE *file; - int32_t i, data_len; - uint8_t *buffer; - struct stat buf; - bool doInfo = false; - bool doVerify = false; - bool doXML = false; - bool doXMLDetail = false; - bool doExtract = false; - bool doCreate = false; - if (argc == 3 && strlen(argv[1]) == 1 && !strncmp(argv[1], "i", 1)) - { - doInfo = true; - } - else if (argc == 3 && strlen(argv[1]) == 1 && !strncmp(argv[1], "v", 1)) - { - doVerify = true; - } - else if (argc == 3 && strlen(argv[1]) == 1 && !strncmp(argv[1], "x", 1)) - { - doXML = true; - } - else if (argc == 3 && strlen(argv[1]) == 2 && !strncmp(argv[1], "xx", 2)) - { - doXMLDetail = true; - } - else if (argc == 3 && strlen(argv[1]) == 1 && !strncmp(argv[1], "e", 1)) - { - doExtract = true; - } - else if (argc == 3 && strlen(argv[1]) == 1 && !strncmp(argv[1], "c", 1)) - { - doCreate = true; - verbose = false; - } - else - { - printf("Version: %s %s\n", argv[0], VERSION); - printf("Usage:\n"); - printf("For image information:\n"); - printf(" %s i FILENAME Info as TXT\n", argv[0]); - printf(" %s x FILENAME Info as XML (basic)\n", argv[0]); - printf(" %s xx FILENAME Info as XML (detailed)\n", argv[0]); - printf("For image verification:\n"); - printf(" %s v FILENAME \n", argv[0]); - printf("For image extraction:\n"); - printf(" %s e FILENAME \n", argv[0]); - printf("For image generation:\n"); - printf(" %s c FILENAME \n", argv[0]); - exit(10); - } - if (doInfo || doVerify || doXML || doXMLDetail || doExtract) - { - ////////////////////////////////// - if (stat(argv[2], &buf) < 0) - { - fprintf(stderr, "Cannot open(stat) %s", argv[2]); - return -2; - } - data_len = buf.st_size; - file = fopen(argv[2], "r"); - if (file == NULL) - { - fprintf(stderr, "Unable to open %s\n", argv[1]); - return -3; - } - buffer = (uint8_t *) malloc(data_len); - if (buffer == NULL) - { - fprintf(stderr, "Unable to get memory %d\n", data_len); - return -4; - } - i = fread(buffer, 1, data_len, file); - ////////////////////////////////// - SwPack *swpack = new SwPack(buffer, i); - swpack->parse(); - if (doInfo) - { - swpack->print(); - } - else if (doVerify) - { - if (swpack->verify()) - { - printf("Image is correct\n"); - } - else - { - printf("Image is NOT correct\n"); - } - } - else if (doXML || doXMLDetail) - { - printf("\n"); - swpack->printXML(doXMLDetail); - printf("\n"); - } - else if (doExtract) - { - swpack->extract(); - } - /* act of solidarity ;) */ - free(buffer); - fclose(file); - } - else if (doCreate) - { - ////////////////////////////////// - /* - - create list of partitions - - create swpack - - swpack set boxtype - - swpack append partition (address, filename) - - swpack create update image - */ - char outputName[1024]; - strcpy(outputName, argv[2]); - uint32_t inputBufferLength = 255; - char inputBuffer[inputBufferLength + 1]; - char partitionName[inputBufferLength + 1]; - int32_t productCode = 0; - int32_t flashOffset = -1; - int32_t nand = 0; - int32_t blockSize = 0; - SwPack *swpack = new SwPack(); - verboseprintf("Select ProductCode\n"); - verboseprintf("1: 0x11321000 - Kathrein UFS-922\n"); - verboseprintf("2: 0x11301003 - Kathrein UFS-912\n"); - verboseprintf("3: 0x11301006 - Kathrein UFS-913\n"); - verboseprintf(":> "); - scanf("%d", &productCode); - switch (productCode) - { - case 1: - { - productCode = 0x11321000; - break; - } - case 3: - { - productCode = 0x11321006; - break; - } - case 2: - default: - { - productCode = 0x11301003; - break; - } - } - swpack->setProductCode(productCode); - verboseprintf("Enter partitions. \"FLASHOFFSET, BLOCKSIZE, NAND, FILENAME;\"\n"); - verboseprintf("Finish list with \";\"\n"); - verboseprintf("Example: \n"); - verboseprintf("\t0x004E0000, 0x0, 0, 922.cramfs\n"); - verboseprintf("\t0x00040000, 0x0, 0, uImage.922.105\n"); - verboseprintf("\t0x002A0000, 0x0, 0, root.922.105.cramfs\n"); - verboseprintf(";\n"); - fflush(stdin); - clear(stdin); - while (1) - { - verboseprintf(":> "); - flashOffset = -1; - scanf("0x%X, ", &flashOffset); - if (flashOffset == -1) - { - verboseprintf("\n flashOffset missing\n"); - break; - } - blockSize = -1; - scanf("0x%X, ", &blockSize); - if (blockSize == -1) - { - verboseprintf("\n blockSize missing\n"); - break; - } - scanf("%d, ", &nand); - if (nand != NOR_RAW && nand != NAND_RAW && nand != NAND_YAFFS2 && nand != NAND_YAFFS2_ERASE) - { - verboseprintf("\n nand missing\n"); - break; - } - scanf("%s", inputBuffer); - if (verbose) - { - printf("\tflashOffset: %d, blockSize: %d, inputBuffer: %s\n", flashOffset, blockSize, inputBuffer); - } - fflush(stdin); - clear(stdin); - if (!strcmp(inputBuffer, "foo")) - { - data_len = 8; - buffer = (uint8_t *) malloc(8); - buffer[0] = 0xFF; - buffer[1] = 0xFF; - buffer[2] = 0xFF; - buffer[3] = 0xFF; - buffer[4] = 0xFF; - buffer[5] = 0xFF; - buffer[6] = 0xFF; - buffer[7] = 0xFF; - i = 8; - } - else - { - stat(inputBuffer, &buf); - data_len = buf.st_size; - file = fopen(inputBuffer, "r"); - if (file == NULL) - { - fprintf(stderr, "Unable to open %s\n", inputBuffer); - return -3; - } - buffer = (uint8_t *) malloc(data_len); - if (buffer == NULL) - { - fprintf(stderr, "Unable to get mem %d\n", data_len); - return -4; - } - i = fread(buffer, 1, data_len, file); - fclose(file); - } - if (nand == NAND_RAW) - { - if (productCode == 0x11321006) - { - sprintf(partitionName, "/2/3/"); // NAND RAW - } - else - { - sprintf(partitionName, "/2/O3/"); // NAND RAW - } - strcat(partitionName, inputBuffer); - } - else if (nand == NAND_YAFFS2) - { - if (blockSize == 0) - { - blockSize = data_len; - if (blockSize % (1 << 16) != 0) - { - blockSize = (blockSize >> 16) + 1; - } - else - { - blockSize = blockSize >> 16; - } - } - else - { - blockSize = blockSize >> 16; - } - if (verbose) - { - printf("BS: %d\n", blockSize); - } - if (productCode == 0x11321006) - { - sprintf(partitionName, "/%X/5/", blockSize); // NAND YAFFS2 - } - else - { - sprintf(partitionName, "/%X/O5/", blockSize); // NAND YAFFS2 - } - strcat(partitionName, inputBuffer); - } - else if (nand == NAND_YAFFS2_ERASE) - { - if (blockSize == 0) - { - blockSize = data_len; - if (blockSize % (1 << 16) != 0) - { - blockSize = (blockSize >> 16) + 1; - } - else - { - blockSize = blockSize >> 16; - } - } - else - { - blockSize = blockSize >> 16; - } - if (verbose) - { - printf("BS: %d\n", blockSize); - } - sprintf(partitionName, "/%X/E5/", blockSize); // NAND YAFFS2 - strcat(partitionName, inputBuffer); - } - else - { - strcpy(partitionName, inputBuffer); // NOR RAW - } - swpack->appendPartition(flashOffset, partitionName, (uint8_t *)buffer, i); - free(buffer); - } - swpack->printXML(true); - data_len = swpack->createImage(&buffer); - file = fopen(outputName, "wb"); - if (file == NULL) - { - fprintf(stderr, "Unable to open %s\n", outputName); - return -3; - } - if (buffer == NULL) - { - fprintf(stderr, "Unable to get memory %d\n", data_len); - return -4; - } - i = fwrite(buffer, 1, data_len, file); - fclose(file); -#if 0 - SwPack *swpack = new SwPack(); - swpack->setProductCode(0x11321000); - char *part1 = strdup("922.cramfs"); - char *part2 = strdup("uImage.922.105"); - char *part3 = strdup("root.922.105.cramfs"); - ////////////// - stat(part1, &buf); - data_len = buf.st_size; - file = fopen(part1, "r"); - if (file == NULL) - { - fprintf(stderr, "Unable to open %s\n", part1); - return -3; - } - buffer = (uint8_t *) malloc(data_len); - if (buffer == NULL) - { - fprintf(stderr, "Unable to get memory %d\n", data_len); - return -4; - } - i = fread(buffer, 1, data_len, file); - fclose(file); - swpack->appendPartition(0x004E0000, part1, (uint8_t *)buffer, i); - free(buffer); - ////////////// - stat(part2, &buf); - data_len = buf.st_size; - file = fopen(part2, "r"); - if (file == NULL) - { - fprintf(stderr, "Unable to open %s\n", part2); - return -3; - } - buffer = (uint8_t *) malloc(data_len); - if (buffer == NULL) - { - fprintf(stderr, "Unable to get memory %d\n", data_len); - return -4; - } - i = fread(buffer, 1, data_len, file); - fclose(file); - swpack->appendPartition(0x00040000, part2, (uint8_t *)buffer, i); - free(buffer); - ////////////// - stat(part3, &buf); - data_len = buf.st_size; - file = fopen(part3, "r"); - if (file == NULL) - { - fprintf(stderr, "Unable to open %s\n", part3); - return -3; - } - buffer = (uint8_t *) malloc(data_len); - if (buffer == NULL) - { - fprintf(stderr, "Unable to get memory %d\n", data_len); - return -4; - } - i = fread(buffer, 1, data_len, file); - fclose(file); - swpack->appendPartition(0x002A0000, part3, (uint8_t *)buffer, i); - free(buffer); - ///////////// - swpack->printXML(true); - data_len = swpack->createImage(&buffer); - file = fopen("update.img", "wb"); - if (file == NULL) - { - fprintf(stderr, "Unable to open %s\n", part1); - return -3; - } - if (buffer == NULL) - { - fprintf(stderr, "Unable to get memory %d\n", data_len); - return -4; - } - for (int32_t j = 0; j < 20; j++) - { - printf("%02X ", *(buffer + j)); - } - printf("\n"); - i = fwrite(buffer, 1, data_len, file); - fclose(file); -#endif - } - return 0; -} diff --git a/flashtool-mup/sh1.cpp b/flashtool-mup/sh1.cpp deleted file mode 100644 index 4b6da2c..0000000 --- a/flashtool-mup/sh1.cpp +++ /dev/null @@ -1,194 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#include "sh1.h" - -/* Hash a single 512-bit block. This is the core of the algorithm. */ - -void SHA1Transform(uint32_t state[5], uint8_t buffer[64]) -{ - uint32_t a, b, c, d, e; - typedef union - { - uint8_t c[64]; - uint32_t l[16]; - } CHAR64LONG16; - CHAR64LONG16 *block; -#ifdef SHA1HANDSOFF - static uint8_t workspace[64]; - block = (CHAR64LONG16 *)workspace; - memcpy(block, buffer, 64); -#else - block = (CHAR64LONG16 *)buffer; -#endif - /* Copy context->state[] to working vars */ - a = state[0]; - b = state[1]; - c = state[2]; - d = state[3]; - e = state[4]; - /* 4 rounds of 20 operations each. Loop unrolled. */ - R0(a, b, c, d, e, 0); - R0(e, a, b, c, d, 1); - R0(d, e, a, b, c, 2); - R0(c, d, e, a, b, 3); - R0(b, c, d, e, a, 4); - R0(a, b, c, d, e, 5); - R0(e, a, b, c, d, 6); - R0(d, e, a, b, c, 7); - R0(c, d, e, a, b, 8); - R0(b, c, d, e, a, 9); - R0(a, b, c, d, e, 10); - R0(e, a, b, c, d, 11); - R0(d, e, a, b, c, 12); - R0(c, d, e, a, b, 13); - R0(b, c, d, e, a, 14); - R0(a, b, c, d, e, 15); - R1(e, a, b, c, d, 16); - R1(d, e, a, b, c, 17); - R1(c, d, e, a, b, 18); - R1(b, c, d, e, a, 19); - R2(a, b, c, d, e, 20); - R2(e, a, b, c, d, 21); - R2(d, e, a, b, c, 22); - R2(c, d, e, a, b, 23); - R2(b, c, d, e, a, 24); - R2(a, b, c, d, e, 25); - R2(e, a, b, c, d, 26); - R2(d, e, a, b, c, 27); - R2(c, d, e, a, b, 28); - R2(b, c, d, e, a, 29); - R2(a, b, c, d, e, 30); - R2(e, a, b, c, d, 31); - R2(d, e, a, b, c, 32); - R2(c, d, e, a, b, 33); - R2(b, c, d, e, a, 34); - R2(a, b, c, d, e, 35); - R2(e, a, b, c, d, 36); - R2(d, e, a, b, c, 37); - R2(c, d, e, a, b, 38); - R2(b, c, d, e, a, 39); - R3(a, b, c, d, e, 40); - R3(e, a, b, c, d, 41); - R3(d, e, a, b, c, 42); - R3(c, d, e, a, b, 43); - R3(b, c, d, e, a, 44); - R3(a, b, c, d, e, 45); - R3(e, a, b, c, d, 46); - R3(d, e, a, b, c, 47); - R3(c, d, e, a, b, 48); - R3(b, c, d, e, a, 49); - R3(a, b, c, d, e, 50); - R3(e, a, b, c, d, 51); - R3(d, e, a, b, c, 52); - R3(c, d, e, a, b, 53); - R3(b, c, d, e, a, 54); - R3(a, b, c, d, e, 55); - R3(e, a, b, c, d, 56); - R3(d, e, a, b, c, 57); - R3(c, d, e, a, b, 58); - R3(b, c, d, e, a, 59); - R4(a, b, c, d, e, 60); - R4(e, a, b, c, d, 61); - R4(d, e, a, b, c, 62); - R4(c, d, e, a, b, 63); - R4(b, c, d, e, a, 64); - R4(a, b, c, d, e, 65); - R4(e, a, b, c, d, 66); - R4(d, e, a, b, c, 67); - R4(c, d, e, a, b, 68); - R4(b, c, d, e, a, 69); - R4(a, b, c, d, e, 70); - R4(e, a, b, c, d, 71); - R4(d, e, a, b, c, 72); - R4(c, d, e, a, b, 73); - R4(b, c, d, e, a, 74); - R4(a, b, c, d, e, 75); - R4(e, a, b, c, d, 76); - R4(d, e, a, b, c, 77); - R4(c, d, e, a, b, 78); - R4(b, c, d, e, a, 79); - /* Add the working vars back into context.state[] */ - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - state[4] += e; - /* Wipe variables */ - a = b = c = d = e = 0; -} - -/* SHA1Init - Initialize new context */ -void SHA1Init(SHA1_CTX *context) -{ - /* SHA1 initialization constants */ - context->state[0] = 0x67452301; - context->state[1] = 0xEFCDAB89; - context->state[2] = 0x98BADCFE; - context->state[3] = 0x10325476; - context->state[4] = 0xC3D2E1F0; - context->count[0] = context->count[1] = 0; -} - -/* Run your data through this. */ -void SHA1Update(SHA1_CTX *context, uint8_t *data, uint32_t len) -{ - uint32_t i, j; - j = (context->count[0] >> 3) & 63; - if ((context->count[0] += len << 3) < (len << 3)) - { - context->count[1]++; - } - context->count[1] += (len >> 29); - if ((j + len) > 63) - { - memcpy(&context->buffer[j], data, (i = 64 - j)); - SHA1Transform(context->state, context->buffer); - for (; i + 63 < len; i += 64) - { - SHA1Transform(context->state, &data[i]); - } - j = 0; - } - else - { - i = 0; - } - memcpy(&context->buffer[j], &data[i], len - i); -} - -/* Add padding and return the message digest. */ -void SHA1Final(uint8_t digest[20], SHA1_CTX *context) -{ - uint32_t i, j; - uint8_t finalcount[8]; - for (i = 0; i < 8; i++) - { - finalcount[i] = (uint8_t)((context->count[(i >= 4 ? 0 : 1)] >> ((3 - (i & 3)) * 8)) & 255); /* Endian independent */ - } - SHA1Update(context, (uint8_t *)"\200", 1); - while ((context->count[0] & 504) != 448) - { - SHA1Update(context, (uint8_t *)"\0", 1); - } - SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */ - for (i = 0; i < 20; i++) - { - digest[i] = (uint8_t)((context->state[i >> 2] >> ((3 - (i & 3)) * 8)) & 255); - } - /* Wipe variables */ - i = j = 0; - memset(context->buffer, 0, 64); - memset(context->state, 0, 20); - memset(context->count, 0, 8); - memset(&finalcount, 0, 8); -#ifdef SHA1HANDSOFF /* make SHA1Transform overwrite it's own static vars */ - SHA1Transform(context->state, context->buffer); -#endif -} diff --git a/flashtool-mup/sh1.h b/flashtool-mup/sh1.h deleted file mode 100644 index 57a3c75..0000000 --- a/flashtool-mup/sh1.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef SH1_H_ -#define SH1_H_ - -#include - -typedef struct -{ - uint32_t state[5]; - uint32_t count[2]; - uint8_t buffer[64]; -} SHA1_CTX; - -/* -SHA-1 in C -By Steve Reid -100% Public Domain - -Test Vectors (from FIPS PUB 180-1) -"abc" - A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D - "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" - 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 -A million repetitions of "a" - 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F -*/ - -/* #define LITTLE_ENDIAN * This should be #define'd if true. */ -/* #define SHA1HANDSOFF * Copies data before messing with it. */ - -#if BYTE_ORDER == BIG_ENDIAN -#else -#undef LITTLE_ENDIAN -#endif - -#define SHA1HANDSOFF - -//by doliyu -//#include "GlobalConfig.h" -//#include "SHA1.h" - -void SHA1Transform(uint32_t state[5], uint8_t buffer[64]); -void SHA1Init(SHA1_CTX *context); -void SHA1Update(SHA1_CTX *context, uint8_t *data, uint32_t len); -void SHA1Final(uint8_t digest[20], SHA1_CTX *context); - -#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) - -/* blk0() and blk() perform the initial expand. */ -/* I got the idea of expanding during the round function from SSLeay */ -#ifdef LITTLE_ENDIAN -#define blk0(i) (block->l[i] = (rol(block->l[i], 24) & 0xFF00FF00) | (rol(block->l[i], 8) & 0x00FF00FF)) -#else -#define blk0(i) block->l[i] -#endif -#define blk(i) (block->l[i&15] = rol(block->l[(i + 13) & 15] ^ block->l[(i + 8) & 15] ^ block->l[(i + 2) & 15] ^ block->l[i & 15], 1)) - -/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ -#define R0(v, w, x, y, z, i)z += ((w & (x ^ y)) ^ y) + blk0(i) + 0x5A827999 + rol(v, 5); w = rol(w, 30); -#define R1(v, w, x, y, z, i)z += ((w & (x ^ y)) ^ y) + blk(i) + 0x5A827999 + rol(v, 5); w = rol(w, 30); -#define R2(v, w, x, y, z, i)z += (w ^ x ^ y) + blk(i) + 0x6ED9EBA1 + rol(v, 5); w = rol(w, 30); -#define R3(v, w, x, y, z, i)z += (((w | x) & y) | (w & x)) + blk(i) + 0x8F1BBCDC + rol(v, 5); w = rol(w, 30); -#define R4(v, w, x, y, z, i)z += (w ^ x ^ y) + blk(i) + 0xCA62C1D6 + rol(v, 5); w = rol(w, 30); - -#endif /* SH1_H_ */ diff --git a/flashtool-mup/swinventory.cpp b/flashtool-mup/swinventory.cpp deleted file mode 100644 index 681cd2a..0000000 --- a/flashtool-mup/swinventory.cpp +++ /dev/null @@ -1,153 +0,0 @@ -#include - -#include "swinventory.h" - -SwInventory::SwInventory() -{ - // First set default values - /* - - - - - - - - */ - this->mHeader = (tSWInventory *) malloc(sizeof(tSWInventory)); - memcpy(this->mHeader->mMagicNumber, (uint8_t *) SW_MAGIC_VALUE, - sizeof(SW_MAGIC_VALUE) <= sizeof(this->mHeader->mMagicNumber) ? - sizeof(SW_MAGIC_VALUE) : sizeof(this->mHeader->mMagicNumber)); - this->mHeader->mHeaderVersion = 100; - this->mHeader->mImageOffset = 0x0; - this->mHeader->mImageSize = 0x0; - this->mHeader->mFlashOffset = 0x0; - this->mHeader->mSWVersion = 0; - this->mHeader->mImageNumber = 0; - this->mUnity = new SwUnity(); -} - -SwInventory::SwInventory(uint8_t *data, uint32_t offset, uint32_t datalen) -{ - mData = data; - mDataOffsetToBOF = offset; - mDataLength = datalen; -} - -int32_t SwInventory::parse() -{ - if (this->mDataLength >= sizeof(tSWInventory)) - { - this->mHeader = (tSWInventory *) this->mData; - this->mChildDataLength = this->mHeader->mImageSize; - this->mChildData = this->mData - this->mDataOffsetToBOF + this->mHeader->mImageOffset + SW_UPDATE_HEADER_SIZE /* jump over pack header */ + - MAX_INVENTORY_COUNT * SW_INVENTORY_SIZE /* plus end of all possible inventories */; - this->mUnity = new SwUnity(this->mChildData, this->mChildDataLength); - this->mUnity->parse(); - return sizeof(tSWInventory); - } - return 0; -} - -void SwInventory::print() -{ - char vHelpStr[256]; - printf("*******************************************************\n"); - printf("SWInventory:\n\n"); - strncpy(vHelpStr, (char *)this->mHeader->mMagicNumber, SW_UPDATE_MAGIC_SIZE); - vHelpStr[SW_UPDATE_MAGIC_SIZE] = '\0'; - printf("mMagicNumber = %s\n", vHelpStr); - printf("mHeaderVersion = %d\n", this->mHeader->mHeaderVersion); - printf("mImageOffset = 0x%08X (%d)\n", this->mHeader->mImageOffset, this->mHeader->mImageOffset); - printf("mImageSize = 0x%08X (%d)\n", this->mHeader->mImageSize, this->mHeader->mImageSize); - printf("mFlashOffset = 0x%08X (%d)\n", this->mHeader->mFlashOffset, this->mHeader->mFlashOffset); - printf("mSWVersion = %d\n", this->mHeader->mSWVersion); - printf("mImageNumber = %d\n", this->mHeader->mImageNumber); - this->mUnity->print(); -} - -void SwInventory::printXML(bool d) -{ - char vHelpStr[256]; - printf("\t\t\n"); - strncpy(vHelpStr, (char *)this->mHeader->mMagicNumber, SW_UPDATE_MAGIC_SIZE); - vHelpStr[SW_UPDATE_MAGIC_SIZE] = '\0'; - if (d) - { - printf("\t\t\t\n", vHelpStr); - printf("\t\t\t\n", this->mHeader->mHeaderVersion); - printf("\t\t\t\n", this->mHeader->mImageOffset); - printf("\t\t\t\n", this->mHeader->mImageSize); - printf("\t\t\t\n", this->mHeader->mFlashOffset); - printf("\t\t\t\n", this->mHeader->mSWVersion); - printf("\t\t\t\n", this->mHeader->mImageNumber); - } - this->mUnity->printXML(d); - printf("\t\t\n"); -} - -int32_t SwInventory::isValid() -{ - if (strncmp((char *)this->mHeader->mMagicNumber, (char *)SW_MAGIC_VALUE, SW_UPDATE_MAGIC_SIZE) != 0) - { - return 0; - } - if (this->mHeader->mHeaderVersion != SW_UPDATER_VERSION) - { - return 0; - } - return 1; -} - -bool SwInventory::verify() -{ - return this->mUnity->verify(); -} - -void SwInventory::extract() -{ - this->mUnity->extract(); -} - -void SwInventory::setPartition(uint32_t flashOffset, char *filename, uint8_t *data, uint32_t dataLength, uint32_t imageOffset) -{ - this->mHeader->mFlashOffset = flashOffset; - this->mHeader->mImageOffset = imageOffset; - this->mHeader->mImageSize = dataLength + SW_UPDATE_HEADER_SIZE; - this->mUnity->setPartition(flashOffset, filename, data, dataLength); - this->mDataLength = sizeof(tSWInventory); - this->mData = (uint8_t *) malloc(sizeof(tSWInventory)); - memcpy(this->mData, this->mHeader, sizeof(tSWInventory)); - this->mChildData = (uint8_t *)malloc(this->mUnity->getData(NULL)); - this->mChildDataLength = this->mUnity->getData(&this->mChildData); - if (this->mChildDataLength % 0x200 != 0) - { - this->mChildDataLength += (0x200 - (this->mChildDataLength % 0x200)); - this->mHeader->mImageSize = this->mChildDataLength; - memcpy(this->mData, this->mHeader, sizeof(tSWInventory)); - } -} - -uint32_t SwInventory::getChildData(uint8_t **data) -{ - if (data != NULL) - { - memcpy(*data, this->mChildData, this->mChildDataLength); - } - return this->mChildDataLength; -} - -uint32_t SwInventory::getData(uint8_t **data) -{ - if (data != NULL) - { - memcpy(*data, this->mData, this->mDataLength); - } - return this->mDataLength; -} - -uint32_t SwInventory::getImageOffset() -{ - return this->mHeader->mImageOffset; -} - diff --git a/flashtool-mup/swinventory.h b/flashtool-mup/swinventory.h deleted file mode 100644 index 9ab6194..0000000 --- a/flashtool-mup/swinventory.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef SWINVENTORY_H_ -#define SWINVENTORY_H_ - -#include -#include -#include -#include -#include -#include -#include -//#include /* sha1 / crc32 */ -#include - -#include "misc.h" -#include "swunity.h" - -class SwInventory -{ - public: - SwInventory(); - SwInventory(uint8_t *data, uint32_t offset, uint32_t datalen); - void print(); - void printXML(bool d); - int32_t parse(); - int32_t isValid(); - - bool verify(); - void extract(); - - void setProductCode(unsigned int code) - { - this->mUnity->setProductCode(code); - } - - void setPartition(unsigned int flashOffset, char *filename, uint8_t *data, uint32_t dataLength, uint32_t imageOffset); - uint32_t getData(unsigned char **data); - uint32_t getChildData(unsigned char **data); - - uint32_t getImageOffset(); - private: - typedef struct sSWInventory - { - uint8_t mMagicNumber[SW_UPDATE_MAGIC_SIZE]; - uint32_t mHeaderVersion; - uint32_t mImageOffset; - uint32_t mImageSize;//200h greater than datalength in unity - uint32_t mFlashOffset;//same as in unity - uint32_t mSWVersion; - uint32_t mImageNumber; - } tSWInventory; - - tSWInventory *mHeader; - - uint32_t mDataOffsetToBOF; - uint32_t mDataLength; - uint8_t *mData; - - uint32_t mChildDataLength; - uint8_t *mChildData; - - SwUnity *mUnity; -}; - -#endif diff --git a/flashtool-mup/swpack.cpp b/flashtool-mup/swpack.cpp deleted file mode 100644 index b8db9db..0000000 --- a/flashtool-mup/swpack.cpp +++ /dev/null @@ -1,190 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -//#include /* sha1 / crc32 */ -#include -#include "misc.h" -#include "swpack.h" - -SwPack::SwPack() -{ - // First set default values - /* - - - - - - */ - this->mHeader = (tSWPack *) malloc(sizeof(tSWPack)); - memcpy(this->mHeader->mMagicNumber, (uint8_t *) SW_MAGIC_VALUE, - sizeof(SW_MAGIC_VALUE) <= sizeof(this->mHeader->mMagicNumber) ? - sizeof(SW_MAGIC_VALUE) : sizeof(this->mHeader->mMagicNumber)); - this->mHeader->mHeaderVersion = 100; - //this->mHeader->mProductCode = 0x11301003; // Kathrein, DVB-S2, simple, Ufs-912 - this->mHeader->mProductCode = 0x11321000; // Kathrein, DVB-S2, Twin-Pvr, Ufs-922 - this->mHeader->mSWVersion = 101; //uboot says that this should be 102 for 922, but it seems that this is not used anyway - this->mHeader->mDate = time(NULL); - this->mHeader->mInventoryCount = 0; - this->mHeader->mInvalidateFlag = 0; - memcpy(this->mHeader->mUpdateInfo, (uint8_t *) "Software Update", - sizeof("Software Update") <= sizeof(this->mHeader->mUpdateInfo) ? - sizeof("Software Update") : sizeof(this->mHeader->mUpdateInfo)); - mCurInventoryOffset = 0; -} - -SwPack::SwPack(uint8_t *data, uint32_t datalen) -{ - mData = data; - mDataLength = datalen; -} - -void SwPack::parse() -{ - this->mHeader = (tSWPack *) mData; - this->mChildDataOffset = SW_UPDATE_HEADER_SIZE /*sizeof(tSWPack)*/; - this->mChildDataLength = this->mDataLength - this->mChildDataOffset; - this->mChildData = mData + this->mChildDataOffset; - this->mInventoryCount = 0; - int32_t offsetNextEntry = 0; - /* until mInventoryCount seems to be not used loop over all inventories */ - while (this->mInventoryCount < MAX_INVENTORY_COUNT) - { - this->mInventory[this->mInventoryCount] = new SwInventory(mChildData + offsetNextEntry, mChildDataOffset + offsetNextEntry, mChildDataLength - offsetNextEntry); - /*offsetNextEntry +=*/ this->mInventory[this->mInventoryCount]->parse(); - offsetNextEntry += SW_INVENTORY_SIZE; - if (!this->mInventory[this->mInventoryCount]->isValid()) - { - delete (this->mInventory[this->mInventoryCount]); - break; - } - this->mInventoryCount++; - } -} - -void SwPack::print() -{ - char vHelpStr[256]; - strncpy(vHelpStr, (char *)this->mHeader->mMagicNumber, SW_UPDATE_MAGIC_SIZE); - vHelpStr[SW_UPDATE_MAGIC_SIZE] = '\0'; - if (verbose) - { - printf("*******************************************************\n"); - printf("SWPack:\n\n"); - printf("mMagicNumber = %s\n", vHelpStr); - printf("mHeaderVersion = %d\n", this->mHeader->mHeaderVersion); - printf("mProductCode = 0x%08X\n", this->mHeader->mProductCode); - printf("mSWVersion = %d\n", this->mHeader->mSWVersion); - printf("mDate = %d\n", (int)this->mHeader->mDate); - printf("mInventoryCount = %d\n", this->mHeader->mInventoryCount); - printf("mInvalidateFlag = %d\n", this->mHeader->mInvalidateFlag); - } - strncpy(vHelpStr, this->mHeader->mUpdateInfo, SW_UPDATE_INFO_LENGTH); - vHelpStr[SW_UPDATE_INFO_LENGTH] = '\0'; - if (verbose) - { - printf("mUpdateInfo = %s\n", vHelpStr); - } - for (uint32_t i = 0; i < this->mInventoryCount; i++) - { - this->mInventory[i]->print(); - } -} - -void SwPack::printXML(bool d) -{ - char vHelpStr[256]; - if (verbose) - { - printf("\t\n"); - strncpy(vHelpStr, (char *)this->mHeader->mMagicNumber, SW_UPDATE_MAGIC_SIZE); - vHelpStr[SW_UPDATE_MAGIC_SIZE] = '\0'; - if (d) - { - printf("\t\t\n", vHelpStr); - } - printf("\t\t\n", this->mHeader->mHeaderVersion); - printf("\t\t\n", this->mHeader->mProductCode); - printf("\t\t\n", this->mHeader->mSWVersion); - printf("\t\t\n", (int)this->mHeader->mDate, strTime(this->mHeader->mDate)); - if (d) - { - printf("\t\t\n", this->mHeader->mInventoryCount); - printf("\t\t\n", this->mHeader->mInvalidateFlag); - } - strncpy(vHelpStr, this->mHeader->mUpdateInfo, SW_UPDATE_INFO_LENGTH); - vHelpStr[SW_UPDATE_INFO_LENGTH] = '\0'; - printf("\t\t\n", vHelpStr); - for (uint32_t i = 0; i < this->mInventoryCount; i++) - { - this->mInventory[i]->printXML(d); - } - printf("\t\n"); - } -} - -bool SwPack::verify() -{ - bool rtv = true; - for (uint32_t i = 0; i < this->mInventoryCount; i++) - { - if (!this->mInventory[i]->verify()) - { - rtv = false; - } - } - return rtv; -} - -void SwPack::extract() -{ - for (uint32_t i = 0; i < this->mInventoryCount; i++) - { - this->mInventory[i]->extract(); - } - return; -} - -void SwPack::appendPartition(uint32_t flashOffset, char *filename, uint8_t *data, uint32_t dataLength) -{ - this->mInventory[this->mInventoryCount] = new SwInventory(); - this->mInventory[this->mInventoryCount]->setProductCode(this->mHeader->mProductCode); - this->mInventory[this->mInventoryCount]->setPartition(flashOffset, filename, data, dataLength, mCurInventoryOffset); - mCurInventoryOffset += this->mInventory[this->mInventoryCount]->getChildData(NULL); - this->mInventoryCount++; -} - -int32_t SwPack::createImage(uint8_t **data) -{ - /*int */mDataLength = SW_UPDATE_HEADER_SIZE + MAX_INVENTORY_COUNT * SW_INVENTORY_SIZE; - for (uint32_t i = 0; i < this->mInventoryCount; i++) - { - mDataLength += this->mInventory[i]->getChildData(NULL); - } - if (verbose) - { - printf("TOTAL SIZE: %u\n", mDataLength); - } - mData = (uint8_t *)malloc(mDataLength); - memcpy(mData, mHeader, sizeof(tSWPack)); - for (uint32_t i = 0; i < this->mInventoryCount; i++) - { - int32_t cDataLenght = this->mInventory[i]->getData(NULL); - uint8_t *cData = (uint8_t *)malloc(cDataLenght); - this->mInventory[i]->getData(&cData); - memcpy(mData + SW_UPDATE_HEADER_SIZE + i * SW_INVENTORY_SIZE, cData, cDataLenght); - free(cData); - cDataLenght = this->mInventory[i]->getChildData(NULL); - cData = (uint8_t *)malloc(cDataLenght); - this->mInventory[i]->getChildData(&cData); - memcpy(mData + this->mInventory[i]->getImageOffset() + SW_UPDATE_HEADER_SIZE + MAX_INVENTORY_COUNT * SW_INVENTORY_SIZE, cData, cDataLenght); - free(cData); - } - *data = (uint8_t *)malloc(this->mDataLength); - memcpy(*data, this->mData, this->mDataLength); - return mDataLength; -} diff --git a/flashtool-mup/swpack.h b/flashtool-mup/swpack.h deleted file mode 100644 index d18dec5..0000000 --- a/flashtool-mup/swpack.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef SWPACK_H_ -#define SWPACK_H_ - -#include -#include "swinventory.h" - -class SwPack -{ - public: - SwPack(); - SwPack(uint8_t *data, uint32_t datalen); - void print(); - void printXML(bool d); - void parse(); - void parseXML(); - - bool verify(); - void extract(); - - void setProductCode(uint32_t code) - { - this->mHeader->mProductCode = code; - } - - void appendPartition(uint32_t flashOffset, char *filename, uint8_t *data, uint32_t dataLength); - int32_t createImage(uint8_t **data); - - private: - typedef struct sSWPack - { - uint8_t mMagicNumber[SW_UPDATE_MAGIC_SIZE]; - uint32_t mHeaderVersion; - uint32_t mProductCode; - uint32_t mSWVersion; - uint32_t mDate; /*time_t*/ - uint32_t mInventoryCount; /* not used ->loop over MAX_INVENTORY_COUNT */ - uint32_t mInvalidateFlag; - char mUpdateInfo[SW_UPDATE_INFO_LENGTH]; - } tSWPack; - - tSWPack *mHeader; - uint32_t mDataLength; - uint8_t *mData; - char *mXML; - - uint32_t mChildDataOffset; - uint32_t mChildDataLength; - uint8_t *mChildData; - - uint32_t mInventoryCount; - SwInventory *mInventory[MAX_INVENTORY_COUNT]; - - private: - uint32_t mCurInventoryOffset; -}; - -#endif diff --git a/flashtool-mup/swunity.cpp b/flashtool-mup/swunity.cpp deleted file mode 100644 index f48a779..0000000 --- a/flashtool-mup/swunity.cpp +++ /dev/null @@ -1,322 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#if GCRY -#include /* sha1 / crc32 */ -#endif -#include - -#include "crc32.h" -#include "sh1.h" -#include "misc.h" -#include "swunity.h" - -SwUnity::SwUnity() -{ - // First set default values - /* - - - - - - - - - - - - */ - this->mHeader = (tSWUnity *) malloc(sizeof(tSWUnity)); - memcpy(this->mHeader->mMagicNumber, (uint8_t *) SW_MAGIC_VALUE, - sizeof(SW_MAGIC_VALUE) <= sizeof(this->mHeader->mMagicNumber) ? - sizeof(SW_MAGIC_VALUE) : sizeof(this->mHeader->mMagicNumber)); - this->mHeader->mHeaderVersion = 100; - //this->mHeader->mProductCode = 0x11301003; // Kathrein, DVB-S2, simple, Ufs-912 - this->mHeader->mProductCode = 0x11321000; // Kathrein, DVB-S2, Twin-Pvr, Ufs-922 - this->mHeader->mSWVersion = 101; //uboot says that this should be 102 für 922, but it seems that this is not used anyway - this->mHeader->mDate = time(NULL); - this->mHeader->mFlashOffset = 0; - this->mHeader->mDataLength = 0; - memcpy(this->mHeader->mUpdateInfo, (uint8_t *) "Software Update", - sizeof("Software Update") <= sizeof(this->mHeader->mUpdateInfo) ? - sizeof("Software Update") : sizeof(this->mHeader->mUpdateInfo)); -} - -SwUnity::SwUnity(uint8_t *data, uint32_t datalen) -{ - mData = data; - mDataLength = datalen; -} - -int32_t SwUnity::parse() -{ - if (this->mDataLength >= sizeof(tSWUnity)) - { - this->mHeader = (tSWUnity *) this->mData; - this->mChildDataLength = this->mDataLength - SW_UPDATE_HEADER_SIZE; - if (this->mChildDataLength > this->mHeader->mDataLength) - { - //printf("Not equal !\n\t%d - %d\n", this->mChildDataLength, this->mHeader->mDataLength); - this->mChildDataLength = this->mHeader->mDataLength; - } - this->mChildData = this->mData + SW_UPDATE_HEADER_SIZE; - return sizeof(tSWUnity); - } - return 0; -} - -void SwUnity::print() -{ - char vHelpStr[256]; - printf("*******************************************************\n"); - printf("SWUnity:\n\n"); - strncpy(vHelpStr, (char *)this->mHeader->mMagicNumber, SW_UPDATE_MAGIC_SIZE); - vHelpStr[SW_UPDATE_MAGIC_SIZE] = '\0'; - printf("mMagicNumber = %s\n", vHelpStr); - printf("mHeaderVersion = %d\n", this->mHeader->mHeaderVersion); - printf("mProductCode = %d\n", this->mHeader->mProductCode); - printf("mSWVersion = %d\n", this->mHeader->mSWVersion); - printf("mDate = %d\n", (int)this->mHeader->mDate); - printf("mFlashOffset = 0x%08X (%d)\n", this->mHeader->mFlashOffset, this->mHeader->mFlashOffset); - printf("mDataLength = 0x%08X (%d)\n", this->mHeader->mDataLength, this->mHeader->mDataLength); - strncpy(vHelpStr, this->mHeader->mHashValue, 20); - vHelpStr[20] = '\0'; - printf("mHashValue =\n"); - for (int32_t i = 0; i < 20; i++) - { - printf("0x%02x ", vHelpStr[i] & 0xff); - if (((i + 1) % 10) == 0) - { - printf("\n"); - } - } - printf("mCRC = 0x%08X (%d)\n", this->mHeader->mCRC, this->mHeader->mCRC); - strncpy(vHelpStr, (char *)this->mHeader->mFileName, SW_UPDATE_FILENAME_LENGTH); - vHelpStr[SW_UPDATE_FILENAME_LENGTH] = '\0'; - printf("mFileName = %s\n", vHelpStr); - strncpy(vHelpStr, (char *)this->mHeader->mUpdateInfo, SW_UPDATE_INFO_LENGTH); - vHelpStr[SW_UPDATE_INFO_LENGTH] = '\0'; - printf("mUpdateInfo = %s\n", vHelpStr); -} - -void SwUnity::printXML(bool d) -{ - char vHelpStr[256]; - printf("\t\t\t\n"); - strncpy(vHelpStr, (char *)this->mHeader->mMagicNumber, SW_UPDATE_MAGIC_SIZE); - vHelpStr[SW_UPDATE_MAGIC_SIZE] = '\0'; - if (d) - { - printf("\t\t\t\t\n", vHelpStr); - printf("\t\t\t\t\n", this->mHeader->mHeaderVersion); - printf("\t\t\t\t\n", this->mHeader->mProductCode); - printf("\t\t\t\t\n", this->mHeader->mSWVersion); - printf("\t\t\t\t\n", (int)this->mHeader->mDate, strTime(this->mHeader->mDate)); - } - printf("\t\t\t\t\n", this->mHeader->mFlashOffset); - if (d) - { - printf("\t\t\t\t\n", this->mHeader->mDataLength); - } - strncpy(vHelpStr, this->mHeader->mHashValue, 20); - vHelpStr[20] = '\0'; - if (d) - { - printf("\t\t\t\t\n"); - printf("\t\t\t\t\n", this->mHeader->mCRC); - } - strncpy(vHelpStr, (char *)this->mHeader->mFileName, SW_UPDATE_FILENAME_LENGTH); - vHelpStr[SW_UPDATE_FILENAME_LENGTH] = '\0'; - printf("\t\t\t\t\n", vHelpStr); - strncpy(vHelpStr, (char *)this->mHeader->mUpdateInfo, SW_UPDATE_INFO_LENGTH); - vHelpStr[SW_UPDATE_INFO_LENGTH] = '\0'; - printf("\t\t\t\t\n", vHelpStr); -#if 0 - printf("\t\t\t\tmChildDataLength; i++) - { - printf("%02X", this->mChildData[i]); - } - printf("h\" />\n"); -#endif - printf("\t\t\t\n"); -} - -int32_t SwUnity::isValid() -{ - if (strncmp((char *)this->mHeader->mMagicNumber, (char *)SW_MAGIC_VALUE, SW_UPDATE_MAGIC_SIZE) != 0) - { - return 0; - } - if (this->mHeader->mHeaderVersion != SW_UPDATER_VERSION) - { - return 0; - } - return 1; -} - -void SwUnity::calcSH1(uint8_t **sh1_hash, uint32_t *sh1_hash_len) -{ -#if GCRY - /* let us see how int32_t is the hash key for SHA1 ... */ - *sh1_hash_len = gcry_md_get_algo_dlen(GCRY_MD_SHA1); - *sh1_hash = (uint8_t *)malloc((*sh1_hash_len) * sizeof(uint8_t)); - /* calculate the hash */ - gcry_md_hash_buffer(GCRY_MD_SHA1, *sh1_hash, this->mChildData, this->mChildDataLength); -#else - SHA1_CTX mContext; - *sh1_hash_len = 20; - *sh1_hash = (uint8_t *)malloc((*sh1_hash_len) * sizeof(uint8_t)); - SHA1Init(&mContext); - SHA1Update(&mContext, this->mChildData, this->mChildDataLength); - SHA1Final(*sh1_hash, &mContext); -#endif - return; -} - -uint32_t SwUnity::calcCRC32(uint8_t **crc32_hash, uint32_t *crc32_hash_len) -{ -#if GCRY - /* let us see how int32_t is the hash key for CRC32 ... */ - *crc32_hash_len = gcry_md_get_algo_dlen(GCRY_MD_CRC32); - *crc32_hash = (uint8_t *)malloc((*crc32_hash_len) * sizeof(uint8_t)); - /* calculate the hash */ - gcry_md_hash_buffer(GCRY_MD_CRC32, *crc32_hash, this->mChildData, this->mChildDataLength); -#endif - if (verbose) - { - printf("%d\n", this->mChildDataLength); - for (int32_t i = 0; i < 40 && i < this->mChildDataLength; i++) - { - printf("%02X ", this->mChildData[i]); - } - printf("\n"); - if (this->mChildDataLength >= 80) - { - for (int32_t i = 0; i < 40; i++) - { - printf("%02X ", this->mChildData[this->mChildDataLength - 41 + i]); - } - printf("\n"); - } - } - return crc32(this->mChildData, this->mChildDataLength); -} - -bool SwUnity::verify() -{ - bool crc32 = false; - bool sh1 = false; - uint8_t *sh1HashArray = NULL; - uint32_t sh1HashLength = 0; - calcSH1(&sh1HashArray, &sh1HashLength); - printf("SH1 ORG: "); - for (int32_t i = 0; i < 20; i++) - { - printf("%02X ", this->mHeader->mHashValue[i] & 0xff); - } - printf("\n"); - printf("SH1 CALC: "); - for (int32_t i = 0; i < 20; i++) - { - printf("%02X ", sh1HashArray[i] & 0xff); - } - printf("\n"); - if (memcmp(this->mHeader->mHashValue, sh1HashArray, sh1HashLength)) - { - sh1 = false; - } - else - { - sh1 = true; - } - uint8_t *crc32HashArray = NULL; - uint32_t crc32Hash = 0; - uint32_t crc32HashLength = 0; - crc32Hash = calcCRC32(&crc32HashArray, &crc32HashLength); - /*crc32Hash = crc32HashArray[0]; - crc32Hash += crc32HashArray[1]<<8; - crc32Hash += crc32HashArray[2]<<16; - crc32Hash += crc32HashArray[3]<<24;*/ - printf("CRC32 %08X - %08X\n", crc32Hash, this->mHeader->mCRC); - if (crc32Hash == this->mHeader->mCRC) - { - crc32 = true; - } - else - { - crc32 = false; - } - return crc32 && sh1; -} - -void SwUnity::extract() -{ - char vHelpStr[256]; - int32_t fd; - uint32_t i; - strncpy(vHelpStr, (char *)this->mHeader->mFileName, SW_UPDATE_FILENAME_LENGTH); - vHelpStr[SW_UPDATE_FILENAME_LENGTH] = '\0'; - for (int32_t i = 0; i < strlen(vHelpStr); i++) - { - if (vHelpStr[i] == '/' || vHelpStr[i] == '\\') - { - vHelpStr[i] = '_'; - } - } - fd = open(vHelpStr, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); - if (fd < 0) - { - printf("error opening %s\n", vHelpStr); - return; - } - i = write(fd, this->mChildData, this->mChildDataLength); - if (i != this->mChildDataLength) - { - printf("error reading data %d / %d\n", i, this->mChildDataLength); - } - close(fd); -} - -void SwUnity::setPartition(uint32_t flashOffset, char *filename, uint8_t *data, uint32_t dataLength) -{ - this->mHeader->mFlashOffset = flashOffset; - memcpy(this->mHeader->mFileName, filename, strlen(filename)); - this->mHeader->mFileName[strlen(filename)] = '\0'; - this->mHeader->mDataLength = dataLength; - this->mChildDataLength = dataLength; - this->mChildData = (uint8_t *)malloc(dataLength); - memcpy(this->mChildData, data, dataLength); - uint8_t *sh1HashArray = NULL; - uint32_t sh1HashLength = 0; - calcSH1(&sh1HashArray, &sh1HashLength); - for (int32_t i = 0; i < 20; i++) - { - this->mHeader->mHashValue[i] = sh1HashArray[i]; - } - uint32_t crc32HashLength = 0; - this->mHeader->mCRC = calcCRC32(NULL, &crc32HashLength); - this->mDataLength = this->mChildDataLength + SW_UPDATE_HEADER_SIZE; - this->mData = (uint8_t *) malloc(this->mDataLength); - memcpy(this->mData, this->mHeader, sizeof(tSWUnity)); - memcpy(this->mData + SW_UPDATE_HEADER_SIZE, this->mChildData, this->mChildDataLength); -} - -uint32_t SwUnity::getData(uint8_t **data) -{ - if (data != NULL) - { - memcpy(*data, this->mData, this->mDataLength); - } - return this->mDataLength; -} diff --git a/flashtool-mup/swunity.h b/flashtool-mup/swunity.h deleted file mode 100644 index 105c4bf..0000000 --- a/flashtool-mup/swunity.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef SWUNITY_H_ -#define SWUNITY_H_ - -#include -#include "misc.h" - -class SwUnity -{ - public: - SwUnity(); - SwUnity(uint8_t *data, uint32_t datalen); - void print(); - void printXML(bool d); - int parse(); - int isValid(); - - bool verify(); - void extract(); - - void setProductCode(uint32_t code) - { - this->mHeader->mProductCode = code; - } - - void setPartition(uint32_t flashOffset, char *filename, uint8_t *data, uint32_t dataLength); - uint32_t getData(uint8_t **data); - private: - void calcSH1(uint8_t **sh1_hash, uint32_t *sh1_hash_len); - uint32_t calcCRC32(uint8_t **crc32_hash, uint32_t *crc32_hash_len); - - private: - typedef struct sSWUnity - { - uint8_t mMagicNumber[SW_UPDATE_MAGIC_SIZE]; - uint32_t mHeaderVersion; - uint32_t mProductCode; - uint32_t mSWVersion; - uint32_t mDate; /*time_t*/ - uint32_t mFlashOffset; - uint32_t mDataLength; - - char mHashValue[20]; - uint32_t mCRC; - - uint8_t mFileName[SW_UPDATE_FILENAME_LENGTH]; - uint8_t mUpdateInfo[SW_UPDATE_INFO_LENGTH]; - } tSWUnity; - - // Parsed Unity Header - tSWUnity *mHeader; - - // Unity Header + Partition Data - uint32_t mDataLength; - uint8_t *mData; - - // Partition Data - uint32_t mChildDataLength; - uint8_t *mChildData; -}; - -#endif diff --git a/flashtool-pad/Makefile.am b/flashtool-pad/Makefile.am deleted file mode 100644 index d75ab4f..0000000 --- a/flashtool-pad/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -bin_PROGRAMS = pad - -pad_SOURCES = pad.c - -AM_CFLAGS = -Wall diff --git a/flashtool-pad/autogen.sh b/flashtool-pad/autogen.sh deleted file mode 100755 index b3f59a3..0000000 --- a/flashtool-pad/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-flashtool-pad" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/flashtool-pad/configure.ac b/flashtool-pad/configure.ac deleted file mode 100644 index 3e83692..0000000 --- a/flashtool-pad/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT([pad],[1.0],[],[pad]) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_OUTPUT([ -Makefile -]) diff --git a/flashtool-pad/pad.c b/flashtool-pad/pad.c deleted file mode 100644 index 8412f0b..0000000 --- a/flashtool-pad/pad.c +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************/ -/* Name : pad */ -/* */ -/* Author: Schischu */ -/* */ -/* Licence: This file is subject to the terms and conditions of the */ -/* GNU General Public License version 2. */ -/**************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include - -#define BUFSIZE 4096 - -int32_t main(int32_t argc, char *argv[]) -{ - int32_t padToSize = 0, readBytes = 0; - uint8_t buffer[BUFSIZE]; - FILE *input = fopen(argv[2], "rb"); - FILE *output = fopen(argv[3], "wb"); - sscanf(argv[1], "%x", &padToSize); - while ((readBytes = fread(buffer, 1, BUFSIZE, input)) > 0) - { - padToSize -= fwrite(buffer, 1, readBytes, output); - } - memset(buffer, 0xFF, BUFSIZE); - while (padToSize > 0) - { - padToSize -= fwrite(buffer, 1, padToSize > BUFSIZE ? BUFSIZE : padToSize, output); - } - return 0; -} diff --git a/flashtool_mup/Makefile.am b/flashtool_mup/Makefile.am deleted file mode 100644 index 3f9c674..0000000 --- a/flashtool_mup/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -sbin_PROGRAMS = mup - -mup_SOURCES = mup.cpp misc.cpp crc32.cpp sh1.cpp swinventory.cpp swpack.cpp swunity.cpp - -AM_CFLAGS = -Wall diff --git a/flashtool_mup/autogen.sh b/flashtool_mup/autogen.sh deleted file mode 100755 index 0dbeb3d..0000000 --- a/flashtool_mup/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools_flashtool_mup" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/flashtool_mup/configure.ac b/flashtool_mup/configure.ac deleted file mode 100644 index 11e0080..0000000 --- a/flashtool_mup/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT([mup],[1.4],[],[mup]) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_OUTPUT([ -Makefile -]) diff --git a/flashtool_mup/crc32.cpp b/flashtool_mup/crc32.cpp deleted file mode 100644 index bad79f3..0000000 --- a/flashtool_mup/crc32.cpp +++ /dev/null @@ -1,83 +0,0 @@ -#include -#include "crc32.h" - -/* taken from ufs922 uboot source */ - -uint32_t crc_table[256] = -{ - 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, - 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, - 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, - 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, - 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, - 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, - 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, - 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd, - 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, - 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, - 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, - 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, - 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, - 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, - 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, - 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, - 0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, - 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072, - 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, - 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, - 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, - 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, - 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066, - 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, - 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, - 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692, - 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, - 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, - 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, - 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, - 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, - 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a, - 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, - 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, - 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, - 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53, - 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, - 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b, - 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, - 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, - 0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, - 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b, - 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, - 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3, - 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, - 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, - 0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, - 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3, - 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, - 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, - 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, - 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, - 0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30, - 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, - 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, - 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654, - 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, - 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, - 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, - 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, - 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, - 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c, - 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, - 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4 -}; - -uint32_t crc32(uint8_t *data, uint32_t len) -{ - register uint32_t i; - uint32_t crc = 0xffffffff; - for (i = 0; i < len; i++) - { - crc = (crc << 8) ^ crc_table[((crc >> 24) ^ *data++) & 0xff]; - } - return crc; -} diff --git a/flashtool_mup/crc32.h b/flashtool_mup/crc32.h deleted file mode 100644 index 98fdc98..0000000 --- a/flashtool_mup/crc32.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * crc32.h - * - * Created on: Mar 6, 2010 - * Author: ubuntu - */ - -#ifndef CRC32_H_ -#define CRC32_H_ - -#include - -uint32_t crc32(uint8_t *data, uint32_t len); - -#endif /* CRC32_H_ */ diff --git a/flashtool_mup/misc.cpp b/flashtool_mup/misc.cpp deleted file mode 100644 index 1c222a9..0000000 --- a/flashtool_mup/misc.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include -#include -#include - -#include "misc.h" - -char *strTime(uint32_t /*time_t*/ now) -{ - struct tm *ts; - char buf[80]; - time_t tmp_now = (time_t)now; - ts = localtime(&tmp_now); - strftime(buf, sizeof(buf), "%a %Y-%m-%d %H:%M:%S %Z", ts); - return strdup(buf); -} - -void verboseprintf(const char *printstring) -{ - if (verbose) - { - printf("%s", printstring); - } -} diff --git a/flashtool_mup/misc.h b/flashtool_mup/misc.h deleted file mode 100644 index 42b56c5..0000000 --- a/flashtool_mup/misc.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef MISC_H_ -#define MISC_H_ - -#include -#include -#include - -#define SW_MAGIC_VALUE "MARUSWUP" - -enum -{ - SW_UPDATE_HEADER_SIZE = 512, - SW_UPDATE_CRYPTO_SIZE = 256, - SW_UPDATE_MAGIC_SIZE = 8, - SW_UPDATE_INFO_LENGTH = 128, - SW_UPDATE_FILENAME_LENGTH = 32, - - SW_INVENTORY_SIZE = 64, - MAX_INVENTORY_COUNT = 8, - - SW_UPDATER_VERSION = 100, -}; - -char *strTime(uint32_t /*time_t*/ now); -void verboseprintf(const char *printstring); -extern bool verbose; - -#endif diff --git a/flashtool_mup/mup.cpp b/flashtool_mup/mup.cpp deleted file mode 100644 index 2260e87..0000000 --- a/flashtool_mup/mup.cpp +++ /dev/null @@ -1,442 +0,0 @@ -/**************************************************************************/ -/* Name : mup */ -/* */ -/* Author: Schischu */ -/* */ -/* Licence: This file is subject to the terms and conditions of the */ -/* GNU General Public License version 2. */ -/**************************************************************************/ - -#include -#include -#include -#include -#include -#include -//#include /* sha1 / crc32 */ -#include - -#include "swpack.h" - -#define MUP_VERSION "1.4" - -#define NOR_RAW 0 -#define NAND_RAW 1 -#define NAND_YAFFS2 2 -#define NAND_YAFFS2_ERASE 3 - -bool verbose = true; - -void clear(FILE *fp) -{ - char buf[255]; - while (fgets(buf, 255, fp) != NULL && feof(fp)) - { - /* puts (buf); */ - } -} - -int32_t main(int32_t argc, char *argv[]) -{ - FILE *file; - int32_t i, data_len; - uint8_t *buffer; - struct stat buf; - bool doInfo = false; - bool doVerify = false; - bool doXML = false; - bool doXMLDetail = false; - bool doExtract = false; - bool doCreate = false; - if (argc == 3 && strlen(argv[1]) == 1 && !strncmp(argv[1], "i", 1)) - { - doInfo = true; - } - else if (argc == 3 && strlen(argv[1]) == 1 && !strncmp(argv[1], "v", 1)) - { - doVerify = true; - } - else if (argc == 3 && strlen(argv[1]) == 1 && !strncmp(argv[1], "x", 1)) - { - doXML = true; - } - else if (argc == 3 && strlen(argv[1]) == 2 && !strncmp(argv[1], "xx", 2)) - { - doXMLDetail = true; - } - else if (argc == 3 && strlen(argv[1]) == 1 && !strncmp(argv[1], "e", 1)) - { - doExtract = true; - } - else if (argc == 3 && strlen(argv[1]) == 1 && !strncmp(argv[1], "c", 1)) - { - doCreate = true; - verbose = false; - } - else - { - printf("Version: %s %s\n", argv[0], MUP_VERSION); - printf("Usage:\n"); - printf("For image information:\n"); - printf(" %s i FILENAME Info as TXT\n", argv[0]); - printf(" %s x FILENAME Info as XML (basic)\n", argv[0]); - printf(" %s xx FILENAME Info as XML (detailed)\n", argv[0]); - printf("For image verification:\n"); - printf(" %s v FILENAME \n", argv[0]); - printf("For image extraction:\n"); - printf(" %s e FILENAME \n", argv[0]); - printf("For image generation:\n"); - printf(" %s c FILENAME \n", argv[0]); - exit(10); - } - if (doInfo || doVerify || doXML || doXMLDetail || doExtract) - { - ////////////////////////////////// - if (stat(argv[2], &buf) < 0) - { - fprintf(stderr, "Cannot open(stat) %s", argv[2]); - return -2; - } - data_len = buf.st_size; - file = fopen(argv[2], "r"); - if (file == NULL) - { - fprintf(stderr, "Unable to open %s\n", argv[1]); - return -3; - } - buffer = (uint8_t *) malloc(data_len); - if (buffer == NULL) - { - fprintf(stderr, "Unable to get memory %d\n", data_len); - return -4; - } - i = fread(buffer, 1, data_len, file); - ////////////////////////////////// - SwPack *swpack = new SwPack(buffer, i); - swpack->parse(); - if (doInfo) - { - swpack->print(); - } - else if (doVerify) - { - if (swpack->verify()) - { - printf("Image is correct\n"); - } - else - { - printf("Image is NOT correct\n"); - } - } - else if (doXML || doXMLDetail) - { - printf("\n"); - swpack->printXML(doXMLDetail); - printf("\n"); - } - else if (doExtract) - { - swpack->extract(); - } - /* act of solidarity ;) */ - free(buffer); - fclose(file); - } - else if (doCreate) - { - ////////////////////////////////// - /* - - create list of partitions - - create swpack - - swpack set boxtype - - swpack append partition (address, filename) - - swpack create update image - */ - char outputName[1024]; - strcpy(outputName, argv[2]); - uint32_t inputBufferLength = 255; - char inputBuffer[inputBufferLength + 1]; - char partitionName[inputBufferLength + 1]; - int32_t productCode = 0; - int32_t flashOffset = -1; - int32_t nand = 0; - int32_t blockSize = 0; - SwPack *swpack = new SwPack(); - verboseprintf("Select ProductCode\n"); - verboseprintf("1: 0x11321000 - Kathrein UFS-922\n"); - verboseprintf("2: 0x11301003 - Kathrein UFS-912\n"); - verboseprintf("3: 0x11301006 - Kathrein UFS-913\n"); - verboseprintf(":> "); - scanf("%d", &productCode); - switch (productCode) - { - case 1: - { - productCode = 0x11321000; - break; - } - case 3: - { - productCode = 0x11321006; - break; - } - case 2: - default: - { - productCode = 0x11301003; - break; - } - } - swpack->setProductCode(productCode); - verboseprintf("Enter partitions. \"FLASHOFFSET, BLOCKSIZE, NAND, FILENAME;\"\n"); - verboseprintf("Finish list with \";\"\n"); - verboseprintf("Example: \n"); - verboseprintf("\t0x004E0000, 0x0, 0, 922.cramfs\n"); - verboseprintf("\t0x00040000, 0x0, 0, uImage.922.105\n"); - verboseprintf("\t0x002A0000, 0x0, 0, root.922.105.cramfs\n"); - verboseprintf(";\n"); - fflush(stdin); - clear(stdin); - while (1) - { - verboseprintf(":> "); - flashOffset = -1; - scanf("0x%X, ", &flashOffset); - if (flashOffset == -1) - { - verboseprintf("\n flashOffset missing\n"); - break; - } - blockSize = -1; - scanf("0x%X, ", &blockSize); - if (blockSize == -1) - { - verboseprintf("\n blockSize missing\n"); - break; - } - scanf("%d, ", &nand); - if (nand != NOR_RAW && nand != NAND_RAW && nand != NAND_YAFFS2 && nand != NAND_YAFFS2_ERASE) - { - verboseprintf("\n nand missing\n"); - break; - } - scanf("%s", inputBuffer); - if (verbose) - { - printf("\tflashOffset: %d, blockSize: %d, inputBuffer: %s\n", flashOffset, blockSize, inputBuffer); - } - fflush(stdin); - clear(stdin); - if (!strcmp(inputBuffer, "foo")) - { - data_len = 8; - buffer = (uint8_t *) malloc(8); - buffer[0] = 0xFF; - buffer[1] = 0xFF; - buffer[2] = 0xFF; - buffer[3] = 0xFF; - buffer[4] = 0xFF; - buffer[5] = 0xFF; - buffer[6] = 0xFF; - buffer[7] = 0xFF; - i = 8; - } - else - { - stat(inputBuffer, &buf); - data_len = buf.st_size; - file = fopen(inputBuffer, "r"); - if (file == NULL) - { - fprintf(stderr, "Unable to open %s\n", inputBuffer); - return -3; - } - buffer = (uint8_t *) malloc(data_len); - if (buffer == NULL) - { - fprintf(stderr, "Unable to get mem %d\n", data_len); - return -4; - } - i = fread(buffer, 1, data_len, file); - fclose(file); - } - if (nand == NAND_RAW) - { - if (productCode == 0x11321006) - { - sprintf(partitionName, "/2/3/"); // NAND RAW - } - else - { - sprintf(partitionName, "/2/O3/"); // NAND RAW - } - strcat(partitionName, inputBuffer); - } - else if (nand == NAND_YAFFS2) - { - if (blockSize == 0) - { - blockSize = data_len; - if (blockSize % (1 << 16) != 0) - { - blockSize = (blockSize >> 16) + 1; - } - else - { - blockSize = blockSize >> 16; - } - } - else - { - blockSize = blockSize >> 16; - } - if (verbose) - { - printf("BS: %d\n", blockSize); - } - if (productCode == 0x11321006) - { - sprintf(partitionName, "/%X/5/", blockSize); // NAND YAFFS2 - } - else - { - sprintf(partitionName, "/%X/O5/", blockSize); // NAND YAFFS2 - } - strcat(partitionName, inputBuffer); - } - else if (nand == NAND_YAFFS2_ERASE) - { - if (blockSize == 0) - { - blockSize = data_len; - if (blockSize % (1 << 16) != 0) - { - blockSize = (blockSize >> 16) + 1; - } - else - { - blockSize = blockSize >> 16; - } - } - else - { - blockSize = blockSize >> 16; - } - if (verbose) - { - printf("BS: %d\n", blockSize); - } - sprintf(partitionName, "/%X/E5/", blockSize); // NAND YAFFS2 - strcat(partitionName, inputBuffer); - } - else - { - strcpy(partitionName, inputBuffer); // NOR RAW - } - swpack->appendPartition(flashOffset, partitionName, (uint8_t *)buffer, i); - free(buffer); - } - swpack->printXML(true); - data_len = swpack->createImage(&buffer); - file = fopen(outputName, "wb"); - if (file == NULL) - { - fprintf(stderr, "Unable to open %s\n", outputName); - return -3; - } - if (buffer == NULL) - { - fprintf(stderr, "Unable to get memory %d\n", data_len); - return -4; - } - i = fwrite(buffer, 1, data_len, file); - fclose(file); -#if 0 - SwPack *swpack = new SwPack(); - swpack->setProductCode(0x11321000); - char *part1 = strdup("922.cramfs"); - char *part2 = strdup("uImage.922.105"); - char *part3 = strdup("root.922.105.cramfs"); - ////////////// - stat(part1, &buf); - data_len = buf.st_size; - file = fopen(part1, "r"); - if (file == NULL) - { - fprintf(stderr, "Unable to open %s\n", part1); - return -3; - } - buffer = (uint8_t *) malloc(data_len); - if (buffer == NULL) - { - fprintf(stderr, "Unable to get memory %d\n", data_len); - return -4; - } - i = fread(buffer, 1, data_len, file); - fclose(file); - swpack->appendPartition(0x004E0000, part1, (uint8_t *)buffer, i); - free(buffer); - ////////////// - stat(part2, &buf); - data_len = buf.st_size; - file = fopen(part2, "r"); - if (file == NULL) - { - fprintf(stderr, "Unable to open %s\n", part2); - return -3; - } - buffer = (uint8_t *) malloc(data_len); - if (buffer == NULL) - { - fprintf(stderr, "Unable to get memory %d\n", data_len); - return -4; - } - i = fread(buffer, 1, data_len, file); - fclose(file); - swpack->appendPartition(0x00040000, part2, (uint8_t *)buffer, i); - free(buffer); - ////////////// - stat(part3, &buf); - data_len = buf.st_size; - file = fopen(part3, "r"); - if (file == NULL) - { - fprintf(stderr, "Unable to open %s\n", part3); - return -3; - } - buffer = (uint8_t *) malloc(data_len); - if (buffer == NULL) - { - fprintf(stderr, "Unable to get memory %d\n", data_len); - return -4; - } - i = fread(buffer, 1, data_len, file); - fclose(file); - swpack->appendPartition(0x002A0000, part3, (uint8_t *)buffer, i); - free(buffer); - ///////////// - swpack->printXML(true); - data_len = swpack->createImage(&buffer); - file = fopen("update.img", "wb"); - if (file == NULL) - { - fprintf(stderr, "Unable to open %s\n", part1); - return -3; - } - if (buffer == NULL) - { - fprintf(stderr, "Unable to get memory %d\n", data_len); - return -4; - } - for (int32_t j = 0; j < 20; j++) - { - printf("%02X ", *(buffer + j)); - } - printf("\n"); - i = fwrite(buffer, 1, data_len, file); - fclose(file); -#endif - } - return 0; -} diff --git a/flashtool_mup/sh1.cpp b/flashtool_mup/sh1.cpp deleted file mode 100644 index 4b6da2c..0000000 --- a/flashtool_mup/sh1.cpp +++ /dev/null @@ -1,194 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#include "sh1.h" - -/* Hash a single 512-bit block. This is the core of the algorithm. */ - -void SHA1Transform(uint32_t state[5], uint8_t buffer[64]) -{ - uint32_t a, b, c, d, e; - typedef union - { - uint8_t c[64]; - uint32_t l[16]; - } CHAR64LONG16; - CHAR64LONG16 *block; -#ifdef SHA1HANDSOFF - static uint8_t workspace[64]; - block = (CHAR64LONG16 *)workspace; - memcpy(block, buffer, 64); -#else - block = (CHAR64LONG16 *)buffer; -#endif - /* Copy context->state[] to working vars */ - a = state[0]; - b = state[1]; - c = state[2]; - d = state[3]; - e = state[4]; - /* 4 rounds of 20 operations each. Loop unrolled. */ - R0(a, b, c, d, e, 0); - R0(e, a, b, c, d, 1); - R0(d, e, a, b, c, 2); - R0(c, d, e, a, b, 3); - R0(b, c, d, e, a, 4); - R0(a, b, c, d, e, 5); - R0(e, a, b, c, d, 6); - R0(d, e, a, b, c, 7); - R0(c, d, e, a, b, 8); - R0(b, c, d, e, a, 9); - R0(a, b, c, d, e, 10); - R0(e, a, b, c, d, 11); - R0(d, e, a, b, c, 12); - R0(c, d, e, a, b, 13); - R0(b, c, d, e, a, 14); - R0(a, b, c, d, e, 15); - R1(e, a, b, c, d, 16); - R1(d, e, a, b, c, 17); - R1(c, d, e, a, b, 18); - R1(b, c, d, e, a, 19); - R2(a, b, c, d, e, 20); - R2(e, a, b, c, d, 21); - R2(d, e, a, b, c, 22); - R2(c, d, e, a, b, 23); - R2(b, c, d, e, a, 24); - R2(a, b, c, d, e, 25); - R2(e, a, b, c, d, 26); - R2(d, e, a, b, c, 27); - R2(c, d, e, a, b, 28); - R2(b, c, d, e, a, 29); - R2(a, b, c, d, e, 30); - R2(e, a, b, c, d, 31); - R2(d, e, a, b, c, 32); - R2(c, d, e, a, b, 33); - R2(b, c, d, e, a, 34); - R2(a, b, c, d, e, 35); - R2(e, a, b, c, d, 36); - R2(d, e, a, b, c, 37); - R2(c, d, e, a, b, 38); - R2(b, c, d, e, a, 39); - R3(a, b, c, d, e, 40); - R3(e, a, b, c, d, 41); - R3(d, e, a, b, c, 42); - R3(c, d, e, a, b, 43); - R3(b, c, d, e, a, 44); - R3(a, b, c, d, e, 45); - R3(e, a, b, c, d, 46); - R3(d, e, a, b, c, 47); - R3(c, d, e, a, b, 48); - R3(b, c, d, e, a, 49); - R3(a, b, c, d, e, 50); - R3(e, a, b, c, d, 51); - R3(d, e, a, b, c, 52); - R3(c, d, e, a, b, 53); - R3(b, c, d, e, a, 54); - R3(a, b, c, d, e, 55); - R3(e, a, b, c, d, 56); - R3(d, e, a, b, c, 57); - R3(c, d, e, a, b, 58); - R3(b, c, d, e, a, 59); - R4(a, b, c, d, e, 60); - R4(e, a, b, c, d, 61); - R4(d, e, a, b, c, 62); - R4(c, d, e, a, b, 63); - R4(b, c, d, e, a, 64); - R4(a, b, c, d, e, 65); - R4(e, a, b, c, d, 66); - R4(d, e, a, b, c, 67); - R4(c, d, e, a, b, 68); - R4(b, c, d, e, a, 69); - R4(a, b, c, d, e, 70); - R4(e, a, b, c, d, 71); - R4(d, e, a, b, c, 72); - R4(c, d, e, a, b, 73); - R4(b, c, d, e, a, 74); - R4(a, b, c, d, e, 75); - R4(e, a, b, c, d, 76); - R4(d, e, a, b, c, 77); - R4(c, d, e, a, b, 78); - R4(b, c, d, e, a, 79); - /* Add the working vars back into context.state[] */ - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - state[4] += e; - /* Wipe variables */ - a = b = c = d = e = 0; -} - -/* SHA1Init - Initialize new context */ -void SHA1Init(SHA1_CTX *context) -{ - /* SHA1 initialization constants */ - context->state[0] = 0x67452301; - context->state[1] = 0xEFCDAB89; - context->state[2] = 0x98BADCFE; - context->state[3] = 0x10325476; - context->state[4] = 0xC3D2E1F0; - context->count[0] = context->count[1] = 0; -} - -/* Run your data through this. */ -void SHA1Update(SHA1_CTX *context, uint8_t *data, uint32_t len) -{ - uint32_t i, j; - j = (context->count[0] >> 3) & 63; - if ((context->count[0] += len << 3) < (len << 3)) - { - context->count[1]++; - } - context->count[1] += (len >> 29); - if ((j + len) > 63) - { - memcpy(&context->buffer[j], data, (i = 64 - j)); - SHA1Transform(context->state, context->buffer); - for (; i + 63 < len; i += 64) - { - SHA1Transform(context->state, &data[i]); - } - j = 0; - } - else - { - i = 0; - } - memcpy(&context->buffer[j], &data[i], len - i); -} - -/* Add padding and return the message digest. */ -void SHA1Final(uint8_t digest[20], SHA1_CTX *context) -{ - uint32_t i, j; - uint8_t finalcount[8]; - for (i = 0; i < 8; i++) - { - finalcount[i] = (uint8_t)((context->count[(i >= 4 ? 0 : 1)] >> ((3 - (i & 3)) * 8)) & 255); /* Endian independent */ - } - SHA1Update(context, (uint8_t *)"\200", 1); - while ((context->count[0] & 504) != 448) - { - SHA1Update(context, (uint8_t *)"\0", 1); - } - SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */ - for (i = 0; i < 20; i++) - { - digest[i] = (uint8_t)((context->state[i >> 2] >> ((3 - (i & 3)) * 8)) & 255); - } - /* Wipe variables */ - i = j = 0; - memset(context->buffer, 0, 64); - memset(context->state, 0, 20); - memset(context->count, 0, 8); - memset(&finalcount, 0, 8); -#ifdef SHA1HANDSOFF /* make SHA1Transform overwrite it's own static vars */ - SHA1Transform(context->state, context->buffer); -#endif -} diff --git a/flashtool_mup/sh1.h b/flashtool_mup/sh1.h deleted file mode 100644 index 57a3c75..0000000 --- a/flashtool_mup/sh1.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef SH1_H_ -#define SH1_H_ - -#include - -typedef struct -{ - uint32_t state[5]; - uint32_t count[2]; - uint8_t buffer[64]; -} SHA1_CTX; - -/* -SHA-1 in C -By Steve Reid -100% Public Domain - -Test Vectors (from FIPS PUB 180-1) -"abc" - A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D - "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" - 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 -A million repetitions of "a" - 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F -*/ - -/* #define LITTLE_ENDIAN * This should be #define'd if true. */ -/* #define SHA1HANDSOFF * Copies data before messing with it. */ - -#if BYTE_ORDER == BIG_ENDIAN -#else -#undef LITTLE_ENDIAN -#endif - -#define SHA1HANDSOFF - -//by doliyu -//#include "GlobalConfig.h" -//#include "SHA1.h" - -void SHA1Transform(uint32_t state[5], uint8_t buffer[64]); -void SHA1Init(SHA1_CTX *context); -void SHA1Update(SHA1_CTX *context, uint8_t *data, uint32_t len); -void SHA1Final(uint8_t digest[20], SHA1_CTX *context); - -#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) - -/* blk0() and blk() perform the initial expand. */ -/* I got the idea of expanding during the round function from SSLeay */ -#ifdef LITTLE_ENDIAN -#define blk0(i) (block->l[i] = (rol(block->l[i], 24) & 0xFF00FF00) | (rol(block->l[i], 8) & 0x00FF00FF)) -#else -#define blk0(i) block->l[i] -#endif -#define blk(i) (block->l[i&15] = rol(block->l[(i + 13) & 15] ^ block->l[(i + 8) & 15] ^ block->l[(i + 2) & 15] ^ block->l[i & 15], 1)) - -/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ -#define R0(v, w, x, y, z, i)z += ((w & (x ^ y)) ^ y) + blk0(i) + 0x5A827999 + rol(v, 5); w = rol(w, 30); -#define R1(v, w, x, y, z, i)z += ((w & (x ^ y)) ^ y) + blk(i) + 0x5A827999 + rol(v, 5); w = rol(w, 30); -#define R2(v, w, x, y, z, i)z += (w ^ x ^ y) + blk(i) + 0x6ED9EBA1 + rol(v, 5); w = rol(w, 30); -#define R3(v, w, x, y, z, i)z += (((w | x) & y) | (w & x)) + blk(i) + 0x8F1BBCDC + rol(v, 5); w = rol(w, 30); -#define R4(v, w, x, y, z, i)z += (w ^ x ^ y) + blk(i) + 0xCA62C1D6 + rol(v, 5); w = rol(w, 30); - -#endif /* SH1_H_ */ diff --git a/flashtool_mup/swinventory.cpp b/flashtool_mup/swinventory.cpp deleted file mode 100644 index ee02c6d..0000000 --- a/flashtool_mup/swinventory.cpp +++ /dev/null @@ -1,160 +0,0 @@ -#include - -#include "swinventory.h" - -SwInventory::SwInventory() -{ - // First set default values - /* - - - - - - - - */ - this->mHeader = (tSWInventory *) malloc(sizeof(tSWInventory)); - memcpy(this->mHeader->mMagicNumber, (uint8_t *) SW_MAGIC_VALUE, - sizeof(SW_MAGIC_VALUE) <= sizeof(this->mHeader->mMagicNumber) ? - sizeof(SW_MAGIC_VALUE) : sizeof(this->mHeader->mMagicNumber)); - this->mHeader->mHeaderVersion = 100; - this->mHeader->mImageOffset = 0x0; - this->mHeader->mImageSize = 0x0; - this->mHeader->mFlashOffset = 0x0; - this->mHeader->mSWVersion = 0; - this->mHeader->mImageNumber = 0; - this->mUnity = new SwUnity(); -} - -SwInventory::SwInventory(uint8_t *data, uint32_t offset, uint32_t datalen) -{ - mData = data; - mDataOffsetToBOF = offset; - mDataLength = datalen; -} - -int32_t SwInventory::parse() -{ - if (this->mDataLength >= sizeof(tSWInventory)) - { - this->mHeader = (tSWInventory *) this->mData; - this->mChildDataLength = this->mHeader->mImageSize; - this->mChildData = this->mData - this->mDataOffsetToBOF + this->mHeader->mImageOffset + SW_UPDATE_HEADER_SIZE /* jump over pack header */ + - MAX_INVENTORY_COUNT * SW_INVENTORY_SIZE /* plus end of all possible inventories */; - this->mUnity = new SwUnity(this->mChildData, this->mChildDataLength); - this->mUnity->parse(); - return sizeof(tSWInventory); - } - return 0; -} - -void SwInventory::print() -{ - char vHelpStr[256]; - printf("*******************************************************\n"); - printf("SWInventory:\n\n"); - strncpy(vHelpStr, (char *)this->mHeader->mMagicNumber, SW_UPDATE_MAGIC_SIZE); - vHelpStr[SW_UPDATE_MAGIC_SIZE] = '\0'; - printf("mMagicNumber = %s\n", vHelpStr); - printf("mHeaderVersion = %d\n", this->mHeader->mHeaderVersion); - printf("mImageOffset = 0x%08X (%d)\n", this->mHeader->mImageOffset, this->mHeader->mImageOffset); - printf("mImageSize = 0x%08X (%d)\n", this->mHeader->mImageSize, this->mHeader->mImageSize); - printf("mFlashOffset = 0x%08X (%d)\n", this->mHeader->mFlashOffset, this->mHeader->mFlashOffset); - printf("mSWVersion = %d\n", this->mHeader->mSWVersion); - printf("mImageNumber = %d\n", this->mHeader->mImageNumber); - this->mUnity->print(); -} - -void SwInventory::printXML(bool d) -{ - char vHelpStr[256]; - printf("\t\t\n"); - strncpy(vHelpStr, (char *)this->mHeader->mMagicNumber, SW_UPDATE_MAGIC_SIZE); - vHelpStr[SW_UPDATE_MAGIC_SIZE] = '\0'; - if (d) - { - printf("\t\t\t\n", vHelpStr); - printf("\t\t\t\n", this->mHeader->mHeaderVersion); - printf("\t\t\t\n", this->mHeader->mImageOffset); - printf("\t\t\t\n", this->mHeader->mImageSize); - printf("\t\t\t\n", this->mHeader->mFlashOffset); - printf("\t\t\t\n", this->mHeader->mSWVersion); - printf("\t\t\t\n", this->mHeader->mImageNumber); - } - this->mUnity->printXML(d); - printf("\t\t\n"); -} - -int32_t SwInventory::isValid() -{ - if (strncmp((char *)this->mHeader->mMagicNumber, (char *)SW_MAGIC_VALUE, SW_UPDATE_MAGIC_SIZE) != 0) - { - return 0; - } - if (this->mHeader->mHeaderVersion != SW_UPDATER_VERSION) - { - return 0; - } - return 1; -} - -bool SwInventory::verify() -{ - return this->mUnity->verify(); -} - -void SwInventory::extract() -{ - this->mUnity->extract(); -} - -void SwInventory::setPartition(uint32_t flashOffset, char *filename, uint8_t *data, uint32_t dataLength, uint32_t imageOffset) -{ - this->mHeader->mFlashOffset = flashOffset; - this->mHeader->mImageOffset = imageOffset; - this->mHeader->mImageSize = dataLength + SW_UPDATE_HEADER_SIZE; - this->mUnity->setPartition(flashOffset, filename, data, dataLength); - this->mDataLength = sizeof(tSWInventory); - this->mData = (uint8_t *) malloc(sizeof(tSWInventory)); - memcpy(this->mData, this->mHeader, sizeof(tSWInventory)); - this->mChildData = (uint8_t *)malloc(this->mUnity->getData(NULL)); - this->mChildDataLength = this->mUnity->getData(&this->mChildData); - this->mUnity->setmDataFree(); //dbo - if (this->mChildDataLength % 0x200 != 0) - { - this->mChildDataLength += (0x200 - (this->mChildDataLength % 0x200)); - this->mHeader->mImageSize = this->mChildDataLength; - memcpy(this->mData, this->mHeader, sizeof(tSWInventory)); - } -} - -//dbo -void SwInventory::setChildDataFree() -{ - free(this->mChildData); -} - -uint32_t SwInventory::getChildData(uint8_t **data) -{ - if (data != NULL) - { - memcpy(*data, this->mChildData, this->mChildDataLength); - } - return this->mChildDataLength; -} - -uint32_t SwInventory::getData(uint8_t **data) -{ - if (data != NULL) - { - memcpy(*data, this->mData, this->mDataLength); - } - return this->mDataLength; -} - -uint32_t SwInventory::getImageOffset() -{ - return this->mHeader->mImageOffset; -} - diff --git a/flashtool_mup/swinventory.h b/flashtool_mup/swinventory.h deleted file mode 100644 index f9e5b11..0000000 --- a/flashtool_mup/swinventory.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef SWINVENTORY_H_ -#define SWINVENTORY_H_ - -#include -#include -#include -#include -#include -#include -#include -//#include /* sha1 / crc32 */ -#include - -#include "misc.h" -#include "swunity.h" - -class SwInventory -{ - public: - SwInventory(); - SwInventory(uint8_t *data, uint32_t offset, uint32_t datalen); - void print(); - void printXML(bool d); - int32_t parse(); - int32_t isValid(); - - bool verify(); - void extract(); - - void setProductCode(unsigned int code) - { - this->mUnity->setProductCode(code); - } - - void setPartition(unsigned int flashOffset, char *filename, uint8_t *data, uint32_t dataLength, uint32_t imageOffset); - uint32_t getData(unsigned char **data); - uint32_t getChildData(unsigned char **data); - void setChildDataFree(); //dbo - - uint32_t getImageOffset(); - private: - typedef struct sSWInventory - { - uint8_t mMagicNumber[SW_UPDATE_MAGIC_SIZE]; - uint32_t mHeaderVersion; - uint32_t mImageOffset; - uint32_t mImageSize;//200h greater than datalength in unity - uint32_t mFlashOffset;//same as in unity - uint32_t mSWVersion; - uint32_t mImageNumber; - } tSWInventory; - - tSWInventory *mHeader; - - uint32_t mDataOffsetToBOF; - uint32_t mDataLength; - uint8_t *mData; - - uint32_t mChildDataLength; - uint8_t *mChildData; - - SwUnity *mUnity; -}; - -#endif diff --git a/flashtool_mup/swpack.cpp b/flashtool_mup/swpack.cpp deleted file mode 100644 index 7d06bab..0000000 --- a/flashtool_mup/swpack.cpp +++ /dev/null @@ -1,181 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -//#include /* sha1 / crc32 */ -#include -#include "misc.h" -#include "swpack.h" - -SwPack::SwPack() -{ - // First set default values - /* - - - - - - */ - this->mHeader = (tSWPack *) malloc(sizeof(tSWPack)); - memcpy(this->mHeader->mMagicNumber, (uint8_t *) SW_MAGIC_VALUE, - sizeof(SW_MAGIC_VALUE) <= sizeof(this->mHeader->mMagicNumber) ? - sizeof(SW_MAGIC_VALUE) : sizeof(this->mHeader->mMagicNumber)); - this->mHeader->mHeaderVersion = 100; - //this->mHeader->mProductCode = 0x11301003; // Kathrein, DVB-S2, simple, Ufs-912 - this->mHeader->mProductCode = 0x11321000; // Kathrein, DVB-S2, Twin-Pvr, Ufs-922 - this->mHeader->mSWVersion = 101; //uboot says that this should be 102 for 922, but it seems that this is not used anyway - this->mHeader->mDate = time(NULL); - this->mHeader->mInventoryCount = 0; - this->mHeader->mInvalidateFlag = 0; - memcpy(this->mHeader->mUpdateInfo, (uint8_t *) "Software Update", - sizeof("Software Update") <= sizeof(this->mHeader->mUpdateInfo) ? - sizeof("Software Update") : sizeof(this->mHeader->mUpdateInfo)); - mCurInventoryOffset = 0; -} - -SwPack::SwPack(uint8_t *data, uint32_t datalen) -{ - mData = data; - mDataLength = datalen; -} - -void SwPack::parse() -{ - this->mHeader = (tSWPack *) mData; - this->mChildDataOffset = SW_UPDATE_HEADER_SIZE /*sizeof(tSWPack)*/; - this->mChildDataLength = this->mDataLength - this->mChildDataOffset; - this->mChildData = mData + this->mChildDataOffset; - this->mInventoryCount = 0; - int32_t offsetNextEntry = 0; - /* until mInventoryCount seems to be not used loop over all inventories */ - while (this->mInventoryCount < MAX_INVENTORY_COUNT) - { - this->mInventory[this->mInventoryCount] = new SwInventory(mChildData + offsetNextEntry, mChildDataOffset + offsetNextEntry, mChildDataLength - offsetNextEntry); - /*offsetNextEntry +=*/ this->mInventory[this->mInventoryCount]->parse(); - offsetNextEntry += SW_INVENTORY_SIZE; - if (!this->mInventory[this->mInventoryCount]->isValid()) - { - delete (this->mInventory[this->mInventoryCount]); - break; - } - this->mInventoryCount++; - } -} - -void SwPack::print() -{ - char vHelpStr[256]; - printf("*******************************************************\n"); - printf("SWPack:\n\n"); - strncpy(vHelpStr, (char *)this->mHeader->mMagicNumber, SW_UPDATE_MAGIC_SIZE); - vHelpStr[SW_UPDATE_MAGIC_SIZE] = '\0'; - printf("mMagicNumber = %s\n", vHelpStr); - printf("mHeaderVersion = %d\n", this->mHeader->mHeaderVersion); - printf("mProductCode = 0x%08X\n", this->mHeader->mProductCode); - printf("mSWVersion = %d\n", this->mHeader->mSWVersion); - printf("mDate = %d\n", (int)this->mHeader->mDate); - printf("mInventoryCount = %d\n", this->mHeader->mInventoryCount); - printf("mInvalidateFlag = %d\n", this->mHeader->mInvalidateFlag); - strncpy(vHelpStr, this->mHeader->mUpdateInfo, SW_UPDATE_INFO_LENGTH); - vHelpStr[SW_UPDATE_INFO_LENGTH] = '\0'; - printf("mUpdateInfo = %s\n", vHelpStr); - for (uint32_t i = 0; i < this->mInventoryCount; i++) - { - this->mInventory[i]->print(); - } -} - -void SwPack::printXML(bool d) -{ - char vHelpStr[256]; - printf("\t\n"); - strncpy(vHelpStr, (char *)this->mHeader->mMagicNumber, SW_UPDATE_MAGIC_SIZE); - vHelpStr[SW_UPDATE_MAGIC_SIZE] = '\0'; - if (d) printf("\t\t\n", vHelpStr); - printf("\t\t\n", this->mHeader->mHeaderVersion); - printf("\t\t\n", this->mHeader->mProductCode); - printf("\t\t\n", this->mHeader->mSWVersion); - printf("\t\t\n", (int)this->mHeader->mDate, strTime(this->mHeader->mDate)); - if (d) printf("\t\t\n", this->mHeader->mInventoryCount); - if (d) printf("\t\t\n", this->mHeader->mInvalidateFlag); - strncpy(vHelpStr, this->mHeader->mUpdateInfo, SW_UPDATE_INFO_LENGTH); - vHelpStr[SW_UPDATE_INFO_LENGTH] = '\0'; - printf("\t\t\n", vHelpStr); - for (uint32_t i = 0; i < this->mInventoryCount; i++) - { - this->mInventory[i]->printXML(d); - } - printf("\t\n"); -} - -bool SwPack::verify() -{ - bool rtv = true; - for (uint32_t i = 0; i < this->mInventoryCount; i++) - { - if (!this->mInventory[i]->verify()) - { - rtv = false; - } - } - return rtv; -} - -void SwPack::extract() -{ - for (uint32_t i = 0; i < this->mInventoryCount; i++) - { - this->mInventory[i]->extract(); - } - return; -} - -void SwPack::appendPartition(uint32_t flashOffset, char *filename, uint8_t *data, uint32_t dataLength) -{ - this->mInventory[this->mInventoryCount] = new SwInventory(); - this->mInventory[this->mInventoryCount]->setProductCode(this->mHeader->mProductCode); - this->mInventory[this->mInventoryCount]->setPartition(flashOffset, filename, data, dataLength, mCurInventoryOffset); - mCurInventoryOffset += this->mInventory[this->mInventoryCount]->getChildData(NULL); - this->mInventoryCount++; -} - -int32_t SwPack::createImage(uint8_t **data) -{ - /*int */mDataLength = SW_UPDATE_HEADER_SIZE + MAX_INVENTORY_COUNT * SW_INVENTORY_SIZE; - for (uint32_t i = 0; i < this->mInventoryCount; i++) - { - mDataLength += this->mInventory[i]->getChildData(NULL); - } - if (verbose) - { - printf("TOTAL SIZE: %u\n", mDataLength); - } - *data = (uint8_t *)malloc(mDataLength); //dbo - //mData = (uint8_t *)malloc(mDataLength); //dbo - memcpy(*data, mHeader, sizeof(tSWPack)); //dbo - //memcpy(mData, mHeader, sizeof(tSWPack)); //dbo - for (uint32_t i = 0; i < this->mInventoryCount; i++) - { - int32_t cDataLenght = this->mInventory[i]->getData(NULL); - uint8_t *cData = (uint8_t *)malloc(cDataLenght); - this->mInventory[i]->getData(&cData); - //memcpy(mData + SW_UPDATE_HEADER_SIZE + i * SW_INVENTORY_SIZE, cData, cDataLenght); //dbo - memcpy(*data + SW_UPDATE_HEADER_SIZE + i * SW_INVENTORY_SIZE, cData, cDataLenght); //dbo - free(cData); - cDataLenght = this->mInventory[i]->getChildData(NULL); - cData = (uint8_t *)malloc(cDataLenght); - this->mInventory[i]->getChildData(&cData); - //memcpy(mData + this->mInventory[i]->getImageOffset() + SW_UPDATE_HEADER_SIZE + MAX_INVENTORY_COUNT * SW_INVENTORY_SIZE, cData, cDataLenght); //dbo - memcpy(*data + this->mInventory[i]->getImageOffset() + SW_UPDATE_HEADER_SIZE + MAX_INVENTORY_COUNT * SW_INVENTORY_SIZE, cData, cDataLenght); //dbo - free(cData); - this->mInventory[i]->setChildDataFree(); //dbo - } - //*data = (uint8_t *)malloc(this->mDataLength); //dbo - //memcpy(*data, this->mData, this->mDataLength); //dbo - //free(this->mData); //dbo - return mDataLength; -} diff --git a/flashtool_mup/swpack.h b/flashtool_mup/swpack.h deleted file mode 100644 index d18dec5..0000000 --- a/flashtool_mup/swpack.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef SWPACK_H_ -#define SWPACK_H_ - -#include -#include "swinventory.h" - -class SwPack -{ - public: - SwPack(); - SwPack(uint8_t *data, uint32_t datalen); - void print(); - void printXML(bool d); - void parse(); - void parseXML(); - - bool verify(); - void extract(); - - void setProductCode(uint32_t code) - { - this->mHeader->mProductCode = code; - } - - void appendPartition(uint32_t flashOffset, char *filename, uint8_t *data, uint32_t dataLength); - int32_t createImage(uint8_t **data); - - private: - typedef struct sSWPack - { - uint8_t mMagicNumber[SW_UPDATE_MAGIC_SIZE]; - uint32_t mHeaderVersion; - uint32_t mProductCode; - uint32_t mSWVersion; - uint32_t mDate; /*time_t*/ - uint32_t mInventoryCount; /* not used ->loop over MAX_INVENTORY_COUNT */ - uint32_t mInvalidateFlag; - char mUpdateInfo[SW_UPDATE_INFO_LENGTH]; - } tSWPack; - - tSWPack *mHeader; - uint32_t mDataLength; - uint8_t *mData; - char *mXML; - - uint32_t mChildDataOffset; - uint32_t mChildDataLength; - uint8_t *mChildData; - - uint32_t mInventoryCount; - SwInventory *mInventory[MAX_INVENTORY_COUNT]; - - private: - uint32_t mCurInventoryOffset; -}; - -#endif diff --git a/flashtool_mup/swunity.cpp b/flashtool_mup/swunity.cpp deleted file mode 100644 index 66d55a5..0000000 --- a/flashtool_mup/swunity.cpp +++ /dev/null @@ -1,328 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#if GCRY -#include /* sha1 / crc32 */ -#endif -#include - -#include "crc32.h" -#include "sh1.h" -#include "misc.h" -#include "swunity.h" - -SwUnity::SwUnity() -{ - // First set default values - /* - - - - - - - - - - - - */ - this->mHeader = (tSWUnity *) malloc(sizeof(tSWUnity)); - memcpy(this->mHeader->mMagicNumber, (uint8_t *) SW_MAGIC_VALUE, - sizeof(SW_MAGIC_VALUE) <= sizeof(this->mHeader->mMagicNumber) ? - sizeof(SW_MAGIC_VALUE) : sizeof(this->mHeader->mMagicNumber)); - this->mHeader->mHeaderVersion = 100; - //this->mHeader->mProductCode = 0x11301003; // Kathrein, DVB-S2, simple, Ufs-912 - this->mHeader->mProductCode = 0x11321000; // Kathrein, DVB-S2, Twin-Pvr, Ufs-922 - this->mHeader->mSWVersion = 101; //uboot says that this should be 102 für 922, but it seems that this is not used anyway - this->mHeader->mDate = time(NULL); - this->mHeader->mFlashOffset = 0; - this->mHeader->mDataLength = 0; - memcpy(this->mHeader->mUpdateInfo, (uint8_t *) "Software Update", - sizeof("Software Update") <= sizeof(this->mHeader->mUpdateInfo) ? - sizeof("Software Update") : sizeof(this->mHeader->mUpdateInfo)); -} - -SwUnity::SwUnity(uint8_t *data, uint32_t datalen) -{ - mData = data; - mDataLength = datalen; -} - -int32_t SwUnity::parse() -{ - if (this->mDataLength >= sizeof(tSWUnity)) - { - this->mHeader = (tSWUnity *) this->mData; - this->mChildDataLength = this->mDataLength - SW_UPDATE_HEADER_SIZE; - if (this->mChildDataLength > this->mHeader->mDataLength) - { - //printf("Not equal !\n\t%d - %d\n", this->mChildDataLength, this->mHeader->mDataLength); - this->mChildDataLength = this->mHeader->mDataLength; - } - this->mChildData = this->mData + SW_UPDATE_HEADER_SIZE; - return sizeof(tSWUnity); - } - return 0; -} - -void SwUnity::print() -{ - char vHelpStr[256]; - printf("*******************************************************\n"); - printf("SWUnity:\n\n"); - strncpy(vHelpStr, (char *)this->mHeader->mMagicNumber, SW_UPDATE_MAGIC_SIZE); - vHelpStr[SW_UPDATE_MAGIC_SIZE] = '\0'; - printf("mMagicNumber = %s\n", vHelpStr); - printf("mHeaderVersion = %d\n", this->mHeader->mHeaderVersion); - printf("mProductCode = %d\n", this->mHeader->mProductCode); - printf("mSWVersion = %d\n", this->mHeader->mSWVersion); - printf("mDate = %d\n", (int)this->mHeader->mDate); - printf("mFlashOffset = 0x%08X (%d)\n", this->mHeader->mFlashOffset, this->mHeader->mFlashOffset); - printf("mDataLength = 0x%08X (%d)\n", this->mHeader->mDataLength, this->mHeader->mDataLength); - strncpy(vHelpStr, this->mHeader->mHashValue, 20); - vHelpStr[20] = '\0'; - printf("mHashValue =\n"); - for (int32_t i = 0; i < 20; i++) - { - printf("0x%02x ", vHelpStr[i] & 0xff); - if (((i + 1) % 10) == 0) - { - printf("\n"); - } - } - printf("mCRC = 0x%08X (%d)\n", this->mHeader->mCRC, this->mHeader->mCRC); - strncpy(vHelpStr, (char *)this->mHeader->mFileName, SW_UPDATE_FILENAME_LENGTH); - vHelpStr[SW_UPDATE_FILENAME_LENGTH] = '\0'; - printf("mFileName = %s\n", vHelpStr); - strncpy(vHelpStr, (char *)this->mHeader->mUpdateInfo, SW_UPDATE_INFO_LENGTH); - vHelpStr[SW_UPDATE_INFO_LENGTH] = '\0'; - printf("mUpdateInfo = %s\n", vHelpStr); -} - -void SwUnity::printXML(bool d) -{ - char vHelpStr[256]; - printf("\t\t\t\n"); - strncpy(vHelpStr, (char *)this->mHeader->mMagicNumber, SW_UPDATE_MAGIC_SIZE); - vHelpStr[SW_UPDATE_MAGIC_SIZE] = '\0'; - if (d) - { - printf("\t\t\t\t\n", vHelpStr); - printf("\t\t\t\t\n", this->mHeader->mHeaderVersion); - printf("\t\t\t\t\n", this->mHeader->mProductCode); - printf("\t\t\t\t\n", this->mHeader->mSWVersion); - printf("\t\t\t\t\n", (int)this->mHeader->mDate, strTime(this->mHeader->mDate)); - } - printf("\t\t\t\t\n", this->mHeader->mFlashOffset); - if (d) - { - printf("\t\t\t\t\n", this->mHeader->mDataLength); - } - strncpy(vHelpStr, this->mHeader->mHashValue, 20); - vHelpStr[20] = '\0'; - if (d) - { - printf("\t\t\t\t\n"); - printf("\t\t\t\t\n", this->mHeader->mCRC); - } - strncpy(vHelpStr, (char *)this->mHeader->mFileName, SW_UPDATE_FILENAME_LENGTH); - vHelpStr[SW_UPDATE_FILENAME_LENGTH] = '\0'; - printf("\t\t\t\t\n", vHelpStr); - strncpy(vHelpStr, (char *)this->mHeader->mUpdateInfo, SW_UPDATE_INFO_LENGTH); - vHelpStr[SW_UPDATE_INFO_LENGTH] = '\0'; - printf("\t\t\t\t\n", vHelpStr); -#if 0 - printf("\t\t\t\tmChildDataLength; i++) - { - printf("%02X", this->mChildData[i]); - } - printf("h\" />\n"); -#endif - printf("\t\t\t\n"); -} - -int32_t SwUnity::isValid() -{ - if (strncmp((char *)this->mHeader->mMagicNumber, (char *)SW_MAGIC_VALUE, SW_UPDATE_MAGIC_SIZE) != 0) - { - return 0; - } - if (this->mHeader->mHeaderVersion != SW_UPDATER_VERSION) - { - return 0; - } - return 1; -} - -void SwUnity::calcSH1(uint8_t **sh1_hash, uint32_t *sh1_hash_len) -{ -#if GCRY - /* let us see how int32_t is the hash key for SHA1 ... */ - *sh1_hash_len = gcry_md_get_algo_dlen(GCRY_MD_SHA1); - *sh1_hash = (uint8_t *)malloc((*sh1_hash_len) * sizeof(uint8_t)); - /* calculate the hash */ - gcry_md_hash_buffer(GCRY_MD_SHA1, *sh1_hash, this->mChildData, this->mChildDataLength); -#else - SHA1_CTX mContext; - *sh1_hash_len = 20; - *sh1_hash = (uint8_t *)malloc((*sh1_hash_len) * sizeof(uint8_t)); - SHA1Init(&mContext); - SHA1Update(&mContext, this->mChildData, this->mChildDataLength); - SHA1Final(*sh1_hash, &mContext); -#endif - return; -} - -uint32_t SwUnity::calcCRC32(uint8_t **crc32_hash, uint32_t *crc32_hash_len) -{ -#if GCRY - /* let us see how int32_t is the hash key for CRC32 ... */ - *crc32_hash_len = gcry_md_get_algo_dlen(GCRY_MD_CRC32); - *crc32_hash = (uint8_t *)malloc((*crc32_hash_len) * sizeof(uint8_t)); - /* calculate the hash */ - gcry_md_hash_buffer(GCRY_MD_CRC32, *crc32_hash, this->mChildData, this->mChildDataLength); -#endif - if (verbose) - { - printf("%d\n", this->mChildDataLength); - for (int32_t i = 0; i < 40 && i < this->mChildDataLength; i++) - { - printf("%02X ", this->mChildData[i]); - } - printf("\n"); - if (this->mChildDataLength >= 80) - { - for (int32_t i = 0; i < 40; i++) - { - printf("%02X ", this->mChildData[this->mChildDataLength - 41 + i]); - } - printf("\n"); - } - } - return crc32(this->mChildData, this->mChildDataLength); -} - -bool SwUnity::verify() -{ - bool crc32 = false; - bool sh1 = false; - uint8_t *sh1HashArray = NULL; - uint32_t sh1HashLength = 0; - calcSH1(&sh1HashArray, &sh1HashLength); - printf("SH1 ORG: "); - for (int32_t i = 0; i < 20; i++) - { - printf("%02X ", this->mHeader->mHashValue[i] & 0xff); - } - printf("\n"); - printf("SH1 CALC: "); - for (int32_t i = 0; i < 20; i++) - { - printf("%02X ", sh1HashArray[i] & 0xff); - } - printf("\n"); - if (memcmp(this->mHeader->mHashValue, sh1HashArray, sh1HashLength)) - { - sh1 = false; - } - else - { - sh1 = true; - } - uint8_t *crc32HashArray = NULL; - uint32_t crc32Hash = 0; - uint32_t crc32HashLength = 0; - crc32Hash = calcCRC32(&crc32HashArray, &crc32HashLength); - /*crc32Hash = crc32HashArray[0]; - crc32Hash += crc32HashArray[1]<<8; - crc32Hash += crc32HashArray[2]<<16; - crc32Hash += crc32HashArray[3]<<24;*/ - printf("CRC32 %08X - %08X\n", crc32Hash, this->mHeader->mCRC); - if (crc32Hash == this->mHeader->mCRC) - { - crc32 = true; - } - else - { - crc32 = false; - } - return crc32 && sh1; -} - -void SwUnity::extract() -{ - char vHelpStr[256]; - int32_t fd; - uint32_t i; - strncpy(vHelpStr, (char *)this->mHeader->mFileName, SW_UPDATE_FILENAME_LENGTH); - vHelpStr[SW_UPDATE_FILENAME_LENGTH] = '\0'; - for (int32_t i = 0; i < strlen(vHelpStr); i++) - { - if (vHelpStr[i] == '/' || vHelpStr[i] == '\\') - { - vHelpStr[i] = '_'; - } - } - fd = open(vHelpStr, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); - if (fd < 0) - { - printf("error opening %s\n", vHelpStr); - return; - } - i = write(fd, this->mChildData, this->mChildDataLength); - if (i != this->mChildDataLength) - { - printf("error reading data %d / %d\n", i, this->mChildDataLength); - } - close(fd); -} - -void SwUnity::setPartition(uint32_t flashOffset, char *filename, uint8_t *data, uint32_t dataLength) -{ - this->mHeader->mFlashOffset = flashOffset; - memcpy(this->mHeader->mFileName, filename, strlen(filename)); - this->mHeader->mFileName[strlen(filename)] = '\0'; - this->mHeader->mDataLength = dataLength; - this->mChildDataLength = dataLength; - this->mChildData = (uint8_t *)malloc(dataLength); - memcpy(this->mChildData, data, dataLength); - uint8_t *sh1HashArray = NULL; - uint32_t sh1HashLength = 0; - calcSH1(&sh1HashArray, &sh1HashLength); - for (int32_t i = 0; i < 20; i++) - { - this->mHeader->mHashValue[i] = sh1HashArray[i]; - } - uint32_t crc32HashLength = 0; - this->mHeader->mCRC = calcCRC32(NULL, &crc32HashLength); - this->mDataLength = this->mChildDataLength + SW_UPDATE_HEADER_SIZE; - this->mData = (uint8_t *) malloc(this->mDataLength); - memcpy(this->mData, this->mHeader, sizeof(tSWUnity)); - memcpy(this->mData + SW_UPDATE_HEADER_SIZE, this->mChildData, this->mChildDataLength); - free(this->mChildData); // dbo -} - -void SwUnity::setmDataFree() //dbo -{ - free(this->mData); -} - -uint32_t SwUnity::getData(uint8_t **data) -{ - if (data != NULL) - { - memcpy(*data, this->mData, this->mDataLength); - } - return this->mDataLength; -} diff --git a/flashtool_mup/swunity.h b/flashtool_mup/swunity.h deleted file mode 100644 index 109f852..0000000 --- a/flashtool_mup/swunity.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef SWUNITY_H_ -#define SWUNITY_H_ - -#include -#include "misc.h" - -class SwUnity -{ - public: - SwUnity(); - SwUnity(uint8_t *data, uint32_t datalen); - void print(); - void printXML(bool d); - int parse(); - int isValid(); - - bool verify(); - void extract(); - - void setProductCode(uint32_t code) - { - this->mHeader->mProductCode = code; - } - - void setPartition(uint32_t flashOffset, char *filename, uint8_t *data, uint32_t dataLength); - uint32_t getData(uint8_t **data); - void setmDataFree(); //dbo - private: - void calcSH1(uint8_t **sh1_hash, uint32_t *sh1_hash_len); - uint32_t calcCRC32(uint8_t **crc32_hash, uint32_t *crc32_hash_len); - - private: - typedef struct sSWUnity - { - uint8_t mMagicNumber[SW_UPDATE_MAGIC_SIZE]; - uint32_t mHeaderVersion; - uint32_t mProductCode; - uint32_t mSWVersion; - uint32_t mDate; /*time_t*/ - uint32_t mFlashOffset; - uint32_t mDataLength; - - char mHashValue[20]; - uint32_t mCRC; - - uint8_t mFileName[SW_UPDATE_FILENAME_LENGTH]; - uint8_t mUpdateInfo[SW_UPDATE_INFO_LENGTH]; - } tSWUnity; - - // Parsed Unity Header - tSWUnity *mHeader; - - // Unity Header + Partition Data - uint32_t mDataLength; - uint8_t *mData; - - // Partition Data - uint32_t mChildDataLength; - uint8_t *mChildData; -}; - -#endif diff --git a/fp_control/Cuberevo.c b/fp_control/Cuberevo.c deleted file mode 100644 index 353f560..0000000 --- a/fp_control/Cuberevo.c +++ /dev/null @@ -1,693 +0,0 @@ -/* - * Cuberevo.c - * - * (c) 2009 dagobert@teamducktales - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/******************** includes ************************ */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "global.h" -#include "Cuberevo.h" - -static int setText(Context_t *context, char *theText); -static int Clear(Context_t *context); -static int setIcon(Context_t *context, int which, int on); -static int getVersion(Context_t *context, int *version); -static int setDisplayTime(Context_t *context, int on); - -/******************** constants ************************ */ - -#define cVFD_DEVICE "/dev/vfd" -#define cEVENT_DEVICE "/dev/input/event0" - -#define cMAXCharsCuberevo 14 /* 14seg ->rest is filtered by driver */ - -//#define USE_FP_UTC - -typedef struct -{ - int display; - int display_custom; - char *timeFormat; - - time_t wakeupTime; - int wakeupDecrement; -} tCUBEREVOPrivate; - -/* ******************* helper/misc functions ****************** */ - -static void setMode(int fd) -{ - struct micom_ioctl_data micom; - micom.u.mode.compat = 1; - - if (ioctl(fd, VFDSETMODE, &micom) < 0) - { - perror("setMode: "); - } -} - -/* Calculate the time value which we can pass to - * the micom fp. - */ -static void setMicomTime(time_t theGMTTime, char *destString, int seconds) -{ - struct tm *now_tm; - char tmpString[13]; -#ifdef USE_FP_UTC - now_tm = gmtime(&theGMTTime); -#else - now_tm = localtime(&theGMTTime); -#endif - - if (seconds) - { - sprintf(tmpString, "%02d%02d%02d%02d%02d%02d", - now_tm->tm_year - 100, now_tm->tm_mon + 1, now_tm->tm_mday, now_tm->tm_hour, now_tm->tm_min, now_tm->tm_sec); - strncpy(destString, tmpString, 12); - } - else - { - sprintf(tmpString, "%02d%02d%02d%02d%02d", - now_tm->tm_year - 100, now_tm->tm_mon + 1, now_tm->tm_mday, now_tm->tm_hour, now_tm->tm_min); - strncpy(destString, tmpString, 10); - } -} - -static time_t getMicomTime(char *micomTimeString) -{ - char convertTime[128]; - unsigned int year, month, day; - unsigned int hour, min, sec; - struct tm the_tm; - time_t convertedTime; - sprintf(convertTime, "%02x %02x %02x %02x %02x %02x\n", - micomTimeString[0], micomTimeString[1], - micomTimeString[2], micomTimeString[3], - micomTimeString[4], micomTimeString[5]); - sscanf(convertTime, "%d %d %d %d %d %d", &sec, &min, &hour, &day, &month, &year); - the_tm.tm_year = year + 100; - the_tm.tm_mon = month - 1; - the_tm.tm_mday = day; - the_tm.tm_hour = hour; - the_tm.tm_min = min; - the_tm.tm_sec = sec; - the_tm.tm_isdst = -1; - convertedTime = mktime(&the_tm); //16:00:00 -#ifdef USE_FP_UTC -#else -// We have to convert the localstring to UTC - { - struct tm *wrong_tz_time_utc_tm; - struct tm *wrong_tz_time_local_tm; - wrong_tz_time_utc_tm = gmtime(&convertedTime); //16:00:00 - wrong_tz_time_local_tm = localtime(&convertedTime); //18:00:00 - convertedTime -= difftime(mktime(&wrong_tz_time_local_tm), mktime(&wrong_tz_time_utc_tm)); // -> local = 16:00:00 / utc = 14:00:00 - } -#endif - return convertedTime; -} - -/* ******************* driver functions ****************** */ - -static int init(Context_t *context) -{ - tCUBEREVOPrivate *private = malloc(sizeof(tCUBEREVOPrivate)); - int vFd; - printf("%s\n", __func__); - vFd = open(cVFD_DEVICE, O_RDWR); - - if (vFd < 0) - { - fprintf(stderr, "Cannot open %s\n", cVFD_DEVICE); - perror(""); - } - - ((Model_t *)context->m)->private = private; - memset(private, 0, sizeof(tCUBEREVOPrivate)); - checkConfig(&private->display, &private->display_custom, &private->timeFormat, &private->wakeupDecrement); - return vFd; -} - -static int usage(Context_t *context, char *prg_name) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int setTime(Context_t *context, time_t *theGMTTime) -{ - struct micom_ioctl_data vData; - printf("%s ->\n", __func__); - setMicomTime(*theGMTTime, vData.u.time.time, 1); - fprintf(stderr, "Setting current Fp Time to: %s (mtime)\n", vData.u.time.time); -#if 1 - - if (ioctl(context->fd, VFDSETTIME, &vData) < 0) - { - perror("setTime: "); - printf("%s <- -1\n", __func__); - return -1; - } - -#endif - printf("%s <- 0\n", __func__); - return 0; -} - -static int getTime(Context_t *context, time_t *theGMTTime) -{ - struct micom_ioctl_data vData; - printf("%s ->\n", __func__); - fprintf(stderr, "Getting current fp time...\n"); -#if 1 - - /* front controller time */ - if (ioctl(context->fd, VFDGETTIME, &vData) < 0) - { - perror("getTime: "); - printf("%s <- -1\n", __func__); - return -1; - } - -#else - strncpy(vData.u.get_time.time, "111017182540", 12); -#endif - fprintf(stderr, "Got current fp Time %s (mtime)\n", vData.u.get_time.time); - /* current front controller time */ - *theGMTTime = (time_t) getMicomTime(vData.u.get_time.time); - printf("%s <- 0\n", __func__); - return 0; -} - -static int getWakeupTime(Context_t *context, time_t *theGMTTime) -{ - struct micom_ioctl_data vData; - fprintf(stderr, "Waiting for current wakeup-time from fp...\n"); - - /* front controller wake-up time */ - if (ioctl(context->fd, VFDGETWAKEUPTIME, &vData) < 0) - { - perror("getWakeupTime: "); - return -1; - } - - /* current front controller time */ - *theGMTTime = (time_t)getMicomTime(vData.u.wakeup_time.time); - return 0; -} - -static int setTimer(Context_t *context, time_t *theGMTTime) -{ - struct micom_ioctl_data vData; - time_t curTime = 0; - time_t curTimeFp = 0; - time_t wakeupTime = 0; - struct tm *ts; - struct tm *tsFp; - struct tm *tsWakeupTime; - tCUBEREVOPrivate *private = (tCUBEREVOPrivate *)((Model_t *)context->m)->private; - printf("%s ->\n", __func__); - // Get current Frontpanel time - getTime(context, &curTimeFp); - tsFp = gmtime(&curTimeFp); - fprintf(stderr, "Current Fp Time: %02d:%02d:%02d %02d-%02d-%04d (UTC)\n", - tsFp->tm_hour, tsFp->tm_min, tsFp->tm_sec, - tsFp->tm_mday, tsFp->tm_mon + 1, tsFp->tm_year + 1900); - // Get current Linux time - time(&curTime); - ts = gmtime(&curTime); - fprintf(stderr, "Current Linux Time: %02d:%02d:%02d %02d-%02d-%04d (UTC)\n", - ts->tm_hour, ts->tm_min, ts->tm_sec, - ts->tm_mday, ts->tm_mon + 1, ts->tm_year + 1900); - // Set current Linux time as new current Frontpanel time - setTime(context, &curTime); - - if (theGMTTime == NULL) - wakeupTime = read_timers_utc(curTime); - else - wakeupTime = *theGMTTime; - - if ((wakeupTime == 0) || (wakeupTime == LONG_MAX)) - { - /* clear timer */ - vData.u.standby.time[0] = '\0'; - } - else - { - // Print wakeup time - tsWakeupTime = gmtime(&wakeupTime); - fprintf(stderr, "Planned Wakeup Time: %02d:%02d:%02d %02d-%02d-%04d (UTC)\n", - tsWakeupTime->tm_hour, tsWakeupTime->tm_min, tsWakeupTime->tm_sec, - tsWakeupTime->tm_mday, tsWakeupTime->tm_mon + 1, tsWakeupTime->tm_year + 1900); - setMicomTime(wakeupTime, vData.u.standby.time, 0); - fprintf(stderr, "Setting planned fp wakeup time to = %s (mtime)\n", - vData.u.standby.time); - } - - fprintf(stderr, "Entering deep standby, goodbye...\n"); - fflush(stdout); - fflush(stderr); - sleep(2); - - if (ioctl(context->fd, VFDSTANDBY, &vData) < 0) - { - perror("standby: "); - printf("%s <- -1\n", __func__); - return -1; - } - - printf("%s <- 0\n", __func__); - return 0; -} - -static int getTimer(Context_t *context, time_t *theGMTTime) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int shutdown(Context_t *context, time_t *shutdownTimeGMT) -{ - time_t curTime; - - /* shutdown immediately */ - if (*shutdownTimeGMT == -1) - return (setTimer(context, NULL)); - - while (1) - { - time(&curTime); - - /*printf("curTime = %d, shutdown %d\n", curTime, *shutdownTimeGMT);*/ - - if (curTime >= *shutdownTimeGMT) - { - /* set most recent e2 timer and bye bye */ - return (setTimer(context, NULL)); - } - - usleep(100000); - } - - return -1; -} - -static int reboot(Context_t *context, time_t *rebootTimeGMT) -{ - time_t curTime; - struct micom_ioctl_data vData; - - while (1) - { - time(&curTime); - - if (curTime >= *rebootTimeGMT) - { - if (ioctl(context->fd, VFDREBOOT, &vData) < 0) - { - perror("reboot: "); - return -1; - } - } - - usleep(100000); - } - - return 0; -} - -static int Sleep(Context_t *context, time_t *wakeUpGMT) -{ - time_t curTime; - int sleep = 1; - int vFd; - fd_set rfds; - struct timeval tv; - int retval, i, rd, version; - struct tm *ts; - char output[cMAXCharsCuberevo + 1]; - struct input_event ev[64]; - tCUBEREVOPrivate *private = (tCUBEREVOPrivate *)((Model_t *)context->m)->private; - printf("%s\n", __func__); - vFd = open(cEVENT_DEVICE, O_RDWR); - - if (vFd < 0) - { - fprintf(stderr, "cannot open %s\n", cEVENT_DEVICE); - perror(""); - return -1; - } - - Clear(context); /* clear display */ - setIcon(context, 1, 1); /* show standby icon */ - getVersion(context, &version); - - /* 4char vfd's ? */ - if ((version == 3) && (private->display)) - { - /* yes: then enable fp time */ - setDisplayTime(context, 1); - } - else - { - setDisplayTime(context, 0); - } - - while (sleep) - { - time(&curTime); - ts = localtime(&curTime); - - if (curTime >= *wakeUpGMT) - { - sleep = 0; - } - else - { - FD_ZERO(&rfds); - FD_SET(vFd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 100000; - retval = select(vFd + 1, &rfds, NULL, NULL, &tv); - - if (retval > 0) - { - rd = read(vFd, ev, sizeof(struct input_event) * 64); - - if (rd < (int) sizeof(struct input_event)) - { - continue; - } - - for (i = 0; i < rd / sizeof(struct input_event); i++) - { - if (ev[i].type == EV_SYN) - { - } - else if (ev[i].type == EV_MSC && (ev[i].code == MSC_RAW || ev[i].code == MSC_SCAN)) - { - } - else - { - if (ev[i].code == 116) - sleep = 0; - } - } - } - } - - if ((private->display) && (version != 3)) - { - /* show soft time with user format */ - strftime(output, cMAXCharsCuberevo + 1, private->timeFormat, ts); - setText(context, output); - } - } - - Clear(context); /* clear display */ - setIcon(context, 1, 0); /* unshow standby icon */ - - if (version == 3) - setDisplayTime(context, 0); - - return 0; -} - -static int setText(Context_t *context, char *theText) -{ - char vHelp[128]; - strncpy(vHelp, theText, cMAXCharsCuberevo); - vHelp[cMAXCharsCuberevo] = '\0'; - /* printf("%s, %d\n", vHelp, strlen(vHelp)); */ - write(context->fd, vHelp, strlen(vHelp)); - return 0; -} - -static int setLed(Context_t *context, int which, int on) -{ - struct micom_ioctl_data vData; - vData.u.led.led_nr = which; - vData.u.led.on = on; - setMode(context->fd); - - if (ioctl(context->fd, VFDSETLED, &vData) < 0) - { - perror("setLed: "); - return -1; - } - - return 0; -} - -static int setRFModulator(Context_t *context, int on) -{ - struct micom_ioctl_data vData; - vData.u.rf.on = on; - setMode(context->fd); - - if (ioctl(context->fd, VFDSETRF, &vData) < 0) - { - perror("setRFModulator: "); - return -1; - } - - return 0; -} - -static int setDisplayTime(Context_t *context, int on) -{ - struct micom_ioctl_data vData; - vData.u.display_time.on = on; - setMode(context->fd); - - if (ioctl(context->fd, VFDSETDISPLAYTIME, &vData) < 0) - { - perror("setDisplayTime: "); - return -1; - } - - return 0; -} - -static int setFan(Context_t *context, int on) -{ - struct micom_ioctl_data vData; - vData.u.fan.on = on; - setMode(context->fd); - - if (ioctl(context->fd, VFDSETFAN, &vData) < 0) - { - perror("setFan: "); - return -1; - } - - return 0; -} - -static int setTimeMode(Context_t *context, int twentyFour) -{ - struct micom_ioctl_data vData; - vData.u.time_mode.twentyFour = twentyFour; - setMode(context->fd); - - if (ioctl(context->fd, VFDSETTIMEMODE, &vData) < 0) - { - perror("setTimeMode: "); - return -1; - } - - return 0; -} - -static int setBrightness(Context_t *context, int brightness) -{ - struct micom_ioctl_data vData; - - if (brightness < 0 || brightness > 7) - return -1; - - vData.u.brightness.level = brightness; - setMode(context->fd); - printf("%d\n", context->fd); - - if (ioctl(context->fd, VFDBRIGHTNESS, &vData) < 0) - { - perror("setBrightness: "); - return -1; - } - - return 0; -} - -static int setLight(Context_t *context, int on) -{ - if (on) - setBrightness(context, 7); - else - setBrightness(context, 0); - - return 0; -} - -/* Attention: this is not the wakeup reason as for other - * boxes (poweron, timer and son on) this is: - * 0x00 ->timer off - * 0x02 ->timer on - */ -static int getWakeupReason(Context_t *context, eWakeupReason *reason) -{ - struct micom_ioctl_data vData; - fprintf(stderr, "Waiting for wakeupmode from fp...\n"); - - /* front controller data */ - if (ioctl(context->fd, VFDGETWAKEUPMODE, &vData) < 0) - { - perror("getWakeupReason: "); - return -1; - } - - if ((vData.u.status.status & 0xff) == 0x02) - *reason = TIMER; - else - *reason = NONE; - - printf("Reason = 0x%x\n", *reason); - return 0; -} - -static int getVersion(Context_t *context, int *version) -{ - struct micom_ioctl_data micom; - fprintf(stderr, "waiting on version from fp ...\n"); - - /* front controller time */ - if (ioctl(context->fd, VFDGETVERSION, &micom) < 0) - { - perror("getVersion: "); - return -1; - } - - *version = micom.u.version.version; - printf("micom version = %d\n", micom.u.version.version); - return 0; -} - -static int Exit(Context_t *context) -{ - tCUBEREVOPrivate *private = (tCUBEREVOPrivate *)((Model_t *)context->m)->private; - - if (context->fd > 0) - close(context->fd); - - free(private); - exit(1); -} - -static int Clear(Context_t *context) -{ - struct vfd_ioctl_data data; - data.start = 0; - - if (ioctl(context->fd, VFDDISPLAYWRITEONOFF, &data) < 0) - { - perror("Clear: "); - return -1; - } - - return 0; -} - -static int setLedBrightness(Context_t *context, int brightness) -{ - struct micom_ioctl_data vData; - - if (brightness < 0 || brightness > 0xff) - return -1; - - vData.u.brightness.level = brightness; - setMode(context->fd); - printf("%d\n", context->fd); - - if (ioctl(context->fd, VFDLEDBRIGHTNESS, &vData) < 0) - { - perror("setLedBrightness: "); - return -1; - } - - return 0; -} - -static int setIcon(Context_t *context, int which, int on) -{ - struct micom_ioctl_data vData; - vData.u.icon.icon_nr = which; - vData.u.icon.on = on; - setMode(context->fd); - - if (ioctl(context->fd, VFDICONDISPLAYONOFF, &vData) < 0) - { - perror("setIcon: "); - return -1; - } - - return 0; -} - -Model_t Cuberevo_model = -{ - .Name = "CUBEREVO frontpanel control utility", - .Type = Cuberevo, - .Init = init, - .Clear = Clear, - .Usage = NULL, - .SetTime = setTime, - .GetTime = getTime, - .SetTimer = setTimer, - .GetTimer = getTimer, - .Shutdown = shutdown, - .Reboot = reboot, - .Sleep = Sleep, - .SetText = setText, - .SetLed = setLed, - .SetIcon = setIcon, - .SetBrightness = setBrightness, - .SetPwrLed = NULL, - .GetWakeupReason = getWakeupReason, - .SetLight = setLight, - .Exit = Exit, - .SetLedBrightness = setLedBrightness, - .GetVersion = getVersion, - .SetRF = setRFModulator, - .SetFan = setFan, - .GetWakeupTime = getWakeupTime, - .SetDisplayTime = setDisplayTime, - .SetTimeMode = setTimeMode, - .private = NULL -}; diff --git a/fp_control/Cuberevo.h b/fp_control/Cuberevo.h deleted file mode 100644 index a0d8a16..0000000 --- a/fp_control/Cuberevo.h +++ /dev/null @@ -1,137 +0,0 @@ -#ifndef __ufs912__ -#define __ufs912__ - -/* ioctl numbers ->hacky */ -#define VFDBRIGHTNESS 0xc0425a03 -#define VFDPWRLED 0xc0425a04 /* added by zeroone, also used in fp_control/global.h ; set PowerLed Brightness on HDBOX*/ -#define VFDDRIVERINIT 0xc0425a08 -#define VFDICONDISPLAYONOFF 0xc0425a0a -#define VFDDISPLAYWRITEONOFF 0xc0425a05 -#define VFDDISPLAYCHARS 0xc0425a00 - -#define VFDCLEARICONS 0xc0425af6 -#define VFDSETRF 0xc0425af7 -#define VFDSETFAN 0xc0425af8 -#define VFDGETWAKEUPMODE 0xc0425af9 -#define VFDGETTIME 0xc0425afa -#define VFDSETTIME 0xc0425afb -#define VFDSTANDBY 0xc0425afc -#define VFDREBOOT 0xc0425afd -#define VFDSETLED 0xc0425afe -#define VFDSETMODE 0xc0425aff - -#define VFDGETWAKEUPTIME 0xc0425b00 -#define VFDGETVERSION 0xc0425b01 -#define VFDSETDISPLAYTIME 0xc0425b02 -#define VFDSETTIMEMODE 0xc0425b03 - -/* this setups the mode temporarily (for one ioctl) - * to the desired mode. currently the "normal" mode - * is the compatible vfd mode - */ -struct set_mode_s -{ - int compat; /* 0 = compatibility mode to vfd driver; 1 = micom mode */ -}; - -struct set_brightness_s -{ - int level; -}; - -struct set_led_s -{ - int led_nr; - /* on: - * 0 = off - * 1 = on - * 2 = slow - * 3 = fast - */ - int on; -}; - -struct set_fan_s -{ - int on; -}; - -struct set_rf_s -{ - int on; -}; - -struct set_display_time_s -{ - int on; -}; - -struct set_icon_s -{ - int icon_nr; - int on; -}; - -/* YYMMDDhhmm */ -struct set_standby_s -{ - char time[10]; -}; - -/* YYMMDDhhmmss */ -struct set_time_s -{ - char time[12]; -}; - -/* YYMMDDhhmmss */ -struct get_time_s -{ - char time[12]; -}; - -struct get_wakeupstatus -{ - char status; -}; - -/* YYMMDDhhmmss */ -struct get_wakeuptime -{ - char time[12]; -}; - -/* 0 = 12dot 12seg, 1 = 13grid, 2 = 12 dot 14seg, 3 = 7seg */ -struct get_version_s -{ - int version; -}; - -struct set_time_mode_s -{ - int twentyFour; -}; - -struct micom_ioctl_data -{ - union - { - struct set_icon_s icon; - struct set_led_s led; - struct set_fan_s fan; - struct set_rf_s rf; - struct set_brightness_s brightness; - struct set_mode_s mode; - struct set_standby_s standby; - struct set_time_s time; - struct get_time_s get_time; - struct get_wakeupstatus status; - struct get_wakeuptime wakeup_time; - struct set_display_time_s display_time; - struct get_version_s version; - struct set_time_mode_s time_mode; - } u; -}; - - -#endif diff --git a/fp_control/Fortis.c b/fp_control/Fortis.c deleted file mode 100644 index f59834c..0000000 --- a/fp_control/Fortis.c +++ /dev/null @@ -1,533 +0,0 @@ -/* - * Fortis.c - * - * (c) 2009 dagobert@teamducktales - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/******************** includes ************************ */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "global.h" -#include "Fortis.h" - -static int setText(Context_t *context, char *theText); -static int Clear(Context_t *context); -static int setIcon(Context_t *context, int which, int on); - -/******************** constants ************************ */ - -#define cVFD_DEVICE "/dev/vfd" -#define cEVENT_DEVICE "/dev/input/event0" - -#define cMAXCharsFortis 12 - -typedef struct -{ - int display; - int display_custom; - char *timeFormat; - - time_t wakeupTime; - int wakeupDecrement; -} tFortisPrivate; - -/* ******************* helper/misc functions ****************** */ - -static void setMode(int fd) -{ - struct nuvoton_ioctl_data nuvoton; - nuvoton.u.mode.compat = 1; - - if (ioctl(fd, VFDSETMODE, &nuvoton) < 0) - { - perror("Set compatibility mode"); - } -} - -unsigned long getNuvotonTime(char *nuvotonTimeString) -{ - unsigned int mjd = ((nuvotonTimeString[0] & 0xFF) * 256) + (nuvotonTimeString[1] & 0xFF); - unsigned long epoch = ((mjd - 40587) * 86400); - unsigned int hour = nuvotonTimeString[2] & 0xFF; - unsigned int min = nuvotonTimeString[3] & 0xFF; - unsigned int sec = nuvotonTimeString[4] & 0xFF; - epoch += (hour * 3600 + min * 60 + sec); - printf("MJD = %d epoch = %ld, time = %02d:%02d:%02d\n", mjd, epoch, hour, min, sec); - return epoch; -} - -/* Calculate the time value which we can pass to - * the nuvoton fp. it is a mjd time (mjd=modified - * julian date). mjd is relative to gmt so theTime - * must be in GMT/UTC. - */ -void setNuvotonTime(time_t theTime, char *destString) -{ - struct tm *now_tm; - now_tm = gmtime(&theTime); - printf("Set Time (UTC): %02d:%02d:%02d %02d-%02d-%04d\n", now_tm->tm_hour, now_tm->tm_min, now_tm->tm_sec, now_tm->tm_mday, now_tm->tm_mon + 1, now_tm->tm_year + 1900); - double mjd = modJulianDate(now_tm); - int mjd_int = mjd; - destString[0] = (mjd_int >> 8); - destString[1] = (mjd_int & 0xff); - destString[2] = now_tm->tm_hour; - destString[3] = now_tm->tm_min; - destString[4] = now_tm->tm_sec; -} - -/* ******************* driver functions ****************** */ - -static int init(Context_t *context) -{ - tFortisPrivate *private = malloc(sizeof(tFortisPrivate)); - int vFd; - vFd = open(cVFD_DEVICE, O_RDWR); - - if (vFd < 0) - { - fprintf(stderr, "Cannot open %s\n", cVFD_DEVICE); - perror(""); - } - - ((Model_t *)context->m)->private = private; - memset(private, 0, sizeof(tFortisPrivate)); - checkConfig(&private->display, &private->display_custom, &private->timeFormat, &private->wakeupDecrement); - return vFd; -} - -static int usage(Context_t *context, char *prg_name) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int setTime(Context_t *context, time_t *theGMTTime) -{ - struct nuvoton_ioctl_data vData; - setNuvotonTime(*theGMTTime, vData.u.time.time); - - if (ioctl(context->fd, VFDSETTIME, &vData) < 0) - { - perror("Set time"); - return -1; - } - - return 0; -} - -static int getTime(Context_t *context, time_t *theGMTTime) -{ - char fp_time[8]; - fprintf(stderr, "waiting on current time from fp ...\n"); - - /* front controller time */ - if (ioctl(context->fd, VFDGETTIME, &fp_time) < 0) - { - perror("Get time"); - return -1; - } - - /* if we get the fp time */ - if (fp_time[0] != '\0') - { - fprintf(stderr, "success reading time from fp\n"); - /* current front controller time */ - *theGMTTime = (time_t) getNuvotonTime(fp_time); - } - else - { - fprintf(stderr, "Error reading time from fp\n"); - *theGMTTime = 0; - } - - return 0; -} - -static int setTimer(Context_t *context, time_t *theGMTTime) -{ - struct nuvoton_ioctl_data vData; - time_t curTime; - time_t curTimeFP; - time_t wakeupTime; - struct tm *ts; - struct tm *tsw; -// tFortisPrivate *private = (tFortisPrivate *)((Model_t *)context->m)->private; - time(&curTime); - ts = localtime(&curTime); - fprintf(stderr, "Current Time: %02d:%02d:%02d %02d-%02d-%04d\n", - ts->tm_hour, ts->tm_min, ts->tm_sec, ts->tm_mday, ts->tm_mon + 1, ts->tm_year + 1900); - - if (theGMTTime == NULL) - wakeupTime = read_timers_utc(curTime); - else - wakeupTime = *theGMTTime; - - tsw = localtime(&wakeupTime); - printf("wakeup Time: %02d:%02d:%02d %02d-%02d-%04d\n", - tsw->tm_hour, tsw->tm_min, tsw->tm_sec, tsw->tm_mday, tsw->tm_mon + 1, tsw->tm_year + 1900); - tsw = localtime(&curTime); - printf("current Time: %02d:%02d:%02d %02d-%02d-%04d\n", - tsw->tm_hour, tsw->tm_min, tsw->tm_sec, tsw->tm_mday, tsw->tm_mon + 1, tsw->tm_year + 1900); - - //check --> WakupTime is set and larger curTime and no larger than a year in the future (gost) - if ((wakeupTime <= 0) || (curTime > wakeupTime) || (curTime < (wakeupTime - 25920000))) - //if ((wakeupTime <= 0) || (wakeupTime == LONG_MAX)) - { - /* nothing to do for e2 */ -// fprintf(stderr, "no e2 timer found clearing fp wakeup time ... good bye ...\n"); -// vData.u.standby.time[0] = '\0'; - fprintf(stderr, "no timer found ... good bye ...\n"); - setNuvotonTime(wakeupTime, vData.u.standby.time); - - if (ioctl(context->fd, VFDSTANDBY, &vData) < 0) - { - perror("Standby"); - return -1; - } - } - else - { - unsigned long diff; - char fp_time[8]; - fprintf(stderr, "waiting on current time from fp ...\n"); - - /* front controller time */ - if (ioctl(context->fd, VFDGETTIME, &fp_time) < 0) - { - perror("Gettime"); - return -1; - } - - /* difference from now to wake up */ - diff = (unsigned long int) wakeupTime - curTime; - - /* if we get the fp time */ - if (fp_time[0] != '\0') - { - fprintf(stderr, "success reading time from fp\n"); - /* current front controller time */ - curTimeFP = (time_t) getNuvotonTime(fp_time); - - /* set FP-Time if curTime > or < 12h (gost)*/ - if (((curTimeFP - curTime) > 43200) || ((curTime - curTimeFP) > 43200)) - { - setTime(context, &curTime); - curTimeFP = curTime; - } - - tsw = gmtime(&curTimeFP); - printf("fp_time (UTC): %02d:%02d:%02d %02d-%02d-%04d\n", tsw->tm_hour, tsw->tm_min, tsw->tm_sec, tsw->tm_mday, tsw->tm_mon + 1, tsw->tm_year + 1900); - } - else - { - fprintf(stderr, "error reading time ... assuming localtime\n"); - /* noop current time already set */ - } - - wakeupTime = curTimeFP + diff; - setNuvotonTime(wakeupTime, vData.u.standby.time); - - if (ioctl(context->fd, VFDSTANDBY, &vData) < 0) - { - perror("Shut down until wake up time"); - return -1; - } - } - - return 0; -} - -static int getTimer(Context_t *context, time_t *theGMTTime) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int shutdown(Context_t *context, time_t *shutdownTimeGMT) -{ - time_t curTime; - - /* shutdown immediate */ - if (*shutdownTimeGMT == -1) - return (setTimer(context, NULL)); - - while (1) - { - time(&curTime); - - if (curTime >= *shutdownTimeGMT) - { - /* set most recent e2 timer and shut down */ - return (setTimer(context, NULL)); - } - - usleep(100000); - } - - return -1; -} - -static int reboot(Context_t *context, time_t *rebootTimeGMT) -{ - time_t curTime; - struct nuvoton_ioctl_data vData; - - while (1) - { - time(&curTime); - - if (curTime >= *rebootTimeGMT) - { - if (ioctl(context->fd, VFDREBOOT, &vData) < 0) - { - perror("Reboot"); - return -1; - } - } - - usleep(100000); - } - - return 0; -} - -static int Sleep(Context_t *context, time_t *wakeUpGMT) -{ - time_t curTime; - int sleep = 1; - int vFd; - fd_set rfds; - struct timeval tv; - int retval, i, rd; - struct tm *ts; - char output[cMAXCharsFortis + 1]; - struct input_event ev[64]; - tFortisPrivate *private = (tFortisPrivate *)((Model_t *)context->m)->private; - vFd = open(cEVENT_DEVICE, O_RDWR); - - if (vFd < 0) - { - fprintf(stderr, "Cannot open %s\n", cEVENT_DEVICE); - perror(""); - return -1; - } - - while (sleep) - { - time(&curTime); - ts = localtime(&curTime); - - if (curTime >= *wakeUpGMT) - { - sleep = 0; - } - else - { - FD_ZERO(&rfds); - FD_SET(vFd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 100000; - retval = select(vFd + 1, &rfds, NULL, NULL, &tv); - - if (retval > 0) - { - rd = read(vFd, ev, sizeof(struct input_event) * 64); - - if (rd < (int) sizeof(struct input_event)) - { - continue; - } - - for (i = 0; i < rd / sizeof(struct input_event); i++) - { - if (ev[i].type == EV_SYN) - { - } - else if (ev[i].type == EV_MSC && (ev[i].code == MSC_RAW || ev[i].code == MSC_SCAN)) - { - } - else - { - if (ev[i].code == 116) - sleep = 0; - } - } - } - } - - if (private->display) - { - strftime(output, cMAXCharsFortis + 1, private->timeFormat, ts); - setText(context, output); - } - } - - return 0; -} - -static int setText(Context_t *context, char *theText) -{ - char vHelp[128]; - strncpy(vHelp, theText, cMAXCharsFortis); - vHelp[cMAXCharsFortis] = '\0'; - write(context->fd, vHelp, strlen(vHelp)); - return 0; -} - -static int setLed(Context_t *context, int which, int on) -{ - struct nuvoton_ioctl_data vData; - vData.u.led.led_nr = which; - vData.u.led.on = on; - setMode(context->fd); - - if (ioctl(context->fd, VFDSETLED, &vData) < 0) - { - perror("SetLED"); - return -1; - } - - return 0; -} - -static int setIcon(Context_t *context, int which, int on) -{ - struct nuvoton_ioctl_data vData; - vData.u.icon.icon_nr = which; - vData.u.icon.on = on; - setMode(context->fd); - - if (ioctl(context->fd, VFDICONDISPLAYONOFF, &vData) < 0) - { - perror("Set icon"); - return -1; - } - - return 0; -} - -static int setBrightness(Context_t *context, int brightness) -{ - struct nuvoton_ioctl_data vData; - - if (brightness < 0 || brightness > 7) - return -1; - - vData.u.brightness.level = brightness; - setMode(context->fd); - - if (ioctl(context->fd, VFDBRIGHTNESS, &vData) < 0) - { - perror("Set VFD brightness"); - return -1; - } - - return 0; -} - -static int Clear(Context_t *context) -{ - int i; - setText(context, " "); - setBrightness(context, 7); - - for (i = 1; i <= 6 ; i++) - setLed(context, i, 0); - - for (i = 1; i <= 16 ; i++) - setIcon(context, i, 0); - - return 0; -} - -static int setPwrLed(Context_t *context, int pwrled) -{ - struct nuvoton_ioctl_data vData; - - if (pwrled < 0 || pwrled > 15) - return -1; - - vData.u.pwrled.level = pwrled; - - if (ioctl(context->fd, VFDPWRLED, &vData) < 0) - { - perror("setpwrled: "); - return -1; - } - - return 0; -} - -static int setLight(Context_t *context, int on) -{ - if (on) - setBrightness(context, 7); - else - setBrightness(context, 0); - - return 0; -} - -static int Exit(Context_t *context) -{ - tFortisPrivate *private = (tFortisPrivate *)((Model_t *)context->m)->private; - - if (context->fd > 0) - close(context->fd); - - free(private); - exit(1); -} - -Model_t Fortis_model = -{ - .Name = "Fortis frontpanel control utility", - .Type = Fortis, - .Init = init, - .Clear = Clear, - .Usage = usage, - .SetTime = setTime, - .GetTime = getTime, - .SetTimer = setTimer, - .GetTimer = getTimer, - .Shutdown = shutdown, - .Reboot = reboot, - .Sleep = Sleep, - .SetText = setText, - .SetLed = setLed, - .SetIcon = setIcon, - .SetBrightness = setBrightness, - .SetPwrLed = setPwrLed, - .SetLight = setLight, - .Exit = Exit, - .SetLedBrightness = NULL, - .GetVersion = NULL, - .SetRF = NULL, - .SetFan = NULL, - .private = NULL -}; diff --git a/fp_control/Fortis.h b/fp_control/Fortis.h deleted file mode 100644 index c75568d..0000000 --- a/fp_control/Fortis.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef __fortis__ -#define __fortis__ - -#define VFDGETVERSION 0xc0425af7 -#define VFDGETWAKEUPTIME 0xc0425b03 -#define VFDSETTIMEMODE 0xc0425b04 - -struct set_brightness_s -{ - int level; -}; - -struct set_icon_s -{ - int icon_nr; - int on; -}; - -struct set_led_s -{ - int led_nr; - int on; -}; - -struct set_pwrled_s -{ - int level; -}; - -/* time must be given as follows: - * time[0] & time[1] = mjd ??? - * time[2] = hour - * time[3] = min - * time[4] = sec - */ -struct set_standby_s -{ - char time[5]; -}; - -struct set_time_s -{ - char time[5]; -}; - -/* this sets up the mode temporarily (for one ioctl) - * to the desired mode. currently the "normal" mode - * is the compatible vfd mode - */ -struct set_mode_s -{ - int compat; /* 0 = compatibility mode to vfd driver; 1 = nuvoton mode */ -}; - -struct nuvoton_ioctl_data -{ - union - { - struct set_icon_s icon; - struct set_led_s led; - struct set_brightness_s brightness; - struct set_pwrled_s pwrled; - struct set_mode_s mode; - struct set_standby_s standby; - struct set_time_s time; - } u; -}; - -#endif diff --git a/fp_control/Makefile.am b/fp_control/Makefile.am deleted file mode 100644 index 7543d98..0000000 --- a/fp_control/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -bin_PROGRAMS = fp_control - -fp_control_SOURCES = \ - fp_control.c \ - global.c \ - Ufs910_1W.c \ - Ufs910_14W.c \ - Ufs912.c \ - Ufs922.c \ - Fortis.c \ - Spark.c \ - Cuberevo.c - -AM_CFLAGS = -Wall -AM_LDFLAGS = -lrt diff --git a/fp_control/Spark.c b/fp_control/Spark.c deleted file mode 100644 index 9002fb3..0000000 --- a/fp_control/Spark.c +++ /dev/null @@ -1,518 +0,0 @@ -/* - * Spark.c - * - * (c) 2010 duckbox project - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/******************** includes ************************ */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "global.h" -#include "Spark.h" - -static int Spark_setText(Context_t *context, char *theText); - -/******************** constants ************************ */ - -#define cVFD_DEVICE "/dev/vfd" - -#define cMAXCharsSpark 63 - -typedef struct -{ - int display; - int display_custom; - char *timeFormat; - - time_t wakeupTime; - int wakeupDecrement; -} tSparkPrivate; - -/* ******************* helper/misc functions ****************** */ - -/* Calculate the time value which we can pass to - * the aotom fp. its a mjd time (mjd=modified - * julian date). mjd is relative to gmt so theGMTTime - * must be in GMT/UTC. - */ -void Spark_setAotomTime(time_t theGMTTime, char *destString) -{ - /* from u-boot aotom */ - struct tm *now_tm; - now_tm = localtime(&theGMTTime); - printf("Set Time (UTC): %02d:%02d:%02d %02d-%02d-%04d\n", - now_tm->tm_hour, now_tm->tm_min, now_tm->tm_sec, now_tm->tm_mday, now_tm->tm_mon + 1, now_tm->tm_year + 1900); - double mjd = modJulianDate(now_tm); - int mjd_int = mjd; - destString[0] = (mjd_int >> 8); - destString[1] = (mjd_int & 0xff); - destString[2] = now_tm->tm_hour; - destString[3] = now_tm->tm_min; - destString[4] = now_tm->tm_sec; -} - -unsigned long Spark_getAotomTime(char *aotomTimeString) -{ - unsigned int mjd = ((aotomTimeString[1] & 0xFF) * 256) + (aotomTimeString[2] & 0xFF); - unsigned long epoch = ((mjd - 40587) * 86400); - unsigned int hour = aotomTimeString[3] & 0xFF; - unsigned int min = aotomTimeString[4] & 0xFF; - unsigned int sec = aotomTimeString[5] & 0xFF; - epoch += (hour * 3600 + min * 60 + sec); - printf("MJD = %d epoch = %ld, time = %02d:%02d:%02d\n", mjd, epoch, hour, min, sec); - return epoch; -} - -/* ******************* driver functions ****************** */ - -static int Spark_init(Context_t *context) -{ - tSparkPrivate *private = malloc(sizeof(tSparkPrivate)); - int vFd; -// printf("%s\n", __func__); - vFd = open(cVFD_DEVICE, O_RDWR); - - if (vFd < 0) - { - fprintf(stderr, "Cannot open %s\n", cVFD_DEVICE); - perror(""); - } - - ((Model_t *)context->m)->private = private; - memset(private, 0, sizeof(tSparkPrivate)); - checkConfig(&private->display, &private->display_custom, &private->timeFormat, &private->wakeupDecrement); - return vFd; -} - -static int Spark_usage(Context_t *context, char *prg_name) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int Spark_setTime(Context_t *context, time_t *theGMTTime) -{ - struct aotom_ioctl_data vData; - printf("%s\n", __func__); - Spark_setAotomTime(*theGMTTime, vData.u.time.time); - - if (ioctl(context->fd, VFDSETTIME, &vData) < 0) - { - perror("settime: "); - return -1; - } - - return 0; -} - -static int Spark_getTime(Context_t *context, time_t *theGMTTime) -{ - time_t iTime; - fprintf(stderr, "waiting on current time from fp ...\n"); - - /* front controller time */ - if (ioctl(context->fd, VFDGETTIME, &iTime) < 0) - { - perror("gettime: "); - return -1; - } - - /* if we get the fp time */ - if (iTime != '\0') - { - fprintf(stderr, "success reading time from fp\n"); - /* current front controller time */ - *theGMTTime = iTime; - } - else - { - fprintf(stderr, "error reading time from fp\n"); - *theGMTTime = 0; - } - - return 0; -} - -static int Spark_setTimer(Context_t *context, time_t *theGMTTime) -{ - struct aotom_ioctl_data vData; - time_t curTime; - time_t wakeupTime; - struct tm *ts; -// tSparkPrivate *private = (tSparkPrivate *)((Model_t *)context->m)->private; - time(&curTime); - ts = localtime(&curTime); - fprintf(stderr, "Current Time: %02d:%02d:%02d %02d-%02d-%04d\n", ts->tm_hour, ts->tm_min, ts->tm_sec, ts->tm_mday, ts->tm_mon + 1, ts->tm_year + 1900); - - if (theGMTTime == NULL) - wakeupTime = read_timers_utc(curTime); - else - wakeupTime = *theGMTTime; - - if ((wakeupTime <= 0) || (wakeupTime == LONG_MAX)) - { - /* nothing to do for e2 */ - fprintf(stderr, "no e2 timer found clearing fp wakeup time ... good bye ...\n"); - vData.u.standby.time[0] = '\0'; - - if (ioctl(context->fd, VFDSTANDBY, &vData) < 0) - { - perror("standby: "); - return -1; - } - } - else - { - unsigned long diff; - time_t iTime; - fprintf(stderr, "waiting on current time from fp ...\n"); - - /* get front controller time */ - if (ioctl(context->fd, VFDGETTIME, &iTime) < 0) - { - perror("Get current fp time"); - return -1; - } - - /* difference from now to wake up */ - diff = (unsigned long int) wakeupTime - curTime; - - if (iTime != '\0') - { - fprintf(stderr, "success reading time from fp\n"); - /* use current front controller time */ - curTime = iTime; - } - else - { - fprintf(stderr, "error reading time ... assuming localtime\n"); - /* noop current time already set */ - } - - wakeupTime = curTime + diff; - Spark_setAotomTime(wakeupTime, vData.u.standby.time); - - if (ioctl(context->fd, VFDSTANDBY, &wakeupTime) < 0) - { - perror("Shut down until wake up time"); - return -1; - } - } - - return 0; -} - -static int Spark_getTimer(Context_t *context, time_t *theGMTTime) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int Spark_shutdown(Context_t *context, time_t *shutdownTimeGMT) -{ - time_t curTime; - - /* shutdown immediate */ - if (*shutdownTimeGMT == -1) - return (Spark_setTimer(context, NULL)); - - while (1) - { - time(&curTime); - - /*printf("curTime = %d, shutdown %d\n", curTime, *shutdownTimeGMT);*/ - - if (curTime >= *shutdownTimeGMT) - { - /* set most recent e2 timer and bye bye */ - return (Spark_setTimer(context, NULL)); - } - - usleep(100000); - } - - return -1; -} - -static int Spark_reboot(Context_t *context, time_t *rebootTimeGMT) -{ - time_t curTime; - struct aotom_ioctl_data vData; - - while (1) - { - time(&curTime); - - if (curTime >= *rebootTimeGMT) - { - if (ioctl(context->fd, VFDREBOOT, &vData) < 0) - { - perror("reboot: "); - return -1; - } - } - - usleep(100000); - } - - return 0; -} - -static int Spark_Sleep(Context_t *context, time_t *wakeUpGMT) -{ -#if 0 - time_t curTime; - int sleep = 1; - int vFd; - fd_set rfds; - struct timeval tv; - int retval; - struct tm *ts; - char output[cMAXCharsSpark + 1]; - tSparkPrivate *private = (tSparkPrivate *)((Model_t *)context->m)->private; - printf("%s\n", __func__); - vFd = open(cRC_DEVICE, O_RDWR); - - if (vFd < 0) - { - fprintf(stderr, "cannot open %s\n", cRC_DEVICE); - perror(""); - return -1; - } - - printf("%s 1\n", __func__); - - while (sleep) - { - time(&curTime); - ts = localtime(&curTime); - - if (curTime >= *wakeUpGMT) - { - sleep = 0; - } - else - { - FD_ZERO(&rfds); - FD_SET(vFd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 100000; - retval = select(vFd + 1, &rfds, NULL, NULL, &tv); - - if (retval > 0) - { - sleep = 0; - } - } - - if (private->display) - { - strftime(output, cMAXCharsSpark + 1, private->timeFormat, ts); - Spark_setText(context, output); - } - } - -#endif - return 0; -} - -static int Spark_setText(Context_t *context, char *theText) -{ - char vHelp[128]; - strncpy(vHelp, theText, cMAXCharsSpark); - vHelp[cMAXCharsSpark] = '\0'; - /* printf("%s, %d\n", vHelp, strlen(vHelp));*/ - write(context->fd, vHelp, strlen(vHelp)); - return 0; -} - -static int Spark_setLed(Context_t *context, int which, int on) -{ - struct aotom_ioctl_data vData; - vData.u.led.led_nr = which; - vData.u.led.on = on; - - if (ioctl(context->fd, VFDSETLED, &vData) < 0) - { - perror("Setled"); - return -1; - } - - return 0; -} - -static int Spark_setIcon(Context_t *context, int which, int on) -{ - struct aotom_ioctl_data vData; - vData.u.icon.icon_nr = which; - vData.u.icon.on = on; - - if (ioctl(context->fd, VFDICONDISPLAYONOFF, &vData) < 0) - { - perror("Set icon"); - return -1; - } - - return 0; -} - -static int Spark_setBrightness(Context_t *context, int brightness) -{ - struct aotom_ioctl_data vData; - - if (brightness < 0 || brightness > 7) - return -1; - - vData.u.brightness.level = brightness; - printf("%d\n", context->fd); - - if (ioctl(context->fd, VFDBRIGHTNESS, &vData) < 0) - { - perror("Set brightness"); - return -1; - } - - return 0; -} - -static int Spark_setPwrLed(Context_t *context, int brightness) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - - -static int Spark_setLight(Context_t *context, int on) -{ - if (on) - Spark_setBrightness(context, 7); - else - Spark_setBrightness(context, 0); - - return 0; -} - -static int Spark_Exit(Context_t *context) -{ - tSparkPrivate *private = (tSparkPrivate *) - ((Model_t *)context->m)->private; - - if (context->fd > 0) - close(context->fd); - - free(private); - - return 1; -} - -static int Spark_Clear(Context_t *context) -{ - struct aotom_ioctl_data vData; - - if (ioctl(context->fd, VFDDISPLAYCLR, &vData) < 0) - { - perror("Clear"); - return -1; - } - - return 0; -} - -static int Spark_getWakeupReason(Context_t *context, eWakeupReason *reason) -{ - if (ioctl(context->fd, VFDGETSTARTUPSTATE, reason) < 0) - { - perror("Get wakeup reason"); - return -1; - } - printf("reason = 0x%x\n", *reason); - - return 0; -} - -static int Spark_setDisplayTime(Context_t *context, int on) -{ - if (on == 1) - { - time_t theGMTTime = time(NULL); - struct tm *gmt; - gmt = localtime(&theGMTTime); - - if (gmt->tm_year == 100) - { - fprintf(stderr, "RTC Time not set.\n"); - } - else - { - fprintf(stderr, "Setting Clock to current time: %02d:%02d:%02d %02d-%02d-%04d\n", - gmt->tm_hour, gmt->tm_min, gmt->tm_sec, gmt->tm_mday, gmt->tm_mon + 1, gmt->tm_year + 1900); - theGMTTime += gmt->tm_gmtoff; - - if (ioctl(context->fd, VFDREBOOT, &theGMTTime) < 0) - { - perror("settime: "); - return -1; - } - } - } - else - { - Spark_Clear(context); - } - - return 0; -} - -Model_t Spark_model = -{ - .Name = "Edision Spark frontpanel control utility", - .Type = Spark, - .Init = Spark_init, - .Clear = Spark_Clear, - .Usage = Spark_usage, - .SetTime = Spark_setTime, - .GetTime = Spark_getTime, - .SetTimer = Spark_setTimer, - .GetTimer = Spark_getTimer, - .SetDisplayTime = Spark_setDisplayTime, - .Shutdown = Spark_shutdown, - .Reboot = Spark_reboot, - .Sleep = Spark_Sleep, - .SetText = Spark_setText, - .SetLed = Spark_setLed, - .SetIcon = Spark_setIcon, - .SetBrightness = Spark_setBrightness, - .GetWakeupReason = Spark_getWakeupReason, - .SetPwrLed = Spark_setPwrLed, - .SetLight = Spark_setLight, - .Exit = Spark_Exit, - .SetLedBrightness = NULL, - .GetVersion = NULL, - .SetRF = NULL, - .SetFan = NULL, - .private = NULL -}; diff --git a/fp_control/Spark.h b/fp_control/Spark.h deleted file mode 100644 index de87032..0000000 --- a/fp_control/Spark.h +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef __Spark__ -#define __Spark__ - -#define VFDGETVERSION 0xc0425af7 -#define VFDGETWAKEUPTIME 0xc0425b03 - -/* this setups the mode temporarily (for one ioctl) - * to the desired mode. currently the "normal" mode - * is the compatible vfd mode - */ -struct set_mode_s -{ - int compat; /* 0 = compatibility mode to vfd driver; 1 = nuvoton mode */ -}; - -struct set_brightness_s -{ - int level; -}; - -struct set_icon_s -{ - int icon_nr; - int on; -}; - -struct set_led_s -{ - int led_nr; - int on; -}; - -/* time must be given as follows: - * time[0] & time[1] = mjd ??? - * time[2] = hour - * time[3] = min - * time[4] = sec - */ -struct set_standby_s -{ - char time[5]; -}; - -struct set_time_s -{ - char time[5]; -}; - -struct aotom_ioctl_data -{ - union - { - struct set_icon_s icon; - struct set_led_s led; - struct set_brightness_s brightness; - struct set_mode_s mode; - struct set_standby_s standby; - struct set_time_s time; - } u; -}; - -#endif diff --git a/fp_control/Ufs910_14W.c b/fp_control/Ufs910_14W.c deleted file mode 100644 index d4701bd..0000000 --- a/fp_control/Ufs910_14W.c +++ /dev/null @@ -1,614 +0,0 @@ -/* - * Ufs910_14W.c - * - * (c) 2009 dagobert@teamducktales - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/******************** includes ************************ */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "global.h" - -static int setText(Context_t *context, char *theText); -static int setIcon(Context_t *context, int which, int on); -static int setLed(Context_t *context, int which, int on); -static int Sleep(Context_t *context, time_t *wakeUpGMT); -static int setLight(Context_t *context, int on); - -/******************** constants ************************ */ -//#define cmdReboot "/sbin/reboot" /* does not currently work */ -#define cmdReboot "init 6" -#define cmdHalt "/sbin/halt" - -#define cVFD_DEVICE "/dev/vfd" -#define cCMDLINE "/proc/cmdline" - -#define cMAXCharsUFS910 16 - -typedef struct -{ - int vfd; - int fd_green; - int fd_red; - int fd_yellow; - - int nfs; - int display; - int display_custom; - char *timeFormat; - - time_t wakeupTime; - int wakeupDecrement; -} tUFS910Private; - -/* ******************* helper/misc functions ****************** */ -/* donalds helper functions */ - -/* ----------------------------------------------------- */ -struct termios old_io; -struct termios new_io; - -int destroySerial() -{ - printf("%s\n", __func__); - int fd = open("/dev/ttyAS0", O_RDWR); - - if ((tcgetattr(fd, &old_io)) == 0) - { - new_io = old_io; - printf("Setting new flags\n"); - /* c_iflags ->input flags */ - new_io.c_iflag &= ~(IMAXBEL | BRKINT | ICRNL); - /* c_lflags ->local flags*/ - new_io.c_lflag &= ~(ECHO | IEXTEN); - /* c_oflags ->output flags*/ - new_io.c_oflag &= ~(ONLCR); - /* c_cflags ->constant flags*/ - new_io.c_cflag = B19200; - tcsetattr(fd, TCSANOW, &new_io); - } - else - printf("Error setting raw mode.\n"); - - close(fd); - return 0; -} - -/* ----------------------------------------------------- */ -void avs_standby(int fd_avs, unsigned int mode) -{ - printf("%s %d\n", __func__, mode); - - if (!mode) - write(fd_avs, "on", 2); - else - write(fd_avs, "off", 3); -} - -/* ----------------------------------------------------- */ -void net_standby(int mode) -{ - printf("%s\n", __func__); - - if (!mode) - system("/sbin/ifconfig eth0 down"); - else if (mode) - system("/sbin/ifconfig eth0 up"); -} - -/* ----------------------------------------------------- */ -void hdmi_standby(int fd_hdmi, int mode) -{ - struct stmfbio_output_configuration outputConfig = {0}; - printf("%s %d\n", __func__, mode); - outputConfig.outputid = 1; - - if (ioctl(fd_hdmi, STMFBIO_GET_OUTPUT_CONFIG, &outputConfig) < 0) - perror("Getting current output configuration failed"); - - outputConfig.caps = 0; - outputConfig.activate = STMFBIO_ACTIVATE_IMMEDIATE; - outputConfig.analogue_config = 0; - outputConfig.caps |= STMFBIO_OUTPUT_CAPS_HDMI_CONFIG; - - if (!mode) - { - outputConfig.hdmi_config |= STMFBIO_OUTPUT_HDMI_DISABLED; - } - else if (mode) - { - outputConfig.hdmi_config &= ~STMFBIO_OUTPUT_HDMI_DISABLED; - } - - if (outputConfig.caps != STMFBIO_OUTPUT_CAPS_NONE) - { - if (ioctl(fd_hdmi, STMFBIO_SET_OUTPUT_CONFIG, &outputConfig) < 0) - perror("setting output configuration failed"); - } -} - -/* ----------------------------------------------------- */ -int helloSerial() -{ - int fd = open("/dev/ttyAS0", O_RDWR); - printf("%s\n", __func__); - tcsetattr(fd, TCSANOW, &old_io); - close(fd); - return 0; -} -/* ----------------------------------------------------- */ - -void startPseudoStandby(Context_t *context, tUFS910Private *private) -{ - int id; - int fd_avs = open("/proc/stb/avs/0/standby", O_RDWR); - int fd_hdmi = open("/dev/fb0", O_RDWR); - printf("%s\n", __func__); - setLed(context, 1, 0); - setLed(context, 2, 1); - setLed(context, 3, 0); - - if (private->nfs == 0) - { - destroySerial(); - net_standby(0); - } - - avs_standby(fd_avs, 0); - hdmi_standby(fd_hdmi, 0); - setText(context, " "); - - for (id = 0x10; id < 0x20; id++) - setIcon(context, id, 0); - - if (private->display == 0) - setLight(context, 0); - - close(fd_hdmi); - close(fd_avs); -} - -void stopPseudoStandby(Context_t *context, tUFS910Private *private) -{ - if (private->display == 0) - setLight(context, 1); - - setText(context, " "); - int id; - - for (id = 0x10; id < 0x20; id++) - setIcon(context, id, 0); - - setLed(context, 1, 0); - setLed(context, 2, 0); - setLed(context, 3, 0); - system(cmdReboot); - /* deactivated, because box will hang and remote control not longer works */ -#if 0 - int fd_avs = open("/proc/stb/avs/0/standby", O_RDWR); - int fd_hdmi = open("/dev/fb0", O_RDWR); - int id; - printf("%s\n", __func__); - - if (private->display == 0) - setLight(context, 1); - - setText(context, " "); - - for (id = 0x10; id < 0x20; id++) - setIcon(context, id, 0); - - hdmi_standby(fd_hdmi, 1); - avs_standby(fd_avs, 1); - - if (private->nfs == 0) - { - net_standby(1); - helloSerial(); - } - - setLed(context, 1, 0); - setLed(context, 2, 0); - setLed(context, 3, 0); - close(fd_hdmi); - close(fd_avs); -#endif -} - -/* ******************* driver functions ****************** */ - -static int init(Context_t *context) -{ - char cmdLine[512]; - int vFd; - tUFS910Private *private = malloc(sizeof(tUFS910Private)); -// printf("%s\n", __func__); - ((Model_t *)context->m)->private = private; - memset(private, 0, sizeof(tUFS910Private)); - vFd = open(cCMDLINE, O_RDWR); - private->nfs = 0; - - if (read(vFd, cmdLine, 512) > 0) - { - if (strstr("nfsroot", cmdLine) != NULL) - private->nfs = 1; - } - - close(vFd); - - if (private->nfs) - printf("mode = nfs\n"); - else - printf("mode = non-nfs\n"); - - vFd = open(cVFD_DEVICE, O_RDWR); - - if (vFd < 0) - { - fprintf(stderr, "Cannot open %s\n", cVFD_DEVICE); - perror(""); - } - - private->fd_green = open("/sys/class/leds/ufs910:green/brightness", O_WRONLY); - private->fd_red = open("/sys/class/leds/ufs910:red/brightness", O_WRONLY); - private->fd_yellow = open("/sys/class/leds/ufs910:orange/brightness", O_WRONLY); - private->vfd = vFd; - checkConfig(&private->display, &private->display_custom, &private->timeFormat, &private->wakeupDecrement); - return vFd; -} - -static int usage(Context_t *context, char *prg_name) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int setTime(Context_t *context, time_t *theGMTTime) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int getTime(Context_t *context, time_t *theGMTTime) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int setTimer(Context_t *context, time_t *theGMTTime) -{ - time_t curTime; - struct tm *ts; - tUFS910Private *private = (tUFS910Private *)((Model_t *)context->m)->private; - printf("%s\n", __func__); - time(&curTime); - ts = localtime(&curTime); - fprintf(stderr, "Current Time: %02d:%02d:%02d %02d-%02d-%04d\n", - ts->tm_hour, ts->tm_min, ts->tm_sec, ts->tm_mday, ts->tm_mon + 1, ts->tm_year + 1900); - startPseudoStandby(context, private); - - if (theGMTTime == NULL) - private->wakeupTime = read_timers_utc(curTime); - else - private->wakeupTime = *theGMTTime; - - Sleep(context, &private->wakeupTime); - stopPseudoStandby(context, private); - return 0; -} - -static int getTimer(Context_t *context, time_t *theGMTTime) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int shutdown(Context_t *context, time_t *shutdownTimeGMT) -{ - time_t curTime; - printf("%s\n", __func__); - - /* shutdown immediately */ - if (*shutdownTimeGMT == -1) - system(cmdHalt); - - while (1) - { - time(&curTime); - - if (curTime >= *shutdownTimeGMT) - { - system(cmdHalt); - } - - usleep(100000); - } - - return -1; -} - -static int reboot(Context_t *context, time_t *rebootTimeGMT) -{ - time_t curTime; - -// printf("%s\n", __func__); - while (1) - { - time(&curTime); - - if (curTime >= *rebootTimeGMT) - { - system(cmdReboot); - } - - usleep(100000); - } - - return 0; -} - -static int Sleep(Context_t *context, time_t *wakeUpGMT) -{ - time_t curTime; - int sleep = 1; - int vFd; - fd_set rfds; - struct timeval tv; - int retval, len, i; - struct tm *ts; - char output[cMAXCharsUFS910 + 1]; - struct input_event data[64]; - tUFS910Private *private = (tUFS910Private *)((Model_t *)context->m)->private; - printf("%s\n", __func__); - output[cMAXCharsUFS910] = '\0'; - vFd = open("/dev/input/event0", O_RDONLY); - - if (vFd < 0) - { - perror("event0"); - return -1; - } - - while (sleep) - { - time(&curTime); - ts = localtime(&curTime); - - if (curTime >= *wakeUpGMT) - { - sleep = 0; - } - else - { - FD_ZERO(&rfds); - FD_SET(vFd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 100000; - retval = select(vFd + 1, &rfds, NULL, NULL, &tv); - - if (retval > 0) - { - len = read(vFd, data, sizeof(struct input_event) * 64); - - for (i = 0; i < len / sizeof(struct input_event); i++) - { - if (data[i].type == EV_SYN) - { - /* noop */ - } - else if (data[i].type == EV_MSC && (data[i].code == MSC_RAW || data[i].code == MSC_SCAN)) - { - /* noop */ - } - else - { - if (data[i].code == 116) - sleep = 0; - } - } - } - } - - if (private->display) - { - strftime(output, cMAXCharsUFS910 + 1, private->timeFormat, ts); - write(private->vfd, &output, sizeof(output)); - } - } - - return 0; -} - -static int setText(Context_t *context, char *theText) -{ - struct vfd_ioctl_data data; - tUFS910Private *private = (tUFS910Private *)((Model_t *)context->m)->private; - memset(data.data, ' ', 63); - memcpy(data.data, theText, strlen(theText)); - data.start = 0; - data.length = strlen(theText); - - if (ioctl(private->vfd, VFDDISPLAYCHARS, &data) < 0) - { - perror("setText: "); - return -1; - } - - return 0; -} - -static int setLed(Context_t *context, int which, int on) -{ - tUFS910Private *private = (tUFS910Private *)((Model_t *)context->m)->private; - printf("%s\n", __func__); - - if (which == 1) - write(private->fd_green, on == 0 ? "0" : "1", 1); - else if (which == 2) - write(private->fd_red, on == 0 ? "0" : "1", 1); - else if (which == 3) - write(private->fd_yellow, on == 0 ? "0" : "1", 1); - else - return -1; - - return 0; -} - -static int setIcon(Context_t *context, int which, int on) -{ - struct vfd_ioctl_data data; - tUFS910Private *private = (tUFS910Private *)((Model_t *)context->m)->private; - printf("%s\n", __func__); - memset(data.data, ' ', 63); - data.start = 0; - data.length = 5; - data.data[0] = which & 0x0f; - data.data[4] = on; - - if (ioctl(private->vfd, VFDICONDISPLAYONOFF, &data) < 0) - { - perror("setIcon: "); - return -1; - } - - return 0; -} - -static int setBrightness(Context_t *context, int brightness) -{ - struct vfd_ioctl_data data; - tUFS910Private *private = (tUFS910Private *)((Model_t *)context->m)->private; - printf("%s\n", __func__); - - if (brightness < 0 || brightness > 7) - return -1; - - memset(data.data, ' ', 63); - data.start = brightness & 0x07; - data.length = 0; - - if (ioctl(private->vfd, VFDBRIGHTNESS, &data) < 0) - { - perror("setBrightness: "); - return -1; - } - - return 0; -} - -static int setPwrLed(Context_t *context, int brightness) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int setLight(Context_t *context, int on) -{ - struct vfd_ioctl_data data; - tUFS910Private *private = (tUFS910Private *)((Model_t *)context->m)->private; - printf("%s\n", __func__); - memset(&data, 0, sizeof(struct vfd_ioctl_data)); - - if (on) - data.start = 0x01; - else - data.start = 0x00; - - data.length = 0; - - if (ioctl(private->vfd, VFDDISPLAYWRITEONOFF, &data) < 0) - { - perror("setLight: "); - return -1; - } - - return 0; -} - -static int Exit(Context_t *context) -{ - tUFS910Private *private = (tUFS910Private *)((Model_t *)context->m)->private; - printf("%s\n", __func__); - - if (context->fd > 0) - close(context->fd); - - if (private->vfd > 0) - close(private->vfd); - - close(private->fd_green); - close(private->fd_red); - close(private->fd_yellow); - free(private); - return 1; -} - -static int Clear(Context_t *context) -{ - int i; - setText(context, " "); - setBrightness(context, 7); - - for (i = 1; i <= 3 ; i++) - setLed(context, i, 0); - - for (i = 1; i <= 16 ; i++) - setIcon(context, i, 0); - - return 0; -} - -Model_t Ufs910_14W_model = -{ - .Name = "Kathrein UFS910 14W frontpanel control utility", - .Type = Ufs910_14W, - .Init = init, - .Clear = Clear, - .Usage = usage, - .SetTime = setTime, - .GetTime = getTime, - .SetTimer = setTimer, - .GetTimer = getTimer, - .Shutdown = shutdown, - .Reboot = reboot, - .Sleep = Sleep, - .SetText = setText, - .SetLed = setLed, - .SetIcon = setIcon, - .SetBrightness = setBrightness, - .SetPwrLed = setPwrLed, - .SetLight = setLight, - .Exit = Exit, - .SetLedBrightness = NULL, - .SetRF = NULL, - .SetFan = NULL, - .private = NULL -}; diff --git a/fp_control/Ufs910_1W.c b/fp_control/Ufs910_1W.c deleted file mode 100644 index 473167e..0000000 --- a/fp_control/Ufs910_1W.c +++ /dev/null @@ -1,462 +0,0 @@ -/* - * Ufs910_1W.c - * - * (c) 2009 dagobert@teamducktales - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/******************** includes ************************ */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "global.h" - -static int setText(Context_t *context, char *theText); - -/******************** constants ************************ */ -#define cTTY_DEVICE "/dev/ttyAS1" -#define cVFD_DEVICE "/dev/vfd" - -#define cMAXCharsUFS910 16 - -//#define cmdReboot "/sbin/reboot" /* does not currently work */ -#define cmdReboot "init 6" - -typedef struct -{ - int vfd; - - int display; - int display_custom; - char *timeFormat; - time_t wakeupTime; - int wakeupDecrement; -} tUFS910Private; - -typedef struct -{ - char *ledOn; - char *ledOff; -} tUFS910Leds; - -#define cGreen 1 -#define cRed 2 -#define cYellow 3 - -tUFS910Leds led[] = -{ - {/* cGreen ,*/ "1", "A" }, - {/* cRed ,*/ "2", "B" }, - {/* cYellow,*/ "3", "C" } -}; - -/* ******************* helper/misc functions ****************** */ - -static int setTemFlagsKathrein(int fd) -{ - struct termios old_io; - struct termios new_io; - - if ((tcgetattr(fd, &old_io)) == 0) - { - new_io = old_io; - printf("Setting new flags\n"); - /* c_iflags ->input flags */ - new_io.c_iflag &= ~(IMAXBEL | BRKINT | ICRNL); - /* c_lflags ->local flags*/ - new_io.c_lflag &= ~(ECHO | IEXTEN); - /* c_oflags ->output flags*/ - new_io.c_oflag &= ~(ONLCR); - /* c_cflags ->constant flags*/ - new_io.c_cflag = B19200; - tcsetattr(fd, TCSANOW, &new_io); - } - else - printf("Error setting raw mode.\n"); - - return 0; -} - -/* ******************* driver functions ****************** */ - -static int init(Context_t *context) -{ - int vFd; - tUFS910Private *private = malloc(sizeof(tUFS910Private)); - ((Model_t *)context->m)->private = private; - memset(private, 0, sizeof(tUFS910Private)); - vFd = open(cTTY_DEVICE, O_RDWR); - - if (vFd < 0) - { - fprintf(stderr, "cannot open %s\n", cTTY_DEVICE); - perror(""); - } - - setTemFlagsKathrein(vFd); - private->vfd = open(cVFD_DEVICE, O_RDWR); - - if (private->vfd < 0) - { - fprintf(stderr, "Cannot open %s\n", cVFD_DEVICE); - perror(""); - } - - checkConfig(&private->display, &private->display_custom, &private->timeFormat, &private->wakeupDecrement); - return vFd; -} - -static int usage(Context_t *context, char *prg_name) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int setTime(Context_t *context, time_t *theGMTTime) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int getTime(Context_t *context, time_t *theGMTTime) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int setTimer(Context_t *context, time_t *theGMTTime) -{ - time_t curTime; - time_t wakeupTime; - struct tm *ts; - unsigned long int diffTm; - unsigned char uTime0, uTime1, uTime2, uTime3; - char cTime[6]; -// tUFS910Private *private = (tUFS910Private *)((Model_t *)context->m)->private; - time(&curTime); - ts = localtime(&curTime); - fprintf(stderr, "Current Time: %02d:%02d:%02d %02d-%02d-%04d\n", - ts->tm_hour, ts->tm_min, ts->tm_sec, ts->tm_mday, ts->tm_mon + 1, ts->tm_year + 1900); - - if (theGMTTime == NULL) - wakeupTime = read_timers_utc(curTime); - else - wakeupTime = *theGMTTime; - - if ((wakeupTime <= 0) || (wakeupTime == LONG_MAX)) - wakeupTime = read_fake_timer_utc(curTime); - - if (curTime > wakeupTime) - { - printf("System time wrong -> Reboot\n"); - diffTm = 5; - } - else - diffTm = (unsigned long int) wakeupTime - curTime; - - printf("Time difference: %ld\n", diffTm); - uTime0 = diffTm % 256; - uTime1 = (diffTm / 256) % 256; - uTime2 = ((diffTm / 256) / 256) % 256; - uTime3 = (((diffTm / 256) / 256) / 256) % 256; - printf("%03d %03d %03d %03d\n", uTime3, uTime2, uTime1, uTime0); - cTime[0] = 'Q'; - cTime[1] = uTime3; - cTime[2] = uTime2; - cTime[3] = uTime1; - cTime[4] = uTime0; - - printf("Goodbye\n"); - - sleep(1); - - /* SWITCH ON RED LED */ - write(context->fd, "2" , 1); - usleep(1000); - write(context->fd, &cTime[0], 1); - usleep(1000); - write(context->fd, &cTime[1], 1); - usleep(1000); - write(context->fd, &cTime[2], 1); - usleep(1000); - write(context->fd, &cTime[3], 1); - usleep(1000); - write(context->fd, &cTime[4], 1); - return 0; -} - -static int getTimer(Context_t *context, time_t *theGMTTime) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int shutdown(Context_t *context, time_t *shutdownTimeGMT) -{ - time_t curTime; - - /* shutdown immediately */ - if (*shutdownTimeGMT == -1) - return (setTimer(context, NULL)); - - while (1) - { - time(&curTime); - - if (curTime >= *shutdownTimeGMT) - { - /* set most recent e2 timer and bye bye */ - return (setTimer(context, NULL)); - } - - usleep(100000); - } - - return -1; -} - -static int reboot(Context_t *context, time_t *rebootTimeGMT) -{ - time_t curTime; - - while (1) - { - time(&curTime); - - if (curTime >= *rebootTimeGMT) - { - system(cmdReboot); - } - - usleep(100000); - } - - return 0; -} - -static int Sleep(Context_t *context, time_t *wakeUpGMT) -{ - time_t curTime; - int sleep = 1; - fd_set rfds; - struct timeval tv; - int retval; - struct tm *ts; - char output[cMAXCharsUFS910 + 1]; - tUFS910Private *private = (tUFS910Private *) - ((Model_t *)context->m)->private; - - while (sleep) - { - time(&curTime); - ts = localtime(&curTime); - - if (curTime >= *wakeUpGMT) - { - sleep = 0; - } - else - { - FD_ZERO(&rfds); - FD_SET(context->fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 100000; - retval = select(context->fd + 1, &rfds, NULL, NULL, &tv); - - if (retval > 0) - { - sleep = 0; - } - } - - if (private->display) - { - strftime(output, cMAXCharsUFS910 + 1, private->timeFormat, ts); - setText(context, output); - } - } - - return 0; -} - -static int setText(Context_t *context, char *theText) -{ - struct vfd_ioctl_data data; - tUFS910Private *private = (tUFS910Private *) - ((Model_t *)context->m)->private; - memset(data.data, ' ', 63); - memcpy(data.data, theText, strlen(theText)); - data.start = 0; - data.length = strlen(theText); - - if (ioctl(private->vfd, VFDDISPLAYCHARS, &data) < 0) - { - perror("setText: "); - return -1; - } - - return 0; -} - -static int setLed(Context_t *context, int which, int on) -{ - if (which < cGreen || which > cYellow) - return -1; - - if (on) - write(context->fd, led[which - 1].ledOn, 1); - else - write(context->fd, led[which - 1].ledOff, 1); - - return 0; -} - -static int setIcon(Context_t *context, int which, int on) -{ - struct vfd_ioctl_data data; - tUFS910Private *private = (tUFS910Private *) - ((Model_t *)context->m)->private; - memset(data.data, ' ', 63); - data.start = 0; - data.length = 5; - data.data[0] = which & 0x0f; - data.data[4] = on; - - if (ioctl(private->vfd, VFDICONDISPLAYONOFF, &data) < 0) - { - perror("setIcon: "); - return -1; - } - - return 0; -} - -static int setBrightness(Context_t *context, int brightness) -{ - struct vfd_ioctl_data data; - tUFS910Private *private = (tUFS910Private *) - ((Model_t *)context->m)->private; - - if (brightness < 0 || brightness > 7) - return -1; - - memset(data.data, ' ', 63); - data.start = brightness & 0x07; - data.length = 0; - - if (ioctl(private->vfd, VFDBRIGHTNESS, &data) < 0) - { - perror("setBrightness: "); - return -1; - } - - return 0; -} - -static int setPwrLed(Context_t *context, int brightness) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int setLight(Context_t *context, int on) -{ - struct vfd_ioctl_data data; - tUFS910Private *private = (tUFS910Private *)((Model_t *)context->m)->private; - memset(&data, 0, sizeof(struct vfd_ioctl_data)); - - if (on) - data.start = 0x01; - else - data.start = 0x00; - - data.length = 0; - - if (ioctl(private->vfd, VFDDISPLAYWRITEONOFF, &data) < 0) - { - perror("setLight: "); - return -1; - } - - return 0; -} - -static int Exit(Context_t *context) -{ - tUFS910Private *private = (tUFS910Private *) - ((Model_t *)context->m)->private; - - if (private->vfd > 0) - close(private->vfd); - - if (context->fd > 0) - close(context->fd); - - free(private); - return 1; -} - -static int Clear(Context_t *context) -{ - int i; - setText(context, " "); - setBrightness(context, 7); - - for (i = 1; i <= 3 ; i++) - setLed(context, i, 0); - - for (i = 1; i <= 16 ; i++) - setIcon(context, i, 0); - - return 0; -} - -Model_t Ufs910_1W_model = -{ - .Name = "Kathrein UFS910 1W frontpanel control utility", - .Type = Ufs910_1W, - .Init = init, - .Clear = Clear, - .Usage = usage, - .SetTime = setTime, - .GetTime = getTime, - .SetTimer = setTimer, - .GetTimer = getTimer, - .Shutdown = shutdown, - .Reboot = reboot, - .Sleep = Sleep, - .SetText = setText, - .SetLed = setLed, - .SetIcon = setIcon, - .SetBrightness = setBrightness, - .SetPwrLed = setPwrLed, - .SetLight = setLight, - .Exit = Exit, - .SetLedBrightness = NULL, - .SetRF = NULL, - .SetFan = NULL, - .private = NULL -}; diff --git a/fp_control/Ufs912.c b/fp_control/Ufs912.c deleted file mode 100644 index 20ad61f..0000000 --- a/fp_control/Ufs912.c +++ /dev/null @@ -1,574 +0,0 @@ -/* - * Ufs912.c - * - * (c) 2009 dagobert@teamducktales - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/******************** includes ************************ */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "global.h" -#include "Ufs912.h" - -static int setText(Context_t *context, char *theText); -static int Clear(Context_t *context); -static int setIcon(Context_t *context, int which, int on); - -/******************** constants ************************ */ - -#define cVFD_DEVICE "/dev/vfd" -#define cEVENT_DEVICE "/dev/input/event0" - -#define cMAXCharsUFS912 16 - -typedef struct -{ - int display; - int display_custom; - char *timeFormat; - - time_t wakeupTime; - int wakeupDecrement; -} tUFS912Private; - -/* ******************* helper/misc functions ****************** */ - -static void setMode(int fd) -{ - struct micom_ioctl_data micom; - micom.u.mode.compat = 1; - - if (ioctl(fd, VFDSETMODE, &micom) < 0) - { - perror("setMode: "); - } -} - -/* calculate the time value which we can pass to - * the micom fp. its a mjd time (mjd=modified - * julian date). mjd is relativ to gmt so theGMTTime - * must be in GMT/UTC. - */ -static void setMicomTime(time_t theGMTTime, char *destString) -{ - /* from u-boot micom */ - struct tm *now_tm; - now_tm = gmtime(&theGMTTime); - //printf("Set Time (UTC): %02d:%02d:%02d %02d-%02d-%04d\n", - // now_tm->tm_hour, now_tm->tm_min, now_tm->tm_sec, now_tm->tm_mday, now_tm->tm_mon+1, now_tm->tm_year+1900); - double mjd = modJulianDate(now_tm); - int mjd_int = mjd; - destString[0] = (mjd_int >> 8); - destString[1] = (mjd_int & 0xff); - destString[2] = now_tm->tm_hour; - destString[3] = now_tm->tm_min; - destString[4] = now_tm->tm_sec; -} - -static unsigned long getMicomTime(char *micomTimeString) -{ - unsigned int mjd = ((micomTimeString[1] & 0xFF) * 256) + (micomTimeString[2] & 0xFF); - unsigned long epoch = ((mjd - 40587) * 86400); - unsigned int hour = micomTimeString[3] & 0xFF; - unsigned int min = micomTimeString[4] & 0xFF; - unsigned int sec = micomTimeString[5] & 0xFF; - epoch += (hour * 3600 + min * 60 + sec); - //printf( "MJD = %d epoch = %ld, time = %02d:%02d:%02d\n", mjd, - // epoch, hour, min, sec ); - return epoch; -} - -/* ******************* driver functions ****************** */ - -static int init(Context_t *context) -{ - tUFS912Private *private = malloc(sizeof(tUFS912Private)); - int vFd; - printf("%s\n", __func__); - vFd = open(cVFD_DEVICE, O_RDWR); - - if (vFd < 0) - { - fprintf(stderr, "Cannot open %s\n", cVFD_DEVICE); - perror(""); - } - - ((Model_t *)context->m)->private = private; - memset(private, 0, sizeof(tUFS912Private)); - checkConfig(&private->display, &private->display_custom, &private->timeFormat, &private->wakeupDecrement); - return vFd; -} -#if 0 -static int usage(Context_t *context, char *prg_name) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} -#endif -static int setTime(Context_t *context, time_t *theGMTTime) -{ - struct micom_ioctl_data vData; - setMicomTime(*theGMTTime, vData.u.time.time); - fprintf(stderr, "Setting Current Fp Time to = %02X%02X %d %d %d (mtime)\n", - vData.u.standby.time[0], vData.u.standby.time[1], vData.u.standby.time[2], - vData.u.standby.time[3], vData.u.standby.time[4]); - - if (ioctl(context->fd, VFDSETTIME, &vData) < 0) - { - perror("settime: "); - return -1; - } - - return 0; -} - -static int getTime(Context_t *context, time_t *theGMTTime) -{ - char fp_time[8]; - -// fprintf(stderr, "Waiting for current time from fp\n"); - /* front controller time */ - if (ioctl(context->fd, VFDGETTIME, &fp_time) < 0) - { - perror("gettime: "); - return -1; - } - - /* if we get the fp time */ - if (fp_time[0] != '\0') - { - fprintf(stderr, "success reading time from fp\n"); - /* current front controller time */ - *theGMTTime = (time_t) getMicomTime(fp_time); - } - else - { - fprintf(stderr, "error reading time from fp\n"); - *theGMTTime = 0; - } - - return 0; -} - -static int setTimer(Context_t *context, time_t *theGMTTime) -{ - struct micom_ioctl_data vData; - time_t curTime = 0; - time_t curTimeFp = 0; - time_t wakeupTime = 0; - struct tm *ts; - struct tm *tsFp; - struct tm *tsWakeupTime; -// tUFS912Private *private = (tUFS912Private *)((Model_t *)context->m)->private; - printf("%s ->\n", __func__); - // Get current Frontpanel time - getTime(context, &curTimeFp); - tsFp = gmtime(&curTimeFp); - fprintf(stderr, "Current Fp Time: %02d:%02d:%02d %02d-%02d-%04d (UTC)\n", - tsFp->tm_hour, tsFp->tm_min, tsFp->tm_sec, tsFp->tm_mday, tsFp->tm_mon + 1, tsFp->tm_year + 1900); - // Get current Linux time - time(&curTime); - ts = gmtime(&curTime); - fprintf(stderr, "Current Linux Time: %02d:%02d:%02d %02d-%02d-%04d (UTC)\n", - ts->tm_hour, ts->tm_min, ts->tm_sec, ts->tm_mday, ts->tm_mon + 1, ts->tm_year + 1900); - // Set current Linux time as new current Frontpanel time - setTime(context, &curTime); - - if (theGMTTime == NULL) - wakeupTime = read_timers_utc(curTime); - else - wakeupTime = *theGMTTime; - - if ((wakeupTime <= 0) || (wakeupTime == LONG_MAX)) - { - /* clear timer */ - vData.u.standby.time[0] = '\0'; - } - else - { - // Print wakeup time - tsWakeupTime = gmtime(&wakeupTime); - fprintf(stderr, "Planned Wakeup Time: %02d:%02d:%02d %02d-%02d-%04d (UTC)\n", - tsWakeupTime->tm_hour, tsWakeupTime->tm_min, tsWakeupTime->tm_sec, tsWakeupTime->tm_mday, tsWakeupTime->tm_mon + 1, tsWakeupTime->tm_year + 1900); - setMicomTime(wakeupTime, vData.u.standby.time); - fprintf(stderr, "Setting Planned Fp Wakeup Time to = %02X%02X %d %d %d (mtime)\n", - vData.u.standby.time[0], vData.u.standby.time[1], vData.u.standby.time[2], - vData.u.standby.time[3], vData.u.standby.time[4]); - } - - fprintf(stderr, "Entering DeepStandby. ... good bye ...\n"); - fflush(stdout); - fflush(stderr); - sleep(2); - - if (ioctl(context->fd, VFDSTANDBY, &vData) < 0) - { - perror("standby: "); - return -1; - } - - return 0; -} - -static int getTimer(Context_t *context, time_t *theGMTTime) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int shutdown(Context_t *context, time_t *shutdownTimeGMT) -{ - time_t curTime; - - /* shutdown immediate */ - if (*shutdownTimeGMT == -1) - return (setTimer(context, NULL)); - - while (1) - { - time(&curTime); - - /*printf("curTime = %d, shutdown %d\n", curTime, *shutdownTimeGMT);*/ - - if (curTime >= *shutdownTimeGMT) - { - /* set most recent e2 timer and bye bye */ - return (setTimer(context, NULL)); - } - - usleep(100000); - } - - return -1; -} - -static int reboot(Context_t *context, time_t *rebootTimeGMT) -{ - time_t curTime; - struct micom_ioctl_data vData; - - while (1) - { - time(&curTime); - - if (curTime >= *rebootTimeGMT) - { - if (ioctl(context->fd, VFDREBOOT, &vData) < 0) - { - perror("reboot: "); - return -1; - } - } - - usleep(100000); - } - - return 0; -} - -static int Sleep(Context_t *context, time_t *wakeUpGMT) -{ - time_t curTime; - int sleep = 1; - int vFd; - fd_set rfds; - struct timeval tv; - int retval, i, rd; - struct tm *ts; - char output[cMAXCharsUFS912 + 1]; - struct input_event ev[64]; - tUFS912Private *private = (tUFS912Private *)((Model_t *)context->m)->private; -// printf("%s\n", __func__); - vFd = open(cEVENT_DEVICE, O_RDWR); - - if (vFd < 0) - { - fprintf(stderr, "cannot open %s\n", cEVENT_DEVICE); - perror(""); - return -1; - } - - printf("%s 1\n", __func__); - - while (sleep) - { - time(&curTime); - ts = localtime(&curTime); - - if (curTime >= *wakeUpGMT) - { - sleep = 0; - } - else - { - FD_ZERO(&rfds); - FD_SET(vFd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 100000; - retval = select(vFd + 1, &rfds, NULL, NULL, &tv); - - if (retval > 0) - { - rd = read(vFd, ev, sizeof(struct input_event) * 64); - - if (rd < (int) sizeof(struct input_event)) - { - continue; - } - - for (i = 0; i < rd / sizeof(struct input_event); i++) - { - if (ev[i].type == EV_SYN) - { - } - else if (ev[i].type == EV_MSC && (ev[i].code == MSC_RAW || ev[i].code == MSC_SCAN)) - { - } - else - { - if (ev[i].code == 116) - sleep = 0; - } - } - } - } - - if (private->display) - { - strftime(output, cMAXCharsUFS912 + 1, private->timeFormat, ts); - setText(context, output); - } - } - - return 0; -} - -static int setText(Context_t *context, char *theText) -{ - char vHelp[128]; - strncpy(vHelp, theText, cMAXCharsUFS912); - vHelp[cMAXCharsUFS912] = '\0'; - /* printf("%s, %d\n", vHelp, strlen(vHelp));*/ - write(context->fd, vHelp, strlen(vHelp)); - return 0; -} - -static int setLed(Context_t *context, int which, int on) -{ - struct micom_ioctl_data vData; - vData.u.led.led_nr = which; - vData.u.led.on = on; - setMode(context->fd); - - if (ioctl(context->fd, VFDSETLED, &vData) < 0) - { - perror("setLed: "); - return -1; - } - - return 0; -} - -static int setIcon(Context_t *context, int which, int on) -{ - struct micom_ioctl_data vData; - vData.u.icon.icon_nr = which; - vData.u.icon.on = on; - setMode(context->fd); - - if (ioctl(context->fd, VFDICONDISPLAYONOFF, &vData) < 0) - { - perror("setIcon: "); - return -1; - } - - return 0; -} - -static int setBrightness(Context_t *context, int brightness) -{ - struct micom_ioctl_data vData; - - if (brightness < 0 || brightness > 7) - return -1; - - vData.u.brightness.level = brightness; - setMode(context->fd); - printf("%d\n", context->fd); - - if (ioctl(context->fd, VFDBRIGHTNESS, &vData) < 0) - { - perror("setBrightness: "); - return -1; - } - - return 0; -} - -static int setLight(Context_t *context, int on) -{ - if (on) - setBrightness(context, 7); - else - setBrightness(context, 0); - - return 0; -} - -/* 0xc1 = rcu - * 0xc2 = front - * 0xc3 = time - * 0xc4 = ac ??? - */ -static int getWakeupReason(Context_t *context, eWakeupReason *reason) -{ - char mode[8]; - fprintf(stderr, "waiting on wakeupmode from fp ...\n"); - - /* front controller time */ - if (ioctl(context->fd, VFDGETWAKEUPMODE, &mode) < 0) - { - perror("getWakeupReason: "); - return -1; - } - - /* if we get the fp time */ - if (mode[0] != '\0') - { - fprintf(stderr, "Success reading wakeupmode from fp\n"); - *reason = mode[1] & 0xff; - printf("reason = 0x%x\n", *reason); - } - else - { - fprintf(stderr, "Error reading wakeupmode from fp\n"); - *reason = 0; - } - - return 0; -} - -static int getVersion(Context_t *context, int *version) -{ - char strVersion[8]; - -// fprintf(stderr, "Waiting for version info from fp ...\n"); - /* front controller version */ - if (ioctl(context->fd, VFDGETVERSION, &strVersion) < 0) - { - perror("getVersion: "); - return -1; - } - - /* if we get the fp time */ - if (strVersion[0] != '\0') - { - fprintf(stderr, "Success reading version from fp\n"); - *version = strVersion[1] * 10 | strVersion[2]; - printf("Version = %d\n", *version); - } - else - { - fprintf(stderr, "Error reading version from fp\n"); - *version = 0; - } - - return 0; -} - -static int Exit(Context_t *context) -{ - tUFS912Private *private = (tUFS912Private *)((Model_t *)context->m)->private; - - if (context->fd > 0) - close(context->fd); - - free(private); - return 1; -} - -static int Clear(Context_t *context) -{ - int i; - setText(context, " "); - - for (i = 2; i <= 5 ; i++) - setLed(context, i, 0); - - for (i = 1; i <= 16 ; i++) - setIcon(context, i, 0); - - return 0; -} - -static int setLedBrightness(Context_t *context, int brightness) -{ - struct micom_ioctl_data vData; - - if (brightness < 0 || brightness > 0xff) - return -1; - - vData.u.brightness.level = brightness; - setMode(context->fd); - printf("%d\n", context->fd); - - if (ioctl(context->fd, VFDLEDBRIGHTNESS, &vData) < 0) - { - perror("setledbrightness: "); - return -1; - } - - return 0; -} - -Model_t UFS912_model = -{ - .Name = "Kathrein UFS912 frontpanel control utility", - .Type = Ufs912, - .Init = init, - .Clear = Clear, - .Usage = NULL, - .SetTime = setTime, - .GetTime = getTime, - .SetTimer = setTimer, - .GetTimer = getTimer, - .Shutdown = shutdown, - .Reboot = reboot, - .Sleep = Sleep, - .SetText = setText, - .SetLed = setLed, - .SetIcon = setIcon, - .SetBrightness = setBrightness, - .SetPwrLed = NULL, - .GetWakeupReason = getWakeupReason, //TODO: CHECK IF WORKING - .SetLight = setLight, - .Exit = Exit, - .SetLedBrightness = setLedBrightness, - .GetVersion = getVersion, - .private = NULL -}; diff --git a/fp_control/Ufs912.h b/fp_control/Ufs912.h deleted file mode 100644 index 46ca50b..0000000 --- a/fp_control/Ufs912.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef __ufs912__ -#define __ufs912__ - -#define VFDGETVERSION 0xc0425af7 - -/* this setups the mode temporarily (for one ioctl) - * to the desired mode. currently the "normal" mode - * is the compatible vfd mode - */ -struct set_mode_s -{ - int compat; /* 0 = compatibility mode to vfd driver; 1 = micom mode */ -}; - -struct set_brightness_s -{ - int level; -}; - -struct set_icon_s -{ - int icon_nr; - int on; -}; - -struct set_led_s -{ - int led_nr; - int on; -}; - -/* time must be given as follows: - * time[0] & time[1] = mjd ??? - * time[2] = hour - * time[3] = min - * time[4] = sec - */ -struct set_standby_s -{ - char time[5]; -}; - -struct set_time_s -{ - char time[5]; -}; - - -struct micom_ioctl_data -{ - union - { - struct set_icon_s icon; - struct set_led_s led; - struct set_brightness_s brightness; - struct set_mode_s mode; - struct set_standby_s standby; - struct set_time_s time; - } u; -}; - - -#endif diff --git a/fp_control/Ufs922.c b/fp_control/Ufs922.c deleted file mode 100644 index cc9011f..0000000 --- a/fp_control/Ufs922.c +++ /dev/null @@ -1,584 +0,0 @@ -/* - * Ufs922.c - * - * (c) 2009 dagobert@teamducktales - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/******************** includes ************************ */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "global.h" -#include "Ufs922.h" - -static int setText(Context_t *context, char *theText); -static int Clear(Context_t *context); -static int setIcon(Context_t *context, int which, int on); - -/******************** constants ************************ */ - -#define cVFD_DEVICE "/dev/vfd" -#define cEVENT_DEVICE "/dev/input/event0" - -#define WAKEUPFILE "/var/wakeup" -#define WAS_TIMER_WAKEUP "/proc/stb/fp/was_timer_wakeup" - -#define cMAXCharsUFS922 16 - -typedef struct -{ - int display; - int display_custom; - char *timeFormat; - - time_t wakeupTime; - int wakeupDecrement; -} tUFS922Private; - -/* ******************* helper/misc functions ****************** */ - -static void setMode(int fd) -{ - struct micom_ioctl_data micom; - micom.u.mode.compat = 1; - - if (ioctl(fd, VFDSETMODE, &micom) < 0) - { - perror("setMode: "); - } -} - -/* Calculate the time value which we can pass to - * the micom fp. its a mjd time (mjd=modified - * julian date). mjd is relativ to gmt so theGMTTime - * must be in GMT/UTC. - */ -void setMicomTime(time_t theGMTTime, char *destString) -{ - /* from u-boot micom */ - struct tm *now_tm; - now_tm = gmtime(&theGMTTime); - printf("Set Time (UTC): %02d:%02d:%02d %02d-%02d-%04d\n", - now_tm->tm_hour, now_tm->tm_min, now_tm->tm_sec, now_tm->tm_mday, now_tm->tm_mon + 1, now_tm->tm_year + 1900); - double mjd = modJulianDate(now_tm); - int mjd_int = mjd; - destString[0] = (mjd_int >> 8); - destString[1] = (mjd_int & 0xff); - destString[2] = now_tm->tm_hour; - destString[3] = now_tm->tm_min; - destString[4] = now_tm->tm_sec; -} - -unsigned long getMicomTime(char *micomTimeString) -{ - unsigned int mjd = ((micomTimeString[1] & 0xFF) * 256) + (micomTimeString[2] & 0xFF); - unsigned long epoch = ((mjd - 40587) * 86400); - unsigned int hour = micomTimeString[3] & 0xFF; - unsigned int min = micomTimeString[4] & 0xFF; - unsigned int sec = micomTimeString[5] & 0xFF; - epoch += (hour * 3600 + min * 60 + sec); - printf("MJD = %d epoch = %ld, time = %02d:%02d:%02d\n", mjd, - epoch, hour, min, sec); - return epoch; -} - -/* ******************* driver functions ****************** */ - -static int init(Context_t *context) -{ - tUFS922Private *private = malloc(sizeof(tUFS922Private)); - int vFd; -// printf("%s\n", __func__); - vFd = open(cVFD_DEVICE, O_RDWR); - - if (vFd < 0) - { - fprintf(stderr, "cannot open %s\n", cVFD_DEVICE); - perror(""); - } - - ((Model_t *)context->m)->private = private; - memset(private, 0, sizeof(tUFS922Private)); - checkConfig(&private->display, &private->display_custom, &private->timeFormat, &private->wakeupDecrement); - return vFd; -} - -static int usage(Context_t *context, char *prg_name) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int setTime(Context_t *context, time_t *theGMTTime) -{ - struct micom_ioctl_data vData; - printf("%s\n", __func__); - setMicomTime(*theGMTTime, vData.u.time.time); - - if (ioctl(context->fd, VFDSETTIME, &vData) < 0) - { - perror("settime: "); - return -1; - } - - return 0; -} - -static int getTime(Context_t *context, time_t *theGMTTime) -{ - char fp_time[8]; - fprintf(stderr, "Waiting on current time from fp...\n"); - - /* front controller time */ - if (ioctl(context->fd, VFDGETTIME, &fp_time) < 0) - { - perror("gettime: "); - return -1; - } - - /* if we get the fp time */ - if (fp_time[0] != '\0') - { -// fprintf(stderr, "Success reading time from fp\n"); - /* current front controller time */ - *theGMTTime = (time_t) getMicomTime(fp_time); - } - else - { - fprintf(stderr, "Error reading time from fp\n"); - *theGMTTime = 0; - } - - return 0; -} - -static int setTimer(Context_t *context, time_t *theGMTTime) -{ - struct micom_ioctl_data vData; - time_t curTime = 0; - time_t curTimeFp = 0; - time_t wakeupTime = 0; - struct tm *ts; - struct tm *tsFp; - struct tm *tsWakeupTime; -// tUFS922Private *private = (tUFS922Private *)((Model_t *)context->m)->private; - printf("%s ->\n", __func__); - // Get current Frontpanel time - getTime(context, &curTimeFp); - tsFp = gmtime(&curTimeFp); - fprintf(stderr, "Current Fp Time: %02d:%02d:%02d %02d-%02d-%04d (UTC)\n", - tsFp->tm_hour, tsFp->tm_min, tsFp->tm_sec, - tsFp->tm_mday, tsFp->tm_mon + 1, tsFp->tm_year + 1900); - // Get current Linux time - time(&curTime); - ts = gmtime(&curTime); - fprintf(stderr, "Current Linux Time: %02d:%02d:%02d %02d-%02d-%04d (UTC)\n", - ts->tm_hour, ts->tm_min, ts->tm_sec, - ts->tm_mday, ts->tm_mon + 1, ts->tm_year + 1900); - // Set current Linux time as new current Frontpanel time - setTime(context, &curTime); - - if (theGMTTime == NULL) - wakeupTime = read_timers_utc(curTime); - else - wakeupTime = *theGMTTime; - - if ((wakeupTime <= 0) || (wakeupTime == LONG_MAX)) - { - /* clear timer */ - vData.u.standby.time[0] = '\0'; - } - else - { - // Print wakeup time - tsWakeupTime = gmtime(&wakeupTime); - fprintf(stderr, "Planned Wakeup Time: %02d:%02d:%02d %02d-%02d-%04d (UTC)\n", - tsWakeupTime->tm_hour, tsWakeupTime->tm_min, tsWakeupTime->tm_sec, - tsWakeupTime->tm_mday, tsWakeupTime->tm_mon + 1, tsWakeupTime->tm_year + 1900); - setMicomTime(wakeupTime, vData.u.standby.time); - fprintf(stderr, "Setting Planned Fp Wakeup Time to = %02X%02X %d %d %d (mtime)\n", - vData.u.standby.time[0], vData.u.standby.time[1], vData.u.standby.time[2], - vData.u.standby.time[3], vData.u.standby.time[4]); - } - - fprintf(stderr, "Entering DeepStandby. Goodbye...\n"); - fflush(stdout); - fflush(stderr); - sleep(2); - - if (ioctl(context->fd, VFDSTANDBY, &vData) < 0) - { - perror("standby: "); - return -1; - } - - return 0; -} - -static int getTimer(Context_t *context, time_t *theGMTTime) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int shutdown(Context_t *context, time_t *shutdownTimeGMT) -{ - time_t curTime; - - /* shutdown immediately */ - if (*shutdownTimeGMT == -1) - return (setTimer(context, NULL)); - - while (1) - { - time(&curTime); - - /*printf("curTime = %d, shutdown %d\n", curTime, *shutdownTimeGMT);*/ - - if (curTime >= *shutdownTimeGMT) - { - /* set most recent e2 timer and bye bye */ - return (setTimer(context, NULL)); - } - - usleep(100000); - } - - return -1; -} - -static int reboot(Context_t *context, time_t *rebootTimeGMT) -{ - time_t curTime; - struct micom_ioctl_data vData; - - while (1) - { - time(&curTime); - - if (curTime >= *rebootTimeGMT) - { - if (ioctl(context->fd, VFDREBOOT, &vData) < 0) - { - perror("reboot: "); - return -1; - } - } - - usleep(100000); - } - - return 0; -} - -static int Sleep(Context_t *context, time_t *wakeUpGMT) -{ - time_t curTime; - int sleep = 1; - int vFd; - fd_set rfds; - struct timeval tv; - int retval, i, rd; - struct tm *ts; - char output[cMAXCharsUFS922 + 1]; - struct input_event ev[64]; - tUFS922Private *private = (tUFS922Private *)((Model_t *)context->m)->private; - printf("%s\n", __func__); - vFd = open(cEVENT_DEVICE, O_RDWR); - - if (vFd < 0) - { - fprintf(stderr, "Cannot open %s\n", cEVENT_DEVICE); - perror(""); - return -1; - } - - printf("%s 1\n", __func__); - - while (sleep) - { - time(&curTime); - ts = localtime(&curTime); - - if (curTime >= *wakeUpGMT) - { - sleep = 0; - } - else - { - FD_ZERO(&rfds); - FD_SET(vFd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 100000; - retval = select(vFd + 1, &rfds, NULL, NULL, &tv); - - if (retval > 0) - { - rd = read(vFd, ev, sizeof(struct input_event) * 64); - - if (rd < (int) sizeof(struct input_event)) - { - continue; - } - - for (i = 0; i < rd / sizeof(struct input_event); i++) - { - if (ev[i].type == EV_SYN) - { - } - else if (ev[i].type == EV_MSC && (ev[i].code == MSC_RAW || ev[i].code == MSC_SCAN)) - { - } - else - { - if (ev[i].code == 116) - sleep = 0; - } - } - } - } - - if (private->display) - { - strftime(output, cMAXCharsUFS922 + 1, private->timeFormat, ts); - setText(context, output); - } - } - - return 0; -} - -static int setText(Context_t *context, char *theText) -{ - char vHelp[128]; - strncpy(vHelp, theText, cMAXCharsUFS922); - vHelp[cMAXCharsUFS922] = '\0'; - /* printf("%s, %d\n", vHelp, strlen(vHelp));*/ - write(context->fd, vHelp, strlen(vHelp)); - return 0; -} - -static int setLed(Context_t *context, int which, int on) -{ - struct micom_ioctl_data vData; - vData.u.led.led_nr = which; - vData.u.led.on = on; - setMode(context->fd); - - if (ioctl(context->fd, VFDSETLED, &vData) < 0) - { - perror("setLed: "); - return -1; - } - - return 0; -} - -static int setIcon(Context_t *context, int which, int on) -{ - struct micom_ioctl_data vData; - vData.u.icon.icon_nr = which; - vData.u.icon.on = on; - setMode(context->fd); - - if (ioctl(context->fd, VFDICONDISPLAYONOFF, &vData) < 0) - { - perror("setIcon: "); - return -1; - } - - return 0; -} - -static int setBrightness(Context_t *context, int brightness) -{ - struct micom_ioctl_data vData; - - if (brightness < 0 || brightness > 7) - return -1; - - vData.u.brightness.level = brightness; - printf("%d\n", context->fd); - setMode(context->fd); - - if (ioctl(context->fd, VFDBRIGHTNESS, &vData) < 0) - { - perror("setBrightness: "); - return -1; - } - - return 0; -} - -static int setPwrLed(Context_t *context, int brightness) -{ - fprintf(stderr, "%s: not implemented\n", __func__); - return -1; -} - -static int setLight(Context_t *context, int on) -{ - if (on) - setBrightness(context, 7); - else - setBrightness(context, 0); - - return 0; -} - -/* FIXME: not sure if this really works for ufs922 ->must be checked */ -static int getWakeupReason(Context_t *context, int *reason) -{ - char mode[8]; - fprintf(stderr, "Waiting for wakeupmode from fp...\n"); - - /* front controller time */ - if (ioctl(context->fd, VFDGETWAKEUPMODE, &mode) < 0) - { - perror("getWakeupReason: "); - return -1; - } - - /* if we get the fp time */ - if (mode[0] != '\0') - { - fprintf(stderr, "success reading wakeupdmode from fp\n"); - *reason = mode[1] && 0xff; - printf("reason = 0x%x\n", *reason); - } - else - { - fprintf(stderr, "error reading wakeupmode from fp\n"); - *reason = 0; - } - - return 0; -} - -/* FIXME: not sure if this really works for ufs922 ->must be checked */ -static int getVersion(Context_t *context, int *version) -{ - char strVersion[8]; - fprintf(stderr, "Waiting on version from fp...\n"); - - /* front controller version info */ - if (ioctl(context->fd, VFDGETVERSION, &strVersion) < 0) - { - perror("getVersion: "); - return -1; - } - - /* if we get the fp time */ - if (strVersion[0] != '\0') - { - fprintf(stderr, "success reading version from fp\n"); - *version = strVersion[1] * 10 | strVersion[2]; - printf("version = %d\n", *version); - } - else - { - fprintf(stderr, "error reading version from fp\n"); - *version = 0; - } - - return 0; -} - -static int Exit(Context_t *context) -{ - tUFS922Private *private = (tUFS922Private *)((Model_t *)context->m)->private; - - if (context->fd > 0) - close(context->fd); - - free(private); - exit(1); -} - -static int Clear(Context_t *context) -{ - int i; - setText(context, " "); - setBrightness(context, 7); - - for (i = 1; i <= 6 ; i++) - setLed(context, i, 0); - - for (i = 1; i <= 16 ; i++) - setIcon(context, i, 0); - - return 0; -} - -static int setLedBrightness(Context_t *context, int brightness) -{ - struct micom_ioctl_data vData; - - if (brightness < 0 || brightness > 0xff) - return -1; - - vData.u.brightness.level = brightness; - setMode(context->fd); - printf("%d\n", context->fd); - - if (ioctl(context->fd, VFDLEDBRIGHTNESS, &vData) < 0) - { - perror("setledbrightness: "); - return -1; - } - - return 0; -} - -Model_t UFS922_model = -{ - .Name = "Kathrein UFS922 frontpanel control utility", - .Type = Ufs922, - .Init = init, - .Clear = Clear, - .Usage = usage, - .SetTime = setTime, - .GetTime = getTime, - .SetTimer = setTimer, - .GetTimer = getTimer, - .Shutdown = shutdown, - .Reboot = reboot, - .Sleep = Sleep, - .SetText = setText, - .SetLed = setLed, - .SetIcon = setIcon, - .SetBrightness = setBrightness, - .SetPwrLed = setPwrLed, -// .GetWakeupReason = getWakeupReason, //TODO: CHECK IF WORKING - .SetLight = setLight, - .Exit = Exit, - .SetLedBrightness = setLedBrightness, - .GetVersion = getVersion, - .SetRF = NULL, - .SetFan = NULL, - .private = NULL -}; diff --git a/fp_control/Ufs922.h b/fp_control/Ufs922.h deleted file mode 100644 index 666ef4b..0000000 --- a/fp_control/Ufs922.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef __ufs922__ -#define __ufs922__ - -#define VFDGETVERSION 0xc0425af7 - -/* this setups the mode temporarily (for one ioctl) - * to the desired mode. currently the "normal" mode - * is the compatible vfd mode - */ -struct set_mode_s -{ - int compat; /* 0 = compatibility mode to vfd driver; 1 = micom mode */ -}; - -struct set_brightness_s -{ - int level; -}; - -struct set_icon_s -{ - int icon_nr; - int on; -}; - -struct set_led_s -{ - int led_nr; - int on; -}; - -/* time must be given as follows: - * time[0] & time[1] = mjd ??? - * time[2] = hour - * time[3] = min - * time[4] = sec - */ -struct set_standby_s -{ - char time[5]; -}; - -struct set_time_s -{ - char time[5]; -}; - - -struct micom_ioctl_data -{ - union - { - struct set_icon_s icon; - struct set_led_s led; - struct set_brightness_s brightness; - struct set_mode_s mode; - struct set_standby_s standby; - struct set_time_s time; - } u; -}; - - -#endif diff --git a/fp_control/autogen.sh b/fp_control/autogen.sh deleted file mode 100755 index 7dbd57c..0000000 --- a/fp_control/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-fp_control" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/fp_control/configure.ac b/fp_control/configure.ac deleted file mode 100644 index 8d34047..0000000 --- a/fp_control/configure.ac +++ /dev/null @@ -1,15 +0,0 @@ -AC_INIT([fp_control],[1.0],[],[fp_control]) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_CHECK_LIB(pthread, pthread_create, [LIBS="$LIBS -lpthread"]) - -AC_OUTPUT([ -Makefile -]) diff --git a/fp_control/fp_control.c b/fp_control/fp_control.c deleted file mode 100644 index 77c57dc..0000000 --- a/fp_control/fp_control.c +++ /dev/null @@ -1,621 +0,0 @@ -/* - * fp_control.c - * - * (c) 2009 dagobert@teamducktales - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* - * added: - * powerLed intensity adjustment - * by zeroone - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "global.h" - -//////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////// - -/* software version of fp_control. please increase on every change */ -static const char *sw_version = "1.04"; - -static eWakeupReason reason = 0; - - -typedef struct -{ - char *arg; - char *arg_long; - char *arg_description; -} tArgs; - -tArgs vArgs[] = -{ - { - "-e", " --setTimer ", "Args: No arguments or [time date] Format: HH:MM:SS dd-mm-YYYY \ - \n\tSet the most recent timer from e2 or neutrino to the frontcontroller and standby \ - \n\tSet the current frontcontroller wake-up time" - }, - { "-d", " --shutdown ", "Args: [time date] Format: HH:MM:SS dd-mm-YYYY\n\tMimics shutdown command. Shutdown receiver via fc at given time." }, - { "-g", " --getTime ", "Args: No arguments\n\tReturn current set frontcontroller time" }, - { "-gs", " --getTimeAndSet ", "Args: No arguments\n\tSet system time to current frontcontroller time" }, - { "-gw", " --getWakeupTime ", "Args: No arguments\n\tReturn current wakeup time" }, - { "-s", " --setTime ", "Args: time date Format: HH:MM:SS dd-mm-YYYY\n\tSet the current frontcontroller time" }, - { "-gt", " --getTimer ", "Args: No arguments\n\tGet the current frontcontroller wake-up time" }, - { "-r", " --reboot ", "Args: time date Format: HH:MM:SS dd-mm-YYYY\n\tReboot receiver via fc at given time" }, - { "-p", " --sleep ", "Args: time date Format: HH:MM:SS dd-mm-YYYY\n\tReboot receiver via fc at given time" }, - { "-t", " --settext ", "Args: text\n\tSet text to frontpanel." }, - { "-l", " --setLed ", "Args: led on\n\tSet a led on or off" }, - { "-i", " --setIcon ", "Args: icon on\n\tSet an icon on or off" }, - { "-b", " --setBrightness ", "Args: brightness\n\tSet display brightness" }, - { "-P", " --setPwrLed ", "Args: 0..15\n\tSet PowerLed brightness" }, - { "-w", " --getWakeupReason ", "Args: No arguments\n\tGet the wake-up reason" }, - { "-L", " --setLight ", "Args: 0/1\n\tSet light" }, - { "-c", " --clear ", "Args: No argumens\n\tClear display, all icons and leds off" }, - { "-v", " --version ", "Args: No argumens\n\tGet version from fc" }, - { "-sf", " --setFan ", "Args: 0/1\n\tset fan on/off" }, - { "-sr", " --setRF ", "Args: 0/1\n\tset rf modulator on/off" }, - { "-dt", " --display_timer ", "Args: 0/1\n\tset display time on/off" }, - { "-tm", " --time_mode ", "Args: 0/1\n\ttoggle 12/24 hour mode" }, - { NULL, NULL, NULL } -}; - -const char *wakeupreason[8] = { "unknown", "poweron", "standby", "timer", "powerswitch", "unknown", "unknown", "unknown" }; - -void usage(Context_t *context, char *prg, char *cmd) -{ - /* let the model print out what it can handle in reality */ - if ((((Model_t *)context->m)->Usage == NULL) || (((Model_t *)context->m)->Usage(context, prg) < 0)) - { - int i; - /* or printout a default usage */ - fprintf(stderr, "General usage:\n\n"); - fprintf(stderr, "%s argument [optarg1] [optarg2]\n", prg); - - for (i = 0; ; i++) - { - if (vArgs[i].arg == NULL) - break; - - if ((cmd == NULL) || (strcmp(cmd, vArgs[i].arg) == 0) || (strstr(vArgs[i].arg_long, cmd) != NULL)) - fprintf(stderr, "%s %s %s\n", vArgs[i].arg, vArgs[i].arg_long, vArgs[i].arg_description); - } - } - - if (((Model_t *)context->m)->Exit) - ((Model_t *)context->m)->Exit(context); - - exit(1); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////// - -/* FIXME: check if this function is correct and delivers gmt time */ -void getTimeFromArg(char *timeStr, char *dateStr, time_t *theGMTTime) -{ - struct tm theTime; -// printf("%s\n", __func__); - sscanf(timeStr, "%d:%d:%d", &theTime.tm_hour, &theTime.tm_min, &theTime.tm_sec); - sscanf(dateStr, "%d-%d-%d", &theTime.tm_mday, &theTime.tm_mon, &theTime.tm_year); - theTime.tm_year -= 1900; - theTime.tm_mon = theTime.tm_mon - 1; - theTime.tm_isdst = -1; /* say mktime that we do not know */ - /* FIXME: hmm this is not a gmt or, isn't it? */ - *theGMTTime = mktime(&theTime); - /* new_time = localtime(&dummy);*/ -// printf("%s <\n", __func__); -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////// - -void processCommand(Context_t *context, int argc, char *argv[]) -{ - int i; - - if (((Model_t *)context->m)->Init) - context->fd = ((Model_t *)context->m)->Init(context); - - if (argc > 1) - { - i = 1; - - while (i < argc) - { - if ((strcmp(argv[i], "-e") == 0) || (strcmp(argv[i], "--setTimer") == 0)) - { - if (argc == 4) - { - time_t theGMTTime; - getTimeFromArg(argv[i + 1], argv[i + 2], &theGMTTime); - - /* set the frontcontroller timer from args */ - if (((Model_t *)context->m)->SetTimer)((Model_t *)context->m)->SetTimer(context, &theGMTTime); - - i += 2; - } - else if (argc == 2) - { - /* setup timer; wake-up time will be read */ - if (((Model_t *)context->m)->SetTimer) - ((Model_t *)context->m)->SetTimer(context, NULL); - } - else - usage(context, argv[0], argv[1]); - } - else if ((strcmp(argv[i], "-g") == 0) || (strcmp(argv[i], "--getTime") == 0)) - { - time_t theGMTTime; - - /* get the frontcontroller time */ - if (((Model_t *)context->m)->GetTime) - { - if (((Model_t *)context->m)->GetTime(context, &theGMTTime) == 0) - { - struct tm *gmt = gmtime(&theGMTTime); - fprintf(stderr, "Current Time: %02d:%02d:%02d %02d-%02d-%04d\n", - gmt->tm_hour, gmt->tm_min, gmt->tm_sec, gmt->tm_mday, gmt->tm_mon + 1, gmt->tm_year + 1900); - } - } - } - else if ((strcmp(argv[i], "-gs") == 0) || (strcmp(argv[i], "--getTimeAndSet") == 0)) - { - time_t theGMTTime; - - /* get the frontcontroller time */ - if (((Model_t *)context->m)->GetTime) - { - if (((Model_t *)context->m)->GetTime(context, &theGMTTime) == 0) - { - struct tm *gmt = gmtime(&theGMTTime); -#if 0 - struct timeval tv; - time_t allsec; - allsec = mktime(gmt); - tv.tv_sec = allsec; - settimeofday(&tv, 0); // only works on spark, so we make a system-call later -#endif - fprintf(stderr, "Setting RTC to current frontpanel time: %02d:%02d:%02d %02d-%02d-%04d\n", - gmt->tm_hour, gmt->tm_min, gmt->tm_sec, gmt->tm_mday, gmt->tm_mon + 1, gmt->tm_year + 1900); - char cmd[50]; - sprintf(cmd, "date -s %04d.%02d.%02d-%02d:%02d:%02d\n", gmt->tm_year + 1900, gmt->tm_mon + 1, gmt->tm_mday, gmt->tm_hour, gmt->tm_min, gmt->tm_sec); - system(cmd); - } - } - } - else if ((strcmp(argv[i], "-gw") == 0) || (strcmp(argv[i], "--getWakeupTime") == 0)) - { - time_t theGMTTime; - - /* get the frontcontroller wakeup time */ - if (((Model_t *)context->m)->GetWakeupTime) - { - if (((Model_t *)context->m)->GetWakeupTime(context, &theGMTTime) == 0) - { - struct tm *gmt = gmtime(&theGMTTime); - fprintf(stderr, "Wakeup Time: %02d:%02d:%02d %02d-%02d-%04d\n", - gmt->tm_hour, gmt->tm_min, gmt->tm_sec, gmt->tm_mday, gmt->tm_mon + 1, gmt->tm_year + 1900); - } - } - } - else if ((strcmp(argv[i], "-s") == 0) || (strcmp(argv[i], "--setTime") == 0)) - { - time_t theGMTTime; - - if (argc == 4) - { - getTimeFromArg(argv[i + 1], argv[i + 2], &theGMTTime); - - /* set the frontcontroller time */ - if (((Model_t *)context->m)->SetTime) - ((Model_t *)context->m)->SetTime(context, &theGMTTime); - } - else - usage(context, argv[0], argv[1]); - - i += 2; - } - else if ((strcmp(argv[i], "-gt") == 0) || (strcmp(argv[i], "--getTimer") == 0)) - { - time_t theGMTTime; - - /* get the current timer value from frontcontroller */ - if (((Model_t *)context->m)->GetTimer) - { - if (((Model_t *)context->m)->GetTimer(context, &theGMTTime) == 0) - { - struct tm *gmt = gmtime(&theGMTTime); - fprintf(stderr, "Current Timer: %02d:%02d:%02d %02d-%02d-%04d\n", - gmt->tm_hour, gmt->tm_min, gmt->tm_sec, gmt->tm_mday, gmt->tm_mon + 1, gmt->tm_year + 1900); - } - } - } - else if ((strcmp(argv[i], "-d") == 0) || (strcmp(argv[i], "--shutDown") == 0)) - { - time_t theGMTTime; - - if (argc == 4) - { - getTimeFromArg(argv[i + 1], argv[i + 2], &theGMTTime); - - /* shutdown at the given time */ - if (((Model_t *)context->m)->Shutdown) - ((Model_t *)context->m)->Shutdown(context, &theGMTTime); - } - else if (argc == 2) - { - theGMTTime = -1; - - /* shutdown immediately */ - if (((Model_t *)context->m)->Shutdown) - ((Model_t *)context->m)->Shutdown(context, &theGMTTime); - } - else - usage(context, argv[0], argv[1]); - - i += 2; - } - else if ((strcmp(argv[i], "-r") == 0) || (strcmp(argv[i], "--reboot") == 0)) - { - time_t theGMTTime; - - if (argc == 4) - { - getTimeFromArg(argv[i + 1], argv[i + 2], &theGMTTime); - - /* reboot at the given time */ - if (((Model_t *)context->m)->Reboot) - ((Model_t *)context->m)->Reboot(context, &theGMTTime); - } - else - usage(context, argv[0], argv[1]); - - i += 2; - } - else if ((strcmp(argv[i], "-p") == 0) || (strcmp(argv[i], "--sleep") == 0)) - { - time_t theGMTTime; - - if (argc == 4) - { - getTimeFromArg(argv[i + 1], argv[i + 2], &theGMTTime); - - /* sleep for a while, or wake-up on another reason (rc ...) */ - if (((Model_t *)context->m)->Sleep) - ((Model_t *)context->m)->Sleep(context, &theGMTTime); - } - else - usage(context, argv[0], argv[1]); - - i += 2; - } - else if ((strcmp(argv[i], "-t") == 0) || (strcmp(argv[i], "--settext") == 0)) - { - if (i + 1 <= argc) - - /* set display text */ - if (((Model_t *)context->m)->SetText) - ((Model_t *)context->m)->SetText(context, argv[i + 1]); - - i += 1; - } - else if ((strcmp(argv[i], "-l") == 0) || (strcmp(argv[i], "--setLed") == 0)) - { - if (i + 2 <= argc) - { - int which, on; - which = atoi(argv[i + 1]); - on = atoi(argv[i + 2]); - i += 2; - - /* set display led */ - if (((Model_t *)context->m)->SetLed) - ((Model_t *)context->m)->SetLed(context, which, on); - } - - i += 2; - } - else if ((strcmp(argv[i], "-i") == 0) || (strcmp(argv[i], "--setIcon") == 0)) - { - if (i + 2 <= argc) - { - int which, on; - which = atoi(argv[i + 1]); - on = atoi(argv[i + 2]); - - /* set display icon */ - if (((Model_t *)context->m)->SetIcon) - ((Model_t *)context->m)->SetIcon(context, which, on); - } - - i += 2; - } - else if ((strcmp(argv[i], "-b") == 0) || (strcmp(argv[i], "--setBrightness") == 0)) - { - if (i + 1 <= argc) - { - int brightness; - brightness = atoi(argv[i + 1]); - - /* set display brightness */ - if (((Model_t *)context->m)->SetBrightness) - ((Model_t *)context->m)->SetBrightness(context, brightness); - } - - i += 1; - } - /* added by zeroone; set PowerLed Brightness on HDBOX*/ - // BEGIN SetPwrLed - else if ((strcmp(argv[i], "-P") == 0) || (strcmp(argv[i], "--setPwrLed") == 0)) - { - if (i + 1 <= argc) - { - int brightness; - brightness = atoi(argv[i + 1]); - - /* set PwrLed Brightness icon */ - if (((Model_t *)context->m)->SetPwrLed) - ((Model_t *)context->m)->SetPwrLed(context, brightness); - } - - i += 1; - } - // END SetPwrLed - else if ((strcmp(argv[i], "-w") == 0) || (strcmp(argv[i], "--getWakeupReason") == 0)) - { - int ret = -1; - - if (((Model_t *)context->m)->GetWakeupReason) - ret = ((Model_t *)context->m)->GetWakeupReason(context, &reason); - else - ret = getWakeupReasonPseudo(&reason); - - if (ret == 0) - { - printf("Wakeup reason = %d (%s)\n\n", reason & 0x07, wakeupreason[reason & 0x07]); - syncWasTimerWakeup(reason); - } - } - else if ((strcmp(argv[i], "-L") == 0) || (strcmp(argv[i], "--setLight") == 0)) - { - if (i + 1 < argc) - { - int on; - on = atoi(argv[i + 1]); - - /* set brightness on/off */ - if (((Model_t *)context->m)->SetLight) - ((Model_t *)context->m)->SetLight(context, on); - } - - i += 1; - } - else if ((strcmp(argv[i], "-c") == 0) || (strcmp(argv[i], "--clear") == 0)) - { - /* clear the display */ - if (((Model_t *)context->m)->Clear) - ((Model_t *)context->m)->Clear(context); - } - else if ((strcmp(argv[i], "-led") == 0) || (strcmp(argv[i], "--setLedBrightness") == 0)) - { - if (i + 1 <= argc) - { - /* set LED brightness */ - int brightness; - brightness = atoi(argv[i + 1]); - - if (((Model_t *)context->m)->SetLedBrightness) - ((Model_t *)context->m)->SetLedBrightness(context, brightness); - } - - i += 1; - } - else if ((strcmp(argv[i], "-v") == 0) || (strcmp(argv[i], "--version") == 0)) - { - int version; - - /* get version */ - if (((Model_t *)context->m)->GetVersion) - ((Model_t *)context->m)->GetVersion(context, &version); - } - else if ((strcmp(argv[i], "-sf") == 0) || (strcmp(argv[i], "--setFan") == 0)) - { - if (i + 1 <= argc) - { - int on; - on = atoi(argv[i + 1]); - - /* set fan on/off */ - if (((Model_t *)context->m)->SetFan) - ((Model_t *)context->m)->SetFan(context, on); - } - - i += 1; - } - else if ((strcmp(argv[i], "-sr") == 0) || (strcmp(argv[i], "--setRF") == 0)) - { - if (i + 1 <= argc) - { - int on; - on = atoi(argv[i + 1]); - - /* set rf on/off */ - if (((Model_t *)context->m)->SetRF) - ((Model_t *)context->m)->SetRF(context, on); - } - - i += 2; - } - else if ((strcmp(argv[i], "-dt") == 0) || (strcmp(argv[i], "--display_time") == 0)) - { - if (i + 1 <= argc) - { - int on; - on = atoi(argv[i + 1]); - - /* set display time */ - if (((Model_t *)context->m)->SetDisplayTime) - ((Model_t *)context->m)->SetDisplayTime(context, on); - } - - i += 2; - } - else if ((strcmp(argv[i], "-tm") == 0) || (strcmp(argv[i], "--time_mode") == 0)) - { - if (i + 1 <= argc) - { - int twentyFour; - twentyFour = atoi(argv[i + 1]); - - /* set 12/24 hour mode */ - if (((Model_t *)context->m)->SetTimeMode) - ((Model_t *)context->m)->SetTimeMode(context, twentyFour); - } - - i += 2; - } - else - { - usage(context, argv[0], NULL); - } - - i++; - } - } - else - { - usage(context, argv[0], NULL); - } - - if (((Model_t *)context->m)->Exit) - ((Model_t *)context->m)->Exit(context); - -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////// - -int getKathreinUfs910BoxType() -{ - char vType; - int vFdBox = open("/proc/boxtype", O_RDONLY); - read(vFdBox, &vType, 1); - close(vFdBox); - return vType == '0' ? 0 : vType == '1' || vType == '3' ? 1 : -1; -} - -int getModel() -{ - int vFd = -1; - const int cSize = 128; - char vName[129] = "Unknown"; - int vLen = -1; - eBoxType vBoxType = Unknown; - vFd = open("/proc/stb/info/model", O_RDONLY); - vLen = read(vFd, vName, cSize); - close(vFd); - - if (vLen > 0) - { - vName[vLen - 1] = '\0'; - printf("Model: %s\n", vName); - - if (!strncasecmp(vName, "ufs910", 6)) - { - switch (getKathreinUfs910BoxType()) - { - case 0: - vBoxType = Ufs910_1W; - break; - - case 1: - vBoxType = Ufs910_14W; - break; - - default: - vBoxType = Unknown; - break; - } - } - else if (!strncasecmp(vName, "ufs922", 6)) - vBoxType = Ufs922; - else if (!strncasecmp(vName, "tf7700hdpvr", 11)) - vBoxType = Tf7700; - else if (!strncasecmp(vName, "hdbox", 5)) - vBoxType = Fortis; - else if (!strncasecmp(vName, "octagon1008", 11)) - vBoxType = Fortis; - else if (!strncasecmp(vName, "atevio7500", 10)) - vBoxType = Fortis; - else if (!strncasecmp(vName, "octagon1008", 11)) - vBoxType = Fortis; - else if (!strncasecmp(vName, "ufs912", 6)) - vBoxType = Ufs912; - else if (!strncasecmp(vName, "ufs913", 6)) - vBoxType = Ufs912; - else if (!strncasecmp(vName, "spark", 5)) - vBoxType = Spark; - else if (!strncasecmp(vName, "spark7162", 9)) - vBoxType = Spark; - else if ((!strncasecmp(vName, "cuberevo", 8)) || - (!strncasecmp(vName, "cuberevo-mini", 13)) || - (!strncasecmp(vName, "cuberevo-mini2", 14)) || - (!strncasecmp(vName, "cuberevo-250hd", 14)) || - (!strncasecmp(vName, "cuberevo-2000hd", 15)) || - (!strncasecmp(vName, "cuberevo-3000hd", 14))) - vBoxType = Cuberevo; - else - vBoxType = Unknown; - } - - printf("vBoxType: %d\n", vBoxType); - - return vBoxType; -} - -int main(int argc, char *argv[]) -{ - eBoxType vBoxType = Unknown; - Context_t context; - - printf("%s: SW Version %s\n", argv[0], sw_version); - - vBoxType = getModel(); - - if (searchModel(&context, vBoxType) != 0) - { - printf("Model not found\n"); - return -1; - } - - printf("Selected Model: %s\n", ((Model_t *)context.m)->Name); - - processCommand(&context, argc, argv); - - exit(reason & 0x07); -} diff --git a/fp_control/global.c b/fp_control/global.c deleted file mode 100644 index 430a385..0000000 --- a/fp_control/global.c +++ /dev/null @@ -1,358 +0,0 @@ -/* - * global.c - * - * (c) 2009 dagobert/donald@teamducktales - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include -#include -#include -#include -#include -#include -#include -#include - -#include "global.h" - -/* #define E2TIMERSXML "/usr/local/share/enigma2/timers.xml" */ -#define E2TIMERSXML "/etc/enigma2/timers.xml" -#define E2WAKEUPTIME "/proc/stb/fp/wakeup_time" - -#define NEUTRINO_TIMERS "/var/tuxbox/config/timerd.conf" - -#define CONFIG "/etc/vdstandby.cfg" -char *sDisplayStd = "%a %d %H:%M:%S"; - -#define WAKEUPFILE "/var/wakeup" -#define WAS_TIMER_WAKEUP "/proc/stb/fp/was_timer_wakeup" - -#define E2_WAKEUP_TIME_PROC - -static Model_t *AvailableModels[] = -{ - &Ufs910_1W_model, - &Ufs910_14W_model, - &UFS922_model, - &Fortis_model, - &UFS912_model, - &Spark_model, - &Cuberevo_model, - NULL -}; - -#ifdef E2_WAKEUP_TIME_PROC -static time_t read_e2_timers(time_t curTime) -{ - char line[12]; - time_t recordTime = LONG_MAX; - FILE *fd = fopen(E2WAKEUPTIME, "r"); - printf("Getting Enigma2 wakeup time"); - - if (fd > 0) - { - fgets(line, 11, fd); - sscanf(line, "%ld", &recordTime); - - if (recordTime <= curTime) - { - recordTime = LONG_MAX; - printf(" - Got time, but in the past (ignoring)\n"); - } - else - printf(" - Done\n"); - - fclose(fd); - } - else - printf(" - Error reading %s\n", E2WAKEUPTIME); - - return recordTime; -} -#else -static time_t read_e2_timers(time_t curTime) -{ - char recordString[11]; - char line[1000]; - time_t recordTime = LONG_MAX; - FILE *fd = fopen(E2TIMERSXML, "r"); - printf("Getting enigma2 wakeup time"); - - if (fd > 0) - { - while (fgets(line, 999, fd) != NULL) - { - line[999] = '\0'; - - if (!strncmp(" curTime ? tmp : recordTime); - } - } - - printf(" - Done\n"); - fclose(fd); - } - else - { - printf(" - Error reading %s\n", E2TIMERSXML); - } - return recordTime; -} -#endif - -static time_t read_neutrino_timers(time_t curTime) -{ - char line[1000]; - time_t recordTime = LONG_MAX; - FILE *fd = fopen(NEUTRINO_TIMERS, "r"); - printf("Getting neutrino wakeup time"); - - if (fd > 0) - { - printf("Opening %s\n", NEUTRINO_TIMERS); - while (fgets(line, 999, fd) != NULL) - { - line[999] = '\0'; - - if (strstr(line, "ALARM_TIME_") != NULL) - { - time_t tmp = 0; - char *str; - str = strstr(line, "="); - - if (str != NULL) - { - tmp = atol(str + 1); - recordTime = (tmp < recordTime && tmp > curTime ? tmp : recordTime); - } - } - } - - printf(" - Done\n"); - fclose(fd); - } - else - printf(" - Error reading %s\n", NEUTRINO_TIMERS); - - if (recordTime != LONG_MAX) - { - int wakeupDecrement = 5 * 60; - int platzhalter; - char * dummy; - checkConfig(&platzhalter, &platzhalter, &dummy, &wakeupDecrement); - recordTime -= wakeupDecrement; - } - - return recordTime; -} - -// Write the wakeup time to a file to allow detection of wakeup cause if fp does not support -static void write_wakeup_file(time_t wakeupTime) -{ - FILE *wakeupFile; - wakeupFile = fopen(WAKEUPFILE, "w"); - - if (wakeupFile) - { - fprintf(wakeupFile, "%ld", wakeupTime); - fclose(wakeupFile); - system("sync"); - } -} - -static time_t read_wakeup_file() -{ - time_t wakeupTime = LONG_MAX; - FILE *wakeupFile; - wakeupFile = fopen(WAKEUPFILE, "r"); - - if (wakeupFile) - { - fscanf(wakeupFile, "%ld", &wakeupTime); - fclose(wakeupFile); - } - - return wakeupTime; -} - -#define FIVE_MIN 300 - -// Important: system has to have a valid current time -// This is a little bit tricky, we can only detect if the time is valid -// and this check happens +-5min arround the timer -int getWakeupReasonPseudo(eWakeupReason *reason) -{ - time_t curTime = 0; - time_t wakeupTime = LONG_MAX; - printf("getWakeupReasonPseudo: IMPORTANT: Valid Linux System Time is mandatory\n"); - time(&curTime); - wakeupTime = read_wakeup_file(); - - if ((curTime - FIVE_MIN) < wakeupTime && (curTime + FIVE_MIN) > wakeupTime) - { - *reason = TIMER; - } - else - { - *reason = NONE; - } - return 0; -} - -int syncWasTimerWakeup(eWakeupReason reason) -{ - FILE *wasTimerWakeupProc = fopen(WAS_TIMER_WAKEUP, "w"); - - if (wasTimerWakeupProc == NULL) - { - fprintf(stderr, "setWakeupReason failed to open %s\n", WAS_TIMER_WAKEUP); - return -1; - } - - if (reason == TIMER) - { - fwrite("1\n", 2, 1, wasTimerWakeupProc); - } - else - { - fwrite("0\n", 2, 1, wasTimerWakeupProc); - } - fclose(wasTimerWakeupProc); - return 0; -} - -// This function tries to read the wakeup time from enigma2 and neutrino -// The wakeup time will also be written to file for wakeupcause detection -// If no wakeup time can be found LONG_MAX will be returned -time_t read_timers_utc(time_t curTime) -{ - time_t wakeupTime = LONG_MAX; - wakeupTime = read_e2_timers(curTime); - - if (wakeupTime == LONG_MAX) - { - wakeupTime = read_neutrino_timers(curTime); - } - write_wakeup_file(wakeupTime); - return wakeupTime; -} - -// This function returns a time in the future -time_t read_fake_timer_utc(time_t curTime) -{ - struct tm tsWake; - struct tm *ts; - time_t wakeupTime = LONG_MAX; - ts = gmtime(&curTime); - tsWake.tm_hour = ts->tm_hour; - tsWake.tm_min = ts->tm_min; - tsWake.tm_sec = ts->tm_sec; - tsWake.tm_mday = ts->tm_mday; - tsWake.tm_mon = ts->tm_mon; - tsWake.tm_year = ts->tm_year + 1; - wakeupTime = mktime(&tsWake); - return wakeupTime; -} -/* ******************************************** */ - -double modJulianDate(struct tm *theTime) -{ - double date; - int month; - int day; - int year; - year = theTime->tm_year + 1900; - month = theTime->tm_mon + 1; - day = theTime->tm_mday; - date = day - 32076 + - 1461 * (year + 4800 + (month - 14) / 12) / 4 + - 367 * (month - 2 - (month - 14) / 12 * 12) / 12 - - 3 * ((year + 4900 + (month - 14) / 12) / 100) / 4; - date += (theTime->tm_hour + 12.0) / 24.0; - date += (theTime->tm_min) / 1440.0; - date += (theTime->tm_sec) / 86400.0; - date -= 2400000.5; - return date; -} - -/* ********************************************** */ - -int searchModel(Context_t *context, eBoxType type) -{ - int i; - - for (i = 0; AvailableModels[i] != NULL; i++) - if (AvailableModels[i]->Type == type) - { - context->m = AvailableModels[i]; - return 0; - } - - return -1; -} - -int checkConfig(int *display, int *display_custom, char **timeFormat, int *wakeup) -{ - const int MAX = 100; - char buffer[MAX]; - *display = 0; - *display_custom = 0; - *timeFormat = "Unknown"; - *wakeup = 5 * 60; - FILE *fd_config = fopen(CONFIG, "r"); - - if (fd_config == NULL) - { - printf("Config file (%s) not found,\nusing standard config:", CONFIG); - printf("Config:\nDisplay:%d, DISPLAYCUSTOM = %d, CUSTOM = %s, WAKEUPDECREMENT %d\n", *display, *display_custom, *timeFormat, *wakeup); - return -1; - } - - while (fgets(buffer, MAX, fd_config)) - { - if (!strncmp("DISPLAY=", buffer, 8)) - { - char *option = &buffer[8]; - - if (!strncmp("TRUE", option, 2)) - *display = 1; - } - else if (!strncmp("DISPLAYCUSTOM=", buffer, 14)) - { - char *option = &buffer[14]; - *display_custom = 1; - *timeFormat = strdup(option); - } - else if (!strncmp("WAKEUPDECREMENT=", buffer, 16)) - { - char *option = &buffer[16]; - *wakeup = atoi(option); - } - } - - if (*timeFormat == NULL) - *timeFormat = sDisplayStd; - - printf("configs: DISPLAY = %d, DISPLAYCUSTOM = %d, CUSTOM = %s, WAKEUPDECREMENT %d\n", *display, *display_custom, *timeFormat, *wakeup); - fclose(fd_config); - return 0; -} diff --git a/fp_control/global.h b/fp_control/global.h deleted file mode 100644 index 21f6ce8..0000000 --- a/fp_control/global.h +++ /dev/null @@ -1,99 +0,0 @@ -#ifndef GLOBAL_H_ -#define GLOBAL_H_ - -#ifndef bool -#define bool unsigned char -#define true 1 -#define false 0 -#endif - -#define VFDGETTIME 0xc0425afa -#define VFDSETTIME 0xc0425afb -#define VFDSTANDBY 0xc0425afc -#define VFDREBOOT 0xc0425afd -#define VFDSETLED 0xc0425afe -#define VFDICONDISPLAYONOFF 0xc0425a0a -#define VFDDISPLAYCHARS 0xc0425a00 -#define VFDBRIGHTNESS 0xc0425a03 -#define VFDPWRLED 0xc0425a04 -#define VFDDISPLAYWRITEONOFF 0xc0425a05 -#define VFDDISPLAYCLR 0xc0425b00 -/* ufs912, 922, hdbox ->unset compat mode */ -#define VFDSETMODE 0xc0425aff -/*spark*/ -#define VFDGETSTARTUPSTATE 0xc0425af8 - -/* ufs912 */ -#define VFDGETVERSION 0xc0425af7 -#define VFDLEDBRIGHTNESS 0xc0425af8 -#define VFDGETWAKEUPMODE 0xc0425af9 - -struct vfd_ioctl_data -{ - unsigned char start; - unsigned char data[64]; - unsigned char length; -}; - -typedef enum {NONE, POWERON, STANDBY, TIMER, POWERSWITCH, UNK1, UNK2, UNK3} eWakeupReason; - -typedef enum {Unknown, Ufs910_1W, Ufs910_14W, Ufs922, Tf7700, Fortis, Ufs912, Spark, Cuberevo} eBoxType; - -typedef struct Context_s -{ - /* Model_t */ - void *m; /* instance data */ - int fd; /* filedescriptor of fd */ - -} Context_t; - -typedef struct Model_s -{ - char *Name; - eBoxType Type; - int (* Init)(Context_t *context); - int (* Clear)(Context_t *context); - int (* Usage)(Context_t *context, char *prg_name); - int (* SetTime)(Context_t *context, time_t *theGMTTime); - int (* GetTime)(Context_t *context, time_t *theGMTTime); - int (* SetTimer)(Context_t *context, time_t *theGMTTime); - int (* GetTimer)(Context_t *context, time_t *theGMTTime); - int (* Shutdown)(Context_t *context, time_t *shutdownTimeGMT); - int (* Reboot)(Context_t *context, time_t *rebootTimeGMT); - int (* Sleep)(Context_t *context, time_t *wakeUpGMT); - int (* SetText)(Context_t *context, char *theText); - int (* SetLed)(Context_t *context, int which, int on); - int (* SetIcon)(Context_t *context, int which, int on); - int (* SetBrightness)(Context_t *context, int brightness); - int (* SetPwrLed)(Context_t *context, int pwrled); - int (* GetWakeupReason)(Context_t *context, eWakeupReason *reason); - int (* SetLight)(Context_t *context, int on); - int (* Exit)(Context_t *context); - int (* SetLedBrightness)(Context_t *context, int brightness); - int (* GetVersion)(Context_t *context, int *version); - int (* SetRF)(Context_t *context, int on); - int (* SetFan)(Context_t *context, int on); - int (* GetWakeupTime)(Context_t *context, time_t *theGMTTime); - int (* SetDisplayTime)(Context_t *context, int on); - int (* SetTimeMode)(Context_t *context, int twentyFour); - void *private; -} Model_t; - -extern Model_t Ufs910_1W_model; -extern Model_t Ufs910_14W_model; -extern Model_t UFS912_model; -extern Model_t UFS922_model; -extern Model_t Fortis_model; -extern Model_t Spark_model; -extern Model_t Cuberevo_model; - -double modJulianDate(struct tm *theTime); -time_t read_timers_utc(time_t curTime); -time_t read_fake_timer_utc(time_t curTime); -int searchModel(Context_t *context, eBoxType type); -int checkConfig(int *display, int *display_custom, char **timeFormat, int *wakeup); - -int getWakeupReasonPseudo(eWakeupReason *reason); -int syncWasTimerWakeup(eWakeupReason reason); - -#endif diff --git a/gitVCInfo/Makefile.am b/gitVCInfo/Makefile.am deleted file mode 100644 index 7566f68..0000000 --- a/gitVCInfo/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -bin_PROGRAMS = gitVCInfo - -gitVCInfo_SOURCES = gitVCInfo.cpp -AM_CFLAGS = -Wall diff --git a/gitVCInfo/autogen.sh b/gitVCInfo/autogen.sh deleted file mode 100755 index 0a9636d..0000000 --- a/gitVCInfo/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-aio-gitVCInfo" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/gitVCInfo/configure.ac b/gitVCInfo/configure.ac deleted file mode 100644 index 27450c5..0000000 --- a/gitVCInfo/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT([gitVCInfo],[1.0],[],[gitVCInfo]) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_OUTPUT([ -Makefile -]) diff --git a/gitVCInfo/gitVCInfo.cpp b/gitVCInfo/gitVCInfo.cpp deleted file mode 100644 index 5ba5299..0000000 --- a/gitVCInfo/gitVCInfo.cpp +++ /dev/null @@ -1,377 +0,0 @@ -/* - Thanks to rhabarber1848 tuxbox dbox2 cvs!! - - - This Application shows "typed" Image Informations (known from dbox2) in a text console over the framebuffer (on television) - CONFIG_FRAMEBUFFER_CONSOLE have to be enabled!! - - It will look like this: - - - ---------- Image Information ---------- - - Image Version : 5.1.5 - Image Type : Release - - Creation Date : 02.04.2010 - Creation Time : 8:18 - Creator : git-developer - Image Name : Neutrino for Duckbox -jffs2/ext2 - Homepage : http://gitorious.org/open-duckbox-project-sh4 - - ---------- Network Settings ----------- - - Network State : disabled - DHCP State : -- unknown -- - Root-Server : intern - IP Address : 192.168.1.8 - Subnet Mask : 255.255.255.0 - Broadcast : 192.168.1.255 - Gateway : 192.168.1.1 - Nameserver : 192.168.178.1 - - Linux Version 2.6.17.14_stm22_0041, gcc Version - Built with the computer smog@redhat.desk - - Loading Neutrino .... - - - For "typing simulation" (delay between characters) you have to start gitVCInfo with -d! - smogm 2010 -*/ - -#include -#include -#include -#include -#include - -//!!you have to set CONFIG_FRAMEBUFFER_CONSOLE in kernel!! thx bpanther -#define CONSOLE "/dev/tty1" -//where to find the version information (/etc/.version??): -#define VERSION_FILE "/.version" -//more information about your box: -#define VERSION_FILE2 "/proc/version" -//network informations: -#define INTERFACES_FILE "/etc/network/interfaces" -#define NAMENSSERVER_FILE "/etc/resolv.conf" -//what is mounted into you filesystem, and how: -#define MOUNTS_FILE "/proc/mounts" - - -#define BUFFERSIZE 255 -#define BIGBUFFERSIZE 2000 -#define MAXOSD 2 -#define CHARDELAY 20000 - -enum {gVERSION, gTYPE, gDATE, gTIME, gCREATOR, gNAME, gWWW, gNETW, gDHCP, gROOT, gIP, gNETM, gBROAD, gGATEWAY, gDNS, gHEADLINE, - gUNKNOWN, gENABLED, gDISABLED, gINTERN, gLINUX, gGCC, gUPC, gLOAD - }; - -const char *info[][MAXOSD] = -{ - { "Image Version :" , "Image Version :" }, - { "Image Typ :" , "Image Type :" }, - { "Datum :" , "Creation Date :" }, - { "Uhrzeit :" , "Creation Time :" }, - { "Erstellt von :" , "Creator :" }, - { "Image Name :" , "Image Name :" }, - { "Homepage :" , "Homepage :" }, - { "Netzwerk Status :" , "Network State :" }, - { "DHCP Status :" , "DHCP State :" }, - { "Root-Server :" , "Root-Server :" }, - { "IP Adresse :" , "IP Address :" }, - { "Netzmaske :" , "Subnet Mask :" }, - { "Broadcast :" , "Broadcast :" }, - { "Gateway :" , "Gateway :" }, - { "Nameserver :" , "Nameserver :" }, - { "-------- Netzwerkeinstellungen --------" , "---------- Network Settings -----------" }, - { "-- unbekannt --" , "-- unknown --" }, - { "aktiviert" , "enabled" }, - { "deaktiviert" , "disabled" }, - { "intern" , "intern" }, - { "Linux Version" , "Linux Version" }, - { "gcc Version" , "gcc Version" }, - { "Erstellt mit dem Computer" , "Built with the computer" }, - { "Lade" , "Loading" } -}; - -int main(int argc, char **argv) -{ - switch (fork()) - { - case -1: - perror("[gitVCInfo] fork"); - return -1; - case 0: - break; - default: - return 0; - } - - if (setsid() < 0) - { - perror("[gitVCInfo] setsid"); - return 1; - } - - unsigned int id = 1; - int opt = -2; - char buf[BUFFERSIZE] = ""; - int release_type = -1; - int imageversion = 0; - int imagesubver = 0; - char imagesubver2[BUFFERSIZE] = "0"; - int year = 9999; - int month = 99; - int day = 99; - int hour = 99; - int minute = 99; - bool delay = false; - int dhcp = 0; - int nic_on = 0; - char imagetyp[64] = "squashfs"; - char linuxversion[24] = ""; - char gccversion[50] = ""; - char userpc[24]; - char ladename[BUFFERSIZE] = "System"; - char creator[BUFFERSIZE]; - char imagename[BUFFERSIZE]; - char homepage[BUFFERSIZE]; - char root[BUFFERSIZE]; - char address[BUFFERSIZE]; - char broadcast[BUFFERSIZE]; - char netmask[BUFFERSIZE]; - char nameserver[BUFFERSIZE]; - char gateway[BUFFERSIZE]; - char null[BUFFERSIZE] = ""; - char versioninfo[20]; - char git_revision[] = "$Revision: 1.7 $"; - sscanf(git_revision, "%*s %s", versioninfo); - - while ((opt = getopt(argc, argv, "hgdn:")) != -1) - { - switch (opt) - { - case 'h': - if (argc < 3) - { - printf("gitVCInfo - bootinfo on screen, v%s\n", versioninfo); - printf("Usage: gitVCInfo [-d] [-g] [-n name] [-h]\n"); - printf("\nPossible options:\n"); - printf("\t-h\t\tprint this usage information\n"); - printf("\t-g\t\tprint bootinfo in german\n"); - printf("\t-d\t\tdelay on\n"); - printf("\t-n name\t\tspecial output (e.g. -n Neutrino)\n"); - exit(0); - } - break; - case 'g': - id = 0; - break; - case 'd': - delay = true; - break; - case 'n': - strcpy(ladename, optarg); - break; - default: - break; - } - } - - strcpy(creator, info[gUNKNOWN][id]); - strcpy(imagename, info[gUNKNOWN][id]); - strcpy(homepage, info[gUNKNOWN][id]); - strcpy(root, info[gINTERN][id]); - strcpy(address, info[gUNKNOWN][id]); - strcpy(broadcast, info[gUNKNOWN][id]); - strcpy(netmask, info[gUNKNOWN][id]); - strcpy(nameserver, info[gUNKNOWN][id]); - strcpy(gateway, info[gUNKNOWN][id]); - - FILE *fv1 = fopen(VERSION_FILE, "r"); - if (fv1) - { - while (fgets(buf, BUFFERSIZE, fv1)) - { - sscanf(buf, "version=%1d%1d%1d%1s%4d%2d%2d%2d%2d", - &release_type, &imageversion, &imagesubver, (char *) &imagesubver2, - &year, &month, &day, &hour, &minute); - sscanf(buf, "creator=%[^\n]", (char *) &creator); - sscanf(buf, "imagename=%[^\n]", (char *) &imagename); - sscanf(buf, "homepage=%[^\n]", (char *) &homepage); - } - fclose(fv1); - } - - FILE *fv2 = fopen(INTERFACES_FILE, "r"); - if (fv2) - { - while (fgets(buf, BUFFERSIZE, fv2)) - { - if (nic_on == 0) - { - if (sscanf(buf, "auto eth%[0]", (char *) &null)) - { - nic_on = 1; - } - } - if (sscanf(buf, "iface eth0 inet stati%[c]", (char *) &null)) - { - dhcp = 1; - } - else if (sscanf(buf, "iface eth0 inet dhc%[p]", (char *) &null)) - { - dhcp = 2; - } - } - fclose(fv2); - } - - FILE *fv3 = fopen(NAMENSSERVER_FILE, "r"); - if (fv3) - { - while (fgets(buf, BUFFERSIZE, fv3)) - { - sscanf(buf, "nameserver %[^\n]", (char *) &nameserver); - } - fclose(fv3); - } - - FILE *fv4 = popen("/sbin/ifconfig eth0", "r"); - if (fv4) - { - while (fgets(buf, BUFFERSIZE, fv4)) - { - sscanf(buf, " inet addr:%s Bcast:%s Mask:%[^\n]", (char *) &address, (char *) &broadcast, (char *) &netmask); - } - fclose(fv4); - } - - FILE *fv5 = popen("/sbin/route -n", "r"); - if (fv5) - { - fscanf(fv5, "%*[^\n]\n%*[^\n]\n%*[^\n]\n"); - while (fgets(buf, BUFFERSIZE, fv5)) - { - sscanf(buf, "%s %[0-9.]", (char *) &null, (char *) &gateway); - } - fclose(fv5); - } - - FILE *fv6 = fopen(MOUNTS_FILE, "r"); //Root-Server IP ermitteln, falls nfsboot - if (fv6) - { - while (fgets(buf, BUFFERSIZE, fv6) != NULL) - { - sscanf(buf, "/dev/root / nfs rw,v2,rsize=4096,wsize=4096,hard,udp,nolock,addr=%s", (char *) &root); - } - fclose(fv6); - } - - FILE *fv7 = fopen(VERSION_FILE2, "r"); //Versionsdatei (/proc/version) auswerten - if (fv7) - { - while (fgets(buf, BUFFERSIZE, fv2) != NULL) - { - sscanf(buf, "Linux version %s (%s) (%s) ", (char *) &linuxversion, (char *) &userpc, (char *) &gccversion/*, (char *) &gccversion, (char *) &gccversion*/); - //Linux version 2.6.17.14_stm22_0041 (BrechREiZ@rhel) (gcc-Version 4.1.1 (STMicroelectronics/Linux Base 4.1.1-23)) #1 PREEMPT Sun Mar 28 20:58:08 CEST - } - fclose(fv7); - } - - FILE *fv8 = fopen(VERSION_FILE, "a"); //Versionsdatei (/.version) beschreibbar, dann jffs2/ext2... - if (fv8) - { - fclose(fv8); - strcpy(imagetyp, "jffs2/ext2"); - } - - char message2[BUFFERSIZE]; - strcpy(message2, ""); - if (delay) - sprintf(message2, "%s %s .... ", info[gLOAD][id], ladename); - - char message[BIGBUFFERSIZE]; - strcpy(message, ""); - sprintf(message, - "\n\n\n\n" - "\t\t ---------- Image Information ----------\n\n" - "\t\t %s %d.%d.%s\n" //Image Version - "\t\t %s %s\n\n" //Image Typ - "\t\t %s %02d.%02d.%d\n" //Date - "\t\t %s %d:%02d\n" //Time - "\t\t %s %s\n" //Creator - "\t\t %s %s-%s\n" //Image Name - "\t\t %s %s\n\n" //Homepage - "\t\t %s\n\n" - "\t\t %s %s\n" //Network state - "\t\t %s %s\n" //DHCP state - "\t\t %s %s\n" //Root-Server - "\t\t %s %s\n" //IP Adress - "\t\t %s %s\n" //Subnet - "\t\t %s %s\n" //Broadcast - "\t\t %s %s\n" //Gateway - "\t\t %s %s\n\n" //Nameserver - "\t\t %s %s, %s %s\n " //Linux Version, gcc Version - "\t\t %s %s\n\n" //User, PC - "\t\t\t\t%s", - info[gVERSION][id], imageversion, imagesubver, imagesubver2, - info[gTYPE][id], release_type == 0 ? "Release" - : release_type == 1 ? "Snapshot" - : release_type == 2 ? "Intern" - : info[gUNKNOWN][id], - info[gDATE][id], day, month, year, - info[gTIME][id], hour, minute, - info[gCREATOR][id], creator, - info[gNAME][id], imagename, imagetyp, - info[gWWW][id], homepage, - info[gHEADLINE][id], - info[gNETW][id], nic_on == 0 ? info[gDISABLED][id] : nic_on == 1 ? info[gENABLED][id] : info[gUNKNOWN][id], - info[gDHCP][id], dhcp == 1 ? info[gDISABLED][id] : dhcp == 2 ? info[gENABLED][id] : info[gUNKNOWN][id], - info[gROOT][id], root, - info[gIP][id], address, - info[gNETM][id], netmask, - info[gBROAD][id], broadcast, - info[gGATEWAY][id], gateway, - info[gDNS][id], nameserver, - info[gLINUX][id], linuxversion, - info[gGCC][id], gccversion, - info[gUPC][id], userpc, - message2); - - FILE *fb = fopen(CONSOLE, "w"); - if (fb == 0) - { - perror("[gitVCInfo] fopen"); - exit(1); - } - - if (!delay) - { - for (unsigned int i = 0; i < strlen(message); i++) - { - fputc(message[i], fb); - fputc(message[i], stdout); - fflush(fb); - fflush(stdout); - } - } - else - { - sprintf(message2, "%s %s .... ", info[gLOAD][id], ladename); - for (unsigned int i = 0; i < strlen(message); i++) - { - fputc(message[i], fb); - fputc(message[i], stdout); - fflush(fb); - fflush(stdout); - usleep(CHARDELAY); - } - } - fputc('\n', fb); - fputc('\n', stdout); - fclose(fb); - return 0; -} diff --git a/hotplug/COPYING b/hotplug/COPYING deleted file mode 100644 index d511905..0000000 --- a/hotplug/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/hotplug/ChangeLog b/hotplug/ChangeLog deleted file mode 100644 index 59b1163..0000000 --- a/hotplug/ChangeLog +++ /dev/null @@ -1,64 +0,0 @@ -Summary of changes v001 to v002 -============================================ - -Christian Borntraeger: - o fix segfault when no parameters are used for agents - o typo in make uninstall - -Greg KH: - o Add manpage to the install/uninstall rules - o delete klibc/klibc.spec, which is a generated file - -Greg Kroah-Hartman: - o fix 'make release' to work properly with git - o update makefile to allow me to do a tarball interm release for someone - o fix up argc test in module_form.c - o make the release tarballs have writable files - -Kay Sievers: - o rename LOG to USE_LOG - o cleanup logging.h and list.h - o libsysfs: new version - o remove old klibc_fixups - o klibc: version 1.0.3 - -Pozsar Balazs: - o Add ieee1394 support - o fix width of pci ids - -Tobias Klauser: - o Manpage for hotplug-ng - - -Summary of changes up to v001 -============================================ - -Greg Kroah-Hartman: - o fix permissions on module_scsi.c - o update documentation - o lots of makefile cleanups (now installs and uninstalls.) - o delete more unneeded subdirs - o delete the test subdir for now - o ok, now the scsi code works - o more scsi cleanups - o fix scsi code to work - o update bk ignore list - o add framework for scsi support - o fun with #defines, it's easier to create a module_ file now - o bk ignore update - o add pci support - o make ccdv work better with vim - o fix up 'make clean' - o delet extras directory - o update bk ignore list - o module_usb now works - o add module_usb program - o add usb.c file from diethotplug package - o make /etc/hotplug.d/ be configurable (for whatever reason...) - o rip out all the unneeded udev remanants - o make hotplug work properly if there is no argv[1] (which can happen) - o updated bk ignore list - o add hotplug to the build - o add hotplug.c - o Import changeset - diff --git a/hotplug/Makefile.am b/hotplug/Makefile.am deleted file mode 100644 index 93d389f..0000000 --- a/hotplug/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -sbin_PROGRAMS = hotplug - -hotplug_SOURCES = \ - bdpoll.c \ - hotplug.c \ - hotplug_basename.c \ - hotplug_devpath.c \ - hotplug_pidfile.c \ - hotplug_setenv.c \ - hotplug_socket.c \ - hotplug_timeout.c \ - hotplug_util.c \ - module_block.c \ - module_firmware.c \ - module_ieee1394.c \ - module_pci.c \ - module_scsi.c \ - module_usb.c \ - udev_sysdeps.c \ - udev_sysfs.c \ - udev_utils.c \ - udev_utils_string.c diff --git a/hotplug/README b/hotplug/README deleted file mode 100644 index 16d51ad..0000000 --- a/hotplug/README +++ /dev/null @@ -1,64 +0,0 @@ - -hotplug-ng - a /sbin/hotplug replacement and auto module loader in c - -To use: - -- You must be running a 2.6 version of the Linux kernel. - -- Your 2.6 kernel must have had CONFIG_HOTPLUG enabled when it was built. - -- Build the project: - make - - Note: - There are a number of different flags that you can use when building - hotplug-ng. They are as follows: - prefix - set this to the default root that you want hotplug-ng to be - installed into. This works just like the 'configure --prefix' - script does. Default value is ''. Only override this if you - really know what you are doing. - USE_KLIBC - if set to 'true', hotplug-ng is built and linked against the - included version of klibc. Default value is 'false'. - USE_LOG - if set to 'true', hotplug-ng will emit messages to the syslog - when it creates or removes device nodes. This is helpful to - see what hotplug-ng is doing. This is enabled by default. - Note, if you are building hotplug-ng against klibc it is - recommended that you disable this option (due to klibc's syslog - implementation.) - DEBUG - if set to 'true', debugging messages will be sent to the syslog - as hotplug-ng is run. Default value is 'false'. - KERNEL_DIR - If this is not set it will default to /lib/modules/`uname -r`/build - This is used if USE_KLIBC=true to find the kernel include - directory that klibc needs to build against. This must be set - if you are not building hotplug-ng while running a 2.6 kernel. - - So, if you want to build hotplug using klibc with debugging messages, you - would do: - make USE_KLIBC=true DEBUG=true - -- Install the project: - make install - -- Add and remove devices from the system and marvel as modules are automatically - loaded faster than they ever have been. - -- If you later get sick of it, uninstall it: - make uninstall - - -Development and documentation help is very much appreciated, see the TODO -file for a list of things left to be done. - -Any comment/questions/concerns please let me and the other hotplug developers -know by sending a message to the linux-hotplug-devel mailing list at: - linux-hotplug-devel@lists.sourceforge.net - -greg k-h -greg@kroah.com -gregkh@suse.de - diff --git a/hotplug/TODO b/hotplug/TODO deleted file mode 100644 index d18f4a2..0000000 --- a/hotplug/TODO +++ /dev/null @@ -1,17 +0,0 @@ -This is a short list of things that needs to be done. They are in no specific -order. I will gladly accept patches for any of these items, or any other stuff -people offer up. - -greg k-h -greg@kroah.com -gregkh@suse.de - -- more autoloaders (need to at least support what the bash scripts do.) We - are missing the following at least: - - input - - dasd - - ieee1394 - -- documentation! We really should document this boot process -- man pages! - diff --git a/hotplug/autogen.sh b/hotplug/autogen.sh deleted file mode 100755 index 867a886..0000000 --- a/hotplug/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-hotplug" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/hotplug/bdpoll.c b/hotplug/bdpoll.c deleted file mode 100644 index 10f15c7..0000000 --- a/hotplug/bdpoll.c +++ /dev/null @@ -1,261 +0,0 @@ -/* - bdpoll.c (based on addon-storage.c from hal-0.5.10) - - Poll storage devices for media changes - - Copyright (C) 2007 Andreas Oberritter - Copyright (C) 2004 David Zeuthen, - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License 2.0 as published by - the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "bdpoll.h" -#include "hotplug_devpath.h" -#include "hotplug_setenv.h" -#include "hotplug_socket.h" -#include "udev.h" - -enum -{ - MEDIA_STATUS_UNKNOWN = 0, - MEDIA_STATUS_GOT_MEDIA = 1, - MEDIA_STATUS_NO_MEDIA = 2, -}; - -static int media_status = MEDIA_STATUS_NO_MEDIA; -static const int interval_in_seconds = 2; - -static const char *bdpoll_vars[] = -{ - "DEVPATH", - "X_E2_MEDIA_STATUS", - NULL, -}; - -static void bdpoll_notify(const char devpath[]) -{ - setenv("DEVPATH", devpath, 1); - hotplug_setenv_bool("X_E2_MEDIA_STATUS", media_status == MEDIA_STATUS_GOT_MEDIA); - hotplug_socket_send_env(bdpoll_vars); -} - -static bool is_mounted(const char device_file[]) -{ - FILE *f; - bool rc; - struct mntent mnt; - struct mntent *mnte; - char buf[512]; - - rc = false; - - if ((f = setmntent("/etc/mtab", "r")) == NULL) - return rc; - - while ((mnte = getmntent_r(f, &mnt, buf, sizeof(buf))) != NULL) - { - if (strcmp(device_file, mnt.mnt_fsname) == 0) - { - rc = true; - break; - } - } - - endmntent(f); - return rc; -} - -static bool poll_for_media(const char device_file[], bool is_cdrom, bool support_media_changed) -{ - int fd; - bool got_media = false; - bool ret = false; - - if (is_cdrom) - { - int drive; - - fd = open(device_file, O_RDONLY | O_NONBLOCK | O_EXCL); - if (fd < 0 && errno == EBUSY) - { - /* this means the disc is mounted or some other app, - * like a cd burner, has already opened O_EXCL */ - - /* HOWEVER, when starting hald, a disc may be - * mounted; so check /etc/mtab to see if it - * actually is mounted. If it is we retry to open - * without O_EXCL - */ - if (!is_mounted(device_file)) - return false; - fd = open(device_file, O_RDONLY | O_NONBLOCK); - } - if (fd < 0) - { - err("%s: %s", device_file, strerror(errno)); - return false; - } - - /* Check if a disc is in the drive - * - * @todo Use MMC-2 API if applicable - */ - drive = ioctl(fd, CDROM_DRIVE_STATUS, CDSL_CURRENT); - switch (drive) - { - case CDS_NO_INFO: - case CDS_NO_DISC: - case CDS_TRAY_OPEN: - case CDS_DRIVE_NOT_READY: - break; - - case CDS_DISC_OK: - /* some CD-ROMs report CDS_DISK_OK even with an open - * tray; if media check has the same value two times in - * a row then this seems to be the case and we must not - * report that there is a media in it. */ - if (support_media_changed && - ioctl(fd, CDROM_MEDIA_CHANGED, CDSL_CURRENT) && - ioctl(fd, CDROM_MEDIA_CHANGED, CDSL_CURRENT)) - { - } - else - { - got_media = true; - } - break; - - case -1: - err("%s: CDROM_DRIVE_STATUS: %s", device_file, strerror(errno)); - break; - } - - close(fd); - } - else - { - fd = open(device_file, O_RDONLY); - if ((fd < 0) && (errno == ENOMEDIUM)) - { - got_media = false; - } - else if (fd >= 0) - { - got_media = true; - } - else - { - err("%s: %s", device_file, strerror(errno)); - return false; - } - } - - switch (media_status) - { - case MEDIA_STATUS_GOT_MEDIA: - if (!got_media) - { - dbg("Media removal detected on %s\n", device_file); - ret = true; - /* have to this to trigger appropriate hotplug events */ - fd = open(device_file, O_RDONLY | O_NONBLOCK); - if (fd >= 0) - { - ioctl(fd, BLKRRPART); - close(fd); - } - } - break; - - case MEDIA_STATUS_NO_MEDIA: - if (got_media) - { - dbg("Media insertion detected on %s\n", device_file); - ret = true; - } - break; - } - - /* update our current status */ - if (got_media) - media_status = MEDIA_STATUS_GOT_MEDIA; - else - media_status = MEDIA_STATUS_NO_MEDIA; - - return ret; -} - -static void usage(const char argv0[]) -{ - fprintf(stderr, "usage: %s [-c][-m]\n", argv0); -} - -int bdpoll(int argc, char *argv[], char *envp[]) -{ - char devnode[FILENAME_MAX]; - const char *devpath; - bool is_cdrom = false; - bool support_media_changed = false; - int opt; - - while ((opt = getopt(argc, argv, "cm")) != -1) - { - switch (opt) - { - case 'c': - is_cdrom = true; - break; - case 'm': - support_media_changed = true; - break; - default: - usage(argv[0]); - return EXIT_FAILURE; - } - } - - if (optind == argc) - { - usage(argv[0]); - return EXIT_FAILURE; - } - - devpath = argv[optind]; - - if (!hotplug_devpath_to_devnode(devpath, devnode, sizeof(devnode))) - { - err("could not parse devpath"); - } - - for (;;) - { - if (poll_for_media(devnode, is_cdrom, support_media_changed)) - bdpoll_notify(devpath); - sleep(interval_in_seconds); - } - - return EXIT_SUCCESS; -} - diff --git a/hotplug/bdpoll.h b/hotplug/bdpoll.h deleted file mode 100644 index ed937ee..0000000 --- a/hotplug/bdpoll.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef HOTPLUG_BDPOLL_H -#define HOTPLUG_BDPOLL_H - -int bdpoll(int argc, char *argv[], char *envp[]); - -#endif diff --git a/hotplug/configure.ac b/hotplug/configure.ac deleted file mode 100644 index 4d05f4e..0000000 --- a/hotplug/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT([hotplug],[1.0],[],[hotplug]) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_OUTPUT([ -Makefile -]) diff --git a/hotplug/hotplug.c b/hotplug/hotplug.c deleted file mode 100644 index 13bc0c0..0000000 --- a/hotplug/hotplug.c +++ /dev/null @@ -1,210 +0,0 @@ -/* - hotplug.c - - Copyright (C) 2007 Andreas Oberritter - Copyright (C) 2004,2005 Greg Kroah-Hartman - Copyright (C) 2004,2007 Kay Sievers - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License 2.0 as published by - the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#include -#include -#include -#include -#include "bdpoll.h" -#include "hotplug_basename.h" -#include "hotplug_socket.h" -#include "hotplug_util.h" -#include "module_block.h" -#include "module_firmware.h" -#include "module_ieee1394.h" -#include "module_pci.h" -#include "module_scsi.h" -#include "module_usb.h" -#include "udev.h" - -struct command -{ - const char *name; - int (*cmd)(int argc, char *argv[], char *envp[]); -}; - -struct subsys -{ - const char *name; - int (*add)(void); - int (*remove)(void); -}; - -static struct subsys subsystems[] = -{ - { - .name = "block", - .add = block_add, - .remove = block_remove, - }, { - .name = "firmware", - .add = firmware_add, - }, { - .name = "ieee1394", - .add = ieee1394_add, - }, { - .name = "pci", - .add = pci_add, - }, { - .name = "scsi", - .add = scsi_add, - }, { - .name = "usb", - .add = usb_add, - }, -}; - -#if defined(USE_LOG) -void log_message(int level, const char *format, ...) -{ - va_list args; - - va_start(args, format); - vsyslog(level, format, args); - va_end(args); -} -#endif - -static void redirect_io(void) -{ -#if !defined(DEBUG) - int fd; - - fd = open("/dev/null", O_RDWR); - if (fd == -1) - { - perror("/dev/null"); - return; - } - - dup2(fd, STDOUT_FILENO); - dup2(fd, STDIN_FILENO); - dup2(fd, STDERR_FILENO); - close(fd); -#endif -} - -static int hotplug(int argc, char *argv[], char *envp[]) -{ - const char *action; - const char *modalias; - struct subsys *s; - unsigned int i; - const char *sysname; - - redirect_io(); - - /* dbg("starting hotplug version %s", UDEV_VERSION); */ - - if (argc < 2) - { - err("hotplug expects a parameter, aborting."); - return EXIT_FAILURE; - } - sysname = argv[1]; - - action = getenv("ACTION"); - if (action == NULL) - { - err("missing ACTION environment variable, aborting."); - return EXIT_FAILURE; - } - - modalias = getenv("MODALIAS"); - if (modalias != NULL) - { - if (!strcmp(ADD_STRING, action)) - modprobe(modalias, true); - else if (!strcmp(REMOVE_STRING, action)) - modprobe(modalias, false); - } - - for (i = 0; i < sizeof(subsystems) / sizeof(subsystems[0]); i++) - { - s = &subsystems[i]; - if (strcmp(s->name, sysname)) - continue; - if (!strcmp(ADD_STRING, action) && s->add) - { - return s->add(); - } - else if (!strcmp(REMOVE_STRING, action) && s->remove) - { - return s->remove(); - } - else - { - dbg("we do not handle %s for %s", action, sysname); - return EXIT_SUCCESS; - } - } - - return EXIT_FAILURE; -} - -static const struct command cmds[] = -{ - { - .name = "bdpoll", - .cmd = bdpoll, - }, - { - .name = "hotplug", - .cmd = hotplug, - }, -#if defined(UDEVMONITOR) - { - .name = "udevmonitor", - .cmd = udevmonitor, - }, -#endif -#if defined(UDEVTRIGGER) - { - .name = "udevtrigger", - .cmd = udevtrigger, - }, -#endif -}; - -int main(int argc, char *argv[], char *envp[]) -{ - const char *command; - const struct command *cmd; - int ret = EXIT_FAILURE; - - /* get binary or symlink name */ - command = hotplug_basename(argv[0]); - - logging_init(command); - - for (cmd = cmds; cmd->name != NULL; cmd++) - { - if (strcmp(cmd->name, command) == 0) - { - ret = cmd->cmd(argc, argv, envp); - break; - } - } - - logging_close(); - return ret; -} - diff --git a/hotplug/hotplug_basename.c b/hotplug/hotplug_basename.c deleted file mode 100644 index 83a147c..0000000 --- a/hotplug/hotplug_basename.c +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include "hotplug_basename.h" - -const char *hotplug_basename(const char *path) -{ - const char *name; - - name = strrchr(path, '/'); - if (name == NULL) - return path; - - return &name[1]; -} - diff --git a/hotplug/hotplug_basename.h b/hotplug/hotplug_basename.h deleted file mode 100644 index b53b7d2..0000000 --- a/hotplug/hotplug_basename.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef HOTPLUG_BASENAME_H -#define HOTPLUG_BASENAME_H - -const char *hotplug_basename(const char *path); - -#endif diff --git a/hotplug/hotplug_devpath.c b/hotplug/hotplug_devpath.c deleted file mode 100644 index c971e76..0000000 --- a/hotplug/hotplug_devpath.c +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include "hotplug_basename.h" -#include "hotplug_devpath.h" - -bool hotplug_devpath_to_devnode(const char devpath[], char devnode[], size_t size) -{ - const char *str; - int ret; - - str = hotplug_basename(devpath); - if (!str) - return false; - - ret = snprintf(devnode, size, "/dev/%s", str); - if (ret < 0) - return false; - - return ((size_t)ret <= size); -} - diff --git a/hotplug/hotplug_devpath.h b/hotplug/hotplug_devpath.h deleted file mode 100644 index b73f120..0000000 --- a/hotplug/hotplug_devpath.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef HOTPLUG_DEVPATH_H -#define HOTPLUG_DEVPATH_H - -#include - -bool hotplug_devpath_to_devnode(const char devpath[], char devnode[], size_t size); - -#endif diff --git a/hotplug/hotplug_pidfile.c b/hotplug/hotplug_pidfile.c deleted file mode 100644 index 5b9c654..0000000 --- a/hotplug/hotplug_pidfile.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - hotplug_pidfile.c - - Copyright (C) 2007 Andreas Oberritter - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License 2.0 as published by - the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#include -#include -#include "hotplug_pidfile.h" -#include "udev_sysdeps.h" - -static void pidfile_set_name(char *filename, size_t size, const char *fmt, va_list ap) -{ - strlcpy(filename, "/var/run/", size); - vsnprintf(&filename[strlen(filename)], size - strlen(filename), fmt, ap); - strlcat(filename, ".pid", size); -} - -int pidfile_read(pid_t *pid, const char *fmt, ...) -{ - char filename[FILENAME_MAX]; - va_list ap; - FILE *f; - int ret; - - va_start(ap, fmt); - pidfile_set_name(filename, sizeof(filename), fmt, ap); - va_end(ap); - - f = fopen(filename, "r"); - if (f == NULL) - { - perror(filename); - return -1; - } - - ret = fscanf(f, "%d\n", pid); - fclose(f); - - return (ret == 1) ? 0 : -1; -} - -int pidfile_write(pid_t pid, const char *fmt, ...) -{ - char filename[FILENAME_MAX]; - va_list ap; - FILE *f; - - va_start(ap, fmt); - pidfile_set_name(filename, sizeof(filename), fmt, ap); - va_end(ap); - - f = fopen(filename, "w"); - if (f == NULL) - { - perror(filename); - return -1; - } - - fprintf(f, "%d\n", pid); - fclose(f); - - return 0; -} - -int pidfile_unlink(const char *fmt, ...) -{ - char filename[FILENAME_MAX]; - va_list ap; - - va_start(ap, fmt); - pidfile_set_name(filename, sizeof(filename), fmt, ap); - va_end(ap); - - return unlink(filename); -} - diff --git a/hotplug/hotplug_pidfile.h b/hotplug/hotplug_pidfile.h deleted file mode 100644 index 0cb982e..0000000 --- a/hotplug/hotplug_pidfile.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef HOTPLUG_PIDFILE_H -#define HOTPLUG_PIDFILE_H - -#include - -int pidfile_read(pid_t *pid, const char *fmt, ...); -int pidfile_write(pid_t pid, const char *fmt, ...); -int pidfile_unlink(const char *fmt, ...); - -#endif diff --git a/hotplug/hotplug_setenv.c b/hotplug/hotplug_setenv.c deleted file mode 100644 index 1f8e0e6..0000000 --- a/hotplug/hotplug_setenv.c +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include "hotplug_setenv.h" - -int hotplug_setenv_bool(const char *name, bool b) -{ - return setenv(name, b ? "1" : "0", 1); -} - diff --git a/hotplug/hotplug_setenv.h b/hotplug/hotplug_setenv.h deleted file mode 100644 index a60f527..0000000 --- a/hotplug/hotplug_setenv.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef HOTPLUG_SETENV_H -#define HOTPLUG_SETENV_H - -#include - -int hotplug_setenv_bool(const char *name, bool b); - -#endif diff --git a/hotplug/hotplug_socket.c b/hotplug/hotplug_socket.c deleted file mode 100644 index 366461f..0000000 --- a/hotplug/hotplug_socket.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - hotplug_socket.c - - Copyright (C) 2007 Andreas Oberritter - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License 2.0 as published by - the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#include -#include -#include -#include -#include -#include "udev.h" - -void hotplug_socket_send_env(const char *vars[]) -{ - struct sockaddr_un addr; - const char *var; - int s; - - addr.sun_family = AF_LOCAL; - strcpy(addr.sun_path, "/tmp/hotplug.socket"); - - if ((s = socket(PF_LOCAL, SOCK_STREAM, 0)) == -1) - { - err("socket: %s", strerror(errno)); - return; - } - - if (connect(s, (const struct sockaddr *)&addr, SUN_LEN(&addr)) == -1) - { - err("connect: %s", strerror(errno)); - goto exit; - } - - while (*vars != NULL) - { - if ((var = getenv(*vars))) - { - write(s, *vars, strlen(*vars)); - write(s, "=", 1); - write(s, var, strlen(var) + 1); - } - vars++; - } -exit: - close(s); -} - diff --git a/hotplug/hotplug_socket.h b/hotplug/hotplug_socket.h deleted file mode 100644 index 7326ea5..0000000 --- a/hotplug/hotplug_socket.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef HOTPLUG_SOCKET_H -#define HOTPLUG_SOCKET_H - -void hotplug_socket_send_env(const char *vars[]); - -#endif diff --git a/hotplug/hotplug_timeout.c b/hotplug/hotplug_timeout.c deleted file mode 100644 index 6672800..0000000 --- a/hotplug/hotplug_timeout.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - hotplug_timeout.c - - Copyright (C) 2007 Andreas Oberritter - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License 2.0 as published by - the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#include -#include -#include "hotplug_timeout.h" - -static unsigned long timeout_ms(void) -{ - struct timeval tv; - - gettimeofday(&tv, NULL); - - return (tv.tv_sec * 1000) + (tv.tv_usec / 1000); -} - -void timeout_init(struct timeout *t, unsigned long ms) -{ - t->val = timeout_ms() + ms; -} - -int timeout_exceeded(struct timeout *t) -{ - return !((long)timeout_ms() - (long)t->val < 0); -} - diff --git a/hotplug/hotplug_timeout.h b/hotplug/hotplug_timeout.h deleted file mode 100644 index 5e9330e..0000000 --- a/hotplug/hotplug_timeout.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef HOTPLUG_TIMEOUT_H -#define HOTPLUG_TIMEOUT_H - -struct timeout -{ - unsigned long val; -}; - -void timeout_init(struct timeout *t, unsigned long ms); -int timeout_exceeded(struct timeout *t); - -#endif - - diff --git a/hotplug/hotplug_util.c b/hotplug/hotplug_util.c deleted file mode 100644 index 45455f3..0000000 --- a/hotplug/hotplug_util.c +++ /dev/null @@ -1,211 +0,0 @@ -/* - * hotplug_util.c - * - * Simple utility functions needed by some of the subsystems. - * - * Copyright (C) 2001,2005 Greg Kroah-Hartman - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -#include /* for NULL */ -#include -#include /* for exit() */ -#include -#include "hotplug_util.h" -#include "udev.h" - -/** - * split_2values - * - * takes a string of format "xxxx:yyyy" and figures out the - * values for xxxx and yyyy - * - */ -int split_2values(const char *string, int base, unsigned int *value1, unsigned int *value2) -{ - char buffer[200]; - char *temp1; - const char *temp2; - - dbg("string = %s", string); - - if (string == NULL) - return -1; - /* dietLibc doesn't have strnlen yet :( */ - /* if (strnlen (string, sizeof(buffer)) >= sizeof(buffer)) */ - if (strlen(string) >= sizeof(buffer)) - return -1; - - /* pick up the first number */ - temp1 = &buffer[0]; - temp2 = string; - while (1) - { - if (*temp2 == 0x00) - break; - if (*temp2 == ':') - break; - *temp1 = *temp2; - ++temp1; - ++temp2; - } - *temp1 = 0x00; - *value1 = strtoul(buffer, NULL, base); - dbg("buffer = %s", &buffer[0]); - dbg("value1 = %d", *value1); - - if (*temp2 == 0x00) - { - /* string is ended, not good */ - return -1; - } - - /* get the second number */ - temp1 = &buffer[0]; - ++temp2; - while (1) - { - if (*temp2 == 0x00) - break; - *temp1 = *temp2; - ++temp1; - ++temp2; - } - *temp1 = 0x00; - *value2 = strtoul(buffer, NULL, base); - dbg("buffer = %s", &buffer[0]); - dbg("value2 = %d", *value2); - - return 0; -} - - -/** - * split_3values - * - * takes a string of format "xxxx/yyyy/zzzz" and figures out the - * values for xxxx, yyyy, and zzzz - * - */ -int split_3values(const char *string, int base, unsigned int *value1, unsigned int *value2, unsigned int *value3) -{ - char buffer[200]; - char *temp1; - const char *temp2; - - dbg("string = %s", string); - - if (string == NULL) - return -1; - /* dietLibc doesn't have strnlen yet :( */ - /* if (strnlen (string, sizeof(buffer)) >= sizeof(buffer)) */ - if (strlen(string) >= sizeof(buffer)) - return -1; - - /* pick up the first number */ - temp1 = &buffer[0]; - temp2 = string; - while (1) - { - if (*temp2 == 0x00) - break; - if (*temp2 == '/') - break; - *temp1 = *temp2; - ++temp1; - ++temp2; - } - *temp1 = 0x00; - *value1 = strtoul(buffer, NULL, base); - dbg("buffer = %s", &buffer[0]); - dbg("value1 = %d", *value1); - - if (*temp2 == 0x00) - { - /* string is ended, not good */ - return -1; - } - - /* get the second number */ - temp1 = &buffer[0]; - ++temp2; - while (1) - { - if (*temp2 == 0x00) - break; - if (*temp2 == '/') - break; - *temp1 = *temp2; - ++temp1; - ++temp2; - } - *temp1 = 0x00; - *value2 = strtoul(buffer, NULL, base); - dbg("buffer = %s", &buffer[0]); - dbg("value2 = %d", *value2); - - if (*temp2 == 0x00) - { - /* string is ended, not good */ - return -1; - } - - /* get the third number */ - temp1 = &buffer[0]; - ++temp2; - while (1) - { - if (*temp2 == 0x00) - break; - *temp1 = *temp2; - ++temp1; - ++temp2; - } - *temp1 = 0x00; - *value3 = strtoul(buffer, NULL, base); - dbg("buffer = %s", &buffer[0]); - dbg("value3 = %d", *value3); - - return 0; -} - -int modprobe(const char *module_name, bool insert) -{ - unsigned int i = 0; - char *argv[4]; - - argv[i++] = "/sbin/modprobe"; - if (!insert) - argv[i++] = "-r"; - argv[i++] = (char *)module_name; - argv[i++] = NULL; - dbg("%sloading module %s", insert ? "" : "un", module_name); - switch (fork()) - { - case 0: - /* we are the child, so lets run the program */ - execv("/sbin/modprobe", argv); - exit(0); - break; - case (-1): - dbg("fork failed."); - break; - default: - break; - } - return 0; -} - diff --git a/hotplug/hotplug_util.h b/hotplug/hotplug_util.h deleted file mode 100644 index 120e273..0000000 --- a/hotplug/hotplug_util.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * hotplug_util.h - * - * A version of /sbin/hotplug that is not a script. - * - * Why? Think initrd :) - * - * Copyright (C) 2001,2005 Greg Kroah-Hartman - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -#ifndef HOTPLUG_UTIL_H -#define HOTPLUG_UTIL_H - -#include - -#define ADD_STRING "add" -#define REMOVE_STRING "remove" - -int split_3values(const char *string, int base, unsigned int *value1, unsigned int *value2, unsigned int *value3); -int split_2values(const char *string, int base, unsigned int *value1, unsigned int *value2); -int modprobe(const char *module_name, bool insert); - -#endif diff --git a/hotplug/list.h b/hotplug/list.h deleted file mode 100644 index da83ec1..0000000 --- a/hotplug/list.h +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Copied from the Linux kernel source tree, version 2.6.0-test1. - * - * Licensed under the GPL v2 as per the whole kernel source tree. - * - */ - -#ifndef _LIST_H -#define _LIST_H - -/** - * container_of - cast a member of a structure out to the containing structure - * - * @ptr: the pointer to the member. - * @type: the type of the container struct this is embedded in. - * @member: the name of the member within the struct. - * - */ -#define container_of(ptr, type, member) ({ \ - const typeof( ((type *)0)->member ) *__mptr = (ptr); \ - (type *)( (char *)__mptr - offsetof(type,member) );}) - -/* - * These are non-NULL pointers that will result in page faults - * under normal circumstances, used to verify that nobody uses - * non-initialized list entries. - */ -#define LIST_POISON1 ((void *) 0x00100100) -#define LIST_POISON2 ((void *) 0x00200200) - -/* - * Simple doubly linked list implementation. - * - * Some of the internal functions ("__xxx") are useful when - * manipulating whole lists rather than single entries, as - * sometimes we already know the next/prev entries and we can - * generate better code by using them directly rather than - * using the generic single-entry routines. - */ - -struct list_head -{ - struct list_head *next, *prev; -}; - -#define LIST_HEAD_INIT(name) { &(name), &(name) } - -#define LIST_HEAD(name) \ - struct list_head name = LIST_HEAD_INIT(name) - -#define INIT_LIST_HEAD(ptr) do { \ - (ptr)->next = (ptr); (ptr)->prev = (ptr); \ - } while (0) - -/* - * Insert a new entry between two known consecutive entries. - * - * This is only for internal list manipulation where we know - * the prev/next entries already! - */ -static inline void __list_add(struct list_head *new, - struct list_head *prev, - struct list_head *next) -{ - next->prev = new; - new->next = next; - new->prev = prev; - prev->next = new; -} - -/** - * list_add - add a new entry - * @new: new entry to be added - * @head: list head to add it after - * - * Insert a new entry after the specified head. - * This is good for implementing stacks. - */ -static inline void list_add(struct list_head *new, struct list_head *head) -{ - __list_add(new, head, head->next); -} - -/** - * list_add_tail - add a new entry - * @new: new entry to be added - * @head: list head to add it before - * - * Insert a new entry before the specified head. - * This is useful for implementing queues. - */ -static inline void list_add_tail(struct list_head *new, struct list_head *head) -{ - __list_add(new, head->prev, head); -} - -/* - * Delete a list entry by making the prev/next entries - * point to each other. - * - * This is only for internal list manipulation where we know - * the prev/next entries already! - */ -static inline void __list_del(struct list_head *prev, struct list_head *next) -{ - next->prev = prev; - prev->next = next; -} - -/** - * list_del - deletes entry from list. - * @entry: the element to delete from the list. - * Note: list_empty on entry does not return true after this, the entry is - * in an undefined state. - */ -static inline void list_del(struct list_head *entry) -{ - __list_del(entry->prev, entry->next); - entry->next = LIST_POISON1; - entry->prev = LIST_POISON2; -} - -/** - * list_del_init - deletes entry from list and reinitialize it. - * @entry: the element to delete from the list. - */ -static inline void list_del_init(struct list_head *entry) -{ - __list_del(entry->prev, entry->next); - INIT_LIST_HEAD(entry); -} - -/** - * list_move - delete from one list and add as another's head - * @list: the entry to move - * @head: the head that will precede our entry - */ -static inline void list_move(struct list_head *list, struct list_head *head) -{ - __list_del(list->prev, list->next); - list_add(list, head); -} - -/** - * list_move_tail - delete from one list and add as another's tail - * @list: the entry to move - * @head: the head that will follow our entry - */ -static inline void list_move_tail(struct list_head *list, - struct list_head *head) -{ - __list_del(list->prev, list->next); - list_add_tail(list, head); -} - -/** - * list_empty - tests whether a list is empty - * @head: the list to test. - */ -static inline int list_empty(struct list_head *head) -{ - return head->next == head; -} - -static inline void __list_splice(struct list_head *list, - struct list_head *head) -{ - struct list_head *first = list->next; - struct list_head *last = list->prev; - struct list_head *at = head->next; - - first->prev = head; - head->next = first; - - last->next = at; - at->prev = last; -} - -/** - * list_splice - join two lists - * @list: the new list to add. - * @head: the place to add it in the first list. - */ -static inline void list_splice(struct list_head *list, struct list_head *head) -{ - if (!list_empty(list)) - __list_splice(list, head); -} - -/** - * list_splice_init - join two lists and reinitialise the emptied list. - * @list: the new list to add. - * @head: the place to add it in the first list. - * - * The list at @list is reinitialised - */ -static inline void list_splice_init(struct list_head *list, - struct list_head *head) -{ - if (!list_empty(list)) - { - __list_splice(list, head); - INIT_LIST_HEAD(list); - } -} - -/** - * list_entry - get the struct for this entry - * @ptr: the &struct list_head pointer. - * @type: the type of the struct this is embedded in. - * @member: the name of the list_struct within the struct. - */ -#define list_entry(ptr, type, member) \ - container_of(ptr, type, member) - -/** - * list_for_each - iterate over a list - * @pos: the &struct list_head to use as a loop counter. - * @head: the head for your list. - */ -#define list_for_each(pos, head) \ - for (pos = (head)->next; pos != (head); \ - pos = pos->next) - -/** - * __list_for_each - iterate over a list - * @pos: the &struct list_head to use as a loop counter. - * @head: the head for your list. - * - * This variant differs from list_for_each() in that it's the - * simplest possible list iteration code. - * Use this for code that knows the list to be very short (empty - * or 1 entry) most of the time. - */ -#define __list_for_each(pos, head) \ - for (pos = (head)->next; pos != (head); pos = pos->next) - -/** - * list_for_each_prev - iterate over a list backwards - * @pos: the &struct list_head to use as a loop counter. - * @head: the head for your list. - */ -#define list_for_each_prev(pos, head) \ - for (pos = (head)->prev; pos != (head); pos = pos->prev) - -/** - * list_for_each_safe - iterate over a list safe against removal of list entry - * @pos: the &struct list_head to use as a loop counter. - * @n: another &struct list_head to use as temporary storage - * @head: the head for your list. - */ -#define list_for_each_safe(pos, n, head) \ - for (pos = (head)->next, n = pos->next; pos != (head); \ - pos = n, n = pos->next) - -/** - * list_for_each_entry - iterate over list of given type - * @pos: the type * to use as a loop counter. - * @head: the head for your list. - * @member: the name of the list_struct within the struct. - */ -#define list_for_each_entry(pos, head, member) \ - for (pos = list_entry((head)->next, typeof(*pos), member); \ - &pos->member != (head); \ - pos = list_entry(pos->member.next, typeof(*pos), member)) - -/** - * list_for_each_entry_reverse - iterate backwards over list of given type. - * @pos: the type * to use as a loop counter. - * @head: the head for your list. - * @member: the name of the list_struct within the struct. - */ -#define list_for_each_entry_reverse(pos, head, member) \ - for (pos = list_entry((head)->prev, typeof(*pos), member); \ - &pos->member != (head); \ - pos = list_entry(pos->member.prev, typeof(*pos), member)) - -/** - * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry - * @pos: the type * to use as a loop counter. - * @n: another type * to use as temporary storage - * @head: the head for your list. - * @member: the name of the list_struct within the struct. - */ -#define list_for_each_entry_safe(pos, n, head, member) \ - for (pos = list_entry((head)->next, typeof(*pos), member), \ - n = list_entry(pos->member.next, typeof(*pos), member); \ - &pos->member != (head); \ - pos = n, n = list_entry(n->member.next, typeof(*n), member)) - -#endif /* _LIST_H */ diff --git a/hotplug/logging.h b/hotplug/logging.h deleted file mode 100644 index dafacee..0000000 --- a/hotplug/logging.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * simple logging functions that can be expanded into nothing - * - * Copyright (C) 2003-2004 Greg Kroah-Hartman - * Copyright (C) 2004-2006 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef LOGGING_H -#define LOGGING_H - -#define err(format, arg...) do { } while (0) -#define info(format, arg...) do { } while (0) -#define dbg(format, arg...) do { } while (0) -#define logging_init(foo) do { } while (0) -#define logging_close(foo) do { } while (0) - -#ifdef USE_LOG -#include -#include -#include - -#undef err -#define err(format, arg...) \ - do { \ - log_message(LOG_ERR ,"%s: " format ,__FUNCTION__ ,## arg); \ - } while (0) - -#undef info -#define info(format, arg...) \ - do { \ - log_message(LOG_INFO ,"%s: " format ,__FUNCTION__ ,## arg); \ - } while (0) - -#ifdef DEBUG -#undef dbg -#define dbg(format, arg...) \ - do { \ - log_message(LOG_DEBUG ,"%s: " format ,__FUNCTION__ ,## arg); \ - } while (0) -#endif - -extern void log_message(int priority, const char *format, ...) -__attribute__((format(printf, 2, 3))); - -#undef logging_init -static inline void logging_init(const char *program_name) -{ - openlog(program_name, LOG_PID | LOG_CONS, LOG_DAEMON); -} - -#undef logging_close -static inline void logging_close(void) -{ - closelog(); -} - -#endif /* USE_LOG */ - -#endif diff --git a/hotplug/module_block.c b/hotplug/module_block.c deleted file mode 100644 index 1a535bd..0000000 --- a/hotplug/module_block.c +++ /dev/null @@ -1,317 +0,0 @@ -/* - module_block.c - - Creates block device nodes using hotplug environment variables. - - Copyright (C) 2007 Andreas Oberritter - Copyright (C) 2005 Greg Kroah-Hartman - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License 2.0 as published by - the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#define _GNU_SOURCE /* for getline() */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "hotplug_basename.h" -#include "hotplug_devpath.h" -#include "hotplug_pidfile.h" -#include "hotplug_setenv.h" -#include "hotplug_socket.h" -#include "hotplug_timeout.h" -#include "module_block.h" -#include "udev.h" - -static const char *block_vars[] = -{ - "ACTION", - "DEVPATH", - "PHYSDEVPATH", - "PHYSDEVDRIVER", - "X_E2_REMOVABLE", - "X_E2_CDROM", - NULL, -}; - -static int bdpoll_exec(const char devpath[], bool is_cdrom, bool support_media_changed) -{ - pid_t pid; - char *argv[5]; - unsigned int i = 0; - - pid = fork(); - if (pid == -1) - { - perror("fork"); - return -1; - } - else if (pid == 0) - { - argv[i++] = "bdpoll"; - argv[i++] = (char *)devpath; - if (is_cdrom) - argv[i++] = "-c"; - if (support_media_changed) - argv[i++] = "-m"; - argv[i++] = NULL; - if (execvp(argv[0], argv) == -1) - perror(argv[0]); - return -1; - } - else - { - return pidfile_write(pid, "bdpoll.%s", hotplug_basename(devpath)); - } -} - -static int bdpoll_kill(const char devpath[]) -{ - struct timeout t; - pid_t pid, wpid; - - if (pidfile_read(&pid, "bdpoll.%s", hotplug_basename(devpath)) == -1) - return -1; - - if (kill(pid, SIGTERM) == -1) - { - perror("kill"); - return -1; - } - - timeout_init(&t, 1000); - do - { - wpid = waitpid(pid, NULL, WNOHANG); - if (wpid == -1) - { - perror("waitpid"); - return -1; - } - if (wpid > 0) - goto exit; - } - while (!timeout_exceeded(&t)); - - if (kill(pid, SIGKILL) == -1) - { - perror("kill"); - return -1; - } - -exit: - pidfile_unlink("bdpoll.%s", hotplug_basename(devpath)); - return 0; -} - -static int do_mknod(const char *devnode, const char *major, const char *minor) -{ - dev_t dev = (atoi(major) << 8) | atoi(minor); - - return mknod(devnode, S_IFBLK | S_IRUSR | S_IWUSR, dev); -} - -static long sysfs_attr_get_long(const char *devpath, const char *attr_name) -{ - char *value; - - value = sysfs_attr_get_value(devpath, attr_name); - if (value == NULL) - { - errno = ERANGE; - return LONG_MAX; - } - - errno = 0; - return strtol(value, NULL, 0); -} - -#define GENHD_FL_REMOVABLE 1 -static bool dev_is_removable(const char *devpath) -{ - long attr; - - attr = sysfs_attr_get_long(devpath, "removable"); - if ((attr != LONG_MAX) || (errno != ERANGE)) - return (attr != 0); - - attr = sysfs_attr_get_long(devpath, "capability"); - if ((attr != LONG_MAX) || (errno != ERANGE)) - return (attr & GENHD_FL_REMOVABLE); - - return false; -} - -#define GENHD_FL_MEDIA_CHANGE_NOTIFY 4 -static bool dev_can_notify_media_change(const char *devpath) -{ - long attr; - - attr = sysfs_attr_get_long(devpath, "capability"); - if ((attr != LONG_MAX) || (errno != ERANGE)) - return (attr & GENHD_FL_MEDIA_CHANGE_NOTIFY); - - return false; -} - -#define GENHD_FL_CD 8 -static bool dev_is_cdrom(const char *devpath) -{ - char pathname[FILENAME_MAX]; - bool ret = false; - const char *str; - char *buf = NULL; - size_t n = 0; - long attr; - FILE *f; - - attr = sysfs_attr_get_long(devpath, "capability"); - if ((attr != LONG_MAX) || (errno != ERANGE)) - return (attr & GENHD_FL_CD); - - str = hotplug_basename(devpath); - - if (!strncmp(str, "sr", 2)) - return 1; - - if ((strlen(str) > 2) && - (str[0] == 'h') && - (str[1] == 'd')) - { - snprintf(pathname, sizeof(pathname), "/proc/ide/%s/media", str); - - f = fopen(pathname, "r"); - if (f == NULL) - { - dbg("can't open %s: %s", pathname, strerror(errno)); - } - else - { - if (getline(&buf, &n, f) != -1) - { - if (buf != NULL) - { - if (n >= 5) - ret = !strncmp(buf, "cdrom", 5); - free(buf); - } - } - fclose(f); - } - } - - return ret; -} - -int block_add(void) -{ - char *devpath; - const char *minor, *major; - char devnode[FILENAME_MAX]; - bool is_removable; - bool is_cdrom; - bool support_media_changed; - - sysfs_init(); - - /* - * DEVPATH=/block/sda - * DEVPATH=/block/sda/sda1 - */ - devpath = getenv("DEVPATH"); - if (!devpath) - { - dbg("missing DEVPATH environment variable, aborting."); - return EXIT_FAILURE; - } - - minor = getenv("MINOR"); - if (!minor) - { - dbg("missing MINOR environment variable, aborting."); - return EXIT_FAILURE; - } - - major = getenv("MAJOR"); - if (!major) - { - dbg("missing MAJOR environment variable, aborting."); - return EXIT_FAILURE; - } - - if (!hotplug_devpath_to_devnode(devpath, devnode, sizeof(devnode))) - { - dbg("could not get device node."); - return EXIT_FAILURE; - } - - unlink(devnode); - - if (do_mknod(devnode, major, minor) == -1) - { - dbg("mknod: %s", strerror(errno)); - return EXIT_FAILURE; - } - - is_removable = dev_is_removable(devpath); - is_cdrom = is_removable && dev_is_cdrom(devpath); - support_media_changed = is_cdrom && dev_can_notify_media_change(devpath); - - if (is_removable) - { - if (bdpoll_exec(devpath, is_cdrom, support_media_changed) == -1) - dbg("could not exec bdpoll"); - } - - hotplug_setenv_bool("X_E2_REMOVABLE", is_removable); - hotplug_setenv_bool("X_E2_CDROM", is_cdrom); - - hotplug_socket_send_env(block_vars); - - return EXIT_SUCCESS; -} - -int block_remove(void) -{ - char *devpath; - char devnode[FILENAME_MAX]; - - devpath = getenv("DEVPATH"); - if (!devpath) - { - dbg("missing DEVPATH environment variable, aborting."); - return EXIT_FAILURE; - } - - if (!hotplug_devpath_to_devnode(devpath, devnode, sizeof(devnode))) - { - dbg("could not get device node."); - return EXIT_FAILURE; - } - - unlink(devnode); - - if (bdpoll_kill(devpath) == -1) - dbg("could not kill bdpoll"); - - hotplug_socket_send_env(block_vars); - - return EXIT_SUCCESS; -} - diff --git a/hotplug/module_block.h b/hotplug/module_block.h deleted file mode 100644 index 1e3c0f4..0000000 --- a/hotplug/module_block.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef HOTPLUG_MODULE_BLOCK_H -#define HOTPLUG_MODULE_BLOCK_H - -int block_add(void); -int block_remove(void); - -#endif diff --git a/hotplug/module_firmware.c b/hotplug/module_firmware.c deleted file mode 100644 index 26f2c0c..0000000 --- a/hotplug/module_firmware.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - module_firmware.c - - Loads a firmware based on the firmware hotplug environment variables. - - Copyright (C) 2007 Andreas Oberritter - Copyright (C) 2001,2005 Greg Kroah-Hartman - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License 2.0 as published by - the Free Software Foundation. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ - -#include -#include -#include -#include -#include -#include -#include "module_firmware.h" -#include "udev.h" - -static int fw_open(const char *fmt, const char *str, int flags) -{ - char path[strlen(fmt) - strlen("%s") + strlen(str) + 1]; - int fd; - - snprintf(path, sizeof(path), fmt, str); - path[sizeof(path) - 1] = '\0'; - - fd = open(path, flags); - if (fd == -1) - { - dbg("can't open '%s': %s", path, strerror(errno)); - return -1; - } - - return fd; -} - -static int fw_write(int fd, const char *buf, size_t count) -{ - size_t off; - ssize_t ret; - - for (off = 0; off < count; off += ret) - { - ret = write(fd, &buf[off], count - off); - if (ret < 0) - { - dbg("write failed: %s", strerror(errno)); - return -1; - } - } - - return count; -} - -int firmware_add(void) -{ - char *devpath_env; - char *firmware_env; - int load_fd = -1; - int src_fd = -1; - int dst_fd = -1; - void *src_ptr = MAP_FAILED; - struct stat st; - int ret = 0; - - devpath_env = getenv("DEVPATH"); - firmware_env = getenv("FIRMWARE"); - dbg("DEVPATH='%s', FIRMWARE = '%s'", devpath_env, firmware_env); - if ((devpath_env == NULL) || - (firmware_env == NULL)) - { - dbg("missing an environment variable, aborting."); - return 1; - } - - load_fd = fw_open("/sys%s/loading", devpath_env, O_WRONLY); - src_fd = fw_open("/lib/firmware/%s", firmware_env, O_RDONLY); - dst_fd = fw_open("/sys%s/data", devpath_env, O_WRONLY); - if ((load_fd == -1) || (src_fd == -1) || (dst_fd == -1)) - goto err; - - if (fstat(src_fd, &st) == -1) - { - dbg("stat failed: %s", strerror(errno)); - goto err; - } - - src_ptr = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, src_fd, 0); - if (src_ptr == MAP_FAILED) - { - dbg("mmap failed: %s", strerror(errno)); - goto err; - } - - if (fw_write(load_fd, "1", 1) == -1) - goto err; - if (fw_write(dst_fd, src_ptr, st.st_size) == -1) - goto err; - if (fw_write(load_fd, "0", 1) == -1) - goto err; - - goto cleanup; -err: - ret = 1; - if (load_fd != -1) - fw_write(load_fd, "-1", 2); -cleanup: - if (src_ptr != MAP_FAILED) - munmap(src_ptr, st.st_size); - if (dst_fd != -1) - close(dst_fd); - if (src_fd != -1) - close(src_fd); - if (load_fd != -1) - close(load_fd); - - return ret; -} - - diff --git a/hotplug/module_firmware.h b/hotplug/module_firmware.h deleted file mode 100644 index c1ddde5..0000000 --- a/hotplug/module_firmware.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef HOTPLUG_MODULE_FIRMWARE_H -#define HOTPLUG_MODULE_FIRMWARE_H - -int firmware_add(void); - -#endif diff --git a/hotplug/module_ieee1394.c b/hotplug/module_ieee1394.c deleted file mode 100644 index 6bcddcc..0000000 --- a/hotplug/module_ieee1394.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * module_ieee1394.c - * - * Loads an ieee1394 driver based on the ieee1394 hotplug environment variables. - * - * Copyright (C) 2005 Pozsár Balázs - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ -#include -#include -#include "hotplug_util.h" -#include "module_ieee1394.h" -#include "udev.h" - -int ieee1394_add(void) -{ - char ieee1394_string[256]; - char *vendor_env; - char *model_env; - char *specifier_env; - char *version_env; - int error; - unsigned long vendor; - unsigned long model; - unsigned long specifier; - unsigned long version; - - vendor_env = getenv("VENDOR_ID"); - model_env = getenv("MODEL_ID"); - specifier_env = getenv("SPECIFIER_ID"); - version_env = getenv("VERSION"); - dbg("VENDOR_ID='%s', MODEL_ID='%s' SPECIFIER_ID='%s' VERSION='%s'", vendor_env, model_env, specifier_env, version_env); - if ((vendor_env == NULL) || - (model_env == NULL) || - (specifier_env == NULL) || - (version_env == NULL)) - { - dbg("missing an environment variable, aborting."); - return 1; - } - - vendor = strtoul(vendor_env, NULL, 16); - model = strtoul(model_env, NULL, 16); - specifier = strtoul(specifier_env, NULL, 16); - version = strtoul(version_env, NULL, 16); - - strcpy(ieee1394_string, "ieee1394:"); - sprintf(ieee1394_string + strlen(ieee1394_string), "ven%08lX", vendor); - sprintf(ieee1394_string + strlen(ieee1394_string), "mo%08lX", model); - sprintf(ieee1394_string + strlen(ieee1394_string), "sp%08lX", specifier); - sprintf(ieee1394_string + strlen(ieee1394_string), "ver%08lX", version); - - return modprobe(ieee1394_string, true); -} - diff --git a/hotplug/module_ieee1394.h b/hotplug/module_ieee1394.h deleted file mode 100644 index 8ed5251..0000000 --- a/hotplug/module_ieee1394.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef HOTPLUG_MODULE_IEEE1394_H -#define HOTPLUG_MODULE_IEEE1394_H - -int ieee1394_add(void); - -#endif diff --git a/hotplug/module_pci.c b/hotplug/module_pci.c deleted file mode 100644 index c4e38bf..0000000 --- a/hotplug/module_pci.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * module_pci.c - * - * Loads a pci driver based on the pci hotplug environment variables. - * - * Copyright (C) 2001,2005 Greg Kroah-Hartman - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ -#include -#include -#include "hotplug_util.h" -#include "module_pci.h" -#include "udev.h" - -int pci_add(void) -{ - char pci_string[256]; - char *class_env; - char *id_env; - char *subsys_env; - int error; - unsigned int vendor; - unsigned int device; - unsigned int subvendor; - unsigned int subdevice; - unsigned int class; - unsigned char baseclass, subclass, interface; - - id_env = getenv("PCI_ID"); - subsys_env = getenv("PCI_SUBSYS_ID"); - class_env = getenv("PCI_CLASS"); - if ((id_env == NULL) || - (subsys_env == NULL) || - (class_env == NULL)) - { - dbg("missing an environment variable, aborting."); - return 1; - } - - error = split_2values(id_env, 16, &vendor, &device); - if (error) - return error; - error = split_2values(subsys_env, 16, &subvendor, &subdevice); - if (error) - return error; - class = strtoul(class_env, NULL, 16); - - baseclass = (unsigned char)(class >> 16); - subclass = (unsigned char)(class >> 8); - interface = (unsigned char)class; - - strcpy(pci_string, "pci:"); - sprintf(pci_string + strlen(pci_string), "v%08X", vendor); - sprintf(pci_string + strlen(pci_string), "d%08X", device); - sprintf(pci_string + strlen(pci_string), "sv%08X", subvendor); - sprintf(pci_string + strlen(pci_string), "sd%08X", subdevice); - sprintf(pci_string + strlen(pci_string), "bc%02X", baseclass); - sprintf(pci_string + strlen(pci_string), "sc%02X", subclass); - sprintf(pci_string + strlen(pci_string), "i%02X", interface); - - return modprobe(pci_string, true); -} - diff --git a/hotplug/module_pci.h b/hotplug/module_pci.h deleted file mode 100644 index e953568..0000000 --- a/hotplug/module_pci.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef HOTPLUG_MODULE_PCI_H -#define HOTPLUG_MODULE_PCI_H - -int pci_add(void); - -#endif diff --git a/hotplug/module_scsi.c b/hotplug/module_scsi.c deleted file mode 100644 index f7c9029..0000000 --- a/hotplug/module_scsi.c +++ /dev/null @@ -1,98 +0,0 @@ -/* - * module_scsi.c - * - * Loads a scsi driver based on the scsi hotplug environment variables. - * - * Copyright (C) 2005 Greg Kroah-Hartman - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ -#include -#include -#include -#include -#include "hotplug_util.h" -#include "module_scsi.h" -#include "udev.h" - -int scsi_add(void) -{ - char scsi_file[256]; - char scsi_type[50]; - int type; - char *devpath; - char *module = NULL; - int i; - int fd; - int len; - int retval = 1; - - devpath = getenv("DEVPATH"); - if (!devpath) - { - dbg("missing DEVPATH environment variable, aborting."); - goto exit; - } - - snprintf(scsi_file, sizeof(scsi_file), "/sys%s/type", devpath); - for (i = 0; i < 10; ++i) - { - struct stat stats; - if (stat(scsi_file, &stats) == 0) - break; - sleep(1); - } - fd = open(scsi_file, O_RDONLY); - if (fd < 0) - { - dbg("can't open file '%s'", scsi_file); - goto exit; - } - len = read(fd, scsi_type, sizeof(scsi_type)); - if (len < 0) - { - dbg("can't open file '%s'", scsi_file); - goto exit_close; - } - - dbg("read '%s' from '%s'", scsi_type, scsi_file); - type = atoi(scsi_type); - dbg("type = %d", type); - switch (type) - { - case 0: - case 7: - module = "sd_mod"; - break; - case 1: - module = "st"; - break; - case 4: - case 5: - module = "sr_mod"; - break; - } - - if (module) - retval = modprobe(module, true); - else - retval = 0; - -exit_close: - close(fd); -exit: - return retval; -} - diff --git a/hotplug/module_scsi.h b/hotplug/module_scsi.h deleted file mode 100644 index a3801c6..0000000 --- a/hotplug/module_scsi.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef HOTPLUG_MODULE_SCSI_H -#define HOTPLUG_MODULE_SCSI_H - -int scsi_add(void); - -#endif diff --git a/hotplug/module_usb.c b/hotplug/module_usb.c deleted file mode 100644 index a3a7c3e..0000000 --- a/hotplug/module_usb.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * module_usb.c - * - * Loads a usb driver based on the usb hotplug environment variables. - * - * Copyright (C) 2001,2005 Greg Kroah-Hartman - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ -#include -#include -#include "hotplug_util.h" -#include "module_usb.h" -#include "udev.h" - -int usb_add(void) -{ - char usb_string[256]; - char *product_env; - char *type_env; - char *interface_env; - int error; - unsigned int idVendor; - unsigned int idProduct; - unsigned int bcdDevice; - unsigned int device_class; - unsigned int device_subclass; - unsigned int device_protocol; - unsigned int interface_class; - unsigned int interface_subclass; - unsigned int interface_protocol; - - product_env = getenv("PRODUCT"); - type_env = getenv("TYPE"); - dbg("PRODUCT='%s', TYPE = '%s'", product_env, type_env); - if ((product_env == NULL) || - (type_env == NULL)) - { - dbg("missing an environment variable, aborting."); - return 1; - } - strcpy(usb_string, "usb:"); - - error = split_3values(product_env, 16, &idVendor, &idProduct, &bcdDevice); - if (error) - return error; - error = split_3values(type_env, 10, &device_class, &device_subclass, &device_protocol); - if (error) - return error; - - sprintf(usb_string + strlen(usb_string), "v%04X", idVendor); - sprintf(usb_string + strlen(usb_string), "p%04X", idProduct); - sprintf(usb_string + strlen(usb_string), "dl%04X", bcdDevice); - sprintf(usb_string + strlen(usb_string), "dh%04X", bcdDevice); - sprintf(usb_string + strlen(usb_string), "dc%02X", (unsigned char)device_class); - sprintf(usb_string + strlen(usb_string), "dsc%02X", (unsigned char)device_subclass); - sprintf(usb_string + strlen(usb_string), "dp%02X", (unsigned char)device_protocol); - - /* we need to look at the interface too */ - interface_env = getenv("INTERFACE"); - if (interface_env == NULL) - { - /* no interface, use default values here. */ - sprintf(usb_string + strlen(usb_string), "ic*isc*ip*"); - } - else - { - error = split_3values(interface_env, 10, &interface_class, - &interface_subclass, &interface_protocol); - if (error) - return error; - sprintf(usb_string + strlen(usb_string), "ic%02X", (unsigned char)interface_class); - sprintf(usb_string + strlen(usb_string), "isc%02X", (unsigned char)interface_subclass); - sprintf(usb_string + strlen(usb_string), "ip%02X", (unsigned char)interface_protocol); - - } - - return modprobe(usb_string, true); -} - diff --git a/hotplug/module_usb.h b/hotplug/module_usb.h deleted file mode 100644 index 863b0e8..0000000 --- a/hotplug/module_usb.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef HOTPLUG_MODULE_USB_H -#define HOTPLUG_MODULE_USB_H - -int usb_add(void); - -#endif diff --git a/hotplug/udev.h b/hotplug/udev.h deleted file mode 100644 index 2628fe9..0000000 --- a/hotplug/udev.h +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (C) 2003 Greg Kroah-Hartman - * Copyright (C) 2003-2006 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef _UDEV_H_ -#define _UDEV_H_ - -#include -#include - -#include "list.h" -#include "logging.h" -#include "udev_sysdeps.h" -#include "udev_version.h" - -#define COMMENT_CHARACTER '#' -#define LINE_SIZE 512 -#define PATH_SIZE 512 -#define NAME_SIZE 256 -#define VALUE_SIZE 128 - -#define ALLOWED_CHARS "#+-.:=@_" -#define ALLOWED_CHARS_FILE ALLOWED_CHARS "/" -#define ALLOWED_CHARS_INPUT ALLOWED_CHARS_FILE " $%?," - -#define DEFAULT_PARTITIONS_COUNT 15 -#define UDEV_ALARM_TIMEOUT 180 - -#define UDEV_MAX(a,b) ((a) > (b) ? (a) : (b)) - -/* pipes */ -#define READ_END 0 -#define WRITE_END 1 - -#define DB_DIR ".udev/db" -#define DB_NAME_INDEX_DIR ".udev/names" -#define RULES_DYN_DIR ".udev/rules.d" - -struct udev_rules; - -struct sysfs_device -{ - struct list_head node; /* for device cache */ - struct sysfs_device *parent; /* already cached parent*/ - char devpath[PATH_SIZE]; - char subsystem[NAME_SIZE]; /* $class, $bus, drivers, module */ - char kernel[NAME_SIZE]; /* device instance name */ - char kernel_number[NAME_SIZE]; - char driver[NAME_SIZE]; /* device driver name */ -}; - -struct udevice -{ - /* device event */ - struct sysfs_device *dev; /* points to dev_local by default */ - struct sysfs_device dev_local; - struct sysfs_device *dev_parent; /* current parent device used for matching */ - char action[NAME_SIZE]; - char *devpath_old; - - /* node */ - char name[PATH_SIZE]; - struct list_head symlink_list; - int symlink_final; - char owner[NAME_SIZE]; - int owner_final; - char group[NAME_SIZE]; - int group_final; - mode_t mode; - int mode_final; - dev_t devt; - - /* event processing */ - struct list_head run_list; - int run_final; - struct list_head env_list; - char tmp_node[PATH_SIZE]; - int partitions; - int ignore_device; - int ignore_remove; - char program_result[PATH_SIZE]; - int link_priority; - int test_run; -}; - -/* udev_config.c */ -extern char udev_root[PATH_SIZE]; -extern char udev_config_filename[PATH_SIZE]; -extern char udev_rules_dir[PATH_SIZE]; -extern int udev_log_priority; -extern int udev_run; -extern void udev_config_init(void); - -/* udev_device.c */ -extern struct udevice *udev_device_init(struct udevice *udev); -extern void udev_device_cleanup(struct udevice *udev); -extern int udev_device_event(struct udev_rules *rules, struct udevice *udev); -extern dev_t udev_device_get_devt(struct udevice *udev); - -/* udev_sysfs.c */ -extern char sysfs_path[PATH_SIZE]; -extern int sysfs_init(void); -extern void sysfs_cleanup(void); -extern void sysfs_device_set_values(struct sysfs_device *dev, const char *devpath, - const char *subsystem, const char *driver); -extern struct sysfs_device *sysfs_device_get(const char *devpath); -extern struct sysfs_device *sysfs_device_get_parent(struct sysfs_device *dev); -extern struct sysfs_device *sysfs_device_get_parent_with_subsystem(struct sysfs_device *dev, const char *subsystem); -extern char *sysfs_attr_get_value(const char *devpath, const char *attr_name); -extern int sysfs_resolve_link(char *path, size_t size); -extern int sysfs_lookup_devpath_by_subsys_id(char *devpath, size_t len, const char *subsystem, const char *id); - -/* udev_node.c */ -extern int udev_node_mknod(struct udevice *udev, const char *file, dev_t devt, mode_t mode, uid_t uid, gid_t gid); -extern void udev_node_update_symlinks(struct udevice *udev, struct udevice *udev_old); -extern int udev_node_add(struct udevice *udev); -extern int udev_node_remove(struct udevice *udev); - -/* udev_db.c */ -extern int udev_db_add_device(struct udevice *dev); -extern int udev_db_delete_device(struct udevice *dev); -extern int udev_db_rename(const char *devpath_old, const char *devpath); -extern int udev_db_get_device(struct udevice *udev, const char *devpath); -extern int udev_db_get_devices_by_name(const char *name, struct list_head *name_list); -extern int udev_db_get_all_entries(struct list_head *name_list); - -/* udev_utils.c */ -struct name_entry -{ - struct list_head node; - char name[PATH_SIZE]; - unsigned int ignore_error: 1; -}; - -extern int log_priority(const char *priority); -extern struct name_entry *name_list_add(struct list_head *name_list, const char *name, int sort); -extern struct name_entry *name_list_key_add(struct list_head *name_list, const char *key, const char *value); -extern int name_list_key_remove(struct list_head *name_list, const char *key); -extern void name_list_cleanup(struct list_head *name_list); -extern int add_matching_files(struct list_head *name_list, const char *dirname, const char *suffix); -extern uid_t lookup_user(const char *user); -extern gid_t lookup_group(const char *group); - -/* udev_utils_string.c */ -extern int string_is_true(const char *str); -extern void remove_trailing_chars(char *path, char c); -extern size_t path_encode(char *s, size_t len); -extern size_t path_decode(char *s); -extern int utf8_encoded_valid_unichar(const char *str); -extern int replace_chars(char *str, const char *white); - -/* udev_utils_file.c */ -extern int create_path(const char *path); -extern int delete_path(const char *path); -extern int file_map(const char *filename, char **buf, size_t *bufsize); -extern void file_unmap(void *buf, size_t bufsize); -extern int unlink_secure(const char *filename); -extern size_t buf_get_line(const char *buf, size_t buflen, size_t cur); - -/* udev commands */ -extern int udevmonitor(int argc, char *argv[], char *envp[]); -extern int udevinfo(int argc, char *argv[], char *envp[]); -extern int udevcontrol(int argc, char *argv[], char *envp[]); -extern int udevtrigger(int argc, char *argv[], char *envp[]); -extern int udevsettle(int argc, char *argv[], char *envp[]); -extern int udevtest(int argc, char *argv[], char *envp[]); - -#endif diff --git a/hotplug/udev_sysdeps.c b/hotplug/udev_sysdeps.c deleted file mode 100644 index ab1008b..0000000 --- a/hotplug/udev_sysdeps.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2003 Greg Kroah-Hartman - * Copyright (C) 2005-2006 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include -#include -#include -#include -#include -#include -#include - -#include "udev.h" - -#ifdef __GLIBC__ -size_t strlcpy(char *dst, const char *src, size_t size) -{ - size_t bytes = 0; - char *q = dst; - const char *p = src; - char ch; - - while ((ch = *p++)) - { - if (bytes + 1 < size) - *q++ = ch; - bytes++; - } - - /* If size == 0 there is no space for a final null... */ - if (size) - *q = '\0'; - return bytes; -} - -size_t strlcat(char *dst, const char *src, size_t size) -{ - size_t bytes = 0; - char *q = dst; - const char *p = src; - char ch; - - while (bytes < size && *q) - { - q++; - bytes++; - } - if (bytes == size) - return (bytes + strlen(src)); - - while ((ch = *p++)) - { - if (bytes + 1 < size) - *q++ = ch; - bytes++; - } - - *q = '\0'; - return bytes; -} -#endif /* __GLIBC__ */ diff --git a/hotplug/udev_sysdeps.h b/hotplug/udev_sysdeps.h deleted file mode 100644 index 7c08034..0000000 --- a/hotplug/udev_sysdeps.h +++ /dev/null @@ -1,172 +0,0 @@ -/* - * wrapping of libc features and kernel interfaces - * - * Copyright (C) 2005-2006 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef _UDEV_SYSDEPS_H_ -#define _UDEV_SYSDEPS_H_ - -#include -#include -#include - -/* needed until Inotify! syscalls reach glibc */ -#include -#ifndef __NR_inotify_init -#if defined(__i386__) -# define __NR_inotify_init 291 -# define __NR_inotify_add_watch 292 -# define __NR_inotify_rm_watch 293 -#elif defined(__x86_64__) -# define __NR_inotify_init 253 -# define __NR_inotify_add_watch 254 -# define __NR_inotify_rm_watch 255 -#elif defined(__powerpc__) || defined(__powerpc64__) -# define __NR_inotify_init 275 -# define __NR_inotify_add_watch 276 -# define __NR_inotify_rm_watch 277 -#elif defined (__ia64__) -# define __NR_inotify_init 1277 -# define __NR_inotify_add_watch 1278 -# define __NR_inotify_rm_watch 1279 -#elif defined (__s390__) -# define __NR_inotify_init 284 -# define __NR_inotify_add_watch 285 -# define __NR_inotify_rm_watch 286 -#elif defined (__alpha__) -# define __NR_inotify_init 444 -# define __NR_inotify_add_watch 445 -# define __NR_inotify_rm_watch 446 -#elif defined (__sparc__) || defined (__sparc64__) -# define __NR_inotify_init 151 -# define __NR_inotify_add_watch 152 -# define __NR_inotify_rm_watch 156 -#elif defined (__arm__) -# define __NR_inotify_init __NR_SYSCALL_BASE+316 -# define __NR_inotify_add_watch __NR_SYSCALL_BASE+317 -# define __NR_inotify_rm_watch __NR_SYSCALL_BASE+318 -#elif defined (__sh__) -# define __NR_inotify_init 290 -# define __NR_inotify_add_watch 291 -# define __NR_inotify_rm_watch 292 -#elif defined (__m32r__) -# define __NR_inotify_init 290 -# define __NR_inotify_add_watch 291 -# define __NR_inotify_rm_watch 292 -#elif defined (__hppa__) -# define __NR_inotify_init 269 -# define __NR_inotify_add_watch 270 -# define __NR_inotify_rm_watch 271 -#elif defined (__mips__) -# include -# if _MIPS_SIM == _MIPS_SIM_ABI32 -# define __NR_Linux 4000 -# define __NR_inotify_init (__NR_Linux + 284) -# define __NR_inotify_add_watch (__NR_Linux + 285) -# define __NR_inotify_rm_watch (__NR_Linux + 286) -# elif _MIPS_SIM == _MIPS_SIM_ABI64 -# define __NR_Linux 5000 -# define __NR_inotify_init (__NR_Linux + 243) -# define __NR_inotify_add_watch (__NR_Linux + 244) -# define __NR_inotify_rm_watch (__NR_Linux + 245) -# elif _MIPS_SIM == _MIPS_SIM_NABI32 -# define __NR_Linux 6000 -# define __NR_inotify_init (__NR_Linux + 247) -# define __NR_inotify_add_watch (__NR_Linux + 248) -# define __NR_inotify_rm_watch (__NR_Linux + 249) -# endif -#else -#warning "inotify unsupported on this architecture!" -#endif -#endif /* __NR_inotify_init */ - -/* dummy if we don't have the syscalls defined */ -#ifndef __NR_inotify_init -static inline int inotify_init(void) -{ - return -1; -} - -static inline int inotify_add_watch(int fd, const char *name, uint32_t mask) -{ - return -1; -} -#else -/* needed until /usr/include/sys/inotify.h is working */ -#ifndef __GLIBC__ -#include -#else -static inline int inotify_init(void) -{ - return syscall(__NR_inotify_init); -} - -static inline int inotify_add_watch(int fd, const char *name, uint32_t mask) -{ - return syscall(__NR_inotify_add_watch, fd, name, mask); -} -#endif /* __GLIBC__ */ -#endif /* __NR_inotify_init */ - -#ifndef IN_CREATE -#define IN_CREATE 0x00000100 /* Subfile was created */ -#define IN_MOVED_FROM 0x00000040 /* File was moved from X */ -#define IN_MOVED_TO 0x00000080 /* File was moved to Y */ -#define IN_DELETE 0x00000200 /* Subfile was deleted */ -#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed */ -#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */ -#endif /* IN_CREATE */ - -/* needed for our signal handlers to work */ -#undef asmlinkage -#ifdef __i386__ -#define asmlinkage __attribute__((regparm(0))) -#else -#define asmlinkage -#endif /* __i386__ */ - -/* headers are broken on some architectures */ -#ifndef __FD_SET -#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) -#endif -#ifndef __FD_CLR -#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) -#endif -#ifndef __FD_ISSET -#define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0) -#endif -#ifndef __FD_ZERO -#define __FD_ZERO(set) ((void) memset ((void*) (set), 0, sizeof (fd_set))) -#endif - -#ifndef NETLINK_KOBJECT_UEVENT -#define NETLINK_KOBJECT_UEVENT 15 -#endif - -#ifndef SO_RCVBUFFORCE -#if defined(__alpha__) || defined(__hppa__) || defined(__sparc__) || defined(__sparc_v9__) -#define SO_RCVBUFFORCE 0x100b -#else -#define SO_RCVBUFFORCE 33 -#endif -#endif - -extern size_t strlcpy(char *dst, const char *src, size_t size); -extern size_t strlcat(char *dst, const char *src, size_t size); - -#endif diff --git a/hotplug/udev_sysfs.c b/hotplug/udev_sysfs.c deleted file mode 100644 index 30094ba..0000000 --- a/hotplug/udev_sysfs.c +++ /dev/null @@ -1,573 +0,0 @@ -/* - * Copyright (C) 2005-2006 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "udev.h" - -char sysfs_path[PATH_SIZE]; - -/* device cache */ -static LIST_HEAD(dev_list); - -/* attribute value cache */ -static LIST_HEAD(attr_list); -struct sysfs_attr -{ - struct list_head node; - char path[PATH_SIZE]; - char *value; /* points to value_local if value is cached */ - char value_local[NAME_SIZE]; -}; - -int sysfs_init(void) -{ - const char *env; - - env = getenv("SYSFS_PATH"); - if (env) - { - strlcpy(sysfs_path, env, sizeof(sysfs_path)); - remove_trailing_chars(sysfs_path, '/'); - } - else - strlcpy(sysfs_path, "/sys", sizeof(sysfs_path)); - dbg("sysfs_path='%s'", sysfs_path); - - INIT_LIST_HEAD(&dev_list); - INIT_LIST_HEAD(&attr_list); - return 0; -} - -void sysfs_cleanup(void) -{ - struct sysfs_attr *attr_loop; - struct sysfs_attr *attr_temp; - struct sysfs_device *dev_loop; - struct sysfs_device *dev_temp; - - list_for_each_entry_safe(attr_loop, attr_temp, &attr_list, node) - { - list_del(&attr_loop->node); - free(attr_loop); - } - - list_for_each_entry_safe(dev_loop, dev_temp, &dev_list, node) - { - list_del(&dev_loop->node); - free(dev_loop); - } -} - -void sysfs_device_set_values(struct sysfs_device *dev, const char *devpath, - const char *subsystem, const char *driver) -{ - char *pos; - - strlcpy(dev->devpath, devpath, sizeof(dev->devpath)); - if (subsystem != NULL) - strlcpy(dev->subsystem, subsystem, sizeof(dev->subsystem)); - if (driver != NULL) - strlcpy(dev->driver, driver, sizeof(dev->driver)); - - /* set kernel name */ - pos = strrchr(dev->devpath, '/'); - if (pos == NULL) - return; - strlcpy(dev->kernel, &pos[1], sizeof(dev->kernel)); - dbg("kernel='%s'", dev->kernel); - - /* some devices have '!' in their name, change that to '/' */ - pos = dev->kernel; - while (pos[0] != '\0') - { - if (pos[0] == '!') - pos[0] = '/'; - pos++; - } - - /* get kernel number */ - pos = &dev->kernel[strlen(dev->kernel)]; - while (isdigit(pos[-1])) - pos--; - strlcpy(dev->kernel_number, pos, sizeof(dev->kernel_number)); - dbg("kernel_number='%s'", dev->kernel_number); -} - -int sysfs_resolve_link(char *devpath, size_t size) -{ - char link_path[PATH_SIZE]; - char link_target[PATH_SIZE]; - int len; - int i; - int back; - - strlcpy(link_path, sysfs_path, sizeof(link_path)); - strlcat(link_path, devpath, sizeof(link_path)); - len = readlink(link_path, link_target, sizeof(link_target)); - if (len <= 0) - return -1; - link_target[len] = '\0'; - dbg("path link '%s' points to '%s'", devpath, link_target); - - for (back = 0; strncmp(&link_target[back * 3], "../", 3) == 0; back++) - ; - dbg("base '%s', tail '%s', back %i", devpath, &link_target[back * 3], back); - for (i = 0; i <= back; i++) - { - char *pos = strrchr(devpath, '/'); - - if (pos == NULL) - return -1; - pos[0] = '\0'; - } - dbg("after moving back '%s'", devpath); - strlcat(devpath, "/", size); - strlcat(devpath, &link_target[back * 3], size); - return 0; -} - -struct sysfs_device *sysfs_device_get(const char *devpath) -{ - char path[PATH_SIZE]; - char devpath_real[PATH_SIZE]; - struct sysfs_device *dev; - struct sysfs_device *dev_loop; - struct stat statbuf; - char link_path[PATH_SIZE]; - char link_target[PATH_SIZE]; - int len; - char *pos; - - /* we handle only these devpathes */ - if (devpath != NULL && - strncmp(devpath, "/devices/", 9) != 0 && - strncmp(devpath, "/subsystem/", 11) != 0 && - strncmp(devpath, "/module/", 8) != 0 && - strncmp(devpath, "/bus/", 5) != 0 && - strncmp(devpath, "/class/", 7) != 0 && - strncmp(devpath, "/block/", 7) != 0) - return NULL; - - dbg("open '%s'", devpath); - strlcpy(devpath_real, devpath, sizeof(devpath_real)); - remove_trailing_chars(devpath_real, '/'); - if (devpath[0] == '\0') - return NULL; - - /* look for device already in cache (we never put an untranslated path in the cache) */ - list_for_each_entry(dev_loop, &dev_list, node) - { - if (strcmp(dev_loop->devpath, devpath_real) == 0) - { - dbg("found in cache '%s'", dev_loop->devpath); - return dev_loop; - } - } - - /* if we got a link, resolve it to the real device */ - strlcpy(path, sysfs_path, sizeof(path)); - strlcat(path, devpath_real, sizeof(path)); - if (lstat(path, &statbuf) != 0) - { - dbg("stat '%s' failed: %s", path, strerror(errno)); - return NULL; - } - if (S_ISLNK(statbuf.st_mode)) - { - if (sysfs_resolve_link(devpath_real, sizeof(devpath_real)) != 0) - return NULL; - - /* now look for device in cache after path translation */ - list_for_each_entry(dev_loop, &dev_list, node) - { - if (strcmp(dev_loop->devpath, devpath_real) == 0) - { - dbg("found in cache '%s'", dev_loop->devpath); - return dev_loop; - } - } - } - - /* it is a new device */ - dbg("new uncached device '%s'", devpath_real); - dev = malloc(sizeof(struct sysfs_device)); - if (dev == NULL) - return NULL; - memset(dev, 0x00, sizeof(struct sysfs_device)); - - sysfs_device_set_values(dev, devpath_real, NULL, NULL); - - /* get subsystem name */ - strlcpy(link_path, sysfs_path, sizeof(link_path)); - strlcat(link_path, dev->devpath, sizeof(link_path)); - strlcat(link_path, "/subsystem", sizeof(link_path)); - len = readlink(link_path, link_target, sizeof(link_target)); - if (len > 0) - { - /* get subsystem from "subsystem" link */ - link_target[len] = '\0'; - dbg("subsystem link '%s' points to '%s'", link_path, link_target); - pos = strrchr(link_target, '/'); - if (pos != NULL) - strlcpy(dev->subsystem, &pos[1], sizeof(dev->subsystem)); - } - else if (strncmp(dev->devpath, "/class/", 7) == 0) - { - /* get subsystem from class dir */ - strlcpy(dev->subsystem, &dev->devpath[7], sizeof(dev->subsystem)); - pos = strchr(dev->subsystem, '/'); - if (pos != NULL) - pos[0] = '\0'; - else - strlcpy(dev->subsystem, "subsystem", sizeof(dev->subsystem)); - } - else if (strncmp(dev->devpath, "/block/", 7) == 0) - { - strlcpy(dev->subsystem, "block", sizeof(dev->subsystem)); - } - else if (strncmp(dev->devpath, "/devices/", 9) == 0) - { - /* get subsystem from "bus" link */ - strlcpy(link_path, sysfs_path, sizeof(link_path)); - strlcat(link_path, dev->devpath, sizeof(link_path)); - strlcat(link_path, "/bus", sizeof(link_path)); - len = readlink(link_path, link_target, sizeof(link_target)); - if (len > 0) - { - link_target[len] = '\0'; - dbg("bus link '%s' points to '%s'", link_path, link_target); - pos = strrchr(link_target, '/'); - if (pos != NULL) - strlcpy(dev->subsystem, &pos[1], sizeof(dev->subsystem)); - } - } - else if (strstr(dev->devpath, "/drivers/") != NULL) - { - strlcpy(dev->subsystem, "drivers", sizeof(dev->subsystem)); - } - else if (strncmp(dev->devpath, "/module/", 8) == 0) - { - strlcpy(dev->subsystem, "module", sizeof(dev->subsystem)); - } - else if (strncmp(dev->devpath, "/subsystem/", 11) == 0) - { - pos = strrchr(dev->devpath, '/'); - if (pos == &dev->devpath[10]) - strlcpy(dev->subsystem, "subsystem", sizeof(dev->subsystem)); - } - else if (strncmp(dev->devpath, "/bus/", 5) == 0) - { - pos = strrchr(dev->devpath, '/'); - if (pos == &dev->devpath[4]) - strlcpy(dev->subsystem, "subsystem", sizeof(dev->subsystem)); - } - - /* get driver name */ - strlcpy(link_path, sysfs_path, sizeof(link_path)); - strlcat(link_path, dev->devpath, sizeof(link_path)); - strlcat(link_path, "/driver", sizeof(link_path)); - len = readlink(link_path, link_target, sizeof(link_target)); - if (len > 0) - { - link_target[len] = '\0'; - dbg("driver link '%s' points to '%s'", link_path, link_target); - pos = strrchr(link_target, '/'); - if (pos != NULL) - strlcpy(dev->driver, &pos[1], sizeof(dev->driver)); - } - - dbg("add to cache 'devpath=%s', subsystem='%s', driver='%s'", dev->devpath, dev->subsystem, dev->driver); - list_add(&dev->node, &dev_list); - - return dev; -} - -struct sysfs_device *sysfs_device_get_parent(struct sysfs_device *dev) -{ - char parent_devpath[PATH_SIZE]; - char *pos; - - dbg("open '%s'", dev->devpath); - - /* look if we already know the parent */ - if (dev->parent != NULL) - return dev->parent; - - strlcpy(parent_devpath, dev->devpath, sizeof(parent_devpath)); - dbg("'%s'", parent_devpath); - - /* strip last element */ - pos = strrchr(parent_devpath, '/'); - if (pos == NULL || pos == parent_devpath) - return NULL; - pos[0] = '\0'; - - if (strncmp(parent_devpath, "/class", 6) == 0) - { - pos = strrchr(parent_devpath, '/'); - if (pos == &parent_devpath[6] || pos == parent_devpath) - { - dbg("/class top level, look for device link"); - goto device_link; - } - } - if (strcmp(parent_devpath, "/block") == 0) - { - dbg("/block top level, look for device link"); - goto device_link; - } - - /* are we at the top level? */ - pos = strrchr(parent_devpath, '/'); - if (pos == NULL || pos == parent_devpath) - return NULL; - - /* get parent and remember it */ - dev->parent = sysfs_device_get(parent_devpath); - return dev->parent; - -device_link: - strlcpy(parent_devpath, dev->devpath, sizeof(parent_devpath)); - strlcat(parent_devpath, "/device", sizeof(parent_devpath)); - if (sysfs_resolve_link(parent_devpath, sizeof(parent_devpath)) != 0) - return NULL; - - /* get parent and remember it */ - dev->parent = sysfs_device_get(parent_devpath); - return dev->parent; -} - -struct sysfs_device *sysfs_device_get_parent_with_subsystem(struct sysfs_device *dev, const char *subsystem) -{ - struct sysfs_device *dev_parent; - - dev_parent = sysfs_device_get_parent(dev); - while (dev_parent != NULL) - { - if (strcmp(dev_parent->subsystem, subsystem) == 0) - return dev_parent; - dev_parent = sysfs_device_get_parent(dev_parent); - } - return NULL; -} - -char *sysfs_attr_get_value(const char *devpath, const char *attr_name) -{ - char path_full[PATH_SIZE]; - const char *path; - char value[NAME_SIZE]; - struct sysfs_attr *attr_loop; - struct sysfs_attr *attr; - struct stat statbuf; - int fd; - ssize_t size; - size_t sysfs_len; - - dbg("open '%s'/'%s'", devpath, attr_name); - sysfs_len = strlcpy(path_full, sysfs_path, sizeof(path_full)); - if (sysfs_len >= sizeof(path_full)) - sysfs_len = sizeof(path_full) - 1; - path = &path_full[sysfs_len]; - strlcat(path_full, devpath, sizeof(path_full)); - strlcat(path_full, "/", sizeof(path_full)); - strlcat(path_full, attr_name, sizeof(path_full)); - - /* look for attribute in cache */ - list_for_each_entry(attr_loop, &attr_list, node) - { - if (strcmp(attr_loop->path, path) == 0) - { - dbg("found in cache '%s'", attr_loop->path); - return attr_loop->value; - } - } - - /* store attribute in cache (also negatives are kept in cache) */ - dbg("new uncached attribute '%s'", path_full); - attr = malloc(sizeof(struct sysfs_attr)); - if (attr == NULL) - return NULL; - memset(attr, 0x00, sizeof(struct sysfs_attr)); - strlcpy(attr->path, path, sizeof(attr->path)); - dbg("add to cache '%s'", path_full); - list_add(&attr->node, &attr_list); - - if (lstat(path_full, &statbuf) != 0) - { - dbg("stat '%s' failed: %s", path_full, strerror(errno)); - goto out; - } - - if (S_ISLNK(statbuf.st_mode)) - { - /* links return the last element of the target path */ - char link_target[PATH_SIZE]; - int len; - const char *pos; - - len = readlink(path_full, link_target, sizeof(link_target)); - if (len > 0) - { - link_target[len] = '\0'; - pos = strrchr(link_target, '/'); - if (pos != NULL) - { - dbg("cache '%s' with link value '%s'", path_full, value); - strlcpy(attr->value_local, &pos[1], sizeof(attr->value_local)); - attr->value = attr->value_local; - } - } - goto out; - } - - /* skip directories */ - if (S_ISDIR(statbuf.st_mode)) - goto out; - - /* skip non-readable files */ - if ((statbuf.st_mode & S_IRUSR) == 0) - goto out; - - /* read attribute value */ - fd = open(path_full, O_RDONLY); - if (fd < 0) - { - dbg("attribute '%s' can not be opened", path_full); - goto out; - } - size = read(fd, value, sizeof(value)); - close(fd); - if (size < 0) - goto out; - if (size == sizeof(value)) - goto out; - - /* got a valid value, store and return it */ - value[size] = '\0'; - remove_trailing_chars(value, '\n'); - dbg("cache '%s' with attribute value '%s'", path_full, value); - strlcpy(attr->value_local, value, sizeof(attr->value_local)); - attr->value = attr->value_local; - -out: - return attr->value; -} - -int sysfs_lookup_devpath_by_subsys_id(char *devpath_full, size_t len, const char *subsystem, const char *id) -{ - size_t sysfs_len; - char path_full[PATH_SIZE]; - char *path; - struct stat statbuf; - - sysfs_len = strlcpy(path_full, sysfs_path, sizeof(path_full)); - path = &path_full[sysfs_len]; - - if (strcmp(subsystem, "subsystem") == 0) - { - strlcpy(path, "/subsystem/", sizeof(path_full) - sysfs_len); - strlcat(path, id, sizeof(path_full) - sysfs_len); - if (stat(path_full, &statbuf) == 0) - goto found; - - strlcpy(path, "/bus/", sizeof(path_full) - sysfs_len); - strlcat(path, id, sizeof(path_full) - sysfs_len); - if (stat(path_full, &statbuf) == 0) - goto found; - goto out; - - strlcpy(path, "/class/", sizeof(path_full) - sysfs_len); - strlcat(path, id, sizeof(path_full) - sysfs_len); - if (stat(path_full, &statbuf) == 0) - goto found; - } - - if (strcmp(subsystem, "module") == 0) - { - strlcpy(path, "/module/", sizeof(path_full) - sysfs_len); - strlcat(path, id, sizeof(path_full) - sysfs_len); - if (stat(path_full, &statbuf) == 0) - goto found; - goto out; - } - - if (strcmp(subsystem, "drivers") == 0) - { - char subsys[NAME_SIZE]; - char *driver; - - strlcpy(subsys, id, sizeof(subsys)); - driver = strchr(subsys, ':'); - if (driver != NULL) - { - driver[0] = '\0'; - driver = &driver[1]; - strlcpy(path, "/subsystem/", sizeof(path_full) - sysfs_len); - strlcat(path, subsys, sizeof(path_full) - sysfs_len); - strlcat(path, "/drivers/", sizeof(path_full) - sysfs_len); - strlcat(path, driver, sizeof(path_full) - sysfs_len); - if (stat(path_full, &statbuf) == 0) - goto found; - - strlcpy(path, "/bus/", sizeof(path_full) - sysfs_len); - strlcat(path, subsys, sizeof(path_full) - sysfs_len); - strlcat(path, "/drivers/", sizeof(path_full) - sysfs_len); - strlcat(path, driver, sizeof(path_full) - sysfs_len); - if (stat(path_full, &statbuf) == 0) - goto found; - } - goto out; - } - - strlcpy(path, "/subsystem/", sizeof(path_full) - sysfs_len); - strlcat(path, subsystem, sizeof(path_full) - sysfs_len); - strlcat(path, "/devices/", sizeof(path_full) - sysfs_len); - strlcat(path, id, sizeof(path_full) - sysfs_len); - if (stat(path_full, &statbuf) == 0) - goto found; - - strlcpy(path, "/bus/", sizeof(path_full) - sysfs_len); - strlcat(path, subsystem, sizeof(path_full) - sysfs_len); - strlcat(path, "/devices/", sizeof(path_full) - sysfs_len); - strlcat(path, id, sizeof(path_full) - sysfs_len); - if (stat(path_full, &statbuf) == 0) - goto found; - - strlcpy(path, "/class/", sizeof(path_full) - sysfs_len); - strlcat(path, subsystem, sizeof(path_full) - sysfs_len); - strlcat(path, "/", sizeof(path_full) - sysfs_len); - strlcat(path, id, sizeof(path_full) - sysfs_len); - if (stat(path_full, &statbuf) == 0) - goto found; -out: - return 0; -found: - if (S_ISLNK(statbuf.st_mode)) - sysfs_resolve_link(path, sizeof(path_full) - sysfs_len); - strlcpy(devpath_full, path, len); - return 1; -} diff --git a/hotplug/udev_utils.c b/hotplug/udev_utils.c deleted file mode 100644 index 50c94d7..0000000 --- a/hotplug/udev_utils.c +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (C) 2004-2005 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "udev.h" - - -int log_priority(const char *priority) -{ - char *endptr; - int prio; - - prio = strtol(priority, &endptr, 10); - if (endptr[0] == '\0') - return prio; - if (strncasecmp(priority, "err", 3) == 0) - return LOG_ERR; - if (strcasecmp(priority, "info") == 0) - return LOG_INFO; - if (strcasecmp(priority, "debug") == 0) - return LOG_DEBUG; - if (string_is_true(priority)) - return LOG_ERR; - - return 0; -} - -struct name_entry *name_list_add(struct list_head *name_list, const char *name, int sort) -{ - struct name_entry *name_loop; - struct name_entry *name_new; - - /* avoid duplicate entries */ - list_for_each_entry(name_loop, name_list, node) - { - if (strcmp(name_loop->name, name) == 0) - { - dbg("'%s' is already in the list", name); - return name_loop; - } - } - - if (sort) - list_for_each_entry(name_loop, name_list, node) - { - if (strcmp(name_loop->name, name) > 0) - break; - } - - name_new = malloc(sizeof(struct name_entry)); - if (name_new == NULL) - return NULL; - - strlcpy(name_new->name, name, sizeof(name_new->name)); - dbg("adding '%s'", name_new->name); - list_add_tail(&name_new->node, &name_loop->node); - - return name_new; -} - -struct name_entry *name_list_key_add(struct list_head *name_list, const char *key, const char *value) -{ - struct name_entry *name_loop; - struct name_entry *name_new; - - list_for_each_entry(name_loop, name_list, node) - { - if (strncmp(name_loop->name, key, strlen(key)) == 0) - { - dbg("key already present '%s', replace it", name_loop->name); - snprintf(name_loop->name, sizeof(name_loop->name), "%s=%s", key, value); - name_loop->name[sizeof(name_loop->name) - 1] = '\0'; - return name_loop; - } - } - - name_new = malloc(sizeof(struct name_entry)); - if (name_new == NULL) - return NULL; - - snprintf(name_new->name, sizeof(name_new->name), "%s=%s", key, value); - name_new->name[sizeof(name_new->name) - 1] = '\0'; - dbg("adding '%s'", name_new->name); - list_add_tail(&name_new->node, &name_loop->node); - - return name_new; -} - -int name_list_key_remove(struct list_head *name_list, const char *key) -{ - struct name_entry *name_loop; - struct name_entry *name_tmp; - size_t keylen = strlen(key); - int retval = 0; - - list_for_each_entry_safe(name_loop, name_tmp, name_list, node) - { - if (strncmp(name_loop->name, key, keylen) != 0) - continue; - if (name_loop->name[keylen] != '=') - continue; - list_del(&name_loop->node); - free(name_loop); - retval = 1; - break; - } - return retval; -} - -void name_list_cleanup(struct list_head *name_list) -{ - struct name_entry *name_loop; - struct name_entry *name_tmp; - - list_for_each_entry_safe(name_loop, name_tmp, name_list, node) - { - list_del(&name_loop->node); - free(name_loop); - } -} - -/* calls function for every file found in specified directory */ -int add_matching_files(struct list_head *name_list, const char *dirname, const char *suffix) -{ - struct dirent *ent; - DIR *dir; - char filename[PATH_SIZE]; - - dbg("open directory '%s'", dirname); - dir = opendir(dirname); - if (dir == NULL) - { - err("unable to open '%s': %s", dirname, strerror(errno)); - return -1; - } - - while (1) - { - ent = readdir(dir); - if (ent == NULL || ent->d_name[0] == '\0') - break; - - if ((ent->d_name[0] == '.') || (ent->d_name[0] == COMMENT_CHARACTER)) - continue; - - /* look for file matching with specified suffix */ - if (suffix != NULL) - { - const char *ext; - - ext = strrchr(ent->d_name, '.'); - if (ext == NULL) - continue; - if (strcmp(ext, suffix) != 0) - continue; - } - dbg("put file '%s/%s' into list", dirname, ent->d_name); - - snprintf(filename, sizeof(filename), "%s/%s", dirname, ent->d_name); - filename[sizeof(filename) - 1] = '\0'; - name_list_add(name_list, filename, 1); - } - - closedir(dir); - return 0; -} - -uid_t lookup_user(const char *user) -{ - struct passwd *pw; - uid_t uid = 0; - - errno = 0; - pw = getpwnam(user); - if (pw == NULL) - { - if (errno == 0 || errno == ENOENT || errno == ESRCH) - err("specified user '%s' unknown", user); - else - err("error resolving user '%s': %s", user, strerror(errno)); - } - else - uid = pw->pw_uid; - - return uid; -} - -extern gid_t lookup_group(const char *group) -{ - struct group *gr; - gid_t gid = 0; - - errno = 0; - gr = getgrnam(group); - if (gr == NULL) - { - if (errno == 0 || errno == ENOENT || errno == ESRCH) - err("specified group '%s' unknown", group); - else - err("error resolving group '%s': %s", group, strerror(errno)); - } - else - gid = gr->gr_gid; - - return gid; -} - diff --git a/hotplug/udev_utils_string.c b/hotplug/udev_utils_string.c deleted file mode 100644 index e897223..0000000 --- a/hotplug/udev_utils_string.c +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright (C) 2004-2005 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "udev.h" - -int string_is_true(const char *str) -{ - if (strcasecmp(str, "true") == 0) - return 1; - if (strcasecmp(str, "yes") == 0) - return 1; - if (strcasecmp(str, "1") == 0) - return 1; - return 0; -} - -void remove_trailing_chars(char *path, char c) -{ - size_t len; - - len = strlen(path); - while (len > 0 && path[len - 1] == c) - path[--len] = '\0'; -} - -size_t path_encode(char *s, size_t len) -{ - char t[(len * 3) + 1]; - size_t i, j; - - t[0] = '\0'; - for (i = 0, j = 0; s[i] != '\0'; i++) - { - if (s[i] == '/') - { - memcpy(&t[j], "\\x2f", 4); - j += 4; - } - else if (s[i] == '\\') - { - memcpy(&t[j], "\\x5c", 4); - j += 4; - } - else - { - t[j] = s[i]; - j++; - } - } - t[j] = '\0'; - strncpy(s, t, len); - return j; -} - -size_t path_decode(char *s) -{ - size_t i, j; - - for (i = 0, j = 0; s[i] != '\0'; j++) - { - if (memcmp(&s[i], "\\x2f", 4) == 0) - { - s[j] = '/'; - i += 4; - } - else if (memcmp(&s[i], "\\x5c", 4) == 0) - { - s[j] = '\\'; - i += 4; - } - else - { - s[j] = s[i]; - i++; - } - } - s[j] = '\0'; - return j; -} - -/* count of characters used to encode one unicode char */ -static int utf8_encoded_expected_len(const char *str) -{ - unsigned char c = (unsigned char)str[0]; - - if (c < 0x80) - return 1; - if ((c & 0xe0) == 0xc0) - return 2; - if ((c & 0xf0) == 0xe0) - return 3; - if ((c & 0xf8) == 0xf0) - return 4; - if ((c & 0xfc) == 0xf8) - return 5; - if ((c & 0xfe) == 0xfc) - return 6; - return 0; -} - -/* decode one unicode char */ -static int utf8_encoded_to_unichar(const char *str) -{ - int unichar; - int len; - int i; - - len = utf8_encoded_expected_len(str); - switch (len) - { - case 1: - return (int)str[0]; - case 2: - unichar = str[0] & 0x1f; - break; - case 3: - unichar = (int)str[0] & 0x0f; - break; - case 4: - unichar = (int)str[0] & 0x07; - break; - case 5: - unichar = (int)str[0] & 0x03; - break; - case 6: - unichar = (int)str[0] & 0x01; - break; - default: - return -1; - } - - for (i = 1; i < len; i++) - { - if (((int)str[i] & 0xc0) != 0x80) - return -1; - unichar <<= 6; - unichar |= (int)str[i] & 0x3f; - } - - return unichar; -} - -/* expected size used to encode one unicode char */ -static int utf8_unichar_to_encoded_len(int unichar) -{ - if (unichar < 0x80) - return 1; - if (unichar < 0x800) - return 2; - if (unichar < 0x10000) - return 3; - if (unichar < 0x200000) - return 4; - if (unichar < 0x4000000) - return 5; - return 6; -} - -/* check if unicode char has a valid numeric range */ -static int utf8_unichar_valid_range(int unichar) -{ - if (unichar > 0x10ffff) - return 0; - if ((unichar & 0xfffff800) == 0xd800) - return 0; - if ((unichar > 0xfdcf) && (unichar < 0xfdf0)) - return 0; - if ((unichar & 0xffff) == 0xffff) - return 0; - return 1; -} - -/* validate one encoded unicode char and return its length */ -int utf8_encoded_valid_unichar(const char *str) -{ - int len; - int unichar; - int i; - - len = utf8_encoded_expected_len(str); - if (len == 0) - return -1; - - /* ascii is valid */ - if (len == 1) - return 1; - - /* check if expected encoded chars are available */ - for (i = 0; i < len; i++) - if ((str[i] & 0x80) != 0x80) - return -1; - - unichar = utf8_encoded_to_unichar(str); - - /* check if encoded length matches encoded value */ - if (utf8_unichar_to_encoded_len(unichar) != len) - return -1; - - /* check if value has valid range */ - if (!utf8_unichar_valid_range(unichar)) - return -1; - - return len; -} - -/* allow chars in whitelist, plain ascii, hex-escaping and valid utf8 */ -int replace_chars(char *str, const char *white) -{ - size_t i = 0; - int replaced = 0; - - while (str[i] != '\0') - { - int len; - - /* accept whitelist */ - if (white != NULL && strchr(white, str[i]) != NULL) - { - i++; - continue; - } - - /* accept plain ascii char */ - if ((str[i] >= '0' && str[i] <= '9') || - (str[i] >= 'A' && str[i] <= 'Z') || - (str[i] >= 'a' && str[i] <= 'z')) - { - i++; - continue; - } - - /* accept hex encoding */ - if (str[i] == '\\' && str[i + 1] == 'x') - { - i += 2; - continue; - } - - /* accept valid utf8 */ - len = utf8_encoded_valid_unichar(&str[i]); - if (len > 1) - { - i += len; - continue; - } - - /* if space is allowed, replace whitespace with ordinary space */ - if (isspace(str[i]) && strchr(white, ' ') != NULL) - { - str[i] = ' '; - i++; - replaced++; - continue; - } - - /* everything else is replaced with '_' */ - str[i] = '_'; - i++; - replaced++; - } - - return replaced; -} diff --git a/hotplug/udev_version.h b/hotplug/udev_version.h deleted file mode 100644 index 7aad898..0000000 --- a/hotplug/udev_version.h +++ /dev/null @@ -1 +0,0 @@ -#define UDEV_VERSION "r33 (http://schwerkraft.elitedvb.net/plugins/scmsvn/viewcvs.php/trunk/?root=hotplug-ng)" diff --git a/hotplug/udevd.h b/hotplug/udevd.h deleted file mode 100644 index 52af147..0000000 --- a/hotplug/udevd.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2004 Ling, Xiaofeng - * Copyright (C) 2004-2006 Kay Sievers - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "list.h" - -#define UDEVD_PRIORITY -4 -#define UDEV_PRIORITY -2 - -#define EVENT_QUEUE_DIR ".udev/queue" -#define EVENT_FAILED_DIR ".udev/failed" -#define EVENT_SEQNUM ".udev/uevent_seqnum" - -/* maximum limit of forked childs */ -#define UDEVD_MAX_CHILDS 256 -/* start to throttle forking if maximum number of running childs in our session is reached */ -#define UDEVD_MAX_CHILDS_RUNNING 16 - -/* linux/include/linux/kobject.h */ -#define UEVENT_BUFFER_SIZE 2048 -#define UEVENT_NUM_ENVP 32 - -#define UDEVD_CTRL_SOCK_PATH "/org/kernel/udev/udevd" -#define UDEVD_CTRL_MAGIC "udevd_" UDEV_VERSION - -enum udevd_ctrl_msg_type -{ - UDEVD_CTRL_UNKNOWN, - UDEVD_CTRL_STOP_EXEC_QUEUE, - UDEVD_CTRL_START_EXEC_QUEUE, - UDEVD_CTRL_SET_LOG_LEVEL, - UDEVD_CTRL_SET_MAX_CHILDS, - UDEVD_CTRL_SET_MAX_CHILDS_RUNNING, - UDEVD_CTRL_RELOAD_RULES, - UDEVD_CTRL_ENV, -}; - -struct udevd_ctrl_msg -{ - char magic[32]; - enum udevd_ctrl_msg_type type; - char buf[256]; -}; - -struct udevd_uevent_msg -{ - struct list_head node; - pid_t pid; - int exitstatus; - time_t queue_time; - char *action; - char *devpath; - char *subsystem; - char *driver; - dev_t devt; - unsigned long long seqnum; - char *devpath_old; - char *physdevpath; - unsigned int timeout; - char *envp[UEVENT_NUM_ENVP + 1]; - char envbuf[]; -}; diff --git a/ipbox_eeprom/.gitignore b/ipbox_eeprom/.gitignore deleted file mode 100644 index 53463ee..0000000 --- a/ipbox_eeprom/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -eeprom diff --git a/ipbox_eeprom/Makefile.am b/ipbox_eeprom/Makefile.am deleted file mode 100644 index 88c352c..0000000 --- a/ipbox_eeprom/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -bin_PROGRAMS = eeprom - -eeprom_SOURCES = eeprom.c - -AM_CFLAGS = -Wall diff --git a/ipbox_eeprom/autogen.sh b/ipbox_eeprom/autogen.sh deleted file mode 100755 index 9729d2e..0000000 --- a/ipbox_eeprom/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-ipbox_eeprom" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/ipbox_eeprom/configure.ac b/ipbox_eeprom/configure.ac deleted file mode 100644 index e26c7d7..0000000 --- a/ipbox_eeprom/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT([ipbox_eeprom],[1.0],[],[ipbox_eeprom]) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_OUTPUT([ -Makefile -]) diff --git a/ipbox_eeprom/eeprom.c b/ipbox_eeprom/eeprom.c deleted file mode 100644 index e74e7c5..0000000 --- a/ipbox_eeprom/eeprom.c +++ /dev/null @@ -1,666 +0,0 @@ -/* - * eeprom.c - * - * (c) 2011 konfetti - * partly copied from uboot source! - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* - * Description: - * - * _ATTENTION_: Many thinks are untested in this module. Use on - * your own risk - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define CONFIG_CUBEREVO - -#define N_TVMODE 6 -char *tvmode_name[N_TVMODE] = -{ - "SD-PAL", "SD-NTSC", - "720P-50", "720P-60", - "1080I-50", "1080I-60" -}; - - -typedef enum -{ - db_key_null = 0, - db_key_end, - db_key_ethaddr, - db_key_prodnum, - db_key_vol, - db_key_lch, - db_key_pcbver, - db_key_tvmode, - db_key_tuner, - db_key_time, -} db_key; - -typedef struct -{ - unsigned short key; - unsigned short len; - unsigned char data[0]; -} db_item; - -static struct -{ - db_key key; - char *name; - int isRO; -} db_name_tbl[] = -{ - { db_key_null, "null" , /*1 */ 0}, - { db_key_end, "end" , /*1 */ 0}, - { db_key_ethaddr, "ethaddr" , 0}, - { db_key_prodnum, "prodnum" , /*1 */ 0}, - { db_key_vol, "volume" , 0}, - { db_key_lch, "lastch" , 0}, - { db_key_pcbver, "pcbver" , /*1 */ 0}, -#if defined(CONFIG_CUBEREVO) || defined(CONFIG_CUBEREVO_MINI) - { db_key_tvmode, "tvmode" , 0}, - { db_key_tuner, "tuner" , /*1 */ 0}, - { db_key_time, "time" , /*1 */ 0}, -#endif -}; - -#define CFG_EEPROM_ADD 0x50 -#define CFG_EEPROM_SIZE 512 - -#define db_name_tbl_size (sizeof(db_name_tbl)/sizeof(db_name_tbl[0])) - -#define DB_MAGIC_SIZE sizeof(unsigned short) -#define DB_HEADE_SIZE sizeof(db_item) - -#define CFG_EEPROM_PAGE_WRITE_BITS 4 -#define CFG_EEPROM_PAGE_WRITE_DELAY_MS 11 /* 10ms. but give more */ - -#define EEPROM_PAGE_SIZE (1 << CFG_EEPROM_PAGE_WRITE_BITS) -#define EEPROM_PAGE_OFFSET(x) ((x) & (EEPROM_PAGE_SIZE - 1)) - -/* ********************************* i2c ************************************ */ -/* - * I2C Message - used for pure i2c transaction, also from /dev interface - */ -struct i2c_msg -{ - unsigned short addr; /* slave address */ - unsigned short flags; - unsigned short len; /* msg length */ - unsigned char *buf; /* pointer to msg data */ -}; - -/* This is the structure as used in the I2C_RDWR ioctl call */ -struct i2c_rdwr_ioctl_data -{ - struct i2c_msg *msgs; /* pointers to i2c_msgs */ - unsigned int nmsgs; /* number of i2c_msgs */ -}; - -#define I2C_SLAVE 0x0703 /* Change slave address */ -/* Attn.: Slave address is 7 or 10 bits */ - -#define I2C_RDWR 0x0707 /* Combined R/W transfer (one stop only)*/ - -int i2c_read(int fd_i2c, unsigned char addr, unsigned char reg, unsigned char *buffer, int len) -{ - struct i2c_rdwr_ioctl_data i2c_rdwr; - int err; - unsigned char b0[] = { reg }; - - //printf("%s> 0x%0x - %d\n", __func__, reg, len); - - i2c_rdwr.nmsgs = 2; - i2c_rdwr.msgs = malloc(2 * sizeof(struct i2c_msg)); - i2c_rdwr.msgs[0].addr = addr; - i2c_rdwr.msgs[0].flags = 0; - i2c_rdwr.msgs[0].len = 1; - i2c_rdwr.msgs[0].buf = b0; - - i2c_rdwr.msgs[1].addr = addr; - i2c_rdwr.msgs[1].flags = 1; - i2c_rdwr.msgs[1].len = len; - i2c_rdwr.msgs[1].buf = malloc(len); - - memset(i2c_rdwr.msgs[1].buf, 0, len); - - if ((err = ioctl(fd_i2c, I2C_RDWR, &i2c_rdwr)) < 0) - { - //printf("i2c_read failed %d %d\n", err, errno); - //printf("%s\n", strerror(errno)); - free(i2c_rdwr.msgs[0].buf); - free(i2c_rdwr.msgs); - - return -1; - } - - //printf("reg 0x%02x ->ret 0x%02x\n", reg, (i2c_rdwr.msgs[1].buf[0] & 0xff)); - memcpy(buffer, i2c_rdwr.msgs[1].buf, len); - - free(i2c_rdwr.msgs[1].buf); - free(i2c_rdwr.msgs); - -// printf("%s<\n", __func__); - return 0; -} - -int i2c_write(int fd_i2c, unsigned char addr, unsigned char reg, unsigned char *buffer, int len) -{ - struct i2c_rdwr_ioctl_data i2c_rdwr; - int err; - unsigned char buf[256]; - - //printf("%s> 0x%0x - %s - %d\n", __func__, reg, buffer, len); - - buf[0] = reg; - memcpy(&buf[1], buffer, len); - - i2c_rdwr.nmsgs = 1; - i2c_rdwr.msgs = malloc(1 * sizeof(struct i2c_msg)); - i2c_rdwr.msgs[0].addr = addr; - i2c_rdwr.msgs[0].flags = 0; - i2c_rdwr.msgs[0].len = len + 1; - i2c_rdwr.msgs[0].buf = buf; - - if ((err = ioctl(fd_i2c, I2C_RDWR, &i2c_rdwr)) < 0) - { - //printf("i2c_read failed %d %d\n", err, errno); - //printf("%s\n", strerror(errno)); - free(i2c_rdwr.msgs[0].buf); - free(i2c_rdwr.msgs); - - return -1; - } - - free(i2c_rdwr.msgs); - -// printf("%s<\n", __func__); - return 0; -} - -/* *************************** uboot copied func ************************************** */ - -int isRO(const char *name) -{ - int a; - - for (a = 0; a < db_name_tbl_size; a++) - { - if (!strcmp(db_name_tbl[a].name, name)) - { - return db_name_tbl[a].isRO; - } - } - - return 1; -} - -int get_keyvalue(const char *name, db_key *key) -{ - int a; - - for (a = 0; a < db_name_tbl_size; a++) - { - if (!strcmp(db_name_tbl[a].name, name)) - { - *key = db_name_tbl[a].key; - return 0; - } - } - - return 1; -} - -static int get_keyname(db_key key, char **name) -{ - int a; - - for (a = 0; a < db_name_tbl_size; a++) - { - if (db_name_tbl[a].key == key) - { - *name = db_name_tbl[a].name; - return 0; - } - } - - //printf("unknown key %d\n", key); - *name = "unknown"; - - return 1; -} - -int eeprom_write(int fd, unsigned dev_addr, unsigned offset, unsigned char *buffer, unsigned cnt) -{ - unsigned end = offset + cnt; - unsigned blk_off; - int rcode = 0; - - /* Write data until done or would cross a write page boundary. - * We must write the address again when changing pages - * because the address counter only increments within a page. - */ - - while (offset < end) - { - unsigned alen, len, maxlen; - unsigned char addr[2]; - - blk_off = offset & 0xFF; /* block offset */ - - addr[0] = offset >> 8; /* block number */ - addr[1] = blk_off; /* block offset */ - alen = 2; - addr[0] |= dev_addr; /* insert device address */ - - maxlen = EEPROM_PAGE_SIZE - EEPROM_PAGE_OFFSET(blk_off); - - len = end - offset; - - if (i2c_write(fd, addr[0], offset, buffer, len) != 0) - rcode = 1; - - buffer += len; - offset += len; - - usleep(CFG_EEPROM_PAGE_WRITE_DELAY_MS * 1000); - } - return rcode; -} - -int eeprom_read(int fd, unsigned dev_addr, unsigned offset, unsigned char *buffer, unsigned cnt) -{ - unsigned end = offset + cnt; - unsigned blk_off; - int rcode = 0; - int i; - - //printf("%s> offset %d cnt %d\n", __func__, offset, cnt); - - while (offset < end) - { - unsigned len, maxlen; - unsigned char addr[2]; - - blk_off = offset & 0xFF; /* block offset */ - - addr[0] = offset >> 8; /* block number */ - addr[1] = blk_off; /* block offset */ - addr[0] |= dev_addr; /* insert device address */ - - len = cnt; - - for (i = 0; i < len; i++) - { - if (i2c_read(fd, addr[0], offset + i, &buffer[i], 1) != 0) - { - rcode = 1; - break; - } - } - - buffer += len; - offset += len; - } - //printf("%s< %d\n", __func__, rcode); - return rcode; -} - -static int read_item(int fd, int offset, db_key *key, unsigned char *buf, int *buflen) -{ - int rcode; - db_item item; - - //printf("%s>\n", __func__); - - if (offset >= CFG_EEPROM_SIZE - DB_HEADE_SIZE) - return -1; - - rcode = eeprom_read(fd, CFG_EEPROM_ADD, offset, (unsigned char *)&item, sizeof(item)); - if (rcode) - return -1; - - //printf("item.len %d\n", item.len); - - if (item.len > 0 && buf != NULL) - { - if (*buflen > item.len) - *buflen = item.len; - - rcode = eeprom_read(fd, CFG_EEPROM_ADD, offset + DB_HEADE_SIZE, buf, *buflen); - if (rcode) - return -1; - - buf[*buflen] = 0; - } - - *key = item.key; - - //printf("%s< %d\n", __func__, item.len); - return item.len; -} - -int search_item(int fd, int offset, db_key key, unsigned char *buf, unsigned char *buflen, int *offret, int *lenret) -{ - int rcode; - int len; - db_key keytmp; - - //printf("key %d\n", key); - - do - { - len = read_item(fd, offset, &keytmp, NULL, NULL); - if (len < 0) - return 1; - - if (keytmp == key) - { - /* found it */ - if (offret != NULL) - *offret = offset; - if (lenret != NULL) - *lenret = len; - - if (len > 0 && buf != NULL) - { - if (*buflen > len) - *buflen = len; - - rcode = eeprom_read( - fd, - CFG_EEPROM_ADD, - offset + DB_HEADE_SIZE, - buf, - *buflen); - if (rcode) - return 1; - - buf[*buflen] = 0; - } - - return 0; - } - - offset += DB_HEADE_SIZE + len; - } - while (keytmp != db_key_end); - - /* we coundn`t find the key. - * return the end key - */ - if (offret != NULL) - *offret = offset - (DB_HEADE_SIZE + len); - if (lenret != NULL) - *lenret = len; - - return 2; -} - -static int save_item(int fd, int offset, db_key key, const char *buf, int len) -{ - int rcode; - db_item item; - - //printf("%s> %d - %s\n", __func__, key, buf); - - /* write item data */ - if (buf != NULL && len != 0) - { - - rcode = eeprom_write( - fd, - CFG_EEPROM_ADD, - offset + DB_HEADE_SIZE, - (unsigned char *)buf, - len); - - if (rcode) - return rcode; - } - - /* write item header */ - item.key = key; - item.len = len; - rcode = eeprom_write(fd, CFG_EEPROM_ADD, offset, (unsigned char *)&item, sizeof(item)); - - //printf("%s< rcode %d\n", __func__, rcode); - return rcode; -} - -static int del_item(int fd, db_key key) -{ - int offset; - db_key keytmp; - int len; - - int last_offset; - db_key last_keytmp; - int last_len; - - int next_offset; - db_key next_keytmp; - int next_len; - - /* find the item */ - offset = DB_MAGIC_SIZE; - last_offset = 0; - last_keytmp = db_key_end; - last_len = 0; - do - { - len = read_item(fd, offset, &keytmp, NULL, NULL); - if (len < 0) - return -1; - - if (keytmp == key) - { - /* merge with next one if it is null item */ - next_offset = offset + DB_HEADE_SIZE + len; - next_len = read_item(fd, next_offset, &next_keytmp, NULL, NULL); - if (next_len >= 0) - { - if (next_keytmp == db_key_null) - len += DB_HEADE_SIZE + next_len; - } - - /* merge with privious one if it was null item */ - if (last_keytmp == db_key_null) - { - offset = last_offset; - len += last_len + DB_HEADE_SIZE; - } - - return save_item(fd, offset, db_key_null, NULL, len); - } - - last_offset = offset; - last_keytmp = keytmp; - last_len = len; - - offset += DB_HEADE_SIZE + len; - } - while (key != db_key_end); - - return 0; -} - -int add_item(int fd, db_key key, const char *data) -{ - int data_len; - int rcode; - - int offset; - int len; - - if (data) - data_len = strlen(data); - else - data_len = 0; - - /* delete same key */ - del_item(fd, key); - - /* search enough space to store the item */ - offset = DB_MAGIC_SIZE; - do - { - rcode = search_item(fd, offset, db_key_null, NULL, NULL, &offset, &len); - if (rcode == 1) /* device error */ - return 1; - if (rcode == 2) /* it`s the end */ - break; - - if (len == data_len || len >= data_len + DB_HEADE_SIZE) - { - rcode = save_item(fd, offset, key, data, data_len); - if (rcode) - return rcode; - - if (len > data_len) - rcode = save_item( - fd, - offset + DB_HEADE_SIZE + data_len, - db_key_null, - NULL, - len - data_len - DB_HEADE_SIZE - ); - - return rcode; - } - - offset += DB_HEADE_SIZE + len; - } - while (1); - - /* store at the end */ - rcode = save_item(fd, offset, key, data, data_len); - if (rcode) - { - save_item(fd, offset, db_key_end, NULL, 0); - return 1; - } - else - { - offset += DB_HEADE_SIZE + data_len; - - rcode = save_item(fd, offset, db_key_end, NULL, 0); - } - - return rcode; -} - - -int main(int argc, char *argv[]) -{ - int fd_i2c; - unsigned char reg = sizeof(unsigned short); //DB_MAGIC_SIZE - int vLoop, ret = 0; - db_item item; - unsigned char *buffer = (unsigned char *) &item; - db_key key; - int offset = DB_MAGIC_SIZE; - - //printf("%s >\n", argv[0]); - - fd_i2c = open("/dev/i2c-2", O_RDWR); - - //printf("fd = %d\n", fd_i2c); - - if (argc > 2) - { -#ifdef write_works - char *key_item = argv[1]; - char *value = argv[2]; - - db_key key; - int rc_code; - - rc_code = get_keyvalue(key_item, &key); - - if (rc_code) - { - printf("unknown key\n"); - goto failed; - } - - if (!isRO(key_item)) - { - printf("writing \"%s\" to \"%s\".\n", key_item, value); - add_item(fd_i2c, key, value); - } - else - { - printf("trying to write RO element denied.\n"); - } -#endif - } - else if (argc > 1) - { - printf("offset\tkey\tlen\tdata\n"); - do - { - int rcode; - char *name; - unsigned char buf[256]; - int buflen; - - buf[0] = 0; - buflen = 255; - rcode = read_item(fd_i2c, offset, &key, buf, &buflen); - if (rcode < 0) - { - rcode = 1; - goto failed; - } - - get_keyname(key, &name); - - if (strcmp(name, argv[1]) == 0) - { - printf("found key %s ->value %s\n", name, buf); - - if (strcmp(name, "tvmode") == 0) - return atoi((unsigned char *) buf); - } - - //printf( "%d\t%s\t%d\t%s\n", offset, name, rcode, (key == db_key_null) ? "" : buf ); - - offset += DB_HEADE_SIZE + rcode; - } - while (key != db_key_end); - } - - return 0; -failed: - printf("failed\n"); - return -1; -} diff --git a/libeplayer2/Makefile.am b/libeplayer2/Makefile.am deleted file mode 100644 index 752118c..0000000 --- a/libeplayer2/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -lib_LTLIBRARIES = libeplayer2.la - -CFLAGS = -Wall -CXXFLAGS = -Wall - -INCLUDES = \ - -Iinclude - -libeplayer2_la_SOURCES = \ - container/mp_msg.c container/avi.c container/aviheader.c container/aviprint.c container/container.c \ - container/demux_audio.c container/demuxer.c container/demux_ts.c \ - container/mkv.c container/mp3_hdr.c container/mp4.c container/demux_mpg.c\ - container/mpeg_hdr.c container/parse_es.c container/stream.c container/utils.c \ - container/container_asf.c container/demux_asf.c container/asfheader.c \ - manager/audio.c manager/manager.c manager/subtitle.c manager/video.c \ - output/enigma2.c output/linuxdvb.c output/output.c container/text_srt.c container/text_ssa.c\ - playback/playback.c - -AM_CFLAGS = -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE diff --git a/libeplayer2/container/asf.h b/libeplayer2/container/asf.h deleted file mode 100644 index d98df47..0000000 --- a/libeplayer2/container/asf.h +++ /dev/null @@ -1,250 +0,0 @@ -#ifndef EPLAYER_ASF_H -#define EPLAYER_ASF_H - -//#include "config.h" /* for WORDS_BIGENDIAN */ -#include -#include "common.h" -//#include "mpbswap.h" - -/////////////////////// -// ASF Object Header -/////////////////////// -typedef struct __attribute__((packed)) -{ -uint8_t guid[16]; -uint64_t size; -} -ASF_obj_header_t; - -//////////////// -// ASF Header -//////////////// -typedef struct __attribute__((packed)) -{ - ASF_obj_header_t objh; - uint32_t cno; // number of subchunks - uint8_t v1; // unknown (0x01) - uint8_t v2; // unknown (0x02) -} -ASF_header_t; - -///////////////////// -// ASF File Header -///////////////////// -typedef struct __attribute__((packed)) -{ - uint8_t stream_id[16]; // stream GUID - uint64_t file_size; - uint64_t creation_time; //File creation time FILETIME 8 - uint64_t num_packets; //Number of packets UINT64 8 - uint64_t play_duration; //Timestamp of the end position UINT64 8 - uint64_t send_duration; //Duration of the playback UINT64 8 - uint64_t preroll; //Time to bufferize before playing UINT32 4 - uint32_t flags; //Unknown, maybe flags ( usually contains 2 ) UINT32 4 - uint32_t min_packet_size; //Min size of the packet, in bytes UINT32 4 - uint32_t max_packet_size; //Max size of the packet UINT32 4 - uint32_t max_bitrate; //Maximum bitrate of the media (sum of all the stream) -} -ASF_file_header_t; - -/////////////////////// -// ASF Stream Header -/////////////////////// -typedef struct __attribute__((packed)) -{ - uint8_t type[16]; // Stream type (audio/video) GUID 16 - uint8_t concealment[16]; // Audio error concealment type GUID 16 - uint64_t unk1; // Unknown, maybe reserved ( usually contains 0 ) UINT64 8 - uint32_t type_size; //Total size of type-specific data UINT32 4 - uint32_t stream_size; //Size of stream-specific data UINT32 4 - uint16_t stream_no; //Stream number UINT16 2 - uint32_t unk2; //Unknown UINT32 4 -} -ASF_stream_header_t; - -/////////////////////////// -// ASF Content Description -/////////////////////////// -typedef struct __attribute__((packed)) -{ - uint16_t title_size; - uint16_t author_size; - uint16_t copyright_size; - uint16_t comment_size; - uint16_t rating_size; -} -ASF_content_description_t; - -//////////////////////// -// ASF Segment Header -//////////////////////// -typedef struct __attribute__((packed)) -{ - uint8_t streamno; - uint8_t seq; - uint32_t x; - uint8_t flag; -} -ASF_segmhdr_t; - -////////////////////// -// ASF Stream Chunck -////////////////////// -typedef struct __attribute__((packed)) -{ - uint16_t type; - uint16_t size; - uint32_t sequence_number; - uint16_t unknown; - uint16_t size_confirm; -} -ASF_stream_chunck_t; - -// Definition of the stream type -#ifdef WORDS_BIGENDIAN -#define ASF_STREAMING_CLEAR 0x2443 // $C -#define ASF_STREAMING_DATA 0x2444 // $D -#define ASF_STREAMING_END_TRANS 0x2445 // $E -#define ASF_STREAMING_HEADER 0x2448 // $H -#else -#define ASF_STREAMING_CLEAR 0x4324 // $C -#define ASF_STREAMING_DATA 0x4424 // $D -#define ASF_STREAMING_END_TRANS 0x4524 // $E -#define ASF_STREAMING_HEADER 0x4824 // $H -#endif - -// Definition of the differents type of ASF streaming -typedef enum -{ - ASF_Unknown_e, - ASF_Live_e, - ASF_Prerecorded_e, - ASF_Redirector_e, - ASF_PlainText_e, - ASF_Authenticate_e -} ASF_StreamType_e; - -typedef struct -{ - ASF_StreamType_e streaming_type; - int request; - int packet_size; - int *audio_streams, n_audio, *video_streams, n_video; - int audio_id, video_id; -} asf_http_streaming_ctrl_t; - - -/* - * Some macros to swap little endian structures read from an ASF file - * into machine endian format - */ -#ifdef WORDS_BIGENDIAN -#define le2me_ASF_obj_header_t(h) { \ - (h)->size = le2me_64((h)->size); \ - } -#define le2me_ASF_header_t(h) { \ - le2me_ASF_obj_header_t(&(h)->objh); \ - (h)->cno = le2me_32((h)->cno); \ - } -#define le2me_ASF_stream_header_t(h) { \ - (h)->unk1 = le2me_64((h)->unk1); \ - (h)->type_size = le2me_32((h)->type_size); \ - (h)->stream_size = le2me_32((h)->stream_size); \ - (h)->stream_no = le2me_16((h)->stream_no); \ - (h)->unk2 = le2me_32((h)->unk2); \ - } -#define le2me_ASF_file_header_t(h) { \ - (h)->file_size = le2me_64((h)->file_size); \ - (h)->creation_time = le2me_64((h)->creation_time); \ - (h)->num_packets = le2me_64((h)->num_packets); \ - (h)->play_duration = le2me_64((h)->play_duration); \ - (h)->send_duration = le2me_64((h)->send_duration); \ - (h)->preroll = le2me_64((h)->preroll); \ - (h)->flags = le2me_32((h)->flags); \ - (h)->min_packet_size = le2me_32((h)->min_packet_size); \ - (h)->max_packet_size = le2me_32((h)->max_packet_size); \ - (h)->max_bitrate = le2me_32((h)->max_bitrate); \ - } -#define le2me_ASF_content_description_t(h) { \ - (h)->title_size = le2me_16((h)->title_size); \ - (h)->author_size = le2me_16((h)->author_size); \ - (h)->copyright_size = le2me_16((h)->copyright_size); \ - (h)->comment_size = le2me_16((h)->comment_size); \ - (h)->rating_size = le2me_16((h)->rating_size); \ - } -#define le2me_BITMAPINFOHEADER(h) { \ - (h)->biSize = le2me_32((h)->biSize); \ - (h)->biWidth = le2me_32((h)->biWidth); \ - (h)->biHeight = le2me_32((h)->biHeight); \ - (h)->biPlanes = le2me_16((h)->biPlanes); \ - (h)->biBitCount = le2me_16((h)->biBitCount); \ - (h)->biCompression = le2me_32((h)->biCompression); \ - (h)->biSizeImage = le2me_32((h)->biSizeImage); \ - (h)->biXPelsPerMeter = le2me_32((h)->biXPelsPerMeter); \ - (h)->biYPelsPerMeter = le2me_32((h)->biYPelsPerMeter); \ - (h)->biClrUsed = le2me_32((h)->biClrUsed); \ - (h)->biClrImportant = le2me_32((h)->biClrImportant); \ - } -#define le2me_WAVEFORMATEX(h) { \ - (h)->wFormatTag = le2me_16((h)->wFormatTag); \ - (h)->nChannels = le2me_16((h)->nChannels); \ - (h)->nSamplesPerSec = le2me_32((h)->nSamplesPerSec); \ - (h)->nAvgBytesPerSec = le2me_32((h)->nAvgBytesPerSec); \ - (h)->nBlockAlign = le2me_16((h)->nBlockAlign); \ - (h)->wBitsPerSample = le2me_16((h)->wBitsPerSample); \ - (h)->cbSize = le2me_16((h)->cbSize); \ - } -#define le2me_ASF_stream_chunck_t(h) { \ - (h)->size = le2me_16((h)->size); \ - (h)->sequence_number = le2me_32((h)->sequence_number); \ - (h)->unknown = le2me_16((h)->unknown); \ - (h)->size_confirm = le2me_16((h)->size_confirm); \ - } -#else -#define le2me_ASF_obj_header_t(h) /**/ -#define le2me_ASF_header_t(h) /**/ -#define le2me_ASF_stream_header_t(h) /**/ -#define le2me_ASF_file_header_t(h) /**/ -#define le2me_ASF_content_description_t(h) /**/ -#define le2me_BITMAPINFOHEADER(h) /**/ -#define le2me_WAVEFORMATEX(h) /**/ -#define le2me_ASF_stream_chunck_t(h) /**/ -#endif - -// priv struct for the demuxer -struct asf_priv -{ - ASF_header_t header; - unsigned char *packet; - int scrambling_h; - int scrambling_w; - int scrambling_b; - unsigned packetsize; - double packetrate; - unsigned movielength; - int asf_is_dvr_ms; - uint32_t asf_frame_state; - int asf_frame_start_found; - double dvr_last_vid_pts; - uint64_t vid_frame_ct; - uint64_t play_duration; - uint64_t num_packets; - int new_vid_frame_seg; - int *vid_repdata_sizes; - int *aud_repdata_sizes; - int vid_repdata_count; - int aud_repdata_count; - uint64_t avg_vid_frame_time; - uint64_t last_key_payload_time; - uint64_t last_aud_pts; - uint64_t last_aud_diff; - int found_first_key_frame; - uint32_t last_vid_seq; - int vid_ext_timing_index; - int aud_ext_timing_index; - int vid_ext_frame_index; - int know_frame_time; - unsigned bps; -}; - -#endif /* EPLAYER_ASF_H */ diff --git a/libeplayer2/container/asfguid.h b/libeplayer2/container/asfguid.h deleted file mode 100644 index bd2f1c1..0000000 --- a/libeplayer2/container/asfguid.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef EPLAYER_ASFGUID_H -#define EPLAYER_ASFGUID_H - -#include -#include "common.h" -//#include "mpbswap.h" - - -#if ARCH_X86 -#define ASF_LOAD_GUID_PREFIX(guid) (*(uint32_t *)(guid)) -#else -#define ASF_LOAD_GUID_PREFIX(guid) AV_RL32(guid) -#endif - -#define ASF_GUID_PREFIX_audio_stream 0xF8699E40 -#define ASF_GUID_PREFIX_video_stream 0xBC19EFC0 -#define ASF_GUID_PREFIX_audio_conceal_none 0x49f1a440 -#define ASF_GUID_PREFIX_audio_conceal_interleave 0xbfc3cd50 -#define ASF_GUID_PREFIX_header 0x75B22630 -#define ASF_GUID_PREFIX_data_chunk 0x75b22636 -#define ASF_GUID_PREFIX_index_chunk 0x33000890 -#define ASF_GUID_PREFIX_stream_header 0xB7DC0791 -#define ASF_GUID_PREFIX_header_2_0 0xD6E229D1 -#define ASF_GUID_PREFIX_file_header 0x8CABDCA1 -#define ASF_GUID_PREFIX_content_desc 0x75b22633 -#define ASF_GUID_PREFIX_stream_group 0x7bf875ce -#define ASF_GUID_PREFIX_ext_audio_stream 0x31178C9D -#define ASF_GUID_PREFIX_ext_stream_embed_stream_header 0x3AFB65E2 -#define ASF_GUID_PREFIX_dvr_ms_timing_rep_data 0xFD3CC02A -#define ASF_GUID_PREFIX_dvr_ms_vid_frame_rep_data 0xDD6432CC - -/* -const char asf_audio_stream_guid[16] = {0x40, 0x9e, 0x69, 0xf8, - 0x4d, 0x5b, 0xcf, 0x11, 0xa8, 0xfd, 0x00, 0x80, 0x5f, 0x5c, 0x44, 0x2b}; -const char asf_video_stream_guid[16] = {0xc0, 0xef, 0x19, 0xbc, - 0x4d, 0x5b, 0xcf, 0x11, 0xa8, 0xfd, 0x00, 0x80, 0x5f, 0x5c, 0x44, 0x2b}; -*/ -static const char asf_stream_header_guid[16] = {0x91, 0x07, 0xdc, 0xb7, - 0xb7, 0xa9, 0xcf, 0x11, 0x8e, 0xe6, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65 - }; -static const char asf_file_header_guid[16] = {0xa1, 0xdc, 0xab, 0x8c, - 0x47, 0xa9, 0xcf, 0x11, 0x8e, 0xe4, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65 - }; -static const char asf_content_desc_guid[16] = {0x33, 0x26, 0xb2, 0x75, - 0x8e, 0x66, 0xcf, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c - }; -static const char asf_stream_group_guid[16] = {0xce, 0x75, 0xf8, 0x7b, - 0x8d, 0x46, 0xd1, 0x11, 0x8d, 0x82, 0x00, 0x60, 0x97, 0xc9, 0xa2, 0xb2 - }; -static const char asf_data_chunk_guid[16] = {0x36, 0x26, 0xb2, 0x75, - 0x8e, 0x66, 0xcf, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c - }; -static const char asf_ext_stream_embed_stream_header[16] = {0xe2, 0x65, 0xfb, 0x3a, - 0xef, 0x47, 0xf2, 0x40, 0xac, 0x2c, 0x70, 0xa9, 0x0d, 0x71, 0xd3, 0x43 - }; -static const char asf_ext_stream_audio[16] = {0x9d, 0x8c, 0x17, 0x31, - 0xe1, 0x03, 0x28, 0x45, 0xb5, 0x82, 0x3d, 0xf9, 0xdb, 0x22, 0xf5, 0x03 - }; -static const char asf_ext_stream_header[16] = {0xCB, 0xA5, 0xE6, 0x14, - 0x72, 0xC6, 0x32, 0x43, 0x83, 0x99, 0xA9, 0x69, 0x52, 0x06, 0x5B, 0x5A - }; -static const char asf_metadata_header[16] = {0xea, 0xcb, 0xf8, 0xc5, - 0xaf, 0x5b, 0x77, 0x48, 0x84, 0x67, 0xaa, 0x8c, 0x44, 0xfa, 0x4c, 0xca - }; -static const char asf_content_encryption[16] = {0xfb, 0xb3, 0x11, 0x22, - 0x23, 0xbd, 0xd2, 0x11, 0xb4, 0xb7, 0x00, 0xa0, 0xc9, 0x55, 0xfc, 0x6e - }; -static const char asf_dvr_ms_timing_rep_data[16] = {0x2a, 0xc0, 0x3c, 0xfd, - 0xdb, 0x06, 0xfa, 0x4c, 0x80, 0x1c, 0x72, 0x12, 0xd3, 0x87, 0x45, 0xe4 - }; -static const char asf_dvr_ms_vid_frame_rep_data[16] = {0xcc, 0x32, 0x64, 0xdd, - 0x29, 0xe2, 0xdb, 0x40, 0x80, 0xf6, 0xd2, 0x63, 0x28, 0xd2, 0x76, 0x1f - }; - -static int find_asf_guid(char *buf, const char *guid, int cur_pos, int buf_len) -{ -int i; -for (i = cur_pos; i < buf_len - 19; i++) -{ - if (memcmp(&buf[i], guid, 16) == 0) - return i + 16 + 8; // point after guid + length -} -return -1; -} - -#endif /* EPLAYER_ASFGUID_H */ diff --git a/libeplayer2/container/asfheader.c b/libeplayer2/container/asfheader.c deleted file mode 100644 index 0a85c34..0000000 --- a/libeplayer2/container/asfheader.c +++ /dev/null @@ -1,929 +0,0 @@ -/* - * This file is part of MPlayer. - * - * MPlayer is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * MPlayer is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with MPlayer; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -// .asf fileformat docs from http://divx.euro.ru - -#include -#include -#include - -#ifndef __sh__ -#include "config.h" -#include "libavutil/common.h" -#include "libavutil/intreadwrite.h" -#include "mp_msg.h" -#include "help_mp.h" - -#include "stream/stream.h" -#else -#include "common.h" -#include "intreadwrite.h" -#include "stream.h" - -#include "mp_msg.h" -#include "help_mp-en.h" - -// PUT_UTF8 extracted from common.h - -const uint8_t ff_log2_tab[256] = -{ -0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, -5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, -6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, -7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, -7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, -7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, -7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 -}; - -static inline int av_log2(unsigned int v) -{ - int n = 0; - if (v & 0xffff0000) - { - v >>= 16; - n += 16; - } - if (v & 0xff00) - { - v >>= 8; - n += 8; - } - n += ff_log2_tab[v]; - - return n; -} - -/*! - * \def PUT_UTF8(val, tmp, PUT_BYTE) - * Converts a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long). - * \param val is an input-only argument and should be of type uint32_t. It holds - * a UCS-4 encoded Unicode character that is to be converted to UTF-8. If - * val is given as a function it is executed only once. - * \param tmp is a temporary variable and should be of type uint8_t. It - * represents an intermediate value during conversion that is to be - * output by PUT_BYTE. - * \param PUT_BYTE writes the converted UTF-8 bytes to any proper destination. - * It could be a function or a statement, and uses tmp as the input byte. - * For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be - * executed up to 4 times for values in the valid UTF-8 range and up to - * 7 times in the general case, depending on the length of the converted - * Unicode character. - */ -#define PUT_UTF8(val, tmp, PUT_BYTE)\ - {\ - int bytes, shift;\ - uint32_t in = val;\ - if (in < 0x80) {\ - tmp = in;\ - PUT_BYTE\ - } else {\ - bytes = (av_log2(in) + 4) / 5;\ - shift = (bytes - 1) * 6;\ - tmp = (256 - (256 >> bytes)) | (in >> shift);\ - PUT_BYTE\ - while (shift >= 6) {\ - shift -= 6;\ - tmp = 0x80 | ((in >> shift) & 0x3f);\ - PUT_BYTE\ - }\ - }\ - } - -#endif - - -#include "demuxer.h" -#include "stheader.h" - -#include "asf.h" - -#include "asfguid.h" - -typedef struct -{ - // must be 0 for metadata record, might be non-zero for metadata lib record - uint16_t lang_list_index; - uint16_t stream_num; - uint16_t name_length; - uint16_t data_type; - uint32_t data_length; - uint16_t *name; - void *data; -} ASF_meta_record_t; - -static char *get_ucs2str(const uint16_t *inbuf, uint16_t inlen) -{ - char *outbuf = calloc(inlen, 2); - char *q; - int i; - - if (!outbuf) - { - mp_msg(MSGT_HEADER, MSGL_ERR, MSGTR_MemAllocFailed); - return NULL; - } - q = outbuf; - for (i = 0; i < inlen / 2; i++) - { - uint8_t tmp; - PUT_UTF8(AV_RL16(&inbuf[i]), tmp, *q++ = tmp;) - } - return outbuf; -} - -static const char *asf_chunk_type(unsigned char *guid) -{ - static char tmp[60]; - char *p; - int i; - - switch (ASF_LOAD_GUID_PREFIX(guid)) - { - case ASF_GUID_PREFIX_audio_stream: - return "guid_audio_stream"; - case ASF_GUID_PREFIX_ext_audio_stream: - return "guid_ext_audio_stream"; - case ASF_GUID_PREFIX_ext_stream_embed_stream_header: - return "guid_ext_stream_embed_stream_header"; - case ASF_GUID_PREFIX_video_stream: - return "guid_video_stream"; - case ASF_GUID_PREFIX_audio_conceal_none: - return "guid_audio_conceal_none"; - case ASF_GUID_PREFIX_audio_conceal_interleave: - return "guid_audio_conceal_interleave"; - case ASF_GUID_PREFIX_header: - return "guid_header"; - case ASF_GUID_PREFIX_data_chunk: - return "guid_data_chunk"; - case ASF_GUID_PREFIX_index_chunk: - return "guid_index_chunk"; - case ASF_GUID_PREFIX_stream_header: - return "guid_stream_header"; - case ASF_GUID_PREFIX_header_2_0: - return "guid_header_2_0"; - case ASF_GUID_PREFIX_file_header: - return "guid_file_header"; - case ASF_GUID_PREFIX_content_desc: - return "guid_content_desc"; - case ASF_GUID_PREFIX_dvr_ms_timing_rep_data: - return "guid_dvr_ms_timing_rep_data"; - case ASF_GUID_PREFIX_dvr_ms_vid_frame_rep_data: - return "guid_dvr_ms_vid_frame_rep_data"; - default: - strcpy(tmp, "unknown guid "); - p = tmp + strlen(tmp); - for (i = 0; i < 16; i++) - { - if ((1 << i) & ((1 << 4) | (1 << 6) | (1 << 8))) *p++ = '-'; - sprintf(p, "%02x", guid[i]); - p += 2; - } - return tmp; - } -} - -int asf_check_header(demuxer_t *demuxer) -{ - unsigned char asfhdrguid[16] = {0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C}; - struct asf_priv *asf = calloc(1, sizeof(*asf)); - asf->scrambling_h = asf->scrambling_w = asf->scrambling_b = 1; - stream_read(demuxer->stream, (unsigned char *) &asf->header, sizeof(asf->header)); // header obj - le2me_ASF_header_t(&asf->header); // swap to machine endian -// for(i=0;i<16;i++) printf(" %02X",temp[i]);printf("\n"); -// for(i=0;i<16;i++) printf(" %02X",asfhdrguid[i]);printf("\n"); - if (memcmp(asfhdrguid, asf->header.objh.guid, 16)) - { - mp_msg(MSGT_HEADER, MSGL_V, "ASF_check: not ASF guid!\n"); - free(asf); - return 0; // not ASF guid - } - if (asf->header.cno > 256) - { - mp_msg(MSGT_HEADER, MSGL_V, "ASF_check: invalid subchunks_no %d\n", (int) asf->header.cno); - free(asf); - return 0; // invalid header??? - } - demuxer->priv = asf; - return DEMUXER_TYPE_ASF; -} - -void print_wave_header(WAVEFORMATEX *h, int verbose_level); -void print_video_header(BITMAPINFOHEADER *h, int verbose_level); - - -static int get_ext_stream_properties(char *buf, int buf_len, int stream_num, struct asf_priv *asf, int is_video) -{ - int pos = 0; - uint8_t *buffer = (uint8_t *) &buf[0]; - uint64_t avg_ft; - unsigned bitrate; - - while ((pos = find_asf_guid(buf, asf_ext_stream_header, pos, buf_len)) >= 0) - { - int this_stream_num, stnamect, payct, i; - int buf_max_index = pos + 50; - if (buf_max_index > buf_len) return 0; - buffer = (uint8_t *) &buf[pos]; - - // the following info is available - // some of it may be useful but we're skipping it for now - // starttime(8 bytes), endtime(8), - // leak-datarate(4), bucket-datasize(4), init-bucket-fullness(4), - // alt-leak-datarate(4), alt-bucket-datasize(4), alt-init-bucket-fullness(4), - // max-object-size(4), - // flags(4) (reliable,seekable,no_cleanpoints?,resend-live-cleanpoints, rest of bits reserved) - - buffer += 8 + 8; - bitrate = AV_RL32(buffer); - buffer += 8 * 4; - this_stream_num = AV_RL16(buffer); - buffer += 2; - - if (this_stream_num == stream_num) - { - buf_max_index += 14; - if (buf_max_index > buf_len) return 0; - buffer += 2; //skip stream-language-id-index - avg_ft = AV_RL64(buffer); // provided in 100ns units - buffer += 8; - asf->bps = bitrate / 8; - - // after this are values for stream-name-count and - // payload-extension-system-count - // followed by associated info for each - stnamect = AV_RL16(buffer); - buffer += 2; - payct = AV_RL16(buffer); - buffer += 2; - - // need to read stream names if present in order - // to get lengths - values are ignored for now - for (i = 0; i < stnamect; i++) - { - int stream_name_len; - buf_max_index += 4; - if (buf_max_index > buf_len) return 0; - buffer += 2; //language_id_index - stream_name_len = AV_RL16(buffer); - buffer += 2; - buffer += stream_name_len; //stream_name - buf_max_index += stream_name_len; - if (buf_max_index > buf_len) return 0; - } - - if (is_video) - { - asf->vid_repdata_count = payct; - asf->vid_repdata_sizes = malloc(payct * sizeof(int)); - } - else - { - asf->aud_repdata_count = payct; - asf->aud_repdata_sizes = malloc(payct * sizeof(int)); - } - - for (i = 0; i < payct; i++) - { - int payload_len; - buf_max_index += 22; - if (buf_max_index > buf_len) return 0; - // Each payload extension definition starts with a GUID. - // In dvr-ms files one of these indicates the presence an - // extension that contains pts values and this is always present - // in the video and audio streams. - // Another GUID indicates the presence of an extension - // that contains useful video frame demuxing information. - // Note that the extension data in each packet does not contain - // these GUIDs and that this header section defines the order the data - // will appear in. - if (memcmp(buffer, asf_dvr_ms_timing_rep_data, 16) == 0) - { - if (is_video) - asf->vid_ext_timing_index = i; - else - asf->aud_ext_timing_index = i; - } - else if (is_video && memcmp(buffer, asf_dvr_ms_vid_frame_rep_data, 16) == 0) - asf->vid_ext_frame_index = i; - buffer += 16; - - payload_len = AV_RL16(buffer); - buffer += 2; - - if (is_video) - asf->vid_repdata_sizes[i] = payload_len; - else - asf->aud_repdata_sizes[i] = payload_len; - buffer += 4; //sys_len - } - - return 1; - } - } - return 1; -} - -#define CHECKDEC(l, n) if (((l) -= (n)) < 0) return 0 -static char *read_meta_record(ASF_meta_record_t *dest, char *buf, - int *buf_len) -{ - CHECKDEC(*buf_len, 2 + 2 + 2 + 2 + 4); - dest->lang_list_index = AV_RL16(buf); - dest->stream_num = AV_RL16(&buf[2]); - dest->name_length = AV_RL16(&buf[4]); - dest->data_type = AV_RL16(&buf[6]); - dest->data_length = AV_RL32(&buf[8]); - buf += 2 + 2 + 2 + 2 + 4; - CHECKDEC(*buf_len, dest->name_length); - dest->name = (uint16_t *)buf; - buf += dest->name_length; - CHECKDEC(*buf_len, dest->data_length); - dest->data = buf; - buf += dest->data_length; - return buf; -} - -static int get_meta(char *buf, int buf_len, int this_stream_num, - float *asp_ratio) -{ - int pos = 0; - uint16_t records_count; - uint16_t x = 0, y = 0; - - if ((pos = find_asf_guid(buf, asf_metadata_header, pos, buf_len)) < 0) - return 0; - - CHECKDEC(buf_len, pos); - buf += pos; - CHECKDEC(buf_len, 2); - records_count = AV_RL16(buf); - buf += 2; - - while (records_count--) - { - ASF_meta_record_t record_entry; - char *name; - - if (!(buf = read_meta_record(&record_entry, buf, &buf_len))) - return 0; - /* reserved, must be zero */ - if (record_entry.lang_list_index) - continue; - /* match stream number: 0 to match all */ - if (record_entry.stream_num && record_entry.stream_num != this_stream_num) - continue; - if (!(name = get_ucs2str(record_entry.name, record_entry.name_length))) - { - mp_msg(MSGT_HEADER, MSGL_ERR, MSGTR_MemAllocFailed); - continue; - } - if (strcmp(name, "AspectRatioX") == 0) - x = AV_RL16(record_entry.data); - else if (strcmp(name, "AspectRatioY") == 0) - y = AV_RL16(record_entry.data); - free(name); - } - if (x && y) - { - *asp_ratio = (float)x / (float)y; - return 1; - } - return 0; -} - -static int is_drm(char *buf, int buf_len) -{ - uint32_t data_len, type_len, key_len, url_len; - int pos = find_asf_guid(buf, asf_content_encryption, 0, buf_len); - - if (pos < 0) - return 0; - - CHECKDEC(buf_len, pos + 4); - buf += pos; - data_len = AV_RL32(buf); - buf += 4; - CHECKDEC(buf_len, data_len); - buf += data_len; - type_len = AV_RL32(buf); - if (type_len < 4) - return 0; - CHECKDEC(buf_len, 4 + type_len + 4); - buf += 4; - - if (buf[0] != 'D' || buf[1] != 'R' || buf[2] != 'M' || buf[3] != '\0') - return 0; - - buf += type_len; - key_len = AV_RL32(buf); - CHECKDEC(buf_len, key_len + 4); - buf += 4; - - buf[key_len - 1] = '\0'; - mp_msg(MSGT_HEADER, MSGL_V, "DRM Key ID: %s\n", buf); - - buf += key_len; - url_len = AV_RL32(buf); - CHECKDEC(buf_len, url_len); - buf += 4; - - buf[url_len - 1] = '\0'; - mp_msg(MSGT_HEADER, MSGL_INFO, MSGTR_MPDEMUX_ASFHDR_DRMLicenseURL, buf); - return 1; -} - -static int asf_init_audio_stream(demuxer_t *demuxer, struct asf_priv *asf, sh_audio_t *sh_audio, ASF_stream_header_t *streamh, int *ppos, uint8_t **buf, char *hdr, unsigned int hdr_len) -{ - uint8_t *buffer = *buf; - int pos = *ppos; - - sh_audio->wf = calloc((streamh->type_size < sizeof(WAVEFORMATEX)) ? sizeof(WAVEFORMATEX) : streamh->type_size, 1); - memcpy(sh_audio->wf, buffer, streamh->type_size); - le2me_WAVEFORMATEX(sh_audio->wf); -#ifndef __sh__ - if (mp_msg_test(MSGT_HEADER, MSGL_V)) print_wave_header(sh_audio->wf, MSGL_V); -#else - print_wave_header(sh_audio->wf, MSGL_V); -#endif - if (ASF_LOAD_GUID_PREFIX(streamh->concealment) == ASF_GUID_PREFIX_audio_conceal_interleave) - { - buffer = (uint8_t *) &hdr[pos]; - pos += streamh->stream_size; - if (pos > hdr_len) return 0; - asf->scrambling_h = buffer[0]; - asf->scrambling_w = (buffer[2] << 8) | buffer[1]; - asf->scrambling_b = (buffer[4] << 8) | buffer[3]; - if (asf->scrambling_b > 0) - { - asf->scrambling_w /= asf->scrambling_b; - } - } - else - { - asf->scrambling_b = asf->scrambling_h = asf->scrambling_w = 1; - } - mp_msg(MSGT_HEADER, MSGL_V, "ASF: audio scrambling: %d x %d x %d\n", asf->scrambling_h, asf->scrambling_w, asf->scrambling_b); - return 1; -} - -static int find_backwards_asf_guid(char *buf, const char *guid, int cur_pos) -{ - int i; - for (i = cur_pos - 16; i > 0; i--) - { - if (memcmp(&buf[i], guid, 16) == 0) - return i + 16 + 8; // point after guid + length - } - return -1; -} - -#ifdef __sh__ -unsigned char ASF_PRIVATE_DATA[4]; -unsigned char *STREAMHEADERBUFFER = NULL; -unsigned int STREAMHEADERBUFFERSIZE = 0; -#endif - -int read_asf_header(demuxer_t *demuxer, struct asf_priv *asf) -{ - int hdr_len = asf->header.objh.size - sizeof(asf->header); - int hdr_skip = 0; - char *hdr = NULL; - char guid_buffer[16]; - int pos, start = stream_tell(demuxer->stream); - uint32_t *streams = NULL; - int audio_streams = 0; - int video_streams = 0; - uint16_t stream_count = 0; - int best_video = -1; - int best_audio = -1; - uint64_t data_len; - ASF_stream_header_t *streamh; - uint8_t *buffer; - int audio_pos = 0; - - if (hdr_len < 0) - { - mp_msg(MSGT_HEADER, MSGL_FATAL, "Header size is too small.\n"); - return 0; - } - - if (hdr_len > 1024 * 1024) - { - mp_msg(MSGT_HEADER, MSGL_ERR, MSGTR_MPDEMUX_ASFHDR_HeaderSizeOver1MB, - hdr_len); - hdr_skip = hdr_len - 1024 * 1024; - hdr_len = 1024 * 1024; - } - hdr = malloc(hdr_len); - if (!hdr) - { - mp_msg(MSGT_HEADER, MSGL_FATAL, MSGTR_MPDEMUX_ASFHDR_HeaderMallocFailed, - hdr_len); - return 0; - } - stream_read(demuxer->stream, (unsigned char *) hdr, hdr_len); - if (hdr_skip) - stream_skip(demuxer->stream, hdr_skip); - if (stream_eof(demuxer->stream)) - { - mp_msg(MSGT_HEADER, MSGL_FATAL, MSGTR_MPDEMUX_ASFHDR_EOFWhileReadingHeader); - goto err_out; - } - - if (is_drm(hdr, hdr_len)) - mp_msg(MSGT_HEADER, MSGL_FATAL, MSGTR_MPDEMUX_ASFHDR_DRMProtected); - - if ((pos = find_asf_guid(hdr, asf_ext_stream_audio, 0, hdr_len)) >= 0) - { - // Special case: found GUID for dvr-ms audio. - // Now skip back to associated stream header. - int sh_pos = 0; - - sh_pos = find_backwards_asf_guid(hdr, asf_stream_header_guid, pos); - - if (sh_pos > 0) - { - sh_audio_t *sh_audio; - - mp_msg(MSGT_HEADER, MSGL_V, "read_asf_header found dvr-ms audio stream header pos=%d\n", sh_pos); - // found audio stream header - following code reads header and - // initializes audio stream. - audio_pos = pos - 16 - 8; - streamh = (ASF_stream_header_t *)&hdr[sh_pos]; - le2me_ASF_stream_header_t(streamh); - audio_pos += 64; //16+16+4+4+4+16+4; - buffer = (uint8_t *) &hdr[audio_pos]; - sh_audio = new_sh_audio(demuxer, streamh->stream_no & 0x7F); -#ifndef __sh__ - sh_audio->needs_parsing = 1; -#endif - mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_AudioID, "asfheader", streamh->stream_no & 0x7F); - ++audio_streams; - if (!asf_init_audio_stream(demuxer, asf, sh_audio, streamh, &audio_pos, &buffer, hdr, hdr_len)) - goto len_err_out; - if (!get_ext_stream_properties(hdr, hdr_len, streamh->stream_no, asf, 0)) - goto len_err_out; - } - } - // find stream headers - // only reset pos if we didnt find dvr_ms audio stream - // if we did find it then we want to avoid reading its header twice - if (audio_pos == 0) - pos = 0; - - while ((pos = find_asf_guid(hdr, asf_stream_header_guid, pos, hdr_len)) >= 0) - { -#ifdef __sh__ - int HeaderPosition = pos - 24; -#endif - - streamh = (ASF_stream_header_t *)&hdr[pos]; - pos += sizeof(ASF_stream_header_t); - if (pos > hdr_len) goto len_err_out; - le2me_ASF_stream_header_t(streamh); - mp_msg(MSGT_HEADER, MSGL_V, "stream type: %s\n", - asf_chunk_type(streamh->type)); - mp_msg(MSGT_HEADER, MSGL_V, "stream concealment: %s\n", - asf_chunk_type(streamh->concealment)); - mp_msg(MSGT_HEADER, MSGL_V, "type: %d bytes, stream: %d bytes ID: %d\n", - (int)streamh->type_size, (int)streamh->stream_size, - (int)streamh->stream_no); - mp_msg(MSGT_HEADER, MSGL_V, "unk1: %lX unk2: %X\n", - (unsigned long)streamh->unk1, (unsigned int)streamh->unk2); - mp_msg(MSGT_HEADER, MSGL_V, "FILEPOS=0x%X\n", pos + start); - // type-specific data: - buffer = (uint8_t *) &hdr[pos]; - pos += streamh->type_size; - if (pos > hdr_len) goto len_err_out; - switch (ASF_LOAD_GUID_PREFIX(streamh->type)) - { - case ASF_GUID_PREFIX_audio_stream: - { - -#ifdef __sh__ - { - int i, j; - int Position = HeaderPosition; - unsigned char ObjectID[16]; - unsigned int ObjectSize = 0; - for (i = 0; i < 16; i++) - ObjectID[i] = hdr[Position + i] & 0xFF; - - for (i = 0; i < 8; i++) - { -// printf("ObjectSize = %u += %u\n", ObjectSize, (hdr[Position+16+i]&0xFF)<stream_no & 0x7F); - mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_AudioID, "asfheader", streamh->stream_no & 0x7F); - ++audio_streams; - if (!asf_init_audio_stream(demuxer, asf, sh_audio, streamh, &pos, &buffer, hdr, hdr_len)) - goto len_err_out; - //if(demuxer->audio->id==-1) demuxer->audio->id=streamh.stream_no & 0x7F; - - break; - } - case ASF_GUID_PREFIX_video_stream: - { - unsigned int len; - float asp_ratio; - sh_video_t *sh_video = new_sh_video(demuxer, streamh->stream_no & 0x7F); - mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_VideoID, "asfheader", streamh->stream_no & 0x7F); - len = streamh->type_size - (4 + 4 + 1 + 2); - ++video_streams; -// sh_video->bih=malloc(chunksize); memset(sh_video->bih,0,chunksize); - sh_video->bih = calloc((len < sizeof(BITMAPINFOHEADER)) ? sizeof(BITMAPINFOHEADER) : len, 1); - memcpy(sh_video->bih, &buffer[4 + 4 + 1 + 2], len); -#ifdef __sh__ - // ASF PRIVATE DATA - memcpy(&ASF_PRIVATE_DATA, &buffer[4 + 4 + 1 + 2 + 40], 4); -#endif - le2me_BITMAPINFOHEADER(sh_video->bih); - if (sh_video->bih->biSize > len && sh_video->bih->biSize > sizeof(BITMAPINFOHEADER)) - sh_video->bih->biSize = len; - if (sh_video->bih->biCompression == mmioFOURCC('D', 'V', 'R', ' ')) - { - //mp_msg(MSGT_DEMUXER, MSGL_WARN, MSGTR_MPDEMUX_ASFHDR_DVRWantsLibavformat); - //sh_video->fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale; - //sh_video->frametime=(float)sh_video->video.dwScale/(float)sh_video->video.dwRate; - asf->asf_frame_state = -1; - asf->asf_frame_start_found = 0; - asf->asf_is_dvr_ms = 1; - asf->dvr_last_vid_pts = 0.0; - } - else asf->asf_is_dvr_ms = 0; - if (!get_ext_stream_properties(hdr, hdr_len, streamh->stream_no, asf, 1)) - goto len_err_out; - if (get_meta(hdr, hdr_len, streamh->stream_no, &asp_ratio)) - { - sh_video->aspect = asp_ratio * sh_video->bih->biWidth / - sh_video->bih->biHeight; - } - sh_video->i_bps = asf->bps; - -#ifndef __sh__ - if (mp_msg_test(MSGT_DEMUX, MSGL_V)) print_video_header(sh_video->bih, MSGL_V); -#else - print_video_header(sh_video->bih, MSGL_V); -#endif - //asf_video_id=streamh.stream_no & 0x7F; - //if(demuxer->video->id==-1) demuxer->video->id=streamh.stream_no & 0x7F; - break; - } - } - // stream-specific data: - // stream_read(demuxer->stream,(char*) buffer,streamh.stream_size); - } - - // find file header - pos = find_asf_guid(hdr, asf_file_header_guid, 0, hdr_len); - if (pos >= 0) - { - ASF_file_header_t *fileh = (ASF_file_header_t *)&hdr[pos]; - pos += sizeof(ASF_file_header_t); - if (pos > hdr_len) goto len_err_out; - le2me_ASF_file_header_t(fileh); - mp_msg(MSGT_HEADER, MSGL_V, "ASF: packets: %d flags: %d " - "max_packet_size: %d min_packet_size: %d max_bitrate: %d " - "preroll: %d\n", - (int)fileh->num_packets, (int)fileh->flags, - (int)fileh->min_packet_size, (int)fileh->max_packet_size, - (int)fileh->max_bitrate, (int)fileh->preroll); - asf->packetsize = fileh->max_packet_size; - asf->packet = malloc(asf->packetsize); // !!! - asf->packetrate = fileh->max_bitrate / 8.0 / (double)asf->packetsize; - asf->movielength = (fileh->play_duration - 10000 * fileh->preroll) / 10000000.0; - } - - // find content header - pos = find_asf_guid(hdr, asf_content_desc_guid, 0, hdr_len); - if (pos >= 0) - { - ASF_content_description_t *contenth = (ASF_content_description_t *)&hdr[pos]; - char *string = NULL; - uint16_t *wstring = NULL; - uint16_t len; - pos += sizeof(ASF_content_description_t); - if (pos > hdr_len) goto len_err_out; - le2me_ASF_content_description_t(contenth); - mp_msg(MSGT_HEADER, MSGL_V, "\n"); - // extract the title - if ((len = contenth->title_size) != 0) - { - wstring = (uint16_t *)&hdr[pos]; - pos += len; - if (pos > hdr_len) goto len_err_out; - if ((string = get_ucs2str(wstring, len))) - { - mp_msg(MSGT_HEADER, MSGL_V, " Title: %s\n", string); - demux_info_add(demuxer, "title", string); - free(string); - } - } - // extract the author - if ((len = contenth->author_size) != 0) - { - wstring = (uint16_t *)&hdr[pos]; - pos += len; - if (pos > hdr_len) goto len_err_out; - if ((string = get_ucs2str(wstring, len))) - { - mp_msg(MSGT_HEADER, MSGL_V, " Author: %s\n", string); - demux_info_add(demuxer, "author", string); - free(string); - } - } - // extract the copyright - if ((len = contenth->copyright_size) != 0) - { - wstring = (uint16_t *)&hdr[pos]; - pos += len; - if (pos > hdr_len) goto len_err_out; - if ((string = get_ucs2str(wstring, len))) - { - mp_msg(MSGT_HEADER, MSGL_V, " Copyright: %s\n", string); - demux_info_add(demuxer, "copyright", string); - free(string); - } - } - // extract the comment - if ((len = contenth->comment_size) != 0) - { - wstring = (uint16_t *)&hdr[pos]; - pos += len; - if (pos > hdr_len) goto len_err_out; - if ((string = get_ucs2str(wstring, len))) - { - mp_msg(MSGT_HEADER, MSGL_V, " Comment: %s\n", string); - demux_info_add(demuxer, "comments", string); - free(string); - } - } - // extract the rating - if ((len = contenth->rating_size) != 0) - { - wstring = (uint16_t *)&hdr[pos]; - pos += len; - if (pos > hdr_len) goto len_err_out; - if ((string = get_ucs2str(wstring, len))) - { - mp_msg(MSGT_HEADER, MSGL_V, " Rating: %s\n", string); - free(string); - } - } - mp_msg(MSGT_HEADER, MSGL_V, "\n"); - } - - // find content header - pos = find_asf_guid(hdr, asf_stream_group_guid, 0, hdr_len); - if (pos >= 0) - { - int max_streams = (hdr_len - pos - 2) / 6; - uint16_t stream_id, i; - uint32_t max_bitrate; - char *ptr = &hdr[pos]; - mp_msg(MSGT_HEADER, MSGL_V, "============ ASF Stream group == START ===\n"); - if (max_streams <= 0) goto len_err_out; - stream_count = AV_RL16(ptr); - ptr += sizeof(uint16_t); - if (stream_count > max_streams) stream_count = max_streams; - if (stream_count > 0) - streams = malloc(2 * stream_count * sizeof(uint32_t)); - mp_msg(MSGT_HEADER, MSGL_V, " stream count=[0x%x][%u]\n", stream_count, stream_count); - for (i = 0 ; i < stream_count ; i++) - { - stream_id = AV_RL16(ptr); - ptr += sizeof(uint16_t); - memcpy(&max_bitrate, ptr, sizeof(uint32_t));// workaround unaligment bug on sparc - max_bitrate = le2me_32(max_bitrate); - ptr += sizeof(uint32_t); - mp_msg(MSGT_HEADER, MSGL_V, " stream id=[0x%x][%u]\n", stream_id, stream_id); - mp_msg(MSGT_HEADER, MSGL_V, " max bitrate=[0x%x][%u]\n", max_bitrate, max_bitrate); - streams[2 * i] = stream_id; - streams[2 * i + 1] = max_bitrate; - } - mp_msg(MSGT_HEADER, MSGL_V, "============ ASF Stream group == END ===\n"); - } - free(hdr); - hdr = NULL; - start = stream_tell(demuxer->stream); // start of first data chunk - stream_read(demuxer->stream, (unsigned char *) guid_buffer, 16); - if (memcmp(guid_buffer, asf_data_chunk_guid, 16) != 0) - { - mp_msg(MSGT_HEADER, MSGL_FATAL, MSGTR_MPDEMUX_ASFHDR_NoDataChunkAfterHeader); - free(streams); - streams = NULL; - return 0; - } - // read length of chunk - stream_read(demuxer->stream, (unsigned char *)&data_len, sizeof(data_len)); - data_len = le2me_64(data_len); - demuxer->movi_start = stream_tell(demuxer->stream) + 26; - demuxer->movi_end = start + data_len; - mp_msg(MSGT_HEADER, MSGL_V, "Found movie at 0x%X - 0x%X\n", - (int)demuxer->movi_start, (int)demuxer->movi_end); - - if (streams) - { - // stream selection is done in the network code, it shouldn't be done here - // as the servers often do not care about what we requested. -#if 0 - uint32_t vr = 0, ar = 0, i; -#ifdef CONFIG_NETWORK - if (demuxer->stream->streaming_ctrl != NULL) - { - if (demuxer->stream->streaming_ctrl->bandwidth != 0 && demuxer->stream->streaming_ctrl->data != NULL) - { - best_audio = ((asf_http_streaming_ctrl_t *)demuxer->stream->streaming_ctrl->data)->audio_id; - best_video = ((asf_http_streaming_ctrl_t *)demuxer->stream->streaming_ctrl->data)->video_id; - } - } - else -#endif - for (i = 0; i < stream_count; i++) - { - uint32_t id = streams[2 * i]; - uint32_t rate = streams[2 * i + 1]; - if (demuxer->v_streams[id] && rate > vr) - { - vr = rate; - best_video = id; - } - else if (demuxer->a_streams[id] && rate > ar) - { - ar = rate; - best_audio = id; - } - } -#endif - free(streams); - streams = NULL; - } - - mp_msg(MSGT_HEADER, MSGL_V, "ASF: %d audio and %d video streams found\n", audio_streams, video_streams); - if (!audio_streams) demuxer->audio->id = -2; // nosound - else if (best_audio > 0 && demuxer->audio->id == -1) demuxer->audio->id = best_audio; - if (!video_streams) - { - if (!audio_streams) - { - mp_msg(MSGT_HEADER, MSGL_ERR, MSGTR_MPDEMUX_ASFHDR_AudioVideoHeaderNotFound); - return 0; - } - demuxer->video->id = -2; // audio-only - } - else if (best_video > 0 && demuxer->video->id == -1) demuxer->video->id = best_video; - -#if 0 - if (mp_msg_test(MSGT_HEADER, MSGL_V)) - { - printf("ASF duration: %d\n", (int)fileh.duration); - printf("ASF start pts: %d\n", (int)fileh.start_timestamp); - printf("ASF end pts: %d\n", (int)fileh.end_timestamp); - } -#endif - - return 1; - -len_err_out: - mp_msg(MSGT_HEADER, MSGL_FATAL, MSGTR_MPDEMUX_ASFHDR_InvalidLengthInASFHeader); -err_out: - if (hdr) free(hdr); - if (streams) free(streams); - return 0; -} diff --git a/libeplayer2/container/avi.c b/libeplayer2/container/avi.c deleted file mode 100644 index e3114cb..0000000 --- a/libeplayer2/container/avi.c +++ /dev/null @@ -1,2050 +0,0 @@ -// AVI file parser for DEMUXER v2.9 by A'rpi/ESP-team - -#include -#include -#include -#include -#include -#include -#undef memcpy -#include - -#include -#include -#include -#include -#include - -#include "stream.h" -#include "demuxer.h" -#include "stheader.h" -#include "aviheader.h" - -#ifdef DEBUG -int demux_avi_debug = 0; -#define demux_avi_printf(x...) do { if (demux_avi_debug)printf(x); } while (0) -#endif - -static const char FILENAME[] = "avi.c"; - -pthread_mutex_t AVImutex; - -void getAVIMutex(const char *filename, const char *function, int line) // FIXME: Use one central getMutex and pass the mutex into the function -{ -#ifdef DEBUG -// printf("%s::%s::%d requesting mutex\n",filename, function, line); -#endif - - pthread_mutex_lock(&AVImutex); - -#ifdef DEBUG -// printf("%s::%s::%d received mutex\n",filename, function, line); -#endif -} - -void releaseAVIMutex(const char *filename, const char *function, int line) // FIXME: Use one central getMutex and pass the mutex into the function -{ - pthread_mutex_unlock(&AVImutex); - -#ifdef DEBUG -// printf("%s::%s::%d released mutex\n",filename, function, line); -#endif -} - -demuxer_t *init_avi_with_ogg(demuxer_t *demuxer); -int demux_ogg_open(demuxer_t *demuxer); - -// PTS: 0=interleaved 1=BPS-based -int pts_from_bps = 1; - -// Select ds from ID -demux_stream_t *demux_avi_select_stream(demuxer_t *demux, unsigned int id) -{ - - int stream_id = avi_stream_id(id); -#ifdef DEBUG - demux_avi_printf("%s::%d id=%u stream_id=%d\n", __FUNCTION__, __LINE__, id, stream_id); -#endif - - if (demux->video->id == -1) - if (demux->v_streams[stream_id]) - demux->video->id = stream_id; - - if (demux->audio->id == -1) - if (demux->a_streams[stream_id]) - demux->audio->id = stream_id; - - if (stream_id == demux->audio->id) - { - if (!demux->audio->sh) - { - sh_audio_t *sh; - avi_priv_t *priv = demux->priv; - sh = demux->audio->sh = demux->a_streams[stream_id]; - -#ifdef DEBUG - demux_avi_printf("Auto-selected AVI audio ID = %d\n", demux->audio->id); -#endif - - if (sh->wf) - { - priv->audio_block_size = sh->wf->nBlockAlign; - if (!priv->audio_block_size) - { - // for PCM audio we can calculate the blocksize: - if (sh->format == 1) - priv->audio_block_size = sh->wf->nChannels * (sh->wf->wBitsPerSample / 8); - else - priv->audio_block_size = 1; // hope the best... - } - else - { - // workaround old mencoder's bug: - if (sh->audio.dwSampleSize == 1 && sh->audio.dwScale == 1 && - (sh->wf->nBlockAlign == 1152 || sh->wf->nBlockAlign == 576)) - { - -#ifdef DEBUG - demux_avi_printf("WorkAroundBlockAlignHeaderBug\n"); -#endif - - priv->audio_block_size = 1; - } - } - } - else - { - priv->audio_block_size = sh->audio.dwSampleSize; - } - } - return demux->audio; - } - if (stream_id == demux->video->id) - { - if (!demux->video->sh) - { - demux->video->sh = demux->v_streams[stream_id]; - -#ifdef DEBUG - demux_avi_printf("Auto-selected AVI video ID = %d\n", demux->video->id); -#endif - } - return demux->video; - } - if (id != mmioFOURCC('J', 'U', 'N', 'K')) - { - // unknown - -#ifdef DEBUG - demux_avi_printf("Unknown chunk: %.4s (%X)\n", (char *) &id, id); -#endif - - //abort(); - } - return NULL; -} - -static int valid_fourcc(unsigned int id) -{ -#ifdef DEBUG - printf("log demux_avi 2\n"); -#endif - - static const char valid[] = "0123456789abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ_"; - unsigned char *fcc = (unsigned char *)(&id); - return strchr(valid, fcc[0]) && strchr(valid, fcc[1]) && - strchr(valid, fcc[2]) && strchr(valid, fcc[3]); -} - -static int choose_chunk_len(unsigned int len1, unsigned int len2) -{ - printf("log demux_avi 3\n"); - // len1 has a bit more priority than len2. len1!=len2 - // Note: this is a first-idea-logic, may be wrong. comments welcomed. - - // prefer small frames rather than 0 - if (!len1) return (len2 > 0x80000) ? len1 : len2; - if (!len2) return (len1 > 0x100000) ? len2 : len1; - - // choose the smaller value: - return (len1 < len2) ? len1 : len2; -} - -static int demux_avi_read_packet(demuxer_t *demux, demux_stream_t *ds, unsigned int id, unsigned int len, int idxpos, int flags) -{ -#ifdef DEBUG - demux_avi_printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - avi_priv_t *priv = demux->priv; - int skip; - float pts = 0; - -#ifdef DEBUG - demux_avi_printf("demux_avi.read_packet: %X\n", id); -#endif - - if (ds == demux->audio) - { - if (priv->pts_corrected == 0) - { - if (priv->pts_has_video) - { - // we have video pts now - float delay = 0; - if (((sh_audio_t *)(ds->sh))->wf->nAvgBytesPerSec) - delay = (float)priv->pts_corr_bytes / ((sh_audio_t *)(ds->sh))->wf->nAvgBytesPerSec; - -#ifdef DEBUG - printf("XXX initial v_pts=%5.3f a_pos=%d (%5.3f) \n", priv->avi_audio_pts, priv->pts_corr_bytes, delay); -#endif - - //priv->pts_correction=-priv->avi_audio_pts+delay; - priv->pts_correction = delay - priv->avi_audio_pts; - //priv->avi_audio_pts+=priv->pts_correction; - priv->pts_corrected = 1; - } - else - priv->pts_corr_bytes += len; - } - if (pts_from_bps) - { - pts = priv->audio_block_no * - (float)((sh_audio_t *)demux->audio->sh)->audio.dwScale / - (float)((sh_audio_t *)demux->audio->sh)->audio.dwRate; - } - else - pts = priv->avi_audio_pts; //+priv->pts_correction; - priv->avi_audio_pts = 0; - // update blockcount: - priv->audio_block_no += priv->audio_block_size ? - ((len + priv->audio_block_size - 1) / priv->audio_block_size) : 1; - } - else if (ds == demux->video) - { - // video - if (priv->skip_video_frames > 0) - { - // drop frame (seeking) - --priv->skip_video_frames; - ds = NULL; - } - - pts = priv->avi_video_pts = priv->video_pack_no * - (float)((sh_video_t *)demux->video->sh)->video.dwScale / - (float)((sh_video_t *)demux->video->sh)->video.dwRate; - - priv->avi_audio_pts = priv->avi_video_pts + priv->pts_correction; - priv->pts_has_video = 1; - - if (ds) ++priv->video_pack_no; - - } - - skip = (len + 1) & (~1); // total bytes in this chunk - -#ifdef DEBUG - demux_avi_printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - if (ds) - { -#ifdef DEBUG - demux_avi_printf("DEMUX_AVI: Read %d data bytes from packet %04X\n", len, id); -#endif - - ds_read_packet(ds, demux->stream, len, pts, idxpos, flags); - skip -= len; - } - skip = FFMAX(skip, 0); - if (avi_stream_id(id) > 99 && id != mmioFOURCC('J', 'U', 'N', 'K')) - skip = FFMIN(skip, 65536); - if (skip) - { -#ifdef DEBUG - demux_avi_printf("DEMUX_AVI: Skipping %d bytes from packet %04X\n", skip, id); -#endif - - stream_skip(demux->stream, skip); - } - return ds ? 1 : 0; -} - -static uint32_t avi_find_id(stream_t *stream) -{ - uint32_t id = stream_read_dword_le(stream); - if (!id) - { -#ifdef DEBUG - demux_avi_printf("Incomplete stream? Trying resync.\n"); -#endif - - do - { - id = stream_read_dword_le(stream); - if (stream_eof(stream)) return 0; - } - while (avi_stream_id(id) > 99); - } - return id; -} - -// return value: -// 0 = EOF or no stream found -// 1 = successfully read a packet -static int demux_avi_fill_buffer(demuxer_t *demux, demux_stream_t *dsds) -{ -//printf("%s::%d\n", __FUNCTION__, __LINE__); - avi_priv_t *priv = demux->priv; - unsigned int id = 0; - unsigned int len; - int ret = 0; - demux_stream_t *ds; - - do - { - int flags = 1; - AVIINDEXENTRY *idx = NULL; - if (priv->idx_size > 0 && priv->idx_pos < priv->idx_size) - { - off_t pos; - - idx = &((AVIINDEXENTRY *)priv->idx)[priv->idx_pos++]; - - if (idx->dwFlags & AVIIF_LIST) - { - // LIST - continue; - } -//printf("%s::%d\n", __FUNCTION__, __LINE__); - if (!demux_avi_select_stream(demux, idx->ckid)) - { -#ifdef DEBUG - demux_avi_printf("Skip chunk %.4s (0x%X) \n", (char *)&idx->ckid, (unsigned int)idx->ckid); -#endif - - continue; // skip this chunk - } -//printf("%s::%d\n", __FUNCTION__, __LINE__); - pos = (off_t)priv->idx_offset + AVI_IDX_OFFSET(idx); - if ((pos < demux->movi_start || pos >= demux->movi_end) && (demux->movi_end > demux->movi_start) && (demux->stream->flags & STREAM_SEEK)) - { -#ifdef DEBUG - demux_avi_printf("ChunkOffset out of range! idx=0x%"PRIX64" \n", (int64_t)pos); -#endif - - continue; - } - stream_seek(demux->stream, pos); - demux->filepos = stream_tell(demux->stream); - -//printf("%s::%d %u %u\n", __FUNCTION__, __LINE__, pos, demux->filepos); - - id = stream_read_dword_le(demux->stream); -//printf("%s::%d\n", __FUNCTION__, __LINE__); - if (stream_eof(demux->stream)) return 0; // EOF! -//printf("%s::%d\n", __FUNCTION__, __LINE__); - - if (id != idx->ckid) - { -#ifdef DEBUG - demux_avi_printf("ChunkID mismatch! raw=%.4s idx=%.4s \n", (char *)&id, (char *)&idx->ckid); -#endif - - if (valid_fourcc(idx->ckid)) - id = idx->ckid; // use index if valid - else if (!valid_fourcc(id)) continue; // drop chunk if both id and idx bad - } - len = stream_read_dword_le(demux->stream); - if ((len != idx->dwChunkLength) && ((len + 1) != idx->dwChunkLength)) - { -#ifdef DEBUG - demux_avi_printf("ChunkSize mismatch! raw=%d idx=%d \n", len, idx->dwChunkLength); -#endif - - if (len > 0x200000 && idx->dwChunkLength > 0x200000) continue; // both values bad :( - len = choose_chunk_len(idx->dwChunkLength, len); - } - if (!(idx->dwFlags & AVIIF_KEYFRAME)) flags = 0; - } - else - { - demux->filepos = stream_tell(demux->stream); - if (demux->filepos >= demux->movi_end && demux->movi_end > demux->movi_start && (demux->stream->flags & STREAM_SEEK)) - { - demux->stream->eof = 1; - return 0; - } - id = avi_find_id(demux->stream); - len = stream_read_dword_le(demux->stream); - if (stream_eof(demux->stream)) return 0; // EOF! - - if (id == mmioFOURCC('L', 'I', 'S', 'T') || id == mmioFOURCC('R', 'I', 'F', 'F')) - { - id = stream_read_dword_le(demux->stream); // list or RIFF type - continue; - } - } -//printf("%s::%d\n", __FUNCTION__, __LINE__); - ds = demux_avi_select_stream(demux, id); -//printf("%s::%d\n", __FUNCTION__, __LINE__); - if (ds) - if (ds->packs + 1 >= MAX_PACKS || ds->bytes + len >= MAX_PACK_BYTES) - { - // this packet will cause a buffer overflow, switch to -ni mode!!! -#ifdef DEBUG - demux_avi_printf("SwitchToNi\n"); -#endif - - if (priv->idx_size > 0) - { - // has index - //demux->type=DEMUXER_TYPE_AVI_NI; - //demux->desc=&demuxer_desc_avi_ni; - --priv->idx_pos; // hack - } - else - { - // no index - //demux->type=DEMUXER_TYPE_AVI_NINI; - //demux->desc=&demuxer_desc_avi_nini; - priv->idx_pos = demux->filepos; // hack - } - priv->idx_pos_v = priv->idx_pos_a = priv->idx_pos; - // quit now, we can't even (no enough buffer memory) read this packet :( - return -1; - } - -//printf("%s::%d\n", __FUNCTION__, __LINE__); - ret = demux_avi_read_packet(demux, ds, id, len, priv->idx_pos - 1, flags); - } - while (ret != 1); - return 1; -} - - -// return value: -// 0 = EOF or no stream found -// 1 = successfully read a packet -int demux_avi_fill_buffer_ni(demuxer_t *demux, demux_stream_t *ds) -{ - printf("log demux_avi 7\n"); - avi_priv_t *priv = demux->priv; - unsigned int id = 0; - unsigned int len; - int ret = 0; - - do - { - int flags = 1; - AVIINDEXENTRY *idx = NULL; - int idx_pos = 0; - demux->filepos = stream_tell(demux->stream); - - if (ds == demux->video) idx_pos = priv->idx_pos_v++; - else if (ds == demux->audio) idx_pos = priv->idx_pos_a++; - else - idx_pos = priv->idx_pos++; - -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - if (priv->idx_size > 0 && idx_pos < priv->idx_size) - { - off_t pos; - idx = &((AVIINDEXENTRY *)priv->idx)[idx_pos]; - - if (idx->dwFlags & AVIIF_LIST) - { - // LIST - continue; - } - if (ds && demux_avi_select_stream(demux, idx->ckid) != ds) - { -#ifdef DEBUG - demux_avi_printf("Skip chunk %.4s (0x%X) \n", (char *)&idx->ckid, (unsigned int)idx->ckid); -#endif - - continue; // skip this chunk - } - - pos = priv->idx_offset + AVI_IDX_OFFSET(idx); - if ((pos < demux->movi_start || pos >= demux->movi_end) && (demux->movi_end > demux->movi_start)) - { -#ifdef DEBUG - demux_avi_printf("ChunkOffset out of range! current=0x%"PRIX64" idx=0x%"PRIX64" \n", (int64_t)demux->filepos, (int64_t)pos); -#endif - - continue; - } - stream_seek(demux->stream, pos); - - id = stream_read_dword_le(demux->stream); - - if (stream_eof(demux->stream)) return 0; - - if (id != idx->ckid) - { -#ifdef DEBUG - demux_avi_printf("ChunkID mismatch! raw=%.4s idx=%.4s \n", (char *)&id, (char *)&idx->ckid); -#endif - - if (valid_fourcc(idx->ckid)) - id = idx->ckid; // use index if valid - else if (!valid_fourcc(id)) continue; // drop chunk if both id and idx bad - } - len = stream_read_dword_le(demux->stream); - if ((len != idx->dwChunkLength) && ((len + 1) != idx->dwChunkLength)) - { -#ifdef DEBUG - demux_avi_printf("ChunkSize mismatch! raw=%d idx=%d \n", len, idx->dwChunkLength); -#endif - - if (len > 0x200000 && idx->dwChunkLength > 0x200000) continue; // both values bad :( - len = choose_chunk_len(idx->dwChunkLength, len); - } - if (!(idx->dwFlags & AVIIF_KEYFRAME)) flags = 0; - } - else return 0; - -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - ret = demux_avi_read_packet(demux, demux_avi_select_stream(demux, id), id, len, idx_pos, flags); - } - while (ret != 1); - return 1; -} - - -// return value: -// 0 = EOF or no stream found -// 1 = successfully read a packet -int demux_avi_fill_buffer_nini(demuxer_t *demux, demux_stream_t *ds) -{ -#ifdef DEBUG - printf("log demux_avi 8\n"); -#endif - - avi_priv_t *priv = demux->priv; - unsigned int id = 0; - unsigned int len; - int ret = 0; - off_t *fpos = NULL; - - if (ds == demux->video) fpos = &priv->idx_pos_v; - else if (ds == demux->audio) fpos = &priv->idx_pos_a; - else - return 0; - - stream_seek(demux->stream, fpos[0]); - - do - { - - demux->filepos = stream_tell(demux->stream); - if (demux->filepos >= demux->movi_end && (demux->movi_end > demux->movi_start)) - { - ds->eof = 1; - return 0; - } - - id = avi_find_id(demux->stream); - len = stream_read_dword_le(demux->stream); - - if (stream_eof(demux->stream)) return 0; - - if (id == mmioFOURCC('L', 'I', 'S', 'T')) - { - id = stream_read_dword_le(demux->stream); // list type - continue; - } - - if (id == mmioFOURCC('R', 'I', 'F', 'F')) - { -#ifdef DEBUG - demux_avi_printf("additional RIFF header...\n"); -#endif - - id = stream_read_dword_le(demux->stream); // "AVIX" - continue; - } - -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - if (ds == demux_avi_select_stream(demux, id)) - { - // read it! - ret = demux_avi_read_packet(demux, ds, id, len, priv->idx_pos - 1, 0); - } - else - { - // skip it! - int skip = (len + 1) & (~1); // total bytes in this chunk - stream_skip(demux->stream, skip); - } - -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - } - while (ret != 1); - fpos[0] = stream_tell(demux->stream); - return 1; -} - -// AVI demuxer parameters: -int index_mode = -1; // -1=untouched 0=don't use index 1=use (generate) index -char *index_file_save = NULL, *index_file_load = NULL; -int force_ni = 0; // force non-interleaved AVI parsing - -void read_avi_header(demuxer_t *demuxer, int index_mode); -/* konfetti: next removed from signature because the descr structure - * has only one parameter. - * ->see demuxer.h - */ -static demuxer_t *demux_open_avi(demuxer_t *demuxer) -{ -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - demux_stream_t *d_audio = demuxer->audio; - demux_stream_t *d_video = demuxer->video; - sh_audio_t *sh_audio = NULL; - sh_video_t *sh_video = NULL; - avi_priv_t *priv = malloc(sizeof(avi_priv_t)); - - // priv struct: - priv->avi_audio_pts = priv->avi_video_pts = 0.0f; - priv->pts_correction = 0.0f; - priv->skip_video_frames = 0; - priv->pts_corr_bytes = 0; - priv->pts_has_video = priv->pts_corrected = 0; - priv->video_pack_no = 0; - priv->audio_block_no = 0; - priv->audio_block_size = 0; - priv->isodml = 0; - priv->suidx_size = 0; - priv->suidx = NULL; - priv->duration = 0; - - demuxer->priv = (void *)priv; - - //---- AVI header: - read_avi_header(demuxer, (demuxer->stream->flags & STREAM_SEEK_BW) ? index_mode : -2); - - if (demuxer->audio->id >= 0 && !demuxer->a_streams[demuxer->audio->id]) - { -#ifdef DEBUG - demux_avi_printf("InvalidAudioStreamNosound %p\n", demuxer->audio->id); -#endif - - demuxer->audio->id = -2; // disabled - } - if (demuxer->video->id >= 0 && !demuxer->v_streams[demuxer->video->id]) - { -#ifdef DEBUG - demux_avi_printf("InvalidAudioStreamUsingDefault %p\n", demuxer->video->id); -#endif - - demuxer->video->id = -1; // autodetect - } - -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - stream_reset(demuxer->stream); - -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - stream_seek(demuxer->stream, demuxer->movi_start); - -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - priv->idx_pos = 0; - priv->idx_pos_a = 0; - priv->idx_pos_v = 0; - if (priv->idx_size > 1) - { - // decide index format: -#if 1 - if ((AVI_IDX_OFFSET(&((AVIINDEXENTRY *)priv->idx)[0]) < demuxer->movi_start || - AVI_IDX_OFFSET(&((AVIINDEXENTRY *)priv->idx)[1]) < demuxer->movi_start) && !priv->isodml) - priv->idx_offset = demuxer->movi_start - 4; - else - priv->idx_offset = 0; -#else - if (AVI_IDX_OFFSET(&((AVIINDEXENTRY *)priv->idx)[0]) < demuxer->movi_start) - priv->idx_offset = demuxer->movi_start - 4; - else - priv->idx_offset = 0; -#endif - -#ifdef DEBUG - demux_avi_printf("AVI index offset: 0x%X (movi=0x%X idx0=0x%X idx1=0x%X)\n", - (int)priv->idx_offset, (int)demuxer->movi_start, - (int)((AVIINDEXENTRY *)priv->idx)[0].dwChunkOffset, - (int)((AVIINDEXENTRY *)priv->idx)[1].dwChunkOffset); -#endif - } - - if (priv->idx_size > 0) - { - // check that file is non-interleaved: - int i; - off_t a_pos = -1; - off_t v_pos = -1; - for (i = 0; i < priv->idx_size; i++) - { - AVIINDEXENTRY *idx = &((AVIINDEXENTRY *)priv->idx)[i]; - demux_stream_t *ds = demux_avi_select_stream(demuxer, idx->ckid); - off_t pos = priv->idx_offset + AVI_IDX_OFFSET(idx); - if (a_pos == -1 && ds == demuxer->audio) - { - a_pos = pos; - if (v_pos != -1) break; - } - if (v_pos == -1 && ds == demuxer->video) - { - v_pos = pos; - if (a_pos != -1) break; - } - } - if (v_pos == -1) - { -#ifdef DEBUG - demux_avi_printf("AVI_NI: MissingVideoStream\n"); -#endif - - return NULL; - } - if (a_pos == -1) - { - d_audio->sh = sh_audio = NULL; - } - else - { - if (force_ni || abs(a_pos - v_pos) > 0x100000) // distance > 1MB - { - //mp_msg(MSGT_DEMUX,MSGL_INFO,MSGTR_NI_Message,force_ni?MSGTR_NI_Forced:MSGTR_NI_Detected); - //demuxer->type=DEMUXER_TYPE_AVI_NI; // HACK!!!! - //demuxer->desc=&demuxer_desc_avi_ni; // HACK!!!! - pts_from_bps = 1; // force BPS sync! - } - } - } - else - { - // no index - if (force_ni) - { -#ifdef DEBUG - demux_avi_printf("UsingNINI\n"); -#endif - - //demuxer->type=DEMUXER_TYPE_AVI_NINI; // HACK!!!! - //demuxer->desc=&demuxer_desc_avi_nini; // HACK!!!! - priv->idx_pos_a = - priv->idx_pos_v = demuxer->movi_start; - pts_from_bps = 1; // force BPS sync! - } - demuxer->seekable = 0; - } - -#ifdef DEBUG - demux_avi_printf("%s::%d packs=%u\n", __FUNCTION__, __LINE__, d_video->packs); -#endif - -#ifdef buggy - if (next == 0) - { - if (!ds_fill_buffer(d_video)) - { -#ifdef DEBUG - demux_avi_printf("AVI: MissingVideoStreamBug\n"); -#endif - - return NULL; - } - } - else if (next == 1) - { - if (!ds_fill_buffer2(d_video, demuxer)) - { -#ifdef DEBUG - demux_avi_printf("AVI: MissingVideoStreamBug\n"); -#endif - - return NULL; - } - } -#else - /* konfetti: dont know the meaning of ds_fill_buffer2 but - * the second parameter is wrong in the call above. mplayer - * does not need this 2nd function so I remove it here since - * someone can explain the what it is for! - */ - if (!ds_fill_buffer(d_video)) - { -#ifdef DEBUG - demux_avi_printf("AVI: MissingVideoStreamBug\n"); -#endif - - return NULL; - } -#endif -#ifdef DEBUG - demux_avi_printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - sh_video = d_video->sh; - sh_video->ds = d_video; - if (d_audio->id != -2) - { -#ifdef DEBUG - demux_avi_printf("AVI: Searching for audio stream (id:%d)\n", d_audio->id); -#endif - -#ifdef buggy - if (next == 0) - { - if (!priv->audio_streams || !ds_fill_buffer(d_audio)) - { -#ifdef DEBUG - demux_avi_printf("AVI: MissingAudioStream\n"); -#endif - - d_audio->sh = sh_audio = NULL; - } - else - { - sh_audio = d_audio->sh; - sh_audio->ds = d_audio; - } - } - else if (next == 1) - { - if (!priv->audio_streams || !ds_fill_buffer2(d_audio, demuxer)) - { -#ifdef DEBUG - demux_avi_printf("AVI: MissingAudioStream\n"); -#endif - - d_audio->sh = sh_audio = NULL; - } - else - { - sh_audio = d_audio->sh; - sh_audio->ds = d_audio; - } - } -#else - /* konfetti: dont know the meaning of ds_fill_buffer2 but - * the second parameter is wrong in the call above. mplayer - * does not need this 2nd function so I remove it here since - * someone can explain the what it is for! - */ - if (!priv->audio_streams || !ds_fill_buffer(d_audio)) - { -#ifdef DEBUG - demux_avi_printf("AVI: MissingAudioStream\n"); -#endif - - d_audio->sh = sh_audio = NULL; - } - else - { - sh_audio = d_audio->sh; - sh_audio->ds = d_audio; - } -#endif - } - -#ifdef DEBUG - demux_avi_printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - // calculating audio/video bitrate: - if (priv->idx_size > 0) - { - // we have index, let's count 'em! - int64_t vsize = 0; - int64_t asize = 0; - size_t vsamples = 0; - size_t asamples = 0; - int i; - for (i = 0; i < priv->idx_size; i++) - { - int id = avi_stream_id(((AVIINDEXENTRY *)priv->idx)[i].ckid); - int len = ((AVIINDEXENTRY *)priv->idx)[i].dwChunkLength; - if (sh_video->ds->id == id) - { - vsize += len; - ++vsamples; - } - else if (sh_audio && sh_audio->ds->id == id) - { - asize += len; - asamples += (len + priv->audio_block_size - 1) / priv->audio_block_size; - } - } - -#ifdef DEBUG - demux_avi_printf("AVI video size=%"PRId64" (%u) audio size=%"PRId64" (%u)\n", vsize, vsamples, asize, asamples); -#endif - - priv->numberofframes = vsamples; - sh_video->i_bps = ((float)vsize / (float)vsamples) * (float)sh_video->video.dwRate / (float)sh_video->video.dwScale; - if (sh_audio) sh_audio->i_bps = ((float)asize / (float)asamples) * (float)sh_audio->audio.dwRate / (float)sh_audio->audio.dwScale; - } - else - { - // guessing, results may be inaccurate: - int64_t vsize; - int64_t asize = 0; - - if ((priv->numberofframes = sh_video->video.dwLength) <= 1) - // bad video header, try to get number of frames from audio - if (sh_audio && sh_audio->wf->nAvgBytesPerSec) priv->numberofframes = sh_video->fps * sh_audio->audio.dwLength / sh_audio->audio.dwRate * sh_audio->audio.dwScale; - if (priv->numberofframes <= 1) - { -#ifdef DEBUG - demux_avi_printf("CouldntDetFNo\n"); -#endif - - priv->numberofframes = 0; - } - - if (sh_audio) - { - if (sh_audio->wf->nAvgBytesPerSec && sh_audio->audio.dwSampleSize != 1) - { - asize = (float)sh_audio->wf->nAvgBytesPerSec * sh_audio->audio.dwLength * sh_audio->audio.dwScale / sh_audio->audio.dwRate; - } - else - { - asize = sh_audio->audio.dwLength; - sh_audio->i_bps = (float)asize / (sh_video->frametime * priv->numberofframes); - } - } - vsize = demuxer->movi_end - demuxer->movi_start - asize - 8 * priv->numberofframes; - -#ifdef DEBUG - demux_avi_printf("AVI video size=%"PRId64" (%u) audio size=%"PRId64"\n", vsize, priv->numberofframes, asize); -#endif - - sh_video->i_bps = (float)vsize / (sh_video->frametime * priv->numberofframes); - } - - return demuxer; - -} - -static int whileSeeking = 0; - -void demux_seek_avi(demuxer_t *demuxer, float rel_seek_secs, float audio_delay, int flags) -{ - avi_priv_t *priv = demuxer->priv; - demux_stream_t *d_audio = demuxer->audio; - demux_stream_t *d_video = demuxer->video; - sh_audio_t *sh_audio = d_audio->sh; - sh_video_t *sh_video = d_video->sh; -#ifdef DEBUG - float skip_audio_secs = 0; -#endif - audio_delay = priv->pts_correction; - -#ifdef DEBUG - printf("\n\n seek:%f %f\n\n", rel_seek_secs, audio_delay); -#endif - - //FIXME: OFF_T - Didn't check AVI case yet (avi files can't be >2G anyway?) - //================= seek in AVI ========================== - int rel_seek_frames = rel_seek_secs * sh_video->fps; - int video_chunk_pos = priv->idx_pos; - int i; - - whileSeeking = 1; - getAVIMutex(FILENAME, __FUNCTION__, __LINE__); - - if (flags & SEEK_ABSOLUTE) - { - // seek absolute - video_chunk_pos = 0; - } - - if (flags & SEEK_FACTOR) - { - rel_seek_frames = rel_seek_secs * priv->numberofframes; - } - - priv->skip_video_frames = 0; - priv->avi_audio_pts = 0; - -// ------------ STEP 1: find nearest video keyframe chunk ------------ - // find nearest video keyframe chunk pos: - if (rel_seek_frames > 0) - { - // seek forward - while (video_chunk_pos < priv->idx_size - 1) - { - int id = ((AVIINDEXENTRY *)priv->idx)[video_chunk_pos].ckid; - if (avi_stream_id(id) == d_video->id) // video frame - { - if ((--rel_seek_frames) < 0 && ((AVIINDEXENTRY *)priv->idx)[video_chunk_pos].dwFlags & AVIIF_KEYFRAME) break; - } - ++video_chunk_pos; - } - } - else - { - // seek backward - while (video_chunk_pos > 0) - { - int id = ((AVIINDEXENTRY *)priv->idx)[video_chunk_pos].ckid; - if (avi_stream_id(id) == d_video->id) // video frame - { - if ((++rel_seek_frames) > 0 && ((AVIINDEXENTRY *)priv->idx)[video_chunk_pos].dwFlags & AVIIF_KEYFRAME) break; - } - --video_chunk_pos; - } - } - priv->idx_pos_a = priv->idx_pos_v = priv->idx_pos = video_chunk_pos; - // re-calc video pts: - d_video->pack_no = 0; - for (i = 0; i < video_chunk_pos; i++) - { - int id = ((AVIINDEXENTRY *)priv->idx)[i].ckid; - if (avi_stream_id(id) == d_video->id) ++d_video->pack_no; - } - priv->video_pack_no = - sh_video->num_frames = sh_video->num_frames_decoded = d_video->pack_no; - priv->avi_video_pts = d_video->pack_no * (float)sh_video->video.dwScale / (float)sh_video->video.dwRate; - d_video->pos = video_chunk_pos; - -#ifdef DEBUG - demux_avi_printf("V_SEEK: pack=%d pts=%5.3f chunk=%d \n", d_video->pack_no, priv->avi_video_pts, video_chunk_pos); -#endif - -// ------------ STEP 2: seek audio, find the right chunk & pos ------------ - - d_audio->pack_no = 0; - priv->audio_block_no = 0; - d_audio->dpos = 0; - - if (sh_audio) - { - int i; - int len = 0; - int skip_audio_bytes = 0; - int curr_audio_pos = -1; - int audio_chunk_pos = -1; - int chunk_max = (demuxer->type == DEMUXER_TYPE_AVI) ? video_chunk_pos : priv->idx_size; - - if (sh_audio->audio.dwSampleSize) - { - // constant rate audio stream - /* immediate seeking to audio position, including when streams are delayed */ - curr_audio_pos = (priv->avi_video_pts + audio_delay) * (float)sh_audio->audio.dwRate / (float)sh_audio->audio.dwScale; - curr_audio_pos *= sh_audio->audio.dwSampleSize; - - // find audio chunk pos: - for (i = 0; i < chunk_max; i++) - { - int id = ((AVIINDEXENTRY *)priv->idx)[i].ckid; - if (avi_stream_id(id) == d_audio->id) - { - len = ((AVIINDEXENTRY *)priv->idx)[i].dwChunkLength; - if (d_audio->dpos <= curr_audio_pos && curr_audio_pos < (d_audio->dpos + len)) - { - break; - } - ++d_audio->pack_no; - priv->audio_block_no += priv->audio_block_size ? - ((len + priv->audio_block_size - 1) / priv->audio_block_size) : 1; - d_audio->dpos += len; - } - } - audio_chunk_pos = i; - skip_audio_bytes = curr_audio_pos - d_audio->dpos; - -#ifdef DEBUG - demux_avi_printf("SEEK: i=%d (max:%d) dpos=%d (wanted:%d) \n", - i, chunk_max, (int)d_audio->dpos, curr_audio_pos); -#endif - - } - else - { - // VBR audio - /* immediate seeking to audio position, including when streams are delayed */ - int chunks = (priv->avi_video_pts + audio_delay) * (float)sh_audio->audio.dwRate / (float)sh_audio->audio.dwScale; - audio_chunk_pos = 0; - - // find audio chunk pos: - for (i = 0; i < priv->idx_size && chunks > 0; i++) - { - int id = ((AVIINDEXENTRY *)priv->idx)[i].ckid; - if (avi_stream_id(id) == d_audio->id) - { - len = ((AVIINDEXENTRY *)priv->idx)[i].dwChunkLength; - if (i > chunk_max) - { - skip_audio_bytes += len; - } - else - { - ++d_audio->pack_no; - priv->audio_block_no += priv->audio_block_size ? - ((len + priv->audio_block_size - 1) / priv->audio_block_size) : 1; - d_audio->dpos += len; - audio_chunk_pos = i; - } - if (priv->audio_block_size) - chunks -= (len + priv->audio_block_size - 1) / priv->audio_block_size; - } - } - } - - // Now we have: - // audio_chunk_pos = chunk no in index table (it's <=chunk_max) - // skip_audio_bytes = bytes to be skipped after chunk seek - // d-audio->pack_no = chunk_no in stream at audio_chunk_pos - // d_audio->dpos = bytepos in stream at audio_chunk_pos - // let's seek! - - // update stream position: - d_audio->pos = audio_chunk_pos; - - if (demuxer->type == DEMUXER_TYPE_AVI) - { - // interleaved stream: - if (audio_chunk_pos < video_chunk_pos) - { - // calc priv->skip_video_frames & adjust video pts counter: - for (i = audio_chunk_pos; i < video_chunk_pos; i++) - { - int id = ((AVIINDEXENTRY *)priv->idx)[i].ckid; - if (avi_stream_id(id) == d_video->id) ++priv->skip_video_frames; - } - // requires for correct audio pts calculation (demuxer): - priv->avi_video_pts -= priv->skip_video_frames * (float)sh_video->video.dwScale / (float)sh_video->video.dwRate; - priv->avi_audio_pts = priv->avi_video_pts; - // set index position: - priv->idx_pos_a = priv->idx_pos_v = priv->idx_pos = audio_chunk_pos; - } - } - else - { - // non-interleaved stream: - priv->idx_pos_a = audio_chunk_pos; - priv->idx_pos_v = video_chunk_pos; - priv->idx_pos = (audio_chunk_pos < video_chunk_pos) ? audio_chunk_pos : video_chunk_pos; - } - -#ifdef DEBUG - demux_avi_printf("SEEK: idx=%d (a:%d v:%d) v.skip=%d a.skip=%d/%4.3f \n", - (int)priv->idx_pos, audio_chunk_pos, video_chunk_pos, - (int)priv->skip_video_frames, skip_audio_bytes, skip_audio_secs); -#endif - - if (skip_audio_bytes) - { - demux_read_data(d_audio, NULL, skip_audio_bytes); - } - - } - d_video->pts = priv->avi_video_pts; // OSD - - releaseAVIMutex(FILENAME, __FUNCTION__, __LINE__); - whileSeeking = 0; -} - - -void demux_close_avi(demuxer_t *demuxer) -{ - avi_priv_t *priv = demuxer->priv; - - if (!priv) - return; - - if (priv->idx_size > 0) - free(priv->idx); - free(priv); -} - - -static int demux_avi_control(demuxer_t *demuxer, int cmd, void *arg) -{ -#ifdef DEBUG - demux_avi_printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - avi_priv_t *priv = demuxer->priv; - demux_stream_t *d_video = demuxer->video; - sh_video_t *sh_video = d_video->sh; - - switch (cmd) - { - case DEMUXER_CTRL_GET_TIME_LENGTH: - if (!priv->numberofframes || !sh_video) return DEMUXER_CTRL_DONTKNOW; - *((double *)arg) = (double)priv->numberofframes / sh_video->fps; - if (sh_video->video.dwLength <= 1) return DEMUXER_CTRL_GUESS; - return DEMUXER_CTRL_OK; - - case DEMUXER_CTRL_GET_PERCENT_POS: - if (!priv->numberofframes || !sh_video) - { - return DEMUXER_CTRL_DONTKNOW; - } - *((int *)arg) = (int)(priv->video_pack_no * 100 / priv->numberofframes); - if (sh_video->video.dwLength <= 1) return DEMUXER_CTRL_GUESS; - return DEMUXER_CTRL_OK; - - case DEMUXER_CTRL_SWITCH_AUDIO: - case DEMUXER_CTRL_SWITCH_VIDEO: - { - int audio = (cmd == DEMUXER_CTRL_SWITCH_AUDIO); - demux_stream_t *ds = audio ? demuxer->audio : demuxer->video; - void **streams = audio ? demuxer->a_streams : demuxer->v_streams; - int maxid = FFMIN(100, audio ? MAX_A_STREAMS : MAX_V_STREAMS); - int chunkid; - if (ds->id < -1) - return DEMUXER_CTRL_NOTIMPL; - - if (*(int *)arg >= 0) - ds->id = *(int *)arg; - else - { - int i; - for (i = 0; i < maxid; i++) - { - if (++ds->id >= maxid) ds->id = 0; - if (streams[ds->id]) break; - } - } - - chunkid = (ds->id / 10 + '0') | (ds->id % 10 + '0') << 8; - ds->sh = NULL; - if (!streams[ds->id]) // stream not available - ds->id = -1; - else - demux_avi_select_stream(demuxer, chunkid); - *(int *)arg = ds->id; - return DEMUXER_CTRL_OK; - } - - default: - return DEMUXER_CTRL_NOTIMPL; - } -} - - -static int avi_check_file(demuxer_t *demuxer) -{ -#ifdef DEBUG - printf("log demux_avi 13\n"); -#endif - - int id = stream_read_dword_le(demuxer->stream); // "RIFF" - - if ((id == mmioFOURCC('R', 'I', 'F', 'F')) || (id == mmioFOURCC('O', 'N', '2', ' '))) - { - stream_read_dword_le(demuxer->stream); //filesize - id = stream_read_dword_le(demuxer->stream); // "AVI " - if (id == formtypeAVI) - return DEMUXER_TYPE_AVI; - // "Samsung Digimax i6 PMP" crap according to bug 742 - if (id == mmioFOURCC('A', 'V', 'I', 0x19)) - return DEMUXER_TYPE_AVI; - if (id == mmioFOURCC('O', 'N', '2', 'f')) - { -#ifdef DEBUG - demux_avi_printf("ON2AviFormat\n"); -#endif - - return DEMUXER_TYPE_AVI; - } - } - - return 0; -} - - -static demuxer_t *demux_open_hack_avi(demuxer_t *demuxer) -{ -#ifdef DEBUG - printf("log demux_avi 14\n"); -#endif - - sh_audio_t *sh_a; - - demuxer = demux_open_avi(demuxer); - if (!demuxer) return NULL; // failed to open - sh_a = demuxer->audio->sh; - if (demuxer->audio->id != -2 && sh_a) - { -#ifdef CONFIG_OGGVORBIS - // support for Ogg-in-AVI: - if (sh_a->format == 0xFFFE) - demuxer = init_avi_with_ogg(demuxer); - else if (sh_a->format == 0x674F) - { - demuxer_t *od; - demuxer->stream = new_ds_stream(demuxer->audio); - od = new_demuxer(demuxer->stream, DEMUXER_TYPE_OGG, -1, -2, -2, NULL); - if (!demux_ogg_open(od)) - { -#ifdef DEBUG - demux_avi_printf("ErrorOpeningOGGDemuxer\n"); -#endif - - free_stream(demuxer->stream); - demuxer->audio->id = -2; - } - else - demuxer = new_demuxers_demuxer(demuxer, od, demuxer); - } -#endif - } - - return demuxer; -} -////////////////////////////////////////////////////////////////7 -////////////////////////////////////////////////////////////////7 - -#include "common.h" -#include "container.h" -#include "manager.h" -#include "utils.h" - -static demuxer_t *demuxer = NULL; -static demux_stream_t *ds = NULL; // dvd subtitle buffer/demuxer -static sh_audio_t *sh_audio = NULL; -static sh_video_t *sh_video = NULL; -static pthread_t PlayThread; -static int hasPlayThreadStarted = 0; - -static int isFirstAudioFrame = 1; - -demuxer_desc_t demuxer_desc_avi = -{ - "AVI demuxer", - "avi", - "AVI", - "Arpi?", - "AVI files, including non interleaved files", - DEMUXER_TYPE_AVI, - 1, // safe autodetect - avi_check_file, - demux_avi_fill_buffer, - demux_open_avi, - demux_close_avi, - demux_seek_avi, - demux_avi_control -}; - -//Trick: VID-3F.avi geht nicht! -// VID-3I.avi 720p stottert! -// VID-3J.avi 1080p not support! -int AviInit(Context_t *context, char *filename) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - getAVIMutex(FILENAME, __FUNCTION__, __LINE__); - - int ret = 0; - int i = 0; - int video_format = 0; - demuxer = (demuxer_t *)malloc(sizeof(demuxer_t)); - memset(demuxer, 0, sizeof(demuxer_t)); - - demuxer->audio = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(demuxer->audio, 0, sizeof(demux_stream_t)); - - demuxer->video = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(demuxer->video, 0, sizeof(demux_stream_t)); - - demuxer->sub = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(demuxer->sub, 0, sizeof(demux_stream_t)); - - ds = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(ds, 0, sizeof(demux_stream_t)); - -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - demuxer->stream = (stream_t *)malloc(sizeof(stream_t)); - memset(demuxer->stream, 0, sizeof(stream_t)); - /* demuxer->stream = (demux_stream_t*)malloc ( sizeof(demux_stream_t)); - memset (demuxer->stream,0,sizeof(demux_stream_t));*/ - -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - demuxer->stream->fd = context->playback->fd; - - read(demuxer->stream->fd, demuxer->stream->buffer, 2048); //soviel ?? - -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - demuxer->desc = &demuxer_desc_avi; - demuxer->audio->id = -1; - demuxer->video->id = -1; - //demuxer->video_play = 0; - demuxer->stream->start_pos = 0; - - if (context->playback->isFile) - { - demuxer->stream->type = STREAMTYPE_FILE; - long pos = lseek(demuxer->stream->fd, 0L, SEEK_CUR); - demuxer->stream->end_pos = lseek(demuxer->stream->fd, 0L, SEEK_END); - lseek(demuxer->stream->fd, pos, SEEK_SET); - } - else - { - demuxer->stream->type = STREAMTYPE_STREAM; - demuxer->stream->end_pos = 0; - } - - demuxer->stream->flags = 6; - demuxer->stream->sector_size = 0; - demuxer->stream->buf_pos = 0; - demuxer->stream->buf_len = 2048; - demuxer->stream->pos = 2048; - demuxer->stream->start_pos = 0; - demuxer->stream->eof = 0; - demuxer->stream->cache_pid = 0; - - ret = avi_check_file(demuxer); - if (ret == DEMUXER_TYPE_AVI) - { -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - demux_open_hack_avi(demuxer); - - if (demuxer->audio->sh == NULL) - { -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - demux_flush(demuxer); - demuxer->audio->id = -1; - demuxer->video->id = -1; - //demuxer->video_play = 0; - demuxer->stream->start_pos = 0; - - if (context->playback->isFile) - { - demuxer->stream->type = STREAMTYPE_FILE; - lseek(demuxer->stream->fd, 0L, SEEK_SET); - } - else - { - demuxer->stream->type = STREAMTYPE_STREAM; - } - - read(demuxer->stream->fd, demuxer->stream->buffer, 2048); //soviel ?? - demuxer->stream->flags = 6; - demuxer->stream->sector_size = 0; - demuxer->stream->buf_pos = 0; - demuxer->stream->buf_len = 2048; - demuxer->stream->pos = 2048; - demuxer->stream->start_pos = 0; - demuxer->stream->eof = 0; - demuxer->stream->cache_pid = 0; - demux_open_hack_avi(demuxer); - -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - } - if (demuxer->audio->sh != NULL) - { - sh_audio = demuxer->audio->sh; - -#ifdef DEBUG - printf("AUDIO 0x%02x\n", sh_audio->format); -#endif - - for (i = 0; i < MAX_A_STREAMS; i++) - { - if (demuxer->a_streams[i] == NULL)continue; - if (((sh_audio_t *)demuxer->a_streams[i])->format == 0x55) //mp3 - { - Track_t Audio = - { - "und", - "A_MPEG/L3", - ((sh_audio_t *)demuxer->a_streams[i])->aid, - }; - context->manager->audio->Command(context, MANAGER_ADD, &Audio); - } - else if (((sh_audio_t *)demuxer->a_streams[i])->format == 0x2000) //ac3 - { - Track_t Audio = - { - "und", - "A_AC3", - ((sh_audio_t *)demuxer->a_streams[i])->aid, - }; - context->manager->audio->Command(context, MANAGER_ADD, &Audio); - } - else if (((sh_audio_t *)demuxer->a_streams[i])->format == 0x2001) //dts - { - Track_t Audio = - { - "und", - "A_DTS", - ((sh_audio_t *)demuxer->a_streams[i])->aid, - }; - context->manager->audio->Command(context, MANAGER_ADD, &Audio); - } - } - - } - if (demuxer->video->sh != NULL) - { - sh_video = demuxer->video->sh; - -#ifdef DEBUG - printf("VIDEO 0x%02x\n", sh_video->format); -#endif - - video_format = le2me_32(sh_video->bih->biCompression); - -#ifdef DEBUG - printf("VIDEO: [%.4s] 0x%02x\n", (char *)&video_format, video_format); -#endif - - if (video_format == 0x3167706d) - { -#ifdef DEBUG - printf("VIDEOFORMAT = MPEG1 not support\n"); -#endif - - /*printf("VIDEOFORMAT = MPEG1\n"); - Track_t Video = { - "und", - "V_MPEG2", - 0, - }; - - context->manager->video->Command(context, MANAGER_ADD, &Video);*/ - } - else if (video_format == 0x33564944) // xvid: ob diese nummern alle in avi gibt ?? - { -#ifdef DEBUG - printf("VIDEOFORMAT = DIVX3 not support\n"); -#endif - } - else if (video_format == 0x44495658 || video_format == 0x30355844 || video_format == 0x3334504D || video_format == 0x3334706D || video_format == 0x35766964 - || video_format == 0x36564944 || video_format == 0x36766964 || video_format == 0x31345041 || video_format == 0x58564944 || video_format == 0x78766964 || video_format == 0x64697678) - { -#ifdef DEBUG - printf("VIDEOFORMAT = DIVX4/5 or XVID\n"); -#endif - - Track_t Video = - { - "und", - "V_MS/VFW/FOURCC", - 0, - }; - - context->manager->video->Command(context, MANAGER_ADD, &Video); - } - else if (video_format == 0x34363248 || video_format == 0x34363268) // h264 !!bei avi geht h264 über V_MPEG2!! - { -#ifdef DEBUG - printf("VIDEOFORMAT = H264\n"); -#endif - - Track_t Video = - { - "und", - "V_MPEG2/H264", - 0, - }; - - context->manager->video->Command(context, MANAGER_ADD, &Video); - } - } - - /*} else if (d->tracks[i] != NULL && d->tracks[i]->type == MATROSKA_TRACK_SUBTITLE) { - Track_t Subtitle = { - d->tracks[i]->language, - d->tracks[i]->codec_id, - i, - }; - context->manager->subtitle->Command(context, MANAGER_ADD, &Subtitle); - } - }*/ - - //select fist subtitle track as default: - /*int SubTrackID = 0; - context->manager->subtitle->Command(context, MANAGER_GET, &SubTrackID); - if (SubTrackID > 0) - demuxer->sub->id = mkv_d->tracks[SubTrackID]->tnum;*/ - - } - releaseAVIMutex(FILENAME, __FUNCTION__, __LINE__); - - return 0; // FIXME -} -void HexdumpAVI(unsigned char *Data, int length) -{ -#ifdef DEBUG - int k; - for (k = 0; k < length; k++) - { - printf("%02x ", Data[k]); - if (((k + 1) & 31) == 0) - printf("\n"); - } - - printf("\n"); -#endif -} -#define INVALID_PTS_VALUE 0x200000000ull -void AviGenerateParcel(Context_t *context, const demuxer_t *demuxer) -{ - const demux_stream_t *video = demuxer->video; - const demux_stream_t *audio = demuxer->audio; - unsigned long long int Pts = 0; - - if (audio->first != NULL) - { - demux_packet_t *current = audio->first; - if (!(current->flags & 0x1)) //current frame isn't a keyframe - { - //printf("\tNORMALFRAME, "); - Pts = INVALID_PTS_VALUE; - } - else - { - //printf("\tKEYFRAME, "); - Pts = (current->pts * 90000); - } - //printf("a current->pts=%f Pts=%llu\n", current->pts, Pts); - while (current != NULL) - { - //printf("AUDIODATA\n"); - //HexdumpAVI(current->buffer, current->len); - context->output->audio->Write(context, current->buffer, current->len, Pts, NULL, 0, 0, "audio"); - - isFirstAudioFrame = 0; - current = current->next; - Pts = INVALID_PTS_VALUE; - } - } - - if (video->first != NULL) - { - demux_packet_t *current = video->first; - if (!(current->flags & 0x1)) //current frame isn't a keyframe - { - //printf("\tNORMALFRAME, "); - Pts = INVALID_PTS_VALUE; - } - else - { - //printf("\tKEYFRAME, "); - Pts = (current->pts * 90000); - } - - //printf("v current->pts=%f Pts=%llu\n", current->pts, Pts); - MainAVIHeader aviHeader = getAVIHeader(); - while (current != NULL) - { - context->output->video->Write(context, current->buffer, current->len, Pts, 0, 0, aviHeader.dwMicroSecPerFrame, "video"); - - current = current->next; - Pts = INVALID_PTS_VALUE; - } - } -} - - - -static void AviThread(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - while (context && context->playback && context->playback->isCreationPhase) - { -#ifdef DEBUG - printf("%s::%s Thread waiting for end of init phase...\n", FILENAME, __FUNCTION__); -#endif - } - -#ifdef DEBUG - printf("%s::%s Running!\n", FILENAME, __FUNCTION__); -#endif - - isFirstAudioFrame = 1; - - while (context && context->playback && context->playback->isPlaying) - { - //printf("%s -->\n", __FUNCTION__); - - //IF AUDIO IS PAUSED, WAIT - if (context->playback->isPaused) - { -#ifdef DEBUG - printf("%s::%s paused\n", FILENAME, __FUNCTION__); -#endif - - usleep(100000); - continue; - } - - if (context->playback->isSeeking || whileSeeking) - { -#ifdef DEBUG - printf("%s::%s seeking\n", FILENAME, __FUNCTION__); -#endif - - usleep(100000); - continue; - } - - getAVIMutex(FILENAME, __FUNCTION__, __LINE__); - - if (!demux_avi_fill_buffer(demuxer, ds)) - { -#ifdef DEBUG - printf("%s::%s demux_avi_fill_buffer failed!\n", FILENAME, __FUNCTION__); -#endif - - releaseAVIMutex(FILENAME, __FUNCTION__, __LINE__); - - break; - } - else - { - AviGenerateParcel(context, demuxer); - - if (demuxer->sub != NULL && demuxer->sub->first != NULL) - { - ds_free_packs(demuxer->sub); - } - - if (demuxer->audio != NULL && demuxer->audio->first != NULL) - { - ds_free_packs(demuxer->audio); - } - - if (demuxer->video != NULL && demuxer->video->first != NULL) - { - ds_free_packs(demuxer->video); - } - //printf("%s <--\n", __FUNCTION__); - - releaseAVIMutex(FILENAME, __FUNCTION__, __LINE__); - } - } - - hasPlayThreadStarted = 0; - - context->playback->Command(context, PLAYBACK_TERM, NULL); - -#ifdef DEBUG - printf("%s::%s terminating\n", FILENAME, __FUNCTION__); -#endif -} - - -static int AviPlay(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int error; - int ret = 0; - pthread_attr_t attr; - - if (context && context->playback && context->playback->isPlaying) - { -#ifdef DEBUG - printf("%s::%s is Playing\n", FILENAME, __FUNCTION__); -#endif - } - else - { -#ifdef DEBUG - printf("%s::%s is NOT Playing\n", FILENAME, __FUNCTION__); -#endif - } - - if (hasPlayThreadStarted == 0) - { - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - - if ((error = pthread_create(&PlayThread, &attr, (void *)&AviThread, context)) != 0) - { -#ifdef DEBUG - printf("%s::%s Error creating thread, error:%d:%s\n", FILENAME, __FUNCTION__, error, strerror(error)); -#endif - - hasPlayThreadStarted = 0; - ret = -1; - } - else - { -#ifdef DEBUG - printf("%s::%s Created thread\n", FILENAME, __FUNCTION__); -#endif - hasPlayThreadStarted = 1; - } - } - else - { -#ifdef DEBUG - printf("%s::%s A thread already exists!\n", FILENAME, __FUNCTION__); -#endif - - ret = -1; - } - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -static int AviStop(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int i; - int ret = 0; - int wait_time = 20; - - while ((hasPlayThreadStarted != 0) && (--wait_time) > 0) - { -#ifdef DEBUG - printf("%s::%s Waiting for AVI thread to terminate itself, will try another %d times\n", FILENAME, __FUNCTION__, wait_time); -#endif - - usleep(100000); - } - - if (wait_time == 0) - { -#ifdef DEBUG - printf("%s::%s Timeout waiting for AVI thread!\n", FILENAME, __FUNCTION__); -#endif - - ret = -1; - } - else - { - getAVIMutex(FILENAME, __FUNCTION__, __LINE__); - - if (demuxer) - { - demux_close_avi(demuxer); - - free(demuxer->stream); - demuxer->stream = NULL; - - free(demuxer->sub); - demuxer->sub = NULL; - - free(demuxer->video); - demuxer->video = NULL; - - free(demuxer->audio); - demuxer->audio = NULL; - - for (i = 0; i < MAX_A_STREAMS; i++) - { - free(demuxer->a_streams[i]); - demuxer->a_streams[i] = NULL; - } - - for (i = 0; i < MAX_V_STREAMS; i++) - { - free(demuxer->v_streams[i]); - demuxer->v_streams[i] = NULL; - } - - for (i = 0; i < MAX_S_STREAMS; i++) - { - free(demuxer->s_streams[i]); - demuxer->s_streams[i] = NULL; - } - - free(demuxer); - demuxer = NULL; - } - - free(ds); - ds = NULL; - - releaseAVIMutex(FILENAME, __FUNCTION__, __LINE__); - } - -#ifdef DEBUG - printf("%s::%s exiting with %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -static int AviGetLength(demuxer_t *demuxer, double *length) -{ - - if (demuxer->priv) - { - avi_priv_t *priv = demuxer->priv; - - if (priv->duration == 0) - return -1; - - *((double *)length) = (double)priv->duration; - } - else - return -1; - - return 0; -} - -static int AviSwitchAudio(demuxer_t *demuxer, int *arg) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - getAVIMutex(FILENAME, __FUNCTION__, __LINE__); - - if (demuxer && demuxer->priv) - { - - //mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - - sh_audio_t *sh = demuxer->a_streams[demuxer->audio->id]; - int aid = *(int *)arg; - /*if (aid < 0) - aid = (sh->aid + 1) % mkv_d->last_aid; - if (aid != sh->aid) */ - { - -#ifdef DEBUG - printf("%s::%s track %d\n", FILENAME, __FUNCTION__, aid); -#endif - - demuxer->audio->id = aid; - sh = demuxer->a_streams[demuxer->audio->id]; - ds_free_packs(demuxer->audio); - } - // *(int*)arg = sh->aid; - } //else - // *(int*)arg = -2; - - releaseAVIMutex(FILENAME, __FUNCTION__, __LINE__); - - return 0; -} - -static int Command(void *_context, ContainerCmd_t command, void *argument) -{ - Context_t *context = (Context_t *) _context; -#ifdef DEBUG - printf("%s::%s Command %d\n", FILENAME, __FUNCTION__, command); -#endif - - int ret = 0; - - switch (command) - { - case CONTAINER_INIT: - { - char *FILENAME = (char *)argument; - ret = AviInit(context, FILENAME); - break; - } - case CONTAINER_PLAY: - { - ret = AviPlay(context); - break; - } - case CONTAINER_STOP: - { - ret = AviStop(context); - break; - } - case CONTAINER_SEEK: - { - demux_seek_avi(demuxer, (float) * ((float *)argument), 0.0, 0); - break; - } - case CONTAINER_LENGTH: - { - double length = 0; - if (demuxer != NULL && AviGetLength(demuxer, &length) != 0) - *((double *)argument) = (double)0; - else - *((double *)argument) = (double)length; - break; - } - case CONTAINER_SWITCH_AUDIO: - { - if (demuxer) - ret = AviSwitchAudio(demuxer, (int *) argument); - break; - } - default: - { -#ifdef DEBUG - printf("%s::%s ContainerCmd %d not supported!\n", FILENAME, __FUNCTION__, command); -#endif - - break; - } - } - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -static char *AviCapabilities[] = { "avi", NULL }; - -Container_t AviContainer = -{ - "AVI", - &Command, - AviCapabilities, - -}; diff --git a/libeplayer2/container/aviheader.c b/libeplayer2/container/aviheader.c deleted file mode 100644 index 80bb916..0000000 --- a/libeplayer2/container/aviheader.c +++ /dev/null @@ -1,870 +0,0 @@ - -#include -#include -#include -#include - -#include "utils.h" -#include "stream.h" -#include "demuxer.h" -#include "stheader.h" - -#include "aviheader.h" - - -int aviheader_debug = 1; -#define aviheader_printf(x...) do { if (aviheader_debug)printf(x); } while (0) - -char *index_file_save, *index_file_load; - -static MainAVIHeader avih; - -void print_avih(MainAVIHeader *h, int verbose_level); -void print_avih_flags(MainAVIHeader *h, int verbose_level); -void print_strh(AVIStreamHeader *h, int verbose_level); -void print_wave_header(WAVEFORMATEX *h, int verbose_level); -void print_video_header(BITMAPINFOHEADER *h, int verbose_level); -void print_index(AVIINDEXENTRY *idx, int idx_size, int verbose_level); -void print_avistdindex_chunk(avistdindex_chunk *h, int verbose_level); -void print_avisuperindex_chunk(avisuperindex_chunk *h, int verbose_level); -void print_vprp(VideoPropHeader *vprp, int verbose_level); - -MainAVIHeader getAVIHeader() -{ -return avih; -} - -static int odml_get_vstream_id(int id, unsigned char res[]) -{ - unsigned char *p = (unsigned char *)&id; - id = le2me_32(id); - - if (p[2] == 'd') - { - if (res) - { - res[0] = p[0]; - res[1] = p[1]; - } - return 1; - } - return 0; -} - -int avi_idx_cmp(const void *elem1, const void *elem2) -{ - register off_t a = AVI_IDX_OFFSET((AVIINDEXENTRY *)elem1); - register off_t b = AVI_IDX_OFFSET((AVIINDEXENTRY *)elem2); - return (a > b) - (b > a); -} - -void read_avi_header(demuxer_t *demuxer, int index_mode) -{ - sh_audio_t *sh_audio = NULL; - sh_video_t *sh_video = NULL; - int stream_id = -1; - int idxfix_videostream = 0; - int idxfix_divx = 0; - avi_priv_t *priv = demuxer->priv; - off_t list_end = 0; - -//---- AVI header: - priv->idx_size = 0; - priv->audio_streams = 0; - while (1) - { - int id = stream_read_dword_le(demuxer->stream); - unsigned chunksize, size2; - static int last_fccType = 0; - static int last_fccHandler = 0; - char *hdr = NULL; - // - if (stream_eof(demuxer->stream)) break; - // Imply -forceidx if -saveidx is specified - if (index_file_save) - index_mode = 2; - // - if (id == mmioFOURCC('L', 'I', 'S', 'T')) - { - unsigned len = stream_read_dword_le(demuxer->stream); // list size - id = stream_read_dword_le(demuxer->stream); // list type - aviheader_printf("LIST %.4s len=%u\n", (char *) &id, len); - if (len >= 4) - { - len -= 4; - list_end = stream_tell(demuxer->stream) + ((len + 1) & (~1)); - } - else - { - aviheader_printf("DEMUX_AVIHDR_EmptyList\n"); - list_end = 0; - } - aviheader_printf("list_end=0x%X\n", (int)list_end); - if (id == listtypeAVIMOVIE) - { - // found MOVI header - if (!demuxer->movi_start) demuxer->movi_start = stream_tell(demuxer->stream); - demuxer->movi_end = stream_tell(demuxer->stream) + len; - aviheader_printf("DEMUX_AVIHDR_FoundMovieAt 0x%x 0x%x\n", (int)demuxer->movi_start, (int)demuxer->movi_end); - if (demuxer->stream->end_pos > demuxer->movi_end) demuxer->movi_end = demuxer->stream->end_pos; - if (index_mode == -2 || index_mode == 2 || index_mode == 0) - break; // reading from non-seekable source (stdin) or forced index or no index forced - if (list_end > 0) stream_seek(demuxer->stream, list_end); // skip movi - list_end = 0; - } - continue; - } - size2 = stream_read_dword_le(demuxer->stream); - aviheader_printf("CHUNK %.4s len=%u\n", (char *) &id, size2); - chunksize = (size2 + 1) & (~1); - switch (id) - { - - // Indicates where the subject of the file is archived - case mmioFOURCC('I', 'A', 'R', 'L'): - hdr = "Archival Location"; - break; - // Lists the artist of the original subject of the file; - // for example, "Michaelangelo." - case mmioFOURCC('I', 'A', 'R', 'T'): - hdr = "Artist"; - break; - // Lists the name of the person or organization that commissioned - // the subject of the file; for example "Pope Julian II." - case mmioFOURCC('I', 'C', 'M', 'S'): - hdr = "Commissioned"; - break; - // Provides general comments about the file or the subject - // of the file. If the comment is several sentences long, end each - // sentence with a period. Do not include new-line characters. - case mmioFOURCC('I', 'C', 'M', 'T'): - hdr = "Comments"; - break; - // Records the copyright information for the file; for example, - // "Copyright Encyclopedia International 1991." If there are multiple - // copyrights, separate them by semicolon followed by a space. - case mmioFOURCC('I', 'C', 'O', 'P'): - hdr = "Copyright"; - break; - // Describes whether an image has been cropped and, if so, how it - // was cropped; for example, "lower-right corner." - case mmioFOURCC('I', 'C', 'R', 'D'): - hdr = "Creation Date"; - break; - // Describes whether an image has been cropped and, if so, how it - // was cropped; for example, "lower-right corner." - case mmioFOURCC('I', 'C', 'R', 'P'): - hdr = "Cropped"; - break; - // Specifies the size of the original subject of the file; for - // example, "8.5 in h, 11 in w." - case mmioFOURCC('I', 'D', 'I', 'M'): - hdr = "Dimensions"; - break; - // Stores dots per inch setting of the digitizer used to - // produce the file, such as "300." - case mmioFOURCC('I', 'D', 'P', 'I'): - hdr = "Dots Per Inch"; - break; - // Stores the of the engineer who worked on the file. If there are - // multiple engineers, separate the names by a semicolon and a blank; - // for example, "Smith, John; Adams, Joe." - case mmioFOURCC('I', 'E', 'N', 'G'): - hdr = "Engineer"; - break; - // Describes the original work, such as "landscape,", "portrait," - // "still liefe," etc. - case mmioFOURCC('I', 'G', 'N', 'R'): - hdr = "Genre"; - break; - // Provides a list of keywords that refer to the file or subject of the - // file. Separate multiple keywords with a semicolon and a blank; - // for example, "Seattle, aerial view; scenery." - case mmioFOURCC('I', 'K', 'E', 'Y'): - hdr = "Keywords"; - break; - // ILGT - Describes the changes in the lightness settings on the digitizer - // required to produce the file. Note that the format of this information - // depends on the hardware used. - case mmioFOURCC('I', 'L', 'G', 'T'): - hdr = "Lightness"; - break; - // IMED - Decribes the original subject of the file, such as - // "computer image," "drawing," "lithograph," and so on. - case mmioFOURCC('I', 'M', 'E', 'D'): - hdr = "Medium"; - break; - // INAM - Stores the title of the subject of the file, such as - // "Seattle from Above." - case mmioFOURCC('I', 'N', 'A', 'M'): - hdr = "Name"; - break; - // IPLT - Specifies the number of colors requested when digitizing - // an image, such as "256." - case mmioFOURCC('I', 'P', 'L', 'T'): - hdr = "Palette Setting"; - break; - // IPRD - Specifies the name of title the file was originally intended - // for, such as "Encyclopedia of Pacific Northwest Geography." - case mmioFOURCC('I', 'P', 'R', 'D'): - hdr = "Product"; - break; - // ISBJ - Decsribes the contents of the file, such as - // "Aerial view of Seattle." - case mmioFOURCC('I', 'S', 'B', 'J'): - hdr = "Subject"; - break; - // ISFT - Identifies the name of the software packages used to create the - // file, such as "Microsoft WaveEdit" - case mmioFOURCC('I', 'S', 'F', 'T'): - hdr = "Software"; - break; - // ISHP - Identifies the change in sharpness for the digitizer - // required to produce the file (the format depends on the hardware used). - case mmioFOURCC('I', 'S', 'H', 'P'): - hdr = "Sharpness"; - break; - // ISRC - Identifies the name of the person or organization who - // suplied the original subject of the file; for example, "Try Research." - case mmioFOURCC('I', 'S', 'R', 'C'): - hdr = "Source"; - break; - // ISRF - Identifies the original form of the material that was digitized, - // such as "slide," "paper," "map," and so on. This is not necessarily - // the same as IMED - case mmioFOURCC('I', 'S', 'R', 'F'): - hdr = "Source Form"; - break; - // ITCH - Identifies the technician who digitized the subject file; - // for example, "Smith, John." - case mmioFOURCC('I', 'T', 'C', 'H'): - hdr = "Technician"; - break; - case mmioFOURCC('I', 'S', 'M', 'P'): - hdr = "Time Code"; - break; - case mmioFOURCC('I', 'D', 'I', 'T'): - hdr = "Digitization Time"; - break; - - case ckidAVIMAINHDR: // read 'avih' - stream_read(demuxer->stream, (unsigned char *) &avih, FFMIN(size2, sizeof(avih))); - le2me_MainAVIHeader(&avih); // swap to machine endian - chunksize -= FFMIN(size2, sizeof(avih)); - //if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_avih(&avih,MSGL_V); // else print_avih_flags(&avih,MSGL_V); - break; - case ckidSTREAMHEADER: // read 'strh' - { - AVIStreamHeader h; - stream_read(demuxer->stream, (unsigned char *) &h, FFMIN(size2, sizeof(h))); - le2me_AVIStreamHeader(&h); // swap to machine endian - chunksize -= FFMIN(size2, sizeof(h)); - ++stream_id; - if (h.fccType == streamtypeVIDEO) - { - sh_video = new_sh_video(demuxer, stream_id); - aviheader_printf("aviheader 0x%x\n", stream_id); - memcpy(&sh_video->video, &h, sizeof(h)); - sh_video->stream_delay = (float)sh_video->video.dwStart * sh_video->video.dwScale / sh_video->video.dwRate; - double fps = (double)sh_video->video.dwRate / (double)sh_video->video.dwScale; - priv->duration = (double)sh_video->video.dwLength / fps; - printf("\n\nlen:%f fps:%f\n\n", priv->duration, fps); - } - else if (h.fccType == streamtypeAUDIO) - { - sh_audio = new_sh_audio(demuxer, stream_id); - aviheader_printf("aviheader 0x%x\n", stream_id); - memcpy(&sh_audio->audio, &h, sizeof(h)); - sh_audio->stream_delay = (float)sh_audio->audio.dwStart * sh_audio->audio.dwScale / sh_audio->audio.dwRate; - } - last_fccType = h.fccType; - last_fccHandler = h.fccHandler; - //if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_strh(&h,MSGL_V); - break; - } - case mmioFOURCC('i', 'n', 'd', 'x'): - { - uint32_t i; - avisuperindex_chunk *s; - - if (!index_mode) break; - - if (chunksize <= 24) - { - break; - } - priv->suidx_size++; - priv->suidx = realloc_struct(priv->suidx, priv->suidx_size, sizeof(avisuperindex_chunk)); - s = &priv->suidx[priv->suidx_size - 1]; - - chunksize -= 24; - memcpy(s->fcc, "indx", 4); - s->dwSize = size2; - s->wLongsPerEntry = stream_read_word_le(demuxer->stream); - s->bIndexSubType = stream_read_char(demuxer->stream); - s->bIndexType = stream_read_char(demuxer->stream); - s->nEntriesInUse = stream_read_dword_le(demuxer->stream); - *(uint32_t *)s->dwChunkId = stream_read_dword_le(demuxer->stream); - stream_read(demuxer->stream, (unsigned char *)s->dwReserved, 3 * 4); - memset(s->dwReserved, 0, 3 * 4); - - print_avisuperindex_chunk(s, 0); - - // Check and fix this useless crap - if (s->wLongsPerEntry != sizeof(avisuperindex_entry) / 4) - { - aviheader_printf("Broken super index chunk size: %u\n", s->wLongsPerEntry); - s->wLongsPerEntry = sizeof(avisuperindex_entry) / 4; - } - if (((chunksize / 4) / s->wLongsPerEntry) < s->nEntriesInUse) - { - aviheader_printf("Broken super index chunk\n"); - s->nEntriesInUse = (chunksize / 4) / s->wLongsPerEntry; - } - - s->aIndex = calloc(s->nEntriesInUse, sizeof(avisuperindex_entry)); - s->stdidx = calloc(s->nEntriesInUse, sizeof(avistdindex_chunk)); - - // now the real index of indices - for (i = 0; i < s->nEntriesInUse; i++) - { - chunksize -= 16; - s->aIndex[i].qwOffset = stream_read_qword_le(demuxer->stream); - s->aIndex[i].dwSize = stream_read_dword_le(demuxer->stream); - s->aIndex[i].dwDuration = stream_read_dword_le(demuxer->stream); - aviheader_printf("ODML (%.4s): [%d] 0x%016"PRIx64" 0x%04x %u\n", - (s->dwChunkId), i, - (uint64_t)s->aIndex[i].qwOffset, s->aIndex[i].dwSize, s->aIndex[i].dwDuration); - } - - break; - } - case ckidSTREAMFORMAT: // read 'strf' - { - if (last_fccType == streamtypeVIDEO) - { - sh_video->bih = calloc(FFMAX(chunksize, sizeof(BITMAPINFOHEADER)), 1); -// sh_video->bih=malloc(chunksize); memset(sh_video->bih,0,chunksize); - aviheader_printf("DEMUX_AVIHDR_FoundBitmapInfoHeader 0x%x 0x%x\n", chunksize, sizeof(BITMAPINFOHEADER)); - stream_read(demuxer->stream, (unsigned char *) sh_video->bih, chunksize); - le2me_BITMAPINFOHEADER(sh_video->bih); // swap to machine endian - if (sh_video->bih->biSize > chunksize && sh_video->bih->biSize > sizeof(BITMAPINFOHEADER)) - sh_video->bih->biSize = chunksize; - // fixup MS-RLE header (seems to be broken for <256 color files) - if (sh_video->bih->biCompression <= 1 && sh_video->bih->biSize == 40) - sh_video->bih->biSize = chunksize; - //if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_video->bih,MSGL_V); - chunksize = 0; - sh_video->fps = (float)sh_video->video.dwRate / (float)sh_video->video.dwScale; - sh_video->frametime = (float)sh_video->video.dwScale / (float)sh_video->video.dwRate; - sh_video->format = sh_video->bih->biCompression; -// if(demuxer->video->id==-1) demuxer->video->id=stream_id; - // IdxFix: - idxfix_videostream = stream_id; - switch (sh_video->bih->biCompression) - { - case mmioFOURCC('M', 'P', 'G', '4'): - case mmioFOURCC('m', 'p', 'g', '4'): - case mmioFOURCC('D', 'I', 'V', '1'): - idxfix_divx = 3; // set index recovery mpeg4 flavour: msmpeg4v1 - aviheader_printf("DEMUX_AVIHDR_RegeneratingKeyfTableForMPG4V1\n"); - break; - case mmioFOURCC('D', 'I', 'V', '3'): - case mmioFOURCC('d', 'i', 'v', '3'): - case mmioFOURCC('D', 'I', 'V', '4'): - case mmioFOURCC('d', 'i', 'v', '4'): - case mmioFOURCC('D', 'I', 'V', '5'): - case mmioFOURCC('d', 'i', 'v', '5'): - case mmioFOURCC('D', 'I', 'V', '6'): - case mmioFOURCC('d', 'i', 'v', '6'): - case mmioFOURCC('M', 'P', '4', '3'): - case mmioFOURCC('m', 'p', '4', '3'): - case mmioFOURCC('M', 'P', '4', '2'): - case mmioFOURCC('m', 'p', '4', '2'): - case mmioFOURCC('D', 'I', 'V', '2'): - case mmioFOURCC('A', 'P', '4', '1'): - idxfix_divx = 1; // set index recovery mpeg4 flavour: msmpeg4v3 - aviheader_printf("DEMUX_AVIHDR_RegeneratingKeyfTableForDIVX3\n"); - break; - case mmioFOURCC('D', 'I', 'V', 'X'): - case mmioFOURCC('d', 'i', 'v', 'x'): - case mmioFOURCC('D', 'X', '5', '0'): - case mmioFOURCC('X', 'V', 'I', 'D'): - case mmioFOURCC('x', 'v', 'i', 'd'): - case mmioFOURCC('F', 'M', 'P', '4'): - case mmioFOURCC('f', 'm', 'p', '4'): - idxfix_divx = 2; // set index recovery mpeg4 flavour: generic mpeg4 - aviheader_printf("DEMUX_AVIHDR_RegeneratingKeyfTableForMPEG4\n"); - break; - } - } - else if (last_fccType == streamtypeAUDIO) - { - unsigned wf_size = chunksize < sizeof(WAVEFORMATEX) ? sizeof(WAVEFORMATEX) : chunksize; - sh_audio->wf = calloc(wf_size, 1); -// sh_audio->wf=malloc(chunksize); memset(sh_audio->wf,0,chunksize); - aviheader_printf("DEMUX_AVIHDR_FoundWaveFmt 0x%x 0x%x\n", chunksize, sizeof(WAVEFORMATEX)); - stream_read(demuxer->stream, (unsigned char *) sh_audio->wf, chunksize); - le2me_WAVEFORMATEX(sh_audio->wf); - if (sh_audio->wf->cbSize != 0 && - wf_size < sizeof(WAVEFORMATEX) + sh_audio->wf->cbSize) - { - sh_audio->wf = realloc(sh_audio->wf, sizeof(WAVEFORMATEX) + sh_audio->wf->cbSize); - } - sh_audio->format = sh_audio->wf->wFormatTag; - if (sh_audio->format == 1 && - last_fccHandler == mmioFOURCC('A', 'x', 'a', 'n')) - sh_audio->format = last_fccHandler; - sh_audio->i_bps = sh_audio->wf->nAvgBytesPerSec; - chunksize = 0; - //if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf,MSGL_V); - ++priv->audio_streams; -// if(demuxer->audio->id==-1) demuxer->audio->id=stream_id; - } - break; - } - case mmioFOURCC('v', 'p', 'r', 'p'): - { - VideoPropHeader *vprp = malloc(chunksize); - unsigned int i; - stream_read(demuxer->stream, (void *)vprp, chunksize); - le2me_VideoPropHeader(vprp); - chunksize -= sizeof(*vprp) - sizeof(vprp->FieldInfo); - chunksize /= sizeof(VIDEO_FIELD_DESC); - if (vprp->nbFieldPerFrame > chunksize) - { - vprp->nbFieldPerFrame = chunksize; - } - chunksize = 0; - for (i = 0; i < vprp->nbFieldPerFrame; i++) - { - le2me_VIDEO_FIELD_DESC(&vprp->FieldInfo[i]); - } - if (sh_video) - { - sh_video->aspect = GET_AVI_ASPECT(vprp->dwFrameAspectRatio); - } - //if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_vprp(vprp,MSGL_V); - free(vprp); - break; - } - case mmioFOURCC('d', 'm', 'l', 'h'): - { - // dmlh 00 00 00 04 frms - unsigned int total_frames = stream_read_dword_le(demuxer->stream); - aviheader_printf("DEMUX_AVIHDR_FoundAVIV2Header 0x%x 0x%x\n", chunksize, total_frames); - stream_skip(demuxer->stream, chunksize - 4); - chunksize = 0; - } - break; - case ckidAVINEWINDEX: - printf("%s::%d -->\n", __FUNCTION__, __LINE__); - if (demuxer->movi_end > stream_tell(demuxer->stream)) - demuxer->movi_end = stream_tell(demuxer->stream); // fixup movi-end - if (index_mode && !priv->isodml) - { - int i; - priv->idx_size = size2 >> 4; - aviheader_printf("DEMUX_AVIHDR_ReadingIndexBlockChunksForFrames 0x%x 0x%x 0x%lx\n", - priv->idx_size, avih.dwTotalFrames, (long unsigned int) stream_tell(demuxer->stream)); - priv->idx = malloc(priv->idx_size << 4); -// printf("\nindex to %p !!!!! (priv=%p)\n",priv->idx,priv); - stream_read(demuxer->stream, (unsigned char *)priv->idx, priv->idx_size << 4); - for (i = 0; i < priv->idx_size; i++) // swap index to machine endian - { - AVIINDEXENTRY *entry = (AVIINDEXENTRY *)priv->idx + i; - le2me_AVIINDEXENTRY(entry); - /* - * We (ab)use the upper word for bits 32-47 of the offset, so - * we'll clear them here. - * FIXME: AFAIK no codec uses them, but if one does it will break - */ - entry->dwFlags &= 0xffff; - } - chunksize -= priv->idx_size << 4; - //if( mp_msg_test(MSGT_HEADER,MSGL_DBG2) ) print_index(priv->idx,priv->idx_size,MSGL_DBG2); - } - printf("%s::%d <--\n", __FUNCTION__, __LINE__); - break; - /* added May 2002 */ - case mmioFOURCC('R', 'I', 'F', 'F'): - { - char riff_type[4]; - - aviheader_printf("DEMUX_AVIHDR_AdditionalRIFFHdr\n"); - stream_read(demuxer->stream, (unsigned char *) riff_type, sizeof riff_type); - if (strncmp(riff_type, "AVIX", sizeof riff_type)) - aviheader_printf("DEMUX_AVIHDR_WarnNotExtendedAVIHdr\n"); - else - { - /* - * We got an extended AVI header, so we need to switch to - * ODML to get seeking to work, provided we got indx chunks - * in the header (suidx_size > 0). - */ - if (priv->suidx_size > 0) - priv->isodml = 1; - } - chunksize = 0; - list_end = 0; /* a new list will follow */ - break; - } - case ckidAVIPADDING: - stream_skip(demuxer->stream, chunksize); - chunksize = 0; - break; - } - if (hdr) - { - aviheader_printf("hdr=%s size=%u\n", hdr, size2); - if (size2 == 3) - chunksize = 1; // empty - else - { - char buf[256]; - int len = (size2 < 250) ? size2 : 250; - stream_read(demuxer->stream, (unsigned char *) buf, len); - chunksize -= len; - buf[len] = 0; - aviheader_printf("%-10s: %s\n", hdr, buf); - demux_info_add(demuxer, hdr, buf); - } - } - aviheader_printf("list_end=0x%"PRIX64" pos=0x%"PRIX64" chunksize=0x%"PRIX64" next=0x%"PRIX64"\n", - (int64_t)list_end, (int64_t)stream_tell(demuxer->stream), - (int64_t)chunksize, (int64_t)chunksize + (int64_t)stream_tell(demuxer->stream)); - if (list_end > 0 && - chunksize + stream_tell(demuxer->stream) == list_end) list_end = 0; - if (list_end > 0 && chunksize + stream_tell(demuxer->stream) > list_end) - { - aviheader_printf("DEMUX_AVIHDR_BrokenChunk 0x%x %p\n", chunksize, (char *) &id); - stream_seek(demuxer->stream, list_end); - list_end = 0; - } - else if (chunksize > 0) stream_skip(demuxer->stream, chunksize); - else if ((int)chunksize < 0) aviheader_printf("chunksize=%u (id=%.4s)\n", chunksize, (char *) &id); - printf("%s::%d\n", __FUNCTION__, __LINE__); - } - printf("%s::%d\n", __FUNCTION__, __LINE__); - if (priv->suidx_size > 0 && priv->idx_size == 0) - { - /* - * No NEWAVIINDEX, but we got an OpenDML index. - */ - priv->isodml = 1; - } - - if (priv->isodml && (index_mode == -1 || index_mode == 0 || index_mode == 1)) - { - int i, j, k; - - avisuperindex_chunk *cx; - AVIINDEXENTRY *idx; - - - if (priv->idx_size) free(priv->idx); - priv->idx_size = 0; - priv->idx_offset = 0; - priv->idx = NULL; - - aviheader_printf("DEMUX_AVIHDR_BuildingODMLidx 0x%x\n", priv->suidx_size); - - // read the standard indices - for (cx = &priv->suidx[0], i = 0; i < priv->suidx_size; cx++, i++) - { - stream_reset(demuxer->stream); - for (j = 0; j < cx->nEntriesInUse; j++) - { - int ret1, ret2; - memset(&cx->stdidx[j], 0, 32); - ret1 = stream_seek(demuxer->stream, (off_t)cx->aIndex[j].qwOffset); - ret2 = stream_read(demuxer->stream, (unsigned char *)&cx->stdidx[j], 32); - if (ret1 != 1 || ret2 != 32 || cx->stdidx[j].nEntriesInUse == 0) - { - // this is a broken file (probably incomplete) let the standard - // gen_index routine handle this - priv->isodml = 0; - priv->idx_size = 0; - aviheader_printf("DEMUX_AVIHDR_BrokenODMLfile\n"); - goto freeout; - } - - le2me_AVISTDIDXCHUNK(&cx->stdidx[j]); - print_avistdindex_chunk(&cx->stdidx[j], 0); - priv->idx_size += cx->stdidx[j].nEntriesInUse; - cx->stdidx[j].aIndex = malloc(cx->stdidx[j].nEntriesInUse * sizeof(avistdindex_entry)); - stream_read(demuxer->stream, (unsigned char *)cx->stdidx[j].aIndex, - cx->stdidx[j].nEntriesInUse * sizeof(avistdindex_entry)); - for (k = 0; k < cx->stdidx[j].nEntriesInUse; k++) - le2me_AVISTDIDXENTRY(&cx->stdidx[j].aIndex[k]); - - cx->stdidx[j].dwReserved3 = 0; - - } - } - - /* - * We convert the index by translating all entries into AVIINDEXENTRYs - * and sorting them by offset. The result should be the same index - * we would get with -forceidx. - */ - - idx = priv->idx = malloc(priv->idx_size * sizeof(AVIINDEXENTRY)); - - for (cx = priv->suidx; cx != &priv->suidx[priv->suidx_size]; cx++) - { - avistdindex_chunk *sic; - for (sic = cx->stdidx; sic != &cx->stdidx[cx->nEntriesInUse]; sic++) - { - avistdindex_entry *sie; - for (sie = sic->aIndex; sie != &sic->aIndex[sic->nEntriesInUse]; sie++) - { - uint64_t off = sic->qwBaseOffset + sie->dwOffset - 8; - memcpy(&idx->ckid, sic->dwChunkId, 4); - idx->dwChunkOffset = off; - idx->dwFlags = (off >> 32) << 16; - idx->dwChunkLength = sie->dwSize & 0x7fffffff; - idx->dwFlags |= (sie->dwSize & 0x80000000) ? 0x0 : AVIIF_KEYFRAME; // bit 31 denotes !keyframe - idx++; - } - } - } - qsort(priv->idx, priv->idx_size, sizeof(AVIINDEXENTRY), avi_idx_cmp); - - /* - Hack to work around a "wrong" index in some divx odml files - (processor_burning.avi as an example) - They have ##dc on non keyframes but the ix00 tells us they are ##db. - Read the fcc of a non-keyframe vid frame and check it. - */ - - { - uint32_t id; - uint32_t db = 0; - stream_reset(demuxer->stream); - - // find out the video stream id. I have seen files with 01db. - for (idx = &((AVIINDEXENTRY *)priv->idx)[0], i = 0; i < priv->idx_size; i++, idx++) - { - unsigned char res[2]; - if (odml_get_vstream_id(idx->ckid, res)) - { - db = mmioFOURCC(res[0], res[1], 'd', 'b'); - break; - } - } - - // find first non keyframe - for (idx = &((AVIINDEXENTRY *)priv->idx)[0], i = 0; i < priv->idx_size; i++, idx++) - { - if (!(idx->dwFlags & AVIIF_KEYFRAME) && idx->ckid == db) break; - } - if (i < priv->idx_size && db) - { - stream_seek(demuxer->stream, AVI_IDX_OFFSET(idx)); - id = stream_read_dword_le(demuxer->stream); - if (id && id != db) // index fcc and real fcc differ? fix it. - for (idx = &((AVIINDEXENTRY *)priv->idx)[0], i = 0; i < priv->idx_size; i++, idx++) - { - if (!(idx->dwFlags & AVIIF_KEYFRAME) && idx->ckid == db) - idx->ckid = id; - } - } - } - - //if ( mp_msg_test(MSGT_HEADER,MSGL_DBG2) ) print_index(priv->idx, priv->idx_size,MSGL_DBG2); - - demuxer->movi_end = demuxer->stream->end_pos; - -freeout: - - // free unneeded stuff - cx = &priv->suidx[0]; - do - { - for (j = 0; j < cx->nEntriesInUse; j++) - if (cx->stdidx[j].nEntriesInUse) free(cx->stdidx[j].aIndex); - free(cx->stdidx); - - } - while (cx++ != &priv->suidx[priv->suidx_size - 1]); - free(priv->suidx); - - } - - /* Read a saved index file */ - if (index_file_load) - { - FILE *fp; - char magic[7]; - unsigned int i; - - if ((fp = fopen(index_file_load, "r")) == NULL) - { - aviheader_printf("DEMUX_AVIHDR_CantReadIdxFile %p %p\n", index_file_load, strerror(errno)); - goto gen_index; - } - fread(&magic, 6, 1, fp); - if (strncmp(magic, "MPIDX1", 6)) - { - aviheader_printf("DEMUX_AVIHDR_NotValidMPidxFile %p\n", index_file_load); - goto gen_index; - } - fread(&priv->idx_size, sizeof(priv->idx_size), 1, fp); - priv->idx = malloc(priv->idx_size * sizeof(AVIINDEXENTRY)); - if (!priv->idx) - { - aviheader_printf("DEMUX_AVIHDR_FailedMallocForIdxFile %p\n", index_file_load); - priv->idx_size = 0; - goto gen_index; - } - - for (i = 0; i < priv->idx_size; i++) - { - AVIINDEXENTRY *idx; - idx = &((AVIINDEXENTRY *)priv->idx)[i]; - fread(idx, sizeof(AVIINDEXENTRY), 1, fp); - if (feof(fp)) - { - aviheader_printf("DEMUX_AVIHDR_PrematureEOF %p\n", index_file_load); - free(priv->idx); - priv->idx_size = 0; - goto gen_index; - } - } - fclose(fp); - aviheader_printf("DEMUX_AVIHDR_IdxFileLoaded %p\n", index_file_load); - } -gen_index: - if (index_mode >= 2 || (priv->idx_size == 0 && index_mode == 1)) - { - // build index for file: - stream_reset(demuxer->stream); - stream_seek(demuxer->stream, demuxer->movi_start); - - priv->idx_pos = 0; - priv->idx_size = 0; - priv->idx = NULL; - - while (1) - { - int id; - unsigned len; - off_t skip; - AVIINDEXENTRY *idx; - unsigned int c; - demuxer->filepos = stream_tell(demuxer->stream); - if (demuxer->filepos >= demuxer->movi_end && demuxer->movi_start < demuxer->movi_end) break; - id = stream_read_dword_le(demuxer->stream); - len = stream_read_dword_le(demuxer->stream); - if (id == mmioFOURCC('L', 'I', 'S', 'T') || id == mmioFOURCC('R', 'I', 'F', 'F')) - { - id = stream_read_dword_le(demuxer->stream); // list or RIFF type - continue; - } - if (stream_eof(demuxer->stream)) break; - if (!id || avi_stream_id(id) == 100) goto skip_chunk; // bad ID (or padding?) - - if (priv->idx_pos >= priv->idx_size) - { -// priv->idx_size+=32; - priv->idx_size += 1024; // +16kB - priv->idx = realloc(priv->idx, priv->idx_size * sizeof(AVIINDEXENTRY)); - if (!priv->idx) - { - priv->idx_pos = 0; // error! - break; - } - } - idx = &((AVIINDEXENTRY *)priv->idx)[priv->idx_pos++]; - idx->ckid = id; - idx->dwFlags = AVIIF_KEYFRAME; // FIXME - idx->dwFlags |= (demuxer->filepos >> 16) & 0xffff0000U; - idx->dwChunkOffset = (unsigned long)demuxer->filepos; - idx->dwChunkLength = len; - - c = stream_read_dword(demuxer->stream); - - if (!len) idx->dwFlags &= ~AVIIF_KEYFRAME; - - // Fix keyframes for DivX files: - if (idxfix_divx) - if (avi_stream_id(id) == idxfix_videostream) - { - switch (idxfix_divx) - { - case 3: - c = stream_read_dword(demuxer->stream) << 5; //skip 32+5 bits for m$mpeg4v1 - case 1: - if (c & 0x40000000) idx->dwFlags &= ~AVIIF_KEYFRAME; - break; // divx 3 - case 2: - if (c == 0x1B6) idx->dwFlags &= ~AVIIF_KEYFRAME; - break; // divx 4 - } - } - - // update status line: - { - static off_t lastpos; - off_t pos; - off_t len = demuxer->movi_end - demuxer->movi_start; - if (len) - { - pos = 100 * (demuxer->filepos - demuxer->movi_start) / len; // % - } - else - { - pos = (demuxer->filepos - demuxer->movi_start) >> 20; // MB - } - if (pos != lastpos) - { - lastpos = pos; - aviheader_printf("DEMUX_AVIHDR_GeneratingIdx 0x%lx %s\n", - (unsigned long)pos, len ? "%" : "MB"); - } - } - aviheader_printf("%08X %08X %.4s %08X %X\n", (unsigned int)demuxer->filepos, id, (char *) &id, (int)c, (unsigned int) idx->dwFlags); -#if 0 - { - unsigned char tmp[64]; - int i; - stream_read(s, tmp, 64); - printf("%.4s", &id); - for (i = 0; i < 64; i++) printf(" %02X", tmp[i]); - printf("\n"); - } -#endif -skip_chunk: - skip = (len + 1) & (~1UL); // total bytes in this chunk - stream_seek(demuxer->stream, 8 + demuxer->filepos + skip); - } - priv->idx_size = priv->idx_pos; - aviheader_printf("DEMUX_AVIHDR_IdxGeneratedForHowManyChunks 0x%x\n", priv->idx_size); - //if( mp_msg_test(MSGT_HEADER,MSGL_DBG2) ) print_index(priv->idx,priv->idx_size,MSGL_DBG2); - - /* Write generated index to a file */ - if (index_file_save) - { - FILE *fp; - unsigned int i; - - if ((fp = fopen(index_file_save, "w")) == NULL) - { - aviheader_printf("DEMUX_AVIHDR_Failed2WriteIdxFile %p %p\n", index_file_save, strerror(errno)); - return; - } - fwrite("MPIDX1", 6, 1, fp); - fwrite(&priv->idx_size, sizeof(priv->idx_size), 1, fp); - for (i = 0; i < priv->idx_size; i++) - { - AVIINDEXENTRY *idx = &((AVIINDEXENTRY *)priv->idx)[i]; - fwrite(idx, sizeof(AVIINDEXENTRY), 1, fp); - } - fclose(fp); - aviheader_printf("DEMUX_AVIHDR_IdxFileSaved %p\n", index_file_save); - } - } - printf("%s::%d\n", __FUNCTION__, __LINE__); -} - diff --git a/libeplayer2/container/aviheader.h b/libeplayer2/container/aviheader.h deleted file mode 100644 index c1f9b42..0000000 --- a/libeplayer2/container/aviheader.h +++ /dev/null @@ -1,369 +0,0 @@ -#ifndef EPLAYER_AVIHEADER_H -#define EPLAYER_AVIHEADER_H - -#include -#include - -#ifndef mmioFOURCC -#define mmioFOURCC( ch0, ch1, ch2, ch3 ) \ - ( (uint32_t)(uint8_t)(ch0) | ( (uint32_t)(uint8_t)(ch1) << 8 ) | \ - ( (uint32_t)(uint8_t)(ch2) << 16 ) | ( (uint32_t)(uint8_t)(ch3) << 24 ) ) -#endif - -/* Macro to make a TWOCC out of two characters */ -#ifndef aviTWOCC -#define aviTWOCC(ch0, ch1) ((uint16_t)(uint8_t)(ch0) | ((uint16_t)(uint8_t)(ch1) << 8)) -#endif - -//typedef uint16_t TWOCC; -//typedef uint32_t FOURCC; - -/* form types, list types, and chunk types */ -#define formtypeAVI mmioFOURCC('A', 'V', 'I', ' ') -#define listtypeAVIHEADER mmioFOURCC('h', 'd', 'r', 'l') -#define ckidAVIMAINHDR mmioFOURCC('a', 'v', 'i', 'h') -#define listtypeSTREAMHEADER mmioFOURCC('s', 't', 'r', 'l') -#define ckidSTREAMHEADER mmioFOURCC('s', 't', 'r', 'h') -#define ckidSTREAMFORMAT mmioFOURCC('s', 't', 'r', 'f') -#define ckidSTREAMHANDLERDATA mmioFOURCC('s', 't', 'r', 'd') -#define ckidSTREAMNAME mmioFOURCC('s', 't', 'r', 'n') - -#define listtypeAVIMOVIE mmioFOURCC('m', 'o', 'v', 'i') -#define listtypeAVIRECORD mmioFOURCC('r', 'e', 'c', ' ') - -#define ckidAVINEWINDEX mmioFOURCC('i', 'd', 'x', '1') - -/* -** Stream types for the field of the stream header. -*/ -#define streamtypeVIDEO mmioFOURCC('v', 'i', 'd', 's') -#define streamtypeAUDIO mmioFOURCC('a', 'u', 'd', 's') -#define streamtypeMIDI mmioFOURCC('m', 'i', 'd', 's') -#define streamtypeTEXT mmioFOURCC('t', 'x', 't', 's') - -/* Basic chunk types */ -#define cktypeDIBbits aviTWOCC('d', 'b') -#define cktypeDIBcompressed aviTWOCC('d', 'c') -#define cktypePALchange aviTWOCC('p', 'c') -#define cktypeWAVEbytes aviTWOCC('w', 'b') - -/* Chunk id to use for extra chunks for padding. */ -#define ckidAVIPADDING mmioFOURCC('J', 'U', 'N', 'K') - -/* flags for use in in AVIFileHdr */ -#define AVIF_HASINDEX 0x00000010 // Index at end of file? -#define AVIF_MUSTUSEINDEX 0x00000020 -#define AVIF_ISINTERLEAVED 0x00000100 -#define AVIF_TRUSTCKTYPE 0x00000800 // Use CKType to find key frames? -#define AVIF_WASCAPTUREFILE 0x00010000 -#define AVIF_COPYRIGHTED 0x00020000 - -typedef struct -{ -uint32_t dwMicroSecPerFrame; // frame display rate (or 0L) -uint32_t dwMaxBytesPerSec; // max. transfer rate -uint32_t dwPaddingGranularity; // pad to multiples of this -// size; normally 2K. -uint32_t dwFlags; // the ever-present flags -uint32_t dwTotalFrames; // # frames in file -uint32_t dwInitialFrames; -uint32_t dwStreams; -uint32_t dwSuggestedBufferSize; - -uint32_t dwWidth; -uint32_t dwHeight; - -uint32_t dwReserved[4]; -} MainAVIHeader; - -typedef struct rectangle_t -{ -short left; -short top; -short right; -short bottom; -} rectangle_t; - -typedef struct -{ -uint32_t fccType; -uint32_t fccHandler; -uint32_t dwFlags; /* Contains AVITF_* flags */ -uint16_t wPriority; -uint16_t wLanguage; -uint32_t dwInitialFrames; -uint32_t dwScale; -uint32_t dwRate; /* dwRate / dwScale == samples/second */ -uint32_t dwStart; -uint32_t dwLength; /* In units above... */ -uint32_t dwSuggestedBufferSize; -uint32_t dwQuality; -uint32_t dwSampleSize; -rectangle_t rcFrame; -} AVIStreamHeader; - -/* Flags for index */ -#define AVIIF_LIST 0x00000001L // chunk is a 'LIST' -#define AVIIF_KEYFRAME 0x00000010L // this frame is a key frame. - -#define AVIIF_NOTIME 0x00000100L // this frame doesn't take any time -#define AVIIF_COMPUSE 0x0FFF0000L // these bits are for compressor use - -#define FOURCC_RIFF mmioFOURCC('R', 'I', 'F', 'F') -#define FOURCC_LIST mmioFOURCC('L', 'I', 'S', 'T') - -typedef struct -{ -uint32_t ckid; -uint32_t dwFlags; -uint32_t dwChunkOffset; // Position of chunk -uint32_t dwChunkLength; // Length of chunk -} AVIINDEXENTRY; - - -typedef struct avisuperindex_entry -{ -uint64_t qwOffset; // absolute file offset -uint32_t dwSize; // size of index chunk at this offset -uint32_t dwDuration; // time span in stream ticks -} avisuperindex_entry; - -typedef struct avistdindex_entry -{ -uint32_t dwOffset; // qwBaseOffset + this is absolute file offset -uint32_t dwSize; // bit 31 is set if this is NOT a keyframe -} avistdindex_entry; - -// Standard index -typedef struct __attribute__((packed)) avistdindex_chunk -{ -char fcc[4]; // ix## -uint32_t dwSize; // size of this chunk -uint16_t wLongsPerEntry; // must be sizeof(aIndex[0])/sizeof(DWORD) -uint8_t bIndexSubType; // must be 0 -uint8_t bIndexType; // must be AVI_INDEX_OF_CHUNKS -uint32_t nEntriesInUse; // first unused entry -char dwChunkId[4]; // '##dc' or '##db' or '##wb' etc.. -uint64_t qwBaseOffset; // all dwOffsets in aIndex array are relative to this -uint32_t dwReserved3; // must be 0 -avistdindex_entry *aIndex; // the actual frames -} avistdindex_chunk; - - -// Base Index Form 'indx' -typedef struct avisuperindex_chunk -{ - char fcc[4]; - uint32_t dwSize; // size of this chunk - uint16_t wLongsPerEntry; // size of each entry in aIndex array (must be 4*4 for us) - uint8_t bIndexSubType; // future use. must be 0 - uint8_t bIndexType; // one of AVI_INDEX_* codes - uint32_t nEntriesInUse; // index of first unused member in aIndex array - char dwChunkId[4]; // fcc of what is indexed - uint32_t dwReserved[3]; // meaning differs for each index type/subtype. - // 0 if unused - avisuperindex_entry *aIndex; // position of ix## chunks - avistdindex_chunk *stdidx; // the actual std indices -} avisuperindex_chunk; - -typedef struct -{ - uint32_t CompressedBMHeight; - uint32_t CompressedBMWidth; - uint32_t ValidBMHeight; - uint32_t ValidBMWidth; - uint32_t ValidBMXOffset; - uint32_t ValidBMYOffset; - uint32_t VideoXOffsetInT; - uint32_t VideoYValidStartLine; -} VIDEO_FIELD_DESC; - -typedef struct -{ - uint32_t VideoFormatToken; - uint32_t VideoStandard; - uint32_t dwVerticalRefreshRate; - uint32_t dwHTotalInT; - uint32_t dwVTotalInLines; - uint32_t dwFrameAspectRatio; - uint32_t dwFrameWidthInPixels; - uint32_t dwFrameHeightInLines; - uint32_t nbFieldPerFrame; - VIDEO_FIELD_DESC FieldInfo[2]; -} VideoPropHeader; - -typedef enum -{ - FORMAT_UNKNOWN, - FORMAT_PAL_SQUARE, - FORMAT_PAL_CCIR_601, - FORMAT_NTSC_SQUARE, - FORMAT_NTSC_CCIR_601, -} VIDEO_FORMAT; - -typedef enum -{ - STANDARD_UNKNOWN, - STANDARD_PAL, - STANDARD_NTSC, - STANDARD_SECAM -} VIDEO_STANDARD; - -#define MAKE_AVI_ASPECT(a, b) (((a)<<16)|(b)) -#define GET_AVI_ASPECT(a) ((float)((a)>>16)/(float)((a)&0xffff)) - -/* - * Some macros to swap little endian structures read from an AVI file - * into machine endian format - */ -#ifdef WORDS_BIGENDIAN -#define le2me_MainAVIHeader(h) { \ - (h)->dwMicroSecPerFrame = le2me_32((h)->dwMicroSecPerFrame); \ - (h)->dwMaxBytesPerSec = le2me_32((h)->dwMaxBytesPerSec); \ - (h)->dwPaddingGranularity = le2me_32((h)->dwPaddingGranularity); \ - (h)->dwFlags = le2me_32((h)->dwFlags); \ - (h)->dwTotalFrames = le2me_32((h)->dwTotalFrames); \ - (h)->dwInitialFrames = le2me_32((h)->dwInitialFrames); \ - (h)->dwStreams = le2me_32((h)->dwStreams); \ - (h)->dwSuggestedBufferSize = le2me_32((h)->dwSuggestedBufferSize); \ - (h)->dwWidth = le2me_32((h)->dwWidth); \ - (h)->dwHeight = le2me_32((h)->dwHeight); \ - } - -#define le2me_AVIStreamHeader(h) { \ - (h)->fccType = le2me_32((h)->fccType); \ - (h)->fccHandler = le2me_32((h)->fccHandler); \ - (h)->dwFlags = le2me_32((h)->dwFlags); \ - (h)->wPriority = le2me_16((h)->wPriority); \ - (h)->wLanguage = le2me_16((h)->wLanguage); \ - (h)->dwInitialFrames = le2me_32((h)->dwInitialFrames); \ - (h)->dwScale = le2me_32((h)->dwScale); \ - (h)->dwRate = le2me_32((h)->dwRate); \ - (h)->dwStart = le2me_32((h)->dwStart); \ - (h)->dwLength = le2me_32((h)->dwLength); \ - (h)->dwSuggestedBufferSize = le2me_32((h)->dwSuggestedBufferSize); \ - (h)->dwQuality = le2me_32((h)->dwQuality); \ - (h)->dwSampleSize = le2me_32((h)->dwSampleSize); \ - le2me_RECT(&(h)->rcFrame); \ - } -#define le2me_RECT(h) { \ - (h)->left = le2me_16((h)->left); \ - (h)->top = le2me_16((h)->top); \ - (h)->right = le2me_16((h)->right); \ - (h)->bottom = le2me_16((h)->bottom); \ - } -#define le2me_BITMAPINFOHEADER(h) { \ - (h)->biSize = le2me_32((h)->biSize); \ - (h)->biWidth = le2me_32((h)->biWidth); \ - (h)->biHeight = le2me_32((h)->biHeight); \ - (h)->biPlanes = le2me_16((h)->biPlanes); \ - (h)->biBitCount = le2me_16((h)->biBitCount); \ - (h)->biCompression = le2me_32((h)->biCompression); \ - (h)->biSizeImage = le2me_32((h)->biSizeImage); \ - (h)->biXPelsPerMeter = le2me_32((h)->biXPelsPerMeter); \ - (h)->biYPelsPerMeter = le2me_32((h)->biYPelsPerMeter); \ - (h)->biClrUsed = le2me_32((h)->biClrUsed); \ - (h)->biClrImportant = le2me_32((h)->biClrImportant); \ - } -#define le2me_WAVEFORMATEX(h) { \ - (h)->wFormatTag = le2me_16((h)->wFormatTag); \ - (h)->nChannels = le2me_16((h)->nChannels); \ - (h)->nSamplesPerSec = le2me_32((h)->nSamplesPerSec); \ - (h)->nAvgBytesPerSec = le2me_32((h)->nAvgBytesPerSec); \ - (h)->nBlockAlign = le2me_16((h)->nBlockAlign); \ - (h)->wBitsPerSample = le2me_16((h)->wBitsPerSample); \ - (h)->cbSize = le2me_16((h)->cbSize); \ - } -#define le2me_AVIINDEXENTRY(h) { \ - (h)->ckid = le2me_32((h)->ckid); \ - (h)->dwFlags = le2me_32((h)->dwFlags); \ - (h)->dwChunkOffset = le2me_32((h)->dwChunkOffset); \ - (h)->dwChunkLength = le2me_32((h)->dwChunkLength); \ - } -#define le2me_AVISTDIDXCHUNK(h) {\ - char c; \ - c = (h)->fcc[0]; (h)->fcc[0] = (h)->fcc[3]; (h)->fcc[3] = c; \ - c = (h)->fcc[1]; (h)->fcc[1] = (h)->fcc[2]; (h)->fcc[2] = c; \ - (h)->dwSize = le2me_32((h)->dwSize); \ - (h)->wLongsPerEntry = le2me_16((h)->wLongsPerEntry); \ - (h)->nEntriesInUse = le2me_32((h)->nEntriesInUse); \ - c = (h)->dwChunkId[0]; (h)->dwChunkId[0] = (h)->dwChunkId[3]; (h)->dwChunkId[3] = c; \ - c = (h)->dwChunkId[1]; (h)->dwChunkId[1] = (h)->dwChunkId[2]; (h)->dwChunkId[2] = c; \ - (h)->qwBaseOffset = le2me_64((h)->qwBaseOffset); \ - (h)->dwReserved3 = le2me_32((h)->dwReserved3); \ - } -#define le2me_AVISTDIDXENTRY(h) {\ - (h)->dwOffset = le2me_32((h)->dwOffset); \ - (h)->dwSize = le2me_32((h)->dwSize); \ - } -#define le2me_VideoPropHeader(h) { \ - (h)->VideoFormatToken = le2me_32((h)->VideoFormatToken); \ - (h)->VideoStandard = le2me_32((h)->VideoStandard); \ - (h)->dwVerticalRefreshRate = le2me_32((h)->dwVerticalRefreshRate); \ - (h)->dwHTotalInT = le2me_32((h)->dwHTotalInT); \ - (h)->dwVTotalInLines = le2me_32((h)->dwVTotalInLines); \ - (h)->dwFrameAspectRatio = le2me_32((h)->dwFrameAspectRatio); \ - (h)->dwFrameWidthInPixels = le2me_32((h)->dwFrameWidthInPixels); \ - (h)->dwFrameHeightInLines = le2me_32((h)->dwFrameHeightInLines); \ - (h)->nbFieldPerFrame = le2me_32((h)->nbFieldPerFrame); \ - } -#define le2me_VIDEO_FIELD_DESC(h) { \ - (h)->CompressedBMHeight = le2me_32((h)->CompressedBMHeight); \ - (h)->CompressedBMWidth = le2me_32((h)->CompressedBMWidth); \ - (h)->ValidBMHeight = le2me_32((h)->ValidBMHeight); \ - (h)->ValidBMWidth = le2me_32((h)->ValidBMWidth); \ - (h)->ValidBMXOffset = le2me_32((h)->ValidBMXOffset); \ - (h)->ValidBMYOffset = le2me_32((h)->ValidBMYOffset); \ - (h)->VideoXOffsetInT = le2me_32((h)->VideoXOffsetInT); \ - (h)->VideoYValidStartLine = le2me_32((h)->VideoYValidStartLine); \ - } - -#else -#define le2me_MainAVIHeader(h) /**/ -#define le2me_AVIStreamHeader(h) /**/ -#define le2me_RECT(h) /**/ -#define le2me_BITMAPINFOHEADER(h) /**/ -#define le2me_WAVEFORMATEX(h) /**/ -#define le2me_AVIINDEXENTRY(h) /**/ -#define le2me_AVISTDIDXCHUNK(h) /**/ -#define le2me_AVISTDIDXENTRY(h) /**/ -#define le2me_VideoPropHeader(h) /**/ -#define le2me_VIDEO_FIELD_DESC(h) /**/ -#endif - -typedef struct -{ - // index stuff: - void *idx; - int idx_size; - off_t idx_pos; - off_t idx_pos_a; - off_t idx_pos_v; - off_t idx_offset; // ennyit kell hozzaadni az index offset ertekekhez - // bps-based PTS stuff: - int video_pack_no; - int audio_block_size; - off_t audio_block_no; - // interleaved PTS stuff: - int skip_video_frames; - int audio_streams; - float avi_audio_pts; - float avi_video_pts; - float pts_correction; - unsigned int pts_corr_bytes; - unsigned char pts_corrected; - unsigned char pts_has_video; - unsigned int numberofframes; - avisuperindex_chunk *suidx; - int suidx_size; - int isodml; - double duration; -} avi_priv_t; - -#define AVI_PRIV ((avi_priv_t*)(demuxer->priv)) - -#define AVI_IDX_OFFSET(x) ((((uint64_t)(x)->dwFlags&0xffff0000)<<16)+(x)->dwChunkOffset) - -MainAVIHeader getAVIHeader(); - -#endif /* EPLAYER_AVIHEADER_H */ diff --git a/libeplayer2/container/aviprint.c b/libeplayer2/container/aviprint.c deleted file mode 100644 index 9a85d85..0000000 --- a/libeplayer2/container/aviprint.c +++ /dev/null @@ -1,187 +0,0 @@ - -#include -#include -#include -#include - - -// for avi_stream_id(): -#include "stream.h" -#include "demuxer.h" -#include "stheader.h" - -#include "aviheader.h" - - -int aviprint_debug = 1; -#define aviprint_printf(x...) do { if (aviprint_debug)printf(x); } while (0) - -void print_avih_flags(MainAVIHeader *h, int verbose_level) -{ - aviprint_printf("MainAVIHeader.dwFlags: (%"PRId32")%s%s%s%s%s%s\n", h->dwFlags, - (h->dwFlags & AVIF_HASINDEX) ? " HAS_INDEX" : "", - (h->dwFlags & AVIF_MUSTUSEINDEX) ? " MUST_USE_INDEX" : "", - (h->dwFlags & AVIF_ISINTERLEAVED) ? " IS_INTERLEAVED" : "", - (h->dwFlags & AVIF_TRUSTCKTYPE) ? " TRUST_CKTYPE" : "", - (h->dwFlags & AVIF_WASCAPTUREFILE) ? " WAS_CAPTUREFILE" : "", - (h->dwFlags & AVIF_COPYRIGHTED) ? " COPYRIGHTED" : "" - ); -} - -void print_avih(MainAVIHeader *h, int verbose_level) -{ - aviprint_printf("======= AVI Header =======\n"); - aviprint_printf("us/frame: %"PRId32" (fps=%5.3f)\n", h->dwMicroSecPerFrame, 1000000.0f / (float)h->dwMicroSecPerFrame); - aviprint_printf("max bytes/sec: %"PRId32"\n", h->dwMaxBytesPerSec); - aviprint_printf("padding: %"PRId32"\n", h->dwPaddingGranularity); - print_avih_flags(h, verbose_level); - aviprint_printf("frames total: %"PRId32" initial: %"PRId32"\n", h->dwTotalFrames, h->dwInitialFrames); - aviprint_printf("streams: %"PRId32"\n", h->dwStreams); - aviprint_printf("Suggested BufferSize: %"PRId32"\n", h->dwSuggestedBufferSize); - aviprint_printf("Size: %"PRId32" x %"PRId32"\n", h->dwWidth, h->dwHeight); - aviprint_printf("==========================\n"); -} - -void print_strh(AVIStreamHeader *h, int verbose_level) -{ - aviprint_printf("====== STREAM Header =====\n"); - aviprint_printf("Type: %.4s FCC: %.4s (%X)\n", (char *)&h->fccType, (char *)&h->fccHandler, (unsigned int)h->fccHandler); - aviprint_printf("Flags: %"PRId32"\n", h->dwFlags); - aviprint_printf("Priority: %d Language: %d\n", h->wPriority, h->wLanguage); - aviprint_printf("InitialFrames: %"PRId32"\n", h->dwInitialFrames); - aviprint_printf("Rate: %"PRId32"/%"PRId32" = %5.3f\n", h->dwRate, h->dwScale, (float)h->dwRate / (float)h->dwScale); - aviprint_printf("Start: %"PRId32" Len: %"PRId32"\n", h->dwStart, h->dwLength); - aviprint_printf("Suggested BufferSize: %"PRId32"\n", h->dwSuggestedBufferSize); - aviprint_printf("Quality %"PRId32"\n", h->dwQuality); - aviprint_printf("Sample size: %"PRId32"\n", h->dwSampleSize); - aviprint_printf("==========================\n"); -} - -void print_wave_header(WAVEFORMATEX *h, int verbose_level) -{ - aviprint_printf("======= WAVE Format =======\n"); - aviprint_printf("Format Tag: %d (0x%X)\n", h->wFormatTag, h->wFormatTag); - aviprint_printf("Channels: %d\n", h->nChannels); - aviprint_printf("Samplerate: %"PRId32"\n", h->nSamplesPerSec); - aviprint_printf("avg byte/sec: %"PRId32"\n", h->nAvgBytesPerSec); - aviprint_printf("Block align: %d\n", h->nBlockAlign); - aviprint_printf("bits/sample: %d\n", h->wBitsPerSample); - aviprint_printf("cbSize: %d\n", h->cbSize); - if (h->wFormatTag == 0x55 && h->cbSize >= 12) - { - printf("FIXME\n"); - /* MPEGLAYER3WAVEFORMAT* h2=(MPEGLAYER3WAVEFORMAT *)h; - aviprint_printf("mp3.wID=%d\n",h2->wID); - aviprint_printf("mp3.fdwFlags=0x%"PRIX32"\n",h2->fdwFlags); - aviprint_printf("mp3.nBlockSize=%d\n",h2->nBlockSize); - aviprint_printf("mp3.nFramesPerBlock=%d\n",h2->nFramesPerBlock); - aviprint_printf("mp3.nCodecDelay=%d\n",h2->nCodecDelay);*/ - } - else if (h->cbSize > 0) - { - int i; - uint8_t *p = (uint8_t *)(h + 1); - aviprint_printf("Unknown extra header dump: "); - for (i = 0; i < h->cbSize; i++) - aviprint_printf("[%x] ", p[i]); - aviprint_printf("\n"); - } - aviprint_printf("==========================================================================\n"); -} - - -void print_video_header(BITMAPINFOHEADER *h, int verbose_level) -{ - aviprint_printf("======= VIDEO Format ======\n"); - aviprint_printf(" biSize %d\n", h->biSize); - aviprint_printf(" biWidth %d\n", h->biWidth); - aviprint_printf(" biHeight %d\n", h->biHeight); - aviprint_printf(" biPlanes %d\n", h->biPlanes); - aviprint_printf(" biBitCount %d\n", h->biBitCount); - aviprint_printf(" biCompression %d='%.4s'\n", h->biCompression, (char *)&h->biCompression); - aviprint_printf(" biSizeImage %d\n", h->biSizeImage); - if (h->biSize > sizeof(BITMAPINFOHEADER)) - { - int i; - uint8_t *p = (uint8_t *)(h + 1); - aviprint_printf("Unknown extra header dump: "); - for (i = 0; i < h->biSize - sizeof(BITMAPINFOHEADER); i++) - aviprint_printf("[%x] ", *(p + i)); - aviprint_printf("\n"); - } - aviprint_printf("===========================\n"); -} - -void print_vprp(VideoPropHeader *vprp, int verbose_level) -{ - int i; - aviprint_printf("======= Video Properties Header =======\n"); - aviprint_printf("Format: %d VideoStandard: %d\n", - vprp->VideoFormatToken, vprp->VideoStandard); - aviprint_printf("VRefresh: %d HTotal: %d VTotal: %d\n", - vprp->dwVerticalRefreshRate, vprp->dwHTotalInT, vprp->dwVTotalInLines); - aviprint_printf("FrameAspect: %d:%d Framewidth: %d Frameheight: %d\n", - vprp->dwFrameAspectRatio >> 16, vprp->dwFrameAspectRatio & 0xffff, - vprp->dwFrameWidthInPixels, vprp->dwFrameHeightInLines); - aviprint_printf("Fields: %d\n", vprp->nbFieldPerFrame); - for (i = 0; i < vprp->nbFieldPerFrame; i++) - { - VIDEO_FIELD_DESC *vfd = &vprp->FieldInfo[i]; - aviprint_printf(" == Field %d description ==\n", i); - aviprint_printf(" CompressedBMHeight: %d CompressedBMWidth: %d\n", - vfd->CompressedBMHeight, vfd->CompressedBMWidth); - aviprint_printf(" ValidBMHeight: %d ValidBMWidth: %d\n", - vfd->ValidBMHeight, vfd->ValidBMWidth); - aviprint_printf(" ValidBMXOffset: %d ValidBMYOffset: %d\n", - vfd->ValidBMXOffset, vfd->ValidBMYOffset); - aviprint_printf(" VideoXOffsetInT: %d VideoYValidStartLine: %d\n", - vfd->VideoXOffsetInT, vfd->VideoYValidStartLine); - } - aviprint_printf("=======================================\n"); -} - -void print_index(AVIINDEXENTRY *idx, int idx_size, int verbose_level) -{ - int i; - unsigned int pos[256]; - unsigned int num[256]; - memset(pos, 0, sizeof(pos)); - memset(num, 0, sizeof(num)); - for (i = 0; i < idx_size; i++) - { - int id = avi_stream_id(idx[i].ckid); - if (id < 0 || id > 255) id = 255; - aviprint_printf("%5d: %.4s %4X %016"PRIX64" len:%6"PRId32" pos:%7d->%7.3f %7d->%7.3f\n", i, - (char *)&idx[i].ckid, - (unsigned int)idx[i].dwFlags & 0xffff, - (uint64_t)AVI_IDX_OFFSET(&idx[i]), -// idx[i].dwChunkOffset+demuxer->movi_start, - idx[i].dwChunkLength, - pos[id], (float)pos[id] / 18747.0f, - num[id], (float)num[id] / 23.976f - ); - pos[id] += idx[i].dwChunkLength; - ++num[id]; - } -} - -void print_avistdindex_chunk(avistdindex_chunk *h, int verbose_level) -{ - aviprint_printf("====== AVI Standard Index Header ========\n"); - aviprint_printf(" FCC (%.4s) dwSize (%d) wLongsPerEntry(%d)\n", h->fcc, h->dwSize, h->wLongsPerEntry); - aviprint_printf(" bIndexSubType (%d) bIndexType (%d)\n", h->bIndexSubType, h->bIndexType); - aviprint_printf(" nEntriesInUse (%d) dwChunkId (%.4s)\n", h->nEntriesInUse, h->dwChunkId); - aviprint_printf(" qwBaseOffset (0x%"PRIX64") dwReserved3 (%d)\n", h->qwBaseOffset, h->dwReserved3); - aviprint_printf("===========================\n"); -} -void print_avisuperindex_chunk(avisuperindex_chunk *h, int verbose_level) -{ - aviprint_printf("====== AVI Super Index Header ========\n"); - aviprint_printf(" FCC (%.4s) dwSize (%d) wLongsPerEntry(%d)\n", h->fcc, h->dwSize, h->wLongsPerEntry); - aviprint_printf(" bIndexSubType (%d) bIndexType (%d)\n", h->bIndexSubType, h->bIndexType); - aviprint_printf(" nEntriesInUse (%d) dwChunkId (%.4s)\n", h->nEntriesInUse, h->dwChunkId); - aviprint_printf(" dwReserved[0] (%d) dwReserved[1] (%d) dwReserved[2] (%d)\n", - h->dwReserved[0], h->dwReserved[1], h->dwReserved[2]); - aviprint_printf("===========================\n"); -} - diff --git a/libeplayer2/container/container.c b/libeplayer2/container/container.c deleted file mode 100644 index ce9dcbc..0000000 --- a/libeplayer2/container/container.c +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include - -#include "container.h" -#include "common.h" - -static const char FILENAME[] = "container.c"; - -static void printContainerCapabilities() -{ -int i, j; -printf("%s::%s\n", FILENAME, __FUNCTION__); -printf("Capabilities: "); -for (i = 0; AvailableContainer[i] != NULL; i++) - for (j = 0; AvailableContainer[i]->Capabilities[j] != NULL; j++) - printf("%s ", AvailableContainer[i]->Capabilities[j]); -printf("\n"); -} - -static int selectContainer(Context_t *context, char *extension) -{ - int i, j; - int ret = -1; - - printf("%s::%s\n", FILENAME, __FUNCTION__); - for (i = 0; AvailableContainer[i] != NULL; i++) - for (j = 0; AvailableContainer[i]->Capabilities[j] != NULL; j++) - if (!strcasecmp(AvailableContainer[i]->Capabilities[j], extension)) - { - context->container->selectedContainer = AvailableContainer[i]; - printf("Selected Container: %s\n", context->container->selectedContainer->Name); - ret = 0; - break; - } - - if (ret != 0) - { - printf("No Container found :-(\n"); - } - - return ret; -} - - -static int Command(Context_t *context, ContainerCmd_t command, void *argument) -{ - printf("%s::%s\n", FILENAME, __FUNCTION__); - - int ret = 0; - - switch (command) - { - case CONTAINER_ADD: - { - ret = selectContainer(context, (char *) argument); - break; - } - case CONTAINER_CAPABILITIES: - { - printContainerCapabilities(); - break; - } - case CONTAINER_DEL: - { - context->container->selectedContainer = NULL; - break; - } - default: - printf("%s::%s ContainerCmd %d not supported!\n", FILENAME, __FUNCTION__, command); - break; - } - - return ret; -} - -extern Container_t SrtContainer; -extern Container_t SsaContainer; - -ContainerHandler_t ContainerHandler = -{ - "Output", - NULL, - &SrtContainer, - &SsaContainer, - Command, -}; diff --git a/libeplayer2/container/container_asf.c b/libeplayer2/container/container_asf.c deleted file mode 100644 index ca9a72e..0000000 --- a/libeplayer2/container/container_asf.c +++ /dev/null @@ -1,585 +0,0 @@ -#include - -// LIBEPLAYER2 Headers -#include "common.h" -#include "container.h" -#include "manager.h" -// End of LIBEPLAYER2 Headers - -// MPLAYER Headers -#include "demuxer.h" -#include "stream.h" -#include "stheader.h" -// End of MPLAYER Headers - -// Extern Declarations -extern int asf_check_header(demuxer_t *demuxer); -extern int demux_asf_fill_buffer(demuxer_t *demux, demux_stream_t *ds); -extern demuxer_t *demux_open_asf(demuxer_t *demuxer); -extern void demux_close_asf(demuxer_t *demuxer); -extern void demux_seek_asf(demuxer_t *demuxer, float rel_seek_secs, float audio_delay, int flags); -// End of Extern Declarations - - - -static const char FILENAME[] = "container_asf.c"; - -#define CodeToInteger(a,b,c,d) ((a << 0) | (b << 8) | (c << 16) | (d <<24)) - -static demux_stream_t *ds = NULL; -static sh_audio_t *sh_audio = NULL; -static sh_video_t *sh_video = NULL; - -static pthread_t PlayThread; -static int hasPlayThreadStarted = 0; -//static int isFirstAudioFrame = 1; - -static int whileSeeking = 0; - - -int ASFInit(Context_t *context, char *filename) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - int i = 0; - - ds = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(ds, 0, sizeof(demux_stream_t)); - - ds->demuxer = (demuxer_t *)malloc(sizeof(demuxer_t)); - memset(ds->demuxer, 0, sizeof(demuxer_t)); - - ds->demuxer->audio = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(ds->demuxer->audio, 0, sizeof(demux_stream_t)); - - ds->demuxer->video = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(ds->demuxer->video, 0, sizeof(demux_stream_t)); - - ds->demuxer->stream = (stream_t *)malloc(sizeof(stream_t)); - memset(ds->demuxer->stream, 0, sizeof(stream_t)); - - ds->demuxer->stream->fd = context->playback->fd; - - - read(ds->demuxer->stream->fd, ds->demuxer->stream->buffer, 2048); - - - ds->demuxer->stream->start_pos = 0; - ds->demuxer->stream->flags = 6; - ds->demuxer->stream->sector_size = 0; - ds->demuxer->stream->buf_pos = 0; - ds->demuxer->stream->buf_len = 2048; - ds->demuxer->stream->pos = 2048; - ds->demuxer->stream->start_pos = 0; - ds->demuxer->stream->type = STREAMTYPE_STREAM; - ds->demuxer->stream->end_pos = 0; - ds->demuxer->stream->eof = 0; - ds->demuxer->stream->cache_pid = 0; - - - - ds->demuxer->video->id = -1; - ds->demuxer->audio->id = -1; - - //printf("%s::%d\n", __FUNCTION__, __LINE__); - asf_check_header(ds->demuxer); - - demux_open_asf(ds->demuxer); - //printf("%s::%d\n", __FUNCTION__, __LINE__); - - - for (i = 0; i < MAX_V_STREAMS; i++) - { - if (ds->demuxer->v_streams[i] == NULL) continue; - - sh_video = (sh_video_t *)ds->demuxer->v_streams[i]; - - if (sh_video) - { - printf("V: %d\n", sh_video->vid); - - if (i == 0) - { - //ds->demuxer->video->sh = sh_video; - ds->demuxer->video->id = sh_video->vid; - } - - char *vcodec = (char *)&sh_video->bih->biCompression; - - printf("biCompression: %s\n", vcodec); - - if (!strncmp(vcodec, "wmv3", 4) || !strncmp(vcodec, "WMV3", 4)) - { - Track_t Video = - { - "eng", - "V_WMV", - sh_video->vid, - }; - context->manager->video->Command(context, MANAGER_ADD, &Video); - - } - else if (!strncmp(vcodec, "wvc1", 4) || !strncmp(vcodec, "WVC1", 4)) - { - Track_t Video = - { - "eng", - "V_VC1", - sh_video->vid, - }; - context->manager->video->Command(context, MANAGER_ADD, &Video); - } - } - } - - for (i = 0; i < MAX_A_STREAMS; i++) - { - if (ds->demuxer->a_streams[i] == NULL) continue; - - sh_audio = (sh_audio_t *)ds->demuxer->a_streams[i]; - - if (sh_audio) - { - printf("A: %d\n", sh_audio->aid); - - if (i == 0) - { - ds->demuxer->audio->id = sh_audio->aid; - //ds->demuxer->audio->sh = sh_audio; - } - - printf("WF: 0x%08x\n", sh_audio->wf->wFormatTag); - - if (sh_audio->wf->wFormatTag == 0x161) // WMA2 - { - Track_t Audio = - { - "und", - "A_WMA", - sh_audio->aid, - }; - context->manager->audio->Command(context, MANAGER_ADD, &Audio); - } - else if (sh_audio->wf->wFormatTag == 0x162) // WMAP - { - Track_t Audio = - { - "und", - "A_WMA", - sh_audio->aid, - }; - //Currently not supported - context->manager->audio->Command(context, MANAGER_ADD, &Audio); - } - - - } - } - - //exit(0); - - return 0; -} - - -extern unsigned char *STREAMHEADERBUFFER; -extern unsigned int STREAMHEADERBUFFERSIZE; - -typedef struct -{ - unsigned char privateData[4]; - unsigned int width; - unsigned int height; - unsigned int framerate; -} bwmv_t; - -extern unsigned char ASF_PRIVATE_DATA[4]; - - -#define INVALID_PTS_VALUE 0x200000000ull -void ASFGenerateParcel(Context_t *context, const demuxer_t *demuxer) -{ - - demux_stream_t *video = demuxer->video; - demux_stream_t *audio = demuxer->audio; - - unsigned long long int Pts = 0; - - //printf("P\n"); - if (audio->first != NULL) - { - //printf("A\n"); - demux_packet_t *current = audio->first; - //printf("PTS: %f\n", current->pts); - Pts = (current->pts * 90000); - - while (current != NULL) - { - context->output->audio->Write(context, current->buffer, current->len, Pts, STREAMHEADERBUFFER, STREAMHEADERBUFFERSIZE, 0, "audio"); - - demux_packet_t *dn = current->next; - free_demux_packet(current); - current = dn; - //current = current->next; - - Pts = INVALID_PTS_VALUE; - } - - audio->first = audio->last = NULL; - audio->packs = 0; // !!!!! - audio->bytes = 0; - if (audio->current) - free_demux_packet(audio->current); - audio->current = NULL; - audio->buffer = NULL; - audio->buffer_pos = audio->buffer_size; - audio->pts = 0; - audio->pts_bytes = 0; - - } - - if (video->first != NULL) - { - //printf("V\n"); - demux_packet_t *current = video->first; - - //if (!(current->flags&0x10)) { //current frame isn't a keyframe - //printf("\tNORMALFRAME, "); - // Pts = INVALID_PTS_VALUE; - //} else { - // //printf("\tKEYFRAME, "); - // Pts = (current->pts * 90000); - //} - - - while (current != NULL) - { - Pts = (current->pts * 90000); - //printf("PTS: %f (%u)\n", current->pts, Pts); - - sh_video = demuxer->video->sh; - sh_video->ds = demuxer->video; - - bwmv_t *priv = (bwmv_t *)malloc(sizeof(bwmv_t)); - memcpy(priv->privateData, ASF_PRIVATE_DATA, 4); - priv->width = sh_video->bih->biWidth; - priv->height = sh_video->bih->biHeight; - priv->framerate = 333667; - - context->output->video->Write(context, current->buffer, current->len, Pts, (unsigned char *) priv, sizeof(bwmv_t), 0, "video"); - - free(priv); - - demux_packet_t *dn = current->next; - free_demux_packet(current); - current = dn; - //current = current->next; - //Pts = INVALID_PTS_VALUE; - } - - video->first = video->last = NULL; - video->packs = 0; // !!!!! - video->bytes = 0; - if (video->current) - free_demux_packet(video->current); - video->current = NULL; - video->buffer = NULL; - video->buffer_pos = video->buffer_size; - video->pts = 0; - video->pts_bytes = 0; - - } -} - - - -static void ASFThread(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - while (context->playback->isCreationPhase) - { -#ifdef DEBUG - printf("%s::%s Thread waiting for end of init phase...\n", FILENAME, __FUNCTION__); -#endif - } - -#ifdef DEBUG - printf("%s::%s Running!\n", FILENAME, __FUNCTION__); -#endif - - while (context && context->playback && context->playback->isPlaying) - { - //printf("%s -->\n", __FUNCTION__); - - //IF MOVIE IS PAUSED, WAIT - if (context->playback->isPaused) - { -#ifdef DEBUG - printf("%s::%s paused\n", FILENAME, __FUNCTION__); -#endif - usleep(100000); - continue; - } - - if (context->playback->isSeeking || whileSeeking) - { -#ifdef DEBUG - printf("%s::%s seeking\n", FILENAME, __FUNCTION__); -#endif - usleep(100000); - continue; - } - - //getASFMutex(FILENAME, __FUNCTION__,__LINE__); - - - - if (!demux_asf_fill_buffer(ds->demuxer, ds)) - { -#ifdef DEBUG - printf("%s::%s demux_asf_fill_buffer failed!\n", FILENAME, __FUNCTION__); -#endif - //releaseASFMutex(FILENAME, __FUNCTION__,__LINE__); - - break; - } - else - { - ASFGenerateParcel(context, ds->demuxer); - if (ds->demuxer->sub != NULL && ds->demuxer->sub->first != NULL) - { - ds_free_packs(ds->demuxer->sub); - } - - /* Dont free the packs, as the fragments would be deleted - if (ds->demuxer->audio != NULL && ds->demuxer->audio->first != NULL) { - ds_free_packs(ds->demuxer->audio); - } - - if (ds->demuxer->video != NULL && ds->demuxer->video->first != NULL) { - ds_free_packs(ds->demuxer->video); - } - */ - - //releaseASFMutex(FILENAME, __FUNCTION__,__LINE__); - } - } - - hasPlayThreadStarted = 0; // prevent locking situation when calling PLAYBACK_TERM - - context->playback->Command(context, PLAYBACK_TERM, NULL); - -#ifdef DEBUG - printf("%s::%s terminating\n", FILENAME, __FUNCTION__); -#endif -} - - -static int ASFPlay(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int error; - int ret = 0; - pthread_attr_t attr; - -#ifdef DEBUG - if (context && context->playback && context->playback->isPlaying) - { - printf("%s::%s is Playing\n", FILENAME, __FUNCTION__); - } - else - { - printf("%s::%s is NOT Playing\n", FILENAME, __FUNCTION__); - } -#endif - - if (hasPlayThreadStarted == 0) - { - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - - if ((error = pthread_create(&PlayThread, &attr, (void *)&ASFThread, context)) != 0) - { -#ifdef DEBUG - printf("%s::%s Error creating thread, error:%d:%s\n", FILENAME, __FUNCTION__, error, strerror(error)); -#endif - hasPlayThreadStarted = 0; - ret = -1; - } - else - { -#ifdef DEBUG - printf("%s::%s Created thread\n", FILENAME, __FUNCTION__); -#endif - hasPlayThreadStarted = 1; - } - } - else - { -#ifdef DEBUG - printf("%s::%s A thread already exists!\n", FILENAME, __FUNCTION__); -#endif - ret = -1; - } - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -static int ASFStop(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int i; - int ret = 0; - int wait_time = 20; - - while ((hasPlayThreadStarted != 0) && (wait_time--) > 0) - { -#ifdef DEBUG - printf("%s::%s Waiting for ASF thread to terminate itself, will try another %d times\n", FILENAME, __FUNCTION__, wait_time); -#endif - usleep(100000); - } - - if (wait_time == 0) - { -#ifdef DEBUG - printf("%s::%s Timeout waiting for ASF thread!\n", FILENAME, __FUNCTION__); -#endif - ret = -1; - } - else - { - //getASFMutex(FILENAME, __FUNCTION__,__LINE__); - - if (ds && ds->demuxer) - { - demux_close_asf(ds->demuxer); - - free(ds->demuxer->stream); - ds->demuxer->stream = NULL; - - free(ds->demuxer->sub); - ds->demuxer->sub = NULL; - - free(ds->demuxer->video); - ds->demuxer->video = NULL; - - free(ds->demuxer->audio); - ds->demuxer->audio = NULL; - - for (i = 0; i < MAX_A_STREAMS; i++) - { - free(ds->demuxer->a_streams[i]); - ds->demuxer->a_streams[i] = NULL; - } - - for (i = 0; i < MAX_V_STREAMS; i++) - { - free(ds->demuxer->v_streams[i]); - ds->demuxer->v_streams[i] = NULL; - } - - for (i = 0; i < MAX_S_STREAMS; i++) - { - free(ds->demuxer->s_streams[i]); - ds->demuxer->s_streams[i] = NULL; - } - - free(ds->demuxer); - ds->demuxer = NULL; - } - - free(ds); - ds = NULL; - - //releaseASFMutex(FILENAME, __FUNCTION__,__LINE__); - } - - return ret; -} - -static int Command(void *_context, ContainerCmd_t command, void *argument) -{ - Context_t *context = (Context_t *) _context; -#ifdef DEBUG - printf("%s::%s Command %d\n", FILENAME, __FUNCTION__, command); -#endif - - int ret = 0; - - switch (command) - { - case CONTAINER_INIT: - { - char *FILENAME = (char *)argument; - ret = ASFInit(context, FILENAME); - break; - } - case CONTAINER_PLAY: - { - ret = ASFPlay(context); - break; - } - case CONTAINER_STOP: - { - ret = ASFStop(context); - break; - } - case CONTAINER_SEEK: - { - //if (ds && ds->demuxer) - // demux_audio_seek (ds->demuxer, 100.0, 100, 0); - break; - } - case CONTAINER_LENGTH: - { - //double length = 0; - //if (ds != NULL && ds->demuxer != NULL && AUDIOGetLength(ds->demuxer, &length)!=0) - // *((double*)argument) = (double)0; - //else - // *((double*)argument) = (double)length; - break; - } - case CONTAINER_INFO: - { - //if (ds && ds->demuxer) - // AUDIOGetInfo(ds->demuxer, (char **)argument); - break; - } - default: -#ifdef DEBUG - printf("%s::%s ContainerCmd %d not supported!\n", FILENAME, __FUNCTION__, command); -#endif - - break; - } - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -static char *ASFCapabilities[] = { "asf", "wmv", "wma", NULL }; - -Container_t ASFContainer = -{ - "ASF", - &Command, - ASFCapabilities, -}; diff --git a/libeplayer2/container/demux_asf.c b/libeplayer2/container/demux_asf.c deleted file mode 100644 index 41a8450..0000000 --- a/libeplayer2/container/demux_asf.c +++ /dev/null @@ -1,837 +0,0 @@ -/* - * ASF file parser for DEMUXER v0.3 - * copyright (c) 2001 A'rpi/ESP-team - * - * This file is part of MPlayer. - * - * MPlayer is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * MPlayer is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with MPlayer; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include -#include -#include -#include - -#include "config.h" -#include "mp_msg.h" -#ifndef __sh__ -#include "help_mp.h" -#else -#include "help_mp-en.h" -#endif - -#ifndef __sh__ -#include "stream/stream.h" -#else -#include "stream.h" -#endif -#include "asf.h" -#include "demuxer.h" - -#ifndef __sh__ -#include "libvo/fastmemcpy.h" -#include "libavutil/intreadwrite.h" -#else -#define fast_memcpy(a,b,c) memcpy(a,b,c) -#include "intreadwrite.h" -#endif - -// defined at asfheader.c: - -int asf_check_header(demuxer_t *demuxer); -int read_asf_header(demuxer_t *demuxer, struct asf_priv *asf); - -// based on asf file-format doc by Eugene [http://divx.euro.ru] - -/** - * \brief reads int stored in number of bytes given by len - * \param ptr pointer to read from, is incremented appropriately - * \param len lowest 2 bits indicate number of bytes to read - * \param def default value to return if len is invalid - */ -static inline unsigned read_varlen(uint8_t **ptr, int len, int def) -{ - const uint8_t *p = *ptr; - len &= 3; - switch (len) - { - case 1: - *ptr += 1; - return *p; - case 2: - *ptr += 2; - return AV_RL16(p); - case 3: - *ptr += 4; - return AV_RL32(p); - } - return def; -} - -/** - * \brief checks if there is enough data to read the bytes given by len - * \param ptr pointer to read from - * \param endptr pointer to the end of the buffer - * \param len lowest 2 bits indicate number of bytes to read - */ -static inline int check_varlen(uint8_t *ptr, uint8_t *endptr, int len) -{ - return len & 3 ? ptr + (1 << ((len & 3) - 1)) <= endptr : 1; -} - -static void asf_descrambling(unsigned char **src, unsigned len, struct asf_priv *asf) -{ - unsigned char *dst; - unsigned char *s2 = *src; - unsigned i = 0, x, y; - if (len > UINT_MAX - MP_INPUT_BUFFER_PADDING_SIZE) - return; - dst = malloc(len + MP_INPUT_BUFFER_PADDING_SIZE); - while (len >= asf->scrambling_h * asf->scrambling_w * asf->scrambling_b + i) - { -// mp_msg(MSGT_DEMUX,MSGL_DBG4,"descrambling! (w=%d b=%d)\n",w,asf_scrambling_b); - //i+=asf_scrambling_h*asf_scrambling_w; - for (x = 0; x < asf->scrambling_w; x++) - for (y = 0; y < asf->scrambling_h; y++) - { - fast_memcpy(dst + i, s2 + (y * asf->scrambling_w + x)*asf->scrambling_b, asf->scrambling_b); - i += asf->scrambling_b; - } - s2 += asf->scrambling_h * asf->scrambling_w * asf->scrambling_b; - } - //if(ilast_vid_seq = -1; - asf->vid_ext_timing_index = -1; - asf->aud_ext_timing_index = -1; - asf->vid_ext_frame_index = -1; -} - -static void demux_asf_append_to_packet(demux_packet_t *dp, unsigned char *data, int len, int offs) -{ - if (dp->len != offs && offs != -1) mp_msg(MSGT_DEMUX, MSGL_V, "warning! fragment.len=%d BUT next fragment offset=%d \n", dp->len, offs); - dp->buffer = realloc(dp->buffer, dp->len + len + MP_INPUT_BUFFER_PADDING_SIZE); - fast_memcpy(dp->buffer + dp->len, data, len); - memset(dp->buffer + dp->len + len, 0, MP_INPUT_BUFFER_PADDING_SIZE); - mp_dbg(MSGT_DEMUX, MSGL_DBG4, "data appended! %d+%d\n", dp->len, len); - dp->len += len; -} - -static int demux_asf_read_packet(demuxer_t *demux, unsigned char *data, int len, int id, int seq, uint64_t time, unsigned short dur, int offs, int keyframe) -{ - struct asf_priv *asf = demux->priv; - demux_stream_t *ds = NULL; - int close_seg = 0; - - mp_dbg(MSGT_DEMUX, MSGL_DBG4, "demux_asf.read_packet: id=%d seq=%d len=%d\n", id, seq, len); - - if (demux->video->id == -1) - if (demux->v_streams[id]) - demux->video->id = id; - - if (demux->audio->id == -1) - if (demux->a_streams[id]) - demux->audio->id = id; - - if (id == demux->audio->id) - { - // audio - ds = demux->audio; - if (!ds->sh) - { - ds->sh = demux->a_streams[id]; - mp_msg(MSGT_DEMUX, MSGL_V, "Auto-selected ASF audio ID = %d\n", ds->id); - } - } - else if (id == demux->video->id) - { - // video - ds = demux->video; - if (!ds->sh) - { - ds->sh = demux->v_streams[id]; - mp_msg(MSGT_DEMUX, MSGL_V, "Auto-selected ASF video ID = %d\n", ds->id); - } - } - - if (ds) - { - if (ds->asf_packet) - { - demux_packet_t *dp = ds->asf_packet; - - if (ds == demux->video && asf->asf_is_dvr_ms) - { - if (asf->new_vid_frame_seg) - { - dp->pos = demux->filepos; - close_seg = 1; - } - else seq = ds->asf_seq; - } - else close_seg = ds->asf_seq != seq; - - if (close_seg) - { - // closed segment, finalize packet: - if (ds == demux->audio) - if (asf->scrambling_h > 1 && asf->scrambling_w > 1 && asf->scrambling_b > 0) - asf_descrambling(&ds->asf_packet->buffer, ds->asf_packet->len, asf); - ds_add_packet(ds, ds->asf_packet); - - ds->asf_packet = NULL; - } - else - { - // append data to it! - demux_asf_append_to_packet(dp, data, len, offs); - // we are ready now. - return 1; - } - } - // create new packet: - { - demux_packet_t *dp; - if (offs > 0) - { - mp_msg(MSGT_DEMUX, MSGL_V, "warning! broken fragment, %d bytes missing \n", offs); - - return 0; - } - dp = new_demux_packet(len); - fast_memcpy(dp->buffer, data, len); - if (asf->asf_is_dvr_ms) - dp->pts = time * 0.0000001; - else - dp->pts = time * 0.001; - dp->flags = keyframe; -// if(ds==demux->video) printf("ASF time: %8d dur: %5d \n",time,dur); - dp->pos = demux->filepos; - ds->asf_packet = dp; - ds->asf_seq = seq; - // we are ready now. - return 1; - } - } - - return 0; -} - -/***************************************************************** - * \brief read the replicated data associated with each segment - * \parameter pp reference to replicated data - * \parameter id stream number - * \parameter seq media object number - * \parameter keyframe key frame indicator - set to zero if keyframe, non-zero otherwise - * \parameter seg_time set to payload time when valid, if audio or new video frame payload, zero otherwise - * - */ -static void get_payload_extension_data(demuxer_t *demux, unsigned char **pp, unsigned char id, unsigned int seq, int *keyframe, uint64_t *seg_time) -{ - struct asf_priv *asf = demux->priv; - uint64_t payload_time; //100ns units - int i, ext_max, ext_timing_index; - uint8_t *pi = *pp + 4; - - if (demux->video->id == -1) - if (demux->v_streams[id]) - demux->video->id = id; - - if (demux->audio->id == -1) - if (demux->a_streams[id]) - demux->audio->id = id; - - if (id != demux->video->id && id != demux->audio->id) return; - - if (id == demux->video->id) - { - ext_max = asf->vid_repdata_count; - ext_timing_index = asf->vid_ext_timing_index; - } - else - { - ext_max = asf->aud_repdata_count; - ext_timing_index = asf->aud_ext_timing_index; - } - - *seg_time = 0.0; - asf->new_vid_frame_seg = 0; - - for (i = 0; i < ext_max; i++) - { - uint16_t payextsize; - uint8_t segment_marker; - - if (id == demux->video->id) - payextsize = asf->vid_repdata_sizes[i]; - else - payextsize = asf->aud_repdata_sizes[i]; - - if (payextsize == 65535) - { - payextsize = AV_RL16(pi); - pi += 2; - } - - // if this is the timing info extension then read the payload time - if (i == ext_timing_index) - payload_time = AV_RL64(pi + 8); - - // if this is the video frame info extension then - // set the keyframe indicator, the 'new frame segment' indicator - // and (initially) the 'frame time' - if (i == asf->vid_ext_frame_index && id == demux->video->id) - { - segment_marker = pi[0]; - // Known video stream segment_marker values that - // contain useful information: - // - // NTSC/ATSC (29.97fps): 0X4A 01001010 - // 0X4B 01001011 - // 0X49 01001001 - // - // PAL/ATSC (25fps): 0X3A 00111010 - // 0X3B 00111011 - // 0X39 00111001 - // - // ATSC progressive (29.97fps): 0X7A 01111010 - // 0X7B 01111011 - // 0X79 01111001 - // 11111111 - // ^ this is new video frame marker - // - // ^^^^ these bits indicate the framerate - // 0X4 is 29.97i, 0X3 is 25i, 0X7 is 29.97p, ???=25p - // - // ^^^ these bits indicate the frame type: - // 001 means I-frame - // 010 and 011 probably mean P and B - - asf->new_vid_frame_seg = (0X08 & segment_marker) && seq != asf->last_vid_seq; - - if (asf->new_vid_frame_seg) asf->last_vid_seq = seq; - - if (asf->avg_vid_frame_time == 0) - { - // set the average frame time initially (in 100ns units). - // This is based on what works for known samples. - // It can be extended if more samples of different types can be obtained. - if (((segment_marker & 0XF0) >> 4) == 4) - { - asf->avg_vid_frame_time = (uint64_t)((1.001 / 30.0) * 10000000.0); - asf->know_frame_time = 1; - } - else if (((segment_marker & 0XF0) >> 4) == 3) - { - asf->avg_vid_frame_time = (uint64_t)(0.04 * 10000000.0); - asf->know_frame_time = 1; - } - else if (((segment_marker & 0XF0) >> 4) == 6) - { - asf->avg_vid_frame_time = (uint64_t)(0.02 * 10000000.0); - asf->know_frame_time = 1; - } - else if (((segment_marker & 0XF0) >> 4) == 7) - { - asf->avg_vid_frame_time = (uint64_t)((1.001 / 60.0) * 10000000.0); - asf->know_frame_time = 1; - } - else - { - // we dont know the frame time initially so - // make a guess and then recalculate as we go. - asf->avg_vid_frame_time = (uint64_t)((1.001 / 60.0) * 10000000.0); - asf->know_frame_time = 0; - } - } - *keyframe = (asf->new_vid_frame_seg && (segment_marker & 0X07) == 1); - } - pi += payextsize; - } - - if (id == demux->video->id && asf->new_vid_frame_seg) - { - asf->vid_frame_ct++; - // Some samples only have timings on key frames and - // the rest contain non-cronological timestamps. Interpolating - // the values between key frames works for all samples. - if (*keyframe) - { - asf->found_first_key_frame = 1; - if (!asf->know_frame_time && asf->last_key_payload_time > 0) - { - // We dont know average frametime so recalculate. - // Giving precedence to the 'weight' of the existing - // average limits damage done to new value when there is - // a sudden time jump which happens occasionally. - asf->avg_vid_frame_time = - (0.9 * asf->avg_vid_frame_time) + - (0.1 * ((payload_time - asf->last_key_payload_time) / asf->vid_frame_ct)); - } - asf->last_key_payload_time = payload_time; - asf->vid_frame_ct = 1; - *seg_time = payload_time; - } - else - *seg_time = (asf->last_key_payload_time + (asf->avg_vid_frame_time * (asf->vid_frame_ct - 1))); - } - - if (id == demux->audio->id) - { - if (payload_time != -1) - asf->last_aud_diff = payload_time - asf->last_aud_pts; - asf->last_aud_pts += asf->last_aud_diff; - *seg_time = asf->last_aud_pts; - } -} -//static int num_elementary_packets100=0; -//static int num_elementary_packets101=0; - -// return value: -// 0 = EOF or no stream found -// 1 = successfully read a packet -#ifndef __sh__ -static int demux_asf_fill_buffer(demuxer_t *demux, demux_stream_t *ds) -{ -#else -int demux_asf_fill_buffer(demuxer_t *demux, demux_stream_t *ds) -{ -#endif - struct asf_priv *asf = demux->priv; - - demux->filepos = stream_tell(demux->stream); - // Brodcast stream have movi_start==movi_end - // Better test ? - if ((demux->movi_start < demux->movi_end) && (demux->filepos >= demux->movi_end)) - { - demux->stream->eof = 1; - return 0; - } - - stream_read(demux->stream, asf->packet, asf->packetsize); - if (demux->stream->eof) return 0; // EOF - if (asf->packetsize < 2) return 0; // Packet too short - - { - unsigned char *p = asf->packet; - unsigned char *p_end = asf->packet + asf->packetsize; - unsigned char flags = p[0]; - unsigned char segtype = p[1]; - unsigned padding; - unsigned plen; - unsigned sequence; - unsigned long time = 0; - unsigned short duration = 0; - - int segs = 1; - unsigned char segsizetype = 0x80; - int seg = -1; - - if (mp_msg_test(MSGT_DEMUX, MSGL_DBG2)) - { - int i; - for (i = 0; i < FFMIN(16, asf->packetsize); i++) printf(" %02X", asf->packet[i]); - printf("\n"); - } - - // skip ECC data if present by testing bit 7 of flags - // 1xxxbbbb -> ecc data present, skip bbbb byte(s) - // 0xxxxxxx -> payload parsing info starts - if (flags & 0x80) - { - p += (flags & 0x0f) + 1; - if (p + 1 >= p_end) return 0; // Packet too short - flags = p[0]; - segtype = p[1]; - } - - //if(segtype!=0x5d) printf("Warning! packet[4] != 0x5d \n"); - - p += 2; // skip flags & segtype - - // Read packet size (plen): - if (!check_varlen(p, p_end, flags >> 5)) return 0; // Not enough data - plen = read_varlen(&p, flags >> 5, 0); - - // Read sequence: - if (!check_varlen(p, p_end, flags >> 1)) return 0; // Not enough data - sequence = read_varlen(&p, flags >> 1, 0); - - // Read padding size (padding): - if (!check_varlen(p, p_end, flags >> 3)) return 0; // Not enough data - padding = read_varlen(&p, flags >> 3, 0); - - if (((flags >> 5) & 3) != 0) - { - // Explicit (absoulte) packet size - mp_dbg(MSGT_DEMUX, MSGL_DBG2, "Explicit packet size specified: %d \n", plen); - if (plen > asf->packetsize) mp_msg(MSGT_DEMUX, MSGL_V, "Warning! plen>packetsize! (%d>%d) \n", plen, asf->packetsize); - } - else - { - // Padding (relative) size - plen = asf->packetsize - padding; - } - - // Read time & duration: - if (p + 5 >= p_end) return 0; // Packet too short - time = AV_RL32(p); - p += 4; - duration = AV_RL16(p); - p += 2; - - // Read payload flags: - if (flags & 1) - { - // multiple sub-packets - if (p >= p_end) return 0; // Packet too short - segsizetype = p[0] >> 6; - segs = p[0] & 0x3F; - ++p; - } - mp_dbg(MSGT_DEMUX, MSGL_DBG4, "%08"PRIu64": flag=%02X segs=%d seq=%u plen=%u pad=%u time=%ld dur=%d\n", - (uint64_t)demux->filepos, flags, segs, sequence, plen, padding, time, duration); - - for (seg = 0; seg < segs; seg++) - { - //ASF_segmhdr_t* sh; - unsigned char streamno; - unsigned int seq; - unsigned int x; // offset or timestamp - unsigned int rlen; - // - int len; - uint64_t time2 = 0; - int keyframe = 0; - - if (p >= p_end) - { - mp_msg(MSGT_DEMUX, MSGL_V, "Warning! invalid packet 1, aborting parsing...\n"); - break; - } - - if (mp_msg_test(MSGT_DEMUX, MSGL_DBG2)) - { - int i; - printf("seg %d:", seg); - for (i = 0; i < FFMIN(16, p_end - p); i++) printf(" %02X", p[i]); - printf("\n"); - } - - streamno = p[0] & 0x7F; - if (p[0] & 0x80) keyframe = 1; - p++; - - // Read media object number (seq): - if (!check_varlen(p, p_end, segtype >> 4)) break; // Not enough data - seq = read_varlen(&p, segtype >> 4, 0); - - // Read offset or timestamp: - if (!check_varlen(p, p_end, segtype >> 2)) break; // Not enough data - x = read_varlen(&p, segtype >> 2, 0); - - // Read replic.data len: - if (!check_varlen(p, p_end, segtype)) break; // Not enough data - rlen = read_varlen(&p, segtype, 0); - -// printf("### rlen=%d \n",rlen); - - switch (rlen) - { - case 0x01: // 1 = special, means grouping - //printf("grouping: %02X \n",p[0]); - ++p; // skip PTS delta - break; - default: - if (rlen >= 8) - { - p += 4; // skip object size - if (p + 3 >= p_end) break; // Packet too short - time2 = AV_RL32(p); // read PTS - if (asf->asf_is_dvr_ms) - get_payload_extension_data(demux, &p, streamno, seq, &keyframe, &time2); - p += rlen - 4; - } - else - { - mp_msg(MSGT_DEMUX, MSGL_V, "unknown segment type (rlen): 0x%02X \n", rlen); - time2 = 0; // unknown - p += rlen; - } - } - - if (flags & 1) - { - // multiple segments - if (!check_varlen(p, p_end, segsizetype)) break; // Not enough data - len = read_varlen(&p, segsizetype, plen - (p - asf->packet)); - } - else - { - // single segment - len = plen - (p - asf->packet); - } - if (len < 0 || (p + len) > p_end) - { - mp_msg(MSGT_DEMUX, MSGL_V, "ASF_parser: warning! segment len=%d\n", len); - len = p_end - p; - } - mp_dbg(MSGT_DEMUX, MSGL_DBG4, " seg #%d: streamno=%d seq=%d type=%02X len=%d\n", seg, streamno, seq, rlen, len); - switch (rlen) - { - case 0x01: - // GROUPING: - //printf("ASF_parser: warning! grouping (flag=1) not yet supported!\n",len); - //printf(" total: %d \n",len); - while (len > 0) - { - int len2 = p[0]; - p++; - //printf(" group part: %d bytes\n",len2); - if (len2 > len - 1 || len2 < 0) break; // Not enough data - len2 = FFMIN(len2, asf->packetsize); - demux_asf_read_packet(demux, p, len2, streamno, seq, x, duration, -1, keyframe); - p += len2; - len -= len2 + 1; - ++seq; - } - if (len != 0) - { - mp_msg(MSGT_DEMUX, MSGL_V, "ASF_parser: warning! groups total != len\n"); - } - break; - default: - // NO GROUPING: - //printf("fragment offset: %d \n",sh->x); - if (len <= 0) break; - if (!asf->asf_is_dvr_ms || asf->found_first_key_frame) - { - len = FFMIN(len, asf->packetsize); - demux_asf_read_packet(demux, p, len, streamno, seq, time2, duration, x, keyframe); - } - p += len; - break; - } - - } // for segs - return 1; // success - } - - mp_msg(MSGT_DEMUX, MSGL_V, "%08"PRIX64": UNKNOWN TYPE %02X %02X %02X %02X %02X...\n", (int64_t)demux->filepos, asf->packet[0], asf->packet[1], asf->packet[2], asf->packet[3], asf->packet[4]); - return 0; -} - -#include "stheader.h" -#ifndef __sh__ -void skip_audio_frame(sh_audio_t *sh_audio); -#endif -#ifndef __sh__ -static void demux_seek_asf(demuxer_t *demuxer, float rel_seek_secs, float audio_delay, int flags) -{ -#else -void demux_seek_asf(demuxer_t *demuxer, float rel_seek_secs, float audio_delay, int flags) -{ -#endif - struct asf_priv *asf = demuxer->priv; - demux_stream_t *d_audio = demuxer->audio; - demux_stream_t *d_video = demuxer->video; - sh_audio_t *sh_audio = d_audio->sh; -// sh_video_t *sh_video=d_video->sh; - - //FIXME: OFF_T - didn't test ASF case yet (don't have a large asf...) - //FIXME: reports good or bad to steve@daviesfam.org please - - //================= seek in ASF ========================== - float p_rate = asf->packetrate; // packets / sec - off_t rel_seek_packs = (flags & SEEK_FACTOR) ? // FIXME: int may be enough? - (rel_seek_secs * (demuxer->movi_end - demuxer->movi_start) / asf->packetsize) : - (rel_seek_secs * p_rate); - off_t rel_seek_bytes = rel_seek_packs * asf->packetsize; - off_t newpos; - //printf("ASF: packs: %d duration: %d \n",(int)fileh.packets,*((int*)&fileh.duration)); -// printf("ASF_seek: %d secs -> %d packs -> %d bytes \n", -// rel_seek_secs,rel_seek_packs,rel_seek_bytes); - newpos = ((flags & SEEK_ABSOLUTE) ? demuxer->movi_start : demuxer->filepos) + rel_seek_bytes; - if (newpos < 0 || newpos < demuxer->movi_start) newpos = demuxer->movi_start; -// printf("\r -- asf: newpos=%d -- \n",newpos); - stream_seek(demuxer->stream, newpos); - - if (asf->asf_is_dvr_ms) asf->dvr_last_vid_pts = 0.0f; - - if (d_video->id >= 0) - ds_fill_buffer(d_video); - if (sh_audio) - { - ds_fill_buffer(d_audio); - } - - if (d_video->id >= 0) - while (1) - { - if (sh_audio && !d_audio->eof) - { - float a_pts = d_audio->pts; - a_pts += (ds_tell_pts(d_audio) - sh_audio->a_in_buffer_len) / (float)sh_audio->i_bps; - // sync audio: - if (d_video->pts > a_pts) - { -#ifndef __sh__ - skip_audio_frame(sh_audio); -#endif -// if(!ds_fill_buffer(d_audio)) sh_audio=NULL; // skip audio. EOF? - continue; - } - } - if (d_video->flags & 1) break; // found a keyframe! - if (!ds_fill_buffer(d_video)) break; // skip frame. EOF? - } - - -} - -static int demux_asf_control(demuxer_t *demuxer, int cmd, void *arg) -{ - struct asf_priv *asf = demuxer->priv; - /* demux_stream_t *d_audio=demuxer->audio; - demux_stream_t *d_video=demuxer->video; - sh_audio_t *sh_audio=d_audio->sh; - sh_video_t *sh_video=d_video->sh; - */ - switch (cmd) - { - case DEMUXER_CTRL_GET_TIME_LENGTH: - *((double *)arg) = asf->movielength; - return DEMUXER_CTRL_OK; - - case DEMUXER_CTRL_GET_PERCENT_POS: - return DEMUXER_CTRL_DONTKNOW; - - default: - return DEMUXER_CTRL_NOTIMPL; - } -} - - -#ifndef __sh__ -static demuxer_t *demux_open_asf(demuxer_t *demuxer) -#else -demuxer_t *demux_open_asf(demuxer_t *demuxer) -#endif -{ - struct asf_priv *asf = demuxer->priv; - sh_audio_t *sh_audio = NULL; - sh_video_t *sh_video = NULL; - - //---- ASF header: - if (!asf) return NULL; - init_priv(asf); - if (!read_asf_header(demuxer, asf)) - return NULL; - stream_reset(demuxer->stream); - stream_seek(demuxer->stream, demuxer->movi_start); -// demuxer->idx_pos=0; -// demuxer->endpos=avi_header.movi_end; - if (demuxer->video->id != -2) - { - if (!ds_fill_buffer(demuxer->video)) - { - mp_msg(MSGT_DEMUXER, MSGL_WARN, "ASF: " MSGTR_MissingVideoStream); - demuxer->video->sh = NULL; - //printf("ASF: missing video stream!? contact the author, it may be a bug :(\n"); - } - else - { - sh_video = demuxer->video->sh; - sh_video->ds = demuxer->video; - sh_video->fps = 1000.0f; - sh_video->frametime = 0.001f; - - if (asf->asf_is_dvr_ms) - { - sh_video->bih->biWidth = 0; - sh_video->bih->biHeight = 0; - } - } - } - - if (demuxer->audio->id != -2) - { - mp_msg(MSGT_DEMUXER, MSGL_V, MSGTR_ASFSearchingForAudioStream, demuxer->audio->id); - if (!ds_fill_buffer(demuxer->audio)) - { - mp_msg(MSGT_DEMUXER, MSGL_INFO, "ASF: " MSGTR_MissingAudioStream); - demuxer->audio->sh = NULL; - } - else - { - sh_audio = demuxer->audio->sh; - sh_audio->ds = demuxer->audio; - sh_audio->format = sh_audio->wf->wFormatTag; - } - } -#ifndef __sh__ - if (!demuxer->stream->seek) - demuxer->seekable = 0; -#endif - - return demuxer; -} - - -#ifndef __sh__ -static void demux_close_asf(demuxer_t *demuxer) -{ -#else -void demux_close_asf(demuxer_t *demuxer) -{ -#endif - struct asf_priv *asf = demuxer->priv; - - if (!asf) return; - - if (asf->aud_repdata_sizes) - free(asf->aud_repdata_sizes); - - if (asf->vid_repdata_sizes) - free(asf->vid_repdata_sizes); - - free(asf); -} - -const demuxer_desc_t demuxer_desc_asf = -{ - "ASF demuxer", - "asf", - "ASF", - "A'rpi", - "ASF, WMV, WMA", - DEMUXER_TYPE_ASF, - 1, // safe autodetect - asf_check_header, - demux_asf_fill_buffer, - demux_open_asf, - demux_close_asf, - demux_seek_asf, - demux_asf_control -}; diff --git a/libeplayer2/container/demux_audio.c b/libeplayer2/container/demux_audio.c deleted file mode 100644 index f27fd50..0000000 --- a/libeplayer2/container/demux_audio.c +++ /dev/null @@ -1,1319 +0,0 @@ - -//#include "../config.h" - -#include -#include -#include "stream.h" -#include "demuxer.h" -#include "stheader.h" -#include "genres.h" -#include "mp3_hdr.h" -#include "intreadwrite.h" - -#include -#include -#include -#include - -int audio_stop = 0; - -#ifdef DEBUG -int demux_audio_debug = 0; -#define demux_audio_printf(x...) do { if (demux_audio_debug)printf(x); } while (0) -#endif - -#define MP3 1 -#define WAV 2 -#define fLaC 3 - - -#define HDR_SIZE 4 -static const char FILENAME[] = "demux_audio.c"; - -typedef struct da_priv -{ - int frmt; - double next_pts; -} da_priv_t; - -//! rather arbitrary value for maximum length of wav-format headers -#define MAX_WAVHDR_LEN (1 * 1024 * 1024) - -//! how many valid frames in a row we need before accepting as valid MP3 -#define MIN_MP3_HDRS 12 - -//! Used to describe a potential (chain of) MP3 headers we found -typedef struct mp3_hdr -{ - off_t frame_pos; // start of first frame in this "chain" of headers - off_t next_frame_pos; // here we expect the next header with same parameters - int mp3_chans; - int mp3_freq; - int mpa_spf; - int mpa_layer; - int mpa_br; - int cons_hdrs; // if this reaches MIN_MP3_HDRS we accept as MP3 file - struct mp3_hdr *next; -} mp3_hdr_t; - -void print_wave_header(WAVEFORMATEX *h, int verbose_level); - -int hr_mp3_seek = 0; - -pthread_mutex_t Audiomutex; - -void getAudioMutex(const char *filename, const char *function, int line) // FIXME: Use one central getMutex and pass the mutex into the function -{ -#ifdef DEBUG - demux_audio_printf("%s::%s::%d requesting mutex\n", filename, function, line); -#endif - - pthread_mutex_lock(&Audiomutex); - -#ifdef DEBUG - demux_audio_printf("%s::%s::%d received mutex\n", filename, function, line); -#endif -} - -void releaseAudioMutex(const char *filename, const char *function, int line) // FIXME: Use one central getMutex and pass the mutex into the function -{ - pthread_mutex_unlock(&Audiomutex); - -#ifdef DEBUG - demux_audio_printf("%s::%s::%d released mutex\n", filename, function, line); -#endif -} - -/** - * \brief free a list of MP3 header descriptions - * \param list pointer to the head-of-list pointer - */ -static void free_mp3_hdrs(mp3_hdr_t **list) -{ - mp3_hdr_t *tmp; - while (*list) - { - tmp = (*list)->next; - free(*list); - *list = NULL; - *list = tmp; - } -} - -/** - * \brief add another potential MP3 header to our list - * If it fits into an existing chain this one is expanded otherwise - * a new one is created. - * All entries that expected a MP3 header before the current position - * are discarded. - * The list is expected to be and will be kept sorted by next_frame_pos - * and when those are equal by frame_pos. - * \param list pointer to the head-of-list pointer - * \param st_pos stream position where the described header starts - * \param mp3_chans number of channels as specified by the header (*) - * \param mp3_freq sampling frequency as specified by the header (*) - * \param mpa_spf frame size as specified by the header - * \param mpa_layer layer type ("version") as specified by the header (*) - * \param mpa_br bitrate as specified by the header - * \param mp3_flen length of the frame as specified by the header - * \return If non-null the current file is accepted as MP3 and the - * mp3_hdr struct describing the valid chain is returned. Must be - * freed independent of the list. - * - * parameters marked by (*) must be the same for all headers in the same chain - */ -static mp3_hdr_t *add_mp3_hdr(mp3_hdr_t **list, off_t st_pos, - int mp3_chans, int mp3_freq, int mpa_spf, - int mpa_layer, int mpa_br, int mp3_flen) -{ - mp3_hdr_t *tmp; - int in_list = 0; - while (*list && (*list)->next_frame_pos <= st_pos) - { - -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - if (((*list)->next_frame_pos < st_pos) || ((*list)->mp3_chans != mp3_chans) - || ((*list)->mp3_freq != mp3_freq) || ((*list)->mpa_layer != mpa_layer)) - { - // wasn't valid! - tmp = (*list)->next; - free(*list); - *list = NULL; - *list = tmp; - } - else - { - (*list)->cons_hdrs++; - (*list)->next_frame_pos = st_pos + mp3_flen; - (*list)->mpa_spf = mpa_spf; - (*list)->mpa_br = mpa_br; - if ((*list)->cons_hdrs >= MIN_MP3_HDRS) - { - // copy the valid entry, so that the list can be easily freed - tmp = malloc(sizeof(mp3_hdr_t)); - memcpy(tmp, *list, sizeof(mp3_hdr_t)); - tmp->next = NULL; - return tmp; - } - in_list = 1; - list = &((*list)->next); - } - } - -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - if (!in_list) // does not belong into an existing chain, insert - { - // find right position to insert to keep sorting - while (*list && (*list)->next_frame_pos <= st_pos + mp3_flen) - list = &((*list)->next); - tmp = malloc(sizeof(mp3_hdr_t)); - tmp->frame_pos = st_pos; - tmp->next_frame_pos = st_pos + mp3_flen; - tmp->mp3_chans = mp3_chans; - tmp->mp3_freq = mp3_freq; - tmp->mpa_spf = mpa_spf; - tmp->mpa_layer = mpa_layer; - tmp->mpa_br = mpa_br; - tmp->cons_hdrs = 1; - tmp->next = *list; - *list = tmp; - - tmp = malloc(sizeof(mp3_hdr_t)); - memcpy(tmp, *list, sizeof(mp3_hdr_t)); - tmp->next = NULL; - return tmp; - } - return NULL; -} - -#if 0 /* this code is a mess, clean it up before reenabling */ -#define FLAC_SIGNATURE_SIZE 4 -#define FLAC_STREAMINFO_SIZE 34 -#define FLAC_SEEKPOINT_SIZE 18 - -enum -{ - FLAC_STREAMINFO = 0, - FLAC_PADDING, - FLAC_APPLICATION, - FLAC_SEEKTABLE, - FLAC_VORBIS_COMMENT, - FLAC_CUESHEET -} flac_preamble_t; - -static void -get_flac_metadata(demuxer_t *demuxer) -{ - uint8_t preamble[4]; - unsigned int blk_len; - stream_t *s = demuxer->stream; - - /* file is qualified; skip over the signature bytes in the stream */ - stream_seek(s, 4); - - /* loop through the metadata blocks; use a do-while construct since there - * will always be 1 metadata block */ - do - { - int r; - - r = stream_read(s, (char *) preamble, FLAC_SIGNATURE_SIZE); - if (r != FLAC_SIGNATURE_SIZE) - return; - - blk_len = AV_RB24(preamble + 1); - - switch (preamble[0] & 0x7F) - { - case FLAC_VORBIS_COMMENT: - { - /* For a description of the format please have a look at */ - /* http://www.xiph.org/vorbis/doc/v-comment.html */ - - uint32_t length, comment_list_len; - char comments[blk_len]; - uint8_t *ptr = comments; - char *comment; - int cn; - char c; - - if (stream_read(s, comments, blk_len) == blk_len) - { - length = AV_RL32(ptr); - ptr += 4 + length; - - comment_list_len = AV_RL32(ptr); - ptr += 4; - - cn = 0; - for (; cn < comment_list_len; cn++) - { - length = AV_RL32(ptr); - ptr += 4; - - comment = ptr; - if (&comment[length] < comments || &comment[length] >= &comments[blk_len]) - return; - c = comment[length]; - comment[length] = 0; - - if (!strncasecmp("TITLE=", comment, 6) && (length - 6 > 0)) - demux_info_add(demuxer, "Title", comment + 6); - else if (!strncasecmp("ARTIST=", comment, 7) && (length - 7 > 0)) - demux_info_add(demuxer, "Artist", comment + 7); - else if (!strncasecmp("ALBUM=", comment, 6) && (length - 6 > 0)) - demux_info_add(demuxer, "Album", comment + 6); - else if (!strncasecmp("DATE=", comment, 5) && (length - 5 > 0)) - demux_info_add(demuxer, "Year", comment + 5); - else if (!strncasecmp("GENRE=", comment, 6) && (length - 6 > 0)) - demux_info_add(demuxer, "Genre", comment + 6); - else if (!strncasecmp("Comment=", comment, 8) && (length - 8 > 0)) - demux_info_add(demuxer, "Comment", comment + 8); - else if (!strncasecmp("TRACKNUMBER=", comment, 12) - && (length - 12 > 0)) - { - char buf[31]; - buf[30] = '\0'; - sprintf(buf, "%d", atoi(comment + 12)); - demux_info_add(demuxer, "Track", buf); - } - comment[length] = c; - - ptr += length; - } - } - break; - } - - case FLAC_STREAMINFO: - case FLAC_PADDING: - case FLAC_APPLICATION: - case FLAC_SEEKTABLE: - case FLAC_CUESHEET: - default: - /* 6-127 are presently reserved */ - stream_skip(s, blk_len); - break; - } - } - while ((preamble[0] & 0x80) == 0); -} -#endif - -static int demux_audio_open(demuxer_t *demuxer) -{ - stream_t *s; - sh_audio_t *sh_audio; - uint8_t hdr[HDR_SIZE]; - int frmt = 0, n = 0, step; - off_t st_pos = 0, next_frame_pos = 0; - // mp3_hdrs list is sorted first by next_frame_pos and then by frame_pos - mp3_hdr_t *mp3_hdrs = NULL, *mp3_found = NULL; - da_priv_t *priv; - - s = demuxer->stream; - - stream_read(s, hdr, HDR_SIZE); - - while (n < 30000 && !s->eof) - { - //printf("%s::%d n=%d eof=%d %4s\n", __FUNCTION__, __LINE__, n,s->eof, hdr); - int mp3_freq, mp3_chans, mp3_flen, mpa_layer, mpa_spf, mpa_br; - st_pos = stream_tell(s) - HDR_SIZE; - -#ifdef DEBUG - printf("%s::%d st_pos=%u\n", __FUNCTION__, __LINE__, st_pos); -#endif - - step = 1; - - if (hdr[0] == 'R' && hdr[1] == 'I' && hdr[2] == 'F' && hdr[3] == 'F') - { - stream_skip(s, 4); - if (s->eof) - break; - stream_read(s, hdr, 4); - if (s->eof) - break; - if (hdr[0] != 'W' || hdr[1] != 'A' || hdr[2] != 'V' || hdr[3] != 'E') - stream_skip(s, -8); - else - // We found wav header. Now we can have 'fmt ' or a mp3 header - // empty the buffer - step = 4; - } - else if (hdr[0] == 'I' && hdr[1] == 'D' && hdr[2] == '3' && (hdr[3] >= 2)) - { - int len; - stream_skip(s, 2); - stream_read(s, hdr, 4); - len = (hdr[0] << 21) | (hdr[1] << 14) | (hdr[2] << 7) | hdr[3]; - - stream_skip(s, len); - step = 4; - } - else if (hdr[0] == 'f' && hdr[1] == 'm' && hdr[2] == 't' && hdr[3] == ' ') - { - frmt = WAV; - break; - } - else if ((mp3_flen = mp_get_mp3_header(hdr, &mp3_chans, &mp3_freq, - &mpa_spf, &mpa_layer, &mpa_br)) > 0) - { - mp3_found = add_mp3_hdr(&mp3_hdrs, st_pos, mp3_chans, mp3_freq, - mpa_spf, mpa_layer, mpa_br, mp3_flen); - if (mp3_found) - { - frmt = MP3; - break; - } - } - else if (hdr[0] == 'f' && hdr[1] == 'L' && hdr[2] == 'a' && hdr[3] == 'C') - { - frmt = fLaC; - if (!mp3_hdrs || mp3_hdrs->cons_hdrs < 3) - break; - } - // Add here some other audio format detection - if (step < HDR_SIZE) - memmove(hdr, &hdr[step], HDR_SIZE - step); - stream_read(s, &hdr[HDR_SIZE - step], step); - n++; - } - - free_mp3_hdrs(&mp3_hdrs); - - if (!frmt) - return 0; - - sh_audio = new_sh_audio(demuxer, 0); - - switch (frmt) - { - case MP3: - sh_audio->format = (mp3_found->mpa_layer < 3 ? 0x50 : 0x55); - demuxer->movi_start = mp3_found->frame_pos; - next_frame_pos = mp3_found->next_frame_pos; - sh_audio->audio.dwSampleSize = 0; - sh_audio->audio.dwScale = mp3_found->mpa_spf; - sh_audio->audio.dwRate = mp3_found->mp3_freq; - sh_audio->wf = malloc(sizeof(WAVEFORMATEX)); - sh_audio->wf->wFormatTag = sh_audio->format; - sh_audio->wf->nChannels = mp3_found->mp3_chans; - sh_audio->wf->nSamplesPerSec = mp3_found->mp3_freq; - sh_audio->wf->nAvgBytesPerSec = mp3_found->mpa_br * (1000 / 8); - sh_audio->wf->nBlockAlign = mp3_found->mpa_spf; - sh_audio->wf->wBitsPerSample = 16; - sh_audio->wf->cbSize = 0; - sh_audio->i_bps = sh_audio->wf->nAvgBytesPerSec; - free(mp3_found); - mp3_found = NULL; - -#ifdef DEBUG - printf("%s::%d s->end_pos = %d\n", __FUNCTION__, __LINE__, s->end_pos); -#endif - - if (s->end_pos && (s->flags & STREAM_SEEK) == STREAM_SEEK) - { - char tag[4]; - stream_seek(s, s->end_pos - 128); - stream_read(s, (unsigned char *) tag, 3); - tag[3] = '\0'; - if (strcmp(tag, "TAG")) - { - demuxer->movi_end = s->end_pos; - -#ifdef DEBUG - printf("demuxer->movi_end = s->end_pos = %d\n", demuxer->movi_end); -#endif - } - else - { - char buf[31]; - uint8_t g; - demuxer->movi_end = stream_tell(s) - 3; - -#ifdef DEBUG - printf("demuxer->movi_end = stream_tell(s)-3; = %d\n", demuxer->movi_end); -#endif - - stream_read(s, (unsigned char *) buf, 30); - buf[30] = '\0'; - demux_info_add(demuxer, "Title", buf); - stream_read(s, (unsigned char *) buf, 30); - buf[30] = '\0'; - demux_info_add(demuxer, "Artist", buf); - stream_read(s, (unsigned char *) buf, 30); - buf[30] = '\0'; - demux_info_add(demuxer, "Album", buf); - stream_read(s, (unsigned char *) buf, 4); - buf[4] = '\0'; - demux_info_add(demuxer, "Year", buf); - stream_read(s, (unsigned char *) buf, 30); - buf[30] = '\0'; - demux_info_add(demuxer, "Comment", buf); - - if (buf[28] == 0 && buf[29] != 0) - { - uint8_t trk = (uint8_t)buf[29]; - sprintf(buf, "%d", trk); - demux_info_add(demuxer, "Track", buf); - } - - g = stream_read_char(s); - demux_info_add(demuxer, "Genre", genres[g]); - } - } - - break; - case WAV: - { - unsigned int chunk_type; - unsigned int chunk_size; - WAVEFORMATEX *w; - int l; - l = stream_read_dword_le(s); - if (l < 16) - { - -#ifdef DEBUG - demux_audio_printf("[demux_audio] Bad wav header length: too short (%d)!!!\n", l); -#endif - - l = 16; - } - if (l > MAX_WAVHDR_LEN) - { - -#ifdef DEBUG - demux_audio_printf("[demux_audio] Bad wav header length: too long (%d)!!!\n", l); -#endif - - l = 16; - } - sh_audio->wf = w = malloc(l > sizeof(WAVEFORMATEX) ? l : sizeof(WAVEFORMATEX)); - w->wFormatTag = sh_audio->format = stream_read_word_le(s); - w->nChannels = sh_audio->channels = stream_read_word_le(s); - w->nSamplesPerSec = sh_audio->samplerate = stream_read_dword_le(s); - w->nAvgBytesPerSec = stream_read_dword_le(s); - w->nBlockAlign = stream_read_word_le(s); - w->wBitsPerSample = stream_read_word_le(s); - sh_audio->samplesize = (w->wBitsPerSample + 7) / 8; - w->cbSize = 0; - sh_audio->i_bps = sh_audio->wf->nAvgBytesPerSec; - l -= 16; - if (l >= 2) - { - w->cbSize = stream_read_word_le(s); - l -= 2; - if (l < w->cbSize) - { -#ifdef DEBUG - demux_audio_printf("[demux_audio] truncated extradata (%d < %d)\n", l, w->cbSize); -#endif - - w->cbSize = l; - } - stream_read(s, (unsigned char *)((char *)(w) + sizeof(WAVEFORMATEX)), w->cbSize); - l -= w->cbSize; - } - - //if( mp_msg_test(MSGT_DEMUX,MSGL_V) ) print_wave_header(w, MSGL_V); - if (l) - stream_skip(s, l); - do - { - chunk_type = stream_read_fourcc(demuxer->stream); - chunk_size = stream_read_dword_le(demuxer->stream); - if (chunk_type != mmioFOURCC('d', 'a', 't', 'a')) - stream_skip(demuxer->stream, chunk_size); - } - while (!s->eof && chunk_type != mmioFOURCC('d', 'a', 't', 'a')); - demuxer->movi_start = stream_tell(s); - demuxer->movi_end = chunk_size ? demuxer->movi_start + chunk_size : s->end_pos; -// printf("wav: %X .. %X\n",(int)demuxer->movi_start,(int)demuxer->movi_end); - // Check if it contains dts audio - if ((w->wFormatTag == 0x01) && (w->nChannels == 2) && (w->nSamplesPerSec == 44100)) - { - unsigned char buf[16384]; // vlc uses 16384*4 (4 dts frames) - unsigned int i; - memset(buf, 0, sizeof(buf)); - stream_read(s, buf, sizeof(buf)); - for (i = 0; i < sizeof(buf) - 5; i += 2) - { - // DTS, 14 bit, LE - if ((buf[i] == 0xff) && (buf[i + 1] == 0x1f) && (buf[i + 2] == 0x00) && - (buf[i + 3] == 0xe8) && ((buf[i + 4] & 0xfe) == 0xf0) && (buf[i + 5] == 0x07)) - { - sh_audio->format = 0x2001; - -#ifdef DEBUG - demux_audio_printf("[demux_audio] DTS audio in wav, 14 bit, LE\n"); -#endif - - break; - } - // DTS, 14 bit, BE - if ((buf[i] == 0x1f) && (buf[i + 1] == 0xff) && (buf[i + 2] == 0xe8) && - (buf[i + 3] == 0x00) && (buf[i + 4] == 0x07) && ((buf[i + 5] & 0xfe) == 0xf0)) - { - sh_audio->format = 0x2001; - -#ifdef DEBUG - demux_audio_printf("[demux_audio] DTS audio in wav, 14 bit, BE\n"); -#endif - - break; - } - // DTS, 16 bit, BE - if ((buf[i] == 0x7f) && (buf[i + 1] == 0xfe) && (buf[i + 2] == 0x80) && - (buf[i + 3] == 0x01)) - { - sh_audio->format = 0x2001; - -#ifdef DEBUG - demux_audio_printf("[demux_audio] DTS audio in wav, 16 bit, BE\n"); -#endif - - break; - } - // DTS, 16 bit, LE - if ((buf[i] == 0xfe) && (buf[i + 1] == 0x7f) && (buf[i + 2] == 0x01) && - (buf[i + 3] == 0x80)) - { - sh_audio->format = 0x2001; - -#ifdef DEBUG - demux_audio_printf("[demux_audio] DTS audio in wav, 16 bit, LE\n"); -#endif - - break; - } - } - -#ifdef DEBUG - if (sh_audio->format == 0x2001) - demux_audio_printf("[demux_audio] DTS sync offset = %u\n", i); -#endif - } - stream_seek(s, demuxer->movi_start); - } - break; - case fLaC: - sh_audio->format = mmioFOURCC('f', 'L', 'a', 'C'); - demuxer->movi_start = stream_tell(s) - 4; - demuxer->movi_end = s->end_pos; - if (demuxer->movi_end > demuxer->movi_start) - { - // try to find out approx. bitrate - int64_t size = demuxer->movi_end - demuxer->movi_start; - int64_t num_samples = 0; - int32_t srate = 0; - stream_skip(s, 14); - stream_read(s, (unsigned char *)&srate, 3); - srate = be2me_32(srate) >> 12; - stream_read(s, (unsigned char *)&num_samples, 5); - num_samples = (be2me_64(num_samples) >> 24) & 0xfffffffffULL; - if (num_samples && srate) - sh_audio->i_bps = size * srate / num_samples; - } - if (sh_audio->i_bps < 1) // guess value to prevent crash - sh_audio->i_bps = 64 * 1024; -// get_flac_metadata (demuxer); - break; - } - - priv = malloc(sizeof(da_priv_t)); - priv->frmt = frmt; - priv->next_pts = 0; - demuxer->priv = priv; - demuxer->audio->id = 0; - demuxer->audio->sh = sh_audio; - sh_audio->ds = demuxer->audio; - sh_audio->samplerate = sh_audio->audio.dwRate; - - if (stream_tell(s) != demuxer->movi_start) - { -#ifdef DEBUG - demux_audio_printf("demux_audio: seeking from 0x%X to start pos 0x%X\n", (int)stream_tell(s), (int)demuxer->movi_start); -#endif - - stream_seek(s, demuxer->movi_start); - if (stream_tell(s) != demuxer->movi_start) - { -#ifdef DEBUG - demux_audio_printf("demux_audio: seeking failed, now at 0x%X!\n", (int)stream_tell(s)); -#endif - - if (next_frame_pos) - { -#ifdef DEBUG - demux_audio_printf("demux_audio: seeking to 0x%X instead\n", (int)next_frame_pos); -#endif - stream_seek(s, next_frame_pos); - } - } - } - -#ifdef DEBUG - printf("demux_audio: audio data 0x%X - 0x%X \n", (int)demuxer->movi_start, (int)demuxer->movi_end); -#endif - - return DEMUXER_TYPE_AUDIO; -} - - -static int demux_audio_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds) -{ -//printf("%s::%d\n", __FUNCTION__, __LINE__); - int l; - demux_packet_t *dp; - - demuxer_t *demux = ds->demuxer; - sh_audio_t *sh_audio = demuxer->audio->sh; - da_priv_t *priv = demux->priv; - double this_pts = priv->next_pts; - stream_t *s = demux->stream; - - if (s->eof) - return 0; - switch (priv->frmt) - { - case MP3 : - while (1) - { - uint8_t hdr[4]; - if (audio_stop) return 0; - stream_read(s, hdr, 4); - if (s->eof) - return 0; - l = mp_decode_mp3_header(hdr); - if (l < 0) - { - if (demux->movi_end && stream_tell(s) >= demux->movi_end) - return 0; // might be ID3 tag, i.e. EOF - stream_skip(s, -3); - } - else - { - dp = new_demux_packet(l); - memcpy(dp->buffer, hdr, 4); - if (stream_read(s, dp->buffer + 4, l - 4) != l - 4) - { - free_demux_packet(dp); - return 0; - } - priv->next_pts += sh_audio->audio.dwScale / (double)sh_audio->samplerate; - break; - } - } - break; - case WAV : - { - unsigned align = sh_audio->wf->nBlockAlign; - l = sh_audio->wf->nAvgBytesPerSec; - if (l <= 0) l = 65536; - if (demux->movi_end && l > demux->movi_end - stream_tell(s)) - { - // do not read beyond end, there might be junk after data chunk - l = demux->movi_end - stream_tell(s); - if (l <= 0) return 0; - } - if (align) - l = (l + align - 1) / align * align; - dp = new_demux_packet(l); - l = stream_read(s, dp->buffer, l); - priv->next_pts += l / (double)sh_audio->i_bps; - break; - } - case fLaC: - { - l = 65535; - dp = new_demux_packet(l); - l = stream_read(s, dp->buffer, l); - /* FLAC is not a constant-bitrate codec. These values will be wrong. */ - priv->next_pts += l / (double)sh_audio->i_bps; - break; - } - default: -#ifdef DEBUG - demux_audio_printf("DEMUX_AUDIO_UnknownFormat %p\n", priv->frmt); -#endif - return 0; - } - resize_demux_packet(dp, l); - dp->pts = this_pts; - ds_add_packet(ds, dp); - return 1; -} - -static void high_res_mp3_seek(demuxer_t *demuxer, float time) -{ - uint8_t hdr[4]; - int len, nf; - da_priv_t *priv = demuxer->priv; - sh_audio_t *sh = (sh_audio_t *)demuxer->audio->sh; - - nf = time * sh->samplerate / sh->audio.dwScale; - while (nf > 0) - { - stream_read(demuxer->stream, hdr, 4); - len = mp_decode_mp3_header(hdr); - if (len < 0) - { - stream_skip(demuxer->stream, -3); - continue; - } - stream_skip(demuxer->stream, len - 4); - priv->next_pts += sh->audio.dwScale / (double)sh->samplerate; - nf--; - } -} - -static int whileSeeking = 0; - -static void demux_audio_seek(demuxer_t *demuxer, float rel_seek_secs, float audio_delay, int flags) -{ - sh_audio_t *sh_audio; - stream_t *s; - int64_t base, pos; - float len; - da_priv_t *priv; - - if (!(sh_audio = demuxer->audio->sh)) - return; - -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - whileSeeking = 1; - getAudioMutex(FILENAME, __FUNCTION__, __LINE__); - - s = demuxer->stream; - priv = demuxer->priv; - - if (priv->frmt == MP3 && hr_mp3_seek && !(flags & SEEK_FACTOR)) - { - len = (flags & SEEK_ABSOLUTE) ? rel_seek_secs - priv->next_pts : rel_seek_secs; - if (len < 0) - { - stream_seek(s, demuxer->movi_start); - len = priv->next_pts + len; - priv->next_pts = 0; - } - if (len > 0) - high_res_mp3_seek(demuxer, len); - - releaseAudioMutex(FILENAME, __FUNCTION__, __LINE__); - whileSeeking = 0; - return; - } - - base = flags & SEEK_ABSOLUTE ? demuxer->movi_start : stream_tell(s); - if (flags & SEEK_FACTOR) - pos = base + ((demuxer->movi_end - demuxer->movi_start) * rel_seek_secs); - else - pos = base + (rel_seek_secs * sh_audio->i_bps); - - if (demuxer->movi_end && pos >= demuxer->movi_end) - { - pos = demuxer->movi_end; - } - else if (pos < demuxer->movi_start) - pos = demuxer->movi_start; - - priv->next_pts = (pos - demuxer->movi_start) / (double)sh_audio->i_bps; - - switch (priv->frmt) - { - case WAV: - pos -= (pos - demuxer->movi_start) % - (sh_audio->wf->nBlockAlign ? sh_audio->wf->nBlockAlign : - (sh_audio->channels * sh_audio->samplesize)); - break; - } - - stream_seek(s, pos); - - releaseAudioMutex(FILENAME, __FUNCTION__, __LINE__); - whileSeeking = 0; -} - -static void demux_close_audio(demuxer_t *demuxer) -{ - da_priv_t *priv = demuxer->priv; - - free(priv); - demuxer->priv = NULL; -} - -////////////////////////////////////////////////////////////////7 -////////////////////////////////////////////////////////////////7 - -#include "common.h" -#include "container.h" -#include "manager.h" -//#include "utils.h" - -//static demuxer_t *demuxer = NULL; -static demux_stream_t *ds = NULL; // dvd subtitle buffer/demuxer -//static sh_audio_t *sh_audio = NULL; -//static sh_video_t *sh_video = NULL; -static pthread_t PlayThread; -static int hasPlayThreadStarted = 0; -//static int isFirstAudioFrame = 1; - -int AUDIOInit(Context_t *context, char *filename) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - getAudioMutex(FILENAME, __FUNCTION__, __LINE__); - - ds = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(ds, 0, sizeof(demux_stream_t)); - - ds->demuxer = (demuxer_t *)malloc(sizeof(demuxer_t)); - memset(ds->demuxer, 0, sizeof(demuxer_t)); - - ds->demuxer->audio = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(ds->demuxer->audio, 0, sizeof(demux_stream_t)); - - ds->demuxer->stream = (stream_t *)malloc(sizeof(stream_t)); - memset(ds->demuxer->stream, 0, sizeof(stream_t)); - - ds->demuxer->stream->fd = context->playback->fd; - - read(ds->demuxer->stream->fd, ds->demuxer->stream->buffer, 2048); //soviel ?? - - ds->demuxer->stream->start_pos = 0; - ds->demuxer->stream->flags = 6; - ds->demuxer->stream->sector_size = 0; - ds->demuxer->stream->buf_pos = 0; - ds->demuxer->stream->buf_len = 2048; - ds->demuxer->stream->pos = 2048; - ds->demuxer->stream->start_pos = 0; - - if (context->playback->isFile) - { - ds->demuxer->stream->type = STREAMTYPE_FILE; - long pos = lseek(ds->demuxer->stream->fd, 0L, SEEK_CUR); - ds->demuxer->stream->end_pos = lseek(ds->demuxer->stream->fd, 0L, SEEK_END); - lseek(ds->demuxer->stream->fd, pos, SEEK_SET); - } - else - { - ds->demuxer->stream->type = STREAMTYPE_STREAM; - ds->demuxer->stream->end_pos = 0; - } - - ds->demuxer->stream->eof = 0; - ds->demuxer->stream->cache_pid = 0; - - demux_audio_open(ds->demuxer); - - da_priv_t *priv = ds->demuxer->priv; - - switch (priv->frmt) - { - case MP3 : - { - Track_t Audio = - { - "und", - "A_MPEG/L3", - 0, - }; - context->manager->audio->Command(context, MANAGER_ADD, &Audio); - break; - } - case WAV : - { - Track_t Audio = - { - "und", - "A_MP3", - 0, - }; - context->manager->audio->Command(context, MANAGER_ADD, &Audio); - break; - } - case fLaC : - { - Track_t Audio = - { - "und", - "A_MP3", - 0, - }; - context->manager->audio->Command(context, MANAGER_ADD, &Audio); - break; - } - } - - releaseAudioMutex(FILENAME, __FUNCTION__, __LINE__); - - return 0; // FIXME -} - -#define INVALID_PTS_VALUE 0x200000000ull -void AUDIOGenerateParcel(Context_t *context, const demuxer_t *demuxer) -{ - //printf("%s::%d\n", __FUNCTION__, __LINE__); - - unsigned long long int Pts = 0; - - if (ds->first != NULL) - { - demux_packet_t *current = ds->first; - - Pts = (current->pts * 90000); - //printf("a current->pts=%f Pts=%llu\n", current->pts, Pts); - - while (current != NULL) - { - context->output->audio->Write(context, current->buffer, current->len, Pts, NULL, 0, 0, "audio"); - - current = current->next; - Pts = INVALID_PTS_VALUE; - } - } -} - -static void AUDIOThread(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - while (context->playback->isCreationPhase) - { -#ifdef DEBUG - printf("%s::%s Thread waiting for end of init phase...\n", FILENAME, __FUNCTION__); -#endif - } - -#ifdef DEBUG - printf("%s::%s Running!\n", FILENAME, __FUNCTION__); -#endif - - while (context && context->playback && context->playback->isPlaying) - { - //printf("%s -->\n", __FUNCTION__); - - //IF MOVIE IS PAUSED, WAIT - if (context->playback->isPaused) - { -#ifdef DEBUG - printf("%s::%s paused\n", FILENAME, __FUNCTION__); -#endif - - usleep(100000); - continue; - } - - if (context->playback->isSeeking || whileSeeking) - { -#ifdef DEBUG - printf("%s::%s seeking\n", FILENAME, __FUNCTION__); -#endif - - usleep(100000); - continue; - } - - getAudioMutex(FILENAME, __FUNCTION__, __LINE__); - - if (!demux_audio_fill_buffer(ds->demuxer, ds)) - { -#ifdef DEBUG - printf("%s::%s demux_ts_fill_buffer failed!\n", FILENAME, __FUNCTION__); -#endif - - releaseAudioMutex(FILENAME, __FUNCTION__, __LINE__); - - break; - } - else - { - AUDIOGenerateParcel(context, ds->demuxer); - - if (ds != NULL && ds->first != NULL) - { - ds_free_packs(ds); - } - - //printf("%s <--\n", __FUNCTION__); - - releaseAudioMutex(FILENAME, __FUNCTION__, __LINE__); - } - } - - usleep(500000); - - hasPlayThreadStarted = 0; - - if (context && context->playback) - context->playback->Command(context, PLAYBACK_TERM, NULL); - -#ifdef DEBUG - printf("%s::%s terminating\n", FILENAME, __FUNCTION__); -#endif -} - - -static int AUDIOPlay(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int error; - int ret = 0; - pthread_attr_t attr; - -#ifdef DEBUG - if (context && context->playback && context->playback->isPlaying) - { - printf("%s::%s is Playing\n", FILENAME, __FUNCTION__); - } - else - { - printf("%s::%s is NOT Playing\n", FILENAME, __FUNCTION__); - } -#endif - - audio_stop = 0; - if (hasPlayThreadStarted == 0) - { - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - - if ((error = pthread_create(&PlayThread, &attr, (void *)&AUDIOThread, context)) != 0) - { -#ifdef DEBUG - printf("%s::%s Error creating thread, error:%d:%s\n", FILENAME, __FUNCTION__, error, strerror(error)); -#endif - - hasPlayThreadStarted = 0; - ret = -1; - } - else - { -#ifdef DEBUG - printf("%s::%s Created thread\n", FILENAME, __FUNCTION__); -#endif - hasPlayThreadStarted = 1; - } - } - else - { -#ifdef DEBUG - printf("%s::%s A thread already exists!\n", FILENAME, __FUNCTION__); -#endif - - ret = -1; - } - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -static int AUDIOStop(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int ret = 0; - int wait_time = 20; - - audio_stop = 1; - while ((hasPlayThreadStarted != 0) && (--wait_time) > 0) - { -#ifdef DEBUG - printf("%s::%s Waiting for Audio thread to terminate itself, will try another %d times\n", FILENAME, __FUNCTION__, wait_time); -#endif - - usleep(100000); - } - - if (wait_time == 0) - { -#ifdef DEBUG - printf("%s::%s Timeout waiting for Audio thread!\n", FILENAME, __FUNCTION__); -#endif - - ret = -1; - } - else - { - if (ds != NULL) - { - - getAudioMutex(FILENAME, __FUNCTION__, __LINE__); - - if (ds->demuxer != NULL) - { - demux_close_audio(ds->demuxer); - - free(ds->demuxer->stream); - ds->demuxer->stream = NULL; - - free(ds->demuxer->audio); - ds->demuxer->audio = NULL; - - free(ds->demuxer); - ds->demuxer = NULL; - } - - free(ds); - ds = NULL; - - releaseAudioMutex(FILENAME, __FUNCTION__, __LINE__); - } - } - - return ret; -} - -static int AUDIOGetLength(demuxer_t *demuxer, double *length) -{ - //printf("%s::%s\n", FILENAME, __FUNCTION__); - - int audio_length = 0; - - if (demuxer->audio != NULL && demuxer->audio->sh != NULL) - { - sh_audio_t *sh_audio = demuxer->audio->sh; - audio_length = sh_audio->i_bps ? demuxer->movi_end / sh_audio->i_bps : 0; - } - - if (audio_length <= 0) return -1; - - *((double *)length) = (double)audio_length; - - return 0; - -} - -static int AUDIOGetInfo(demuxer_t *demuxer, char **infoString) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - if (demuxer && demuxer->info) - { - char **info = demuxer->info; - int n = 0; - - for (n = 0; info && info[2 * n] != NULL; n++) - { - if (!strcasecmp(*infoString, info[2 * n])) - { -#ifdef DEBUG - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - - *infoString = strdup(info[2 * n + 1]); - } - } - } - - return 0; - -} - -static int Command(Context_t *context, ContainerCmd_t command, void *argument) -{ -#ifdef DEBUG - printf("%s::%s Command %d\n", FILENAME, __FUNCTION__, command); -#endif - - int ret = 0; - - switch (command) - { - case CONTAINER_INIT: - { - char *FILENAME = (char *)argument; - ret = AUDIOInit(context, FILENAME); - break; - } - case CONTAINER_PLAY: - { - ret = AUDIOPlay(context); - break; - } - case CONTAINER_STOP: - { - ret = AUDIOStop(context); - break; - } - case CONTAINER_SEEK: - { - if (ds && ds->demuxer) - demux_audio_seek(ds->demuxer, (float) * ((float *)argument), 0.0, 0); - break; - } - case CONTAINER_LENGTH: - { - double length = 0; - if (ds != NULL && ds->demuxer != NULL && AUDIOGetLength(ds->demuxer, &length) != 0) - *((double *)argument) = (double)0; - else - *((double *)argument) = (double)length; - break; - } - case CONTAINER_INFO: - { - if (ds && ds->demuxer) - ret = AUDIOGetInfo(ds->demuxer, (char **)argument); - break; - } - default: -#ifdef DEBUG - printf("%s::%s ContainerCmd %d not supported!\n", FILENAME, __FUNCTION__, command); -#endif - break; - } - - return ret; -} - -static char *AUDIOCapabilities[] = { "mp3", "wav", "flac", NULL }; - -Container_t AUDIOContainer = -{ - "AUDIO", - &Command, - AUDIOCapabilities, -}; - -/*const demuxer_desc_t demuxer_desc_audio = { - "Audio demuxer", - "audio", - "Audio only", - "?", - "Audio only files", - DEMUXER_TYPE_AUDIO, - 0, // unsafe autodetect - demux_audio_open, - demux_audio_fill_buffer, - NULL, - demux_close_audio, - demux_audio_seek, - demux_audio_control -};*/ diff --git a/libeplayer2/container/demux_mpg.c b/libeplayer2/container/demux_mpg.c deleted file mode 100644 index 6cccf97..0000000 --- a/libeplayer2/container/demux_mpg.c +++ /dev/null @@ -1,2219 +0,0 @@ -// MPG/VOB file parser for DEMUXER v2.5 by A'rpi/ESP-team - -#include -#include -#include -#include -#include -#include - -//#include "config.h" - -#include "stream.h" -#include "demuxer.h" -#include "parse_es.h" -#include "stheader.h" -#include "mp3_hdr.h" - -//#define MAX_PS_PACKETSIZE 2048 -#define MAX_PS_PACKETSIZE (224*1024) - -#define UNKNOWN 0 -#define VIDEO_MPEG1 0x10000001 -#define VIDEO_MPEG2 0x10000002 -#define VIDEO_MPEG4 0x10000004 -#define VIDEO_H264 0x10000005 -#define AUDIO_MP2 0x50 -#define AUDIO_A52 0x2000 -#define AUDIO_LPCM_BE 0x10001 -#define AUDIO_AAC mmioFOURCC('M', 'P', '4', 'A') - -static const char FILENAME[] = "demux_mpg.c"; - -#ifdef DEBUG -int demux_mpg_debug = 0; -#define demux_mpg_printf(x...) do { if (demux_mpg_debug)printf(x); } while (0) -#endif - -pthread_mutex_t MPGmutex; - -void getMPGMutex(const char *filename, const char *function, int line) // FIXME: Use one central getMutex and pass the mutex into the function -{ -#ifdef DEBUG -// printf("%s::%s::%d requesting mutex\n",filename, function, line); -#endif - - pthread_mutex_lock(&MPGmutex); - -#ifdef DEBUG -// printf("%s::%s::%d received mutex\n",filename, function, line); -#endif -} - -void releaseMPGMutex(const char *filename, const char *function, int line) // FIXME: Use one central getMutex and pass the mutex into the function -{ - pthread_mutex_unlock(&MPGmutex); -#ifdef DEBUG -// printf("%s::%s::%d released mutex\n",filename, function, line); -#endif -} - -typedef struct mpg_demuxer -{ - float last_pts; - float first_pts; // first pts found in stream - float first_to_final_pts_len; // difference between final pts and first pts - int has_valid_timestamps; // !=0 iff time stamps look linear - // (not necessarily starting with 0) - unsigned int es_map[0x40]; //es map of stream types (associated to the pes id) from 0xb0 to 0xef - int num_a_streams; - int a_stream_ids[MAX_A_STREAMS]; -} mpg_demuxer_t; - -extern char *dvdsub_lang; -static int mpeg_pts_error = 0; -off_t ps_probe = 0; - -static int parse_psm(demuxer_t *demux, int len) -{ - unsigned char c, id, type; - unsigned int plen, prog_len, es_map_len; - mpg_demuxer_t *priv = (mpg_demuxer_t *) demux->priv; - -#ifdef DEBUG - demux_mpg_printf("PARSE_PSM, len=%d\n", len); -#endif - - if (! len || len > 1018) - return 0; - - c = stream_read_char(demux->stream); - if (!(c & 0x80)) - { - stream_skip(demux->stream, len - 1); //not yet valid, discard - return 0; - } - stream_skip(demux->stream, 1); - prog_len = stream_read_word(demux->stream); //length of program descriptors - stream_skip(demux->stream, prog_len); //.. that we ignore - es_map_len = stream_read_word(demux->stream); //length of elementary streams map - es_map_len = FFMIN(es_map_len, len - prog_len - 8); //sanity check - while (es_map_len > 0) - { - type = stream_read_char(demux->stream); - id = stream_read_char(demux->stream); - if (id >= 0xB0 && id <= 0xEF && priv) - { - int idoffset = id - 0xB0; - switch (type) - { - case 0x1: - priv->es_map[idoffset] = VIDEO_MPEG1; - break; - case 0x2: - priv->es_map[idoffset] = VIDEO_MPEG2; - break; - case 0x3: - case 0x4: - priv->es_map[idoffset] = AUDIO_MP2; - break; - case 0x0f: - case 0x11: - priv->es_map[idoffset] = AUDIO_AAC; - break; - case 0x10: - priv->es_map[idoffset] = VIDEO_MPEG4; - break; - case 0x1b: - priv->es_map[idoffset] = VIDEO_H264; - break; - case 0x81: - priv->es_map[idoffset] = AUDIO_A52; - break; - } - -#ifdef DEBUG - printf("PSM ES, id=0x%x, type=%x, stype: %x\n", id, type, priv->es_map[idoffset]); -#endif - - } - plen = stream_read_word(demux->stream); //length of elementary stream descriptors - plen = FFMIN(plen, es_map_len); //sanity check - stream_skip(demux->stream, plen); //skip descriptors for now - es_map_len -= 4 + plen; - } - stream_skip(demux->stream, 4); //skip crc32 - return 1; -} - -// 500000 is a wild guess -#define TIMESTAMP_PROBE_LEN 500000 - -//MAX_PTS_DIFF_FOR_CONSECUTIVE denotes the maximum difference -//between two pts to consider them consecutive -//1.0 is a wild guess -#define MAX_PTS_DIFF_FOR_CONSECUTIVE 1.0 - -//returns the first pts found within TIME_STAMP_PROBE_LEN bytes after stream_pos in demuxer's stream. -//if no pts is found or an error occurs, -1.0 is returned. -//Packs are freed. -static float read_first_mpeg_pts_at_position(demuxer_t *demuxer, off_t stream_pos) -{ - stream_t *s = demuxer->stream; - mpg_demuxer_t *mpg_d = demuxer->priv; - float pts = -1.0; //the pts to return; - float found_pts1; //the most recently found pts - float found_pts2; //the pts found before found_pts1 - float found_pts3; //the pts found before found_pts2 - int found = 0; - - if (!mpg_d || stream_pos < 0) - return pts; - - found_pts3 = found_pts2 = found_pts1 = mpg_d->last_pts; - stream_seek(s, stream_pos); - - //We look for pts. - //However, we do not stop at the first found one, as timestamps may reset - //Therefore, we seek until we found three consecutive - //pts within MAX_PTS_DIFF_FOR_CONSECUTIVE. - - while (found < 3 && !s->eof - && (fabsf(found_pts2 - found_pts1) < MAX_PTS_DIFF_FOR_CONSECUTIVE) - && (fabsf(found_pts3 - found_pts2) < MAX_PTS_DIFF_FOR_CONSECUTIVE) - && (stream_tell(s) < stream_pos + TIMESTAMP_PROBE_LEN) - && ds_fill_buffer(demuxer->video)) - { - if (mpg_d->last_pts != found_pts1) - { - if (!found) - found_pts3 = found_pts2 = found_pts1 = mpg_d->last_pts; //the most recently found pts - else - { - found_pts3 = found_pts2; - found_pts2 = found_pts1; - found_pts1 = mpg_d->last_pts; - } - found++; - } - } - - if (found == 3) pts = found_pts3; - - //clean up from searching of first pts; - //ds_free_packs(demuxer->audio); - //ds_free_packs(demuxer->video); - //ds_free_packs(demuxer->sub); - demux_flush(demuxer); - - return pts; -} - -/// Open an mpg physical stream -static demuxer_t *demux_mpg_open(demuxer_t *demuxer) -{ - stream_t *s = demuxer->stream; - mpg_demuxer_t *mpg_d; - - if (!ds_fill_buffer(demuxer->video)) return 0; - mpg_d = calloc(1, sizeof(mpg_demuxer_t)); - if (mpg_d) - { - demuxer->priv = mpg_d; - mpg_d->last_pts = -1.0; - mpg_d->first_pts = -1.0; - - //if seeking is allowed set has_valid_timestamps if appropriate - if (demuxer->seekable - && (demuxer->stream->type == STREAMTYPE_FILE - || demuxer->stream->type == STREAMTYPE_VCD) - && demuxer->movi_start != demuxer-> movi_end - ) - { - //We seek to the beginning of the stream, to somewhere in the - //middle, and to the end of the stream, while remembering the pts - //at each of the three positions. With these pts, we check whether - //or not the pts are "linear enough" to justify seeking by the pts - //of the stream - - //The position where the stream is now - off_t pos = stream_tell(s); - float first_pts = read_first_mpeg_pts_at_position(demuxer, demuxer->movi_start); - if (first_pts != -1.0) - { - float middle_pts = read_first_mpeg_pts_at_position(demuxer, (demuxer->movi_end + demuxer->movi_start) / 2); - if (middle_pts != -1.0) - { - float final_pts = read_first_mpeg_pts_at_position(demuxer, demuxer->movi_end - TIMESTAMP_PROBE_LEN); - if (final_pts != -1.0) - { - // found proper first, middle, and final pts. - float proportion = (middle_pts - first_pts == 0) ? -1 : (final_pts - middle_pts) / (middle_pts - first_pts); - // if they are linear enough set has_valid_timestamps - if ((0.5 < proportion) && (proportion < 2)) - { - mpg_d->first_pts = first_pts; - mpg_d->first_to_final_pts_len = final_pts - first_pts; - mpg_d->has_valid_timestamps = 1; - } - } - } - } - - //Cleaning up from seeking in stream - demuxer->stream->eof = 0; - demuxer->video->eof = 0; - demuxer->audio->eof = 0; - - stream_seek(s, pos); - ds_fill_buffer(demuxer->video); - } // if ( demuxer->seekable ) - } // if ( mpg_d ) - return demuxer; -} - -static void demux_close_mpg(demuxer_t *demuxer) -{ - mpg_demuxer_t *mpg_d = demuxer->priv; - - free(mpg_d); - mpg_d = NULL; -} - - -static unsigned long long read_mpeg_timestamp(stream_t *s, int c) -{ - unsigned int d, e; - unsigned long long pts; - d = stream_read_word(s); - e = stream_read_word(s); - if (((c & 1) != 1) || ((d & 1) != 1) || ((e & 1) != 1)) - { - ++mpeg_pts_error; - return 0; // invalid pts - } - pts = (((uint64_t)((c >> 1) & 7)) << 30) | ((d >> 1) << 15) | (e >> 1); - -#ifdef DEBUG - demux_mpg_printf(" pts {%"PRIu64"}", pts); -#endif - - return pts; -} - -static void new_audio_stream(demuxer_t *demux, int aid) -{ - if (!demux->a_streams[aid]) - { - mpg_demuxer_t *mpg_d = (mpg_demuxer_t *)demux->priv; - sh_audio_t *sh_a; - new_sh_audio(demux, aid); - sh_a = (sh_audio_t *)demux->a_streams[aid]; - switch (aid & 0xE0) // 1110 0000 b (high 3 bit: type low 5: id) - { - case 0x00: - sh_a->format = 0x50; - break; // mpeg - case 0xA0: - sh_a->format = 0x10001; - break; // dvd pcm - case 0x80: - if ((aid & 0xF8) == 0x88) sh_a->format = 0x2001; //dts - else sh_a->format = 0x2000; - break; // ac3 - } - //evo files - if ((aid & 0xC0) == 0xC0) sh_a->format = 0x2000; - else if (aid >= 0x98 && aid <= 0x9f) sh_a->format = 0x2001; - if (mpg_d) mpg_d->a_stream_ids[mpg_d->num_a_streams++] = aid; - } - if (demux->audio->id == -1) demux->audio->id = aid; -} - -static int demux_mpg_read_packet(demuxer_t *demux, int id) -{ - int d; - int len; - int set_pts = 0; // !=0 iff pts has been set to a proper value - unsigned char c = 0; - unsigned long long pts = 0; - unsigned long long dts = 0; - int l; - int pes_ext2_subid = -1; - double stream_pts = MP_NOPTS_VALUE; - demux_stream_t *ds = NULL; - demux_packet_t *dp; - mpg_demuxer_t *priv = (mpg_demuxer_t *) demux->priv; - -#ifdef DEBUG - demux_mpg_printf("demux_read_packet: %X\n", id); -#endif - -// if(id==0x1F0){ -// demux->synced=0; // force resync after 0x1F0 -// return -1; -//} - -// if(id==0x1BA) packet_start_pos=stream_tell(demux->stream); - if ((id < 0x1BC || id >= 0x1F0) && id != 0x1FD) return -1; - if (id == 0x1BE) return -1; // padding stream - if (id == 0x1BF) return -1; // private2 - - len = stream_read_word(demux->stream); - -#ifdef DEBUG - demux_mpg_printf("PACKET len=%d", len); -#endif - -// if(len==62480){ demux->synced=0;return -1;} /* :) */ - if (len == 0 || len > MAX_PS_PACKETSIZE) - { - -#ifdef DEBUG - demux_mpg_printf("Invalid PS packet len: %d\n", len); -#endif - - return -2; // invalid packet !!!!!! - } - - mpeg_pts_error = 0; - -#ifdef DEBUG - demux_mpg_printf("\t id= 0x%02x\n", id); -#endif - - if (id == 0x1BC) - { - parse_psm(demux, len); - return 0; - } - - while (len > 0) // Skip stuFFing bytes - { - c = stream_read_char(demux->stream); - --len; - if (c != 0xFF)break; - } - if ((c >> 6) == 1) // Read (skip) STD scale & size value - { -// printf(" STD_scale=%d",(c>>5)&1); - d = ((c & 0x1F) << 8) | stream_read_char(demux->stream); - len -= 2; -// printf(" STD_size=%d",d); - c = stream_read_char(demux->stream); - } - // Read System-1 stream timestamps: - if ((c >> 4) == 2) - { - pts = read_mpeg_timestamp(demux->stream, c); - set_pts = 1; - len -= 4; - } - else if ((c >> 4) == 3) - { - pts = read_mpeg_timestamp(demux->stream, c); - c = stream_read_char(demux->stream); - if ((c >> 4) != 1) pts = 0; //printf("{ERROR4}"); - else set_pts = 1; - dts = read_mpeg_timestamp(demux->stream, c); - len -= 4 + 1 + 4; - } - else if ((c >> 6) == 2) - { - int pts_flags; - int hdrlen; - int parse_ext2; - // System-2 (.VOB) stream: - c = stream_read_char(demux->stream); - pts_flags = c >> 6; - parse_ext2 = (id == 0x1FD) && ((c & 0x3F) == 1); - c = stream_read_char(demux->stream); - hdrlen = c; - len -= 2; - -#ifdef DEBUG - demux_mpg_printf(" hdrlen=%d (len=%d)", hdrlen, len); -#endif - - if (hdrlen > len) - { -#ifdef DEBUG - demux_mpg_printf("demux_mpg: invalid header length \n"); -#endif - - return -1; - } - if (pts_flags == 2 && hdrlen >= 5) - { - c = stream_read_char(demux->stream); - pts = read_mpeg_timestamp(demux->stream, c); - set_pts = 1; - len -= 5; - hdrlen -= 5; - } - else if (pts_flags == 3 && hdrlen >= 10) - { - c = stream_read_char(demux->stream); - pts = read_mpeg_timestamp(demux->stream, c); - set_pts = 1; - c = stream_read_char(demux->stream); - dts = read_mpeg_timestamp(demux->stream, c); - len -= 10; - hdrlen -= 10; - } - len -= hdrlen; - if (parse_ext2 && hdrlen >= 3) - { - c = stream_read_char(demux->stream); - hdrlen--; - - if ((c & 0x0F) != 0x0F) - { -#ifdef DEBUG - demux_mpg_printf("demux_mpg: pes_extension_flag2 not set, discarding pes packet\n"); -#endif - - return -1; - } - if (c & 0x80) //pes_private_data_flag - { - if (hdrlen < 16) - { -#ifdef DEBUG - demux_mpg_printf("demux_mpg: not enough pes_private_data bytes: %d < 16, discarding pes packet\n", hdrlen); -#endif - - return -1; - } - stream_skip(demux->stream, 16); - hdrlen -= 16; - } - if (c & 0x40) //pack_header_field_flag - { - int l = stream_read_char(demux->stream); - if (l < 0) //couldn't read from the stream? - return -1; - hdrlen--; - if (l < 0 || hdrlen < l) - { -#ifdef DEBUG - demux_mpg_printf("demux_mpg: not enough pack_header bytes: hdrlen: %d < skip: %d, discarding pes packet\n", hdrlen, l); -#endif - - return -1; - } - stream_skip(demux->stream, l); - hdrlen -= l; - } - if (c & 0x20) //program_packet_sequence_counter_flag - { - if (hdrlen < 2) - { -#ifdef DEBUG - demux_mpg_printf("demux_mpg: not enough program_packet bytes: hdrlen: %d, discarding pes packet\n", hdrlen); -#endif - - return -1; - } - stream_skip(demux->stream, 2); - hdrlen -= 2; - } - if (c & 0x10) - { - //STD - stream_skip(demux->stream, 2); - hdrlen -= 2; - } - c = stream_read_char(demux->stream); //pes_extension2 flag - hdrlen--; - if (c != 0x81) - { -#ifdef DEBUG - demux_mpg_printf("demux_mpg: unknown pes_extension2 format, len is > 1 \n"); -#endif - - return -1; - } - c = stream_read_char(demux->stream); //pes_extension2 payload === substream id - hdrlen--; - if (c < 0x55 || c > 0x5F) - { -#ifdef DEBUG - demux_mpg_printf("demux_mpg: unknown vc1 substream_id: 0x%x \n", c); -#endif - - return -1; - } - pes_ext2_subid = c; - } - if (hdrlen > 0) - stream_skip(demux->stream, hdrlen); // skip header and stuffing bytes - - if (id == 0x1FD && pes_ext2_subid != -1) - { - //==== EVO VC1 STREAMS ===// - if (!demux->v_streams[pes_ext2_subid]) new_sh_video(demux, pes_ext2_subid); - if (demux->video->id == -1) demux->video->id = pes_ext2_subid; - if (demux->video->id == pes_ext2_subid) - { - ds = demux->video; - if (!ds->sh) ds->sh = demux->v_streams[pes_ext2_subid]; - if (priv && ds->sh) - { - sh_video_t *sh = (sh_video_t *)ds->sh; - sh->format = mmioFOURCC('W', 'V', 'C', '1'); - } - } - } - //============== DVD Audio sub-stream ====================== - if (id == 0x1BD) - { - int aid, rawa52 = 0; - off_t tmppos; - unsigned int tmp; - - tmppos = stream_tell(demux->stream); - tmp = stream_read_word(demux->stream); - stream_seek(demux->stream, tmppos); - /// vdr stores A52 without the 4 header bytes, so we have to check this condition first - if (tmp == 0x0B77) - { - aid = 128; - rawa52 = 1; - } - else - { - aid = stream_read_char(demux->stream); - --len; - if (len < 3) return -1; // invalid audio packet - } - - // AID: - // 0x20..0x3F subtitle - // 0x80..0x87 and 0xC0..0xCF AC3 audio - // 0x88..0x8F and 0x98..0x9F DTS audio - // 0xA0..0xBF PCM audio - - if ((aid & 0xE0) == 0x20) - { - // subtitle: - aid &= 0x1F; - - if (!demux->s_streams[aid]) - { - sh_sub_t *sh = new_sh_sub(demux, aid); - if (sh) sh->type = 'v'; - -#ifdef DEBUG - demux_mpg_printf("==> Found subtitle: %d\n", aid); -#endif - } - - if (demux->sub->id > -1) - demux->sub->id &= 0x1F; - if (!dvdsub_lang && demux->sub->id == -1) - demux->sub->id = aid; - if (demux->sub->id == aid) - { - ds = demux->sub; - } - } - else if ((aid >= 0x80 && aid <= 0x8F) || (aid >= 0x98 && aid <= 0xAF) || (aid >= 0xC0 && aid <= 0xCF)) - { - -// aid=128+(aid&0x7F); - // aid=0x80..0xBF - new_audio_stream(demux, aid); - if (demux->audio->id == aid) - { - int type; - ds = demux->audio; - if (!ds->sh) ds->sh = demux->a_streams[aid]; - // READ Packet: Skip additional audio header data: - if (!rawa52) - { - c = stream_read_char(demux->stream); //num of frames - type = stream_read_char(demux->stream); //startpos hi - type = (type << 8) | stream_read_char(demux->stream); //startpos lo -// printf("\r[%02X][%04X]",c,type); - len -= 3; - } - if ((aid & 0xE0) == 0xA0 && len >= 3) - { - unsigned char *hdr; - // save audio header as codecdata! - if (!((sh_audio_t *)(ds->sh))->codecdata_len) - { - ((sh_audio_t *)(ds->sh))->codecdata = malloc(3); - ((sh_audio_t *)(ds->sh))->codecdata_len = 3; - } - hdr = ((sh_audio_t *)(ds->sh))->codecdata; - // read LPCM header: - // emphasis[1], mute[1], rvd[1], frame number[5]: - hdr[0] = stream_read_char(demux->stream); -// printf(" [%01X:%02d]",c>>5,c&31); - // quantization[2],freq[2],rvd[1],channels[3] - hdr[1] = stream_read_char(demux->stream); -// printf("[%01X:%01X] ",c>>4,c&15); - // dynamic range control (0x80=off): - hdr[2] = stream_read_char(demux->stream); -// printf("[%02X] ",c); - len -= 3; - -#ifdef DEBUG - if (len <= 0) demux_mpg_printf("End of packet while searching for PCM header\n"); -#endif - - } -// printf(" \n"); - } // if(demux->audio->id==aid) - - } - else - { -#ifdef DEBUG - demux_mpg_printf("Unknown 0x1BD substream: 0x%02X \n", aid); -#endif - } - } //if(id==0x1BD) - } - else - { - if (c != 0x0f) - { -#ifdef DEBUG - demux_mpg_printf(" {ERROR5,c=%d} \n", c); -#endif - - return -1; // invalid packet !!!!!! - } - } - -#ifdef DEBUG - if (mpeg_pts_error) demux_mpg_printf(" {PTS_err:%d} \n", mpeg_pts_error); -#endif - -#ifdef DEBUG - demux_mpg_printf(" => len=%d\n", len); -#endif - -// if(len<=0 || len>MAX_PS_PACKETSIZE) return -1; // Invalid packet size - if (len <= 0 || len > MAX_PS_PACKETSIZE) - { -#ifdef DEBUG - demux_mpg_printf("Invalid PS data len: %d\n", len); -#endif - - return -1; // invalid packet !!!!!! - } - - if (id >= 0x1C0 && id <= 0x1DF) - { - // mpeg audio - int aid = id - 0x1C0; - new_audio_stream(demux, aid); - if (demux->audio->id == aid) - { - ds = demux->audio; - if (!ds->sh) ds->sh = demux->a_streams[aid]; - if (priv && ds->sh) - { - sh_audio_t *sh = (sh_audio_t *)ds->sh; - if (priv->es_map[id - 0x1B0]) - sh->format = priv->es_map[id - 0x1B0]; - -#ifdef DEBUG - demux_mpg_printf("ASSIGNED TO STREAM %d CODEC %x\n", id, priv->es_map[id - 0x1B0]); -#endif - } - } - } - else if (id >= 0x1E0 && id <= 0x1EF) - { - // mpeg video - int aid = id - 0x1E0; - if (!demux->v_streams[aid]) new_sh_video(demux, aid); - if (demux->video->id == -1) demux->video->id = aid; - if (demux->video->id == aid) - { - ds = demux->video; - if (!ds->sh) ds->sh = demux->v_streams[aid]; - if (priv && ds->sh) - { - sh_video_t *sh = (sh_video_t *)ds->sh; - if (priv->es_map[id - 0x1B0]) - { - sh->format = priv->es_map[id - 0x1B0]; - -#ifdef DEBUG - demux_mpg_printf("ASSIGNED TO STREAM %d CODEC %x\n", id, priv->es_map[id - 0x1B0]); -#endif - } - } - } - } - - if (ds) - { -#ifdef DEBUG - demux_mpg_printf("DEMUX_MPG: Read %d data bytes from packet %04X\n", len, id); -// printf("packet start = 0x%X \n",stream_tell(demux->stream)-packet_start_pos); -#endif - - dp = new_demux_packet(len); - if (!dp) - { -#ifdef DEBUG - demux_mpg_printf("DEMUX_MPG ERROR: couldn't create demux_packet(%d bytes)\n", len); -#endif - - stream_skip(demux->stream, len); - return 0; - } - l = stream_read(demux->stream, dp->buffer, len); - if (l < len) - resize_demux_packet(dp, l); - len = l; - // if(set_pts) - dp->pts = pts / 90000.0f; - dp->pos = demux->filepos; - /* - workaround: - set dp->stream_pts only when feeding the video stream, or strangely interleaved files - (such as SWIII) will show strange alternations in the stream time, wildly going - back and forth - */ - if (ds == demux->video && stream_control(demux->stream, STREAM_CTRL_GET_CURRENT_TIME, (void *)&stream_pts) != STREAM_UNSUPPORTED) - dp->stream_pts = stream_pts; - ds_add_packet(ds, dp); - if (demux->priv && set_pts)((mpg_demuxer_t *)demux->priv)->last_pts = pts / 90000.0f; -// if(ds==demux->sub) parse_dvdsub(ds->last->buffer,ds->last->len); - return 1; - } - -#ifdef DEBUG - demux_mpg_printf("DEMUX_MPG: Skipping %d data bytes from packet %04X\n", len, id); -#endif - - if (len <= 2356) stream_skip(demux->stream, len); - return 0; -} - -static int num_elementary_packets100 = 0; -static int num_elementary_packets101 = 0; -static int num_elementary_packets12x = 0; -static int num_elementary_packets1B6 = 0; -static int num_elementary_packetsPES = 0; -static int num_mpeg12_startcode = 0; -static int num_h264_slice = 0; //combined slice -static int num_h264_dpa = 0; //DPA Slice -static int num_h264_dpb = 0; //DPB Slice -static int num_h264_dpc = 0; //DPC Slice -static int num_h264_idr = 0; //IDR Slice -static int num_h264_sps = 0; -static int num_h264_pps = 0; - -static int num_mp3audio_packets = 0; - -static void clear_stats(void) -{ - num_elementary_packets100 = 0; - num_elementary_packets101 = 0; - num_elementary_packets1B6 = 0; - num_elementary_packets12x = 0; - num_elementary_packetsPES = 0; - num_mpeg12_startcode = 0; - num_h264_slice = 0; //combined slice - num_h264_dpa = 0; //DPA Slice - num_h264_dpb = 0; //DPB Slice - num_h264_dpc = 0; //DPC Slice - num_h264_idr = 0; //IDR Slice - num_h264_sps = 0; - num_h264_pps = 0; - num_mp3audio_packets = 0; -} - -//assumes demuxer->synced < 2 -static inline void update_stats(int head) -{ - if (head == 0x1B6) ++num_elementary_packets1B6; - else if (head == 0x1B3 || head == 0x1BB) ++num_mpeg12_startcode; - else if (head == 0x100) ++num_elementary_packets100; - else if (head == 0x101) ++num_elementary_packets101; - else if (head == 0x1BD || (0x1C0 <= head && head <= 0x1EF)) - num_elementary_packetsPES++; - else if (head >= 0x120 && head <= 0x12F) ++num_elementary_packets12x; - if (head >= 0x100 && head < 0x1B0) - { - if ((head & ~0x60) == 0x101) ++num_h264_slice; - else if ((head & ~0x60) == 0x102) ++num_h264_dpa; - else if ((head & ~0x60) == 0x103) ++num_h264_dpb; - else if ((head & ~0x60) == 0x104) ++num_h264_dpc; - else if ((head & ~0x60) == 0x105 && head != 0x105) ++num_h264_idr; - else if ((head & ~0x60) == 0x107 && head != 0x107) ++num_h264_sps; - else if ((head & ~0x60) == 0x108 && head != 0x108) ++num_h264_pps; - } -} - -static int demux_mpg_probe(demuxer_t *demuxer) -{ - int pes = 1; - int tmp; - off_t tmppos; - int file_format = DEMUXER_TYPE_UNKNOWN; - - tmppos = stream_tell(demuxer->stream); - tmp = stream_read_dword(demuxer->stream); - if (tmp == 0x1E0 || tmp == 0x1C0) - { - tmp = stream_read_word(demuxer->stream); - if (tmp > 1 && tmp <= 2048) pes = 0; // demuxer->synced=3; // PES... - } - stream_seek(demuxer->stream, tmppos); - - clear_stats(); - - if (demux_mpg_open(demuxer)) - file_format = DEMUXER_TYPE_MPEG_PS; - else - { -#ifdef DEBUG - demux_mpg_printf("MPEG packet stats: p100: %d p101: %d p1B6: %d p12x: %d sli: %d a: %d b: %d c: %d idr: %d sps: %d pps: %d PES: %d MP3: %d, synced: %d\n", - num_elementary_packets100, num_elementary_packets101, - num_elementary_packets1B6, num_elementary_packets12x, - num_h264_slice, num_h264_dpa, - num_h264_dpb, num_h264_dpc = 0, - num_h264_idr, num_h264_sps = 0, - num_h264_pps, - num_elementary_packetsPES, num_mp3audio_packets, demuxer->synced); -#endif - - //MPEG packet stats: p100: 458 p101: 458 PES: 0 MP3: 1103 (.m2v) - if (num_mp3audio_packets > 50 && num_mp3audio_packets > 2 * num_elementary_packets100 - && abs(num_elementary_packets100 - num_elementary_packets101) > 2) - return file_format; - - // some hack to get meaningfull error messages to our unhappy users: - if (num_mpeg12_startcode >= 2 && num_elementary_packets100 >= 2 && num_elementary_packets101 >= 2 && - abs(num_elementary_packets101 + 8 - num_elementary_packets100) < 16) - { - if (num_elementary_packetsPES >= 4 && num_elementary_packetsPES >= num_elementary_packets100 - 4) - { - return file_format; - } - file_format = DEMUXER_TYPE_MPEG_ES; // <-- hack is here :) - } - else - // fuzzy mpeg4-es detection. do NOT enable without heavy testing of mpeg formats detection! - if (num_elementary_packets1B6 > 3 && num_elementary_packets12x >= 1 && - num_elementary_packetsPES == 0 && num_elementary_packets100 <= num_elementary_packets12x && - demuxer->synced < 2) - { - file_format = DEMUXER_TYPE_MPEG4_ES; - } - else - // fuzzy h264-es detection. do NOT enable without heavy testing of mpeg formats detection! - if ((num_h264_slice > 3 || (num_h264_dpa > 3 && num_h264_dpb > 3 && num_h264_dpc > 3)) && - /* FIXME num_h264_sps>=1 && */ num_h264_pps >= 1 && num_h264_idr >= 1 && - num_elementary_packets1B6 == 0 && num_elementary_packetsPES == 0 && - demuxer->synced < 2) - { - file_format = DEMUXER_TYPE_H264_ES; - } - else - { -#ifdef DEBUG - if (demuxer->synced == 2) - demux_mpg_printf("MPEG: MSGTR_MissingVideoStreamBug\n"); - else - demux_mpg_printf("NotSystemStream\n"); -#endif - } - } - //FIXME this shouldn't be necessary - stream_seek(demuxer->stream, tmppos); - return file_format; -} - -static int demux_mpg_es_fill_buffer(demuxer_t *demux, demux_stream_t *ds) -{ - // Elementary video stream - if (demux->stream->eof) return 0; - demux->filepos = stream_tell(demux->stream); - ds_read_packet(demux->video, demux->stream, STREAM_BUFFER_SIZE, 0, demux->filepos, 0); - return 1; -} - -/** - * \brief discard until 0x100 header and return a filled buffer - * \param b buffer-end pointer - * \param pos current pos in stream, negative since b points to end of buffer - * \param s stream to read from - * \return new position, differs from original pos when eof hit and thus - * b was modified to point to the new end of buffer - */ -static int find_end(unsigned char **b, int pos, stream_t *s) -{ - register int state = 0xffffffff; - unsigned char *buf = *b; - int start = pos; - int read, unused; - // search already read part - while (state != 0x100 && pos) - { - state = state << 8 | buf[pos++]; - } - // continue search in stream - while (state != 0x100) - { - register int c = stream_read_char(s); - if (c < 0) break; - state = state << 8 | c; - } - // modify previous header (from 0x1bc or 0x1bf to 0x100) - buf[start++] = 0; - // copy remaining buffer part to current pos - memmove(&buf[start], &buf[pos], -pos); - unused = start + -pos; // -unused bytes in buffer - read = stream_read(s, &buf[unused], -unused); - unused += read; - // fix buffer so it ends at pos == 0 (eof case) - *b = &buf[unused]; - start -= unused; - return start; -} - -/** - * This format usually uses an insane bitrate, which makes this function - * performance-critical! - * Be sure to benchmark any changes with different compiler versions. - */ -static int demux_mpg_gxf_fill_buffer(demuxer_t *demux, demux_stream_t *ds) -{ - demux_packet_t *pack; - int len; - demux->filepos = stream_tell(demux->stream); - pack = new_demux_packet(STREAM_BUFFER_SIZE); - len = stream_read(demux->stream, pack->buffer, STREAM_BUFFER_SIZE); - if (len <= 0) - { - free_demux_packet(pack); - return 0; - } - { - register uint32_t state = (uint32_t)demux->priv; - register int pos = -len; - unsigned char *buf = &pack->buffer[len]; - do - { - state = state << 8 | buf[pos]; - if (unlikely((state | 3) == 0x1bf)) - pos = find_end(&buf, pos, demux->stream); - } - while (++pos < 0); - demux->priv = (void *)state; - len = buf - pack->buffer; - } - if (len < STREAM_BUFFER_SIZE) - resize_demux_packet(pack, len); - ds_add_packet(ds, pack); - return 1; -} - -int demux_mpg_fill_buffer(demuxer_t *demux, demux_stream_t *ds) -{ - unsigned int head = 0; - int skipped = 0; - int max_packs = 256; // 512kbyte - int ret = 0; - -// System stream - do - { - demux->filepos = stream_tell(demux->stream); -#if 1 - //lame workaround: this is needed to show the progress bar when playing dvdnav:// - //(ths poor guy doesn't know teh length of the stream at startup) - demux->movi_end = demux->stream->end_pos; -#endif - head = stream_read_dword(demux->stream); - if ((head & 0xFFFFFF00) != 0x100) - { - // sync... - demux->filepos -= skipped; - while (1) - { - int c = stream_read_char(demux->stream); - if (c < 0) break; //EOF - head <<= 8; - if (head != 0x100) - { - head |= c; - if (mp_check_mp3_header(head)) ++num_mp3audio_packets; - ++skipped; //++demux->filepos; - continue; - } - head |= c; - break; - } - demux->filepos += skipped; - } - if (stream_eof(demux->stream)) break; - // sure: head=0x000001XX - -#ifdef DEBUG - demux_mpg_printf("*** head=0x%X\n", head); -#endif - - if (demux->synced == 0) - { - if (head == 0x1BA) demux->synced = 1; //else -// if(head==0x1BD || (head>=0x1C0 && head<=0x1EF)) demux->synced=3; // PES? - } - else if (demux->synced == 1) - { - if (head == 0x1BB || head == 0x1BD || (head >= 0x1C0 && head <= 0x1EF)) - { - demux->synced = 2; - -#ifdef DEBUG - demux_mpg_printf("system stream synced at 0x%"PRIX64" (%"PRId64")!\n", (int64_t)demux->filepos, (int64_t)demux->filepos); -#endif - - num_elementary_packets100 = 0; // requires for re-sync! - num_elementary_packets101 = 0; // requires for re-sync! - } - else demux->synced = 0; - } // else - if (demux->synced >= 2) - { - ret = demux_mpg_read_packet(demux, head); - if (!ret) - if (--max_packs == 0) - { - demux->stream->eof = 1; -#ifdef DEBUG - demux_mpg_printf("DoesntContainSelectedStream\n"); -#endif - - return 0; - } - if (demux->synced == 3) demux->synced = (ret == 1) ? 2 : 0; // PES detect - } - else - { - update_stats(head); - -#ifdef DEBUG - if (head >= 0x100 && head < 0x1B0) - demux_mpg_printf("Opps... elementary video packet found: %03X\n", head); - else if ((head >= 0x1C0 && head < 0x1F0) || head == 0x1BD) - demux_mpg_printf("Opps... PES packet found: %03X\n", head); -#endif - - if (((num_elementary_packets100 > 50 && num_elementary_packets101 > 50) || - (num_elementary_packetsPES > 50)) && skipped > 4000000) - { -#ifdef DEBUG - demux_mpg_printf("sync_mpeg_ps: seems to be ES/PES stream...\n"); -#endif - - demux->stream->eof = 1; - break; - } - if (num_mp3audio_packets > 100 && num_elementary_packets100 < 10) - { -#ifdef DEBUG - demux_mpg_printf("sync_mpeg_ps: seems to be MP3 stream...\n"); -#endif - - demux->stream->eof = 1; - break; - } - } - } - while (ret != 1); - -#ifdef DEBUG - demux_mpg_printf("demux: %d bad bytes skipped\n", skipped); -#endif - - if (demux->stream->eof) - { -#ifdef DEBUG - demux_mpg_printf("MPEG Stream reached EOF\n"); -#endif - - return 0; - } - - return 1; -} - -//extern void skip_audio_frame(sh_audio_t *sh_audio); - -static int whileSeeking = 0; - -void demux_seek_mpg(demuxer_t *demuxer, float rel_seek_secs, float audio_delay, int flags) -{ - demux_stream_t *d_audio = demuxer->audio; - demux_stream_t *d_video = demuxer->video; - sh_audio_t *sh_audio = d_audio->sh; - sh_video_t *sh_video = d_video->sh; - mpg_demuxer_t *mpg_d = (mpg_demuxer_t *)demuxer->priv; - int precision = 1; - float oldpts = 0; - off_t oldpos = demuxer->filepos; - float newpts = 0; - off_t newpos = (flags & SEEK_ABSOLUTE) ? demuxer->movi_start : oldpos; - - whileSeeking = 1; - getMPGMutex(FILENAME, __FUNCTION__, __LINE__); - - if (mpg_d) - oldpts = mpg_d->last_pts; - newpts = (flags & SEEK_ABSOLUTE) ? 0.0 : oldpts; - //================= seek in MPEG ========================== - //calculate the pts to seek to - if (flags & SEEK_FACTOR) - { - if (mpg_d && mpg_d->first_to_final_pts_len > 0.0) - newpts += mpg_d->first_to_final_pts_len * rel_seek_secs; - else - newpts += rel_seek_secs * (demuxer->movi_end - demuxer->movi_start) * oldpts / oldpos; - } - else - newpts += rel_seek_secs; - if (newpts < 0) newpts = 0; - - if (flags & SEEK_FACTOR) - { - // float seek 0..1 - newpos += (demuxer->movi_end - demuxer->movi_start) * rel_seek_secs; - } - else - { - // time seek (secs) - if (mpg_d && mpg_d->has_valid_timestamps) - { - if (mpg_d->first_to_final_pts_len > 0.0) - newpos += rel_seek_secs * (demuxer->movi_end - demuxer->movi_start) / mpg_d->first_to_final_pts_len; - else if (oldpts > 0.0) - newpos += rel_seek_secs * (oldpos - demuxer->movi_start) / oldpts; - } - else if (!sh_video || !sh_video->i_bps) // unspecified or VBR - newpos += 2324 * 75 * rel_seek_secs; // 174.3 kbyte/sec - else - newpos += sh_video->i_bps * rel_seek_secs; - } - - while (1) - { - if (newpos < demuxer->movi_start) - { - if (demuxer->stream->type != STREAMTYPE_VCD) demuxer->movi_start = 0; // for VCD - if (newpos < demuxer->movi_start) newpos = demuxer->movi_start; - } - - stream_seek(demuxer->stream, newpos); - - // re-sync video: - videobuf_code_len = 0; // reset ES stream buffer - - ds_fill_buffer(d_video); - if (sh_audio) - { - ds_fill_buffer(d_audio); - } - - while (1) - { - int i; - if (sh_audio && !d_audio->eof && d_video->pts && d_audio->pts) - { - float a_pts = d_audio->pts; - a_pts += (ds_tell_pts(d_audio) - sh_audio->a_in_buffer_len) / (float)sh_audio->i_bps; - if (d_video->pts > a_pts) - { - //skip_audio_frame(sh_audio); // sync audio - continue; - } - } - if (!sh_video) break; - i = sync_video_packet(d_video); - if (sh_video->format == mmioFOURCC('W', 'V', 'C', '1')) - { - if (i == 0x10E || i == 0x10F) //entry point or sequence header - break; - } - else if (sh_video->format == 0x10000004) //mpeg4 - { - if (i == 0x1B6) //vop (frame) startcode - { - int pos = videobuf_len; - if (!read_video_packet(d_video)) break; // EOF - if ((videobuffer[pos + 4] & 0x3F) == 0) break; //I-frame - } - } - else if (sh_video->format == 0x10000005) //h264 - { - if ((i & ~0x60) == 0x105) break; - } - else //default mpeg1/2 - { - if (i == 0x1B3 || i == 0x1B8) break; // found it! - } - if (!i /*|| !skip_video_packet(d_video)*/) break; // EOF? - } - if (!mpg_d) - break; - if (!precision || abs(newpts - mpg_d->last_pts) < 0.5 || (mpg_d->last_pts == oldpts)) break; - if ((newpos - oldpos) * (mpg_d->last_pts - oldpts) < 0) // invalid timestamps - { - mpg_d->has_valid_timestamps = 0; - break; - } - precision--; - //prepare another seek because we are off by more than 0.5s - if (mpg_d) - { - newpos += (newpts - mpg_d->last_pts) * (newpos - oldpos) / (mpg_d->last_pts - oldpts); - //ds_free_packs(d_audio); - //ds_free_packs(d_video); - //ds_free_packs(demuxer->sub); - demux_flush(demuxer); - demuxer->stream->eof = 0; // clear eof flag - d_video->eof = 0; - d_audio->eof = 0; - } - } - - whileSeeking = 0; - - releaseMPGMutex(FILENAME, __FUNCTION__, __LINE__); -} - -int demux_mpg_control(demuxer_t *demuxer, int cmd, void *arg) -{ - mpg_demuxer_t *mpg_d = (mpg_demuxer_t *)demuxer->priv; - - switch (cmd) - { - case DEMUXER_CTRL_GET_TIME_LENGTH: - if (stream_control(demuxer->stream, STREAM_CTRL_GET_TIME_LENGTH, arg) != STREAM_UNSUPPORTED) - { -#ifdef DEBUG - demux_mpg_printf("\r\nDEMUX_MPG_CTRL, (%.3lf)\r\n", *((double *)arg)); -#endif - - return DEMUXER_CTRL_GUESS; - } - if (mpg_d && mpg_d->has_valid_timestamps) - { - *((double *)arg) = (double)mpg_d->first_to_final_pts_len; - return DEMUXER_CTRL_OK; - } - return DEMUXER_CTRL_DONTKNOW; - - case DEMUXER_CTRL_GET_PERCENT_POS: - if (mpg_d && mpg_d->has_valid_timestamps && mpg_d->first_to_final_pts_len > 0.0) - { - *((int *)arg) = (int)(100 * (mpg_d->last_pts - mpg_d->first_pts) / mpg_d->first_to_final_pts_len); - return DEMUXER_CTRL_OK; - } - return DEMUXER_CTRL_DONTKNOW; - - case DEMUXER_CTRL_SWITCH_AUDIO: - if (!(mpg_d && mpg_d->num_a_streams > 1 && demuxer->audio && demuxer->audio->sh)) - return DEMUXER_CTRL_NOTIMPL; - else - { - demux_stream_t *d_audio = demuxer->audio; - sh_audio_t *sh_audio = d_audio->sh; - sh_audio_t *sh_a = sh_audio; - int i; - if (!sh_audio) - return DEMUXER_CTRL_NOTIMPL; - if (*((int *)arg) < 0) - { - for (i = 0; i < mpg_d->num_a_streams; i++) - { - if (d_audio->id == mpg_d->a_stream_ids[i]) break; - } - i = (i + 1) % mpg_d->num_a_streams; - sh_a = (sh_audio_t *)demuxer->a_streams[mpg_d->a_stream_ids[i]]; - } - else - { - for (i = 0; i < mpg_d->num_a_streams; i++) - if (*((int *)arg) == mpg_d->a_stream_ids[i]) break; - if (i < mpg_d->num_a_streams) - sh_a = (sh_audio_t *)demuxer->a_streams[*((int *)arg)]; - } - if (i < mpg_d->num_a_streams && d_audio->id != mpg_d->a_stream_ids[i]) - { - d_audio->id = mpg_d->a_stream_ids[i]; - d_audio->sh = sh_a; - ds_free_packs(d_audio); - } - } - *((int *)arg) = demuxer->audio->id; - return DEMUXER_CTRL_OK; - - default: - return DEMUXER_CTRL_NOTIMPL; - } -} - - -static int demux_mpg_pes_probe(demuxer_t *demuxer) -{ - demuxer->synced = 3; - return (demux_mpg_probe(demuxer) == DEMUXER_TYPE_MPEG_PS) ? DEMUXER_TYPE_MPEG_PES : 0; -} - - -static demuxer_t *demux_mpg_es_open(demuxer_t *demuxer) -{ - sh_video_t *sh_video = NULL; - - demuxer->audio->sh = NULL; // ES streams has no audio channel - demuxer->video->sh = new_sh_video(demuxer, 0); // create dummy video stream header, id=0 - sh_video = demuxer->video->sh; - sh_video->ds = demuxer->video; - - return demuxer; -} - -static demuxer_t *demux_mpg_gxf_open(demuxer_t *demuxer) -{ - demuxer->audio->sh = NULL; - demuxer->video->sh = new_sh_video(demuxer, 0); - ((sh_video_t *)demuxer->video->sh)->ds = demuxer->video; - demuxer->priv = (void *) 0xffffffff; - return demuxer; -} - -static demuxer_t *demux_mpg_ps_open(demuxer_t *demuxer) -{ - sh_audio_t *sh_audio = NULL; - sh_video_t *sh_video = NULL; - - sh_video = demuxer->video->sh; - sh_video->ds = demuxer->video; - - if (demuxer->audio->id != -2) - { - if (!ds_fill_buffer(demuxer->audio)) - { -#ifdef DEBUG - demux_mpg_printf("MPEG: MissingAudioStream\n"); -#endif - - demuxer->audio->sh = NULL; - } - else - { - sh_audio = demuxer->audio->sh; - sh_audio->ds = demuxer->audio; - } - } - - if (!sh_video->format && ps_probe > 0) - { - off_t pos = stream_tell(demuxer->stream); - - clear_stats(); - /* do { - head=sync_video_packet(demuxer->video); - if(!head) break; - update_stats(head); - skip_video_packet(demuxer->video); - } while(stream_tell(demuxer->stream) < pos + ps_probe && !demuxer->stream->eof); - */ - ds_free_packs(demuxer->video); - demuxer->stream->eof = 0; - stream_seek(demuxer->stream, pos); - -#ifdef DEBUG - demux_mpg_printf("MPEG packet stats: p100: %d p101: %d p1B6: %d p12x: %d sli: %d a: %d b: %d c: %d idr: %d sps: %d pps: %d\n", - num_elementary_packets100, num_elementary_packets101, - num_elementary_packets1B6, num_elementary_packets12x, - num_h264_slice, num_h264_dpa, num_h264_dpb, num_h264_dpc, - num_h264_idr, num_h264_sps, num_h264_pps); -#endif - - if (num_elementary_packets1B6 > 3 && num_elementary_packets12x >= 1 && - num_elementary_packets100 <= num_elementary_packets12x) - sh_video->format = 0x10000004; - else if ((num_h264_slice > 3 || (num_h264_dpa > 3 && num_h264_dpb > 3 && num_h264_dpc > 3)) && - num_h264_sps >= 1 && num_h264_pps >= 1 && num_h264_idr >= 1 && - num_elementary_packets1B6 == 0) - sh_video->format = 0x10000005; - else sh_video->format = 0x10000002; - } - - return demuxer; -} -////////////////////////////////////////////////////////////////7 -////////////////////////////////////////////////////////////////7 - -#include "common.h" -#include "container.h" -#include "manager.h" -#include "utils.h" - -static demuxer_t *demuxer = NULL; -static demux_stream_t *ds = NULL; // dvd subtitle buffer/demuxer -static sh_audio_t *sh_audio = NULL; -static sh_video_t *sh_video = NULL; -static pthread_t PlayThread; -static int hasPlayThreadStarted = 0; -static int TSMPEG = 0; - -demuxer_desc_t demuxer_desc_mpeg_ps = -{ - "MPEG PS demuxer", - "mpegps", - "MPEG-PS", - "Arpi?", - "Mpeg", - DEMUXER_TYPE_MPEG_PS, - 0, // unsafe autodetect - demux_mpg_probe, - demux_mpg_fill_buffer, - demux_mpg_ps_open, - demux_close_mpg, - demux_seek_mpg, - demux_mpg_control, -}; -demuxer_desc_t demuxer_desc_mpeg_pes = -{ - "MPEG PES demuxer", - "mpegpes", - "MPEG-PES", - "Arpi?", - "Mpeg", - DEMUXER_TYPE_MPEG_PES, - 0, // unsafe autodetect - demux_mpg_pes_probe, - demux_mpg_fill_buffer, - demux_mpg_ps_open, - demux_close_mpg, - demux_seek_mpg, - demux_mpg_control, -}; -int MpgInit(Context_t *context, char *filename) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - getMPGMutex(FILENAME, __FUNCTION__, __LINE__); - - int ret = 0; - - demuxer = (demuxer_t *)malloc(sizeof(demuxer_t)); - memset(demuxer, 0, sizeof(demuxer_t)); - - demuxer->audio = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(demuxer->audio, 0, sizeof(demux_stream_t)); - - demuxer->video = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(demuxer->video, 0, sizeof(demux_stream_t)); - - demuxer->sub = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(demuxer->sub, 0, sizeof(demux_stream_t)); - - ds = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(ds, 0, sizeof(demux_stream_t)); - -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - demuxer->stream = (stream_t *)malloc(sizeof(stream_t)); - memset(demuxer->stream, 0, sizeof(stream_t)); - - -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - demuxer->stream->fd = context->playback->fd; - - read(demuxer->stream->fd, demuxer->stream->buffer, 2048); //soviel ?? - -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - demuxer->desc = &demuxer_desc_mpeg_pes; - demuxer->audio->id = -1; - demuxer->video->id = -1; - //demuxer->video_play = 0; - demuxer->stream->start_pos = 0; - - if (context->playback->isUPNP) - demuxer->stream->type = STREAMTYPE_STREAM; - else if (context->playback->isHttp) - demuxer->stream->type = STREAMTYPE_STREAM; - else if (context->playback->isFile) - demuxer->stream->type = STREAMTYPE_FILE; - - demuxer->stream->flags = 6; - demuxer->stream->sector_size = 0; - demuxer->stream->buf_pos = 0; - demuxer->stream->buf_len = 2048; - demuxer->stream->pos = 2048; - demuxer->stream->start_pos = 0; - demuxer->stream->end_pos = 0; - demuxer->stream->eof = 0; - demuxer->stream->cache_pid = 0; - - ret = demux_mpg_pes_probe(demuxer); - //FIXME - if (ret == 0) - { - ret = ts_mpg(demuxer); -#ifdef DEBUG - printf("ret =%d\n", ret); -#endif - - if (ret == 0) // NO MPG OR TS - return -1;//FIXME - if (demuxer->video && demuxer->video->sh && demuxer->audio && demuxer->audio->sh) - { - sh_audio = demuxer->audio->sh; - -#ifdef DEBUG - printf("TS AUDIO 0x%02x\n", sh_audio->format); -#endif - - sh_video = demuxer->video->sh; -#ifdef DEBUG - printf("TS VIDEO 0x%08X\n", sh_video->format); -#endif - } - TSMPEG = 1; - } - else - { - ps_probe = 1; - ret = 0; - - demuxer = demux_mpg_ps_open(demuxer); - -#ifdef DEBUG - printf("ret = %d\n", ret); -#endif - - if (demuxer->video && demuxer->video->sh && demuxer->audio && demuxer->audio->sh) - { -#ifdef DEBUG - printf("DEMUXER=%s\n", demuxer->desc->name); -#endif - - sh_audio = demuxer->audio->sh; - -#ifdef DEBUG - printf("MPG AUDIO 0x%02x\n", sh_audio->format); -#endif - - sh_video = demuxer->video->sh; - -#ifdef DEBUG - printf("MPG VIDEO 0x%08X\n", sh_video->format); -#endif - } - } - if (sh_video->format == 0x10000001 || sh_video->format == 0x10000002) - { - Track_t Video = - { - "und", - "V_MPEG2", - 0, - }; - - context->manager->video->Command(context, MANAGER_ADD, &Video); - } - else if (sh_video->format == 0x10000004) - { - Track_t Video = - { - "und", - "V_MS/VFW/FOURCC", - 0, - }; - - context->manager->video->Command(context, MANAGER_ADD, &Video); - } - else if (sh_video->format == 0x10000005) - { - Track_t Video = - { - "und", - "V_MPEG2/H264", - 0, - }; - - context->manager->video->Command(context, MANAGER_ADD, &Video); - } - if (sh_audio->format == 0x55 || sh_audio->format == 0x50) //mp3 - { - - Track_t Audio = - { - "und", - "A_MPEG/L3", - 0, - }; - context->manager->audio->Command(context, MANAGER_ADD, &Audio); - - } - else if (sh_audio->format == 0x2000) //ac3 - { - - Track_t Audio = - { - "und", - "A_AC3", - 0, - }; - context->manager->audio->Command(context, MANAGER_ADD, &Audio); - - } - else if (sh_audio->format == 0x2001) //dts - { - - Track_t Audio = - { - "und", - "A_DTS", - 0, - }; - context->manager->audio->Command(context, MANAGER_ADD, &Audio); - } - - releaseMPGMutex(FILENAME, __FUNCTION__, __LINE__); - - return ret; -} - -static unsigned long long int aStartPts = 0; -static unsigned long long int vStartPts = 0; -#define INVALID_PTS_VALUE 0x200000000ull -void MpgGenerateParcel(Context_t *context, const demuxer_t *demuxer) -{ - const demux_stream_t *video = demuxer->video; - const demux_stream_t *audio = demuxer->audio; -// const demux_stream_t * sub = demuxer->sub; - unsigned long long int Pts_audio = 0; - unsigned long long int Pts_video = 0; - unsigned int aPtsInit = 0; - unsigned int vPtsInit = 0; - demux_packet_t *current_audio = NULL; - demux_packet_t *current_video = NULL; - - if (audio->first != NULL) - { - current_audio = audio->first; - -#ifdef DEBUG - if (current_audio->flags) // fixme : always zero? - printf("audio current_audio->flags = 0x%02x\n", current_audio->flags); -#endif - - if (!(current_audio->flags & 0x10)) //current frame isn't a keyframe - { - //printf("\tNORMALFRAME, "); - Pts_audio = INVALID_PTS_VALUE; - } - else - { - //printf("\tKEYFRAME, "); - Pts_audio = (current_audio->pts * 90000); - } - - if (aStartPts == 0) - { - aPtsInit = 1; - aStartPts = Pts_audio; - Pts_audio = 0; - } - else if (Pts_audio != INVALID_PTS_VALUE) - { - Pts_audio -= aStartPts; - } - } - - if (video->first != NULL) - { - current_video = video->first; - -#ifdef DEBUG - if (current_video->flags) // fixme : always zero? - printf("video current->flags = 0x%02x\n", current_video->flags); -#endif - - if (!(current_video->flags & 0x10)) //current frame isn't a keyframe - { - //printf("\tNORMALFRAME, "); - Pts_video = INVALID_PTS_VALUE; - } - else - { - //printf("\tKEYFRAME, "); - Pts_video = (current_video->pts * 90000); - } - - if (vStartPts == 0) - { - vPtsInit = 1; - vStartPts = Pts_video; - Pts_video = 0; - } - else if (Pts_video != INVALID_PTS_VALUE) - { - Pts_video -= vStartPts; - } - } - - if (aPtsInit && vStartPts) // audio found first time, video known? - { - if (vStartPts < aStartPts) - { - aStartPts = vStartPts; - } - else - { - vStartPts = aStartPts; - } - } - - if (vPtsInit && aStartPts) // video found first time, audio known? - { - if (vStartPts < aStartPts) - { - aStartPts = vStartPts; - } - else - { - vStartPts = aStartPts; - } - } - - while (current_audio != NULL) - { - - context->output->audio->Write(context, current_audio->buffer, current_audio->len, Pts_audio, NULL, 0, 0, "audio"); - - current_audio = current_audio->next; - } - - while (current_video != NULL) - { - - context->output->video->Write(context, current_video->buffer, current_video->len, Pts_video, 0, 0, 0, "video"); - - current_video = current_video->next; - } -} - - - -static void MpgThread(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - while (context->playback->isCreationPhase) - { -#ifdef DEBUG - printf("%s::%s Thread waiting for end of init phase...\n", FILENAME, __FUNCTION__); -#endif - } - -#ifdef DEBUG - printf("%s::%s Running!\n", FILENAME, __FUNCTION__); -#endif - - while (context && context->playback && context->playback->isPlaying) - { - //printf("%s -->\n", __FUNCTION__); - - //IF MOVIE IS PAUSED, WAIT - if (context->playback->isPaused) - { -#ifdef DEBUG - printf("%s::%s paused\n", FILENAME, __FUNCTION__); -#endif - - usleep(100000); - continue; - } - - if (context->playback->isSeeking || whileSeeking) - { -#ifdef DEBUG - printf("%s::%s seeking\n", FILENAME, __FUNCTION__); -#endif - - usleep(100000); - continue; - } - - getMPGMutex(FILENAME, __FUNCTION__, __LINE__); - - if (TSMPEG == 0) - { - if (!demux_mpg_fill_buffer(demuxer, ds)) - { -#ifdef DEBUG - printf("%s::%s demux_mpg_fill_buffer failed!\n", FILENAME, __FUNCTION__); -#endif - - releaseMPGMutex(FILENAME, __FUNCTION__, __LINE__); - - break; - } - } - else - { - if (!demux_ts_fill_buffer(demuxer, ds)) - { -#ifdef DEBUG - printf("%s::%s demux_ts_fill_buffer failed!\n", FILENAME, __FUNCTION__); -#endif - - releaseMPGMutex(FILENAME, __FUNCTION__, __LINE__); - - break; - } - } - - MpgGenerateParcel(context, demuxer); - - if (demuxer->sub != NULL && demuxer->sub->first != NULL) - { - ds_free_packs(demuxer->sub); - } - - if (demuxer->audio != NULL && demuxer->audio->first != NULL) - { - ds_free_packs(demuxer->audio); - } - - if (demuxer->video != NULL && demuxer->video->first != NULL) - { - ds_free_packs(demuxer->video); - } - - releaseMPGMutex(FILENAME, __FUNCTION__, __LINE__); - } - - aStartPts = 0; - vStartPts = 0; - - hasPlayThreadStarted = 0; // prevent locking situation when calling PLAYBACK_TERM - - context->playback->Command(context, PLAYBACK_TERM, NULL); - -#ifdef DEBUG - printf("%s::%s terminating\n", FILENAME, __FUNCTION__); -#endif -} - - -static int MpgPlay(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int error; - int ret = 0; - pthread_attr_t attr; - -#ifdef DEBUG - if (context && context->playback && context->playback->isPlaying) - { - printf("%s::%s is Playing\n", FILENAME, __FUNCTION__); - } - else - { - printf("%s::%s is NOT Playing\n", FILENAME, __FUNCTION__); - } -#endif - - if (hasPlayThreadStarted == 0) - { - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - - if ((error = pthread_create(&PlayThread, &attr, (void *)&MpgThread, context)) != 0) - { -#ifdef DEBUG - printf("%s::%s Error creating thread, error:%d:%s\n", FILENAME, __FUNCTION__, error, strerror(error)); -#endif - - hasPlayThreadStarted = 0; - ret = -1; - } - else - { -#ifdef DEBUG - printf("%s::%s Created thread\n", FILENAME, __FUNCTION__); -#endif - hasPlayThreadStarted = 1; - } - } - else - { -#ifdef DEBUG - printf("%s::%s A thread already exists!\n", FILENAME, __FUNCTION__); -#endif - - ret = -1; - } - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -static int MpgStop(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int i; - int ret = 0; - int wait_time = 20; - - while ((hasPlayThreadStarted != 0) && (--wait_time) > 0) - { -#ifdef DEBUG - printf("%s::%s Waiting for MPG thread to terminate itself, will try another %d times\n", FILENAME, __FUNCTION__, wait_time); -#endif - - usleep(100000); - } - - if (wait_time == 0) - { -#ifdef DEBUG - printf("%s::%s Timeout waiting for MPG thread!\n", FILENAME, __FUNCTION__); -#endif - - ret = -1; - } - else - { - - getMPGMutex(FILENAME, __FUNCTION__, __LINE__); - - demux_close_mpg(demuxer); - - free(demuxer->stream); - demuxer->stream = NULL; - - free(demuxer->sub); - demuxer->sub = NULL; - - free(demuxer->video); - demuxer->video = NULL; - - free(demuxer->audio); - demuxer->audio = NULL; - - for (i = 0; i < MAX_A_STREAMS; i++) - { - free(demuxer->a_streams[i]); - demuxer->a_streams[i] = NULL; - } - - for (i = 0; i < MAX_V_STREAMS; i++) - { - free(demuxer->v_streams[i]); - demuxer->v_streams[i] = NULL; - } - - for (i = 0; i < MAX_S_STREAMS; i++) - { - free(demuxer->s_streams[i]); - demuxer->s_streams[i] = NULL; - } - - free(demuxer); - demuxer = NULL; - - free(ds); - ds = NULL; - - releaseMPGMutex(FILENAME, __FUNCTION__, __LINE__); - } - - return ret; -} - -static int Command(void *_context, ContainerCmd_t command, void *argument) -{ - Context_t *context = (Context_t *) _context; -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int ret = 0; - - switch (command) - { - case CONTAINER_INIT: - { - char *FILENAME = (char *)argument; - ret = MpgInit(context, FILENAME); - break; - } - case CONTAINER_PLAY: - { - ret = MpgPlay(context); - break; - } - case CONTAINER_STOP: - { - ret = MpgStop(context); - break; - } - case CONTAINER_SEEK: - { - demux_seek_mpg(demuxer, 100.0, 100, 0); - break; - } - default: - { -#ifdef DEBUG - printf("%s::%s ContainerCmd %d not supported!\n", FILENAME, __FUNCTION__, command); -#endif - - break; - } - } - - return ret; -} - -static char *MPGCapabilities[] = { "mpg", "mpeg", "vob", "MPG", "MPEG", "VOB", NULL }; - -Container_t MPGContainer = -{ - "Mpg", - &Command, - MPGCapabilities, - -}; -/* -demuxer_desc_t demuxer_desc_mpeg_ps = { - "MPEG PS demuxer", - "mpegps", - "MPEG-PS", - "Arpi?", - "Mpeg", - DEMUXER_TYPE_MPEG_PS, - 0, // unsafe autodetect - demux_mpg_probe, - demux_mpg_fill_buffer, - demux_mpg_ps_open, - demux_close_mpg, - demux_seek_mpg, - demux_mpg_control, -}; - - -demuxer_desc_t demuxer_desc_mpeg_pes = { - "MPEG PES demuxer", - "mpegpes", - "MPEG-PES", - "Arpi?", - "Mpeg", - DEMUXER_TYPE_MPEG_PES, - 0, // unsafe autodetect - demux_mpg_pes_probe, - demux_mpg_fill_buffer, - demux_mpg_ps_open, - demux_close_mpg, - demux_seek_mpg, - demux_mpg_control, -}; - - -demuxer_desc_t demuxer_desc_mpeg_gxf = { - "MPEG ES in GXF demuxer", - "mpeggxf", - "MPEG-ES in GXF", - "Reimar Doeffinger", - "Mpeg", - DEMUXER_TYPE_MPEG_GXF, - 0, // hack autodetection - NULL, - demux_mpg_gxf_fill_buffer, - demux_mpg_gxf_open, - NULL, - NULL, - NULL -}; - -demuxer_desc_t demuxer_desc_mpeg_es = { - "MPEG ES demuxer", - "mpeges", - "MPEG-ES", - "Arpi?", - "Mpeg", - DEMUXER_TYPE_MPEG_ES, - 0, // hack autodetection - NULL, - demux_mpg_es_fill_buffer, - demux_mpg_es_open, - demux_close_mpg, - demux_seek_mpg, - demux_mpg_control, -}; - - -demuxer_desc_t demuxer_desc_mpeg4_es = { - "MPEG4 ES demuxer", - "mpeg4es", - "MPEG-ES", - "Arpi?", - "Mpeg", - DEMUXER_TYPE_MPEG4_ES, - 0, // hack autodetection - NULL, - demux_mpg_es_fill_buffer, - demux_mpg_es_open, - demux_close_mpg, - demux_seek_mpg, - demux_mpg_control, -}; - - -demuxer_desc_t demuxer_desc_h264_es = { - "H.264 ES demuxer", - "h264es", - "H264-ES", - "Arpi?", - "Mpeg", - DEMUXER_TYPE_H264_ES, - 0, // hack autodetection - NULL, - demux_mpg_es_fill_buffer, - demux_mpg_es_open, - demux_close_mpg, - demux_seek_mpg, - demux_mpg_control, -}; -*/ diff --git a/libeplayer2/container/demux_ts.c b/libeplayer2/container/demux_ts.c deleted file mode 100644 index 95ecce8..0000000 --- a/libeplayer2/container/demux_ts.c +++ /dev/null @@ -1,4734 +0,0 @@ -#include -#include -#include -#include -#include -#include - -//#include "../config.h" - -#include "stream.h" -#include "demuxer.h" -#include "parse_es.h" -#include "stheader.h" - -#include "ms_hdr.h" -#include "mpeg_hdr.h" - -/* #define DEBUG */ - -#ifdef DEBUG -int debugts = 1; -#define demux_ts_printf(x...) do { if (debugts)printf(x); } while (0) -#endif - - -#define TS_PH_PACKET_SIZE 192 -#define TS_FEC_PACKET_SIZE 204 -#define TS_PACKET_SIZE 188 -#define NB_PID_MAX 8192 - -#define MAX_HEADER_SIZE 6 /* enough for PES header + length */ -#define MAX_CHECK_SIZE 65535 -#define TS_MAX_PROBE_SIZE 2000000 /* do not forget to change this in cfg-common-opts.h, too */ -#define NUM_CONSECUTIVE_TS_PACKETS 32 -#define NUM_CONSECUTIVE_AUDIO_PACKETS 348 -#define MAX_A52_FRAME_SIZE 3840 - -#ifndef SIZE_MAX -#define SIZE_MAX ((size_t)-1) -#endif - -#define TYPE_AUDIO 1 -#define TYPE_VIDEO 2 - -static const char FILENAME[] = "demux_ts.c"; - -int ts_prog; -int ts_keep_broken = 0; -off_t ts_probe = 0; -int audio_substream_id = -1; -static unsigned int video_format = 0; -extern char *dvdsub_lang, *audio_lang; //for -alang - -typedef enum -{ - UNKNOWN = -1, - VIDEO_MPEG1 = 0x10000001, - VIDEO_MPEG2 = 0x10000002, - VIDEO_MPEG4 = 0x10000004, - VIDEO_H264 = 0x10000005, - VIDEO_AVC = mmioFOURCC('a', 'v', 'c', '1'), - VIDEO_VC1 = mmioFOURCC('W', 'V', 'C', '1'), - AUDIO_MP2 = 0x50, - AUDIO_A52 = 0x2000, - AUDIO_DTS = 0x2001, - AUDIO_LPCM_BE = 0x10001, - AUDIO_AAC = mmioFOURCC('M', 'P', '4', 'A'), - AUDIO_TRUEHD = mmioFOURCC('T', 'R', 'H', 'D'), - SPU_DVD = 0x3000000, - SPU_DVB = 0x3000001, - SPU_TELETEXT = 0x3000002, - PES_PRIVATE1 = 0xBD00000, - SL_PES_STREAM = 0xD000000, - SL_SECTION = 0xD100000, - MP4_OD = 0xD200000, -} es_stream_type_t; - -typedef struct -{ - uint8_t *buffer; - uint16_t buffer_len; -} ts_section_t; - -typedef struct -{ - int size; - unsigned char *start; - uint16_t payload_size; - es_stream_type_t type, subtype; - float pts, last_pts; - int pid; - char lang[4]; - int last_cc; // last cc code (-1 if first packet) - int is_synced; - ts_section_t section; - uint8_t *extradata; - int extradata_alloc, extradata_len; - struct - { - uint8_t au_start, au_end, last_au_end; - } sl; -} ES_stream_t; - -typedef struct -{ - void *sh; - int id; - int type; -} sh_av_t; - -typedef struct MpegTSContext -{ - int packet_size; // raw packet size, including FEC if present e.g. 188 bytes - ES_stream_t *pids[NB_PID_MAX]; - sh_av_t streams[NB_PID_MAX]; -} MpegTSContext; - - -typedef struct -{ - demux_stream_t *ds; - demux_packet_t *pack; - int offset, buffer_size; -} av_fifo_t; - -#define MAX_EXTRADATA_SIZE 64*1024 -typedef struct -{ - int32_t object_type; //aka codec used - int32_t stream_type; //video, audio etc. - uint8_t buf[MAX_EXTRADATA_SIZE]; - uint16_t buf_size; - uint8_t szm1; -} mp4_decoder_config_t; - -typedef struct -{ - //flags - uint8_t flags; - uint8_t au_start; - uint8_t au_end; - uint8_t random_accesspoint; - uint8_t random_accesspoint_only; - uint8_t padding; - uint8_t use_ts; - uint8_t idle; - uint8_t duration; - - uint32_t ts_resolution, ocr_resolution; - uint8_t ts_len, ocr_len, au_len, instant_bitrate_len, degr_len, au_seqnum_len, packet_seqnum_len; - uint32_t timescale; - uint16_t au_duration, cts_duration; - uint64_t ocr, dts, cts; -} mp4_sl_config_t; - -typedef struct -{ - uint16_t id; - uint8_t flags; - mp4_decoder_config_t decoder; - mp4_sl_config_t sl; -} mp4_es_descr_t; - -typedef struct -{ - uint16_t id; - uint8_t flags; - mp4_es_descr_t *es; - uint16_t es_cnt; -} mp4_od_t; - -typedef struct -{ - uint8_t skip; - uint8_t table_id; - uint8_t ssi; - uint16_t section_length; - uint16_t ts_id; - uint8_t version_number; - uint8_t curr_next; - uint8_t section_number; - uint8_t last_section_number; - struct pat_progs_t - { - uint16_t id; - uint16_t pmt_pid; - } *progs; - uint16_t progs_cnt; - ts_section_t section; -} pat_t; - -typedef struct -{ - uint16_t progid; - uint8_t skip; - uint8_t table_id; - uint8_t ssi; - uint16_t section_length; - uint8_t version_number; - uint8_t curr_next; - uint8_t section_number; - uint8_t last_section_number; - uint16_t PCR_PID; - uint16_t prog_descr_length; - ts_section_t section; - uint16_t es_cnt; - struct pmt_es_t - { - uint16_t pid; - uint32_t type; //it's 8 bit long, but cast to the right type as FOURCC - uint16_t descr_length; - uint8_t format_descriptor[5]; - uint8_t lang[4]; - uint16_t mp4_es_id; - } *es; - mp4_od_t iod, *od; - mp4_es_descr_t *mp4es; - int od_cnt, mp4es_cnt; -} pmt_t; - -typedef struct -{ - uint64_t size; - float duration; - float first_pts; - float last_pts; -} TS_stream_info; - -typedef struct -{ - MpegTSContext ts; - int last_pid; - av_fifo_t fifo[3]; //0 for audio, 1 for video, 2 for subs - pat_t pat; - pmt_t *pmt; - uint16_t pmt_cnt; - uint32_t prog; - uint32_t vbitrate; - int keep_broken; - int last_aid; - int last_vid; - char packet[TS_FEC_PACKET_SIZE]; - TS_stream_info vstr, astr; -} ts_priv_t; - - -typedef struct -{ - es_stream_type_t type; - ts_section_t section; -} TS_pids_t; - - -#define IS_AUDIO(x) (((x) == AUDIO_MP2) || ((x) == AUDIO_A52) || ((x) == AUDIO_LPCM_BE) || ((x) == AUDIO_AAC) || ((x) == AUDIO_DTS) || ((x) == AUDIO_TRUEHD)) -#define IS_VIDEO(x) (((x) == VIDEO_MPEG1) || ((x) == VIDEO_MPEG2) || ((x) == VIDEO_MPEG4) || ((x) == VIDEO_H264) || ((x) == VIDEO_AVC) || ((x) == VIDEO_VC1)) -#define IS_SUB(x) (((x) == SPU_DVD) || ((x) == SPU_DVB) || ((x) == SPU_TELETEXT)) - -pthread_mutex_t TSmutex; - -void getTSMutex(const char *filename, const char *function, int line) // FIXME: Use one central getMutex and pass the mutex into the function -{ -#ifdef DEBUG -// printf("%s::%s::%d requesting mutex\n",filename, function, line); -#endif - - pthread_mutex_lock(&TSmutex); - -#ifdef DEBUG -// printf("%s::%s::%d received mutex\n",filename, function, line); -#endif -} - -void releaseTSMutex(const char *filename, const char *function, int line) // FIXME: Use one central getMutex and pass the mutex into the function -{ - pthread_mutex_unlock(&TSmutex); - -#ifdef DEBUG -// printf("%s::%s::%d released mutex\n",filename, function, line); -#endif -} - -static int ts_parse(demuxer_t *demuxer, ES_stream_t *es, unsigned char *packet, int probe); - -static uint8_t get_packet_size(const unsigned char *buf, int size) -{ - int i; - - if (size < (TS_FEC_PACKET_SIZE * NUM_CONSECUTIVE_TS_PACKETS)) - return 0; - - for (i = 0; i < NUM_CONSECUTIVE_TS_PACKETS; i++) - { - if (buf[i * TS_PACKET_SIZE] != 0x47) - { -#ifdef DEBUG - demux_ts_printf("GET_PACKET_SIZE, pos %d, char: %2x\n", i, buf[i * TS_PACKET_SIZE]); -#endif - - goto try_fec; - } - } - return TS_PACKET_SIZE; - -try_fec: - for (i = 0; i < NUM_CONSECUTIVE_TS_PACKETS; i++) - { - if (buf[i * TS_FEC_PACKET_SIZE] != 0x47) - { -#ifdef DEBUG - demux_ts_printf("GET_PACKET_SIZE, pos %d, char: %2x\n", i, buf[i * TS_PACKET_SIZE]); -#endif - - goto try_philips; - } - } - return TS_FEC_PACKET_SIZE; - -try_philips: - for (i = 0; i < NUM_CONSECUTIVE_TS_PACKETS; i++) - { - if (buf[i * TS_PH_PACKET_SIZE] != 0x47) - return 0; - } - return TS_PH_PACKET_SIZE; -} - -static int parse_avc_sps(uint8_t *buf, int len, int *w, int *h); -static inline uint8_t *pid_lang_from_pmt(ts_priv_t *priv, int pid); - -static void ts_add_stream(demuxer_t *demuxer, ES_stream_t *es) -{ -#ifdef DEBUG - int i; -#endif - ts_priv_t *priv = (ts_priv_t *) demuxer->priv; - - if (priv->ts.streams[es->pid].sh) - return; - - if ((IS_AUDIO(es->type) || IS_AUDIO(es->subtype)) && priv->last_aid + 1 < MAX_A_STREAMS) - { - sh_audio_t *sh = new_sh_audio_aid(demuxer, priv->last_aid, es->pid); - if (sh) - { -#ifdef DEBUG - uint8_t *lang = pid_lang_from_pmt(priv, es->pid); -#endif - sh->format = IS_AUDIO(es->type) ? es->type : es->subtype; - sh->ds = demuxer->audio; - - priv->ts.streams[es->pid].id = priv->last_aid; - priv->ts.streams[es->pid].sh = sh; - priv->ts.streams[es->pid].type = TYPE_AUDIO; - -#ifdef DEBUG - demux_ts_printf("\r\nADDED AUDIO PID %d, type: %x stream n. %d\r\n", es->pid, sh->format, priv->last_aid); - if (lang && lang[0]) - demux_ts_printf("ID_AID_%d_LANG=%s\n", es->pid, lang); -#endif - - priv->last_aid++; - } - - if (es->extradata && es->extradata_len) - { - sh->wf = (WAVEFORMATEX *) malloc(sizeof(WAVEFORMATEX) + es->extradata_len); - sh->wf->cbSize = es->extradata_len; - memcpy(sh->wf + 1, es->extradata, es->extradata_len); - } - } - - if ((IS_VIDEO(es->type) || IS_VIDEO(es->subtype)) && priv->last_vid + 1 < MAX_V_STREAMS) - { - sh_video_t *sh = new_sh_video_vid(demuxer, priv->last_vid, es->pid); - if (sh) - { - sh->format = IS_VIDEO(es->type) ? es->type : es->subtype; - sh->ds = demuxer->video; - - priv->ts.streams[es->pid].id = priv->last_vid; - priv->ts.streams[es->pid].sh = sh; - priv->ts.streams[es->pid].type = TYPE_VIDEO; - -#ifdef DEBUG - demux_ts_printf("\r\nADDED VIDEO PID %d, type: %x stream n. %d\r\n", es->pid, sh->format, priv->last_vid); -#endif - - priv->last_vid++; - - - if (sh->format == VIDEO_AVC && es->extradata && es->extradata_len) - { - int w = 0, h = 0; - sh->bih = (BITMAPINFOHEADER *) calloc(1, sizeof(BITMAPINFOHEADER) + es->extradata_len); - sh->bih->biSize = sizeof(BITMAPINFOHEADER) + es->extradata_len; - sh->bih->biCompression = sh->format; - memcpy(sh->bih + 1, es->extradata, es->extradata_len); - -#ifdef DEBUG - demux_ts_printf("EXTRADATA(%d BYTES): \n", es->extradata_len); - for (i = 0; i < es->extradata_len; i++) - demux_ts_printf("%02x ", (int) es->extradata[i]); - demux_ts_printf("\n"); -#endif - - if (parse_avc_sps(es->extradata, es->extradata_len, &w, &h)) - { - sh->bih->biWidth = w; - sh->bih->biHeight = h; - } - } - } - } -} - -static int ts_check_file(demuxer_t *demuxer) -{ - const int buf_size = (TS_FEC_PACKET_SIZE * NUM_CONSECUTIVE_TS_PACKETS); - unsigned char buf[TS_FEC_PACKET_SIZE * NUM_CONSECUTIVE_TS_PACKETS], done = 0, *ptr; - uint32_t _read, i, count = 0, is_ts; - int cc[NB_PID_MAX], last_cc[NB_PID_MAX], pid, cc_ok, c, good, bad; - uint8_t size = 0; - off_t pos = 0; - off_t init_pos; - -#ifdef DEBUG - demux_ts_printf("Checking for MPEG-TS...\n"); -#endif - - init_pos = stream_tell(demuxer->stream); - is_ts = 0; - while (! done) - { - i = 1; - c = 0; - - while (((c = stream_read_char(demuxer->stream)) != 0x47) - && (c >= 0) - && (i < MAX_CHECK_SIZE) - && ! demuxer->stream->eof - ) i++; - - if (c != 0x47) - { -#ifdef DEBUG - demux_ts_printf("THIS DOESN'T LOOK LIKE AN MPEG-TS FILE!\n"); -#endif - - is_ts = 0; - done = 1; - continue; - } - - pos = stream_tell(demuxer->stream) - 1; - buf[0] = c; - _read = stream_read(demuxer->stream, &buf[1], buf_size - 1); - - if (_read < buf_size - 1) - { -#ifdef DEBUG - demux_ts_printf("COULDN'T READ ENOUGH DATA, EXITING TS_CHECK\n"); -#endif - - stream_reset(demuxer->stream); - return 0; - } - - size = get_packet_size(buf, buf_size); - if (size) - { - done = 1; - is_ts = 1; - } - - if (pos - init_pos >= MAX_CHECK_SIZE) - { - done = 1; - is_ts = 0; - } - } - -#ifdef DEBUG - demux_ts_printf("TRIED UP TO POSITION %"PRIu64", FOUND %x, packet_size= %d, SEEMS A TS? %d\n", (uint64_t) pos, c, size, is_ts); -#endif - - stream_seek(demuxer->stream, pos); - - if (! is_ts) - return 0; - - //LET'S CHECK continuity counters - good = bad = 0; - for (count = 0; count < NB_PID_MAX; count++) - { - cc[count] = last_cc[count] = -1; - } - - for (count = 0; count < NUM_CONSECUTIVE_TS_PACKETS; count++) - { - ptr = &(buf[size * count]); - pid = ((ptr[1] & 0x1f) << 8) | ptr[2]; - -#ifdef DEBUG - demux_ts_printf("BUF: %02x %02x %02x %02x, PID %d, SIZE: %d \n", - ptr[0], ptr[1], ptr[2], ptr[3], pid, size); -#endif - - if ((pid == 8191) || (pid < 16)) - continue; - - cc[pid] = (ptr[3] & 0xf); - cc_ok = (last_cc[pid] < 0) || ((((last_cc[pid] + 1) & 0x0f) == cc[pid])); - -#ifdef DEBUG - demux_ts_printf("PID %d, COMPARE CC %d AND LAST_CC %d\n", pid, cc[pid], last_cc[pid]); -#endif - - if (! cc_ok) - //return 0; - bad++; - else - good++; - - last_cc[pid] = cc[pid]; - } - -#ifdef DEBUG - demux_ts_printf("GOOD CC: %d, BAD CC: %d\n", good, bad); -#endif - - if (good >= bad) - return size; - else - return 0; -} - - -static inline int32_t progid_idx_in_pmt(ts_priv_t *priv, uint16_t progid) -{ - int x; - - if (priv->pmt == NULL) - return -1; - - for (x = 0; x < priv->pmt_cnt; x++) - { - if (priv->pmt[x].progid == progid) - return x; - } - - return -1; -} - - -static inline int32_t progid_for_pid(ts_priv_t *priv, int pid, int32_t req) //finds the first program listing a pid -{ - int i, j; - pmt_t *pmt; - - - if (priv->pmt == NULL) - return -1; - - - for (i = 0; i < priv->pmt_cnt; i++) - { - pmt = &(priv->pmt[i]); - - if (pmt->es == NULL) - return -1; - - for (j = 0; j < pmt->es_cnt; j++) - { - if (pmt->es[j].pid == pid) - { - if ((req == 0) || (req == pmt->progid)) - return pmt->progid; - } - } - - } - return -1; -} - -static inline int32_t prog_pcr_pid(ts_priv_t *priv, int progid) -{ - int i; - - if (priv->pmt == NULL) - return -1; - for (i = 0; i < priv->pmt_cnt; i++) - { - if (priv->pmt[i].progid == progid) - return priv->pmt[i].PCR_PID; - } - return -1; -} - - -static inline int pid_match_lang(ts_priv_t *priv, uint16_t pid, char *lang) -{ - uint16_t i, j; - pmt_t *pmt; - - if (priv->pmt == NULL) - return -1; - - for (i = 0; i < priv->pmt_cnt; i++) - { - pmt = &(priv->pmt[i]); - - if (pmt->es == NULL) - return -1; - - for (j = 0; j < pmt->es_cnt; j++) - { - if (pmt->es[j].pid != pid) - continue; - -#ifdef DEBUG - demux_ts_printf("CMP LANG %s AND %s, pids: %d %d\n", pmt->es[j].lang, lang, pmt->es[j].pid, pid); -#endif - - if (strncmp((char *) pmt->es[j].lang, lang, 3) == 0) - { - return 1; - } - } - - } - - return -1; -} - -typedef struct -{ - int32_t atype, vtype, stype; //types - int32_t apid, vpid, spid; //stream ids - char slang[4], alang[4]; //languages - uint16_t prog; - off_t probe; -} tsdemux_init_t; - -//stripped down version of a52_syncinfo() from liba52 -//copyright belongs to Michel Lespinasse and Aaron Holtzman -int mp_a52_framesize(uint8_t *buf, int *srate) -{ - int rate[] = { 32, 40, 48, 56, 64, 80, 96, 112, - 128, 160, 192, 224, 256, 320, 384, 448, - 512, 576, 640 - }; - uint8_t halfrate[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3}; - int frmsizecod, bitrate, half; - - if ((buf[0] != 0x0b) || (buf[1] != 0x77)) /* syncword */ - return 0; - - if (buf[5] >= 0x60) /* bsid >= 12 */ - return 0; - - half = halfrate[buf[5] >> 3]; - - frmsizecod = buf[4] & 63; - if (frmsizecod >= 38) - return 0; - - bitrate = rate[frmsizecod >> 1]; - - switch (buf[4] & 0xc0) - { - case 0: /* 48 KHz */ - *srate = 48000 >> half; - return 4 * bitrate; - case 0x40: /* 44.1 KHz */ - *srate = 44100 >> half; - return 2 * (320 * bitrate / 147 + (frmsizecod & 1)); - case 0x80: /* 32 KHz */ - *srate = 32000 >> half; - return 6 * bitrate; - } - - return 0; -} - -//second stage: returns the count of A52 syncwords found -static int a52_check(char *buf, int len) -{ - int cnt, frame_length, ok, srate; - - cnt = ok = 0; - if (len < 8) - return 0; - - while (cnt < len - 7) - { - if (buf[cnt] == 0x0B && buf[cnt + 1] == 0x77) - { - frame_length = mp_a52_framesize((uint8_t *) &buf[cnt], &srate); - if (frame_length >= 7 && frame_length <= 3840) - { - cnt += frame_length; - ok++; - } - else - cnt++; - } - else - cnt++; - } - -#ifdef DEBUG - demux_ts_printf("A52_CHECK(%d input bytes), found %d frame syncwords of %d bytes length\n", len, ok, frame_length); -#endif - - return ok; -} - - -static off_t ts_detect_streams(demuxer_t *demuxer, tsdemux_init_t *param) -{ - int video_found = 0, audio_found = 0, sub_found = 0, i, num_packets = 0, req_apid, req_vpid, req_spid; - int is_audio, is_video, is_sub, has_tables; - int32_t p, chosen_pid = 0; - off_t pos = 0, ret = 0, init_pos, end_pos; - ES_stream_t es; - unsigned char tmp[TS_FEC_PACKET_SIZE]; - ts_priv_t *priv = (ts_priv_t *) demuxer->priv; - struct - { - char *buf; - int pos; - } pes_priv1[8192], *pptr; - char *tmpbuf; - - priv->last_pid = 8192; //invalid pid - - req_apid = param->apid; - req_vpid = param->vpid; - req_spid = param->spid; - - has_tables = 0; - memset(pes_priv1, 0, sizeof(pes_priv1)); - init_pos = stream_tell(demuxer->stream); - -#ifdef DEBUG - demux_ts_printf("PROBING UP TO %"PRIu64", PROG: %d\n", (uint64_t) param->probe, param->prog); -#endif - - end_pos = init_pos + (param->probe ? param->probe : TS_MAX_PROBE_SIZE); - while (1) - { - pos = stream_tell(demuxer->stream); - - if ((pos > end_pos) || (demuxer->stream->eof)) - { - break; - } - - if (ts_parse(demuxer, &es, tmp, 1)) - { - //Non PES-aligned A52 audio may escape detection if PMT is not present; - //in this case we try to find at least 3 A52 syncwords - if ((es.type == PES_PRIVATE1) && (! audio_found) && req_apid > -2) - { - pptr = &pes_priv1[es.pid]; - if (pptr->pos < 64 * 1024) - { - tmpbuf = (char *) realloc(pptr->buf, pptr->pos + es.size); - if (tmpbuf != NULL) - { - pptr->buf = tmpbuf; - memcpy(&(pptr->buf[ pptr->pos ]), es.start, es.size); - pptr->pos += es.size; - if (a52_check(pptr->buf, pptr->pos) > 2) - { - param->atype = AUDIO_A52; - param->apid = es.pid; - es.type = AUDIO_A52; - } - } - } - } - - is_audio = IS_AUDIO(es.type) || ((es.type == SL_PES_STREAM) && IS_AUDIO(es.subtype)); - is_video = IS_VIDEO(es.type) || ((es.type == SL_PES_STREAM) && IS_VIDEO(es.subtype)); - is_sub = IS_SUB(es.type); - - - if ((! is_audio) && (! is_video) && (! is_sub)) - continue; - if (is_audio && req_apid == -2) - continue; - - if (is_video) - { -#ifdef DEBUG - demux_ts_printf("ID_VIDEO_ID=%d\n", es.pid); -#endif - - chosen_pid = (req_vpid == es.pid); - if ((! chosen_pid) && (req_vpid > 0)) - continue; - } - else if (is_audio) - { -#ifdef DEBUG - demux_ts_printf("ID_AUDIO_ID=%d\n", es.pid); - if (es.lang[0] > 0) - demux_ts_printf("ID_AID_%d_LANG=%s\n", es.pid, es.lang); -#endif - - if (req_apid > 0) - { - chosen_pid = (req_apid == es.pid); - if (! chosen_pid) - continue; - } - else if (param->alang[0] > 0 && es.lang[0] > 0) - { - if (pid_match_lang(priv, es.pid, param->alang) == -1) - continue; - - chosen_pid = 1; - param->apid = req_apid = es.pid; - } - } - else if (is_sub) - { -#ifdef DEBUG - demux_ts_printf("ID_SUBTITLE_ID=%d\n", es.pid); - if (es.lang[0] > 0) - demux_ts_printf("ID_SID_%d_LANG=%s\n", es.pid, es.lang); -#endif - - chosen_pid = (req_spid == es.pid); - if ((! chosen_pid) && (req_spid > 0)) - continue; - } - - if (req_apid < 0 && (param->alang[0] == 0) && req_vpid < 0 && req_spid < 0) - chosen_pid = 1; - - if ((ret == 0) && chosen_pid) - { - ret = stream_tell(demuxer->stream); - } - - p = progid_for_pid(priv, es.pid, param->prog); - if (p != -1) - { - has_tables++; - if (!param->prog && chosen_pid) - param->prog = p; - } - - if ((param->prog > 0) && (param->prog != p)) - { - if (audio_found) - { - if (is_video && (req_vpid == es.pid)) - { - param->vtype = IS_VIDEO(es.type) ? es.type : es.subtype; - param->vpid = es.pid; - video_found = 1; - break; - } - } - - if (video_found) - { - if (is_audio && (req_apid == es.pid)) - { - param->atype = IS_AUDIO(es.type) ? es.type : es.subtype; - param->apid = es.pid; - audio_found = 1; - break; - } - } - - - continue; - } - - -#ifdef DEBUG - demux_ts_printf("TYPE: %x, PID: %d, PROG FOUND: %d\n", es.type, es.pid, param->prog); -#endif - - if (is_video) - { - if ((req_vpid == -1) || (req_vpid == es.pid)) - { - param->vtype = IS_VIDEO(es.type) ? es.type : es.subtype; - param->vpid = es.pid; - video_found = 1; - } - } - - - if (((req_vpid == -2) || (num_packets >= NUM_CONSECUTIVE_AUDIO_PACKETS)) && audio_found && !param->probe) - { - //novideo or we have at least 348 audio packets (64 KB) without video (TS with audio only) - param->vtype = 0; - break; - } - - if (is_sub) - { - if ((req_spid == -1) || (req_spid == es.pid)) - { - param->stype = es.type; - param->spid = es.pid; - sub_found = 1; - } - } - - if (is_audio) - { - if ((req_apid == -1) || (req_apid == es.pid)) - { - param->atype = IS_AUDIO(es.type) ? es.type : es.subtype; - param->apid = es.pid; - audio_found = 1; - } - } - - if (audio_found && (param->apid == es.pid) && (! video_found)) - num_packets++; - - if ((has_tables == 0) && (video_found && audio_found) && (pos >= 1000000)) - { - break; - } - } - } - - for (i = 0; i < 8192; i++) - { - if (pes_priv1[i].buf != NULL) - { - free(pes_priv1[i].buf); - pes_priv1[i].buf = NULL; - pes_priv1[i].pos = 0; - } - } - - if (video_found) - { -#ifdef DEBUG - if (param->vtype == VIDEO_MPEG1) - demux_ts_printf("VIDEO MPEG1(pid=%d) ", param->vpid); - else if (param->vtype == VIDEO_MPEG2) - demux_ts_printf("VIDEO MPEG2(pid=%d) ", param->vpid); - else if (param->vtype == VIDEO_MPEG4) - demux_ts_printf("VIDEO MPEG4(pid=%d) ", param->vpid); - else if (param->vtype == VIDEO_H264) - demux_ts_printf("VIDEO H264(pid=%d) ", param->vpid); - else if (param->vtype == VIDEO_VC1) - demux_ts_printf("VIDEO VC1(pid=%d) ", param->vpid); - else if (param->vtype == VIDEO_AVC) - demux_ts_printf("VIDEO AVC(NAL-H264, pid=%d) ", param->vpid); -#endif - } - else - { - param->vtype = UNKNOWN; - //WE DIDN'T MATCH ANY VIDEO STREAM - -#ifdef DEBUG - demux_ts_printf("NO VIDEO! "); -#endif - } - - if (param->atype == AUDIO_MP2) - { -#ifdef DEBUG - demux_ts_printf("AUDIO MPA(pid=%d)", param->apid); -#endif - } - else if (param->atype == AUDIO_A52) - { -#ifdef DEBUG - demux_ts_printf("AUDIO A52(pid=%d)", param->apid); -#endif - } - else if (param->atype == AUDIO_DTS) - { -#ifdef DEBUG - demux_ts_printf("AUDIO DTS(pid=%d)", param->apid); -#endif - } - else if (param->atype == AUDIO_LPCM_BE) - { -#ifdef DEBUG - demux_ts_printf("AUDIO LPCM(pid=%d)", param->apid); -#endif - } - else if (param->atype == AUDIO_AAC) - { -#ifdef DEBUG - demux_ts_printf("AUDIO AAC(pid=%d)", param->apid); -#endif - } - else if (param->atype == AUDIO_TRUEHD) - { -#ifdef DEBUG - demux_ts_printf("AUDIO TRUEHD(pid=%d)", param->apid); -#endif - } - else - { - audio_found = 0; - param->atype = UNKNOWN; - //WE DIDN'T MATCH ANY AUDIO STREAM, SO WE FORCE THE DEMUXER TO IGNORE AUDIO -#ifdef DEBUG - demux_ts_printf("NO AUDIO! "); -#endif - } - - if (IS_SUB(param->stype)) - { -#ifdef DEBUG - demux_ts_printf(" SUB %s(pid=%d) ", (param->stype == SPU_DVD ? "DVD" : param->stype == SPU_DVB ? "DVB" : "Teletext"), param->spid); -#endif - } - else - { - param->stype = UNKNOWN; - -#ifdef DEBUG - demux_ts_printf(" NO SUBS (yet)! "); -#endif - } - - if (video_found || audio_found) - { - if (!param->prog) - { - p = progid_for_pid(priv, video_found ? param->vpid : param->apid, 0); - if (p != -1) - param->prog = p; - } - - if (demuxer->stream->eof && (ret == 0)) - ret = init_pos; - -#ifdef DEBUG - demux_ts_printf(" PROGRAM N. %d\n", param->prog); -#endif - } - else - { -#ifdef DEBUG - demux_ts_printf("\n"); -#endif - } - - - for (i = 0; i < 8192; i++) - { - if (priv->ts.pids[i] != NULL) - { - priv->ts.pids[i]->payload_size = 0; - priv->ts.pids[i]->pts = priv->ts.pids[i]->last_pts = 0; - priv->ts.pids[i]->last_cc = -1; - priv->ts.pids[i]->is_synced = 0; - } - } - - return ret; -} - -static int parse_avc_sps(uint8_t *buf, int len, int *w, int *h) -{ - int sps, sps_len; - unsigned char *ptr; - mp_mpeg_header_t picture; - if (len < 6) - return 0; - sps = buf[5] & 0x1f; - if (!sps) - return 0; - sps_len = (buf[6] << 8) | buf[7]; - if (!sps_len || (sps_len > len - 8)) - return 0; - ptr = &(buf[8]); - picture.display_picture_width = picture.display_picture_height = 0; - h264_parse_sps(&picture, ptr, len - 8); - if (!picture.display_picture_width || !picture.display_picture_height) - return 0; - *w = picture.display_picture_width; - *h = picture.display_picture_height; - return 1; -} - -static demuxer_t *demux_open_ts(demuxer_t *demuxer) -{ - int i; - uint8_t packet_size; - sh_video_t *sh_video; - sh_audio_t *sh_audio; - off_t start_pos; - tsdemux_init_t params; - ts_priv_t *priv = demuxer->priv; - -#ifdef DEBUG - demux_ts_printf("DEMUX OPEN, AUDIO_ID: %d, VIDEO_ID: %d, SUBTITLE_ID: %d,\n", - demuxer->audio->id, demuxer->video->id, demuxer->sub->id); -#endif - - - demuxer->type = DEMUXER_TYPE_MPEG_TS; - - - stream_reset(demuxer->stream); - - packet_size = ts_check_file(demuxer); - if (!packet_size) - return NULL; - - priv = calloc(1, sizeof(ts_priv_t)); - if (priv == NULL) - { -#ifdef DEBUG - demux_ts_printf("DEMUX_OPEN_TS, couldn't allocate enough memory for ts->priv, exit\n"); -#endif - - return NULL; - } - - for (i = 0; i < 8192; i++) - { - priv->ts.pids[i] = NULL; - priv->ts.streams[i].id = -3; - } - priv->pat.progs = NULL; - priv->pat.progs_cnt = 0; - priv->pat.section.buffer = NULL; - priv->pat.section.buffer_len = 0; - - priv->pmt = NULL; - priv->pmt_cnt = 0; - - priv->keep_broken = ts_keep_broken; - priv->ts.packet_size = packet_size; - - - demuxer->priv = priv; - if (demuxer->stream->type != STREAMTYPE_FILE) - demuxer->seekable = 1; - else - demuxer->seekable = 1; - - - params.atype = params.vtype = params.stype = UNKNOWN; - params.apid = demuxer->audio->id; - params.vpid = demuxer->video->id; - params.spid = demuxer->sub->id; - params.prog = ts_prog; - params.probe = ts_probe; - - if (dvdsub_lang != NULL) - { - strncpy(params.slang, dvdsub_lang, 3); - params.slang[3] = 0; - } - else - memset(params.slang, 0, 4); - - if (audio_lang != NULL) - { - strncpy(params.alang, audio_lang, 3); - params.alang[3] = 0; - } - else - memset(params.alang, 0, 4); - - start_pos = ts_detect_streams(demuxer, ¶ms); - - demuxer->sub->id = params.spid; - priv->prog = params.prog; - - if (params.vtype != UNKNOWN) - { - ts_add_stream(demuxer, priv->ts.pids[params.vpid]); - sh_video = priv->ts.streams[params.vpid].sh; - demuxer->video->id = priv->ts.streams[params.vpid].id; - sh_video->ds = demuxer->video; - sh_video->format = params.vtype; - demuxer->video->sh = sh_video; - } - - if (params.atype != UNKNOWN) - { - ES_stream_t *es = priv->ts.pids[params.apid]; - - if (!IS_AUDIO(es->type) && !IS_AUDIO(es->subtype) && IS_AUDIO(params.atype)) es->subtype = params.atype; - ts_add_stream(demuxer, priv->ts.pids[params.apid]); - sh_audio = priv->ts.streams[params.apid].sh; - demuxer->audio->id = priv->ts.streams[params.apid].id; - sh_audio->ds = demuxer->audio; - sh_audio->format = params.atype; - demuxer->audio->sh = sh_audio; - } - - -#ifdef DEBUG - demux_ts_printf("Opened TS demuxer, audio: %x(pid %d), video: %x(pid %d)...POS=%"PRIu64", PROBE=%"PRIu64"\n", params.atype, demuxer->audio->id, params.vtype, demuxer->video->id, (uint64_t) start_pos, ts_probe); -#endif - - start_pos = (start_pos <= priv->ts.packet_size ? 0 : start_pos - priv->ts.packet_size); - demuxer->movi_start = start_pos; - //demuxer->reference_clock = MP_NOPTS_VALUE; - stream_reset(demuxer->stream); - stream_seek(demuxer->stream, start_pos); //IF IT'S FROM A PIPE IT WILL FAIL, BUT WHO CARES? - - priv->last_pid = 8192; //invalid pid - - for (i = 0; i < 3; i++) - { - priv->fifo[i].pack = NULL; - priv->fifo[i].offset = 0; - } - priv->fifo[0].ds = demuxer->audio; - priv->fifo[1].ds = demuxer->video; - priv->fifo[2].ds = demuxer->sub; - - priv->fifo[0].buffer_size = 1536; - priv->fifo[1].buffer_size = 32767; - priv->fifo[2].buffer_size = 32767; - - priv->pat.section.buffer_len = 0; - for (i = 0; i < priv->pmt_cnt; i++) - priv->pmt[i].section.buffer_len = 0; - - demuxer->filepos = stream_tell(demuxer->stream); - return demuxer; -} - -static void demux_close_ts(demuxer_t *demuxer) -{ - uint16_t i; - ts_priv_t *priv = (ts_priv_t *) demuxer->priv; - - if (priv) - { - free(priv->pat.section.buffer); - priv->pat.section.buffer = NULL; - - free(priv->pat.progs); - priv->pat.progs = NULL; - - if (priv->pmt != NULL) - { - for (i = 0; i < priv->pmt_cnt; i++) - { - free(priv->pmt[i].section.buffer); - priv->pmt[i].section.buffer = NULL; - - free(priv->pmt[i].es); - priv->pmt[i].es = NULL; - } - free(priv->pmt); - priv->pmt = NULL; - } - - for (i = 0; i < NB_PID_MAX; i++) - { - free(priv->ts.pids[i]); - priv->ts.pids[i] = NULL; - } - - free(priv); - demuxer->priv = NULL; - } -} - - -unsigned char mp_getbits(unsigned char *, unsigned int, unsigned char); -#define getbits mp_getbits - -static int mp4_parse_sl_packet(pmt_t *pmt, uint8_t *buf, uint16_t packet_len, int pid, ES_stream_t *pes_es) -{ - int i, n, m, mp4_es_id = -1; - uint64_t v = 0; - uint32_t pl_size = 0; - int deg_flag = 0; - mp4_es_descr_t *es = NULL; - mp4_sl_config_t *sl = NULL; - uint8_t au_start = 0, au_end = 0, rap_flag = 0, ocr_flag = 0, padding = 0, padding_bits = 0, idle = 0; - - pes_es->is_synced = 0; - -#ifdef DEBUG - demux_ts_printf("mp4_parse_sl_packet, pid: %d, pmt: %pm, packet_len: %d\n", pid, pmt, packet_len); -#endif - - if (! pmt || !packet_len) - return 0; - - for (i = 0; i < pmt->es_cnt; i++) - { - if (pmt->es[i].pid == pid) - mp4_es_id = pmt->es[i].mp4_es_id; - } - if (mp4_es_id < 0) - return -1; - - for (i = 0; i < pmt->mp4es_cnt; i++) - { - if (pmt->mp4es[i].id == mp4_es_id) - es = &(pmt->mp4es[i]); - } - if (! es) - return -1; - - pes_es->subtype = es->decoder.object_type; - - sl = &(es->sl); - if (!sl) - return -1; - - //now es is the complete es_descriptor of out mp4 ES stream -#ifdef DEBUG - demux_ts_printf("ID: %d, FLAGS: 0x%x, subtype: %x\n", es->id, sl->flags, pes_es->subtype); -#endif - - n = 0; - if (sl->au_start) - pes_es->sl.au_start = au_start = getbits(buf, n++, 1); - else - pes_es->sl.au_start = (pes_es->sl.last_au_end ? 1 : 0); - if (sl->au_end) - pes_es->sl.au_end = au_end = getbits(buf, n++, 1); - - if (!sl->au_start && !sl->au_end) - { - pes_es->sl.au_start = pes_es->sl.au_end = au_start = au_end = 1; - } - pes_es->sl.last_au_end = pes_es->sl.au_end; - - - if (sl->ocr_len > 0) - ocr_flag = getbits(buf, n++, 1); - if (sl->idle) - idle = getbits(buf, n++, 1); - if (sl->padding) - padding = getbits(buf, n++, 1); - if (padding) - { - padding_bits = getbits(buf, n, 3); - n += 3; - } - - if (idle || (padding && !padding_bits)) - { - pes_es->payload_size = 0; - return -1; - } - - //(! idle && (!padding || padding_bits != 0)) is true - n += sl->packet_seqnum_len; - if (sl->degr_len) - deg_flag = getbits(buf, n++, 1); - if (deg_flag) - n += sl->degr_len; - - if (ocr_flag) - { - n += sl->ocr_len; - -#ifdef DEBUG - demux_ts_printf("OCR: %d bits\n", sl->ocr_len); -#endif - } - - if (packet_len * 8 <= n) - return -1; - -#ifdef DEBUG - demux_ts_printf("\nAU_START: %d, AU_END: %d\n", au_start, au_end); -#endif - - if (au_start) - { - int dts_flag = 0, cts_flag = 0, ib_flag = 0; - - if (sl->random_accesspoint) - rap_flag = getbits(buf, n++, 1); - - //check commented because it seems it's rarely used, and we need this flag set in case of au_start - //the decoder will eventually discard the payload if it can't decode it - //if(rap_flag || sl->random_accesspoint_only) - pes_es->is_synced = 1; - - n += sl->au_seqnum_len; - if (packet_len * 8 <= n + 8) - return -1; - if (sl->use_ts) - { - dts_flag = getbits(buf, n++, 1); - cts_flag = getbits(buf, n++, 1); - } - if (sl->instant_bitrate_len) - ib_flag = getbits(buf, n++, 1); - if (packet_len * 8 <= n + 8) - return -1; - if (dts_flag && (sl->ts_len > 0)) - { - n += sl->ts_len; - -#ifdef DEBUG - demux_ts_printf("DTS: %d bits\n", sl->ts_len); -#endif - } - if (packet_len * 8 <= n + 8) - return -1; - if (cts_flag && (sl->ts_len > 0)) - { - int i = 0, m; - - while (i < sl->ts_len) - { - m = FFMIN(8, sl->ts_len - i); - v |= getbits(buf, n, m); - if (sl->ts_len - i > 8) - v <<= 8; - i += m; - n += m; - if (packet_len * 8 <= n + 8) - return -1; - } - - pes_es->pts = (float) v / (float) sl->ts_resolution; - -#ifdef DEBUG - demux_ts_printf("CTS: %d bits, value: %"PRIu64"/%d = %.3f\n", sl->ts_len, v, sl->ts_resolution, pes_es->pts); -#endif - } - - - i = 0; - pl_size = 0; - while (i < sl->au_len) - { - m = FFMIN(8, sl->au_len - i); - pl_size |= getbits(buf, n, m); - if (sl->au_len - i > 8) - pl_size <<= 8; - i += m; - n += m; - if (packet_len * 8 <= n + 8) - return -1; - } -#ifdef DEBUG - demux_ts_printf("AU_LEN: %u (%d bits)\n", pl_size, sl->au_len); -#endif - - if (ib_flag) - n += sl->instant_bitrate_len; - } - - m = (n + 7) / 8; - if (0 < pl_size && pl_size < pes_es->payload_size) - pes_es->payload_size = pl_size; - -#ifdef DEBUG - demux_ts_printf("mp4_parse_sl_packet, n=%d, m=%d, size from pes hdr: %u, sl hdr size: %u, RAP FLAGS: %d/%d\n", - n, m, pes_es->payload_size, pl_size, (int) rap_flag, (int) sl->random_accesspoint_only); -#endif - - return m; -} - -//this function parses the extension fields in the PES header and returns the substream_id, or -1 in case of errors -static int parse_pes_extension_fields(unsigned char *p, int pkt_len) -{ - int skip; - unsigned char flags; - - if (!(p[7] & 0x1)) //no extension_field - return -1; - skip = 9; - if (p[7] & 0x80) - { - skip += 5; - if (p[7] & 0x40) - skip += 5; - } - if (p[7] & 0x20) //escr_flag - skip += 6; - if (p[7] & 0x10) //es_rate_flag - skip += 3; - if (p[7] & 0x08) //dsm_trick_mode is unsupported, skip - { - skip = 0;//don't let's parse the extension fields - } - if (p[7] & 0x04) //additional_copy_info - skip += 1; - if (p[7] & 0x02) //pes_crc_flag - skip += 2; - if (skip >= pkt_len) //too few bytes - return -1; - flags = p[skip]; - skip++; - if (flags & 0x80) //pes_private_data_flag - skip += 16; - if (skip >= pkt_len) - return -1; - if (flags & 0x40) //pack_header_field_flag - { - unsigned char l = p[skip]; - skip += l; - } - if (flags & 0x20) //program_packet_sequence_counter - skip += 2; - if (flags & 0x10) //p_std - skip += 2; - if (skip >= pkt_len) - return -1; - if (flags & 0x01) //finally the long desired pes_extension2 - { - unsigned char l = p[skip]; //ext2 flag+len - skip++; - if ((l == 0x81) && (skip < pkt_len)) - { - int ssid = p[skip]; - -#ifdef DEBUG - demux_ts_printf("SUBSTREAM_ID=%d (0x%02X)\n", ssid, ssid); -#endif - - return ssid; - } - } - - return -1; -} - -static int pes_parse2(unsigned char *buf, uint16_t packet_len, ES_stream_t *es, int32_t type_from_pmt, pmt_t *pmt, int pid) -{ - unsigned char *p; - uint32_t header_len; - int64_t pts; - uint32_t stream_id; - uint32_t pkt_len, pes_is_aligned; - - //Here we are always at the start of a PES packet -#ifdef DEBUG - demux_ts_printf("pes_parse2(%p, %d): \n", buf, (uint32_t) packet_len); -#endif - - if (packet_len == 0 || packet_len > 184) - { -#ifdef DEBUG - demux_ts_printf("pes_parse2, BUFFER LEN IS TOO SMALL OR TOO BIG: %d EXIT\n", packet_len); -#endif - - return 0; - } - - p = buf; - pkt_len = packet_len; - - -#ifdef DEBUG - demux_ts_printf("pes_parse2: HEADER %02x %02x %02x %02x\n", p[0], p[1], p[2], p[3]); -#endif - - if (p[0] || p[1] || (p[2] != 1)) - { -#ifdef DEBUG - demux_ts_printf("pes_parse2: error HEADER %02x %02x %02x (should be 0x000001) \n", p[0], p[1], p[2]); -#endif - - return 0 ; - } - - packet_len -= 6; - if (packet_len == 0) - { -#ifdef DEBUG - demux_ts_printf("pes_parse2: packet too short: %d, exit\n", packet_len); -#endif - - return 0; - } - - es->payload_size = (p[4] << 8 | p[5]); - pes_is_aligned = (p[6] & 4); - - stream_id = p[3]; - - if (p[7] & 0x80) - { - /* pts available */ - pts = (int64_t)(p[9] & 0x0E) << 29 ; - pts |= p[10] << 22 ; - pts |= (p[11] & 0xFE) << 14 ; - pts |= p[12] << 7 ; - pts |= (p[13] & 0xFE) >> 1 ; - - es->pts = pts / 90000.0f; - } - else - es->pts = 0.0f; - - - header_len = p[8]; - - - if (header_len + 9 > pkt_len) //9 are the bytes read up to the header_length field - { -#ifdef DEBUG - demux_ts_printf("demux_ts: illegal value for PES_header_data_length (0x%02x)\n", header_len); -#endif - - return 0; - } - - if (stream_id == 0xfd) - { - int ssid = parse_pes_extension_fields(p, pkt_len); - - if ((audio_substream_id != -1) && (ssid != audio_substream_id)) - return 0; - - if (ssid == 0x72) - es->type = type_from_pmt = AUDIO_TRUEHD; - } - - p += header_len + 9; - packet_len -= header_len + 3; - - if (es->payload_size) - es->payload_size -= header_len + 3; - - - es->is_synced = 1; //only for SL streams we have to make sure it's really true, see below - if (stream_id == 0xbd) - { -#ifdef DEBUG - demux_ts_printf("pes_parse2: audio buf = %02X %02X %02X %02X %02X %02X %02X %02X, 80: %d\n", - p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[0] & 0x80); -#endif - - /* - * we check the descriptor tag first because some stations - * do not include any of the A52 header info in their audio tracks - * these "raw" streams may begin with a byte that looks like a stream type. - */ - - - if ( - (type_from_pmt == AUDIO_A52) || /* A52 - raw */ - (p[0] == 0x0B && p[1] == 0x77) /* A52 - syncword */ - ) - { -#ifdef DEBUG - demux_ts_printf("A52 RAW OR SYNCWORD\n"); -#endif - - es->start = p; - es->size = packet_len; - es->type = AUDIO_A52; - es->payload_size -= packet_len; - - return 1; - } - /* SPU SUBS */ - else if (type_from_pmt == SPU_DVB || - ((p[0] == 0x20) && pes_is_aligned)) // && p[1] == 0x00)) - { - es->start = p; - es->size = packet_len; - es->type = SPU_DVB; - es->payload_size -= packet_len; - - return 1; - } - else if (pes_is_aligned && ((p[0] & 0xE0) == 0x20)) //SPU_DVD - { - //DVD SUBS - es->start = p + 1; - es->size = packet_len - 1; - es->type = SPU_DVD; - es->payload_size -= packet_len; - - return 1; - } - else if (pes_is_aligned && (p[0] & 0xF8) == 0x80) - { -#ifdef DEBUG - demux_ts_printf("A52 WITH HEADER\n"); -#endif - - es->start = p + 4; - es->size = packet_len - 4; - es->type = AUDIO_A52; - es->payload_size -= packet_len; - - return 1; - } - else if (pes_is_aligned && ((p[0] & 0xf0) == 0xa0)) - { - int pcm_offset; - - for (pcm_offset = 0; ++pcm_offset < packet_len - 1 ;) - { - if (p[pcm_offset] == 0x01 && p[pcm_offset + 1] == 0x80) - { - /* START */ - pcm_offset += 2; - break; - } - } - - es->start = p + pcm_offset; - es->size = packet_len - pcm_offset; - es->type = AUDIO_LPCM_BE; - es->payload_size -= packet_len; - - return 1; - } - else - { -#ifdef DEBUG - demux_ts_printf("PES_PRIVATE1\n"); -#endif - - es->start = p; - es->size = packet_len; - es->type = (type_from_pmt == UNKNOWN ? PES_PRIVATE1 : type_from_pmt); - es->payload_size -= packet_len; - - return 1; - } - } - else if (((stream_id >= 0xe0) && (stream_id <= 0xef)) || (stream_id == 0xfd && type_from_pmt != UNKNOWN)) - { - es->start = p; - es->size = packet_len; - if (type_from_pmt != UNKNOWN) - es->type = type_from_pmt; - else - es->type = VIDEO_MPEG2; - if (es->payload_size) - es->payload_size -= packet_len; - -#ifdef DEBUG - demux_ts_printf("pes_parse2: M2V size %d\n", es->size); -#endif - - return 1; - } - else if ((stream_id == 0xfa)) - { - int l; - - es->is_synced = 0; - if (type_from_pmt != UNKNOWN) //MP4 A/V or SL - { - es->start = p; - es->size = packet_len; - es->type = type_from_pmt; - - if (type_from_pmt == SL_PES_STREAM) - { - //if(pes_is_aligned) - //{ - l = mp4_parse_sl_packet(pmt, p, packet_len, pid, es); - -#ifdef DEBUG - demux_ts_printf("L=%d, TYPE=%x\n", l, type_from_pmt); -#endif - - if (l < 0) - { -#ifdef DEBUG - demux_ts_printf("pes_parse2: couldn't parse SL header, passing along full PES payload\n"); -#endif - - l = 0; - } - //} - - es->start += l; - es->size -= l; - } - - if (es->payload_size) - es->payload_size -= packet_len; - - return 1; - } - } - else if ((stream_id & 0xe0) == 0xc0) - { - es->start = p; - es->size = packet_len; - - if (type_from_pmt != UNKNOWN) - es->type = type_from_pmt; - else - es->type = AUDIO_MP2; - - es->payload_size -= packet_len; - - return 1; - } - else if (type_from_pmt != -1) //as a last resort here we trust the PMT, if present - { - es->start = p; - es->size = packet_len; - es->type = type_from_pmt; - es->payload_size -= packet_len; - - return 1; - } - else - { -#ifdef DEBUG - demux_ts_printf("pes_parse2: unknown packet, id: %x\n", stream_id); -#endif - } - - es->is_synced = 0; - return 0; -} - - - - -static int ts_sync(stream_t *stream) -{ - int c = 0; - -#ifdef DEBUG - //demux_ts_printf("TS_SYNC \n"); -#endif - - while (((c = stream_read_char(stream)) != 0x47) && ! stream->eof); - - if (c == 0x47) - return c; - else - return 0; -} - - -static void ts_dump_streams(ts_priv_t *priv) -{ - int i; - - for (i = 0; i < 3; i++) - { - if ((priv->fifo[i].pack != NULL) && (priv->fifo[i].offset != 0)) - { - resize_demux_packet(priv->fifo[i].pack, priv->fifo[i].offset); - ds_add_packet(priv->fifo[i].ds, priv->fifo[i].pack); - priv->fifo[i].offset = 0; - priv->fifo[i].pack = NULL; - } - } -} - - -static inline int32_t prog_idx_in_pat(ts_priv_t *priv, uint16_t progid) -{ - int x; - - if (priv->pat.progs == NULL) - return -1; - - for (x = 0; x < priv->pat.progs_cnt; x++) - { - if (priv->pat.progs[x].id == progid) - return x; - } - - return -1; -} - - -static inline int32_t prog_id_in_pat(ts_priv_t *priv, uint16_t pid) -{ - int x; - - if (priv->pat.progs == NULL) - return -1; - - for (x = 0; x < priv->pat.progs_cnt; x++) - { - if (priv->pat.progs[x].pmt_pid == pid) - return priv->pat.progs[x].id; - } - - return -1; -} - -static int collect_section(ts_section_t *section, int is_start, unsigned char *buff, int size) -{ - uint8_t *ptr; - uint16_t tlen; - int skip, tid; - -#ifdef DEBUG - demux_ts_printf("COLLECT_SECTION, start: %d, size: %d, collected: %d\n", is_start, size, section->buffer_len); -#endif - - if (! is_start && !section->buffer_len) - return 0; - - if (is_start) - { - if (! section->buffer) - { - section->buffer = (uint8_t *) malloc(4096 + 256); - if (section->buffer == NULL) - return 0; - } - section->buffer_len = 0; - } - - if (size + section->buffer_len > 4096 + 256) - { -#ifdef DEBUG - demux_ts_printf("COLLECT_SECTION, excessive len: %d + %d\n", section->buffer_len, size); -#endif - - return 0; - } - - memcpy(&(section->buffer[section->buffer_len]), buff, size); - section->buffer_len += size; - - if (section->buffer_len < 3) - return 0; - - skip = section->buffer[0]; - if (skip + 4 > section->buffer_len) - return 0; - - ptr = &(section->buffer[skip + 1]); - tid = ptr[0]; - tlen = ((ptr[1] & 0x0f) << 8) | ptr[2]; - -#ifdef DEBUG - demux_ts_printf("SKIP: %d+1, TID: %d, TLEN: %d, COLLECTED: %d\n", skip, tid, tlen, section->buffer_len); -#endif - - if (section->buffer_len < (skip + 1 + 3 + tlen)) - { -#ifdef DEBUG - demux_ts_printf("DATA IS NOT ENOUGH, NEXT TIME\n"); -#endif - - return 0; - } - - return skip + 1; -} - -static int parse_pat(ts_priv_t *priv, int is_start, unsigned char *buff, int size) -{ - int skip; - unsigned char *ptr; - unsigned char *base; - int entries, i; - uint16_t progid; - struct pat_progs_t *tmp; - ts_section_t *section; - - section = &(priv->pat.section); - skip = collect_section(section, is_start, buff, size); - if (! skip) - return 0; - - ptr = &(section->buffer[skip]); - //PARSING - priv->pat.table_id = ptr[0]; - if (priv->pat.table_id != 0) - return 0; - priv->pat.ssi = (ptr[1] >> 7) & 0x1; - priv->pat.curr_next = ptr[5] & 0x01; - priv->pat.ts_id = (ptr[3] << 8) | ptr[4]; - priv->pat.version_number = (ptr[5] >> 1) & 0x1F; - priv->pat.section_length = ((ptr[1] & 0x03) << 8) | ptr[2]; - priv->pat.section_number = ptr[6]; - priv->pat.last_section_number = ptr[7]; - - //check_crc32(0xFFFFFFFFL, ptr, priv->pat.buffer_len - 4, &ptr[priv->pat.buffer_len - 4]); -#ifdef DEBUG - demux_ts_printf("PARSE_PAT: section_len: %d, section %d/%d\n", priv->pat.section_length, priv->pat.section_number, priv->pat.last_section_number); -#endif - - entries = (int)(priv->pat.section_length - 9) / 4; //entries per section - - for (i = 0; i < entries; i++) - { - int32_t idx; - base = &ptr[8 + i * 4]; - progid = (base[0] << 8) | base[1]; - - if ((idx = prog_idx_in_pat(priv, progid)) == -1) - { -#ifdef DEBUG - int sz = sizeof(struct pat_progs_t) * (priv->pat.progs_cnt + 1); -#endif - tmp = realloc_struct(priv->pat.progs, priv->pat.progs_cnt + 1, sizeof(struct pat_progs_t)); - if (tmp == NULL) - { -#ifdef DEBUG - demux_ts_printf("PARSE_PAT: COULDN'T REALLOC %d bytes, NEXT\n", sz); -#endif - - break; - } - priv->pat.progs = tmp; - idx = priv->pat.progs_cnt; - priv->pat.progs_cnt++; - } - - priv->pat.progs[idx].id = progid; - priv->pat.progs[idx].pmt_pid = ((base[2] & 0x1F) << 8) | base[3]; - -#ifdef DEBUG - demux_ts_printf("PROG: %d (%d-th of %d), PMT: %d\n", priv->pat.progs[idx].id, i + 1, entries, priv->pat.progs[idx].pmt_pid); - demux_ts_printf("PROGRAM_ID=%d (0x%02X), PMT_PID: %d(0x%02X)\n", - progid, progid, priv->pat.progs[idx].pmt_pid, priv->pat.progs[idx].pmt_pid); -#endif - } - - return 1; -} - - -static inline int32_t es_pid_in_pmt(pmt_t *pmt, uint16_t pid) -{ - uint16_t i; - - if (pmt == NULL) - return -1; - - if (pmt->es == NULL) - return -1; - - for (i = 0; i < pmt->es_cnt; i++) - { - if (pmt->es[i].pid == pid) - return (int32_t) i; - } - - return -1; -} - - -static uint16_t get_mp4_desc_len(uint8_t *buf, int *len) -{ - //uint16_t i = 0, size = 0; - int i = 0, j, size = 0; - -#ifdef DEBUG - demux_ts_printf("PARSE_MP4_DESC_LEN(%d), bytes: ", *len); -#endif - - j = FFMIN(*len, 4); - while (i < j) - { -#ifdef DEBUG - demux_ts_printf(" %x ", buf[i]); -#endif - - size |= (buf[i] & 0x7f); - if (!(buf[i] & 0x80)) - break; - size <<= 7; - i++; - } - -#ifdef DEBUG - demux_ts_printf(", SIZE=%d\n", size); -#endif - - *len = i + 1; - return size; -} - - -static uint16_t parse_mp4_slconfig_descriptor(uint8_t *buf, int len, void *elem) -{ - int i = 0; - mp4_es_descr_t *es; - mp4_sl_config_t *sl; - -#ifdef DEBUG - demux_ts_printf("PARSE_MP4_SLCONFIG_DESCRIPTOR(%d)\n", len); -#endif - - es = (mp4_es_descr_t *) elem; - if (!es) - { -#ifdef DEBUG - demux_ts_printf("argh! NULL elem passed, skip\n"); -#endif - - return len; - } - sl = &(es->sl); - - sl->ts_len = sl->ocr_len = sl->au_len = sl->instant_bitrate_len = sl->degr_len = sl->au_seqnum_len = sl->packet_seqnum_len = 0; - sl->ocr = sl->dts = sl->cts = 0; - - if (buf[0] == 0) - { - i++; - sl->flags = buf[i]; - i++; - sl->ts_resolution = (buf[i] << 24) | (buf[i + 1] << 16) | (buf[i + 2] << 8) | buf[i + 3]; - i += 4; - sl->ocr_resolution = (buf[i] << 24) | (buf[i + 1] << 16) | (buf[i + 2] << 8) | buf[i + 3]; - i += 4; - sl->ts_len = buf[i]; - i++; - sl->ocr_len = buf[i]; - i++; - sl->au_len = buf[i]; - i++; - sl->instant_bitrate_len = buf[i]; - i++; - sl->degr_len = (buf[i] >> 4) & 0x0f; - sl->au_seqnum_len = ((buf[i] & 0x0f) << 1) | ((buf[i + 1] >> 7) & 0x01); - i++; - sl->packet_seqnum_len = ((buf[i] >> 2) & 0x1f); - i++; - - } - else if (buf[0] == 1) - { - sl->flags = 0; - sl->ts_resolution = 1000; - sl->ts_len = 32; - i++; - } - else if (buf[0] == 2) - { - sl->flags = 4; - i++; - } - else - { - sl->flags = 0; - i++; - } - - sl->au_start = (sl->flags >> 7) & 0x1; - sl->au_end = (sl->flags >> 6) & 0x1; - sl->random_accesspoint = (sl->flags >> 5) & 0x1; - sl->random_accesspoint_only = (sl->flags >> 4) & 0x1; - sl->padding = (sl->flags >> 3) & 0x1; - sl->use_ts = (sl->flags >> 2) & 0x1; - sl->idle = (sl->flags >> 1) & 0x1; - sl->duration = sl->flags & 0x1; - - if (sl->duration) - { - sl->timescale = (buf[i] << 24) | (buf[i + 1] << 16) | (buf[i + 2] << 8) | buf[i + 3]; - i += 4; - sl->au_duration = (buf[i] << 8) | buf[i + 1]; - i += 2; - sl->cts_duration = (buf[i] << 8) | buf[i + 1]; - i += 2; - } - else //no support for fixed durations atm - sl->timescale = sl->au_duration = sl->cts_duration = 0; - -#ifdef DEBUG - demux_ts_printf("MP4SLCONFIG(len=0x%x), predef: %d, flags: %x, use_ts: %d, tslen: %d, timescale: %d, dts: %"PRIu64", cts: %"PRIu64"\n", - len, buf[0], sl->flags, sl->use_ts, sl->ts_len, sl->timescale, (uint64_t) sl->dts, (uint64_t) sl->cts); -#endif - - return len; -} - -static int parse_mp4_descriptors(pmt_t *pmt, uint8_t *buf, int len, void *elem); - -static uint16_t parse_mp4_decoder_config_descriptor(pmt_t *pmt, uint8_t *buf, int len, void *elem) -{ - int i = 0, j; - mp4_es_descr_t *es; - mp4_decoder_config_t *dec; - -#ifdef DEBUG - demux_ts_printf("PARSE_MP4_DECODER_CONFIG_DESCRIPTOR(%d)\n", len); -#endif - - es = (mp4_es_descr_t *) elem; - if (!es) - { -#ifdef DEBUG - demux_ts_printf("argh! NULL elem passed, skip\n"); -#endif - - return len; - } - dec = (mp4_decoder_config_t *) & (es->decoder); - - dec->object_type = buf[i]; - dec->stream_type = (buf[i + 1] >> 2) & 0x3f; - - if (dec->object_type == 1 && dec->stream_type == 1) - { - dec->object_type = MP4_OD; - dec->stream_type = MP4_OD; - } - else if (dec->stream_type == 4) - { - if (dec->object_type == 0x6a) - dec->object_type = VIDEO_MPEG1; - if (dec->object_type >= 0x60 && dec->object_type <= 0x65) - dec->object_type = VIDEO_MPEG2; - else if (dec->object_type == 0x20) - dec->object_type = VIDEO_MPEG4; - else if (dec->object_type == 0x21) - dec->object_type = VIDEO_AVC; - /*else if(dec->object_type == 0x22) - fprintf(stderr, "TYPE 0x22\n");*/ - else dec->object_type = UNKNOWN; - } - else if (dec->stream_type == 5) - { - if (dec->object_type == 0x40) - dec->object_type = AUDIO_AAC; - else if (dec->object_type == 0x6b) - dec->object_type = AUDIO_MP2; - else if (dec->object_type >= 0x66 && dec->object_type <= 0x69) - dec->object_type = AUDIO_MP2; - else - dec->object_type = UNKNOWN; - } - else - dec->object_type = dec->stream_type = UNKNOWN; - - if (dec->object_type != UNKNOWN) - { - //update the type of the current stream - for (j = 0; j < pmt->es_cnt; j++) - { - if (pmt->es[j].mp4_es_id == es->id) - { - pmt->es[j].type = SL_PES_STREAM; - } - } - } - - if (len > 13) - parse_mp4_descriptors(pmt, &buf[13], len - 13, dec); - -#ifdef DEBUG - demux_ts_printf("MP4DECODER(0x%x), object_type: 0x%x, stream_type: 0x%x\n", len, dec->object_type, dec->stream_type); -#endif - - return len; -} - -static uint16_t parse_mp4_decoder_specific_descriptor(uint8_t *buf, int len, void *elem) -{ -#ifdef DEBUG - int i; -#endif - - mp4_decoder_config_t *dec; - -#ifdef DEBUG - demux_ts_printf("PARSE_MP4_DECODER_SPECIFIC_DESCRIPTOR(%d)\n", len); -#endif - - dec = (mp4_decoder_config_t *) elem; - if (!dec) - { -#ifdef DEBUG - demux_ts_printf("argh! NULL elem passed, skip\n"); -#endif - - return len; - } - -#ifdef DEBUG - demux_ts_printf("MP4 SPECIFIC INFO BYTES: \n"); - for (i = 0; i < len; i++) - demux_ts_printf("%02x ", buf[i]); - demux_ts_printf("\n"); -#endif - - if (len > MAX_EXTRADATA_SIZE) - { -#ifdef DEBUG - demux_ts_printf("DEMUX_TS, EXTRADATA SUSPICIOUSLY BIG: %d, REFUSED\r\n", len); -#endif - - return len; - } - memcpy(dec->buf, buf, len); - dec->buf_size = len; - - return len; -} - -static uint16_t parse_mp4_es_descriptor(pmt_t *pmt, uint8_t *buf, int len) -{ - int i = 0, j = 0, k, found; - uint8_t flag; - mp4_es_descr_t es, *target_es = NULL, *tmp; - -#ifdef DEBUG - demux_ts_printf("PARSE_MP4ES: len=%d\n", len); -#endif - - memset(&es, 0, sizeof(mp4_es_descr_t)); - while (i < len) - { - es.id = (buf[i] << 8) | buf[i + 1]; - -#ifdef DEBUG - demux_ts_printf("MP4ES_ID: %d\n", es.id); -#endif - - i += 2; - flag = buf[i]; - i++; - if (flag & 0x80) - i += 2; - if (flag & 0x40) - i += buf[i] + 1; - if (flag & 0x20) //OCR, maybe we need it - i += 2; - - j = parse_mp4_descriptors(pmt, &buf[i], len - i, &es); - -#ifdef DEBUG - demux_ts_printf("PARSE_MP4ES, types after parse_mp4_descriptors: 0x%x, 0x%x\n", es.decoder.object_type, es.decoder.stream_type); -#endif - - if (es.decoder.object_type != UNKNOWN && es.decoder.stream_type != UNKNOWN) - { - found = 0; - //search this ES_ID if we already have it - for (k = 0; k < pmt->mp4es_cnt; k++) - { - if (pmt->mp4es[k].id == es.id) - { - target_es = &(pmt->mp4es[k]); - found = 1; - } - } - - if (! found) - { - tmp = realloc_struct(pmt->mp4es, pmt->mp4es_cnt + 1, sizeof(mp4_es_descr_t)); - if (tmp == NULL) - { - fprintf(stderr, "CAN'T REALLOC MP4_ES_DESCR\n"); - continue; - } - pmt->mp4es = tmp; - target_es = &(pmt->mp4es[pmt->mp4es_cnt]); - pmt->mp4es_cnt++; - } - memcpy(target_es, &es, sizeof(mp4_es_descr_t)); - -#ifdef DEBUG - demux_ts_printf("MP4ES_CNT: %d, ID=%d\n", pmt->mp4es_cnt, target_es->id); -#endif - } - - i += j; - } - - return len; -} - -static void parse_mp4_object_descriptor(pmt_t *pmt, uint8_t *buf, int len, void *elem) -{ - int i, j = 0, id; - - i = 0; - id = (buf[0] << 2) | ((buf[1] & 0xc0) >> 6); - -#ifdef DEBUG - demux_ts_printf("PARSE_MP4_OBJECT_DESCRIPTOR: len=%d, OD_ID=%d\n", len, id); -#endif - - if (buf[1] & 0x20) - { - i += buf[2] + 1; //url - -#ifdef DEBUG - demux_ts_printf("URL\n"); -#endif - } - else - { - i = 2; - - while (i < len) - { - j = parse_mp4_descriptors(pmt, &(buf[i]), len - i, elem); - -#ifdef DEBUG - demux_ts_printf("OBJD, NOW i = %d, j=%d, LEN=%d\n", i, j, len); -#endif - - i += j; - } - } -} - - -static void parse_mp4_iod(pmt_t *pmt, uint8_t *buf, int len, void *elem) -{ - int i, j = 0; - mp4_od_t *iod = &(pmt->iod); - - iod->id = (buf[0] << 2) | ((buf[1] & 0xc0) >> 6); - -#ifdef DEBUG - demux_ts_printf("PARSE_MP4_IOD: len=%d, IOD_ID=%d\n", len, iod->id); -#endif - - i = 2; - if (buf[1] & 0x20) - { - i += buf[2] + 1; //url - -#ifdef DEBUG - demux_ts_printf("URL\n"); -#endif - } - else - { - i = 7; - while (i < len) - { - j = parse_mp4_descriptors(pmt, &(buf[i]), len - i, elem); - -#ifdef DEBUG - demux_ts_printf("IOD, NOW i = %d, j=%d, LEN=%d\n", i, j, len); -#endif - - i += j; - } - } -} - -static int parse_mp4_descriptors(pmt_t *pmt, uint8_t *buf, int len, void *elem) -{ - int tag, descr_len, i = 0, j = 0; - -#ifdef DEBUG - demux_ts_printf("PARSE_MP4_DESCRIPTORS, len=%d\n", len); -#endif - - if (! len) - return len; - - while (i < len) - { - tag = buf[i]; - j = len - i - 1; - descr_len = get_mp4_desc_len(&(buf[i + 1]), &j); - -#ifdef DEBUG - demux_ts_printf("TAG=%d (0x%x), DESCR_len=%d, len=%d, j=%d\n", tag, tag, descr_len, len, j); -#endif - - if (descr_len > len - j + 1) - { -#ifdef DEBUG - demux_ts_printf("descriptor is too long, exit\n"); -#endif - - return len; - } - i += j + 1; - - switch (tag) - { - case 0x1: - parse_mp4_object_descriptor(pmt, &(buf[i]), descr_len, elem); - break; - case 0x2: - parse_mp4_iod(pmt, &(buf[i]), descr_len, elem); - break; - case 0x3: - parse_mp4_es_descriptor(pmt, &(buf[i]), descr_len); - break; - case 0x4: - parse_mp4_decoder_config_descriptor(pmt, &buf[i], descr_len, elem); - break; - case 0x05: - parse_mp4_decoder_specific_descriptor(&buf[i], descr_len, elem); - break; - case 0x6: - parse_mp4_slconfig_descriptor(&buf[i], descr_len, elem); - break; - default: - { -#ifdef DEBUG - demux_ts_printf("Unsupported mp4 descriptor 0x%x\n", tag); -#endif - } - } - i += descr_len; - } - - return len; -} - -static ES_stream_t *new_pid(ts_priv_t *priv, int pid) -{ - ES_stream_t *tss; - - tss = malloc(sizeof(ES_stream_t)); - if (! tss) - return NULL; - memset(tss, 0, sizeof(ES_stream_t)); - tss->pid = pid; - tss->last_cc = -1; - tss->type = UNKNOWN; - tss->subtype = UNKNOWN; - tss->is_synced = 0; - tss->extradata = NULL; - tss->extradata_alloc = tss->extradata_len = 0; - priv->ts.pids[pid] = tss; - - return tss; -} - - -static int parse_program_descriptors(pmt_t *pmt, uint8_t *buf, uint16_t len) -{ - uint16_t i = 0, k, olen = len; - - while (len > 0) - { -#ifdef DEBUG - demux_ts_printf("PROG DESCR, TAG=%x, LEN=%d(%x)\n", buf[i], buf[i + 1], buf[i + 1]); -#endif - - if (buf[i + 1] > len - 2) - { -#ifdef DEBUG - demux_ts_printf("ERROR, descriptor len is too long, skipping\n"); -#endif - - return olen; - } - - if (buf[i] == 0x1d) - { - if (buf[i + 3] == 2) //buggy versions of vlc muxer make this non-standard mess (missing iod_scope) - k = 3; - else - k = 4; //this is standard compliant - parse_mp4_descriptors(pmt, &buf[i + k], (int) buf[i + 1] - (k - 2), NULL); - } - - len -= 2 + buf[i + 1]; - } - - return olen; -} - -static int parse_descriptors(struct pmt_es_t *es, uint8_t *ptr) -{ - int j, descr_len, len; - - j = 0; - len = es->descr_length; - while (len > 2) - { - descr_len = ptr[j + 1]; - -#ifdef DEBUG - demux_ts_printf("...descr id: 0x%x, len=%d\n", ptr[j], descr_len); -#endif - - if (descr_len > len) - { -#ifdef DEBUG - demux_ts_printf("INVALID DESCR LEN for tag %02x: %d vs %d max, EXIT LOOP\n", ptr[j], descr_len, len); -#endif - - return -1; - } - - - if (ptr[j] == 0x6a || ptr[j] == 0x7a) //A52 Descriptor - { - if (es->type == 0x6) - { - es->type = AUDIO_A52; - -#ifdef DEBUG - demux_ts_printf("DVB A52 Descriptor\n"); -#endif - } - } - else if (ptr[j] == 0x7b) //DVB DTS Descriptor - { - if (es->type == 0x6) - { - es->type = AUDIO_DTS; -#ifdef DEBUG - demux_ts_printf("DVB DTS Descriptor\n"); -#endif - } - } - else if (ptr[j] == 0x56) // Teletext - { - if (descr_len >= 5) - { - memcpy(es->lang, ptr + 2, 3); - es->lang[3] = 0; - } - es->type = SPU_TELETEXT; - } - else if (ptr[j] == 0x59) //Subtitling Descriptor - { - uint8_t subtype; - -#ifdef DEBUG - demux_ts_printf("Subtitling Descriptor\n"); -#endif - - if (descr_len < 8) - { -#ifdef DEBUG - demux_ts_printf("Descriptor length too short for DVB Subtitle Descriptor: %d, SKIPPING\n", descr_len); -#endif - } - else - { - memcpy(es->lang, &ptr[j + 2], 3); - es->lang[3] = 0; - subtype = ptr[j + 5]; - if ( - (subtype >= 0x10 && subtype <= 0x13) || - (subtype >= 0x20 && subtype <= 0x23) - ) - { - es->type = SPU_DVB; - //page parameters: compo page 2 bytes, ancillary page 2 bytes - } - else - es->type = UNKNOWN; - } - } - else if (ptr[j] == 0x50) //Component Descriptor - { -#ifdef DEBUG - demux_ts_printf("Component Descriptor\n"); -#endif - - memcpy(es->lang, &ptr[j + 5], 3); - es->lang[3] = 0; - } - else if (ptr[j] == 0xa) //Language Descriptor - { - memcpy(es->lang, &ptr[j + 2], 3); - es->lang[3] = 0; - -#ifdef DEBUG - demux_ts_printf("Language Descriptor: %s\n", es->lang); -#endif - } - else if (ptr[j] == 0x5) //Registration Descriptor (looks like e fourCC :) ) - { -#ifdef DEBUG - demux_ts_printf("Registration Descriptor\n"); -#endif - - if (descr_len < 4) - { -#ifdef DEBUG - demux_ts_printf("Registration Descriptor length too short: %d, SKIPPING\n", descr_len); -#endif - } - else - { - char *d; - memcpy(es->format_descriptor, &ptr[j + 2], 4); - es->format_descriptor[4] = 0; - - d = (char *) &ptr[j + 2]; - if (d[0] == 'A' && d[1] == 'C' && d[2] == '-' && d[3] == '3') - { - es->type = AUDIO_A52; - } - else if (d[0] == 'D' && d[1] == 'T' && d[2] == 'S' && d[3] == '1') - { - es->type = AUDIO_DTS; - } - else if (d[0] == 'D' && d[1] == 'T' && d[2] == 'S' && d[3] == '2') - { - es->type = AUDIO_DTS; - } - else if (d[0] == 'V' && d[1] == 'C' && d[2] == '-' && d[3] == '1') - { - es->type = VIDEO_VC1; - } - else - es->type = UNKNOWN; - -#ifdef DEBUG - demux_ts_printf("FORMAT %s\n", es->format_descriptor); -#endif - } - } - else if (ptr[j] == 0x1e) - { - es->mp4_es_id = (ptr[j + 2] << 8) | ptr[j + 3]; - -#ifdef DEBUG - demux_ts_printf("SL Descriptor: ES_ID: %d(%x), pid: %d\n", es->mp4_es_id, es->mp4_es_id, es->pid); -#endif - } - else - { -#ifdef DEBUG - demux_ts_printf("Unknown descriptor 0x%x, SKIPPING\n", ptr[j]); -#endif - } - - len -= 2 + descr_len; - j += 2 + descr_len; - } - - return 1; -} - -static int parse_sl_section(pmt_t *pmt, ts_section_t *section, int is_start, unsigned char *buff, int size) -{ - int tid, len, skip; - uint8_t *ptr; - skip = collect_section(section, is_start, buff, size); - if (! skip) - return 0; - - ptr = &(section->buffer[skip]); - tid = ptr[0]; - len = ((ptr[1] & 0x0f) << 8) | ptr[2]; - -#ifdef DEBUG - demux_ts_printf("TABLEID: %d (av. %d), skip=%d, LEN: %d\n", tid, section->buffer_len, skip, len); -#endif - - if (len > 4093 || section->buffer_len < len || tid != 5) - { -#ifdef DEBUG - demux_ts_printf("SECTION TOO LARGE or wrong section type, EXIT\n"); -#endif - - return 0; - } - - if (!(ptr[5] & 1)) - return 0; - - //8 is the current position, len - 9 is the amount of data available - parse_mp4_descriptors(pmt, &ptr[8], len - 9, NULL); - - return 1; -} - -static int parse_pmt(ts_priv_t *priv, uint16_t progid, uint16_t pid, int is_start, unsigned char *buff, int size) -{ - unsigned char *base, *es_base; - pmt_t *pmt; - int32_t idx, es_count, section_bytes; -#ifdef DEBUG - uint8_t m = 0; -#endif - int skip; - pmt_t *tmp; - struct pmt_es_t *tmp_es; - ts_section_t *section; - ES_stream_t *tss; - - idx = progid_idx_in_pmt(priv, progid); - - if (idx == -1) - { -#ifdef DEBUG - int sz = (priv->pmt_cnt + 1) * sizeof(pmt_t); -#endif - tmp = realloc_struct(priv->pmt, priv->pmt_cnt + 1, sizeof(pmt_t)); - if (tmp == NULL) - { -#ifdef DEBUG - demux_ts_printf("PARSE_PMT: COULDN'T REALLOC %d bytes, NEXT\n", sz); -#endif - - return 0; - } - priv->pmt = tmp; - idx = priv->pmt_cnt; - memset(&(priv->pmt[idx]), 0, sizeof(pmt_t)); - priv->pmt_cnt++; - priv->pmt[idx].progid = progid; - } - - pmt = &(priv->pmt[idx]); - - section = &(pmt->section); - skip = collect_section(section, is_start, buff, size); - if (! skip) - return 0; - - base = &(section->buffer[skip]); - -#ifdef DEBUG - demux_ts_printf("FILL_PMT(prog=%d), PMT_len: %d, IS_START: %d, TS_PID: %d, SIZE=%d, M=%d, ES_CNT=%d, IDX=%d, PMT_PTR=%p\n", - progid, pmt->section.buffer_len, is_start, pid, size, m, pmt->es_cnt, idx, pmt); -#endif - - pmt->table_id = base[0]; - if (pmt->table_id != 2) - return -1; - pmt->ssi = base[1] & 0x80; - pmt->section_length = (((base[1] & 0xf) << 8) | base[2]); - pmt->version_number = (base[5] >> 1) & 0x1f; - pmt->curr_next = (base[5] & 1); - pmt->section_number = base[6]; - pmt->last_section_number = base[7]; - pmt->PCR_PID = ((base[8] & 0x1f) << 8) | base[9]; - pmt->prog_descr_length = ((base[10] & 0xf) << 8) | base[11]; - if (pmt->prog_descr_length > pmt->section_length - 9) - { -#ifdef DEBUG - demux_ts_printf("PARSE_PMT, INVALID PROG_DESCR LENGTH (%d vs %d)\n", pmt->prog_descr_length, pmt->section_length - 9); -#endif - - return -1; - } - - if (pmt->prog_descr_length) - parse_program_descriptors(pmt, &base[12], pmt->prog_descr_length); - - es_base = &base[12 + pmt->prog_descr_length]; //the beginning of th ES loop - - section_bytes = pmt->section_length - 13 - pmt->prog_descr_length; - es_count = 0; - - while (section_bytes >= 5) - { - int es_pid, es_type; - - es_type = es_base[0]; - es_pid = ((es_base[1] & 0x1f) << 8) | es_base[2]; - - idx = es_pid_in_pmt(pmt, es_pid); - if (idx == -1) - { -#ifdef DEBUG - int sz = sizeof(struct pmt_es_t) * (pmt->es_cnt + 1); -#endif - tmp_es = realloc_struct(pmt->es, pmt->es_cnt + 1, sizeof(struct pmt_es_t)); - if (tmp_es == NULL) - { -#ifdef DEBUG - demux_ts_printf("PARSE_PMT, COULDN'T ALLOCATE %d bytes for PMT_ES\n", sz); -#endif - - continue; - } - pmt->es = tmp_es; - idx = pmt->es_cnt; - memset(&(pmt->es[idx]), 0, sizeof(struct pmt_es_t)); - pmt->es_cnt++; - } - - pmt->es[idx].descr_length = ((es_base[3] & 0xf) << 8) | es_base[4]; - - - if (pmt->es[idx].descr_length > section_bytes - 5) - { -#ifdef DEBUG - demux_ts_printf("PARSE_PMT, ES_DESCR_LENGTH TOO LARGE %d > %d, EXIT\n", - pmt->es[idx].descr_length, section_bytes - 5); -#endif - - return -1; - } - - - pmt->es[idx].pid = es_pid; - - if (es_type != 0x6) - pmt->es[idx].type = UNKNOWN; - else - pmt->es[idx].type = es_type; - - parse_descriptors(&pmt->es[idx], &es_base[5]); - - switch (es_type) - { - case 1: - pmt->es[idx].type = VIDEO_MPEG1; - video_format = VIDEO_MPEG1; - break; - case 2: - pmt->es[idx].type = VIDEO_MPEG2; - video_format = VIDEO_MPEG2; - break; - case 3: - case 4: - pmt->es[idx].type = AUDIO_MP2; - break; - case 6: - if (pmt->es[idx].type == 0x6) //this could have been ovrwritten by parse_descriptors - pmt->es[idx].type = UNKNOWN; - break; - case 0x10: - pmt->es[idx].type = VIDEO_MPEG4; - video_format = VIDEO_MPEG4; - break; - case 0x0f: - case 0x11: - pmt->es[idx].type = AUDIO_AAC; - break; - case 0x1b: - pmt->es[idx].type = VIDEO_H264; - video_format = VIDEO_H264; - break; - case 0x12: - pmt->es[idx].type = SL_PES_STREAM; - break; - case 0x13: - pmt->es[idx].type = SL_SECTION; - break; - case 0x81: - pmt->es[idx].type = AUDIO_A52; - break; - case 0x8A: - case 0x82: - case 0x85: - case 0x86: - pmt->es[idx].type = AUDIO_DTS; - break; - case 0xEA: - pmt->es[idx].type = VIDEO_VC1; - video_format = VIDEO_VC1; - break; - default: -#ifdef DEBUG - demux_ts_printf("UNKNOWN ES TYPE=0x%x\n", es_type); -#endif - - pmt->es[idx].type = UNKNOWN; - } - - tss = priv->ts.pids[es_pid]; //an ES stream - if (tss == NULL) - { - tss = new_pid(priv, es_pid); - if (tss) - tss->type = pmt->es[idx].type; - } - - section_bytes -= 5 + pmt->es[idx].descr_length; - -#ifdef DEBUG - demux_ts_printf("PARSE_PMT(%d INDEX %d), STREAM: %d, FOUND pid=0x%x (%d), type=0x%x, ES_DESCR_LENGTH: %d, bytes left: %d\n", - progid, idx, es_count, pmt->es[idx].pid, pmt->es[idx].pid, pmt->es[idx].type, pmt->es[idx].descr_length, section_bytes); -#endif - - es_base += 5 + pmt->es[idx].descr_length; - - es_count++; - } - -#ifdef DEBUG - demux_ts_printf("----------------------------\n"); -#endif - - return 1; -} - -static pmt_t *pmt_of_pid(ts_priv_t *priv, int pid, mp4_decoder_config_t **mp4_dec) -{ - int32_t i, j, k; - - if (priv->pmt) - { - for (i = 0; i < priv->pmt_cnt; i++) - { - if (priv->pmt[i].es && priv->pmt[i].es_cnt) - { - for (j = 0; j < priv->pmt[i].es_cnt; j++) - { - if (priv->pmt[i].es[j].pid == pid) - { - //search mp4_es_id - if (priv->pmt[i].es[j].mp4_es_id) - { - for (k = 0; k < priv->pmt[i].mp4es_cnt; k++) - { - if (priv->pmt[i].mp4es[k].id == priv->pmt[i].es[j].mp4_es_id) - { - *mp4_dec = &(priv->pmt[i].mp4es[k].decoder); - break; - } - } - } - - return &(priv->pmt[i]); - } - } - } - } - } - - return NULL; -} - - -static inline int32_t pid_type_from_pmt(ts_priv_t *priv, int pid) -{ - int32_t pmt_idx, pid_idx, i, j; - - pmt_idx = progid_idx_in_pmt(priv, priv->prog); - - if (pmt_idx != -1) - { - pid_idx = es_pid_in_pmt(&(priv->pmt[pmt_idx]), pid); - if (pid_idx != -1) - return priv->pmt[pmt_idx].es[pid_idx].type; - } - //else - //{ - for (i = 0; i < priv->pmt_cnt; i++) - { - pmt_t *pmt = &(priv->pmt[i]); - for (j = 0; j < pmt->es_cnt; j++) - if (pmt->es[j].pid == pid) - return pmt->es[j].type; - } - //} - - return UNKNOWN; -} - - -static inline uint8_t *pid_lang_from_pmt(ts_priv_t *priv, int pid) -{ - int32_t pmt_idx, pid_idx, i, j; - - pmt_idx = progid_idx_in_pmt(priv, priv->prog); - - if (pmt_idx != -1) - { - pid_idx = es_pid_in_pmt(&(priv->pmt[pmt_idx]), pid); - if (pid_idx != -1) - return priv->pmt[pmt_idx].es[pid_idx].lang; - } - else - { - for (i = 0; i < priv->pmt_cnt; i++) - { - pmt_t *pmt = &(priv->pmt[i]); - for (j = 0; j < pmt->es_cnt; j++) - if (pmt->es[j].pid == pid) - return pmt->es[j].lang; - } - } - - return NULL; -} - - -static int fill_packet(demuxer_t *demuxer, demux_stream_t *ds, demux_packet_t **dp, int *dp_offset, TS_stream_info *si) -{ - int ret = 0; - - if ((*dp != NULL) && (*dp_offset > 0)) - { - ret = *dp_offset; - resize_demux_packet(*dp, ret); //shrinked to the right size - ds_add_packet(ds, *dp); - -#ifdef DEBUG - demux_ts_printf("ADDED %d bytes to %s fifo, PTS=%.3f\n", ret, (ds == demuxer->audio ? "audio" : (ds == demuxer->video ? "video" : "sub")), (*dp)->pts); -#endif - - if (si) - { - float diff = (*dp)->pts - si->last_pts; - float dur; - - if (abs(diff) > 1) //1 second, there's a discontinuity - { - si->duration += si->last_pts - si->first_pts; - si->first_pts = si->last_pts = (*dp)->pts; - } - else - { - si->last_pts = (*dp)->pts; - } - si->size += ret; - dur = si->duration + (si->last_pts - si->first_pts); - - if (dur > 0 && ds == demuxer->video) - { - ts_priv_t *priv = (ts_priv_t *) demuxer->priv; - if (dur > 1) //otherwise it may be unreliable - priv->vbitrate = (uint32_t)((float) si->size / dur); - } - } - } - else if (*dp != NULL)free_demux_packet(*dp); - - *dp = NULL; - *dp_offset = 0; - - return ret; -} - -static int fill_extradata(mp4_decoder_config_t *mp4_dec, ES_stream_t *tss) -{ - uint8_t *tmp; - -#ifdef DEBUG - demux_ts_printf("MP4_dec: %p, pid: %d\n", mp4_dec, tss->pid); -#endif - - if (mp4_dec->buf_size > tss->extradata_alloc) - { - tmp = (uint8_t *) realloc(tss->extradata, mp4_dec->buf_size); - if (!tmp) - return 0; - tss->extradata = tmp; - tss->extradata_alloc = mp4_dec->buf_size; - } - memcpy(tss->extradata, mp4_dec->buf, mp4_dec->buf_size); - tss->extradata_len = mp4_dec->buf_size; - -#ifdef DEBUG - demux_ts_printf("EXTRADATA: %p, alloc=%d, len=%d\n", tss->extradata, tss->extradata_alloc, tss->extradata_len); -#endif - - return tss->extradata_len; -} - -// 0 = EOF or no stream found -// else = [-] number of bytes written to the packet -static int ts_parse(demuxer_t *demuxer , ES_stream_t *es, unsigned char *packet, int probe) -{ - ES_stream_t *tss; - uint8_t done = 0; - int buf_size, is_start, pid, base; - int len, cc, cc_ok, afc, retv = 0, is_video, is_audio, is_sub; - ts_priv_t *priv = (ts_priv_t *) demuxer->priv; - stream_t *stream = demuxer->stream; - char *p; - demux_stream_t *ds = NULL; - demux_packet_t **dp = NULL; - int *dp_offset = 0, *buffer_size = 0; - int32_t progid, pid_type, bad, ts_error; - int junk = 0, rap_flag = 0; - pmt_t *pmt; - mp4_decoder_config_t *mp4_dec; - TS_stream_info *si; - - - while (! done) - { - bad = ts_error = 0; - ds = (demux_stream_t *) NULL; - dp = (demux_packet_t **) NULL; - dp_offset = buffer_size = NULL; - rap_flag = 0; - mp4_dec = NULL; - es->is_synced = 0; - es->lang[0] = 0; - si = NULL; - - junk = priv->ts.packet_size - TS_PACKET_SIZE; - buf_size = priv->ts.packet_size - junk; - - if (stream_eof(stream)) - { - if (! probe) - { - ts_dump_streams(priv); - demuxer->filepos = stream_tell(demuxer->stream); - } - -#ifdef DEBUG - demux_ts_printf("TS_PARSE: end of file\n"); -#endif - - return 0; - } - - - if (! ts_sync(stream)) - { -#ifdef DEBUG - demux_ts_printf("TS_PARSE: COULDN'T SYNC\n"); -#endif - - return 0; - } - - len = stream_read(stream, &packet[1], 3); - - if (len != 3) - { -#ifdef DEBUG - demux_ts_printf("TS_PARSE: stream error\n"); -#endif - return 0; - } - buf_size -= 4; - - if ((packet[1] >> 7) & 0x01) //transport error - ts_error = 1; - - - is_start = packet[1] & 0x40; - pid = ((packet[1] & 0x1f) << 8) | packet[2]; - - tss = priv->ts.pids[pid]; //an ES stream - if (tss == NULL) - { - tss = new_pid(priv, pid); - if (tss == NULL) - continue; - } - - cc = (packet[3] & 0xf); - cc_ok = (tss->last_cc < 0) || ((((tss->last_cc + 1) & 0x0f) == cc)); - tss->last_cc = cc; - - bad = ts_error; // || (! cc_ok); - if (bad) - { - if (priv->keep_broken == 0) - { - stream_skip(stream, buf_size - 1 + junk); - continue; - } - - is_start = 0; //queued to the packet data - } - - if (is_start) - tss->is_synced = 1; - - if ((!is_start && !tss->is_synced) || ((pid > 1) && (pid < 16)) || (pid == 8191)) //invalid pid - { - stream_skip(stream, buf_size - 1 + junk); - continue; - } - - - afc = (packet[3] >> 4) & 3; - if (!(afc % 2)) //no payload in this TS packet - { - stream_skip(stream, buf_size - 1 + junk); - continue; - } - - if (afc > 1) - { - int c; - c = stream_read_char(stream); - buf_size--; - if (c < 0 || c > 183) //broken from the stream layer or invalid - { - stream_skip(stream, buf_size - 1 + junk); - continue; - } - - //c==0 is allowed! - if (c > 0) - { - uint8_t pcrbuf[188]; - int flags = stream_read_char(stream); - int has_pcr; - rap_flag = (flags & 0x40) >> 6; - has_pcr = flags & 0x10; - - buf_size--; - c--; - stream_read(stream, pcrbuf, c); - - if (has_pcr) - { - int pcr_pid = prog_pcr_pid(priv, priv->prog); - if (pcr_pid == pid) - { - uint64_t pcr, pcr_ext; - - pcr = (int64_t)(pcrbuf[0]) << 25; - pcr |= pcrbuf[1] << 17 ; - pcr |= (pcrbuf[2]) << 9; - pcr |= pcrbuf[3] << 1 ; - pcr |= (pcrbuf[4] & 0x80) >> 7; - - pcr_ext = (pcrbuf[4] & 0x01) << 8; - pcr_ext |= pcrbuf[5]; - - pcr = pcr * 300 + pcr_ext; - - //demuxer->reference_clock = (double)pcr/(double)27000000.0; - } - } - - buf_size -= c; - if (buf_size == 0) - continue; - } - } - - //find the program that the pid belongs to; if (it's the right one or -1) && pid_type==SL_SECTION - //call parse_sl_section() - pmt = pmt_of_pid(priv, pid, &mp4_dec); - if (mp4_dec) - { - fill_extradata(mp4_dec, tss); - if (IS_VIDEO(mp4_dec->object_type) || IS_AUDIO(mp4_dec->object_type)) - { - tss->type = SL_PES_STREAM; - tss->subtype = mp4_dec->object_type; - } - } - - - //TABLE PARSING - - base = priv->ts.packet_size - buf_size; - - priv->last_pid = pid; - - is_video = IS_VIDEO(tss->type) || (tss->type == SL_PES_STREAM && IS_VIDEO(tss->subtype)); - is_audio = IS_AUDIO(tss->type) || (tss->type == SL_PES_STREAM && IS_AUDIO(tss->subtype)) || (tss->type == PES_PRIVATE1); - is_sub = IS_SUB(tss->type); - pid_type = pid_type_from_pmt(priv, pid); - - // PES CONTENT STARTS HERE - if (! probe) - { - if ((is_video || is_audio) && is_start && !priv->ts.streams[pid].sh) - ts_add_stream(demuxer, tss); - - if ((pid == demuxer->sub->id)) //or the lang is right - { - pid_type = SPU_DVD; - } - - if (is_video && (demuxer->video->id == priv->ts.streams[pid].id)) - { - ds = demuxer->video; - - dp = &priv->fifo[1].pack; - dp_offset = &priv->fifo[1].offset; - buffer_size = &priv->fifo[1].buffer_size; - si = &priv->vstr; - } - else if (is_audio && (demuxer->audio->id == priv->ts.streams[pid].id)) - { - ds = demuxer->audio; - - dp = &priv->fifo[0].pack; - dp_offset = &priv->fifo[0].offset; - buffer_size = &priv->fifo[0].buffer_size; - si = &priv->astr; - } - else if (is_sub - || IS_SUB(pid_type)) - { - //SUBS are infrequent, so the initial detection may fail - // and we may need to add them at play-time - if (demuxer->sub->id == -1) - { - uint16_t p; - p = progid_for_pid(priv, tss->pid, priv->prog); - - if (p == priv->prog) - { - int asgn = 0; - uint8_t *lang; - - if (dvdsub_lang) - { - if ((lang = pid_lang_from_pmt(priv, pid))) - asgn = (strncmp((char *) lang, dvdsub_lang, 3) == 0); - } - else //no language specified with -slang - asgn = 1; - - if (asgn) - { - demuxer->sub->id = tss->pid; - -#ifdef DEBUG - demux_ts_printf("CHOSEN SUBs pid 0x%x (%d) FROM PROG %d\n", tss->pid, tss->pid, priv->prog); -#endif - } - } - } - - if (demuxer->sub->id == tss->pid) - { - ds = demuxer->sub; - - dp = &priv->fifo[2].pack; - dp_offset = &priv->fifo[2].offset; - buffer_size = &priv->fifo[2].buffer_size; - } - else - { - stream_skip(stream, buf_size + junk); - continue; - } - } - - //IS IT TIME TO QUEUE DATA to the dp_packet? - if (is_start && (dp != NULL)) - { - retv = fill_packet(demuxer, ds, dp, dp_offset, si); - } - - - if (dp && *dp == NULL) - { - if (*buffer_size > MAX_PACK_BYTES) - *buffer_size = MAX_PACK_BYTES; - *dp = new_demux_packet(*buffer_size); //es->size - *dp_offset = 0; - if (! *dp) - { - fprintf(stderr, "fill_buffer, NEW_ADD_PACKET(%d)FAILED\n", *buffer_size); - continue; - } - -#ifdef DEBUG - demux_ts_printf("CREATED DP(%d)\n", *buffer_size); -#endif - } - } - - - if (probe || !dp) //dp is NULL for tables and sections - { - p = (char *) &packet[base]; - } - else //feeding - { - if (*dp_offset + buf_size > *buffer_size) - { - *buffer_size = *dp_offset + buf_size + TS_FEC_PACKET_SIZE; - resize_demux_packet(*dp, *buffer_size); - } - p = (char *) & ((*dp)->buffer[*dp_offset]); - } - - len = stream_read(stream, (unsigned char *) p, buf_size); - if (len < buf_size) - { -#ifdef DEBUG - demux_ts_printf("\r\nts_parse() couldn't read enough data: %d < %d\r\n", len, buf_size); -#endif - - continue; - } - stream_skip(stream, junk); - - if (pid == 0) - { - parse_pat(priv, is_start, (unsigned char *) p, buf_size); - continue; - } - else if ((tss->type == SL_SECTION) && pmt) - { - int k, mp4_es_id = -1; - ts_section_t *section; - for (k = 0; k < pmt->mp4es_cnt; k++) - { - if (pmt->mp4es[k].decoder.object_type == MP4_OD && pmt->mp4es[k].decoder.stream_type == MP4_OD) - mp4_es_id = pmt->mp4es[k].id; - } - -#ifdef DEBUG - demux_ts_printf("MP4ESID: %d\n", mp4_es_id); -#endif - - for (k = 0; k < pmt->es_cnt; k++) - { - if (pmt->es[k].mp4_es_id == mp4_es_id) - { - section = &(tss->section); - parse_sl_section(pmt, section, is_start, &packet[base], buf_size); - } - } - continue; - } - else - { - progid = prog_id_in_pat(priv, pid); - if (progid != -1) - { - if (pid != demuxer->video->id && pid != demuxer->audio->id && pid != demuxer->sub->id) - { - parse_pmt(priv, progid, pid, is_start, &packet[base], buf_size); - continue; - } - else - { -#ifdef DEBUG - demux_ts_printf("Argh! Data pid %d used in the PMT, Skipping PMT parsing!\n", pid); -#endif - } - } - } - - if (!probe && !dp) - continue; - - if (is_start) - { - uint8_t *lang = NULL; - -#ifdef DEBUG - demux_ts_printf("IS_START\n"); -#endif - - len = pes_parse2((unsigned char *) p, buf_size, es, pid_type, pmt, pid); - if (! len) - { - tss->is_synced = 0; - continue; - } - es->pid = tss->pid; - tss->is_synced |= es->is_synced || rap_flag; - tss->payload_size = es->payload_size; - - if ((is_sub || is_audio) && (lang = pid_lang_from_pmt(priv, es->pid))) - { - memcpy(es->lang, lang, 3); - es->lang[3] = 0; - } - else - es->lang[0] = 0; - - if (probe) - { - if (es->type == UNKNOWN) - { -#ifdef DEBUG - demux_ts_printf("TS_PARSE: es type unknown\n"); -#endif - return 0; - } - tss->type = es->type; - tss->subtype = es->subtype; -#ifdef DEBUG - demux_ts_printf("TS_PARSE: return 1\n"); -#endif - - return 1; - } - else - { - if (es->pts == 0.0f) - es->pts = tss->pts = tss->last_pts; - else - tss->pts = tss->last_pts = es->pts; - -#ifdef DEBUG - demux_ts_printf("ts_parse, NEW pid=%d, PSIZE: %u, type=%X, start=%p, len=%d\n", - es->pid, es->payload_size, es->type, es->start, es->size); -#endif - - demuxer->filepos = stream_tell(demuxer->stream) - es->size; - - memmove(p, es->start, es->size); - *dp_offset += es->size; - (*dp)->flags = 0; - (*dp)->pos = stream_tell(demuxer->stream); - (*dp)->pts = es->pts; - - if (retv > 0) - { -#ifdef DEBUG - demux_ts_printf("TS_PARSE: retv %d\n", retv); -#endif - return retv; - } - else - continue; - } - } - else - { - uint16_t sz; - - es->pid = tss->pid; - es->type = tss->type; - es->subtype = tss->subtype; - es->pts = tss->pts = tss->last_pts; - es->start = &packet[base]; - - - if (tss->payload_size > 0) - { - sz = FFMIN(tss->payload_size, buf_size); - tss->payload_size -= sz; - es->size = sz; - } - else - { - if (is_video) - { - sz = es->size = buf_size; - } - else - { - continue; - } - } - - - if (! probe) - { - *dp_offset += sz; - - if (*dp_offset >= MAX_PACK_BYTES) - { - (*dp)->pts = tss->last_pts; - retv = fill_packet(demuxer, ds, dp, dp_offset, si); -#ifdef DEBUG - demux_ts_printf("TS_PARSE: ret 1\n"); -#endif - return 1; - } - - continue; - } - else - { - memcpy(es->start, p, sz); - - if (es->size) - { -#ifdef DEBUG - demux_ts_printf("TS_PARSE: es->size %d\n", es->size); -#endif - return es->size; - } - else - continue; - } - } - } -#ifdef DEBUG - demux_ts_printf("TS_PARSE: priv; - if (a) - { - if (priv->fifo[0].pack != NULL) - { - free_demux_packet(priv->fifo[0].pack); - priv->fifo[0].pack = NULL; - } - priv->fifo[0].offset = 0; - } - - if (v) - { - if (priv->fifo[1].pack != NULL) - { - free_demux_packet(priv->fifo[1].pack); - priv->fifo[1].pack = NULL; - } - priv->fifo[1].offset = 0; - } - - if (s) - { - if (priv->fifo[2].pack != NULL) - { - free_demux_packet(priv->fifo[2].pack); - priv->fifo[2].pack = NULL; - } - priv->fifo[2].offset = 0; - } - //demuxer->reference_clock = MP_NOPTS_VALUE; -} - -static int whileSeeking = 0; - -static void demux_seek_ts(demuxer_t *demuxer, float rel_seek_secs, float audio_delay, int flags) -{ - demux_stream_t *d_audio = demuxer->audio; - demux_stream_t *d_video = demuxer->video; - sh_audio_t *sh_audio = d_audio->sh; - sh_video_t *sh_video = d_video->sh; - ts_priv_t *priv = (ts_priv_t *) demuxer->priv; - int i, video_stats; - off_t newpos; - - //================= seek in MPEG-TS ========================== - -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - whileSeeking = 1; - getTSMutex(FILENAME, __FUNCTION__, __LINE__); - - ts_dump_streams(demuxer->priv); - reset_fifos(demuxer, sh_audio != NULL, sh_video != NULL, demuxer->sub->id > 0); - - demux_flush(demuxer); - - video_stats = (sh_video != NULL); - if (video_stats) - { -#ifdef DEBUG - demux_ts_printf("IBPS: %d, vb: %d\r\n", sh_video->i_bps, priv->vbitrate); -#endif - - if (priv->vbitrate) - video_stats = priv->vbitrate; - else - video_stats = sh_video->i_bps; - } - - newpos = (flags & SEEK_ABSOLUTE) ? demuxer->movi_start : demuxer->filepos; - if (flags & SEEK_FACTOR) // float seek 0..1 - newpos += (demuxer->movi_end - demuxer->movi_start) * rel_seek_secs; - else - { - // time seek (secs) - if (! video_stats) // unspecified or VBR - newpos += 2324 * 75 * rel_seek_secs; // 174.3 kbyte/sec - else - newpos += video_stats * rel_seek_secs; - } - - - if (newpos < demuxer->movi_start) - newpos = demuxer->movi_start; //begininng of stream - - stream_seek(demuxer->stream, newpos); - - for (i = 0; i < 8192; i++) - if (priv->ts.pids[i] != NULL) - priv->ts.pids[i]->is_synced = 0; - - videobuf_code_len = 0; - - if (sh_video != NULL) - ds_fill_buffer(d_video); - - if (sh_audio != NULL) - ds_fill_buffer(d_audio); - - /* - // sync_video_packet not working - // infinite loop in demuxer.c->demux_pattern_3() - while(sh_video != NULL) - { - if(sh_audio && !d_audio->eof && d_video->pts && d_audio->pts) - { - float a_pts=d_audio->pts; - a_pts+=(ds_tell_pts(d_audio)-sh_audio->a_in_buffer_len)/(float)sh_audio->i_bps; - if(d_video->pts > a_pts) - { - //skip_audio_frame(sh_audio); // sync audio - continue; - } - } - - - i = sync_video_packet(d_video); - if((sh_video->format == VIDEO_MPEG1) || (sh_video->format == VIDEO_MPEG2)) - { - if(i==0x1B3 || i==0x1B8) break; // found it! - } - else if((sh_video->format == VIDEO_MPEG4) && (i==0x1B6)) - break; - else if(sh_video->format == VIDEO_VC1 && (i==0x10E || i==0x10F)) - break; - else //H264 - { - if((i & ~0x60) == 0x105 || (i & ~0x60) == 0x107) break; - } - - if(!i || !skip_video_packet(d_video)) break; // EOF? - } - */ - - releaseTSMutex(FILENAME, __FUNCTION__, __LINE__); - whileSeeking = 0; - -#ifdef DEBUG - printf("%s::%s exiting\n", FILENAME, __FUNCTION__); -#endif -} - - -int demux_ts_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds) -{ - ES_stream_t es; - ts_priv_t *priv = (ts_priv_t *)demuxer->priv; - - return -ts_parse(demuxer, &es, (unsigned char *) priv->packet, 0); -} -extern int demux_ts_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds); - -static int ts_check_file_dmx(demuxer_t *demuxer) -{ - return ts_check_file(demuxer) ? DEMUXER_TYPE_MPEG_TS : 0; -} - -static int is_usable_program(ts_priv_t *priv, pmt_t *pmt) -{ - int j; - - for (j = 0; j < pmt->es_cnt; j++) - { - if (priv->ts.pids[pmt->es[j].pid] == NULL || priv->ts.streams[pmt->es[j].pid].sh == NULL) - continue; - if ( - priv->ts.streams[pmt->es[j].pid].type == TYPE_VIDEO || - priv->ts.streams[pmt->es[j].pid].type == TYPE_AUDIO - ) - return 1; - } - - return 0; -} - -static int demux_ts_control(demuxer_t *demuxer, int cmd, void *arg) -{ - ts_priv_t *priv = (ts_priv_t *)demuxer->priv; - - switch (cmd) - { - case DEMUXER_CTRL_SWITCH_AUDIO: - case DEMUXER_CTRL_SWITCH_VIDEO: - { - void *sh = NULL; - int i, n; - int reftype, areset = 0, vreset = 0; - demux_stream_t *ds; - - if (cmd == DEMUXER_CTRL_SWITCH_VIDEO) - { - reftype = TYPE_VIDEO; - ds = demuxer->video; - vreset = 1; - } - else - { - reftype = TYPE_AUDIO; - ds = demuxer->audio; - areset = 1; - } - n = *((int *)arg); - if (n == -2) - { - reset_fifos(demuxer, areset, vreset, 0); - ds->id = -2; - ds->sh = NULL; - ds_free_packs(ds); - *((int *)arg) = ds->id; - return DEMUXER_CTRL_OK; - } - - if (n < 0) - { - for (i = 0; i < 8192; i++) - { - if (priv->ts.streams[i].id == ds->id && priv->ts.streams[i].type == reftype) - break; - } - - while (!sh) - { - i = (i + 1) % 8192; - if (priv->ts.streams[i].type == reftype) - { - if (priv->ts.streams[i].id == ds->id) //we made a complete loop - break; - sh = priv->ts.streams[i].sh; - } - } - } - else //audio track - { - if (n >= 8192 || priv->ts.streams[n].type != reftype) return DEMUXER_CTRL_NOTIMPL; - i = n; - sh = priv->ts.streams[i].sh; - } - - if (sh) - { - if (ds->id != priv->ts.streams[i].id) - reset_fifos(demuxer, areset, vreset, 0); - ds->id = priv->ts.streams[i].id; - ds->sh = sh; - ds_free_packs(ds); - -#ifdef DEBUG - demux_ts_printf("\r\ndemux_ts, switched to audio pid %d, id: %d, sh: %p\r\n", i, ds->id, sh); -#endif - } - - *((int *)arg) = ds->id; - return DEMUXER_CTRL_OK; - } - - case DEMUXER_CTRL_IDENTIFY_PROGRAM: //returns in prog->{aid,vid} the new ids that comprise a program - { - int i, j, cnt = 0; - int vid_done = 0, aid_done = 0; - pmt_t *pmt = NULL; - demux_program_t *prog = arg; - - if (priv->pmt_cnt < 2) - return DEMUXER_CTRL_NOTIMPL; - - if (prog->progid == -1) - { - int cur_pmt_idx = 0; - - for (i = 0; i < priv->pmt_cnt; i++) - if (priv->pmt[i].progid == priv->prog) - { - cur_pmt_idx = i; - break; - } - - i = (cur_pmt_idx + 1) % priv->pmt_cnt; - while (i != cur_pmt_idx) - { - pmt = &priv->pmt[i]; - cnt = is_usable_program(priv, pmt); - if (cnt) - break; - i = (i + 1) % priv->pmt_cnt; - } - } - else - { - for (i = 0; i < priv->pmt_cnt; i++) - if (priv->pmt[i].progid == prog->progid) - { - pmt = &priv->pmt[i]; //required program - cnt = is_usable_program(priv, pmt); - } - } - - if (!cnt) - return DEMUXER_CTRL_NOTIMPL; - - //finally some food - prog->aid = prog->vid = -2; //no audio and no video by default - for (j = 0; j < pmt->es_cnt; j++) - { - if (priv->ts.pids[pmt->es[j].pid] == NULL || priv->ts.streams[pmt->es[j].pid].sh == NULL) - continue; - - if (!vid_done && priv->ts.streams[pmt->es[j].pid].type == TYPE_VIDEO) - { - vid_done = 1; - prog->vid = pmt->es[j].pid; - } - else if (!aid_done && priv->ts.streams[pmt->es[j].pid].type == TYPE_AUDIO) - { - aid_done = 1; - prog->aid = pmt->es[j].pid; - } - } - - priv->prog = prog->progid = pmt->progid; - return DEMUXER_CTRL_OK; - } - - default: - return DEMUXER_CTRL_NOTIMPL; - } -} -////////////////////////////////////////////////////////////////7 -////////////////////////////////////////////////////////////////7 - -int ts_mpg(demuxer_t *demuxer) -{ - demuxer_t *ret = NULL; - - ret = demux_open_ts(demuxer); - - if (ret == NULL) - return 0; - else - return -1; -} -extern int ts_mpg(demuxer_t *demuxer); - -#include "common.h" -#include "container.h" -#include "manager.h" -#include "utils.h" - -static demuxer_t *demuxer = NULL; -static demux_stream_t *ds = NULL; // dvd subtitle buffer/demuxer -static sh_audio_t *sh_audio = NULL; -static sh_video_t *sh_video = NULL; -static pthread_t PlayThread; -static int isPlayThreadCreated = 0; - -int TSInit(Context_t *context, char *filename) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - getTSMutex(FILENAME, __FUNCTION__, __LINE__); - - int ret = 0; - int i = 0; - - demuxer = (demuxer_t *)malloc(sizeof(demuxer_t)); - memset(demuxer, 0, sizeof(demuxer_t)); - - demuxer->audio = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(demuxer->audio, 0, sizeof(demux_stream_t)); - - demuxer->video = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(demuxer->video, 0, sizeof(demux_stream_t)); - - demuxer->sub = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(demuxer->sub, 0, sizeof(demux_stream_t)); - - ds = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(ds, 0, sizeof(demux_stream_t)); - -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - demuxer->stream = (stream_t *)malloc(sizeof(stream_t)); - memset(demuxer->stream, 0, sizeof(stream_t)); - -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - demuxer->stream->fd = context->playback->fd; - - //read(demuxer->stream->fd,demuxer->stream->buffer,2048);//soviel ?? - -#ifdef DEBUG - printf("%s::%d\n", __FUNCTION__, __LINE__); -#endif - - demuxer->audio->id = -1; - demuxer->video->id = -1; - //demuxer->video_play = 0; - demuxer->stream->start_pos = 0; - - if (context->playback->isUPNP) - demuxer->stream->type = STREAMTYPE_STREAM; - else if (context->playback->isHttp) - demuxer->stream->type = STREAMTYPE_STREAM; - else if (context->playback->isFile) - demuxer->stream->type = STREAMTYPE_FILE; - - demuxer->stream->flags = 6; - demuxer->stream->sector_size = 0; - demuxer->stream->buf_pos = 0; - demuxer->stream->buf_len = 2048; - demuxer->stream->pos = 0;//2048; - demuxer->stream->start_pos = 0; - demuxer->stream->end_pos = 0; - demuxer->stream->eof = 0; - demuxer->stream->cache_pid = 0; - - //ts_check_file_dmx(demuxer); - if (demux_open_ts(demuxer) == NULL) - ret = 0; - else - ret = -1; - - //printf("ret = %d\n",ret); - - if (demuxer->video->sh) - { - sh_video = demuxer->video->sh; -#ifdef DEBUG - printf("VIDEO 0x%02x\n", sh_video->format); -#endif - - if (sh_video->format == 0x10000001 || sh_video->format == 0x10000002) - { - Track_t Video = - { - "und", - "V_MPEG2", - 0, - }; - - context->manager->video->Command(context, MANAGER_ADD, &Video); - } - else if (sh_video->format == 0x10000004) - { - Track_t Video = - { - "und", - "V_MS/VFW/FOURCC", - 0, - }; - - context->manager->video->Command(context, MANAGER_ADD, &Video); - } - else if (sh_video->format == 0x10000005) - { - Track_t Video = - { - "und", - "V_MPEG2/H264", - 0, - }; - - context->manager->video->Command(context, MANAGER_ADD, &Video); - } - else - { -#ifdef DEBUG - printf("%s::%s Unknown video format 0x%02x\n", FILENAME, __FUNCTION__, sh_video->format); -#endif - } - } - - if (demuxer->audio->sh != NULL) - { - sh_audio = demuxer->audio->sh; -#ifdef DEBUG - printf("AUDIO 0x%02x\n", sh_audio->format); -#endif - - if (sh_audio->format == 0x55 || sh_audio->format == 0x50) //mp3 - { - Track_t Audio = - { - "und", - "A_MPEG/L3", - i, - }; - context->manager->audio->Command(context, MANAGER_ADD, &Audio); - } - else if (sh_audio->format == 0x2000) //ac3 - { - Track_t Audio = - { - "und", - "A_AC3", - i, - }; - context->manager->audio->Command(context, MANAGER_ADD, &Audio); - } - else if (sh_audio->format == 0x2001) //dts - { - - Track_t Audio = - { - "und", - "A_DTS", - i, - }; - context->manager->audio->Command(context, MANAGER_ADD, &Audio); - } - else - { -#ifdef DEBUG - printf("%s::%s Unknown audio format 0x%02x\n", FILENAME, __FUNCTION__, sh_audio->format); -#endif - } - } - - releaseTSMutex(FILENAME, __FUNCTION__, __LINE__); - - return 0; // FIXME -} - -static unsigned long long int aStartPts = 0; -static unsigned long long int vStartPts = 0; - -#define INVALID_PTS_VALUE 0x200000000ull -void TSGenerateParcel(Context_t *context, const demuxer_t *demuxer) -{ - const demux_stream_t *video = demuxer->video; - const demux_stream_t *audio = demuxer->audio; - unsigned long long int Pts_audio = 0; - unsigned long long int Pts_video = 0; - unsigned int video_format_changed = 0; - unsigned int aPtsInit = 0; - unsigned int vPtsInit = 0; - demux_packet_t *current_audio = NULL; - demux_packet_t *current_video = NULL; - - if (!video_format) // initialize - if (sh_video->format) - { - video_format = sh_video->format; - -#ifdef DEBUG - printf("%s::%s video format init with 0x%02x\n", FILENAME, __FUNCTION__, video_format); -#endif - } - - if (sh_video->format != video_format) // changed? - { - video_format_changed = 1; - -#ifdef DEBUG - printf("%s::%s: change video format 0x%02x to 0x%02x\n", FILENAME, __FUNCTION__, sh_video->format, video_format); -#endif - - sh_video->format = video_format; - - if (sh_video->format == 0x10000001 || sh_video->format == 0x10000002) - { - Track_t Video = - { - "und", - "V_MPEG2", - 0, - }; - - context->manager->video->Command(context, MANAGER_DEL, NULL); - context->manager->video->Command(context, MANAGER_ADD, &Video); - context->output->video->Command(context, OUTPUT_SWITCH, "video"); - } - else if (sh_video->format == 0x10000004) - { - Track_t Video = - { - "und", - "V_MS/VFW/FOURCC", - 0, - }; - - context->manager->video->Command(context, MANAGER_DEL, NULL); - context->manager->video->Command(context, MANAGER_ADD, &Video); - context->output->video->Command(context, OUTPUT_SWITCH, "video"); - } - else if (sh_video->format == 0x10000005) - { - Track_t Video = - { - "und", - "V_MPEG2/H264", - 0, - }; - - context->manager->video->Command(context, MANAGER_DEL, NULL); - context->manager->video->Command(context, MANAGER_ADD, &Video); - context->output->video->Command(context, OUTPUT_SWITCH, "video"); - } - } - - if (audio->first != NULL) - { - current_audio = audio->first; - - if (current_audio->flags) // fixme : always zero? - { -#ifdef DEBUG - printf("audio current_audio->flags = 0x%02x\n", current_audio->flags); -#endif - } - - printf("audio current_audio->flags = 0x%02x\n", current_audio->flags); - if (!(current_audio->flags & 0x10)) - video_format_changed = 0; - else - video_format_changed = 1; - - /*if (!(current->flags&0x10)) { //current frame isn't a keyframe - //printf("\tNORMALFRAME, "); - Pts = INVALID_PTS_VALUE; - } else { - //printf("\tKEYFRAME, "); - Pts = (current->pts * 90000); - }*/ - - if (video_format_changed) - Pts_audio = INVALID_PTS_VALUE; - else - Pts_audio = current_audio->pts * 90000; - - if (aStartPts == 0) - { - aPtsInit = 1; - aStartPts = Pts_audio; - Pts_audio = 0; - } - else if (Pts_audio != INVALID_PTS_VALUE) - { - Pts_audio -= aStartPts; - } - } - - if (video->first != NULL) - { - current_video = video->first; - - if (current_video->flags) // fixme : always zero? - { -#ifdef DEBUG - printf("video current->flags = 0x%02x\n", current_video->flags); -#endif - } - - printf("video current->flags = 0x%02x\n", current_video->flags); - if (!(current_video->flags & 0x10)) - video_format_changed = 0; - else - video_format_changed = 1; - - /*if (!(current->flags&0x10)) { //current frame isn't a keyframe - //printf("\tNORMALFRAME, "); - Pts = INVALID_PTS_VALUE; - } else { - //printf("\tKEYFRAME, "); - Pts = (current->pts * 90000); - }*/ - - if (video_format_changed) - Pts_video = INVALID_PTS_VALUE; - else - Pts_video = current_video->pts * 90000; - - if (vStartPts == 0) - { - vPtsInit = 1; - vStartPts = Pts_video; - Pts_video = 0; - } - else if (Pts_video != INVALID_PTS_VALUE) - { - Pts_video -= vStartPts; - } - } - - if (aPtsInit && vStartPts) // audio found first time, video known? - { - if (vStartPts < aStartPts) - { - aStartPts = vStartPts; - } - else - { - vStartPts = aStartPts; - } - } - - if (vPtsInit && aStartPts) // video found first time, audio known? - { - if (vStartPts < aStartPts) - { - aStartPts = vStartPts; - } - else - { - vStartPts = aStartPts; - } - } - - while (current_audio != NULL) - { - //printf("AUDIODATA\n"); - //HexdumpAVI(current->buffer, current->len); - - context->output->audio->Write(context, current_audio->buffer, current_audio->len, Pts_audio, NULL, 0, 0, "audio"); - - current_audio = current_audio->next; - Pts_audio = INVALID_PTS_VALUE; - } - - while (current_video != NULL) - { - context->output->video->Write(context, current_video->buffer, current_video->len, Pts_video, 0, 0, 0, "video"); - - current_video = current_video->next; - Pts_video = INVALID_PTS_VALUE; - } -} - - - -static void TSThread(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - while (context->playback->isCreationPhase) - { -#ifdef DEBUG - printf("%s::%s Thread waiting for end of init phase...\n", FILENAME, __FUNCTION__); -#endif - } - -#ifdef DEBUG - printf("%s::%s Running!\n", FILENAME, __FUNCTION__); -#endif - - while (context && context->playback && context->playback->isPlaying) - { - //printf("%s -->\n", __FUNCTION__); - - //IF MOVIE IS PAUSED, WAIT - if (context->playback->isPaused) - { -#ifdef DEBUG - printf("%s::%s paused\n", FILENAME, __FUNCTION__); -#endif - - usleep(100000); - continue; - } - - if (context->playback->isSeeking || whileSeeking) - { -#ifdef DEBUG - printf("%s::%s seeking\n", FILENAME, __FUNCTION__); -#endif - - usleep(100000); - continue; - } - - getTSMutex(FILENAME, __FUNCTION__, __LINE__); - - if (!demux_ts_fill_buffer(demuxer, ds)) - { -#ifdef DEBUG - printf("%s::%s demux_ts_fill_buffer failed!\n", FILENAME, __FUNCTION__); -#endif - - releaseTSMutex(FILENAME, __FUNCTION__, __LINE__); - - break; - } - else - { - TSGenerateParcel(context, demuxer); - - if (demuxer->sub != NULL && demuxer->sub->first != NULL) - { - ds_free_packs(demuxer->sub); - } - - if (demuxer->audio != NULL && demuxer->audio->first != NULL) - { - ds_free_packs(demuxer->audio); - } - - if (demuxer->video != NULL && demuxer->video->first != NULL) - { - ds_free_packs(demuxer->video); - } - //printf("%s <--\n", __FUNCTION__); - - releaseTSMutex(FILENAME, __FUNCTION__, __LINE__); - } - } - - aStartPts = 0; - vStartPts = 0; - - isPlayThreadCreated = 0; // prevent locking situation when calling PLAYBACK_TERM - - context->playback->Command(context, PLAYBACK_TERM, NULL); - -#ifdef DEBUG - printf("%s::%s terminating\n", FILENAME, __FUNCTION__); -#endif -} - - -static int TSPlay(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int error; - int ret = 0; - pthread_attr_t attr; - -#ifdef DEBUG - if (context && context->playback && context->playback->isPlaying) - { - printf("%s::%s is Playing\n", FILENAME, __FUNCTION__); - } - else - { - printf("%s::%s is NOT Playing\n", FILENAME, __FUNCTION__); - } -#endif - - if (isPlayThreadCreated == 0) - { - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - - if ((error = pthread_create(&PlayThread, &attr, (void *)&TSThread, context)) != 0) - { -#ifdef DEBUG - printf("%s::%s Error creating thread, error:%d:%s\n", FILENAME, __FUNCTION__, error, strerror(error)); -#endif - - isPlayThreadCreated = 0; - ret = -1; - } - else - { -#ifdef DEBUG - printf("%s::%s Created thread\n", FILENAME, __FUNCTION__); -#endif - } - isPlayThreadCreated = 1; - } - else - { -#ifdef DEBUG - printf("%s::%s A thread already exists!\n", FILENAME, __FUNCTION__); -#endif - - ret = -1; - } - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -static int TSStop(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int i; - int ret = 0; - int wait_time = 20; - - while ((isPlayThreadCreated != 0) && (--wait_time) > 0) - { -#ifdef DEBUG - printf("%s::%s Waiting for TS thread to terminate itself, will try another %d times\n", FILENAME, __FUNCTION__, wait_time); -#endif - - usleep(100000); - } - - if (wait_time == 0) - { -#ifdef DEBUG - printf("%s::%s Timeout waiting for TS thread!\n", FILENAME, __FUNCTION__); -#endif - - ret = -1; - } - else - { - getTSMutex(FILENAME, __FUNCTION__, __LINE__); - - if (demuxer) - { - demux_close_ts(demuxer); - - free(demuxer->stream); - demuxer->stream = NULL; - - free(demuxer->sub); - demuxer->sub = NULL; - - free(demuxer->video); - demuxer->video = NULL; - - free(demuxer->audio); - demuxer->audio = NULL; - - for (i = 0; i < MAX_A_STREAMS; i++) - { - free(demuxer->a_streams[i]); - demuxer->a_streams[i] = NULL; - } - - for (i = 0; i < MAX_V_STREAMS; i++) - { - free(demuxer->v_streams[i]); - demuxer->v_streams[i] = NULL; - } - - for (i = 0; i < MAX_S_STREAMS; i++) - { - free(demuxer->s_streams[i]); - demuxer->s_streams[i] = NULL; - } - - free(demuxer); - demuxer = NULL; - } - - free(ds); - ds = NULL; - - video_format = 0; - - releaseTSMutex(FILENAME, __FUNCTION__, __LINE__); - } - - return ret; -} - -static int TSGetLength(demuxer_t *demuxer, double *length) -{ - return -1; // FIXME -} - -static int Command(void *_context, ContainerCmd_t command, void *argument) -{ - Context_t *context = (Context_t *) _context; -#ifdef DEBUG - printf("%s::%s Command %d\n", FILENAME, __FUNCTION__, command); -#endif - - int ret = 0; - - switch (command) - { - case CONTAINER_INIT: - { - char *FILENAME = (char *)argument; - ret = TSInit(context, FILENAME); - break; - } - case CONTAINER_PLAY: - { - ret = TSPlay(context); - break; - } - case CONTAINER_STOP: - { - ret = TSStop(context); - break; - } - case CONTAINER_SEEK: - { - demux_seek_ts(demuxer, (float) * ((float *)argument), 0.0, 0); - break; - } - case CONTAINER_LENGTH: - { - double length = 0; - if (demuxer != NULL && TSGetLength(demuxer, &length) != 0) - *((double *)argument) = (double)0; - else - *((double *)argument) = (double)length; - break; - } - default: -#ifdef DEBUG - printf("%s::%s ContainerCmd %d not supported!\n", FILENAME, __FUNCTION__, command); -#endif - - break; - } - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -static char *TSCapabilities[] = { "ts", "m2ts", "trp", "mts", "rec", NULL }; - -Container_t TSContainer = -{ - "TS", - &Command, - TSCapabilities, - -}; -/* -const demuxer_desc_t demuxer_desc_mpeg_ts = { - "MPEG-TS demuxer", - "mpegts", - "TS", - "Nico Sabbi", - "", - DEMUXER_TYPE_MPEG_TS, - 0, // unsafe autodetect - ts_check_file_dmx, - demux_ts_fill_buffer, - demux_open_ts, - demux_close_ts, - demux_seek_ts, - demux_ts_control -}; -*/ diff --git a/libeplayer2/container/demuxer.c b/libeplayer2/container/demuxer.c deleted file mode 100644 index e00a58e..0000000 --- a/libeplayer2/container/demuxer.c +++ /dev/null @@ -1,478 +0,0 @@ -#include -#include -#include -#include - -#include -#include - -#include "utils.h" -#include "stream.h" -#include "demuxer.h" -#include "mkv.h" - -#include "stheader.h" - -#ifdef __cplusplus -extern "C" { -#endif - -int demuxer_debug = 1; -static const char FILENAME[] = "demuxer.c"; - -#define demuxer_printf(x...) do { if (demuxer_debug)printf(x); } while (0) - -#define fast_memcpy(a,b,c) memcpy(a,b,c) - -char *dvdsub_lang; -char *audio_lang; -int dvdsub_id = 0; - -sh_sub_t *new_sh_sub_sid(demuxer_t *demuxer, int id, int sid) -{ - if (id > MAX_S_STREAMS - 1 || id < 0) - { - demuxer_printf("Requested sub stream id overflow (%d > %d)\n", id, MAX_S_STREAMS); - return NULL; - } - if (demuxer->s_streams[id]) - demuxer_printf("Sub stream %i redefined\n", id); - else - { - sh_sub_t *sh = calloc(1, sizeof(sh_sub_t)); - demuxer->s_streams[id] = sh; - sh->sid = sid; - demuxer_printf("ID_SUBTITLE_ID=%d\n", sid); - if (dvdsub_id == id) - { - demuxer->sub->id = id; - demuxer->sub->sh = sh; - } - } - demuxer_printf("id =%d\n", id); - return demuxer->s_streams[id]; -} - -void free_sh_sub(sh_sub_t *sh) -{ - demuxer_printf("DEMUXER: freeing sh_sub at %p\n", sh); - free(sh); - sh = NULL; -} - -sh_audio_t *new_sh_audio_aid(demuxer_t *demuxer, int id, int aid) -{ - if (id > MAX_A_STREAMS - 1 || id < 0) - { - demuxer_printf("Requested audio stream id overflow (%d > %d)\n", id, MAX_A_STREAMS); - return NULL; - } - if (demuxer->a_streams[id]) - { - demuxer_printf("AUDIO %d\n", id); - } - else - { - sh_audio_t *sh; - //mp_msg(MSGT_DEMUXER,MSGL_V,MSGTR_FoundAudioStream,id); - demuxer->a_streams[id] = calloc(1, sizeof(sh_audio_t)); - sh = demuxer->a_streams[id]; - // set some defaults - sh->samplesize = 2; - sh->sample_format = AF_FORMAT_S16_NE; - sh->audio_out_minsize = 8192; /* default size, maybe not enough for Win32/ACM*/ - sh->pts = MP_NOPTS_VALUE; - demuxer_printf("ID_AUDIO_ID=%d\n", aid); - } - ((sh_audio_t *)demuxer->a_streams[id])->aid = aid; - demuxer_printf("audio_id =%d\n", id); - audio_id = id; - return demuxer->a_streams[id]; -} - -void free_sh_audio(demuxer_t *demuxer, int id) -{ - sh_audio_t *sh = demuxer->a_streams[id]; - demuxer->a_streams[id] = NULL; - demuxer_printf("DEMUXER: freeing sh_audio at %p\n", sh); - free(sh->wf); - sh->wf = NULL; - free(sh); - sh = NULL; -} - -sh_video_t *new_sh_video_vid(demuxer_t *demuxer, int id, int vid) -{ - demuxer_printf("new_sh_video_vid->\n"); - if (id > MAX_V_STREAMS - 1 || id < 0) - { - demuxer_printf("Requested video stream id overflow (%d > %d)\n", - id, MAX_V_STREAMS); - demuxer_printf("new_sh_video_vid-< nULL\n"); - return NULL; - } - if (demuxer->v_streams[id] != NULL) - { - demuxer_printf("Warnung VideoStreamRedefined %d\n", id); - } - else - { - demuxer_printf("VideoStreamRedefined %d\n", id); - demuxer->v_streams[id] = calloc(1, sizeof(sh_video_t)); - demuxer_printf("ID_VIDEO_ID=%d\n", vid); - } - demuxer_printf("new_sh_video_vid 2\n"); - - ((sh_video_t *)demuxer->v_streams[id])->vid = vid; - demuxer_printf("new_sh_video_vid-<\n"); - return demuxer->v_streams[id]; -} - -void free_sh_video(sh_video_t *sh) -{ - demuxer_printf("DEMUXER: freeing sh_video at %p\n", sh); - free(sh->bih); - sh->bih = NULL; - free(sh); - sh = NULL; -} -void ds_add_packet(demux_stream_t *ds, demux_packet_t *dp) -{ -//printf("ds_add_packet\n"); -// demux_packet_t* dp=new_demux_packet(len); -// stream_read(stream,dp->buffer,len); -// dp->pts=pts; //(float)pts/90000.0f; -// dp->pos=pos; - // append packet to DS stream: - ++ds->packs; - ds->bytes += dp->len; - if (ds->last) - { - // next packet in stream - ds->last->next = dp; - ds->last = dp; - } - else - { - // first packet in stream - ds->first = ds->last = dp; - } -// demuxer_printf("DEMUX: Append packet to %s, len=%d pts=%5.3f pos=%u [packs: A=%d V=%d]\n", -// (ds==ds->audio)?"d_audio":"d_video", -// dp->len,dp->pts,(unsigned int)dp->pos,ds->audio->packs,ds->video->packs); -} - -int demux_fill_buffer(demuxer_t *demux, demux_stream_t *ds) -{ - demuxer_printf("%s::%d\n", __FUNCTION__, __LINE__); - // Note: parameter 'ds' can be NULL! -// demuxer_printf("demux->type=%d\n",demux->type); - - if (demux->desc == NULL) - demuxer_printf("%s::%d demux->desc=NULL\n", __FUNCTION__, __LINE__); - - return demux->desc->fill_buffer(demux, ds); -} -// return value: -// 0 = EOF -// 1 = succesfull -int ds_fill_buffer(demux_stream_t *ds) -{ - demuxer_printf("ds_fill_buffer->\n"); - demuxer_t *demux = ds->demuxer; - if (ds->current) free_demux_packet(ds->current); - - while (1) - { - if (ds->packs) - { - demux_packet_t *p = ds->first; - // copy useful data: - ds->buffer = p->buffer; - ds->buffer_pos = 0; - ds->buffer_size = p->len; - ds->pos = p->pos; - ds->dpos += p->len; // !!! - ++ds->pack_no; - - if (p->pts != (correct_pts ? MP_NOPTS_VALUE : 0)) - { - ds->pts = p->pts; - ds->pts_bytes = 0; - } - ds->pts_bytes += p->len; // !!! - if (p->stream_pts != MP_NOPTS_VALUE) demux->stream_pts = p->stream_pts; - ds->flags = p->flags; - // unlink packet: - ds->bytes -= p->len; - ds->current = p; - ds->first = p->next; - if (!ds->first) ds->last = NULL; - --ds->packs; - return 1; //ds->buffer_size; - } - /* if(demux->audio->packs>=MAX_PACKS || demux->audio->bytes>=MAX_PACK_BYTES){ - // mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_TooManyAudioInBuffer,demux->audio->packs,demux->audio->bytes); - // mp_msg(MSGT_DEMUXER,MSGL_HINT,MSGTR_MaybeNI); - break; - } - if(demux->video->packs>=MAX_PACKS || demux->video->bytes>=MAX_PACK_BYTES){ - // mp_msg(MSGT_DEMUXER,MSGL_ERR,MSGTR_TooManyVideoInBuffer,demux->video->packs,demux->video->bytes); - // mp_msg(MSGT_DEMUXER,MSGL_HINT,MSGTR_MaybeNI); - break; - }*/ - demuxer_printf("%s::%d\n", __FUNCTION__, __LINE__); - - return 0; - - if (demux == NULL) - demuxer_printf("ds_fill_buffer demux==NULL\n"); - if (ds == NULL) - demuxer_printf("ds_fill_buffer ds==NULL\n"); - - demuxer_printf("%s::%d\n", __FUNCTION__, __LINE__); - if (!demux_fill_buffer(demux, ds)) - { - demuxer_printf("ds_fill_buffer()->demux_fill_buffer() failed\n"); - break; // EOF - } - demuxer_printf("%s::%d\n", __FUNCTION__, __LINE__); - } - ds->buffer_pos = ds->buffer_size = 0; - ds->buffer = NULL; - ds->current = NULL; - demuxer_printf("ds_fill_buffer: EOF reached (stream: %s) \n", ds == demux->audio ? "audio" : "video"); - ds->eof = 1; - demuxer_printf("ds_fill_buffer-< 0\n"); - return 0; -} -int ds_fill_buffer2(demux_stream_t *ds, demux_stream_t *demuxer) -{ - demuxer_printf("ds_fill_buffer2->\n"); - if (demuxer == NULL) - demuxer_printf("ds_fill_buffer2 demuxer==NULL\n"); - ds->demuxer = demuxer; - demuxer_t *demux = ds->demuxer; - if (ds->current) free_demux_packet(ds->current); - while (1) - { - if (ds->packs) - { - demux_packet_t *p = ds->first; - ds->buffer = p->buffer; - ds->buffer_pos = 0; - ds->buffer_size = p->len; - ds->pos = p->pos; - ds->dpos += p->len; // !!! - ++ds->pack_no; - if (p->pts != (correct_pts ? MP_NOPTS_VALUE : 0)) - { - ds->pts = p->pts; - ds->pts_bytes = 0; - } - ds->pts_bytes += p->len; // !!! - if (p->stream_pts != MP_NOPTS_VALUE) demux->stream_pts = p->stream_pts; - ds->flags = p->flags; - ds->bytes -= p->len; - ds->current = p; - ds->first = p->next; - if (!ds->first) ds->last = NULL; - --ds->packs; - return 1; //ds->buffer_size; - } - demuxer_printf("%s::%d\n", __FUNCTION__, __LINE__); - if (!demux_fill_buffer(demux, ds)) - { - demuxer_printf("ds_fill_buffer2()->demux_fill_buffer2() failed\n"); - break; // EOF - } - demuxer_printf("%s::%d\n", __FUNCTION__, __LINE__); - } - ds->buffer_pos = ds->buffer_size = 0; - ds->buffer = NULL; - ds->current = NULL; - demuxer_printf("ds_fill_buffer2: EOF reached (stream: %s) \n", ds == demux->audio ? "audio" : "video"); - ds->eof = 1; - demuxer_printf("ds_fill_buffer2-< 0\n"); - return 0; -} - -int demux_read_data(demux_stream_t *ds, unsigned char *mem, int len) -{ - int x; - int bytes = 0; - while (len > 0) - { - x = ds->buffer_size - ds->buffer_pos; - if (x == 0) - { - if (!ds_fill_buffer(ds)) return bytes; - } - else - { - if (x > len) x = len; - if (mem) fast_memcpy(mem + bytes, &ds->buffer[ds->buffer_pos], x); - bytes += x; - len -= x; - ds->buffer_pos += x; - } - } - return bytes; -} - -int demuxer_add_chapter(demuxer_t *demuxer, const char *name, uint64_t start, uint64_t end) -{ - if (demuxer->chapters == NULL) - demuxer->chapters = malloc(32 * sizeof(*demuxer->chapters)); - else if (!(demuxer->num_chapters % 32)) - demuxer->chapters = realloc(demuxer->chapters, (demuxer->num_chapters + 32) * sizeof(*demuxer->chapters)); - - demuxer->chapters[demuxer->num_chapters].start = start; - demuxer->chapters[demuxer->num_chapters].end = end; - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); - demuxer->chapters[demuxer->num_chapters].name = strdup(name); - - return demuxer->num_chapters ++; -} - -int demuxer_sub_track_by_lang(demuxer_t *d, char *lang) -{ - int i, len; - lang += strspn(lang, ","); - while ((len = strcspn(lang, ",")) > 0) - { - for (i = 0; i < MAX_S_STREAMS; ++i) - { - sh_sub_t *sh = d->s_streams[i]; - if (sh && sh->lang && strncmp(sh->lang, lang, len) == 0) - return sh->sid; - } - lang += len; - lang += strspn(lang, ","); - } - return -1; -} -int demux_info_add(demuxer_t *demuxer, const char *opt, const char *param) -{ - char **info = demuxer->info; - int n = 0; - - - for (n = 0; info && info[2 * n] != NULL; n++) - { - if (!strcasecmp(opt, info[2 * n])) - { - demuxer_printf("DemuxerInfoChanged %p %p\n", opt, param); - free(info[2 * n + 1]); - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); - info[2 * n + 1] = strdup(param); - return 0; - } - } - - info = demuxer->info = (char **)realloc(info, (2 * (n + 2)) * sizeof(char *)); - printf("2strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); - info[2 * n] = strdup(opt); - info[2 * n + 1] = strdup(param); - memset(&info[2 * (n + 1)], 0, 2 * sizeof(char *)); - - return 1; -} - -void ds_read_packet(demux_stream_t *ds, stream_t *stream, int len, double pts, off_t pos, int flags) -{ - demux_packet_t *dp = new_demux_packet(len); - len = stream_read(stream, dp->buffer, len); - resize_demux_packet(dp, len); - dp->pts = pts; //(float)pts/90000.0f; - dp->pos = pos; - dp->flags = flags; - // append packet to DS stream: - ds_add_packet(ds, dp); -} - -// Reset and set internal data but do not free the instance -void ds_free_packs(demux_stream_t *ds) -{ - - if (ds != NULL) - { - demux_packet_t *dp = ds->first; - - while (dp) - { - demux_packet_t *dn = dp->next; - free_demux_packet(dp); - dp = dn; - } - - if (ds->asf_packet) - { - // free unfinished .asf fragments: - free(ds->asf_packet->buffer); - ds->asf_packet->buffer = NULL; - free(ds->asf_packet); - ds->asf_packet = NULL; - } - - ds->first = ds->last = NULL; - ds->packs = 0; // !!!!! - ds->bytes = 0; - - free_demux_packet(ds->current); - - ds->buffer = NULL; - ds->buffer_pos = ds->buffer_size; - ds->pts = 0; - ds->pts_bytes = 0; - } -} - -void demux_flush(demuxer_t *demuxer) -{ - ds_free_packs(demuxer->video); - ds_free_packs(demuxer->audio); - ds_free_packs(demuxer->sub); -} - -/** - * \brief read data until the given 3-byte pattern is encountered, up to maxlen - * \param mem memory to read data into, may be NULL to discard data - * \param maxlen maximum number of bytes to read - * \param read number of bytes actually read - * \param pattern pattern to search for (lowest 8 bits are ignored) - * \return whether pattern was found - */ -int demux_pattern_3(demux_stream_t *ds, unsigned char *mem, int maxlen, - int *read, uint32_t pattern) -{ - register uint32_t head = 0xffffff00; - register uint32_t pat = pattern & 0xffffff00; - int total_len = 0; - do - { - register unsigned char *ds_buf = &ds->buffer[ds->buffer_size]; - int len = ds->buffer_size - ds->buffer_pos; - register long pos = -len; - if (unlikely(pos >= 0)) // buffer is empty - { - ds_fill_buffer(ds); - continue; - } - do - { - head |= ds_buf[pos]; - head <<= 8; - } - while (++pos && head != pat); - len += pos; - if (total_len + len > maxlen) - len = maxlen - total_len; - len = demux_read_data(ds, mem ? &mem[total_len] : NULL, len); - total_len += len; - } - while ((head != pat || total_len < 3) && total_len < maxlen && !ds->eof); - if (read) - *read = total_len; - return total_len >= 3 && head == pat; -} diff --git a/libeplayer2/container/demuxer.h b/libeplayer2/container/demuxer.h deleted file mode 100644 index d7e6a95..0000000 --- a/libeplayer2/container/demuxer.h +++ /dev/null @@ -1,324 +0,0 @@ -#ifndef _DEMUXER_H -#define _DEMUXER_H - -#include -#include - -#include "stream.h" -#include "aviheader.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define MP_INPUT_BUFFER_PADDING_SIZE 8 - -#define HAVE_BUILTIN_EXPECT - -#ifdef HAVE_BUILTIN_EXPECT - -#define likely(x) __builtin_expect ((x) != 0, 1) -#define unlikely(x) __builtin_expect ((x) != 0, 0) - -#else - -#define likely(x) (x) -#define unlikely(x) (x) - -#endif - -#define FFMAX(a,b) ((a) > (b) ? (a) : (b)) -#define FFMIN(a,b) ((a) > (b) ? (b) : (a)) - -#define MAX_PACKS 4096 -#define MAX_PACK_BYTES 0x800000 - -#define DEMUXER_TYPE_PLAYLIST (2<<16) - -#define DEMUXER_TYPE_UNKNOWN 0 -#define DEMUXER_TYPE_MPEG_ES 1 -#define DEMUXER_TYPE_MPEG_PS 2 -#define DEMUXER_TYPE_AVI 3 -#define DEMUXER_TYPE_AVI_NI 4 -#define DEMUXER_TYPE_AVI_NINI 5 -#define DEMUXER_TYPE_ASF 6 -#define DEMUXER_TYPE_AUDIO 17 -#define DEMUXER_TYPE_MPEG4_ES 27 -#define DEMUXER_TYPE_MPEG_TS 29 -#define DEMUXER_TYPE_H264_ES 30 -#define DEMUXER_TYPE_MATROSKA 31 -#define DEMUXER_TYPE_MPEG_PES 41 - -// DEMUXER control commands/answers -#define DEMUXER_CTRL_NOTIMPL -1 -#define DEMUXER_CTRL_DONTKNOW 0 -#define DEMUXER_CTRL_OK 1 -#define DEMUXER_CTRL_GUESS 2 -#define DEMUXER_CTRL_GET_TIME_LENGTH 10 -#define DEMUXER_CTRL_GET_PERCENT_POS 11 -#define DEMUXER_CTRL_SWITCH_AUDIO 12 -#define DEMUXER_CTRL_RESYNC 13 -#define DEMUXER_CTRL_SWITCH_VIDEO 14 -#define DEMUXER_CTRL_IDENTIFY_PROGRAM 15 - -#define SEEK_ABSOLUTE (1 << 0) -#define SEEK_FACTOR (1 << 1) - -#define MP_NOPTS_VALUE (-1LL<<63) //both int64_t and double should be able to represent this exactly -// Holds one packet/frame/whatever -typedef struct demux_packet_st -{ - int len; - double pts; - double endpts; - double stream_pts; - off_t pos; // position in index (AVI) or file (MPG) - unsigned char *buffer; - int flags; // keyframe, etc - int refcount; //refcounter for the master packet, if 0, buffer can be free()d - struct demux_packet_st *master; //pointer to the master packet if this one is a cloned one - struct demux_packet_st *next; -} demux_packet_t; - -typedef struct -{ - int buffer_pos; // current buffer position - int buffer_size; // current buffer size - unsigned char *buffer; // current buffer, never free() it, always use free_demux_packet(buffer_ref); - double pts; // current buffer's pts - int pts_bytes; // number of bytes read after last pts stamp - int eof; // end of demuxed stream? (true if all buffer empty) - off_t pos; // position in the input stream (file) - off_t dpos; // position in the demuxed stream - int pack_no; // serial number of packet - int flags; // flags of current packet (keyframe etc) -//--------------- - int packs; // number of packets in buffer - int bytes; // total bytes of packets in buffer - demux_packet_t *first; // read to current buffer from here - demux_packet_t *last; // append new packets from input stream to here - demux_packet_t *current;// needed for refcounting of the buffer - int id; // stream ID (for multiple audio/video streams) - struct demuxer_st *demuxer; // parent demuxer structure (stream handler) -// ---- asf ----- - demux_packet_t *asf_packet; // read asf fragments here - int asf_seq; -// ---- mov ----- - unsigned int ss_mul, ss_div; -// ---- stream header ---- - void *sh; -} demux_stream_t; -#define MAX_A_STREAMS 256 -#define MAX_V_STREAMS 256 -#define MAX_S_STREAMS 32 - -struct demuxer_st; - -extern int correct_pts; - -/** - * Demuxer description structure - */ -typedef struct demuxers_desc_st -{ - const char *info; ///< What is it (long name and/or description) - const char *name; ///< Demuxer name, used with -demuxer switch - const char *shortdesc; ///< Description printed at demuxer detection - const char *author; ///< Demuxer author(s) - const char *comment; ///< Comment, printed with -demuxer help - - int type; ///< DEMUXER_TYPE_xxx - int safe_check; ///< If 1 detection is safe and fast, do it before file extension check - - /// Check if can demux the file, return DEMUXER_TYPE_xxx on success - int (*check_file)(struct demuxer_st *demuxer); ///< Mandatory if safe_check == 1, else optional - /// Get packets from file, return 0 on eof - int (*fill_buffer)(struct demuxer_st *demuxer, demux_stream_t *ds); ///< Mandatory - /// Open the demuxer, return demuxer on success, NULL on failure - struct demuxer_st *(*open)(struct demuxer_st *demuxer); ///< Optional - /// Close the demuxer - void (*close)(struct demuxer_st *demuxer); ///< Optional - // Seek - void (*seek)(struct demuxer_st *demuxer, float rel_seek_secs, float audio_delay, int flags); ///< Optional - // Control - int (*control)(struct demuxer_st *demuxer, int cmd, void *arg); ///< Optional -} demuxer_desc_t; - -typedef struct demux_chapter_s -{ - uint64_t start, end; - char *name; -} demux_chapter_t; - -typedef struct demuxer_st -{ - demuxer_desc_t *desc; ///< Demuxer description structure - off_t filepos; // input stream current pos. - off_t movi_start; - off_t movi_end; - stream_t *stream; - double stream_pts; // current stream pts, if applicable (e.g. dvd) - char *filename; ///< Needed by avs_check_file - int synced; // stream synced (used by mpeg) - int type; // demuxer type: mpeg PS, mpeg ES, avi, avi-ni, avi-nini, asf - int file_format; // file format: mpeg/avi/asf - int seekable; // flag - // - demux_stream_t *audio; // audio buffer/demuxer - demux_stream_t *video; // video buffer/demuxer - demux_stream_t *sub; // dvd subtitle buffer/demuxer - - // stream headers: - void *a_streams[MAX_A_STREAMS]; // audio streams (sh_audio_t) - void *v_streams[MAX_V_STREAMS]; // video sterams (sh_video_t) - void *s_streams[MAX_S_STREAMS]; // dvd subtitles (flag) - - demux_chapter_t *chapters; - int num_chapters; - - void *priv; // fileformat-dependent data - char **info; - -} demuxer_t; - -typedef struct -{ - int progid; //program id - int aid, vid, sid; //audio, video and subtitle id -} demux_program_t; - -static inline demux_packet_t *new_demux_packet(int len) -{ - demux_packet_t *dp = (demux_packet_t *)malloc(sizeof(demux_packet_t)); - dp->len = len; - dp->next = NULL; - // still using 0 by default in case there is some code that uses 0 for both - // unknown and a valid pts value - dp->pts = correct_pts ? MP_NOPTS_VALUE : 0; - dp->endpts = MP_NOPTS_VALUE; - dp->stream_pts = MP_NOPTS_VALUE; - dp->pos = 0; - dp->flags = 0; - dp->refcount = 1; - dp->master = NULL; - dp->buffer = NULL; - if (len > 0 && (dp->buffer = (unsigned char *)malloc(len + 8))) - memset(dp->buffer + len, 0, 8); - else - dp->len = 0; - return dp; -} - -static inline void resize_demux_packet(demux_packet_t *dp, int len) -{ - if (len > 0) - { - dp->buffer = (unsigned char *)realloc(dp->buffer, len + 8); - } - else - { - free(dp->buffer); - dp->buffer = NULL; - } - dp->len = len; - if (dp->buffer) - memset(dp->buffer + len, 0, 8); - else - dp->len = 0; -} - -static inline void free_demux_packet(demux_packet_t *dp) -{ - if (dp != NULL) - { - if (dp->master == NULL) //dp is a master packet - { - dp->refcount--; - if (dp->refcount == 0) - { - free(dp->buffer); - dp->buffer = NULL; - free(dp); - dp = NULL; - } - } - else // dp is a clone - { - free_demux_packet(dp->master); - free(dp); - dp = NULL; - } - } -} - -static inline int avi_stream_id(unsigned int id) -{ - unsigned char *p = (unsigned char *)&id; - unsigned char a, b; -#if WORDS_BIGENDIAN - a = p[3] - '0'; - b = p[2] - '0'; -#else - a = p[0] - '0'; - b = p[1] - '0'; -#endif - if (a > 9 || b > 9) return 100; // invalid ID - return a * 10 + b; -} -#ifndef SIZE_MAX -#define SIZE_MAX ((size_t)-1) -#endif - -static inline void *realloc_struct(void *ptr, size_t nmemb, size_t size) -{ - if (nmemb > SIZE_MAX / size) - { - free(ptr); - return NULL; - } - return realloc(ptr, nmemb * size); -} - -extern char *dvdsub_lang; -extern char *audio_lang; -extern int dvdsub_id; - -static inline int ds_tell_pts(demux_stream_t *ds) -{ - return (ds->pts_bytes - ds->buffer_size) + ds->buffer_pos; -} - -#if 1 -#define demux_getc(ds) (\ - (likely(ds->buffer_posbuffer_size)) ? ds->buffer[ds->buffer_pos++] \ - :((unlikely(!ds_fill_buffer(ds)))? (-1) : ds->buffer[ds->buffer_pos++] ) ) -#else -static inline int demux_getc(demux_stream_t *ds) -{ - if (ds->buffer_pos >= ds->buffer_size) - { - if (!ds_fill_buffer(ds)) - { -// printf("DEMUX_GETC: EOF reached!\n"); - return -1; // EOF - } - } -// printf("[%02X]",ds->buffer[ds->buffer_pos]); - return ds->buffer[ds->buffer_pos++]; -} -#endif - -void free_sh_audio(demuxer_t *demuxer, int id); -void ds_add_packet(demux_stream_t *ds, demux_packet_t *dp); -int demux_fill_buffer(demuxer_t *demux, demux_stream_t *ds); -int ds_fill_buffer(demux_stream_t *ds); -int ds_fill_buffer2(demux_stream_t *ds, demux_stream_t *demuxer); //for avi and mpg -int demux_read_data(demux_stream_t *ds, unsigned char *mem, int len); -int demuxer_add_chapter(demuxer_t *demuxer, const char *name, uint64_t start, uint64_t end); -int demuxer_sub_track_by_lang(demuxer_t *d, char *lang); -void ds_read_packet(demux_stream_t *ds, stream_t *stream, int len, double pts, off_t pos, int flags); -void ds_free_packs(demux_stream_t *ds); -int demux_info_add(demuxer_t *demuxer, const char *opt, const char *param); -void demux_flush(demuxer_t *demuxer); - -#endif //DEMUXER_H diff --git a/libeplayer2/container/genres.h b/libeplayer2/container/genres.h deleted file mode 100644 index 3d4c6f0..0000000 --- a/libeplayer2/container/genres.h +++ /dev/null @@ -1,294 +0,0 @@ -/*********************************** - * Copyright (C) 2001 Jason Carter - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - *********************************** - * FILE: GENRES.H - * NAME: ID3EDIT - ID3 tag v 1.1 editor - * DESCRIPTION: Genres character array - * AUTHOR: Jason Carter - *********************************** - * - * Initially modified for use with MPlayer by Diego Biurrun on 2004-08-22 - * $Id: genres.h 28283 2009-01-09 10:14:03Z diego $ - * detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ - */ - -#ifndef EPLAYER_GENRES_H -#define EPLAYER_GENRES_H - - -const char *const genres[] = -{ - "Blues", /* 0 */ - "Classic Rock", /* 1 */ - "Country", /* 2 */ - "Dance", /* 3 */ - "Disco", /* 4 */ - "Funk", /* 5 */ - "Grunge", /* 6 */ - "Hip-Hop", /* 7 */ - "Jazz", /* 8 */ - "Metal", /* 9 */ - "New Age", /* 10 */ - "Oldies", /* 11 */ - "Other", /* 12 */ - "Pop", /* 13 */ - "R&B", /* 14 */ - "Rap", /* 15 */ - "Reggae", /* 16 */ - "Rock", /* 17 */ - "Techno", /* 18 */ - "Industrial", /* 19 */ - "Alternative", /* 20 */ - "Ska", /* 21 */ - "Death Metal", /* 22 */ - "Pranks", /* 23 */ - "Soundtrack", /* 24 */ - "Eurotechno", /* 25 */ - "Ambient", /* 26 */ - "Trip-Hop", /* 27 */ - "Vocal", /* 28 */ - "Jazz+Funk", /* 29 */ - "Fusion", /* 30 */ - "Trance", /* 31 */ - "Classical", /* 32 */ - "Instrumental", /* 33 */ - "Acid", /* 34 */ - "House", /* 35 */ - "Game", /* 36 */ - "Sound Clip", /* 37 */ - "Gospel", /* 38 */ - "Noise", /* 39 */ - "Alternative Rock", /* 40 */ - "Bass", /* 41 */ - "Soul", /* 42 */ - "Punk", /* 43 */ - "Space", /* 44 */ - "Meditative", /* 45 */ - "Instrumental Pop", /* 46 */ - "Instrumental Rock", /* 47 */ - "Ethnic", /* 48 */ - "Gothic", /* 49 */ - "Darkwave", /* 50 */ - "Techno-Industrial", /* 51 */ - "Electronic", /* 52 */ - "Pop-Folk", /* 53 */ - "Eurodance", /* 54 */ - "Dream", /* 55 */ - "Southern Rock", /* 56 */ - "Comedy", /* 57 */ - "Cult", /* 58 */ - "Gangsta", /* 59 */ - "Top 40", /* 60 */ - "Christian Rap", /* 61 */ - "Pop/Funk", /* 62 */ - "Jungle", /* 63 */ - "Native American", /* 64 */ - "Cabaret", /* 65 */ - "New Wave", /* 66 */ - "Psychadelic", /* 67 */ - "Rave", /* 68 */ - "Show Tunes", /* 69 */ - "Trailer", /* 70 */ - "Lo-Fi", /* 71 */ - "Tribal", /* 72 */ - "Acid Punk", /* 73 */ - "Acid Jazz", /* 74 */ - "Polka", /* 75 */ - "Retro", /* 76 */ - "Musical", /* 77 */ - "Rock & Roll", /* 78 */ - "Hard Rock", /* 79 */ - "Folk", /* 80 */ - "Folk/Rock", /* 81 */ - "National Folk", /* 82 */ - "Swing", /* 83 */ - "Fast-Fusion", /* 84 */ - "Bebop", /* 85 */ - "Latin", /* 86 */ - "Revival", /* 87 */ - "Celtic", /* 88 */ - "Bluegrass", /* 89 */ - "Avantgarde", /* 90 */ - "Gothic Rock", /* 91 */ - "Progressive Rock", /* 92 */ - "Psychedelic Rock", /* 93 */ - "Symphonic Rock", /* 94 */ - "Slow Rock", /* 95 */ - "Big Band", /* 96 */ - "Chorus", /* 97 */ - "Easy Listening", /* 98 */ - "Acoustic", /* 99 */ - "Humour", /* 100 */ - "Speech", /* 101 */ - "Chanson", /* 102 */ - "Opera", /* 103 */ - "Chamber Music", /* 104 */ - "Sonata", /* 105 */ - "Symphony", /* 106 */ - "Booty Bass", /* 107 */ - "Primus", /* 108 */ - "Porn Groove", /* 109 */ - "Satire", /* 110 */ - "Slow Jam", /* 111 */ - "Club", /* 112 */ - "Tango", /* 113 */ - "Samba", /* 114 */ - "Folklore", /* 115 */ - "Ballad", /* 116 */ - "Power Ballad", /* 117 */ - "Rhytmic Soul", /* 118 */ - "Freestyle", /* 119 */ - "Duet", /* 120 */ - "Punk Rock", /* 121 */ - "Drum Solo", /* 122 */ - "Acapella", /* 123 */ - "Euro-House", /* 124 */ - "Dance Hall", /* 125 */ - "Goa", /* 126 */ - "Drum & Bass", /* 127 */ - "Club-House", /* 128 */ - "Hardcore", /* 129 */ - "Terror", /* 130 */ - "Indie", /* 131 */ - "BritPop", /* 132 */ - "Negerpunk", /* 133 */ - "Polsk Punk", /* 134 */ - "Beat", /* 135 */ - "Christian Gangsta Rap", /* 136 */ - "Heavy Metal", /* 137 */ - "Black Metal", /* 138 */ - "Crossover", /* 139 */ - "Contemporary Christian", /* 140 */ - "Christian Rock", /* 141 */ - "Merengue", /* 142 */ - "Salsa", /* 143 */ - "Thrash Metal", /* 144 */ - "Anime", /* 145 */ - "Jpop", /* 146 */ - "Synthpop", /* 147 */ - "Unknown", /* 148 */ - "Unknown", /* 149 */ - "Unknown", /* 150 */ - "Unknown", /* 151 */ - "Unknown", /* 152 */ - "Unknown", /* 153 */ - "Unknown", /* 154 */ - "Unknown", /* 155 */ - "Unknown", /* 156 */ - "Unknown", /* 157 */ - "Unknown", /* 158 */ - "Unknown", /* 159 */ - "Unknown", /* 160 */ - "Unknown", /* 161 */ - "Unknown", /* 162 */ - "Unknown", /* 163 */ - "Unknown", /* 164 */ - "Unknown", /* 165 */ - "Unknown", /* 166 */ - "Unknown", /* 167 */ - "Unknown", /* 168 */ - "Unknown", /* 169 */ - "Unknown", /* 170 */ - "Unknown", /* 171 */ - "Unknown", /* 172 */ - "Unknown", /* 173 */ - "Unknown", /* 174 */ - "Unknown", /* 175 */ - "Unknown", /* 176 */ - "Unknown", /* 177 */ - "Unknown", /* 178 */ - "Unknown", /* 179 */ - "Unknown", /* 180 */ - "Unknown", /* 181 */ - "Unknown", /* 182 */ - "Unknown", /* 183 */ - "Unknown", /* 184 */ - "Unknown", /* 185 */ - "Unknown", /* 186 */ - "Unknown", /* 187 */ - "Unknown", /* 188 */ - "Unknown", /* 189 */ - "Unknown", /* 190 */ - "Unknown", /* 191 */ - "Unknown", /* 192 */ - "Unknown", /* 193 */ - "Unknown", /* 194 */ - "Unknown", /* 195 */ - "Unknown", /* 196 */ - "Unknown", /* 197 */ - "Unknown", /* 198 */ - "Unknown", /* 199 */ - "Unknown", /* 200 */ - "Unknown", /* 201 */ - "Unknown", /* 202 */ - "Unknown", /* 203 */ - "Unknown", /* 204 */ - "Unknown", /* 205 */ - "Unknown", /* 206 */ - "Unknown", /* 207 */ - "Unknown", /* 208 */ - "Unknown", /* 209 */ - "Unknown", /* 210 */ - "Unknown", /* 211 */ - "Unknown", /* 212 */ - "Unknown", /* 213 */ - "Unknown", /* 214 */ - "Unknown", /* 215 */ - "Unknown", /* 216 */ - "Unknown", /* 217 */ - "Unknown", /* 218 */ - "Unknown", /* 219 */ - "Unknown", /* 220 */ - "Unknown", /* 221 */ - "Unknown", /* 222 */ - "Unknown", /* 223 */ - "Unknown", /* 224 */ - "Unknown", /* 225 */ - "Unknown", /* 226 */ - "Unknown", /* 227 */ - "Unknown", /* 228 */ - "Unknown", /* 229 */ - "Unknown", /* 230 */ - "Unknown", /* 231 */ - "Unknown", /* 232 */ - "Unknown", /* 233 */ - "Unknown", /* 234 */ - "Unknown", /* 235 */ - "Unknown", /* 236 */ - "Unknown", /* 237 */ - "Unknown", /* 238 */ - "Unknown", /* 239 */ - "Unknown", /* 240 */ - "Unknown", /* 241 */ - "Unknown", /* 242 */ - "Unknown", /* 243 */ - "Unknown", /* 244 */ - "Unknown", /* 245 */ - "Unknown", /* 246 */ - "Unknown", /* 247 */ - "Unknown", /* 248 */ - "Unknown", /* 249 */ - "Unknown", /* 250 */ - "Unknown", /* 251 */ - "Unknown", /* 252 */ - "Unknown", /* 253 */ - "Unknown", /* 254 */ - "Unknown", /* 255 */ -}; - -#endif /* EPLAYER_GENRES_H */ diff --git a/libeplayer2/container/help_mp-en.h b/libeplayer2/container/help_mp-en.h deleted file mode 100644 index b5a021c..0000000 --- a/libeplayer2/container/help_mp-en.h +++ /dev/null @@ -1,2118 +0,0 @@ -// $Revision: 30515 $ -// MASTER FILE. Use this file as base for translations. -// Translated files should be sent to the mplayer-DOCS mailing list or -// to the help messages maintainer, see DOCS/tech/MAINTAINERS. -// The header of the translated file should contain credits and contact -// information. Before major releases we will notify all translators to update -// their files. Please do not simply translate and forget this, outdated -// translations quickly become worthless. To help us spot outdated files put a -// note like "sync'ed with help_mp-en.h XXX" in the header of the translation. -// Do NOT translate the above lines, just follow the instructions. - - -// ========================= MPlayer help =========================== - -#ifdef HELP_MP_DEFINE_STATIC -static const char help_text[] = - "Usage: mplayer [options] [url|path/]filename\n" - "\n" - "Basic options: (complete list in the man page)\n" - " -vo select video output driver ('-vo help' for a list)\n" - " -ao select audio output driver ('-ao help' for a list)\n" -#ifdef CONFIG_VCD - " vcd:// play (S)VCD (Super Video CD) track (raw device, no mount)\n" -#endif -#ifdef CONFIG_DVDREAD - " dvd:// play DVD title from device instead of plain file\n" -#endif - " -alang/-slang select DVD audio/subtitle language (by 2-char country code)\n" - " -ss seek to given (seconds or hh:mm:ss) position\n" - " -nosound do not play sound\n" - " -fs fullscreen playback (or -vm, -zoom, details in the man page)\n" - " -x -y set display resolution (for use with -vm or -zoom)\n" - " -sub specify subtitle file to use (also see -subfps, -subdelay)\n" - " -playlist specify playlist file\n" - " -vid x -aid y select video (x) and audio (y) stream to play\n" - " -fps x -srate y change video (x fps) and audio (y Hz) rate\n" - " -pp enable postprocessing filter (details in the man page)\n" - " -framedrop enable frame dropping (for slow machines)\n" - "\n" - "Basic keys: (complete list in the man page, also check input.conf)\n" - " <- or -> seek backward/forward 10 seconds\n" - " down or up seek backward/forward 1 minute\n" - " pgdown or pgup seek backward/forward 10 minutes\n" - " < or > step backward/forward in playlist\n" - " p or SPACE pause movie (press any key to continue)\n" - " q or ESC stop playing and quit program\n" - " + or - adjust audio delay by +/- 0.1 second\n" - " o cycle OSD mode: none / seekbar / seekbar + timer\n" - " * or / increase or decrease PCM volume\n" - " x or z adjust subtitle delay by +/- 0.1 second\n" - " r or t adjust subtitle position up/down, also see -vf expand\n" - "\n" - " * * * SEE THE MAN PAGE FOR DETAILS, FURTHER (ADVANCED) OPTIONS AND KEYS * * *\n" - "\n"; -#endif - -// ========================= MPlayer messages =========================== - -// mplayer.c -#define MSGTR_Exiting "\nExiting...\n" -#define MSGTR_ExitingHow "\nExiting... (%s)\n" -#define MSGTR_Exit_quit "Quit" -#define MSGTR_Exit_eof "End of file" -#define MSGTR_Exit_error "Fatal error" -#define MSGTR_IntBySignal "\nMPlayer interrupted by signal %d in module: %s\n" -#define MSGTR_NoHomeDir "Cannot find HOME directory.\n" -#define MSGTR_GetpathProblem "get_path(\"config\") problem\n" -#define MSGTR_CreatingCfgFile "Creating config file: %s\n" -#define MSGTR_BuiltinCodecsConf "Using built-in default codecs.conf.\n" -#define MSGTR_CantLoadFont "Cannot load bitmap font: %s\n" -#define MSGTR_CantLoadSub "Cannot load subtitles: %s\n" -#define MSGTR_DumpSelectedStreamMissing "dump: FATAL: Selected stream missing!\n" -#define MSGTR_CantOpenDumpfile "Cannot open dump file.\n" -#define MSGTR_CoreDumped "Core dumped ;)\n" -#define MSGTR_FPSnotspecified "FPS not specified in the header or invalid, use the -fps option.\n" -#define MSGTR_TryForceAudioFmtStr "Trying to force audio codec driver family %s...\n" -#define MSGTR_CantFindAudioCodec "Cannot find codec for audio format 0x%X.\n" -#define MSGTR_TryForceVideoFmtStr "Trying to force video codec driver family %s...\n" -#define MSGTR_CantFindVideoCodec "Cannot find codec matching selected -vo and video format 0x%X.\n" -#define MSGTR_CannotInitVO "FATAL: Cannot initialize video driver.\n" -#define MSGTR_CannotInitAO "Could not open/initialize audio device -> no sound.\n" -#define MSGTR_StartPlaying "Starting playback...\n" - -#define MSGTR_SystemTooSlow "\n\n"\ - " ************************************************\n"\ - " **** Your system is too SLOW to play this! ****\n"\ - " ************************************************\n\n"\ - "Possible reasons, problems, workarounds:\n"\ - "- Most common: broken/buggy _audio_ driver\n"\ - " - Try -ao sdl or use the OSS emulation of ALSA.\n"\ - " - Experiment with different values for -autosync, 30 is a good start.\n"\ - "- Slow video output\n"\ - " - Try a different -vo driver (-vo help for a list) or try -framedrop!\n"\ - "- Slow CPU\n"\ - " - Don't try to play a big DVD/DivX on a slow CPU! Try some of the lavdopts,\n"\ - " e.g. -vfm ffmpeg -lavdopts lowres=1:fast:skiploopfilter=all.\n"\ - "- Broken file\n"\ - " - Try various combinations of -nobps -ni -forceidx -mc 0.\n"\ - "- Slow media (NFS/SMB mounts, DVD, VCD etc)\n"\ - " - Try -cache 8192.\n"\ - "- Are you using -cache to play a non-interleaved AVI file?\n"\ - " - Try -nocache.\n"\ - "Read DOCS/HTML/en/video.html for tuning/speedup tips.\n"\ - "If none of this helps you, read DOCS/HTML/en/bugreports.html.\n\n" - -#define MSGTR_NoGui "MPlayer was compiled WITHOUT GUI support.\n" -#define MSGTR_GuiNeedsX "MPlayer GUI requires X11.\n" -#define MSGTR_Playing "\nPlaying %s.\n" -#define MSGTR_NoSound "Audio: no sound\n" -#define MSGTR_FPSforced "FPS forced to be %5.3f (ftime: %5.3f).\n" -#define MSGTR_CompiledWithRuntimeDetection "Compiled with runtime CPU detection.\n" -#define MSGTR_CompiledWithCPUExtensions "Compiled for x86 CPU with extensions:" -#define MSGTR_AvailableVideoOutputDrivers "Available video output drivers:\n" -#define MSGTR_AvailableAudioOutputDrivers "Available audio output drivers:\n" -#define MSGTR_AvailableAudioCodecs "Available audio codecs:\n" -#define MSGTR_AvailableVideoCodecs "Available video codecs:\n" -#define MSGTR_AvailableAudioFm "Available (compiled-in) audio codec families/drivers:\n" -#define MSGTR_AvailableVideoFm "Available (compiled-in) video codec families/drivers:\n" -#define MSGTR_AvailableFsType "Available fullscreen layer change modes:\n" -#define MSGTR_UsingRTCTiming "Using Linux hardware RTC timing (%ldHz).\n" -#define MSGTR_CannotReadVideoProperties "Video: Cannot read properties.\n" -#define MSGTR_NoStreamFound "No stream found.\n" -#define MSGTR_ErrorInitializingVODevice "Error opening/initializing the selected video_out (-vo) device.\n" -#define MSGTR_ForcedVideoCodec "Forced video codec: %s\n" -#define MSGTR_ForcedAudioCodec "Forced audio codec: %s\n" -#define MSGTR_Video_NoVideo "Video: no video\n" -#define MSGTR_NotInitializeVOPorVO "\nFATAL: Could not initialize video filters (-vf) or video output (-vo).\n" -#define MSGTR_Paused "\n ===== PAUSE =====\r" // no more than 23 characters (status line for audio files) -#define MSGTR_PlaylistLoadUnable "\nUnable to load playlist %s.\n" -#define MSGTR_Exit_SIGILL_RTCpuSel \ - "- MPlayer crashed by an 'Illegal Instruction'.\n"\ - " It may be a bug in our new runtime CPU-detection code...\n"\ - " Please read DOCS/HTML/en/bugreports.html.\n" -#define MSGTR_Exit_SIGILL \ - "- MPlayer crashed by an 'Illegal Instruction'.\n"\ - " It usually happens when you run it on a CPU different than the one it was\n"\ - " compiled/optimized for.\n"\ - " Verify this!\n" -#define MSGTR_Exit_SIGSEGV_SIGFPE \ - "- MPlayer crashed by bad usage of CPU/FPU/RAM.\n"\ - " Recompile MPlayer with --enable-debug and make a 'gdb' backtrace and\n"\ - " disassembly. Details in DOCS/HTML/en/bugreports_what.html#bugreports_crash.\n" -#define MSGTR_Exit_SIGCRASH \ - "- MPlayer crashed. This shouldn't happen.\n"\ - " It can be a bug in the MPlayer code _or_ in your drivers _or_ in your\n"\ - " gcc version. If you think it's MPlayer's fault, please read\n"\ - " DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and\n"\ - " won't help unless you provide this information when reporting a possible bug.\n" -#define MSGTR_LoadingConfig "Loading config '%s'\n" -#define MSGTR_LoadingProtocolProfile "Loading protocol-related profile '%s'\n" -#define MSGTR_LoadingExtensionProfile "Loading extension-related profile '%s'\n" -#define MSGTR_AddedSubtitleFile "SUB: Added subtitle file (%d): %s\n" -#define MSGTR_RemovedSubtitleFile "SUB: Removed subtitle file (%d): %s\n" -#define MSGTR_ErrorOpeningOutputFile "Error opening file [%s] for writing!\n" -#define MSGTR_CommandLine "CommandLine:" -#define MSGTR_RTCDeviceNotOpenable "Failed to open %s: %s (it should be readable by the user.)\n" -#define MSGTR_LinuxRTCInitErrorIrqpSet "Linux RTC init error in ioctl (rtc_irqp_set %lu): %s\n" -#define MSGTR_IncreaseRTCMaxUserFreq "Try adding \"echo %lu > /proc/sys/dev/rtc/max-user-freq\" to your system startup scripts.\n" -#define MSGTR_LinuxRTCInitErrorPieOn "Linux RTC init error in ioctl (rtc_pie_on): %s\n" -#define MSGTR_UsingTimingType "Using %s timing.\n" -#define MSGTR_NoIdleAndGui "The -idle option cannot be used with GMPlayer.\n" -#define MSGTR_MenuInitialized "Menu initialized: %s\n" -#define MSGTR_MenuInitFailed "Menu init failed.\n" -#define MSGTR_Getch2InitializedTwice "WARNING: getch2_init called twice!\n" -#define MSGTR_DumpstreamFdUnavailable "Cannot dump this stream - no file descriptor available.\n" -#define MSGTR_CantOpenLibmenuFilterWithThisRootMenu "Can't open libmenu video filter with root menu %s.\n" -#define MSGTR_AudioFilterChainPreinitError "Error at audio filter chain pre-init!\n" -#define MSGTR_LinuxRTCReadError "Linux RTC read error: %s\n" -#define MSGTR_SoftsleepUnderflow "Warning! Softsleep underflow!\n" -#define MSGTR_DvdnavNullEvent "DVDNAV Event NULL?!\n" -#define MSGTR_DvdnavHighlightEventBroken "DVDNAV Event: Highlight event broken\n" -#define MSGTR_DvdnavEvent "DVDNAV Event: %s\n" -#define MSGTR_DvdnavHighlightHide "DVDNAV Event: Highlight Hide\n" -#define MSGTR_DvdnavStillFrame "######################################## DVDNAV Event: Still Frame: %d sec(s)\n" -#define MSGTR_DvdnavNavStop "DVDNAV Event: Nav Stop\n" -#define MSGTR_DvdnavNavNOP "DVDNAV Event: Nav NOP\n" -#define MSGTR_DvdnavNavSpuStreamChangeVerbose "DVDNAV Event: Nav SPU Stream Change: phys: %d/%d/%d logical: %d\n" -#define MSGTR_DvdnavNavSpuStreamChange "DVDNAV Event: Nav SPU Stream Change: phys: %d logical: %d\n" -#define MSGTR_DvdnavNavAudioStreamChange "DVDNAV Event: Nav Audio Stream Change: phys: %d logical: %d\n" -#define MSGTR_DvdnavNavVTSChange "DVDNAV Event: Nav VTS Change\n" -#define MSGTR_DvdnavNavCellChange "DVDNAV Event: Nav Cell Change\n" -#define MSGTR_DvdnavNavSpuClutChange "DVDNAV Event: Nav SPU CLUT Change\n" -#define MSGTR_DvdnavNavSeekDone "DVDNAV Event: Nav Seek Done\n" -#define MSGTR_MenuCall "Menu call\n" - -// --- edit decision lists -#define MSGTR_EdlOutOfMem "Can't allocate enough memory to hold EDL data.\n" -#define MSGTR_EdlRecordsNo "Read %d EDL actions.\n" -#define MSGTR_EdlQueueEmpty "There are no EDL actions to take care of.\n" -#define MSGTR_EdlCantOpenForWrite "Can't open EDL file [%s] for writing.\n" -#define MSGTR_EdlCantOpenForRead "Can't open EDL file [%s] for reading.\n" -#define MSGTR_EdlNOsh_video "Cannot use EDL without video, disabling.\n" -#define MSGTR_EdlNOValidLine "Invalid EDL line: %s\n" -#define MSGTR_EdlBadlyFormattedLine "Badly formatted EDL line [%d], discarding.\n" -#define MSGTR_EdlBadLineOverlap "Last stop position was [%f]; next start is [%f].\n"\ - "Entries must be in chronological order, cannot overlap. Discarding.\n" -#define MSGTR_EdlBadLineBadStop "Stop time has to be after start time.\n" -#define MSGTR_EdloutBadStop "EDL skip canceled, last start > stop\n" -#define MSGTR_EdloutStartSkip "EDL skip start, press 'i' again to end block.\n" -#define MSGTR_EdloutEndSkip "EDL skip end, line written.\n" -#define MSGTR_MPEndposNoSizeBased "Option -endpos in MPlayer does not yet support size units.\n" - -// mplayer.c OSD -#define MSGTR_OSDenabled "enabled" -#define MSGTR_OSDdisabled "disabled" -#define MSGTR_OSDAudio "Audio: %s" -#define MSGTR_OSDVideo "Video: %s" -#define MSGTR_OSDChannel "Channel: %s" -#define MSGTR_OSDSubDelay "Sub delay: %d ms" -#define MSGTR_OSDSpeed "Speed: x %6.2f" -#define MSGTR_OSDosd "OSD: %s" -#define MSGTR_OSDChapter "Chapter: (%d) %s" -#define MSGTR_OSDAngle "Angle: %d/%d" -#define MSGTR_OSDDeinterlace "Deinterlace: %s" - -// property values -#define MSGTR_Enabled "enabled" -#define MSGTR_EnabledEdl "enabled (EDL)" -#define MSGTR_Disabled "disabled" -#define MSGTR_HardFrameDrop "hard" -#define MSGTR_Unknown "unknown" -#define MSGTR_Bottom "bottom" -#define MSGTR_Center "center" -#define MSGTR_Top "top" -#define MSGTR_SubSourceFile "file" -#define MSGTR_SubSourceVobsub "vobsub" -#define MSGTR_SubSourceDemux "embedded" - -// OSD bar names -#define MSGTR_Volume "Volume" -#define MSGTR_Panscan "Panscan" -#define MSGTR_Gamma "Gamma" -#define MSGTR_Brightness "Brightness" -#define MSGTR_Contrast "Contrast" -#define MSGTR_Saturation "Saturation" -#define MSGTR_Hue "Hue" -#define MSGTR_Balance "Balance" - -// property state -#define MSGTR_LoopStatus "Loop: %s" -#define MSGTR_MuteStatus "Mute: %s" -#define MSGTR_AVDelayStatus "A-V delay: %s" -#define MSGTR_OnTopStatus "Stay on top: %s" -#define MSGTR_RootwinStatus "Rootwin: %s" -#define MSGTR_BorderStatus "Border: %s" -#define MSGTR_FramedroppingStatus "Framedropping: %s" -#define MSGTR_VSyncStatus "VSync: %s" -#define MSGTR_SubSelectStatus "Subtitles: %s" -#define MSGTR_SubSourceStatus "Sub source: %s" -#define MSGTR_SubPosStatus "Sub position: %s/100" -#define MSGTR_SubAlignStatus "Sub alignment: %s" -#define MSGTR_SubDelayStatus "Sub delay: %s" -#define MSGTR_SubScale "Sub Scale: %s" -#define MSGTR_SubVisibleStatus "Subtitles: %s" -#define MSGTR_SubForcedOnlyStatus "Forced sub only: %s" - -// mencoder.c -#define MSGTR_UsingPass3ControlFile "Using pass3 control file: %s\n" -#define MSGTR_MissingFilename "\nFilename missing.\n\n" -#define MSGTR_CannotOpenFile_Device "Cannot open file/device.\n" -#define MSGTR_CannotOpenDemuxer "Cannot open demuxer.\n" -#define MSGTR_NoAudioEncoderSelected "\nNo audio encoder (-oac) selected. Select one (see -oac help) or use -nosound.\n" -#define MSGTR_NoVideoEncoderSelected "\nNo video encoder (-ovc) selected. Select one (see -ovc help).\n" -#define MSGTR_CannotOpenOutputFile "Cannot open output file '%s'.\n" -#define MSGTR_EncoderOpenFailed "Failed to open the encoder.\n" -#define MSGTR_MencoderWrongFormatAVI "\nWARNING: OUTPUT FILE FORMAT IS _AVI_. See -of help.\n" -#define MSGTR_MencoderWrongFormatMPG "\nWARNING: OUTPUT FILE FORMAT IS _MPEG_. See -of help.\n" -#define MSGTR_MissingOutputFilename "No output file specified, please see the -o option." -#define MSGTR_ForcingOutputFourcc "Forcing output FourCC to %x [%.4s].\n" -#define MSGTR_ForcingOutputAudiofmtTag "Forcing output audio format tag to 0x%x.\n" -#define MSGTR_DuplicateFrames "\n%d duplicate frame(s)!\n" -#define MSGTR_SkipFrame "\nSkipping frame!\n" -#define MSGTR_ResolutionDoesntMatch "\nNew video file has different resolution or colorspace than the previous one.\n" -#define MSGTR_FrameCopyFileMismatch "\nAll video files must have identical fps, resolution, and codec for -ovc copy.\n" -#define MSGTR_AudioCopyFileMismatch "\nAll files must have identical audio codec and format for -oac copy.\n" -#define MSGTR_NoAudioFileMismatch "\nCannot mix video-only files with audio and video files. Try -nosound.\n" -#define MSGTR_NoSpeedWithFrameCopy "WARNING: -speed is not guaranteed to work correctly with -oac copy!\n"\ - "Your encode might be broken!\n" -#define MSGTR_ErrorWritingFile "%s: Error writing file.\n" -#define MSGTR_FlushingVideoFrames "\nFlushing video frames.\n" -#define MSGTR_FiltersHaveNotBeenConfiguredEmptyFile "Filters have not been configured! Empty file?\n" -#define MSGTR_RecommendedVideoBitrate "Recommended video bitrate for %s CD: %d\n" -#define MSGTR_VideoStreamResult "\nVideo stream: %8.3f kbit/s (%d B/s) size: %"PRIu64" bytes %5.3f secs %d frames\n" -#define MSGTR_AudioStreamResult "\nAudio stream: %8.3f kbit/s (%d B/s) size: %"PRIu64" bytes %5.3f secs\n" -#define MSGTR_EdlSkipStartEndCurrent "EDL SKIP: Start: %.2f End: %.2f Current: V: %.2f A: %.2f \r" -#define MSGTR_OpenedStream "success: format: %d data: 0x%X - 0x%x\n" -#define MSGTR_VCodecFramecopy "videocodec: framecopy (%dx%d %dbpp fourcc=%x)\n" -#define MSGTR_ACodecFramecopy "audiocodec: framecopy (format=%x chans=%d rate=%d bits=%d B/s=%d sample-%d)\n" -#define MSGTR_CBRPCMAudioSelected "CBR PCM audio selected.\n" -#define MSGTR_MP3AudioSelected "MP3 audio selected.\n" -#define MSGTR_CannotAllocateBytes "Couldn't allocate %d bytes.\n" -#define MSGTR_SettingAudioDelay "Setting audio delay to %5.3fs.\n" -#define MSGTR_SettingVideoDelay "Setting video delay to %5.3fs.\n" -#define MSGTR_SettingAudioInputGain "Setting audio input gain to %f.\n" -#define MSGTR_LamePresetEquals "\npreset=%s\n\n" -#define MSGTR_LimitingAudioPreload "Limiting audio preload to 0.4s.\n" -#define MSGTR_IncreasingAudioDensity "Increasing audio density to 4.\n" -#define MSGTR_ZeroingAudioPreloadAndMaxPtsCorrection "Forcing audio preload to 0, max pts correction to 0.\n" -#define MSGTR_CBRAudioByterate "\n\nCBR audio: %d bytes/sec, %d bytes/block\n" -#define MSGTR_LameVersion "LAME version %s (%s)\n\n" -#define MSGTR_InvalidBitrateForLamePreset "Error: The bitrate specified is out of the valid range for this preset.\n"\ - "\n"\ - "When using this mode you must enter a value between \"8\" and \"320\".\n"\ - "\n"\ - "For further information try: \"-lameopts preset=help\"\n" -#define MSGTR_InvalidLamePresetOptions "Error: You did not enter a valid profile and/or options with preset.\n"\ - "\n"\ - "Available profiles are:\n"\ - "\n"\ - " standard\n"\ - " extreme\n"\ - " insane\n"\ - " (ABR Mode) - The ABR Mode is implied. To use it,\n"\ - " simply specify a bitrate. For example:\n"\ - " \"preset=185\" activates this\n"\ - " preset and uses 185 as an average kbps.\n"\ - "\n"\ - " Some examples:\n"\ - "\n"\ - " \"-lameopts fast:preset=standard \"\n"\ - " or \"-lameopts cbr:preset=192 \"\n"\ - " or \"-lameopts preset=172 \"\n"\ - " or \"-lameopts preset=extreme \"\n"\ - "\n"\ - "For further information try: \"-lameopts preset=help\"\n" -#define MSGTR_LamePresetsLongInfo "\n"\ - "The preset switches are designed to provide the highest possible quality.\n"\ - "\n"\ - "They have for the most part been subjected to and tuned via rigorous double\n"\ - "blind listening tests to verify and achieve this objective.\n"\ - "\n"\ - "These are continually updated to coincide with the latest developments that\n"\ - "occur and as a result should provide you with nearly the best quality\n"\ - "currently possible from LAME.\n"\ - "\n"\ - "To activate these presets:\n"\ - "\n"\ - " For VBR modes (generally highest quality):\n"\ - "\n"\ - " \"preset=standard\" This preset should generally be transparent\n"\ - " to most people on most music and is already\n"\ - " quite high in quality.\n"\ - "\n"\ - " \"preset=extreme\" If you have extremely good hearing and similar\n"\ - " equipment, this preset will generally provide\n"\ - " slightly higher quality than the \"standard\"\n"\ - " mode.\n"\ - "\n"\ - " For CBR 320kbps (highest quality possible from the preset switches):\n"\ - "\n"\ - " \"preset=insane\" This preset will usually be overkill for most\n"\ - " people and most situations, but if you must\n"\ - " have the absolute highest quality with no\n"\ - " regard to filesize, this is the way to go.\n"\ - "\n"\ - " For ABR modes (high quality per given bitrate but not as high as VBR):\n"\ - "\n"\ - " \"preset=\" Using this preset will usually give you good\n"\ - " quality at a specified bitrate. Depending on the\n"\ - " bitrate entered, this preset will determine the\n"\ - " optimal settings for that particular situation.\n"\ - " While this approach works, it is not nearly as\n"\ - " flexible as VBR, and usually will not attain the\n"\ - " same level of quality as VBR at higher bitrates.\n"\ - "\n"\ - "The following options are also available for the corresponding profiles:\n"\ - "\n"\ - " standard\n"\ - " extreme\n"\ - " insane\n"\ - " (ABR Mode) - The ABR Mode is implied. To use it,\n"\ - " simply specify a bitrate. For example:\n"\ - " \"preset=185\" activates this\n"\ - " preset and uses 185 as an average kbps.\n"\ - "\n"\ - " \"fast\" - Enables the new fast VBR for a particular profile. The\n"\ - " disadvantage to the speed switch is that often times the\n"\ - " bitrate will be slightly higher than with the normal mode\n"\ - " and quality may be slightly lower also.\n"\ - " Warning: with the current version fast presets might result in too\n"\ - " high bitrate compared to regular presets.\n"\ - "\n"\ - " \"cbr\" - If you use the ABR mode (read above) with a significant\n"\ - " bitrate such as 80, 96, 112, 128, 160, 192, 224, 256, 320,\n"\ - " you can use the \"cbr\" option to force CBR mode encoding\n"\ - " instead of the standard abr mode. ABR does provide higher\n"\ - " quality but CBR may be useful in situations such as when\n"\ - " streaming an MP3 over the internet may be important.\n"\ - "\n"\ - " For example:\n"\ - "\n"\ - " \"-lameopts fast:preset=standard \"\n"\ - " or \"-lameopts cbr:preset=192 \"\n"\ - " or \"-lameopts preset=172 \"\n"\ - " or \"-lameopts preset=extreme \"\n"\ - "\n"\ - "\n"\ - "A few aliases are available for ABR mode:\n"\ - "phone => 16kbps/mono phon+/lw/mw-eu/sw => 24kbps/mono\n"\ - "mw-us => 40kbps/mono voice => 56kbps/mono\n"\ - "fm/radio/tape => 112kbps hifi => 160kbps\n"\ - "cd => 192kbps studio => 256kbps" -#define MSGTR_LameCantInit \ - "Cannot set LAME options, check bitrate/samplerate, some very low bitrates\n"\ - "(<32) need lower samplerates (i.e. -srate 8000).\n"\ - "If everything else fails, try a preset." -#define MSGTR_ConfigFileError "config file error" -#define MSGTR_ErrorParsingCommandLine "error parsing command line" -#define MSGTR_VideoStreamRequired "Video stream is mandatory!\n" -#define MSGTR_ForcingInputFPS "Input fps will be interpreted as %5.3f instead.\n" -#define MSGTR_RawvideoDoesNotSupportAudio "Output file format RAWVIDEO does not support audio - disabling audio.\n" -#define MSGTR_DemuxerDoesntSupportNosound "This demuxer doesn't support -nosound yet.\n" -#define MSGTR_MemAllocFailed "Memory allocation failed.\n" -#define MSGTR_NoMatchingFilter "Couldn't find matching filter/ao format!\n" -#define MSGTR_MP3WaveFormatSizeNot30 "sizeof(MPEGLAYER3WAVEFORMAT)==%d!=30, maybe broken C compiler?\n" -#define MSGTR_NoLavcAudioCodecName "Audio LAVC, Missing codec name!\n" -#define MSGTR_LavcAudioCodecNotFound "Audio LAVC, couldn't find encoder for codec %s.\n" -#define MSGTR_CouldntAllocateLavcContext "Audio LAVC, couldn't allocate context!\n" -#define MSGTR_CouldntOpenCodec "Couldn't open codec %s, br=%d.\n" -#define MSGTR_CantCopyAudioFormat "Audio format 0x%x is incompatible with '-oac copy', please try '-oac pcm' instead or use '-fafmttag' to override it.\n" - -// cfg-mencoder.h -#define MSGTR_MEncoderMP3LameHelp "\n\n"\ - " vbr=<0-4> variable bitrate method\n"\ - " 0: cbr (constant bitrate)\n"\ - " 1: mt (Mark Taylor VBR algorithm)\n"\ - " 2: rh (Robert Hegemann VBR algorithm - default)\n"\ - " 3: abr (average bitrate)\n"\ - " 4: mtrh (Mark Taylor Robert Hegemann VBR algorithm)\n"\ - "\n"\ - " abr average bitrate\n"\ - "\n"\ - " cbr constant bitrate\n"\ - " Also forces CBR mode encoding on subsequent ABR presets modes.\n"\ - "\n"\ - " br=<0-1024> specify bitrate in kBit (CBR and ABR only)\n"\ - "\n"\ - " q=<0-9> quality (0-highest, 9-lowest) (only for VBR)\n"\ - "\n"\ - " aq=<0-9> algorithmic quality (0-best/slowest, 9-worst/fastest)\n"\ - "\n"\ - " ratio=<1-100> compression ratio\n"\ - "\n"\ - " vol=<0-10> set audio input gain\n"\ - "\n"\ - " mode=<0-3> (default: auto)\n"\ - " 0: stereo\n"\ - " 1: joint-stereo\n"\ - " 2: dualchannel\n"\ - " 3: mono\n"\ - "\n"\ - " padding=<0-2>\n"\ - " 0: no\n"\ - " 1: all\n"\ - " 2: adjust\n"\ - "\n"\ - " fast Switch on faster encoding on subsequent VBR presets modes,\n"\ - " slightly lower quality and higher bitrates.\n"\ - "\n"\ - " preset= Provide the highest possible quality settings.\n"\ - " medium: VBR encoding, good quality\n"\ - " (150-180 kbps bitrate range)\n"\ - " standard: VBR encoding, high quality\n"\ - " (170-210 kbps bitrate range)\n"\ - " extreme: VBR encoding, very high quality\n"\ - " (200-240 kbps bitrate range)\n"\ - " insane: CBR encoding, highest preset quality\n"\ - " (320 kbps bitrate)\n"\ - " <8-320>: ABR encoding at average given kbps bitrate.\n\n" - -// codec-cfg.c -#define MSGTR_DuplicateFourcc "duplicated FourCC" -#define MSGTR_TooManyFourccs "too many FourCCs/formats..." -#define MSGTR_ParseError "parse error" -#define MSGTR_ParseErrorFIDNotNumber "parse error (format ID not a number?)" -#define MSGTR_ParseErrorFIDAliasNotNumber "parse error (format ID alias not a number?)" -#define MSGTR_DuplicateFID "duplicated format ID" -#define MSGTR_TooManyOut "too many out..." -#define MSGTR_InvalidCodecName "\ncodec(%s) name is not valid!\n" -#define MSGTR_CodecLacksFourcc "\ncodec(%s) does not have FourCC/format!\n" -#define MSGTR_CodecLacksDriver "\ncodec(%s) does not have a driver!\n" -#define MSGTR_CodecNeedsDLL "\ncodec(%s) needs a 'dll'!\n" -#define MSGTR_CodecNeedsOutfmt "\ncodec(%s) needs an 'outfmt'!\n" -#define MSGTR_CantAllocateComment "Can't allocate memory for comment. " -#define MSGTR_GetTokenMaxNotLessThanMAX_NR_TOKEN "get_token(): max >= MAX_MR_TOKEN!" -#define MSGTR_ReadingFile "Reading %s: " -#define MSGTR_CantOpenFileError "Can't open '%s': %s\n" -#define MSGTR_CantGetMemoryForLine "Can't get memory for 'line': %s\n" -#define MSGTR_CantReallocCodecsp "Can't realloc '*codecsp': %s\n" -#define MSGTR_CodecNameNotUnique "Codec name '%s' isn't unique." -#define MSGTR_CantStrdupName "Can't strdup -> 'name': %s\n" -#define MSGTR_CantStrdupInfo "Can't strdup -> 'info': %s\n" -#define MSGTR_CantStrdupDriver "Can't strdup -> 'driver': %s\n" -#define MSGTR_CantStrdupDLL "Can't strdup -> 'dll': %s" -#define MSGTR_AudioVideoCodecTotals "%d audio & %d video codecs\n" -#define MSGTR_CodecDefinitionIncorrect "Codec is not defined correctly." -#define MSGTR_OutdatedCodecsConf "This codecs.conf is too old and incompatible with this MPlayer release!" - -// fifo.c -#define MSGTR_CannotMakePipe "Cannot make PIPE!\n" - -// parser-mecmd.c, parser-mpcmd.c -#define MSGTR_NoFileGivenOnCommandLine "'--' indicates no more options, but no filename was given on the command line.\n" -#define MSGTR_TheLoopOptionMustBeAnInteger "The loop option must be an integer: %s\n" -#define MSGTR_UnknownOptionOnCommandLine "Unknown option on the command line: -%s\n" -#define MSGTR_ErrorParsingOptionOnCommandLine "Error parsing option on the command line: -%s\n" -#define MSGTR_InvalidPlayEntry "Invalid play entry %s\n" -#define MSGTR_NotAnMEncoderOption "-%s is not an MEncoder option\n" -#define MSGTR_NoFileGiven "No file given\n" - -// m_config.c -#define MSGTR_SaveSlotTooOld "Save slot found from lvl %d is too old: %d !!!\n" -#define MSGTR_InvalidCfgfileOption "The %s option can't be used in a config file.\n" -#define MSGTR_InvalidCmdlineOption "The %s option can't be used on the command line.\n" -#define MSGTR_InvalidSuboption "Error: option '%s' has no suboption '%s'.\n" -#define MSGTR_MissingSuboptionParameter "Error: suboption '%s' of '%s' must have a parameter!\n" -#define MSGTR_MissingOptionParameter "Error: option '%s' must have a parameter!\n" -#define MSGTR_OptionListHeader "\n Name Type Min Max Global CL Cfg\n\n" -#define MSGTR_TotalOptions "\nTotal: %d options\n" -#define MSGTR_ProfileInclusionTooDeep "WARNING: Profile inclusion too deep.\n" -#define MSGTR_NoProfileDefined "No profiles have been defined.\n" -#define MSGTR_AvailableProfiles "Available profiles:\n" -#define MSGTR_UnknownProfile "Unknown profile '%s'.\n" -#define MSGTR_Profile "Profile %s: %s\n" - -// m_property.c -#define MSGTR_PropertyListHeader "\n Name Type Min Max\n\n" -#define MSGTR_TotalProperties "\nTotal: %d properties\n" - -// loader/ldt_keeper.c -#define MSGTR_LOADER_DYLD_Warning "WARNING: Attempting to use DLL codecs but environment variable\n DYLD_BIND_AT_LAUNCH not set. This will likely crash.\n" - - -// ====================== GUI messages/buttons ======================== - -// --- labels --- -#define MSGTR_About "About" -#define MSGTR_FileSelect "Select file..." -#define MSGTR_SubtitleSelect "Select subtitle..." -#define MSGTR_OtherSelect "Select..." -#define MSGTR_AudioFileSelect "Select external audio channel..." -#define MSGTR_FontSelect "Select font..." -// Note: If you change MSGTR_PlayList please see if it still fits MSGTR_MENU_PlayList -#define MSGTR_PlayList "Playlist" -#define MSGTR_Equalizer "Equalizer" -#define MSGTR_ConfigureEqualizer "Configure Equalizer" -#define MSGTR_SkinBrowser "Skin Browser" -#define MSGTR_Network "Network streaming..." -// Note: If you change MSGTR_Preferences please see if it still fits MSGTR_MENU_Preferences -#define MSGTR_Preferences "Preferences" -#define MSGTR_AudioPreferences "Audio driver configuration" -#define MSGTR_NoMediaOpened "No media opened." -#define MSGTR_VCDTrack "VCD track %d" -#define MSGTR_NoChapter "No chapter" -#define MSGTR_Chapter "Chapter %d" -#define MSGTR_NoFileLoaded "No file loaded." - -// --- buttons --- -#define MSGTR_Ok "OK" -#define MSGTR_Cancel "Cancel" -#define MSGTR_Add "Add" -#define MSGTR_Remove "Remove" -#define MSGTR_Clear "Clear" -#define MSGTR_Config "Config" -#define MSGTR_ConfigDriver "Configure driver" -#define MSGTR_Browse "Browse" - -// --- error messages --- -#define MSGTR_NEMDB "Sorry, not enough memory to draw buffer." -#define MSGTR_NEMFMR "Sorry, not enough memory for menu rendering." -#define MSGTR_IDFGCVD "Sorry, I did not find a GUI-compatible video output driver." -#define MSGTR_NEEDLAVC "Sorry, you cannot play non-MPEG files with your DXR3/H+ device without reencoding.\nPlease enable lavc in the DXR3/H+ configuration box." -#define MSGTR_UNKNOWNWINDOWTYPE "Unknown window type found ..." - -// --- skin loader error messages -#define MSGTR_SKIN_ERRORMESSAGE "[skin] error in skin config file on line %d: %s" -#define MSGTR_SKIN_WARNING1 "[skin] warning: in config file line %d:\nwidget (%s) found but no \"section\" found before" -#define MSGTR_SKIN_WARNING2 "[skin] warning: in config file line %d:\nwidget (%s) found but no \"subsection\" found before" -#define MSGTR_SKIN_WARNING3 "[skin] warning: in config file line %d:\nthis subsection is not supported by widget (%s)" -#define MSGTR_SKIN_SkinFileNotFound "[skin] file ( %s ) not found.\n" -#define MSGTR_SKIN_SkinFileNotReadable "[skin] file ( %s ) not readable.\n" -#define MSGTR_SKIN_BITMAP_16bit "Bitmaps of 16 bits or less depth not supported (%s).\n" -#define MSGTR_SKIN_BITMAP_FileNotFound "File not found (%s)\n" -#define MSGTR_SKIN_BITMAP_BMPReadError "BMP read error (%s)\n" -#define MSGTR_SKIN_BITMAP_TGAReadError "TGA read error (%s)\n" -#define MSGTR_SKIN_BITMAP_PNGReadError "PNG read error (%s)\n" -#define MSGTR_SKIN_BITMAP_RLENotSupported "RLE packed TGA not supported (%s)\n" -#define MSGTR_SKIN_BITMAP_UnknownFileType "unknown file type (%s)\n" -#define MSGTR_SKIN_BITMAP_ConversionError "24 bit to 32 bit conversion error (%s)\n" -#define MSGTR_SKIN_BITMAP_UnknownMessage "unknown message: %s\n" -#define MSGTR_SKIN_FONT_NotEnoughtMemory "not enough memory\n" -#define MSGTR_SKIN_FONT_TooManyFontsDeclared "Too many fonts declared.\n" -#define MSGTR_SKIN_FONT_FontFileNotFound "Font file not found.\n" -#define MSGTR_SKIN_FONT_FontImageNotFound "Font image file not found.\n" -#define MSGTR_SKIN_FONT_NonExistentFontID "non-existent font identifier (%s)\n" -#define MSGTR_SKIN_UnknownParameter "unknown parameter (%s)\n" -#define MSGTR_SKIN_SKINCFG_SkinNotFound "Skin not found (%s).\n" -#define MSGTR_SKIN_SKINCFG_SelectedSkinNotFound "Selected skin ( %s ) not found, trying 'default'...\n" -#define MSGTR_SKIN_SKINCFG_SkinCfgReadError "skin config file read error (%s)\n" -#define MSGTR_SKIN_LABEL "Skins:" - -// --- GTK menus -#define MSGTR_MENU_AboutMPlayer "About MPlayer" -#define MSGTR_MENU_Open "Open..." -#define MSGTR_MENU_PlayFile "Play file..." -#define MSGTR_MENU_PlayVCD "Play VCD..." -#define MSGTR_MENU_PlayDVD "Play DVD..." -#define MSGTR_MENU_PlayURL "Play URL..." -#define MSGTR_MENU_LoadSubtitle "Load subtitle..." -#define MSGTR_MENU_DropSubtitle "Drop subtitle..." -#define MSGTR_MENU_LoadExternAudioFile "Load external audio file..." -#define MSGTR_MENU_Playing "Playing" -#define MSGTR_MENU_Play "Play" -#define MSGTR_MENU_Pause "Pause" -#define MSGTR_MENU_Stop "Stop" -#define MSGTR_MENU_NextStream "Next stream" -#define MSGTR_MENU_PrevStream "Prev stream" -#define MSGTR_MENU_Size "Size" -#define MSGTR_MENU_HalfSize "Half size" -#define MSGTR_MENU_NormalSize "Normal size" -#define MSGTR_MENU_DoubleSize "Double size" -#define MSGTR_MENU_FullScreen "Fullscreen" -#define MSGTR_MENU_DVD "DVD" -#define MSGTR_MENU_VCD "VCD" -#define MSGTR_MENU_PlayDisc "Open disc..." -#define MSGTR_MENU_ShowDVDMenu "Show DVD menu" -#define MSGTR_MENU_Titles "Titles" -#define MSGTR_MENU_Title "Title %2d" -#define MSGTR_MENU_None "(none)" -#define MSGTR_MENU_Chapters "Chapters" -#define MSGTR_MENU_Chapter "Chapter %2d" -#define MSGTR_MENU_AudioLanguages "Audio languages" -#define MSGTR_MENU_SubtitleLanguages "Subtitle languages" -#define MSGTR_MENU_PlayList MSGTR_PlayList -#define MSGTR_MENU_SkinBrowser "Skin browser" -#define MSGTR_MENU_Preferences MSGTR_Preferences -#define MSGTR_MENU_Exit "Exit..." -#define MSGTR_MENU_Mute "Mute" -#define MSGTR_MENU_Original "Original" -#define MSGTR_MENU_AspectRatio "Aspect ratio" -#define MSGTR_MENU_AudioTrack "Audio track" -#define MSGTR_MENU_Track "Track %d" -#define MSGTR_MENU_VideoTrack "Video track" -#define MSGTR_MENU_Subtitles "Subtitles" - -// --- equalizer -// Note: If you change MSGTR_EQU_Audio please see if it still fits MSGTR_PREFERENCES_Audio -#define MSGTR_EQU_Audio "Audio" -// Note: If you change MSGTR_EQU_Video please see if it still fits MSGTR_PREFERENCES_Video -#define MSGTR_EQU_Video "Video" -#define MSGTR_EQU_Contrast "Contrast: " -#define MSGTR_EQU_Brightness "Brightness: " -#define MSGTR_EQU_Hue "Hue: " -#define MSGTR_EQU_Saturation "Saturation: " -#define MSGTR_EQU_Front_Left "Front Left" -#define MSGTR_EQU_Front_Right "Front Right" -#define MSGTR_EQU_Back_Left "Rear Left" -#define MSGTR_EQU_Back_Right "Rear Right" -#define MSGTR_EQU_Center "Center" -#define MSGTR_EQU_Bass "Bass" -#define MSGTR_EQU_All "All" -#define MSGTR_EQU_Channel1 "Channel 1:" -#define MSGTR_EQU_Channel2 "Channel 2:" -#define MSGTR_EQU_Channel3 "Channel 3:" -#define MSGTR_EQU_Channel4 "Channel 4:" -#define MSGTR_EQU_Channel5 "Channel 5:" -#define MSGTR_EQU_Channel6 "Channel 6:" - -// --- playlist -#define MSGTR_PLAYLIST_Path "Path" -#define MSGTR_PLAYLIST_Selected "Selected files" -#define MSGTR_PLAYLIST_Files "Files" -#define MSGTR_PLAYLIST_DirectoryTree "Directory tree" - -// --- preferences -#define MSGTR_PREFERENCES_Audio MSGTR_EQU_Audio -#define MSGTR_PREFERENCES_Video MSGTR_EQU_Video -#define MSGTR_PREFERENCES_SubtitleOSD "Subtitles & OSD" -#define MSGTR_PREFERENCES_Codecs "Codecs & demuxer" -// Note: If you change MSGTR_PREFERENCES_Misc see if it still fits MSGTR_PREFERENCES_FRAME_Misc -#define MSGTR_PREFERENCES_Misc "Misc" -#define MSGTR_PREFERENCES_None "None" -#define MSGTR_PREFERENCES_DriverDefault "driver default" -#define MSGTR_PREFERENCES_AvailableDrivers "Available drivers:" -#define MSGTR_PREFERENCES_DoNotPlaySound "Do not play sound" -#define MSGTR_PREFERENCES_NormalizeSound "Normalize sound" -#define MSGTR_PREFERENCES_EnableEqualizer "Enable equalizer" -#define MSGTR_PREFERENCES_SoftwareMixer "Enable Software Mixer" -#define MSGTR_PREFERENCES_ExtraStereo "Enable extra stereo" -#define MSGTR_PREFERENCES_Coefficient "Coefficient:" -#define MSGTR_PREFERENCES_AudioDelay "Audio delay" -#define MSGTR_PREFERENCES_DoubleBuffer "Enable double buffering" -#define MSGTR_PREFERENCES_DirectRender "Enable direct rendering" -#define MSGTR_PREFERENCES_FrameDrop "Enable frame dropping" -#define MSGTR_PREFERENCES_HFrameDrop "Enable HARD frame dropping (dangerous)" -#define MSGTR_PREFERENCES_Flip "Flip image upside down" -#define MSGTR_PREFERENCES_Panscan "Panscan: " -#define MSGTR_PREFERENCES_OSDTimer "Timer and indicators" -#define MSGTR_PREFERENCES_OSDProgress "Progressbars only" -#define MSGTR_PREFERENCES_OSDTimerPercentageTotalTime "Timer, percentage and total time" -#define MSGTR_PREFERENCES_Subtitle "Subtitle:" -#define MSGTR_PREFERENCES_SUB_Delay "Delay: " -#define MSGTR_PREFERENCES_SUB_FPS "FPS:" -#define MSGTR_PREFERENCES_SUB_POS "Position: " -#define MSGTR_PREFERENCES_SUB_AutoLoad "Disable subtitle autoloading" -#define MSGTR_PREFERENCES_SUB_Unicode "Unicode subtitle" -#define MSGTR_PREFERENCES_SUB_MPSUB "Convert the given subtitle to MPlayer's subtitle format" -#define MSGTR_PREFERENCES_SUB_SRT "Convert the given subtitle to the time based SubViewer (SRT) format" -#define MSGTR_PREFERENCES_SUB_Overlap "Toggle subtitle overlapping" -#define MSGTR_PREFERENCES_SUB_USE_ASS "SSA/ASS subtitle rendering" -#define MSGTR_PREFERENCES_SUB_ASS_USE_MARGINS "Use margins" -#define MSGTR_PREFERENCES_SUB_ASS_TOP_MARGIN "Top: " -#define MSGTR_PREFERENCES_SUB_ASS_BOTTOM_MARGIN "Bottom: " -#define MSGTR_PREFERENCES_Font "Font:" -#define MSGTR_PREFERENCES_FontFactor "Font factor:" -#define MSGTR_PREFERENCES_PostProcess "Enable postprocessing" -#define MSGTR_PREFERENCES_AutoQuality "Auto quality: " -#define MSGTR_PREFERENCES_NI "Use non-interleaved AVI parser" -#define MSGTR_PREFERENCES_IDX "Rebuild index table, if needed" -#define MSGTR_PREFERENCES_VideoCodecFamily "Video codec family:" -#define MSGTR_PREFERENCES_AudioCodecFamily "Audio codec family:" -#define MSGTR_PREFERENCES_FRAME_OSD_Level "OSD level" -#define MSGTR_PREFERENCES_FRAME_Subtitle "Subtitle" -#define MSGTR_PREFERENCES_FRAME_Font "Font" -#define MSGTR_PREFERENCES_FRAME_PostProcess "Postprocessing" -#define MSGTR_PREFERENCES_FRAME_CodecDemuxer "Codec & demuxer" -#define MSGTR_PREFERENCES_FRAME_Cache "Cache" -#define MSGTR_PREFERENCES_FRAME_Misc MSGTR_PREFERENCES_Misc -#define MSGTR_PREFERENCES_Audio_Device "Device:" -#define MSGTR_PREFERENCES_Audio_Mixer "Mixer:" -#define MSGTR_PREFERENCES_Audio_MixerChannel "Mixer channel:" -#define MSGTR_PREFERENCES_Message "Please remember that you need to restart playback for some options to take effect!" -#define MSGTR_PREFERENCES_DXR3_VENC "Video encoder:" -#define MSGTR_PREFERENCES_DXR3_LAVC "Use LAVC (FFmpeg)" -#define MSGTR_PREFERENCES_FontEncoding1 "Unicode" -#define MSGTR_PREFERENCES_FontEncoding2 "Western European Languages (ISO-8859-1)" -#define MSGTR_PREFERENCES_FontEncoding3 "Western European Languages with Euro (ISO-8859-15)" -#define MSGTR_PREFERENCES_FontEncoding4 "Slavic/Central European Languages (ISO-8859-2)" -#define MSGTR_PREFERENCES_FontEncoding5 "Esperanto, Galician, Maltese, Turkish (ISO-8859-3)" -#define MSGTR_PREFERENCES_FontEncoding6 "Old Baltic charset (ISO-8859-4)" -#define MSGTR_PREFERENCES_FontEncoding7 "Cyrillic (ISO-8859-5)" -#define MSGTR_PREFERENCES_FontEncoding8 "Arabic (ISO-8859-6)" -#define MSGTR_PREFERENCES_FontEncoding9 "Modern Greek (ISO-8859-7)" -#define MSGTR_PREFERENCES_FontEncoding10 "Turkish (ISO-8859-9)" -#define MSGTR_PREFERENCES_FontEncoding11 "Baltic (ISO-8859-13)" -#define MSGTR_PREFERENCES_FontEncoding12 "Celtic (ISO-8859-14)" -#define MSGTR_PREFERENCES_FontEncoding13 "Hebrew charsets (ISO-8859-8)" -#define MSGTR_PREFERENCES_FontEncoding14 "Russian (KOI8-R)" -#define MSGTR_PREFERENCES_FontEncoding15 "Ukrainian, Belarusian (KOI8-U/RU)" -#define MSGTR_PREFERENCES_FontEncoding16 "Simplified Chinese charset (CP936)" -#define MSGTR_PREFERENCES_FontEncoding17 "Traditional Chinese charset (BIG5)" -#define MSGTR_PREFERENCES_FontEncoding18 "Japanese charsets (SHIFT-JIS)" -#define MSGTR_PREFERENCES_FontEncoding19 "Korean charset (CP949)" -#define MSGTR_PREFERENCES_FontEncoding20 "Thai charset (CP874)" -#define MSGTR_PREFERENCES_FontEncoding21 "Cyrillic Windows (CP1251)" -#define MSGTR_PREFERENCES_FontEncoding22 "Slavic/Central European Windows (CP1250)" -#define MSGTR_PREFERENCES_FontEncoding23 "Arabic Windows (CP1256)" -#define MSGTR_PREFERENCES_FontNoAutoScale "No autoscale" -#define MSGTR_PREFERENCES_FontPropWidth "Proportional to movie width" -#define MSGTR_PREFERENCES_FontPropHeight "Proportional to movie height" -#define MSGTR_PREFERENCES_FontPropDiagonal "Proportional to movie diagonal" -#define MSGTR_PREFERENCES_FontEncoding "Encoding:" -#define MSGTR_PREFERENCES_FontBlur "Blur:" -#define MSGTR_PREFERENCES_FontOutLine "Outline:" -#define MSGTR_PREFERENCES_FontTextScale "Text scale:" -#define MSGTR_PREFERENCES_FontOSDScale "OSD scale:" -#define MSGTR_PREFERENCES_Cache "Cache on/off" -#define MSGTR_PREFERENCES_CacheSize "Cache size: " -#define MSGTR_PREFERENCES_LoadFullscreen "Start in fullscreen" -#define MSGTR_PREFERENCES_SaveWinPos "Save window position" -#define MSGTR_PREFERENCES_XSCREENSAVER "Stop XScreenSaver" -#define MSGTR_PREFERENCES_PlayBar "Enable playbar" -#define MSGTR_PREFERENCES_AutoSync "AutoSync on/off" -#define MSGTR_PREFERENCES_AutoSyncValue "Autosync: " -#define MSGTR_PREFERENCES_CDROMDevice "CD-ROM device:" -#define MSGTR_PREFERENCES_DVDDevice "DVD device:" -#define MSGTR_PREFERENCES_FPS "Movie FPS:" -#define MSGTR_PREFERENCES_ShowVideoWindow "Show video window when inactive" -#define MSGTR_PREFERENCES_ArtsBroken "Newer aRts versions are incompatible "\ - "with GTK 1.x and will crash GMPlayer!" - -// -- aboutbox -#define MSGTR_ABOUT_UHU "GUI development sponsored by UHU Linux\n" -#define MSGTR_ABOUT_Contributors "Code and documentation contributors\n" -#define MSGTR_ABOUT_Codecs_libs_contributions "Codecs and third party libraries\n" -#define MSGTR_ABOUT_Translations "Translations\n" -#define MSGTR_ABOUT_Skins "Skins\n" - -// --- messagebox -#define MSGTR_MSGBOX_LABEL_FatalError "Fatal error!" -#define MSGTR_MSGBOX_LABEL_Error "Error!" -#define MSGTR_MSGBOX_LABEL_Warning "Warning!" - -// bitmap.c -#define MSGTR_NotEnoughMemoryC32To1 "[c32to1] not enough memory for image\n" -#define MSGTR_NotEnoughMemoryC1To32 "[c1to32] not enough memory for image\n" - -// cfg.c -#define MSGTR_ConfigFileReadError "[cfg] config file read error ...\n" -#define MSGTR_UnableToSaveOption "[cfg] Unable to save the '%s' option.\n" - -// interface.c -#define MSGTR_DeletingSubtitles "[GUI] Deleting subtitles.\n" -#define MSGTR_LoadingSubtitles "[GUI] Loading subtitles: %s\n" -#define MSGTR_AddingVideoFilter "[GUI] Adding video filter: %s\n" -#define MSGTR_RemovingVideoFilter "[GUI] Removing video filter: %s\n" - -// mw.c -#define MSGTR_NotAFile "This does not seem to be a file: %s !\n" - -// ws.c -#define MSGTR_WS_CouldNotOpenDisplay "[ws] Could not open the display.\n" -#define MSGTR_WS_RemoteDisplay "[ws] Remote display, disabling XMITSHM.\n" -#define MSGTR_WS_NoXshm "[ws] Sorry, your system does not support the X shared memory extension.\n" -#define MSGTR_WS_NoXshape "[ws] Sorry, your system does not support the XShape extension.\n" -#define MSGTR_WS_ColorDepthTooLow "[ws] Sorry, the color depth is too low.\n" -#define MSGTR_WS_TooManyOpenWindows "[ws] There are too many open windows.\n" -#define MSGTR_WS_ShmError "[ws] shared memory extension error\n" -#define MSGTR_WS_NotEnoughMemoryDrawBuffer "[ws] Sorry, not enough memory to draw buffer.\n" -#define MSGTR_WS_DpmsUnavailable "DPMS not available?\n" -#define MSGTR_WS_DpmsNotEnabled "Could not enable DPMS.\n" - -// wsxdnd.c -#define MSGTR_WS_NotAFile "This does not seem to be a file...\n" -#define MSGTR_WS_DDNothing "D&D: Nothing returned!\n" - -// ======================= video output drivers ======================== - -#define MSGTR_VOincompCodec "The selected video_out device is incompatible with this codec.\n"\ - "Try appending the scale filter to your filter list,\n"\ - "e.g. -vf spp,scale instead of -vf spp.\n" -#define MSGTR_VO_GenericError "This error has occurred" -#define MSGTR_VO_UnableToAccess "Unable to access" -#define MSGTR_VO_ExistsButNoDirectory "already exists, but is not a directory." -#define MSGTR_VO_DirExistsButNotWritable "Output directory already exists, but is not writable." -#define MSGTR_VO_DirExistsAndIsWritable "Output directory already exists and is writable." -#define MSGTR_VO_CantCreateDirectory "Unable to create output directory." -#define MSGTR_VO_CantCreateFile "Unable to create output file." -#define MSGTR_VO_DirectoryCreateSuccess "Output directory successfully created." -#define MSGTR_VO_ParsingSuboptions "Parsing suboptions." -#define MSGTR_VO_SuboptionsParsedOK "Suboptions parsed OK." -#define MSGTR_VO_ValueOutOfRange "value out of range" -#define MSGTR_VO_NoValueSpecified "No value specified." -#define MSGTR_VO_UnknownSuboptions "unknown suboption(s)" - -// aspect.c -#define MSGTR_LIBVO_ASPECT_NoSuitableNewResFound "[ASPECT] Warning: No suitable new res found!\n" -#define MSGTR_LIBVO_ASPECT_NoNewSizeFoundThatFitsIntoRes "[ASPECT] Error: No new size found that fits into res!\n" - -// font_load_ft.c -#define MSGTR_LIBVO_FONT_LOAD_FT_NewFaceFailed "New_Face failed. Maybe the font path is wrong.\nPlease supply the text font file (~/.mplayer/subfont.ttf).\n" -#define MSGTR_LIBVO_FONT_LOAD_FT_NewMemoryFaceFailed "New_Memory_Face failed..\n" -#define MSGTR_LIBVO_FONT_LOAD_FT_SubFaceFailed "subtitle font: load_sub_face failed.\n" -#define MSGTR_LIBVO_FONT_LOAD_FT_SubFontCharsetFailed "subtitle font: prepare_charset failed.\n" -#define MSGTR_LIBVO_FONT_LOAD_FT_CannotPrepareSubtitleFont "Cannot prepare subtitle font.\n" -#define MSGTR_LIBVO_FONT_LOAD_FT_CannotPrepareOSDFont "Cannot prepare OSD font.\n" -#define MSGTR_LIBVO_FONT_LOAD_FT_CannotGenerateTables "Cannot generate tables.\n" -#define MSGTR_LIBVO_FONT_LOAD_FT_DoneFreeTypeFailed "FT_Done_FreeType failed.\n" -#define MSGTR_LIBVO_FONT_LOAD_FT_FontconfigNoMatch "Fontconfig failed to select a font. Trying without fontconfig...\n" - -// sub.c -#define MSGTR_VO_SUB_Seekbar "Seekbar" -#define MSGTR_VO_SUB_Play "Play" -#define MSGTR_VO_SUB_Pause "Pause" -#define MSGTR_VO_SUB_Stop "Stop" -#define MSGTR_VO_SUB_Rewind "Rewind" -#define MSGTR_VO_SUB_Forward "Forward" -#define MSGTR_VO_SUB_Clock "Clock" -#define MSGTR_VO_SUB_Contrast "Contrast" -#define MSGTR_VO_SUB_Saturation "Saturation" -#define MSGTR_VO_SUB_Volume "Volume" -#define MSGTR_VO_SUB_Brightness "Brightness" -#define MSGTR_VO_SUB_Hue "Hue" -#define MSGTR_VO_SUB_Balance "Balance" - -// vo_3dfx.c -#define MSGTR_LIBVO_3DFX_Only16BppSupported "[VO_3DFX] Only 16bpp supported!" -#define MSGTR_LIBVO_3DFX_VisualIdIs "[VO_3DFX] Visual ID is %lx.\n" -#define MSGTR_LIBVO_3DFX_UnableToOpenDevice "[VO_3DFX] Unable to open /dev/3dfx.\n" -#define MSGTR_LIBVO_3DFX_Error "[VO_3DFX] Error: %d.\n" -#define MSGTR_LIBVO_3DFX_CouldntMapMemoryArea "[VO_3DFX] Couldn't map 3dfx memory areas: %p,%p,%d.\n" -#define MSGTR_LIBVO_3DFX_DisplayInitialized "[VO_3DFX] Initialized: %p.\n" -#define MSGTR_LIBVO_3DFX_UnknownSubdevice "[VO_3DFX] Unknown subdevice: %s.\n" - -// vo_aa.c -#define MSGTR_VO_AA_HelpHeader "\n\nHere are the aalib vo_aa suboptions:\n" -#define MSGTR_VO_AA_AdditionalOptions "Additional options vo_aa provides:\n" \ - " help print this help message\n" \ - " osdcolor set OSD color\n subcolor set subtitle color\n" \ - " the color parameters are:\n 0 : normal\n" \ - " 1 : dim\n 2 : bold\n 3 : boldfont\n" \ - " 4 : reverse\n 5 : special\n\n\n" - -// vo_dxr3.c -#define MSGTR_LIBVO_DXR3_UnableToLoadNewSPUPalette "[VO_DXR3] Unable to load new SPU palette!\n" -#define MSGTR_LIBVO_DXR3_UnableToSetPlaymode "[VO_DXR3] Unable to set playmode!\n" -#define MSGTR_LIBVO_DXR3_UnableToSetSubpictureMode "[VO_DXR3] Unable to set subpicture mode!\n" -#define MSGTR_LIBVO_DXR3_UnableToGetTVNorm "[VO_DXR3] Unable to get TV norm!\n" -#define MSGTR_LIBVO_DXR3_AutoSelectedTVNormByFrameRate "[VO_DXR3] Auto-selected TV norm by framerate: " -#define MSGTR_LIBVO_DXR3_UnableToSetTVNorm "[VO_DXR3] Unable to set TV norm!\n" -#define MSGTR_LIBVO_DXR3_SettingUpForNTSC "[VO_DXR3] Setting up for NTSC.\n" -#define MSGTR_LIBVO_DXR3_SettingUpForPALSECAM "[VO_DXR3] Setting up for PAL/SECAM.\n" -#define MSGTR_LIBVO_DXR3_SettingAspectRatioTo43 "[VO_DXR3] Setting aspect ratio to 4:3.\n" -#define MSGTR_LIBVO_DXR3_SettingAspectRatioTo169 "[VO_DXR3] Setting aspect ratio to 16:9.\n" -#define MSGTR_LIBVO_DXR3_OutOfMemory "[VO_DXR3] out of memory\n" -#define MSGTR_LIBVO_DXR3_UnableToAllocateKeycolor "[VO_DXR3] Unable to allocate keycolor!\n" -#define MSGTR_LIBVO_DXR3_UnableToAllocateExactKeycolor "[VO_DXR3] Unable to allocate exact keycolor, using closest match (0x%lx).\n" -#define MSGTR_LIBVO_DXR3_Uninitializing "[VO_DXR3] Uninitializing.\n" -#define MSGTR_LIBVO_DXR3_FailedRestoringTVNorm "[VO_DXR3] Failed restoring TV norm!\n" -#define MSGTR_LIBVO_DXR3_EnablingPrebuffering "[VO_DXR3] Enabling prebuffering.\n" -#define MSGTR_LIBVO_DXR3_UsingNewSyncEngine "[VO_DXR3] Using new sync engine.\n" -#define MSGTR_LIBVO_DXR3_UsingOverlay "[VO_DXR3] Using overlay.\n" -#define MSGTR_LIBVO_DXR3_ErrorYouNeedToCompileMplayerWithX11 "[VO_DXR3] Error: Overlay requires compiling with X11 libs/headers installed.\n" -#define MSGTR_LIBVO_DXR3_WillSetTVNormTo "[VO_DXR3] Will set TV norm to: " -#define MSGTR_LIBVO_DXR3_AutoAdjustToMovieFrameRatePALPAL60 "auto-adjust to movie framerate (PAL/PAL-60)" -#define MSGTR_LIBVO_DXR3_AutoAdjustToMovieFrameRatePALNTSC "auto-adjust to movie framerate (PAL/NTSC)" -#define MSGTR_LIBVO_DXR3_UseCurrentNorm "Use current norm." -#define MSGTR_LIBVO_DXR3_UseUnknownNormSuppliedCurrentNorm "Unknown norm supplied. Use current norm." -#define MSGTR_LIBVO_DXR3_ErrorOpeningForWritingTrying "[VO_DXR3] Error opening %s for writing, trying /dev/em8300 instead.\n" -#define MSGTR_LIBVO_DXR3_ErrorOpeningForWritingTryingMV "[VO_DXR3] Error opening %s for writing, trying /dev/em8300_mv instead.\n" -#define MSGTR_LIBVO_DXR3_ErrorOpeningForWritingAsWell "[VO_DXR3] Error opening /dev/em8300 for writing as well!\nBailing out.\n" -#define MSGTR_LIBVO_DXR3_ErrorOpeningForWritingAsWellMV "[VO_DXR3] Error opening /dev/em8300_mv for writing as well!\nBailing out.\n" -#define MSGTR_LIBVO_DXR3_Opened "[VO_DXR3] Opened: %s.\n" -#define MSGTR_LIBVO_DXR3_ErrorOpeningForWritingTryingSP "[VO_DXR3] Error opening %s for writing, trying /dev/em8300_sp instead.\n" -#define MSGTR_LIBVO_DXR3_ErrorOpeningForWritingAsWellSP "[VO_DXR3] Error opening /dev/em8300_sp for writing as well!\nBailing out.\n" -#define MSGTR_LIBVO_DXR3_UnableToOpenDisplayDuringHackSetup "[VO_DXR3] Unable to open display during overlay hack setup!\n" -#define MSGTR_LIBVO_DXR3_UnableToInitX11 "[VO_DXR3] Unable to init X11!\n" -#define MSGTR_LIBVO_DXR3_FailedSettingOverlayAttribute "[VO_DXR3] Failed setting overlay attribute.\n" -#define MSGTR_LIBVO_DXR3_FailedSettingOverlayScreen "[VO_DXR3] Failed setting overlay screen!\nExiting.\n" -#define MSGTR_LIBVO_DXR3_FailedEnablingOverlay "[VO_DXR3] Failed enabling overlay!\nExiting.\n" -#define MSGTR_LIBVO_DXR3_FailedResizingOverlayWindow "[VO_DXR3] Failed resizing overlay window!\n" -#define MSGTR_LIBVO_DXR3_FailedSettingOverlayBcs "[VO_DXR3] Failed setting overlay bcs!\n" -#define MSGTR_LIBVO_DXR3_FailedGettingOverlayYOffsetValues "[VO_DXR3] Failed getting overlay Y-offset values!\nExiting.\n" -#define MSGTR_LIBVO_DXR3_FailedGettingOverlayXOffsetValues "[VO_DXR3] Failed getting overlay X-offset values!\nExiting.\n" -#define MSGTR_LIBVO_DXR3_FailedGettingOverlayXScaleCorrection "[VO_DXR3] Failed getting overlay X scale correction!\nExiting.\n" -#define MSGTR_LIBVO_DXR3_YOffset "[VO_DXR3] Yoffset: %d.\n" -#define MSGTR_LIBVO_DXR3_XOffset "[VO_DXR3] Xoffset: %d.\n" -#define MSGTR_LIBVO_DXR3_XCorrection "[VO_DXR3] Xcorrection: %d.\n" -#define MSGTR_LIBVO_DXR3_FailedSetSignalMix "[VO_DXR3] Failed to set signal mix!\n" - -// vo_jpeg.c -#define MSGTR_VO_JPEG_ProgressiveJPEG "Progressive JPEG enabled." -#define MSGTR_VO_JPEG_NoProgressiveJPEG "Progressive JPEG disabled." -#define MSGTR_VO_JPEG_BaselineJPEG "Baseline JPEG enabled." -#define MSGTR_VO_JPEG_NoBaselineJPEG "Baseline JPEG disabled." - -// vo_mga.c -#define MSGTR_LIBVO_MGA_AspectResized "[VO_MGA] aspect(): resized to %dx%d.\n" -#define MSGTR_LIBVO_MGA_Uninit "[VO] uninit!\n" - -// mga_common.c -#define MSGTR_LIBVO_MGA_ErrorInConfigIoctl "[MGA] error in mga_vid_config ioctl (wrong mga_vid.o version?)" -#define MSGTR_LIBVO_MGA_CouldNotGetLumaValuesFromTheKernelModule "[MGA] Could not get luma values from the kernel module!\n" -#define MSGTR_LIBVO_MGA_CouldNotSetLumaValuesFromTheKernelModule "[MGA] Could not set luma values from the kernel module!\n" -#define MSGTR_LIBVO_MGA_ScreenWidthHeightUnknown "[MGA] Screen width/height unknown!\n" -#define MSGTR_LIBVO_MGA_InvalidOutputFormat "[MGA] invalid output format %0X\n" -#define MSGTR_LIBVO_MGA_IncompatibleDriverVersion "[MGA] Your mga_vid driver version is incompatible with this MPlayer version!\n" -#define MSGTR_LIBVO_MGA_CouldntOpen "[MGA] Couldn't open: %s\n" -#define MSGTR_LIBVO_MGA_ResolutionTooHigh "[MGA] Source resolution exceeds 1023x1023 in at least one dimension.\n[MGA] Rescale in software or use -lavdopts lowres=1.\n" -#define MSGTR_LIBVO_MGA_mgavidVersionMismatch "[MGA] mismatch between kernel (%u) and MPlayer (%u) mga_vid driver versions\n" - -// vo_null.c -#define MSGTR_LIBVO_NULL_UnknownSubdevice "[VO_NULL] Unknown subdevice: %s.\n" - -// vo_png.c -#define MSGTR_LIBVO_PNG_Warning1 "[VO_PNG] Warning: compression level set to 0, compression disabled!\n" -#define MSGTR_LIBVO_PNG_Warning2 "[VO_PNG] Info: Use -vo png:z= to set compression level from 0 to 9.\n" -#define MSGTR_LIBVO_PNG_Warning3 "[VO_PNG] Info: (0 = no compression, 1 = fastest, lowest - 9 best, slowest compression)\n" -#define MSGTR_LIBVO_PNG_ErrorOpeningForWriting "\n[VO_PNG] Error opening '%s' for writing!\n" -#define MSGTR_LIBVO_PNG_ErrorInCreatePng "[VO_PNG] Error in create_png.\n" - -// vo_pnm.c -#define MSGTR_VO_PNM_ASCIIMode "ASCII mode enabled." -#define MSGTR_VO_PNM_RawMode "Raw mode enabled." -#define MSGTR_VO_PNM_PPMType "Will write PPM files." -#define MSGTR_VO_PNM_PGMType "Will write PGM files." -#define MSGTR_VO_PNM_PGMYUVType "Will write PGMYUV files." - -// vo_sdl.c -#define MSGTR_LIBVO_SDL_CouldntGetAnyAcceptableSDLModeForOutput "[VO_SDL] Couldn't get any acceptable SDL Mode for output.\n" -#define MSGTR_LIBVO_SDL_SetVideoModeFailed "[VO_SDL] set_video_mode: SDL_SetVideoMode failed: %s.\n" -#define MSGTR_LIBVO_SDL_SetVideoModeFailedFull "[VO_SDL] Set_fullmode: SDL_SetVideoMode failed: %s.\n" -#define MSGTR_LIBVO_SDL_MappingI420ToIYUV "[VO_SDL] Mapping I420 to IYUV.\n" -#define MSGTR_LIBVO_SDL_UnsupportedImageFormat "[VO_SDL] Unsupported image format (0x%X).\n" -#define MSGTR_LIBVO_SDL_InfoPleaseUseVmOrZoom "[VO_SDL] Info - please use -vm or -zoom to switch to the best resolution.\n" -#define MSGTR_LIBVO_SDL_FailedToSetVideoMode "[VO_SDL] Failed to set video mode: %s.\n" -#define MSGTR_LIBVO_SDL_CouldntCreateAYUVOverlay "[VO_SDL] Couldn't create a YUV overlay: %s.\n" -#define MSGTR_LIBVO_SDL_CouldntCreateARGBSurface "[VO_SDL] Couldn't create an RGB surface: %s.\n" -#define MSGTR_LIBVO_SDL_UsingDepthColorspaceConversion "[VO_SDL] Using depth/colorspace conversion, this will slow things down (%ibpp -> %ibpp).\n" -#define MSGTR_LIBVO_SDL_UnsupportedImageFormatInDrawslice "[VO_SDL] Unsupported image format in draw_slice, contact MPlayer developers!\n" -#define MSGTR_LIBVO_SDL_BlitFailed "[VO_SDL] Blit failed: %s.\n" -#define MSGTR_LIBVO_SDL_InitializationFailed "[VO_SDL] SDL initialization failed: %s.\n" -#define MSGTR_LIBVO_SDL_UsingDriver "[VO_SDL] Using driver: %s.\n" - -// vo_svga.c -#define MSGTR_LIBVO_SVGA_ForcedVidmodeNotAvailable "[VO_SVGA] Forced vid_mode %d (%s) not available.\n" -#define MSGTR_LIBVO_SVGA_ForcedVidmodeTooSmall "[VO_SVGA] Forced vid_mode %d (%s) too small.\n" -#define MSGTR_LIBVO_SVGA_Vidmode "[VO_SVGA] Vid_mode: %d, %dx%d %dbpp.\n" -#define MSGTR_LIBVO_SVGA_VgasetmodeFailed "[VO_SVGA] Vga_setmode(%d) failed.\n" -#define MSGTR_LIBVO_SVGA_VideoModeIsLinearAndMemcpyCouldBeUsed "[VO_SVGA] Video mode is linear and memcpy could be used for image transfer.\n" -#define MSGTR_LIBVO_SVGA_VideoModeHasHardwareAcceleration "[VO_SVGA] Video mode has hardware acceleration and put_image could be used.\n" -#define MSGTR_LIBVO_SVGA_IfItWorksForYouIWouldLikeToKnow "[VO_SVGA] If it works for you I would like to know.\n[VO_SVGA] (send log with `mplayer test.avi -v -v -v -v &> svga.log`). Thx!\n" -#define MSGTR_LIBVO_SVGA_VideoModeHas "[VO_SVGA] Video mode has %d page(s).\n" -#define MSGTR_LIBVO_SVGA_CenteringImageStartAt "[VO_SVGA] Centering image. Starting at (%d,%d)\n" -#define MSGTR_LIBVO_SVGA_UsingVidix "[VO_SVGA] Using VIDIX. w=%i h=%i mw=%i mh=%i\n" - -// vo_tdfx_vid.c -#define MSGTR_LIBVO_TDFXVID_Move "[VO_TDXVID] Move %d(%d) x %d => %d.\n" -#define MSGTR_LIBVO_TDFXVID_AGPMoveFailedToClearTheScreen "[VO_TDFXVID] AGP move failed to clear the screen.\n" -#define MSGTR_LIBVO_TDFXVID_BlitFailed "[VO_TDFXVID] Blit failed.\n" -#define MSGTR_LIBVO_TDFXVID_NonNativeOverlayFormatNeedConversion "[VO_TDFXVID] Non-native overlay format needs conversion.\n" -#define MSGTR_LIBVO_TDFXVID_UnsupportedInputFormat "[VO_TDFXVID] Unsupported input format 0x%x.\n" -#define MSGTR_LIBVO_TDFXVID_OverlaySetupFailed "[VO_TDFXVID] Overlay setup failed.\n" -#define MSGTR_LIBVO_TDFXVID_OverlayOnFailed "[VO_TDFXVID] Overlay on failed.\n" -#define MSGTR_LIBVO_TDFXVID_OverlayReady "[VO_TDFXVID] Overlay ready: %d(%d) x %d @ %d => %d(%d) x %d @ %d.\n" -#define MSGTR_LIBVO_TDFXVID_TextureBlitReady "[VO_TDFXVID] Texture blit ready: %d(%d) x %d @ %d => %d(%d) x %d @ %d.\n" -#define MSGTR_LIBVO_TDFXVID_OverlayOffFailed "[VO_TDFXVID] Overlay off failed\n" -#define MSGTR_LIBVO_TDFXVID_CantOpen "[VO_TDFXVID] Can't open %s: %s.\n" -#define MSGTR_LIBVO_TDFXVID_CantGetCurrentCfg "[VO_TDFXVID] Can't get current configuration: %s.\n" -#define MSGTR_LIBVO_TDFXVID_MemmapFailed "[VO_TDFXVID] Memmap failed !!!!!\n" -#define MSGTR_LIBVO_TDFXVID_GetImageTodo "Get image todo.\n" -#define MSGTR_LIBVO_TDFXVID_AgpMoveFailed "[VO_TDFXVID] AGP move failed.\n" -#define MSGTR_LIBVO_TDFXVID_SetYuvFailed "[VO_TDFXVID] Set YUV failed.\n" -#define MSGTR_LIBVO_TDFXVID_AgpMoveFailedOnYPlane "[VO_TDFXVID] AGP move failed on Y plane.\n" -#define MSGTR_LIBVO_TDFXVID_AgpMoveFailedOnUPlane "[VO_TDFXVID] AGP move failed on U plane.\n" -#define MSGTR_LIBVO_TDFXVID_AgpMoveFailedOnVPlane "[VO_TDFXVID] AGP move failed on V plane.\n" -#define MSGTR_LIBVO_TDFXVID_UnknownFormat "[VO_TDFXVID] unknown format: 0x%x.\n" - -// vo_tdfxfb.c -#define MSGTR_LIBVO_TDFXFB_CantOpen "[VO_TDFXFB] Can't open %s: %s.\n" -#define MSGTR_LIBVO_TDFXFB_ProblemWithFbitgetFscreenInfo "[VO_TDFXFB] Problem with FBITGET_FSCREENINFO ioctl: %s.\n" -#define MSGTR_LIBVO_TDFXFB_ProblemWithFbitgetVscreenInfo "[VO_TDFXFB] Problem with FBITGET_VSCREENINFO ioctl: %s.\n" -#define MSGTR_LIBVO_TDFXFB_ThisDriverOnlySupports "[VO_TDFXFB] This driver only supports the 3Dfx Banshee, Voodoo3 and Voodoo 5.\n" -#define MSGTR_LIBVO_TDFXFB_OutputIsNotSupported "[VO_TDFXFB] %d bpp output is not supported.\n" -#define MSGTR_LIBVO_TDFXFB_CouldntMapMemoryAreas "[VO_TDFXFB] Couldn't map memory areas: %s.\n" -#define MSGTR_LIBVO_TDFXFB_BppOutputIsNotSupported "[VO_TDFXFB] %d bpp output is not supported (This should never have happened).\n" -#define MSGTR_LIBVO_TDFXFB_SomethingIsWrongWithControl "[VO_TDFXFB] Eik! Something's wrong with control().\n" -#define MSGTR_LIBVO_TDFXFB_NotEnoughVideoMemoryToPlay "[VO_TDFXFB] Not enough video memory to play this movie. Try at a lower resolution.\n" -#define MSGTR_LIBVO_TDFXFB_ScreenIs "[VO_TDFXFB] Screen is %dx%d at %d bpp, in is %dx%d at %d bpp, norm is %dx%d.\n" - -// vo_tga.c -#define MSGTR_LIBVO_TGA_UnknownSubdevice "[VO_TGA] Unknown subdevice: %s.\n" - -// vo_vesa.c -#define MSGTR_LIBVO_VESA_FatalErrorOccurred "[VO_VESA] Fatal error occurred! Can't continue.\n" -#define MSGTR_LIBVO_VESA_UnknownSubdevice "[VO_VESA] unknown subdevice: '%s'.\n" -#define MSGTR_LIBVO_VESA_YouHaveTooLittleVideoMemory "[VO_VESA] You have too little video memory for this mode:\n[VO_VESA] Required: %08lX present: %08lX.\n" -#define MSGTR_LIBVO_VESA_YouHaveToSpecifyTheCapabilitiesOfTheMonitor "[VO_VESA] You have to specify the capabilities of the monitor. Not changing refresh rate.\n" -#define MSGTR_LIBVO_VESA_UnableToFitTheMode "[VO_VESA] The mode does not fit the monitor limits. Not changing refresh rate.\n" -#define MSGTR_LIBVO_VESA_DetectedInternalFatalError "[VO_VESA] Detected internal fatal error: init is called before preinit.\n" -#define MSGTR_LIBVO_VESA_SwitchFlipIsNotSupported "[VO_VESA] The -flip option is not supported.\n" -#define MSGTR_LIBVO_VESA_PossibleReasonNoVbe2BiosFound "[VO_VESA] Possible reason: No VBE2 BIOS found.\n" -#define MSGTR_LIBVO_VESA_FoundVesaVbeBiosVersion "[VO_VESA] Found VESA VBE BIOS Version %x.%x Revision: %x.\n" -#define MSGTR_LIBVO_VESA_VideoMemory "[VO_VESA] Video memory: %u Kb.\n" -#define MSGTR_LIBVO_VESA_Capabilites "[VO_VESA] VESA Capabilities: %s %s %s %s %s.\n" -#define MSGTR_LIBVO_VESA_BelowWillBePrintedOemInfo "[VO_VESA] !!! OEM info will be printed below !!!\n" -#define MSGTR_LIBVO_VESA_YouShouldSee5OemRelatedLines "[VO_VESA] You should see 5 OEM related lines below; If not, you've broken vm86.\n" -#define MSGTR_LIBVO_VESA_OemInfo "[VO_VESA] OEM info: %s.\n" -#define MSGTR_LIBVO_VESA_OemRevision "[VO_VESA] OEM Revision: %x.\n" -#define MSGTR_LIBVO_VESA_OemVendor "[VO_VESA] OEM vendor: %s.\n" -#define MSGTR_LIBVO_VESA_OemProductName "[VO_VESA] OEM Product Name: %s.\n" -#define MSGTR_LIBVO_VESA_OemProductRev "[VO_VESA] OEM Product Rev: %s.\n" -#define MSGTR_LIBVO_VESA_Hint "[VO_VESA] Hint: For working TV-Out you should have plugged in the TV connector\n"\ - "[VO_VESA] before booting since VESA BIOS initializes itself only during POST.\n" -#define MSGTR_LIBVO_VESA_UsingVesaMode "[VO_VESA] Using VESA mode (%u) = %x [%ux%u@%u]\n" -#define MSGTR_LIBVO_VESA_CantInitializeSwscaler "[VO_VESA] Can't initialize software scaler.\n" -#define MSGTR_LIBVO_VESA_CantUseDga "[VO_VESA] Can't use DGA. Force bank switching mode. :(\n" -#define MSGTR_LIBVO_VESA_UsingDga "[VO_VESA] Using DGA (physical resources: %08lXh, %08lXh)" -#define MSGTR_LIBVO_VESA_CantUseDoubleBuffering "[VO_VESA] Can't use double buffering: not enough video memory.\n" -#define MSGTR_LIBVO_VESA_CantFindNeitherDga "[VO_VESA] Can find neither DGA nor relocatable window frame.\n" -#define MSGTR_LIBVO_VESA_YouveForcedDga "[VO_VESA] You've forced DGA. Exiting\n" -#define MSGTR_LIBVO_VESA_CantFindValidWindowAddress "[VO_VESA] Can't find valid window address.\n" -#define MSGTR_LIBVO_VESA_UsingBankSwitchingMode "[VO_VESA] Using bank switching mode (physical resources: %08lXh, %08lXh).\n" -#define MSGTR_LIBVO_VESA_CantAllocateTemporaryBuffer "[VO_VESA] Can't allocate temporary buffer.\n" -#define MSGTR_LIBVO_VESA_SorryUnsupportedMode "[VO_VESA] Sorry, unsupported mode -- try -x 640 -zoom.\n" -#define MSGTR_LIBVO_VESA_OhYouReallyHavePictureOnTv "[VO_VESA] Oh you really have a picture on the TV!\n" -#define MSGTR_LIBVO_VESA_CantInitialozeLinuxVideoOverlay "[VO_VESA] Can't initialize Linux Video Overlay.\n" -#define MSGTR_LIBVO_VESA_UsingVideoOverlay "[VO_VESA] Using video overlay: %s.\n" -#define MSGTR_LIBVO_VESA_CantInitializeVidixDriver "[VO_VESA] Can't initialize VIDIX driver.\n" -#define MSGTR_LIBVO_VESA_UsingVidix "[VO_VESA] Using VIDIX.\n" -#define MSGTR_LIBVO_VESA_CantFindModeFor "[VO_VESA] Can't find mode for: %ux%u@%u.\n" -#define MSGTR_LIBVO_VESA_InitializationComplete "[VO_VESA] VESA initialization complete.\n" - -// vesa_lvo.c -#define MSGTR_LIBVO_VESA_ThisBranchIsNoLongerSupported "[VESA_LVO] This branch is no longer supported.\n[VESA_LVO] Please use -vo vesa:vidix instead.\n" -#define MSGTR_LIBVO_VESA_CouldntOpen "[VESA_LVO] Couldn't open: '%s'\n" -#define MSGTR_LIBVO_VESA_InvalidOutputFormat "[VESA_LVI] Invalid output format: %s(%0X)\n" -#define MSGTR_LIBVO_VESA_IncompatibleDriverVersion "[VESA_LVO] Your fb_vid driver version is incompatible with this MPlayer version!\n" - -// vo_x11.c -#define MSGTR_LIBVO_X11_DrawFrameCalled "[VO_X11] draw_frame() called!!!!!!\n" - -// vo_xv.c -#define MSGTR_LIBVO_XV_DrawFrameCalled "[VO_XV] draw_frame() called!!!!!!\n" -#define MSGTR_LIBVO_XV_SharedMemoryNotSupported "[VO_XV] Shared memory not supported\nReverting to normal Xv.\n" -#define MSGTR_LIBVO_XV_XvNotSupportedByX11 "[VO_XV] Sorry, Xv not supported by this X11 version/driver\n[VO_XV] ******** Try with -vo x11 or -vo sdl *********\n" -#define MSGTR_LIBVO_XV_XvQueryAdaptorsFailed "[VO_XV] XvQueryAdaptors failed.\n" -#define MSGTR_LIBVO_XV_InvalidPortParameter "[VO_XV] Invalid port parameter, overriding with port 0.\n" -#define MSGTR_LIBVO_XV_CouldNotGrabPort "[VO_XV] Could not grab port %i.\n" -#define MSGTR_LIBVO_XV_CouldNotFindFreePort "[VO_XV] Could not find free Xvideo port - maybe another process is already\n"\ - "[VO_XV] using it. Close all video applications, and try again. If that does\n"\ - "[VO_XV] not help, see 'mplayer -vo help' for other (non-xv) video out drivers.\n" -#define MSGTR_LIBVO_XV_NoXvideoSupport "[VO_XV] It seems there is no Xvideo support for your video card available.\n"\ - "[VO_XV] Run 'xvinfo' to verify its Xv support and read\n"\ - "[VO_XV] DOCS/HTML/en/video.html#xv!\n"\ - "[VO_XV] See 'mplayer -vo help' for other (non-xv) video out drivers.\n"\ - "[VO_XV] Try -vo x11.\n" -#define MSGTR_VO_XV_ImagedimTooHigh "Source image dimensions are too high: %ux%u (maximum is %ux%u)\n" - -// vo_yuv4mpeg.c -#define MSGTR_VO_YUV4MPEG_InterlacedHeightDivisibleBy4 "Interlaced mode requires image height to be divisible by 4." -#define MSGTR_VO_YUV4MPEG_InterlacedLineBufAllocFail "Unable to allocate line buffer for interlaced mode." -#define MSGTR_VO_YUV4MPEG_InterlacedInputNotRGB "Input not RGB, can't separate chrominance by fields!" -#define MSGTR_VO_YUV4MPEG_WidthDivisibleBy2 "Image width must be divisible by 2." -#define MSGTR_VO_YUV4MPEG_NoMemRGBFrameBuf "Not enough memory to allocate RGB framebuffer." -#define MSGTR_VO_YUV4MPEG_OutFileOpenError "Can't get memory or file handle to write \"%s\"!" -#define MSGTR_VO_YUV4MPEG_OutFileWriteError "Error writing image to output!" -#define MSGTR_VO_YUV4MPEG_UnknownSubDev "Unknown subdevice: %s" -#define MSGTR_VO_YUV4MPEG_InterlacedTFFMode "Using interlaced output mode, top-field first." -#define MSGTR_VO_YUV4MPEG_InterlacedBFFMode "Using interlaced output mode, bottom-field first." -#define MSGTR_VO_YUV4MPEG_ProgressiveMode "Using (default) progressive frame mode." - -// vosub_vidix.c -#define MSGTR_LIBVO_SUB_VIDIX_CantStartPlayback "[VO_SUB_VIDIX] Can't start playback: %s\n" -#define MSGTR_LIBVO_SUB_VIDIX_CantStopPlayback "[VO_SUB_VIDIX] Can't stop playback: %s\n" -#define MSGTR_LIBVO_SUB_VIDIX_InterleavedUvForYuv410pNotSupported "[VO_SUB_VIDIX] Interleaved UV for YUV410P not supported.\n" -#define MSGTR_LIBVO_SUB_VIDIX_DummyVidixdrawsliceWasCalled "[VO_SUB_VIDIX] Dummy vidix_draw_slice() was called.\n" -#define MSGTR_LIBVO_SUB_VIDIX_DummyVidixdrawframeWasCalled "[VO_SUB_VIDIX] Dummy vidix_draw_frame() was called.\n" -#define MSGTR_LIBVO_SUB_VIDIX_UnsupportedFourccForThisVidixDriver "[VO_SUB_VIDIX] Unsupported FourCC for this VIDIX driver: %x (%s).\n" -#define MSGTR_LIBVO_SUB_VIDIX_VideoServerHasUnsupportedResolution "[VO_SUB_VIDIX] Video server has unsupported resolution (%dx%d), supported: %dx%d-%dx%d.\n" -#define MSGTR_LIBVO_SUB_VIDIX_VideoServerHasUnsupportedColorDepth "[VO_SUB_VIDIX] Video server has unsupported color depth by vidix (%d).\n" -#define MSGTR_LIBVO_SUB_VIDIX_DriverCantUpscaleImage "[VO_SUB_VIDIX] VIDIX driver can't upscale image (%d%d -> %d%d).\n" -#define MSGTR_LIBVO_SUB_VIDIX_DriverCantDownscaleImage "[VO_SUB_VIDIX] VIDIX driver can't downscale image (%d%d -> %d%d).\n" -#define MSGTR_LIBVO_SUB_VIDIX_CantConfigurePlayback "[VO_SUB_VIDIX] Can't configure playback: %s.\n" -#define MSGTR_LIBVO_SUB_VIDIX_YouHaveWrongVersionOfVidixLibrary "[VO_SUB_VIDIX] You have the wrong version of the VIDIX library.\n" -#define MSGTR_LIBVO_SUB_VIDIX_CouldntFindWorkingVidixDriver "[VO_SUB_VIDIX] Couldn't find working VIDIX driver.\n" -#define MSGTR_LIBVO_SUB_VIDIX_CouldntGetCapability "[VO_SUB_VIDIX] Couldn't get capability: %s.\n" - -// x11_common.c -#define MSGTR_EwmhFullscreenStateFailed "\nX11: Couldn't send EWMH fullscreen event!\n" -#define MSGTR_CouldNotFindXScreenSaver "xscreensaver_disable: Could not find XScreenSaver window.\n" -#define MSGTR_SelectedVideoMode "XF86VM: Selected video mode %dx%d for image size %dx%d.\n" - -#define MSGTR_InsertingAfVolume "[Mixer] No hardware mixing, inserting volume filter.\n" -#define MSGTR_NoVolume "[Mixer] No volume control available.\n" -#define MSGTR_NoBalance "[Mixer] No balance control available.\n" - -// old vo drivers that have been replaced -#define MSGTR_VO_PGM_HasBeenReplaced "The pgm video output driver has been replaced by -vo pnm:pgmyuv.\n" -#define MSGTR_VO_MD5_HasBeenReplaced "The md5 video output driver has been replaced by -vo md5sum.\n" - - -// ======================= audio output drivers ======================== - -// audio_out.c -#define MSGTR_AO_ALSA9_1x_Removed "audio_out: alsa9 and alsa1x modules were removed, use -ao alsa instead.\n" -#define MSGTR_AO_TryingPreferredAudioDriver "Trying preferred audio driver '%.*s', options '%s'\n" -#define MSGTR_AO_NoSuchDriver "No such audio driver '%.*s'\n" -#define MSGTR_AO_FailedInit "Failed to initialize audio driver '%s'\n" -#define MSGTR_AO_TryingEveryKnown "Trying every known audio driver...\n" - -// ao_oss.c -#define MSGTR_AO_OSS_CantOpenMixer "[AO OSS] audio_setup: Can't open mixer device %s: %s\n" -#define MSGTR_AO_OSS_ChanNotFound "[AO OSS] audio_setup: Audio card mixer does not have channel '%s', using default.\n" -#define MSGTR_AO_OSS_CantOpenDev "[AO OSS] audio_setup: Can't open audio device %s: %s\n" -#define MSGTR_AO_OSS_CantMakeFd "[AO OSS] audio_setup: Can't make file descriptor blocking: %s\n" -#define MSGTR_AO_OSS_CantSet "[AO OSS] Can't set audio device %s to %s output, trying %s...\n" -#define MSGTR_AO_OSS_CantSetChans "[AO OSS] audio_setup: Failed to set audio device to %d channels.\n" -#define MSGTR_AO_OSS_CantUseGetospace "[AO OSS] audio_setup: driver doesn't support SNDCTL_DSP_GETOSPACE :-(\n" -#define MSGTR_AO_OSS_CantUseSelect "[AO OSS]\n *** Your audio driver DOES NOT support select() ***\n Recompile MPlayer with #undef HAVE_AUDIO_SELECT in config.h !\n\n" -#define MSGTR_AO_OSS_CantReopen "[AO OSS]\nFatal error: *** CANNOT RE-OPEN / RESET AUDIO DEVICE *** %s\n" -#define MSGTR_AO_OSS_UnknownUnsupportedFormat "[AO OSS] Unknown/Unsupported OSS format: %x.\n" - -// ao_arts.c -#define MSGTR_AO_ARTS_CantInit "[AO ARTS] %s\n" -#define MSGTR_AO_ARTS_ServerConnect "[AO ARTS] Connected to sound server.\n" -#define MSGTR_AO_ARTS_CantOpenStream "[AO ARTS] Unable to open a stream.\n" -#define MSGTR_AO_ARTS_StreamOpen "[AO ARTS] Stream opened.\n" -#define MSGTR_AO_ARTS_BufferSize "[AO ARTS] buffer size: %d\n" - -// ao_dxr2.c -#define MSGTR_AO_DXR2_SetVolFailed "[AO DXR2] Setting volume to %d failed.\n" -#define MSGTR_AO_DXR2_UnsupSamplerate "[AO DXR2] %d Hz not supported, try to resample.\n" - -// ao_esd.c -#define MSGTR_AO_ESD_CantOpenSound "[AO ESD] esd_open_sound failed: %s\n" -#define MSGTR_AO_ESD_LatencyInfo "[AO ESD] latency: [server: %0.2fs, net: %0.2fs] (adjust %0.2fs)\n" -#define MSGTR_AO_ESD_CantOpenPBStream "[AO ESD] failed to open ESD playback stream: %s\n" - -// ao_mpegpes.c -#define MSGTR_AO_MPEGPES_CantSetMixer "[AO MPEGPES] DVB audio set mixer failed: %s.\n" -#define MSGTR_AO_MPEGPES_UnsupSamplerate "[AO MPEGPES] %d Hz not supported, try to resample.\n" - -// ao_pcm.c -#define MSGTR_AO_PCM_FileInfo "[AO PCM] File: %s (%s)\nPCM: Samplerate: %iHz Channels: %s Format %s\n" -#define MSGTR_AO_PCM_HintInfo "[AO PCM] Info: Faster dumping is achieved with -vc null -vo null -ao pcm:fast\n[AO PCM] Info: To write WAVE files use -ao pcm:waveheader (default).\n" -#define MSGTR_AO_PCM_CantOpenOutputFile "[AO PCM] Failed to open %s for writing!\n" - -// ao_sdl.c -#define MSGTR_AO_SDL_INFO "[AO SDL] Samplerate: %iHz Channels: %s Format %s\n" -#define MSGTR_AO_SDL_DriverInfo "[AO SDL] using %s audio driver.\n" -#define MSGTR_AO_SDL_UnsupportedAudioFmt "[AO SDL] Unsupported audio format: 0x%x.\n" -#define MSGTR_AO_SDL_CantInit "[AO SDL] SDL Audio initialization failed: %s\n" -#define MSGTR_AO_SDL_CantOpenAudio "[AO SDL] Unable to open audio: %s\n" - -// ao_sgi.c -#define MSGTR_AO_SGI_INFO "[AO SGI] control.\n" -#define MSGTR_AO_SGI_InitInfo "[AO SGI] init: Samplerate: %iHz Channels: %s Format %s\n" -#define MSGTR_AO_SGI_InvalidDevice "[AO SGI] play: invalid device.\n" -#define MSGTR_AO_SGI_CantSetParms_Samplerate "[AO SGI] init: setparams failed: %s\nCould not set desired samplerate.\n" -#define MSGTR_AO_SGI_CantSetAlRate "[AO SGI] init: AL_RATE was not accepted on the given resource.\n" -#define MSGTR_AO_SGI_CantGetParms "[AO SGI] init: getparams failed: %s\n" -#define MSGTR_AO_SGI_SampleRateInfo "[AO SGI] init: samplerate is now %lf (desired rate is %lf)\n" -#define MSGTR_AO_SGI_InitConfigError "[AO SGI] init: %s\n" -#define MSGTR_AO_SGI_InitOpenAudioFailed "[AO SGI] init: Unable to open audio channel: %s\n" -#define MSGTR_AO_SGI_Uninit "[AO SGI] uninit: ...\n" -#define MSGTR_AO_SGI_Reset "[AO SGI] reset: ...\n" -#define MSGTR_AO_SGI_PauseInfo "[AO SGI] audio_pause: ...\n" -#define MSGTR_AO_SGI_ResumeInfo "[AO SGI] audio_resume: ...\n" - -// ao_sun.c -#define MSGTR_AO_SUN_RtscSetinfoFailed "[AO SUN] rtsc: SETINFO failed.\n" -#define MSGTR_AO_SUN_RtscWriteFailed "[AO SUN] rtsc: write failed.\n" -#define MSGTR_AO_SUN_CantOpenAudioDev "[AO SUN] Can't open audio device %s, %s -> nosound.\n" -#define MSGTR_AO_SUN_UnsupSampleRate "[AO SUN] audio_setup: your card doesn't support %d channel, %s, %d Hz samplerate.\n" -#define MSGTR_AO_SUN_CantUseSelect "[AO SUN]\n *** Your audio driver DOES NOT support select() ***\nRecompile MPlayer with #undef HAVE_AUDIO_SELECT in config.h !\n\n" -#define MSGTR_AO_SUN_CantReopenReset "[AO SUN]\nFatal error: *** CANNOT REOPEN / RESET AUDIO DEVICE (%s) ***\n" - -// ao_alsa5.c -#define MSGTR_AO_ALSA5_InitInfo "[AO ALSA5] alsa-init: requested format: %d Hz, %d channels, %s\n" -#define MSGTR_AO_ALSA5_SoundCardNotFound "[AO ALSA5] alsa-init: no soundcards found.\n" -#define MSGTR_AO_ALSA5_InvalidFormatReq "[AO ALSA5] alsa-init: invalid format (%s) requested - output disabled.\n" -#define MSGTR_AO_ALSA5_PlayBackError "[AO ALSA5] alsa-init: playback open error: %s\n" -#define MSGTR_AO_ALSA5_PcmInfoError "[AO ALSA5] alsa-init: PCM info error: %s\n" -#define MSGTR_AO_ALSA5_SoundcardsFound "[AO ALSA5] alsa-init: %d soundcard(s) found, using: %s\n" -#define MSGTR_AO_ALSA5_PcmChanInfoError "[AO ALSA5] alsa-init: PCM channel info error: %s\n" -#define MSGTR_AO_ALSA5_CantSetParms "[AO ALSA5] alsa-init: error setting parameters: %s\n" -#define MSGTR_AO_ALSA5_CantSetChan "[AO ALSA5] alsa-init: error setting up channel: %s\n" -#define MSGTR_AO_ALSA5_ChanPrepareError "[AO ALSA5] alsa-init: channel prepare error: %s\n" -#define MSGTR_AO_ALSA5_DrainError "[AO ALSA5] alsa-uninit: playback drain error: %s\n" -#define MSGTR_AO_ALSA5_FlushError "[AO ALSA5] alsa-uninit: playback flush error: %s\n" -#define MSGTR_AO_ALSA5_PcmCloseError "[AO ALSA5] alsa-uninit: PCM close error: %s\n" -#define MSGTR_AO_ALSA5_ResetDrainError "[AO ALSA5] alsa-reset: playback drain error: %s\n" -#define MSGTR_AO_ALSA5_ResetFlushError "[AO ALSA5] alsa-reset: playback flush error: %s\n" -#define MSGTR_AO_ALSA5_ResetChanPrepareError "[AO ALSA5] alsa-reset: channel prepare error: %s\n" -#define MSGTR_AO_ALSA5_PauseDrainError "[AO ALSA5] alsa-pause: playback drain error: %s\n" -#define MSGTR_AO_ALSA5_PauseFlushError "[AO ALSA5] alsa-pause: playback flush error: %s\n" -#define MSGTR_AO_ALSA5_ResumePrepareError "[AO ALSA5] alsa-resume: channel prepare error: %s\n" -#define MSGTR_AO_ALSA5_Underrun "[AO ALSA5] alsa-play: alsa underrun, resetting stream.\n" -#define MSGTR_AO_ALSA5_PlaybackPrepareError "[AO ALSA5] alsa-play: playback prepare error: %s\n" -#define MSGTR_AO_ALSA5_WriteErrorAfterReset "[AO ALSA5] alsa-play: write error after reset: %s - giving up.\n" -#define MSGTR_AO_ALSA5_OutPutError "[AO ALSA5] alsa-play: output error: %s\n" - -// ao_alsa.c -#define MSGTR_AO_ALSA_InvalidMixerIndexDefaultingToZero "[AO_ALSA] Invalid mixer index. Defaulting to 0.\n" -#define MSGTR_AO_ALSA_MixerOpenError "[AO_ALSA] Mixer open error: %s\n" -#define MSGTR_AO_ALSA_MixerAttachError "[AO_ALSA] Mixer attach %s error: %s\n" -#define MSGTR_AO_ALSA_MixerRegisterError "[AO_ALSA] Mixer register error: %s\n" -#define MSGTR_AO_ALSA_MixerLoadError "[AO_ALSA] Mixer load error: %s\n" -#define MSGTR_AO_ALSA_UnableToFindSimpleControl "[AO_ALSA] Unable to find simple control '%s',%i.\n" -#define MSGTR_AO_ALSA_ErrorSettingLeftChannel "[AO_ALSA] Error setting left channel, %s\n" -#define MSGTR_AO_ALSA_ErrorSettingRightChannel "[AO_ALSA] Error setting right channel, %s\n" -#define MSGTR_AO_ALSA_CommandlineHelp "\n[AO_ALSA] -ao alsa commandline help:\n"\ - "[AO_ALSA] Example: mplayer -ao alsa:device=hw=0.3\n"\ - "[AO_ALSA] Sets first card fourth hardware device.\n\n"\ - "[AO_ALSA] Options:\n"\ - "[AO_ALSA] noblock\n"\ - "[AO_ALSA] Opens device in non-blocking mode.\n"\ - "[AO_ALSA] device=\n"\ - "[AO_ALSA] Sets device (change , to . and : to =)\n" -#define MSGTR_AO_ALSA_ChannelsNotSupported "[AO_ALSA] %d channels are not supported.\n" -#define MSGTR_AO_ALSA_OpenInNonblockModeFailed "[AO_ALSA] Open in nonblock-mode failed, trying to open in block-mode.\n" -#define MSGTR_AO_ALSA_PlaybackOpenError "[AO_ALSA] Playback open error: %s\n" -#define MSGTR_AO_ALSA_ErrorSetBlockMode "[AL_ALSA] Error setting block-mode %s.\n" -#define MSGTR_AO_ALSA_UnableToGetInitialParameters "[AO_ALSA] Unable to get initial parameters: %s\n" -#define MSGTR_AO_ALSA_UnableToSetAccessType "[AO_ALSA] Unable to set access type: %s\n" -#define MSGTR_AO_ALSA_FormatNotSupportedByHardware "[AO_ALSA] Format %s is not supported by hardware, trying default.\n" -#define MSGTR_AO_ALSA_UnableToSetFormat "[AO_ALSA] Unable to set format: %s\n" -#define MSGTR_AO_ALSA_UnableToSetChannels "[AO_ALSA] Unable to set channels: %s\n" -#define MSGTR_AO_ALSA_UnableToDisableResampling "[AO_ALSA] Unable to disable resampling: %s\n" -#define MSGTR_AO_ALSA_UnableToSetSamplerate2 "[AO_ALSA] Unable to set samplerate-2: %s\n" -#define MSGTR_AO_ALSA_UnableToSetBufferTimeNear "[AO_ALSA] Unable to set buffer time near: %s\n" -#define MSGTR_AO_ALSA_UnableToGetPeriodSize "[AO ALSA] Unable to get period size: %s\n" -#define MSGTR_AO_ALSA_UnableToSetPeriods "[AO_ALSA] Unable to set periods: %s\n" -#define MSGTR_AO_ALSA_UnableToSetHwParameters "[AO_ALSA] Unable to set hw-parameters: %s\n" -#define MSGTR_AO_ALSA_UnableToGetBufferSize "[AO_ALSA] Unable to get buffersize: %s\n" -#define MSGTR_AO_ALSA_UnableToGetSwParameters "[AO_ALSA] Unable to get sw-parameters: %s\n" -#define MSGTR_AO_ALSA_UnableToSetSwParameters "[AO_ALSA] Unable to set sw-parameters: %s\n" -#define MSGTR_AO_ALSA_UnableToGetBoundary "[AO_ALSA] Unable to get boundary: %s\n" -#define MSGTR_AO_ALSA_UnableToSetStartThreshold "[AO_ALSA] Unable to set start threshold: %s\n" -#define MSGTR_AO_ALSA_UnableToSetStopThreshold "[AO_ALSA] Unable to set stop threshold: %s\n" -#define MSGTR_AO_ALSA_UnableToSetSilenceSize "[AO_ALSA] Unable to set silence size: %s\n" -#define MSGTR_AO_ALSA_PcmCloseError "[AO_ALSA] pcm close error: %s\n" -#define MSGTR_AO_ALSA_NoHandlerDefined "[AO_ALSA] No handler defined!\n" -#define MSGTR_AO_ALSA_PcmPrepareError "[AO_ALSA] pcm prepare error: %s\n" -#define MSGTR_AO_ALSA_PcmPauseError "[AO_ALSA] pcm pause error: %s\n" -#define MSGTR_AO_ALSA_PcmDropError "[AO_ALSA] pcm drop error: %s\n" -#define MSGTR_AO_ALSA_PcmResumeError "[AO_ALSA] pcm resume error: %s\n" -#define MSGTR_AO_ALSA_DeviceConfigurationError "[AO_ALSA] Device configuration error." -#define MSGTR_AO_ALSA_PcmInSuspendModeTryingResume "[AO_ALSA] Pcm in suspend mode, trying to resume.\n" -#define MSGTR_AO_ALSA_WriteError "[AO_ALSA] Write error: %s\n" -#define MSGTR_AO_ALSA_TryingToResetSoundcard "[AO_ALSA] Trying to reset soundcard.\n" -#define MSGTR_AO_ALSA_CannotGetPcmStatus "[AO_ALSA] Cannot get pcm status: %s\n" - -// ao_plugin.c -#define MSGTR_AO_PLUGIN_InvalidPlugin "[AO PLUGIN] invalid plugin: %s\n" - - -// ======================= audio filters ================================ - -// af_scaletempo.c -#define MSGTR_AF_ValueOutOfRange MSGTR_VO_ValueOutOfRange - -// af_ladspa.c -#define MSGTR_AF_LADSPA_AvailableLabels "available labels in" -#define MSGTR_AF_LADSPA_WarnNoInputs "WARNING! This LADSPA plugin has no audio inputs.\n The incoming audio signal will be lost." -#define MSGTR_AF_LADSPA_ErrMultiChannel "Multi-channel (>2) plugins are not supported (yet).\n Use only mono and stereo plugins." -#define MSGTR_AF_LADSPA_ErrNoOutputs "This LADSPA plugin has no audio outputs." -#define MSGTR_AF_LADSPA_ErrInOutDiff "The number of audio inputs and audio outputs of the LADSPA plugin differ." -#define MSGTR_AF_LADSPA_ErrFailedToLoad "failed to load" -#define MSGTR_AF_LADSPA_ErrNoDescriptor "Couldn't find ladspa_descriptor() function in the specified library file." -#define MSGTR_AF_LADSPA_ErrLabelNotFound "Couldn't find label in plugin library." -#define MSGTR_AF_LADSPA_ErrNoSuboptions "No suboptions specified." -#define MSGTR_AF_LADSPA_ErrNoLibFile "No library file specified." -#define MSGTR_AF_LADSPA_ErrNoLabel "No filter label specified." -#define MSGTR_AF_LADSPA_ErrNotEnoughControls "Not enough controls specified on the command line." -#define MSGTR_AF_LADSPA_ErrControlBelow "%s: Input control #%d is below lower boundary of %0.4f.\n" -#define MSGTR_AF_LADSPA_ErrControlAbove "%s: Input control #%d is above upper boundary of %0.4f.\n" - -// format.c -#define MSGTR_AF_FORMAT_UnknownFormat "unknown format " - - -// ========================== INPUT ========================================= - -// joystick.c -#define MSGTR_INPUT_JOYSTICK_Opening "Opening joystick device %s\n" -#define MSGTR_INPUT_JOYSTICK_CantOpen "Can't open joystick device %s: %s\n" -#define MSGTR_INPUT_JOYSTICK_ErrReading "Error while reading joystick device: %s\n" -#define MSGTR_INPUT_JOYSTICK_LoosingBytes "Joystick: We lose %d bytes of data\n" -#define MSGTR_INPUT_JOYSTICK_WarnLostSync "Joystick: warning init event, we have lost sync with driver.\n" -#define MSGTR_INPUT_JOYSTICK_WarnUnknownEvent "Joystick warning unknown event type %d\n" - -// appleir.c -#define MSGTR_INPUT_APPLE_IR_Init "Initializing Apple IR on %s\n" -#define MSGTR_INPUT_APPLE_IR_Detect "Detected Apple IR on %s\n" -#define MSGTR_INPUT_APPLE_IR_CantOpen "Can't open Apple IR device: %s\n" - -// input.c -#define MSGTR_INPUT_INPUT_ErrCantRegister2ManyCmdFds "Too many command file descriptors, cannot register file descriptor %d.\n" -#define MSGTR_INPUT_INPUT_ErrCantRegister2ManyKeyFds "Too many key file descriptors, cannot register file descriptor %d.\n" -#define MSGTR_INPUT_INPUT_ErrArgMustBeInt "Command %s: argument %d isn't an integer.\n" -#define MSGTR_INPUT_INPUT_ErrArgMustBeFloat "Command %s: argument %d isn't a float.\n" -#define MSGTR_INPUT_INPUT_ErrUnterminatedArg "Command %s: argument %d is unterminated.\n" -#define MSGTR_INPUT_INPUT_ErrUnknownArg "Unknown argument %d\n" -#define MSGTR_INPUT_INPUT_Err2FewArgs "Command %s requires at least %d arguments, we found only %d so far.\n" -#define MSGTR_INPUT_INPUT_ErrReadingCmdFd "Error while reading command file descriptor %d: %s\n" -#define MSGTR_INPUT_INPUT_ErrCmdBufferFullDroppingContent "Command buffer of file descriptor %d is full: dropping content.\n" -#define MSGTR_INPUT_INPUT_ErrInvalidCommandForKey "Invalid command for bound key %s" -#define MSGTR_INPUT_INPUT_ErrSelect "Select error: %s\n" -#define MSGTR_INPUT_INPUT_ErrOnKeyInFd "Error on key input file descriptor %d\n" -#define MSGTR_INPUT_INPUT_ErrDeadKeyOnFd "Dead key input on file descriptor %d\n" -#define MSGTR_INPUT_INPUT_Err2ManyKeyDowns "Too many key down events at the same time\n" -#define MSGTR_INPUT_INPUT_ErrOnCmdFd "Error on command file descriptor %d\n" -#define MSGTR_INPUT_INPUT_ErrReadingInputConfig "Error while reading input config file %s: %s\n" -#define MSGTR_INPUT_INPUT_ErrUnknownKey "Unknown key '%s'\n" -#define MSGTR_INPUT_INPUT_ErrUnfinishedBinding "Unfinished binding %s\n" -#define MSGTR_INPUT_INPUT_ErrBuffer2SmallForKeyName "Buffer is too small for this key name: %s\n" -#define MSGTR_INPUT_INPUT_ErrNoCmdForKey "No command found for key %s" -#define MSGTR_INPUT_INPUT_ErrBuffer2SmallForCmd "Buffer is too small for command %s\n" -#define MSGTR_INPUT_INPUT_ErrWhyHere "What are we doing here?\n" -#define MSGTR_INPUT_INPUT_ErrCantInitJoystick "Can't init input joystick\n" -#define MSGTR_INPUT_INPUT_ErrCantStatFile "Can't stat %s: %s\n" -#define MSGTR_INPUT_INPUT_ErrCantOpenFile "Can't open %s: %s\n" -#define MSGTR_INPUT_INPUT_ErrCantInitAppleRemote "Can't init Apple Remote.\n" - -// lirc.c -#define MSGTR_SettingUpLIRC "Setting up LIRC support...\n" -#define MSGTR_LIRCopenfailed "Failed to open LIRC support. You will not be able to use your remote control.\n" -#define MSGTR_LIRCcfgerr "Failed to read LIRC config file %s.\n" - - -// ========================== LIBMPDEMUX =================================== - -// muxer.c, muxer_*.c -#define MSGTR_TooManyStreams "Too many streams!" -#define MSGTR_RawMuxerOnlyOneStream "Rawaudio muxer supports only one audio stream!\n" -#define MSGTR_IgnoringVideoStream "Ignoring video stream!\n" -#define MSGTR_UnknownStreamType "Warning, unknown stream type: %d\n" -#define MSGTR_WarningLenIsntDivisible "Warning, len isn't divisible by samplesize!\n" -#define MSGTR_MuxbufMallocErr "Muxer frame buffer cannot allocate memory!\n" -#define MSGTR_MuxbufReallocErr "Muxer frame buffer cannot reallocate memory!\n" -#define MSGTR_MuxbufSending "Muxer frame buffer sending %d frame(s) to the muxer.\n" -#define MSGTR_WritingHeader "Writing header...\n" -#define MSGTR_WritingTrailer "Writing index...\n" - -// demuxer.c, demux_*.c -#define MSGTR_AudioStreamRedefined "WARNING: Audio stream header %d redefined.\n" -#define MSGTR_VideoStreamRedefined "WARNING: Video stream header %d redefined.\n" -#define MSGTR_TooManyAudioInBuffer "\nToo many audio packets in the buffer: (%d in %d bytes).\n" -#define MSGTR_TooManyVideoInBuffer "\nToo many video packets in the buffer: (%d in %d bytes).\n" -#define MSGTR_MaybeNI "Maybe you are playing a non-interleaved stream/file or the codec failed?\n" \ - "For AVI files, try to force non-interleaved mode with the -ni option.\n" -#define MSGTR_WorkAroundBlockAlignHeaderBug "AVI: Working around CBR-MP3 nBlockAlign header bug!\n" -#define MSGTR_SwitchToNi "\nBadly interleaved AVI file detected - switching to -ni mode...\n" -#define MSGTR_InvalidAudioStreamNosound "AVI: invalid audio stream ID: %d - ignoring (nosound)\n" -#define MSGTR_InvalidAudioStreamUsingDefault "AVI: invalid video stream ID: %d - ignoring (using default)\n" -#define MSGTR_ON2AviFormat "ON2 AVI format" -#define MSGTR_Detected_XXX_FileFormat "%s file format detected.\n" -#define MSGTR_DetectedAudiofile "Audio file detected.\n" -#define MSGTR_NotSystemStream "Not MPEG System Stream format... (maybe Transport Stream?)\n" -#define MSGTR_InvalidMPEGES "Invalid MPEG-ES stream??? Contact the author, it may be a bug :(\n" -#define MSGTR_FormatNotRecognized "============ Sorry, this file format is not recognized/supported =============\n"\ - "=== If this file is an AVI, ASF or MPEG stream, please contact the author! ===\n" -#define MSGTR_SettingProcessPriority "Setting process priority: %s\n" -#define MSGTR_FilefmtFourccSizeFpsFtime "[V] filefmt:%d fourcc:0x%X size:%dx%d fps:%5.3f ftime:=%6.4f\n" -#define MSGTR_CannotInitializeMuxer "Cannot initialize muxer." -#define MSGTR_MissingVideoStream "No video stream found.\n" -#define MSGTR_MissingAudioStream "No audio stream found -> no sound.\n" -#define MSGTR_MissingVideoStreamBug "Missing video stream!? Contact the author, it may be a bug :(\n" - -#define MSGTR_DoesntContainSelectedStream "demux: File doesn't contain the selected audio or video stream.\n" - -#define MSGTR_NI_Forced "Forced" -#define MSGTR_NI_Detected "Detected" -#define MSGTR_NI_Message "%s NON-INTERLEAVED AVI file format.\n" - -#define MSGTR_UsingNINI "Using NON-INTERLEAVED broken AVI file format.\n" -#define MSGTR_CouldntDetFNo "Could not determine number of frames (for absolute seek).\n" -#define MSGTR_CantSeekRawAVI "Cannot seek in raw AVI streams. (Index required, try with the -idx switch.)\n" -#define MSGTR_CantSeekFile "Cannot seek in this file.\n" - -#define MSGTR_MOVcomprhdr "MOV: Compressed headers support requires ZLIB!\n" -#define MSGTR_MOVvariableFourCC "MOV: WARNING: Variable FourCC detected!?\n" -#define MSGTR_MOVtooManyTrk "MOV: WARNING: too many tracks" -#define MSGTR_FoundAudioStream "==> Found audio stream: %d\n" -#define MSGTR_FoundVideoStream "==> Found video stream: %d\n" -#define MSGTR_DetectedTV "TV detected! ;-)\n" -#define MSGTR_ErrorOpeningOGGDemuxer "Unable to open the Ogg demuxer.\n" -#define MSGTR_ASFSearchingForAudioStream "ASF: Searching for audio stream (id:%d).\n" -#define MSGTR_CannotOpenAudioStream "Cannot open audio stream: %s\n" -#define MSGTR_CannotOpenSubtitlesStream "Cannot open subtitle stream: %s\n" -#define MSGTR_OpeningAudioDemuxerFailed "Failed to open audio demuxer: %s\n" -#define MSGTR_OpeningSubtitlesDemuxerFailed "Failed to open subtitle demuxer: %s\n" -#define MSGTR_TVInputNotSeekable "TV input is not seekable! (Seeking will probably be for changing channels ;)\n" -#define MSGTR_DemuxerInfoChanged "Demuxer info %s changed to %s\n" -#define MSGTR_ClipInfo "Clip info:\n" - -#define MSGTR_LeaveTelecineMode "\ndemux_mpg: 30000/1001fps NTSC content detected, switching framerate.\n" -#define MSGTR_EnterTelecineMode "\ndemux_mpg: 24000/1001fps progressive NTSC content detected, switching framerate.\n" - -#define MSGTR_CacheFill "\rCache fill: %5.2f%% (%"PRId64" bytes) " -#define MSGTR_NoBindFound "No bind found for key '%s'." -#define MSGTR_FailedToOpen "Failed to open %s.\n" - -#define MSGTR_VideoID "[%s] Video stream found, -vid %d\n" -#define MSGTR_AudioID "[%s] Audio stream found, -aid %d\n" -#define MSGTR_SubtitleID "[%s] Subtitle stream found, -sid %d\n" - -// asfheader.c -#define MSGTR_MPDEMUX_ASFHDR_HeaderSizeOver1MB "FATAL: header size bigger than 1 MB (%d)!\nPlease contact MPlayer authors, and upload/send this file.\n" -#define MSGTR_MPDEMUX_ASFHDR_HeaderMallocFailed "Could not allocate %d bytes for header.\n" -#define MSGTR_MPDEMUX_ASFHDR_EOFWhileReadingHeader "EOF while reading ASF header, broken/incomplete file?\n" -#define MSGTR_MPDEMUX_ASFHDR_DVRWantsLibavformat "DVR will probably only work with libavformat, try -demuxer 35 if you have problems\n" -#define MSGTR_MPDEMUX_ASFHDR_NoDataChunkAfterHeader "No data chunk following header!\n" -#define MSGTR_MPDEMUX_ASFHDR_AudioVideoHeaderNotFound "ASF: no audio or video headers found - broken file?\n" -#define MSGTR_MPDEMUX_ASFHDR_InvalidLengthInASFHeader "Invalid length in ASF header!\n" -#define MSGTR_MPDEMUX_ASFHDR_DRMLicenseURL "DRM License URL: %s\n" -#define MSGTR_MPDEMUX_ASFHDR_DRMProtected "This file has been encumbered with DRM encryption, it will not play in MPlayer!\n" - -// aviheader.c -#define MSGTR_MPDEMUX_AVIHDR_EmptyList "** empty list?!\n" -#define MSGTR_MPDEMUX_AVIHDR_FoundMovieAt "Found movie at 0x%X - 0x%X\n" -#define MSGTR_MPDEMUX_AVIHDR_FoundBitmapInfoHeader "Found 'bih', %u bytes of %d\n" -#define MSGTR_MPDEMUX_AVIHDR_RegeneratingKeyfTableForMPG4V1 "Regenerating keyframe table for M$ mpg4v1 video.\n" -#define MSGTR_MPDEMUX_AVIHDR_RegeneratingKeyfTableForDIVX3 "Regenerating keyframe table for DIVX3 video.\n" -#define MSGTR_MPDEMUX_AVIHDR_RegeneratingKeyfTableForMPEG4 "Regenerating keyframe table for MPEG-4 video.\n" -#define MSGTR_MPDEMUX_AVIHDR_FoundWaveFmt "Found 'wf', %d bytes of %d\n" -#define MSGTR_MPDEMUX_AVIHDR_FoundAVIV2Header "AVI: dmlh found (size=%d) (total_frames=%d)\n" -#define MSGTR_MPDEMUX_AVIHDR_ReadingIndexBlockChunksForFrames "Reading INDEX block, %d chunks for %d frames (fpos=%"PRId64").\n" -#define MSGTR_MPDEMUX_AVIHDR_AdditionalRIFFHdr "Additional RIFF header...\n" -#define MSGTR_MPDEMUX_AVIHDR_WarnNotExtendedAVIHdr "** Warning: this is no extended AVI header..\n" -#define MSGTR_MPDEMUX_AVIHDR_BrokenChunk "Broken chunk? chunksize=%d (id=%.4s)\n" -#define MSGTR_MPDEMUX_AVIHDR_BuildingODMLidx "AVI: ODML: Building ODML index (%d superindexchunks).\n" -#define MSGTR_MPDEMUX_AVIHDR_BrokenODMLfile "AVI: ODML: Broken (incomplete?) file detected. Will use traditional index.\n" -#define MSGTR_MPDEMUX_AVIHDR_CantReadIdxFile "Can't read index file %s: %s\n" -#define MSGTR_MPDEMUX_AVIHDR_NotValidMPidxFile "%s is not a valid MPlayer index file.\n" -#define MSGTR_MPDEMUX_AVIHDR_FailedMallocForIdxFile "Could not allocate memory for index data from %s.\n" -#define MSGTR_MPDEMUX_AVIHDR_PrematureEOF "premature end of index file %s\n" -#define MSGTR_MPDEMUX_AVIHDR_IdxFileLoaded "Loaded index file: %s\n" -#define MSGTR_MPDEMUX_AVIHDR_GeneratingIdx "Generating Index: %3lu %s \r" -#define MSGTR_MPDEMUX_AVIHDR_IdxGeneratedForHowManyChunks "AVI: Generated index table for %d chunks!\n" -#define MSGTR_MPDEMUX_AVIHDR_Failed2WriteIdxFile "Couldn't write index file %s: %s\n" -#define MSGTR_MPDEMUX_AVIHDR_IdxFileSaved "Saved index file: %s\n" - -// demux_audio.c -#define MSGTR_MPDEMUX_AUDIO_UnknownFormat "Audio demuxer: unknown format %d.\n" - -// demux_demuxers.c -#define MSGTR_MPDEMUX_DEMUXERS_FillBufferError "fill_buffer error: bad demuxer: not vd, ad or sd.\n" - -// demux_mkv.c -#define MSGTR_MPDEMUX_MKV_ZlibInitializationFailed "[mkv] zlib initialization failed.\n" -#define MSGTR_MPDEMUX_MKV_ZlibDecompressionFailed "[mkv] zlib decompression failed.\n" -#define MSGTR_MPDEMUX_MKV_LzoInitializationFailed "[mkv] lzo initialization failed.\n" -#define MSGTR_MPDEMUX_MKV_LzoDecompressionFailed "[mkv] lzo decompression failed.\n" -#define MSGTR_MPDEMUX_MKV_TrackEncrypted "[mkv] Track number %u has been encrypted and decryption has not yet been\n[mkv] implemented. Skipping track.\n" -#define MSGTR_MPDEMUX_MKV_UnknownContentEncoding "[mkv] Unknown content encoding type for track %u. Skipping track.\n" -#define MSGTR_MPDEMUX_MKV_UnknownCompression "[mkv] Track %u has been compressed with an unknown/unsupported compression\n[mkv] algorithm (%u). Skipping track.\n" -#define MSGTR_MPDEMUX_MKV_ZlibCompressionUnsupported "[mkv] Track %u was compressed with zlib but mplayer has not been compiled\n[mkv] with support for zlib compression. Skipping track.\n" -#define MSGTR_MPDEMUX_MKV_TrackIDName "[mkv] Track ID %u: %s (%s) \"%s\", %s\n" -#define MSGTR_MPDEMUX_MKV_TrackID "[mkv] Track ID %u: %s (%s), %s\n" -#define MSGTR_MPDEMUX_MKV_UnknownCodecID "[mkv] Unknown/unsupported CodecID (%s) or missing/bad CodecPrivate\n[mkv] data (track %u).\n" -#define MSGTR_MPDEMUX_MKV_FlacTrackDoesNotContainValidHeaders "[mkv] FLAC track does not contain valid headers.\n" -#define MSGTR_MPDEMUX_MKV_UnknownAudioCodec "[mkv] Unknown/unsupported audio codec ID '%s' for track %u or missing/faulty\n[mkv] private codec data.\n" -#define MSGTR_MPDEMUX_MKV_SubtitleTypeNotSupported "[mkv] Subtitle type '%s' is not supported.\n" -#define MSGTR_MPDEMUX_MKV_WillPlayVideoTrack "[mkv] Will play video track %u.\n" -#define MSGTR_MPDEMUX_MKV_NoVideoTrackFound "[mkv] No video track found/wanted.\n" -#define MSGTR_MPDEMUX_MKV_NoAudioTrackFound "[mkv] No audio track found/wanted.\n" -#define MSGTR_MPDEMUX_MKV_WillDisplaySubtitleTrack "[mkv] Will display subtitle track %u.\n" -#define MSGTR_MPDEMUX_MKV_NoBlockDurationForSubtitleTrackFound "[mkv] Warning: No BlockDuration for subtitle track found.\n" -#define MSGTR_MPDEMUX_MKV_TooManySublines "[mkv] Warning: too many sublines to render, skipping.\n" -#define MSGTR_MPDEMUX_MKV_TooManySublinesSkippingAfterFirst "\n[mkv] Warning: too many sublines to render, skipping after first %i.\n" - -// demux_nuv.c -#define MSGTR_MPDEMUX_NUV_NoVideoBlocksInFile "No video blocks in file.\n" - -// demux_xmms.c -#define MSGTR_MPDEMUX_XMMS_FoundPlugin "Found plugin: %s (%s).\n" -#define MSGTR_MPDEMUX_XMMS_ClosingPlugin "Closing plugin: %s.\n" -#define MSGTR_MPDEMUX_XMMS_WaitForStart "Waiting for the XMMS plugin to start playback of '%s'...\n" - - -// ========================== LIBMENU =================================== - -// common -#define MSGTR_LIBMENU_NoEntryFoundInTheMenuDefinition "[MENU] No entry found in the menu definition.\n" - -// libmenu/menu.c -#define MSGTR_LIBMENU_SyntaxErrorAtLine "[MENU] syntax error at line: %d\n" -#define MSGTR_LIBMENU_MenuDefinitionsNeedANameAttrib "[MENU] Menu definitions need a name attribute (line %d).\n" -#define MSGTR_LIBMENU_BadAttrib "[MENU] bad attribute %s=%s in menu '%s' at line %d\n" -#define MSGTR_LIBMENU_UnknownMenuType "[MENU] unknown menu type '%s' at line %d\n" -#define MSGTR_LIBMENU_CantOpenConfigFile "[MENU] Can't open menu config file: %s\n" -#define MSGTR_LIBMENU_ConfigFileIsTooBig "[MENU] Config file is too big (> %d KB)\n" -#define MSGTR_LIBMENU_ConfigFileIsEmpty "[MENU] Config file is empty.\n" -#define MSGTR_LIBMENU_MenuNotFound "[MENU] Menu %s not found.\n" -#define MSGTR_LIBMENU_MenuInitFailed "[MENU] Menu '%s': Init failed.\n" -#define MSGTR_LIBMENU_UnsupportedOutformat "[MENU] Unsupported output format!!!!\n" - -// libmenu/menu_cmdlist.c -#define MSGTR_LIBMENU_ListMenuEntryDefinitionsNeedAName "[MENU] List menu entry definitions need a name (line %d).\n" -#define MSGTR_LIBMENU_ListMenuNeedsAnArgument "[MENU] List menu needs an argument.\n" - -// libmenu/menu_console.c -#define MSGTR_LIBMENU_WaitPidError "[MENU] Waitpid error: %s.\n" -#define MSGTR_LIBMENU_SelectError "[MENU] Select error.\n" -#define MSGTR_LIBMENU_ReadErrorOnChildFD "[MENU] Read error on child's file descriptor: %s.\n" -#define MSGTR_LIBMENU_ConsoleRun "[MENU] Console run: %s ...\n" -#define MSGTR_LIBMENU_AChildIsAlreadyRunning "[MENU] A child is already running.\n" -#define MSGTR_LIBMENU_ForkFailed "[MENU] Fork failed !!!\n" -#define MSGTR_LIBMENU_WriteError "[MENU] write error\n" - -// libmenu/menu_filesel.c -#define MSGTR_LIBMENU_OpendirError "[MENU] opendir error: %s\n" -#define MSGTR_LIBMENU_ReallocError "[MENU] realloc error: %s\n" -#define MSGTR_LIBMENU_MallocError "[MENU] memory allocation error: %s\n" -#define MSGTR_LIBMENU_ReaddirError "[MENU] readdir error: %s\n" -#define MSGTR_LIBMENU_CantOpenDirectory "[MENU] Can't open directory %s.\n" - -// libmenu/menu_param.c -#define MSGTR_LIBMENU_SubmenuDefinitionNeedAMenuAttribut "[MENU] Submenu definition needs a 'menu' attribute.\n" -#define MSGTR_LIBMENU_InvalidProperty "[MENU] Invalid property '%s' in pref menu entry. (line %d).\n" -#define MSGTR_LIBMENU_PrefMenuEntryDefinitionsNeed "[MENU] Pref menu entry definitions need a valid 'property' or 'txt' attribute (line %d).\n" -#define MSGTR_LIBMENU_PrefMenuNeedsAnArgument "[MENU] Pref menu needs an argument.\n" - -// libmenu/menu_pt.c -#define MSGTR_LIBMENU_CantfindTheTargetItem "[MENU] Can't find the target item ????\n" -#define MSGTR_LIBMENU_FailedToBuildCommand "[MENU] Failed to build command: %s.\n" - -// libmenu/menu_txt.c -#define MSGTR_LIBMENU_MenuTxtNeedATxtFileName "[MENU] Text menu needs a textfile name (parameter file).\n" -#define MSGTR_LIBMENU_MenuTxtCantOpen "[MENU] Can't open %s.\n" -#define MSGTR_LIBMENU_WarningTooLongLineSplitting "[MENU] Warning, line too long. Splitting it.\n" -#define MSGTR_LIBMENU_ParsedLines "[MENU] Parsed %d lines.\n" - -// libmenu/vf_menu.c -#define MSGTR_LIBMENU_UnknownMenuCommand "[MENU] Unknown command: '%s'.\n" -#define MSGTR_LIBMENU_FailedToOpenMenu "[MENU] Failed to open menu: '%s'.\n" - - -// ========================== LIBMPCODECS =================================== - -// dec_video.c & dec_audio.c: -#define MSGTR_CantOpenCodec "Could not open codec.\n" -#define MSGTR_CantCloseCodec "Could not close codec.\n" - -#define MSGTR_MissingDLLcodec "ERROR: Could not open required DirectShow codec %s.\n" -#define MSGTR_ACMiniterror "Could not load/initialize Win32/ACM audio codec (missing DLL file?).\n" -#define MSGTR_MissingLAVCcodec "Cannot find codec '%s' in libavcodec...\n" - -#define MSGTR_MpegNoSequHdr "MPEG: FATAL: EOF while searching for sequence header.\n" -#define MSGTR_CannotReadMpegSequHdr "FATAL: Cannot read sequence header.\n" -#define MSGTR_CannotReadMpegSequHdrEx "FATAL: Cannot read sequence header extension.\n" -#define MSGTR_BadMpegSequHdr "MPEG: bad sequence header\n" -#define MSGTR_BadMpegSequHdrEx "MPEG: bad sequence header extension\n" - -#define MSGTR_ShMemAllocFail "Cannot allocate shared memory.\n" -#define MSGTR_CantAllocAudioBuf "Cannot allocate audio out buffer.\n" - -#define MSGTR_UnknownAudio "Unknown/missing audio format -> no sound\n" - -#define MSGTR_UsingExternalPP "[PP] Using external postprocessing filter, max q = %d.\n" -#define MSGTR_UsingCodecPP "[PP] Using codec's postprocessing, max q = %d.\n" -#define MSGTR_VideoAttributeNotSupportedByVO_VD "Video attribute '%s' is not supported by selected vo & vd.\n" -#define MSGTR_VideoCodecFamilyNotAvailableStr "Requested video codec family [%s] (vfm=%s) not available.\nEnable it at compilation.\n" -#define MSGTR_AudioCodecFamilyNotAvailableStr "Requested audio codec family [%s] (afm=%s) not available.\nEnable it at compilation.\n" -#define MSGTR_OpeningVideoDecoder "Opening video decoder: [%s] %s\n" -#define MSGTR_SelectedVideoCodec "Selected video codec: [%s] vfm: %s (%s)\n" -#define MSGTR_OpeningAudioDecoder "Opening audio decoder: [%s] %s\n" -#define MSGTR_SelectedAudioCodec "Selected audio codec: [%s] afm: %s (%s)\n" -#define MSGTR_BuildingAudioFilterChain "Building audio filter chain for %dHz/%dch/%s -> %dHz/%dch/%s...\n" -#define MSGTR_UninitVideoStr "Uninit video: %s\n" -#define MSGTR_UninitAudioStr "Uninit audio: %s\n" -#define MSGTR_VDecoderInitFailed "VDecoder init failed :(\n" -#define MSGTR_ADecoderInitFailed "ADecoder init failed :(\n" -#define MSGTR_ADecoderPreinitFailed "ADecoder preinit failed :(\n" -#define MSGTR_AllocatingBytesForInputBuffer "dec_audio: Allocating %d bytes for input buffer.\n" -#define MSGTR_AllocatingBytesForOutputBuffer "dec_audio: Allocating %d + %d = %d bytes for output buffer.\n" - -// ad_dvdpcm.c: -#define MSGTR_SamplesWanted "Samples of this format are needed to improve support. Please contact the developers.\n" - -// libmpcodecs/ad_libdv.c -#define MSGTR_MPCODECS_AudioFramesizeDiffers "[AD_LIBDV] Warning! Audio framesize differs! read=%d hdr=%d.\n" - -// vd.c -#define MSGTR_CodecDidNotSet "VDec: Codec did not set sh->disp_w and sh->disp_h, trying workaround.\n" -#define MSGTR_CouldNotFindColorspace "Could not find matching colorspace - retrying with -vf scale...\n" -#define MSGTR_MovieAspectIsSet "Movie-Aspect is %.2f:1 - prescaling to correct movie aspect.\n" -#define MSGTR_MovieAspectUndefined "Movie-Aspect is undefined - no prescaling applied.\n" - -// vd_dshow.c, vd_dmo.c -#define MSGTR_DownloadCodecPackage "You need to upgrade/install the binary codecs package.\nGo to http://www.mplayerhq.hu/dload.html\n" -#define MSGTR_DShowInitOK "INFO: Win32/DShow video codec init OK.\n" -#define MSGTR_DMOInitOK "INFO: Win32/DMO video codec init OK.\n" - -// libmpcodecs/vd_dmo.c vd_dshow.c vd_vfw.c -#define MSGTR_MPCODECS_CouldntAllocateImageForCinepakCodec "[VD_DMO] Couldn't allocate image for cinepak codec.\n" - -// libmpcodecs/vd_ffmpeg.c -#define MSGTR_MPCODECS_XVMCAcceleratedCodec "[VD_FFMPEG] XVMC accelerated codec.\n" -#define MSGTR_MPCODECS_ArithmeticMeanOfQP "[VD_FFMPEG] Arithmetic mean of QP: %2.4f, Harmonic mean of QP: %2.4f\n" -#define MSGTR_MPCODECS_DRIFailure "[VD_FFMPEG] DRI failure.\n" -#define MSGTR_MPCODECS_CouldntAllocateImageForCodec "[VD_FFMPEG] Couldn't allocate image for codec.\n" -#define MSGTR_MPCODECS_XVMCAcceleratedMPEG2 "[VD_FFMPEG] XVMC-accelerated MPEG-2.\n" -#define MSGTR_MPCODECS_TryingPixfmt "[VD_FFMPEG] Trying pixfmt=%d.\n" -#define MSGTR_MPCODECS_McGetBufferShouldWorkOnlyWithXVMC "[VD_FFMPEG] The mc_get_buffer should work only with XVMC acceleration!!" -#define MSGTR_MPCODECS_UnexpectedInitVoError "[VD_FFMPEG] Unexpected init_vo error.\n" -#define MSGTR_MPCODECS_UnrecoverableErrorRenderBuffersNotTaken "[VD_FFMPEG] Unrecoverable error, render buffers not taken.\n" -#define MSGTR_MPCODECS_OnlyBuffersAllocatedByVoXvmcAllowed "[VD_FFMPEG] Only buffers allocated by vo_xvmc allowed.\n" - -// libmpcodecs/ve_lavc.c -#define MSGTR_MPCODECS_HighQualityEncodingSelected "[VE_LAVC] High quality encoding selected (non-realtime)!\n" -#define MSGTR_MPCODECS_UsingConstantQscale "[VE_LAVC] Using constant qscale = %f (VBR).\n" - -// libmpcodecs/ve_raw.c -#define MSGTR_MPCODECS_OutputWithFourccNotSupported "[VE_RAW] Raw output with FourCC [%x] not supported!\n" -#define MSGTR_MPCODECS_NoVfwCodecSpecified "[VE_RAW] Required VfW codec not specified!!\n" - -// vf.c -#define MSGTR_CouldNotFindVideoFilter "Couldn't find video filter '%s'.\n" -#define MSGTR_CouldNotOpenVideoFilter "Couldn't open video filter '%s'.\n" -#define MSGTR_OpeningVideoFilter "Opening video filter: " -#define MSGTR_CannotFindColorspace "Cannot find matching colorspace, even by inserting 'scale' :(\n" - -// libmpcodecs/vf_crop.c -#define MSGTR_MPCODECS_CropBadPositionWidthHeight "[CROP] Bad position/width/height - cropped area outside of the original!\n" - -// libmpcodecs/vf_cropdetect.c -#define MSGTR_MPCODECS_CropArea "[CROP] Crop area: X: %d..%d Y: %d..%d (-vf crop=%d:%d:%d:%d).\n" - -// libmpcodecs/vf_format.c, vf_palette.c, vf_noformat.c -#define MSGTR_MPCODECS_UnknownFormatName "[VF_FORMAT] Unknown format name: '%s'.\n" - -// libmpcodecs/vf_framestep.c vf_noformat.c vf_palette.c vf_tile.c -#define MSGTR_MPCODECS_ErrorParsingArgument "[VF_FRAMESTEP] Error parsing argument.\n" - -// libmpcodecs/ve_vfw.c -#define MSGTR_MPCODECS_CompressorType "Compressor type: %.4lx\n" -#define MSGTR_MPCODECS_CompressorSubtype "Compressor subtype: %.4lx\n" -#define MSGTR_MPCODECS_CompressorFlags "Compressor flags: %lu, version %lu, ICM version: %lu\n" -#define MSGTR_MPCODECS_Flags "Flags:" -#define MSGTR_MPCODECS_Quality " quality" - -// libmpcodecs/vf_expand.c -#define MSGTR_MPCODECS_FullDRNotPossible "Full DR not possible, trying SLICES instead!\n" -#define MSGTR_MPCODECS_WarnNextFilterDoesntSupportSlices "WARNING! Next filter doesn't support SLICES, get ready for sig11...\n" -#define MSGTR_MPCODECS_FunWhydowegetNULL "Why do we get NULL??\n" - -// libmpcodecs/vf_test.c, vf_yuy2.c, vf_yvu9.c -#define MSGTR_MPCODECS_WarnNextFilterDoesntSupport "%s not supported by next filter/vo :(\n" - - -// ================================== LIBASS ==================================== - -// ass_bitmap.c -#define MSGTR_LIBASS_FT_Glyph_To_BitmapError "[ass] FT_Glyph_To_Bitmap error %d \n" -#define MSGTR_LIBASS_UnsupportedPixelMode "[ass] Unsupported pixel mode: %d\n" -#define MSGTR_LIBASS_GlyphBBoxTooLarge "[ass] Glyph bounding box too large: %dx%dpx\n" - -// ass.c -#define MSGTR_LIBASS_NoStyleNamedXFoundUsingY "[ass] [%p] Warning: no style named '%s' found, using '%s'\n" -#define MSGTR_LIBASS_BadTimestamp "[ass] bad timestamp\n" -#define MSGTR_LIBASS_BadEncodedDataSize "[ass] bad encoded data size\n" -#define MSGTR_LIBASS_FontLineTooLong "[ass] Font line too long: %d, %s\n" -#define MSGTR_LIBASS_EventFormatHeaderMissing "[ass] Event format header missing\n" -#define MSGTR_LIBASS_ErrorOpeningIconvDescriptor "[ass] error opening iconv descriptor.\n" -#define MSGTR_LIBASS_ErrorRecodingFile "[ass] error recoding file.\n" -#define MSGTR_LIBASS_FopenFailed "[ass] ass_read_file(%s): fopen failed\n" -#define MSGTR_LIBASS_FseekFailed "[ass] ass_read_file(%s): fseek failed\n" -#define MSGTR_LIBASS_RefusingToLoadSubtitlesLargerThan100M "[ass] ass_read_file(%s): Refusing to load subtitles larger than 100M\n" -#define MSGTR_LIBASS_ReadFailed "Read failed, %d: %s\n" -#define MSGTR_LIBASS_AddedSubtitleFileMemory "[ass] Added subtitle file: (%d styles, %d events)\n" -#define MSGTR_LIBASS_AddedSubtitleFileFname "[ass] Added subtitle file: %s (%d styles, %d events)\n" -#define MSGTR_LIBASS_FailedToCreateDirectory "[ass] Failed to create directory %s\n" -#define MSGTR_LIBASS_NotADirectory "[ass] Not a directory: %s\n" - -// ass_cache.c -#define MSGTR_LIBASS_TooManyFonts "[ass] Too many fonts\n" -#define MSGTR_LIBASS_ErrorOpeningFont "[ass] Error opening font: %s, %d\n" - -// ass_fontconfig.c -#define MSGTR_LIBASS_SelectedFontFamilyIsNotTheRequestedOne "[ass] fontconfig: Selected font is not the requested one: '%s' != '%s'\n" -#define MSGTR_LIBASS_UsingDefaultFontFamily "[ass] fontconfig_select: Using default font family: (%s, %d, %d) -> %s, %d\n" -#define MSGTR_LIBASS_UsingDefaultFont "[ass] fontconfig_select: Using default font: (%s, %d, %d) -> %s, %d\n" -#define MSGTR_LIBASS_UsingArialFontFamily "[ass] fontconfig_select: Using 'Arial' font family: (%s, %d, %d) -> %s, %d\n" -#define MSGTR_LIBASS_FcInitLoadConfigAndFontsFailed "[ass] FcInitLoadConfigAndFonts failed.\n" -#define MSGTR_LIBASS_UpdatingFontCache "[ass] Updating font cache.\n" -#define MSGTR_LIBASS_BetaVersionsOfFontconfigAreNotSupported "[ass] Beta versions of fontconfig are not supported.\n[ass] Update before reporting any bugs.\n" -#define MSGTR_LIBASS_FcStrSetAddFailed "[ass] FcStrSetAdd failed.\n" -#define MSGTR_LIBASS_FcDirScanFailed "[ass] FcDirScan failed.\n" -#define MSGTR_LIBASS_FcDirSave "[ass] FcDirSave failed.\n" -#define MSGTR_LIBASS_FcConfigAppFontAddDirFailed "[ass] FcConfigAppFontAddDir failed\n" -#define MSGTR_LIBASS_FontconfigDisabledDefaultFontWillBeUsed "[ass] Fontconfig disabled, only default font will be used.\n" -#define MSGTR_LIBASS_FunctionCallFailed "[ass] %s failed\n" - -// ass_render.c -#define MSGTR_LIBASS_NeitherPlayResXNorPlayResYDefined "[ass] Neither PlayResX nor PlayResY defined. Assuming 384x288.\n" -#define MSGTR_LIBASS_PlayResYUndefinedSettingY "[ass] PlayResY undefined, setting %d.\n" -#define MSGTR_LIBASS_PlayResXUndefinedSettingX "[ass] PlayResX undefined, setting %d.\n" -#define MSGTR_LIBASS_FT_Init_FreeTypeFailed "[ass] FT_Init_FreeType failed.\n" -#define MSGTR_LIBASS_Init "[ass] Init\n" -#define MSGTR_LIBASS_InitFailed "[ass] Init failed.\n" -#define MSGTR_LIBASS_BadCommand "[ass] Bad command: %c%c\n" -#define MSGTR_LIBASS_ErrorLoadingGlyph "[ass] Error loading glyph.\n" -#define MSGTR_LIBASS_FT_Glyph_Stroke_Error "[ass] FT_Glyph_Stroke error %d \n" -#define MSGTR_LIBASS_UnknownEffectType_InternalError "[ass] Unknown effect type (internal error)\n" -#define MSGTR_LIBASS_NoStyleFound "[ass] No style found!\n" -#define MSGTR_LIBASS_EmptyEvent "[ass] Empty event!\n" -#define MSGTR_LIBASS_MAX_GLYPHS_Reached "[ass] MAX_GLYPHS reached: event %d, start = %llu, duration = %llu\n Text = %s\n" -#define MSGTR_LIBASS_EventHeightHasChanged "[ass] Warning! Event height has changed! \n" - -// ass_font.c -#define MSGTR_LIBASS_GlyphNotFoundReselectingFont "[ass] Glyph 0x%X not found, selecting one more font for (%s, %d, %d)\n" -#define MSGTR_LIBASS_GlyphNotFound "[ass] Glyph 0x%X not found in font for (%s, %d, %d)\n" -#define MSGTR_LIBASS_ErrorOpeningMemoryFont "[ass] Error opening memory font: %s\n" -#define MSGTR_LIBASS_NoCharmaps "[ass] font face with no charmaps\n" -#define MSGTR_LIBASS_NoCharmapAutodetected "[ass] no charmap autodetected, trying the first one\n" - - -// ================================== stream ==================================== - -// ai_alsa1x.c -#define MSGTR_MPDEMUX_AIALSA1X_CannotSetSamplerate "Cannot set samplerate.\n" -#define MSGTR_MPDEMUX_AIALSA1X_CannotSetBufferTime "Cannot set buffer time.\n" -#define MSGTR_MPDEMUX_AIALSA1X_CannotSetPeriodTime "Cannot set period time.\n" - -// ai_alsa1x.c / ai_alsa.c -#define MSGTR_MPDEMUX_AIALSA_PcmBrokenConfig "Broken configuration for this PCM: no configurations available.\n" -#define MSGTR_MPDEMUX_AIALSA_UnavailableAccessType "Access type not available.\n" -#define MSGTR_MPDEMUX_AIALSA_UnavailableSampleFmt "Sample format not available.\n" -#define MSGTR_MPDEMUX_AIALSA_UnavailableChanCount "Channel count not available - reverting to default: %d\n" -#define MSGTR_MPDEMUX_AIALSA_CannotInstallHWParams "Unable to install hardware paramameters: %s" -#define MSGTR_MPDEMUX_AIALSA_PeriodEqualsBufferSize "Can't use period equal to buffer size (%u == %lu)\n" -#define MSGTR_MPDEMUX_AIALSA_CannotInstallSWParams "Unable to install software parameters:\n" -#define MSGTR_MPDEMUX_AIALSA_ErrorOpeningAudio "Error opening audio: %s\n" -#define MSGTR_MPDEMUX_AIALSA_AlsaStatusError "ALSA status error: %s" -#define MSGTR_MPDEMUX_AIALSA_AlsaXRUN "ALSA xrun!!! (at least %.3f ms long)\n" -#define MSGTR_MPDEMUX_AIALSA_AlsaStatus "ALSA Status:\n" -#define MSGTR_MPDEMUX_AIALSA_AlsaXRUNPrepareError "ALSA xrun: prepare error: %s" -#define MSGTR_MPDEMUX_AIALSA_AlsaReadWriteError "ALSA read/write error" - -// ai_oss.c -#define MSGTR_MPDEMUX_AIOSS_Unable2SetChanCount "Unable to set channel count: %d\n" -#define MSGTR_MPDEMUX_AIOSS_Unable2SetStereo "Unable to set stereo: %d\n" -#define MSGTR_MPDEMUX_AIOSS_Unable2Open "Unable to open '%s': %s\n" -#define MSGTR_MPDEMUX_AIOSS_UnsupportedFmt "unsupported format\n" -#define MSGTR_MPDEMUX_AIOSS_Unable2SetAudioFmt "Unable to set audio format." -#define MSGTR_MPDEMUX_AIOSS_Unable2SetSamplerate "Unable to set samplerate: %d\n" -#define MSGTR_MPDEMUX_AIOSS_Unable2SetTrigger "Unable to set trigger: %d\n" -#define MSGTR_MPDEMUX_AIOSS_Unable2GetBlockSize "Unable to get block size!\n" -#define MSGTR_MPDEMUX_AIOSS_AudioBlockSizeZero "Audio block size is zero, setting to %d!\n" -#define MSGTR_MPDEMUX_AIOSS_AudioBlockSize2Low "Audio block size too low, setting to %d!\n" - -// asf_mmst_streaming.c -#define MSGTR_MPDEMUX_MMST_WriteError "write error\n" -#define MSGTR_MPDEMUX_MMST_EOFAlert "\nAlert! EOF\n" -#define MSGTR_MPDEMUX_MMST_PreHeaderReadFailed "pre-header read failed\n" -#define MSGTR_MPDEMUX_MMST_InvalidHeaderSize "Invalid header size, giving up.\n" -#define MSGTR_MPDEMUX_MMST_HeaderDataReadFailed "Header data read failed.\n" -#define MSGTR_MPDEMUX_MMST_packet_lenReadFailed "packet_len read failed.\n" -#define MSGTR_MPDEMUX_MMST_InvalidRTSPPacketSize "Invalid RTSP packet size, giving up.\n" -#define MSGTR_MPDEMUX_MMST_CmdDataReadFailed "Command data read failed.\n" -#define MSGTR_MPDEMUX_MMST_HeaderObject "header object\n" -#define MSGTR_MPDEMUX_MMST_DataObject "data object\n" -#define MSGTR_MPDEMUX_MMST_FileObjectPacketLen "file object, packet length = %d (%d)\n" -#define MSGTR_MPDEMUX_MMST_StreamObjectStreamID "stream object, stream ID: %d\n" -#define MSGTR_MPDEMUX_MMST_2ManyStreamID "Too many IDs, stream skipped." -#define MSGTR_MPDEMUX_MMST_UnknownObject "unknown object\n" -#define MSGTR_MPDEMUX_MMST_MediaDataReadFailed "Media data read failed.\n" -#define MSGTR_MPDEMUX_MMST_MissingSignature "missing signature\n" -#define MSGTR_MPDEMUX_MMST_PatentedTechnologyJoke "Everything done. Thank you for downloading a media file containing proprietary and patented technology.\n" -#define MSGTR_MPDEMUX_MMST_UnknownCmd "unknown command %02x\n" -#define MSGTR_MPDEMUX_MMST_GetMediaPacketErr "get_media_packet error : %s\n" -#define MSGTR_MPDEMUX_MMST_Connected "Connected\n" - -// asf_streaming.c -#define MSGTR_MPDEMUX_ASF_StreamChunkSize2Small "Ahhhh, stream_chunck size is too small: %d\n" -#define MSGTR_MPDEMUX_ASF_SizeConfirmMismatch "size_confirm mismatch!: %d %d\n" -#define MSGTR_MPDEMUX_ASF_WarnDropHeader "Warning: drop header ????\n" -#define MSGTR_MPDEMUX_ASF_ErrorParsingChunkHeader "Error while parsing chunk header\n" -#define MSGTR_MPDEMUX_ASF_NoHeaderAtFirstChunk "Didn't get a header as first chunk !!!!\n" -#define MSGTR_MPDEMUX_ASF_BufferMallocFailed "Error: Can't allocate %d bytes buffer.\n" -#define MSGTR_MPDEMUX_ASF_ErrReadingNetworkStream "Error while reading network stream.\n" -#define MSGTR_MPDEMUX_ASF_ErrChunk2Small "Error: Chunk is too small.\n" -#define MSGTR_MPDEMUX_ASF_ErrSubChunkNumberInvalid "Error: Subchunk number is invalid.\n" -#define MSGTR_MPDEMUX_ASF_Bandwidth2SmallCannotPlay "Bandwidth too small, file cannot be played!\n" -#define MSGTR_MPDEMUX_ASF_Bandwidth2SmallDeselectedAudio "Bandwidth too small, deselected audio stream.\n" -#define MSGTR_MPDEMUX_ASF_Bandwidth2SmallDeselectedVideo "Bandwidth too small, deselected video stream.\n" -#define MSGTR_MPDEMUX_ASF_InvalidLenInHeader "Invalid length in ASF header!\n" -#define MSGTR_MPDEMUX_ASF_ErrReadingChunkHeader "Error while reading chunk header.\n" -#define MSGTR_MPDEMUX_ASF_ErrChunkBiggerThanPacket "Error: chunk_size > packet_size\n" -#define MSGTR_MPDEMUX_ASF_ErrReadingChunk "Error while reading chunk.\n" -#define MSGTR_MPDEMUX_ASF_ASFRedirector "=====> ASF Redirector\n" -#define MSGTR_MPDEMUX_ASF_InvalidProxyURL "invalid proxy URL\n" -#define MSGTR_MPDEMUX_ASF_UnknownASFStreamType "unknown ASF stream type\n" -#define MSGTR_MPDEMUX_ASF_Failed2ParseHTTPResponse "Failed to parse HTTP response.\n" -#define MSGTR_MPDEMUX_ASF_ServerReturn "Server returned %d:%s\n" -#define MSGTR_MPDEMUX_ASF_ASFHTTPParseWarnCuttedPragma "ASF HTTP PARSE WARNING : Pragma %s cut from %d bytes to %d\n" -#define MSGTR_MPDEMUX_ASF_SocketWriteError "socket write error: %s\n" -#define MSGTR_MPDEMUX_ASF_HeaderParseFailed "Failed to parse header.\n" -#define MSGTR_MPDEMUX_ASF_NoStreamFound "No stream found.\n" -#define MSGTR_MPDEMUX_ASF_UnknownASFStreamingType "unknown ASF streaming type\n" -#define MSGTR_MPDEMUX_ASF_InfoStreamASFURL "STREAM_ASF, URL: %s\n" -#define MSGTR_MPDEMUX_ASF_StreamingFailed "Failed, exiting.\n" - -// audio_in.c -#define MSGTR_MPDEMUX_AUDIOIN_ErrReadingAudio "\nError reading audio: %s\n" -#define MSGTR_MPDEMUX_AUDIOIN_XRUNSomeFramesMayBeLeftOut "Recovered from cross-run, some frames may be left out!\n" -#define MSGTR_MPDEMUX_AUDIOIN_ErrFatalCannotRecover "Fatal error, cannot recover!\n" -#define MSGTR_MPDEMUX_AUDIOIN_NotEnoughSamples "\nNot enough audio samples!\n" - -// cache2.c -#define MSGTR_MPDEMUX_CACHE2_NonCacheableStream "\rThis stream is non-cacheable.\n" -#define MSGTR_MPDEMUX_CACHE2_ReadFileposDiffers "!!! read_filepos differs!!! Report this bug...\n" - -// network.c -#define MSGTR_MPDEMUX_NW_UnknownAF "Unknown address family %d\n" -#define MSGTR_MPDEMUX_NW_ResolvingHostForAF "Resolving %s for %s...\n" -#define MSGTR_MPDEMUX_NW_CantResolv "Couldn't resolve name for %s: %s\n" -#define MSGTR_MPDEMUX_NW_ConnectingToServer "Connecting to server %s[%s]: %d...\n" -#define MSGTR_MPDEMUX_NW_CantConnect2Server "Failed to connect to server with %s\n" -#define MSGTR_MPDEMUX_NW_SelectFailed "Select failed.\n" -#define MSGTR_MPDEMUX_NW_ConnTimeout "connection timeout\n" -#define MSGTR_MPDEMUX_NW_GetSockOptFailed "getsockopt failed: %s\n" -#define MSGTR_MPDEMUX_NW_ConnectError "connect error: %s\n" -#define MSGTR_MPDEMUX_NW_InvalidProxySettingTryingWithout "Invalid proxy setting... Trying without proxy.\n" -#define MSGTR_MPDEMUX_NW_CantResolvTryingWithoutProxy "Could not resolve remote hostname for AF_INET. Trying without proxy.\n" -#define MSGTR_MPDEMUX_NW_ErrSendingHTTPRequest "Error while sending HTTP request: Didn't send all the request.\n" -#define MSGTR_MPDEMUX_NW_ReadFailed "Read failed.\n" -#define MSGTR_MPDEMUX_NW_Read0CouldBeEOF "http_read_response read 0 (i.e. EOF).\n" -#define MSGTR_MPDEMUX_NW_AuthFailed "Authentication failed. Please use the -user and -passwd options to provide your\n"\ - "username/password for a list of URLs, or form an URL like:\n"\ - "http://username:password@hostname/file\n" -#define MSGTR_MPDEMUX_NW_AuthRequiredFor "Authentication required for %s\n" -#define MSGTR_MPDEMUX_NW_AuthRequired "Authentication required.\n" -#define MSGTR_MPDEMUX_NW_NoPasswdProvidedTryingBlank "No password provided, trying blank password.\n" -#define MSGTR_MPDEMUX_NW_ErrServerReturned "Server returns %d: %s\n" -#define MSGTR_MPDEMUX_NW_CacheSizeSetTo "Cache size set to %d KBytes\n" - -// open.c, stream.c: -#define MSGTR_CdDevNotfound "CD-ROM Device '%s' not found.\n" -#define MSGTR_ErrTrackSelect "Error selecting VCD track." -#define MSGTR_ReadSTDIN "Reading from stdin...\n" -#define MSGTR_UnableOpenURL "Unable to open URL: %s\n" -#define MSGTR_ConnToServer "Connected to server: %s\n" -#define MSGTR_FileNotFound "File not found: '%s'\n" - -#define MSGTR_SMBInitError "Cannot init the libsmbclient library: %d\n" -#define MSGTR_SMBFileNotFound "Could not open from LAN: '%s'\n" -#define MSGTR_SMBNotCompiled "MPlayer was not compiled with SMB reading support.\n" - -#define MSGTR_CantOpenDVD "Couldn't open DVD device: %s (%s)\n" - -// stream_cdda.c -#define MSGTR_MPDEMUX_CDDA_CantOpenCDDADevice "Can't open CDDA device.\n" -#define MSGTR_MPDEMUX_CDDA_CantOpenDisc "Can't open disc.\n" -#define MSGTR_MPDEMUX_CDDA_AudioCDFoundWithNTracks "Found audio CD with %ld tracks.\n" - -// stream_cddb.c -#define MSGTR_MPDEMUX_CDDB_FailedToReadTOC "Failed to read TOC.\n" -#define MSGTR_MPDEMUX_CDDB_FailedToOpenDevice "Failed to open %s device.\n" -#define MSGTR_MPDEMUX_CDDB_NotAValidURL "not a valid URL\n" -#define MSGTR_MPDEMUX_CDDB_FailedToSendHTTPRequest "Failed to send the HTTP request.\n" -#define MSGTR_MPDEMUX_CDDB_FailedToReadHTTPResponse "Failed to read the HTTP response.\n" -#define MSGTR_MPDEMUX_CDDB_HTTPErrorNOTFOUND "Not Found.\n" -#define MSGTR_MPDEMUX_CDDB_HTTPErrorUnknown "unknown error code\n" -#define MSGTR_MPDEMUX_CDDB_NoCacheFound "No cache found.\n" -#define MSGTR_MPDEMUX_CDDB_NotAllXMCDFileHasBeenRead "Not all the xmcd file has been read.\n" -#define MSGTR_MPDEMUX_CDDB_FailedToCreateDirectory "Failed to create directory %s.\n" -#define MSGTR_MPDEMUX_CDDB_NotAllXMCDFileHasBeenWritten "Not all of the xmcd file has been written.\n" -#define MSGTR_MPDEMUX_CDDB_InvalidXMCDDatabaseReturned "Invalid xmcd database file returned.\n" -#define MSGTR_MPDEMUX_CDDB_UnexpectedFIXME "unexpected FIXME\n" -#define MSGTR_MPDEMUX_CDDB_UnhandledCode "unhandled code\n" -#define MSGTR_MPDEMUX_CDDB_UnableToFindEOL "Unable to find end of line.\n" -#define MSGTR_MPDEMUX_CDDB_ParseOKFoundAlbumTitle "Parse OK, found: %s\n" -#define MSGTR_MPDEMUX_CDDB_AlbumNotFound "Album not found.\n" -#define MSGTR_MPDEMUX_CDDB_ServerReturnsCommandSyntaxErr "Server returns: Command syntax error\n" -#define MSGTR_MPDEMUX_CDDB_NoSitesInfoAvailable "No sites information available.\n" -#define MSGTR_MPDEMUX_CDDB_FailedToGetProtocolLevel "Failed to get the protocol level.\n" -#define MSGTR_MPDEMUX_CDDB_NoCDInDrive "No CD in the drive.\n" - -// stream_cue.c -#define MSGTR_MPDEMUX_CUEREAD_UnexpectedCuefileLine "[bincue] Unexpected cuefile line: %s\n" -#define MSGTR_MPDEMUX_CUEREAD_BinFilenameTested "[bincue] bin filename tested: %s\n" -#define MSGTR_MPDEMUX_CUEREAD_CannotFindBinFile "[bincue] Couldn't find the bin file - giving up.\n" -#define MSGTR_MPDEMUX_CUEREAD_UsingBinFile "[bincue] Using bin file %s.\n" -#define MSGTR_MPDEMUX_CUEREAD_UnknownModeForBinfile "[bincue] unknown mode for binfile. Should not happen. Aborting.\n" -#define MSGTR_MPDEMUX_CUEREAD_CannotOpenCueFile "[bincue] Cannot open %s.\n" -#define MSGTR_MPDEMUX_CUEREAD_ErrReadingFromCueFile "[bincue] Error reading from %s\n" -#define MSGTR_MPDEMUX_CUEREAD_ErrGettingBinFileSize "[bincue] Error getting size of bin file.\n" -#define MSGTR_MPDEMUX_CUEREAD_InfoTrackFormat "track %02d: format=%d %02d:%02d:%02d\n" -#define MSGTR_MPDEMUX_CUEREAD_UnexpectedBinFileEOF "[bincue] unexpected end of bin file\n" -#define MSGTR_MPDEMUX_CUEREAD_CannotReadNBytesOfPayload "[bincue] Couldn't read %d bytes of payload.\n" -#define MSGTR_MPDEMUX_CUEREAD_CueStreamInfo_FilenameTrackTracksavail "CUE stream_open, filename=%s, track=%d, available tracks: %d -> %d\n" - -// stream_dvd.c -#define MSGTR_DVDspeedCantOpen "Couldn't open DVD device for writing, changing DVD speed needs write access.\n" -#define MSGTR_DVDrestoreSpeed "Restoring DVD speed... " -#define MSGTR_DVDlimitSpeed "Limiting DVD speed to %dKB/s... " -#define MSGTR_DVDlimitFail "failed\n" -#define MSGTR_DVDlimitOk "successful\n" -#define MSGTR_NoDVDSupport "MPlayer was compiled without DVD support, exiting.\n" -#define MSGTR_DVDnumTitles "There are %d titles on this DVD.\n" -#define MSGTR_DVDinvalidTitle "Invalid DVD title number: %d\n" -#define MSGTR_DVDnumChapters "There are %d chapters in this DVD title.\n" -#define MSGTR_DVDinvalidChapter "Invalid DVD chapter number: %d\n" -#define MSGTR_DVDinvalidChapterRange "Invalid chapter range specification %s\n" -#define MSGTR_DVDinvalidLastChapter "Invalid DVD last chapter number: %d\n" -#define MSGTR_DVDnumAngles "There are %d angles in this DVD title.\n" -#define MSGTR_DVDinvalidAngle "Invalid DVD angle number: %d\n" -#define MSGTR_DVDnoIFO "Cannot open the IFO file for DVD title %d.\n" -#define MSGTR_DVDnoVMG "Can't open VMG info!\n" -#define MSGTR_DVDnoVOBs "Cannot open title VOBS (VTS_%02d_1.VOB).\n" -#define MSGTR_DVDnoMatchingAudio "No matching DVD audio language found!\n" -#define MSGTR_DVDaudioChannel "Selected DVD audio channel: %d language: %c%c\n" -#define MSGTR_DVDaudioStreamInfo "audio stream: %d format: %s (%s) language: %s aid: %d.\n" -#define MSGTR_DVDnumAudioChannels "number of audio channels on disk: %d.\n" -#define MSGTR_DVDnoMatchingSubtitle "No matching DVD subtitle language found!\n" -#define MSGTR_DVDsubtitleChannel "Selected DVD subtitle channel: %d language: %c%c\n" -#define MSGTR_DVDsubtitleLanguage "subtitle ( sid ): %d language: %s\n" -#define MSGTR_DVDnumSubtitles "number of subtitles on disk: %d\n" - -// stream_radio.c -#define MSGTR_RADIO_ChannelNamesDetected "[radio] Radio channel names detected.\n" -#define MSGTR_RADIO_FreqRange "[radio] Allowed frequency range is %.2f-%.2f MHz.\n" -#define MSGTR_RADIO_WrongFreqForChannel "[radio] Wrong frequency for channel %s\n" -#define MSGTR_RADIO_WrongChannelNumberFloat "[radio] Wrong channel number: %.2f\n" -#define MSGTR_RADIO_WrongChannelNumberInt "[radio] Wrong channel number: %d\n" -#define MSGTR_RADIO_WrongChannelName "[radio] Wrong channel name: %s\n" -#define MSGTR_RADIO_FreqParameterDetected "[radio] Radio frequency parameter detected.\n" -#define MSGTR_RADIO_DoneParsingChannels "[radio] Done parsing channels.\n" -#define MSGTR_RADIO_GetTunerFailed "[radio] Warning: ioctl get tuner failed: %s. Setting frac to %d.\n" -#define MSGTR_RADIO_NotRadioDevice "[radio] %s is no radio device!\n" -#define MSGTR_RADIO_TunerCapLowYes "[radio] tuner is low:yes frac=%d\n" -#define MSGTR_RADIO_TunerCapLowNo "[radio] tuner is low:no frac=%d\n" -#define MSGTR_RADIO_SetFreqFailed "[radio] ioctl set frequency 0x%x (%.2f) failed: %s\n" -#define MSGTR_RADIO_GetFreqFailed "[radio] ioctl get frequency failed: %s\n" -#define MSGTR_RADIO_SetMuteFailed "[radio] ioctl set mute failed: %s\n" -#define MSGTR_RADIO_QueryControlFailed "[radio] ioctl query control failed: %s\n" -#define MSGTR_RADIO_GetVolumeFailed "[radio] ioctl get volume failed: %s\n" -#define MSGTR_RADIO_SetVolumeFailed "[radio] ioctl set volume failed: %s\n" -#define MSGTR_RADIO_DroppingFrame "\n[radio] too bad - dropping audio frame (%d bytes)!\n" -#define MSGTR_RADIO_BufferEmpty "[radio] grab_audio_frame: buffer empty, waiting for %d data bytes.\n" -#define MSGTR_RADIO_AudioInitFailed "[radio] audio_in_init failed: %s\n" -#define MSGTR_RADIO_AudioBuffer "[radio] Audio capture - buffer=%d bytes (block=%d bytes).\n" -#define MSGTR_RADIO_AllocateBufferFailed "[radio] cannot allocate audio buffer (block=%d,buf=%d): %s\n" -#define MSGTR_RADIO_CurrentFreq "[radio] Current frequency: %.2f\n" -#define MSGTR_RADIO_SelectedChannel "[radio] Selected channel: %d - %s (freq: %.2f)\n" -#define MSGTR_RADIO_ChangeChannelNoChannelList "[radio] Can not change channel: no channel list given.\n" -#define MSGTR_RADIO_UnableOpenDevice "[radio] Unable to open '%s': %s\n" -#define MSGTR_RADIO_RadioDevice "[radio] Radio fd: %d, %s\n" -#define MSGTR_RADIO_InitFracFailed "[radio] init_frac failed.\n" -#define MSGTR_RADIO_WrongFreq "[radio] Wrong frequency: %.2f\n" -#define MSGTR_RADIO_UsingFreq "[radio] Using frequency: %.2f.\n" -#define MSGTR_RADIO_AudioInInitFailed "[radio] audio_in_init failed.\n" -#define MSGTR_RADIO_BufferString "[radio] %s: in buffer=%d dropped=%d\n" -#define MSGTR_RADIO_AudioInSetupFailed "[radio] audio_in_setup call failed: %s\n" -#define MSGTR_RADIO_CaptureStarting "[radio] Starting capture stuff.\n" -#define MSGTR_RADIO_ClearBufferFailed "[radio] Clearing buffer failed: %s\n" -#define MSGTR_RADIO_StreamEnableCacheFailed "[radio] Call to stream_enable_cache failed: %s\n" -#define MSGTR_RADIO_DriverUnknownStr "[radio] Unknown driver name: %s\n" -#define MSGTR_RADIO_DriverV4L2 "[radio] Using V4Lv2 radio interface.\n" -#define MSGTR_RADIO_DriverV4L "[radio] Using V4Lv1 radio interface.\n" -#define MSGTR_RADIO_DriverBSDBT848 "[radio] Using *BSD BT848 radio interface.\n" -#define MSGTR_RADIO_AvailableDrivers "[radio] Available drivers: " - -//tv.c -#define MSGTR_TV_BogusNormParameter "tv.c: norm_from_string(%s): Bogus norm parameter, setting %s.\n" -#define MSGTR_TV_NoVideoInputPresent "Error: No video input present!\n" -#define MSGTR_TV_UnknownImageFormat ""\ - "==================================================================\n"\ - " WARNING: UNTESTED OR UNKNOWN OUTPUT IMAGE FORMAT REQUESTED (0x%x)\n"\ - " This may cause buggy playback or program crash! Bug reports will\n"\ - " be ignored! You should try again with YV12 (which is the default\n"\ - " colorspace) and read the documentation!\n"\ - "==================================================================\n" -#define MSGTR_TV_SelectedNormId "Selected norm id: %d\n" -#define MSGTR_TV_SelectedNorm "Selected norm : %s\n" -#define MSGTR_TV_CannotSetNorm "Error: Cannot set norm!\n" -#define MSGTR_TV_MJP_WidthHeight " MJP: width %d height %d\n" -#define MSGTR_TV_UnableToSetWidth "Unable to set requested width: %d\n" -#define MSGTR_TV_UnableToSetHeight "Unable to set requested height: %d\n" -#define MSGTR_TV_NoTuner "Selected input hasn't got a tuner!\n" -#define MSGTR_TV_UnableFindChanlist "Unable to find selected channel list! (%s)\n" -#define MSGTR_TV_SelectedChanlist "Selected channel list: %s (including %d channels)\n" -#define MSGTR_TV_ChannelFreqParamConflict "You can't set frequency and channel simultaneously!\n" -#define MSGTR_TV_ChannelNamesDetected "TV channel names detected.\n" -#define MSGTR_TV_NoFreqForChannel "Couldn't find frequency for channel %s (%s)\n" -#define MSGTR_TV_SelectedChannel3 "Selected channel: %s - %s (freq: %.3f)\n" -#define MSGTR_TV_SelectedChannel2 "Selected channel: %s (freq: %.3f)\n" -#define MSGTR_TV_SelectedFrequency "Selected frequency: %lu (%.3f)\n" -#define MSGTR_TV_RequestedChannel "Requested channel: %s\n" -#define MSGTR_TV_UnsupportedAudioType "Audio type '%s (%x)' unsupported!\n" -#define MSGTR_TV_AudioFormat " TV audio: %d channels, %d bits, %d Hz\n" -#define MSGTR_TV_AvailableDrivers "Available drivers:\n" -#define MSGTR_TV_DriverInfo "Selected driver: %s\n name: %s\n author: %s\n comment: %s\n" -#define MSGTR_TV_NoSuchDriver "No such driver: %s\n" -#define MSGTR_TV_DriverAutoDetectionFailed "TV driver autodetection failed.\n" -#define MSGTR_TV_UnknownColorOption "Unknown color option (%d) specified!\n" -#define MSGTR_TV_CurrentFrequency "Current frequency: %lu (%.3f)\n" -#define MSGTR_TV_NoTeletext "No teletext" -#define MSGTR_TV_Bt848IoctlFailed "tvi_bsdbt848: Call to %s ioctl failed. Error: %s\n" -#define MSGTR_TV_Bt848InvalidAudioRate "tvi_bsdbt848: Invalid audio rate. Error: %s\n" -#define MSGTR_TV_Bt848ErrorOpeningBktrDev "tvi_bsdbt848: Unable to open bktr device. Error: %s\n" -#define MSGTR_TV_Bt848ErrorOpeningTunerDev "tvi_bsdbt848: Unable to open tuner device. Error: %s\n" -#define MSGTR_TV_Bt848ErrorOpeningDspDev "tvi_bsdbt848: Unable to open dsp device. Error: %s\n" -#define MSGTR_TV_Bt848ErrorConfiguringDsp "tvi_bsdbt848: Configuration of dsp failed. Error: %s\n" -#define MSGTR_TV_Bt848ErrorReadingAudio "tvi_bsdbt848: Error reading audio data. Error: %s\n" -#define MSGTR_TV_Bt848MmapFailed "tvi_bsdbt848: mmap failed. Error: %s\n" -#define MSGTR_TV_Bt848FrameBufAllocFailed "tvi_bsdbt848: Frame buffer allocation failed. Error: %s\n" -#define MSGTR_TV_Bt848ErrorSettingWidth "tvi_bsdbt848: Error setting picture width. Error: %s\n" -#define MSGTR_TV_Bt848ErrorSettingHeight "tvi_bsdbt848: Error setting picture height. Error: %s\n" -#define MSGTR_TV_Bt848UnableToStopCapture "tvi_bsdbt848: Unable to stop capture. Error: %s\n" -#define MSGTR_TV_TTSupportedLanguages "Supported Teletext languages:\n" -#define MSGTR_TV_TTSelectedLanguage "Selected default teletext language: %s\n" -#define MSGTR_TV_ScannerNotAvailableWithoutTuner "Channel scanner is not available without tuner\n" - -//tvi_dshow.c -#define MSGTR_TVI_DS_UnableConnectInputVideoDecoder "Unable to connect given input to video decoder. Error:0x%x\n" -#define MSGTR_TVI_DS_UnableConnectInputAudioDecoder "Unable to connect given input to audio decoder. Error:0x%x\n" -#define MSGTR_TVI_DS_UnableSelectVideoFormat "tvi_dshow: Unable to select video format. Error:0x%x\n" -#define MSGTR_TVI_DS_UnableSelectAudioFormat "tvi_dshow: Unable to select audio format. Error:0x%x\n" -#define MSGTR_TVI_DS_UnableGetMediaControlInterface "tvi_dshow: Unable to get IMediaControl interface. Error:0x%x\n" -#define MSGTR_TVI_DS_UnableStartGraph "tvi_dshow: Unable to start graph! Error:0x%x\n" -#define MSGTR_TVI_DS_DeviceNotFound "tvi_dshow: Device #%d not found\n" -#define MSGTR_TVI_DS_UnableGetDeviceName "tvi_dshow: Unable to get name for device #%d\n" -#define MSGTR_TVI_DS_UsingDevice "tvi_dshow: Using device #%d: %s\n" -#define MSGTR_TVI_DS_DeviceName "tvi_dshow: Device #%d: %s\n" -#define MSGTR_TVI_DS_DirectGetFreqFailed "tvi_dshow: Unable to get frequency directly. OS built-in channels table will be used.\n" -#define MSGTR_TVI_DS_DirectSetFreqFailed "tvi_dshow: Unable to set frequency directly. OS built-in channels table will be used.\n" -#define MSGTR_TVI_DS_SupportedNorms "tvi_dshow: supported norms:" -#define MSGTR_TVI_DS_AvailableVideoInputs "tvi_dshow: available video inputs:" -#define MSGTR_TVI_DS_AvailableAudioInputs "tvi_dshow: available audio inputs:" -//following phrase will be printed near the selected audio/video input -#define MSGTR_TVI_DS_InputSelected "(selected)" -#define MSGTR_TVI_DS_UnableExtractFreqTable "tvi_dshow: Unable to load frequency table from kstvtune.ax\n" -#define MSGTR_TVI_DS_WrongDeviceParam "tvi_dshow: Wrong device parameter: %s\n" -#define MSGTR_TVI_DS_WrongDeviceIndex "tvi_dshow: Wrong device index: %d\n" -#define MSGTR_TVI_DS_WrongADeviceParam "tvi_dshow: Wrong adevice parameter: %s\n" -#define MSGTR_TVI_DS_WrongADeviceIndex "tvi_dshow: Wrong adevice index: %d\n" - -#define MSGTR_TVI_DS_SamplerateNotsupported "tvi_dshow: Samplerate %d is not supported by device. Failing back to first available.\n" -#define MSGTR_TVI_DS_VideoAdjustigNotSupported "tvi_dshow: Adjusting of brightness/hue/saturation/contrast is not supported by device\n" - -#define MSGTR_TVI_DS_ChangingWidthHeightNotSupported "tvi_dshow: Changing video width/height is not supported by device.\n" -#define MSGTR_TVI_DS_SelectingInputNotSupported "tvi_dshow: Selection of capture source is not supported by device\n" -#define MSGTR_TVI_DS_FreqTableLoaded "tvi_dshow: loaded system (%s) frequency table for country id=%d (channels:%d).\n" -#define MSGTR_TVI_DS_ErrorParsingAudioFormatStruct "tvi_dshow: Unable to parse audio format structure.\n" -#define MSGTR_TVI_DS_ErrorParsingVideoFormatStruct "tvi_dshow: Unable to parse video format structure.\n" -#define MSGTR_TVI_DS_UnableSetAudioMode "tvi_dshow: Unable to set audio mode %d. Error:0x%x\n" -#define MSGTR_TVI_DS_UnsupportedMediaType "tvi_dshow: Unsupported media type passed to %s\n" -#define MSGTR_TVI_DS_UnableGetsupportedVideoFormats "tvi_dshow: Unable to get supported media formats from video pin. Error:0x%x\n" -#define MSGTR_TVI_DS_UnableGetsupportedAudioFormats "tvi_dshow: Unable to get supported media formats from audio pin. Error:0x%x Disabling audio.\n" -#define MSGTR_TVI_DS_UnableFindNearestChannel "tvi_dshow: Unable to find nearest channel in system frequency table\n" -#define MSGTR_TVI_DS_UnableToSetChannel "tvi_dshow: Unable to switch to nearest channel from system frequency table. Error:0x%x\n" -#define MSGTR_TVI_DS_UnableTerminateVPPin "tvi_dshow: Unable to terminate VideoPort pin with any filter in graph. Error:0x%x\n" -#define MSGTR_TVI_DS_UnableBuildVideoSubGraph "tvi_dshow: Unable to build video chain of capture graph. Error:0x%x\n" -#define MSGTR_TVI_DS_UnableBuildAudioSubGraph "tvi_dshow: Unable to build audio chain of capture graph. Error:0x%x\n" -#define MSGTR_TVI_DS_UnableBuildVBISubGraph "tvi_dshow: Unable to build VBI chain of capture graph. Error:0x%x\n" -#define MSGTR_TVI_DS_GraphInitFailure "tvi_dshow: Directshow graph initialization failure.\n" -#define MSGTR_TVI_DS_NoVideoCaptureDevice "tvi_dshow: Unable to find video capture device\n" -#define MSGTR_TVI_DS_NoAudioCaptureDevice "tvi_dshow: Unable to find audio capture device\n" -#define MSGTR_TVI_DS_GetActualMediatypeFailed "tvi_dshow: Unable to get actual mediatype (Error:0x%x). Assuming equal to requested.\n" - -// url.c -#define MSGTR_MPDEMUX_URL_StringAlreadyEscaped "String appears to be already escaped in url_escape %c%c1%c2\n" diff --git a/libeplayer2/container/intreadwrite.h b/libeplayer2/container/intreadwrite.h deleted file mode 100644 index bf93c7e..0000000 --- a/libeplayer2/container/intreadwrite.h +++ /dev/null @@ -1,251 +0,0 @@ -#ifndef AVUTIL_INTREADWRITE_H -#define AVUTIL_INTREADWRITE_H - -#include -#include -//#include "config.h" -//#include "bswap.h" - -#if ARCH_ARM -# include "arm/bswap.h" -#elif ARCH_BFIN -# include "bfin/bswap.h" -#elif ARCH_SH4 -# include "sh4/bswap.h" -#elif ARCH_X86 -# include "x86/bswap.h" -#endif - -#ifndef bswap_16 -static inline const uint16_t bswap_16(uint16_t x) -{ - x = (x >> 8) | (x << 8); - return x; -} -#endif - -#ifndef bswap_32 -static inline const uint32_t bswap_32(uint32_t x) -{ - x = ((x << 8) & 0xFF00FF00) | ((x >> 8) & 0x00FF00FF); - x = (x >> 16) | (x << 16); - return x; -} -#endif - -#ifndef bswap_64 -static inline uint64_t const bswap_64(uint64_t x) -{ -#if 0 - x = ((x << 8) & 0xFF00FF00FF00FF00ULL) | ((x >> 8) & 0x00FF00FF00FF00FFULL); - x = ((x << 16) & 0xFFFF0000FFFF0000ULL) | ((x >> 16) & 0x0000FFFF0000FFFFULL); - return (x >> 32) | (x << 32); -#else - union - { - uint64_t ll; - uint32_t l[2]; - } w, r; - w.ll = x; - r.l[0] = bswap_32(w.l[1]); - r.l[1] = bswap_32(w.l[0]); - return r.ll; -#endif -} -#endif - -// be2me ... BigEndian to MachineEndian -// le2me ... LittleEndian to MachineEndian - -#ifdef WORDS_BIGENDIAN -#define be2me_16(x) (x) -#define be2me_32(x) (x) -#define be2me_64(x) (x) -#define le2me_16(x) bswap_16(x) -#define le2me_32(x) bswap_32(x) -#define le2me_64(x) bswap_64(x) -#else -#define be2me_16(x) bswap_16(x) -#define be2me_32(x) bswap_32(x) -#define be2me_64(x) bswap_64(x) -#define le2me_16(x) (x) -#define le2me_32(x) (x) -#define le2me_64(x) (x) -#endif - -#ifdef __GNUC__ - -struct unaligned_64 -{ - uint64_t l; -} __attribute__((packed)); -struct unaligned_32 -{ - uint32_t l; -} __attribute__((packed)); -struct unaligned_16 -{ - uint16_t l; -} __attribute__((packed)); - -#define AV_RN16(a) (((const struct unaligned_16 *) (a))->l) -#define AV_RN32(a) (((const struct unaligned_32 *) (a))->l) -#define AV_RN64(a) (((const struct unaligned_64 *) (a))->l) - -#define AV_WN16(a, b) (((struct unaligned_16 *) (a))->l) = (b) -#define AV_WN32(a, b) (((struct unaligned_32 *) (a))->l) = (b) -#define AV_WN64(a, b) (((struct unaligned_64 *) (a))->l) = (b) - -#elif defined(__DECC) - -#define AV_RN16(a) (*((const __unaligned uint16_t*)(a))) -#define AV_RN32(a) (*((const __unaligned uint32_t*)(a))) -#define AV_RN64(a) (*((const __unaligned uint64_t*)(a))) - -#define AV_WN16(a, b) *((__unaligned uint16_t*)(a)) = (b) -#define AV_WN32(a, b) *((__unaligned uint32_t*)(a)) = (b) -#define AV_WN64(a, b) *((__unaligned uint64_t*)(a)) = (b) - -#else - -#define AV_RN16(a) (*((const uint16_t*)(a))) -#define AV_RN32(a) (*((const uint32_t*)(a))) -#define AV_RN64(a) (*((const uint64_t*)(a))) - -#define AV_WN16(a, b) *((uint16_t*)(a)) = (b) -#define AV_WN32(a, b) *((uint32_t*)(a)) = (b) -#define AV_WN64(a, b) *((uint64_t*)(a)) = (b) - -#endif /* !__GNUC__ */ - -/* endian macros */ -#define AV_RB8(x) (((const uint8_t*)(x))[0]) -#define AV_WB8(p, d) do { ((uint8_t*)(p))[0] = (d); } while(0) - -#define AV_RL8(x) AV_RB8(x) -#define AV_WL8(p, d) AV_WB8(p, d) - -#if HAVE_FAST_UNALIGNED -# ifdef WORDS_BIGENDIAN -# define AV_RB16(x) AV_RN16(x) -# define AV_WB16(p, d) AV_WN16(p, d) - -# define AV_RL16(x) bswap_16(AV_RN16(x)) -# define AV_WL16(p, d) AV_WN16(p, bswap_16(d)) - -# define AV_RB32(x) AV_RN32(x) -# define AV_WB32(p, d) AV_WN32(p, d) - -# define AV_RL32(x) bswap_32(AV_RN32(x)) -# define AV_WL32(p, d) AV_WN32(p, bswap_32(d)) - -# define AV_RB64(x) AV_RN64(x) -# define AV_WB64(p, d) AV_WN64(p, d) - -# define AV_RL64(x) bswap_64(AV_RN64(x)) -# define AV_WL64(p, d) AV_WN64(p, bswap_64(d)) -# else /* WORDS_BIGENDIAN */ -# define AV_RB16(x) bswap_16(AV_RN16(x)) -# define AV_WB16(p, d) AV_WN16(p, bswap_16(d)) - -# define AV_RL16(x) AV_RN16(x) -# define AV_WL16(p, d) AV_WN16(p, d) - -# define AV_RB32(x) bswap_32(AV_RN32(x)) -# define AV_WB32(p, d) AV_WN32(p, bswap_32(d)) - -# define AV_RL32(x) AV_RN32(x) -# define AV_WL32(p, d) AV_WN32(p, d) - -# define AV_RB64(x) bswap_64(AV_RN64(x)) -# define AV_WB64(p, d) AV_WN64(p, bswap_64(d)) - -# define AV_RL64(x) AV_RN64(x) -# define AV_WL64(p, d) AV_WN64(p, d) -# endif -#else /* HAVE_FAST_UNALIGNED */ -#define AV_RB16(x) ((((const uint8_t*)(x))[0] << 8) | ((const uint8_t*)(x))[1]) -#define AV_WB16(p, d) do { \ - ((uint8_t*)(p))[1] = (d); \ - ((uint8_t*)(p))[0] = (d)>>8; } while(0) - -#define AV_RL16(x) ((((const uint8_t*)(x))[1] << 8) | \ - ((const uint8_t*)(x))[0]) -#define AV_WL16(p, d) do { \ - ((uint8_t*)(p))[0] = (d); \ - ((uint8_t*)(p))[1] = (d)>>8; } while(0) - -#define AV_RB32(x) ((((const uint8_t*)(x))[0] << 24) | \ - (((const uint8_t*)(x))[1] << 16) | \ - (((const uint8_t*)(x))[2] << 8) | \ - ((const uint8_t*)(x))[3]) -#define AV_WB32(p, d) do { \ - ((uint8_t*)(p))[3] = (d); \ - ((uint8_t*)(p))[2] = (d)>>8; \ - ((uint8_t*)(p))[1] = (d)>>16; \ - ((uint8_t*)(p))[0] = (d)>>24; } while(0) - -#define AV_RL32(x) ((((const uint8_t*)(x))[3] << 24) | \ - (((const uint8_t*)(x))[2] << 16) | \ - (((const uint8_t*)(x))[1] << 8) | \ - ((const uint8_t*)(x))[0]) -#define AV_WL32(p, d) do { \ - ((uint8_t*)(p))[0] = (d); \ - ((uint8_t*)(p))[1] = (d)>>8; \ - ((uint8_t*)(p))[2] = (d)>>16; \ - ((uint8_t*)(p))[3] = (d)>>24; } while(0) - -#define AV_RB64(x) (((uint64_t)((const uint8_t*)(x))[0] << 56) | \ - ((uint64_t)((const uint8_t*)(x))[1] << 48) | \ - ((uint64_t)((const uint8_t*)(x))[2] << 40) | \ - ((uint64_t)((const uint8_t*)(x))[3] << 32) | \ - ((uint64_t)((const uint8_t*)(x))[4] << 24) | \ - ((uint64_t)((const uint8_t*)(x))[5] << 16) | \ - ((uint64_t)((const uint8_t*)(x))[6] << 8) | \ - (uint64_t)((const uint8_t*)(x))[7]) -#define AV_WB64(p, d) do { \ - ((uint8_t*)(p))[7] = (d); \ - ((uint8_t*)(p))[6] = (d)>>8; \ - ((uint8_t*)(p))[5] = (d)>>16; \ - ((uint8_t*)(p))[4] = (d)>>24; \ - ((uint8_t*)(p))[3] = (d)>>32; \ - ((uint8_t*)(p))[2] = (d)>>40; \ - ((uint8_t*)(p))[1] = (d)>>48; \ - ((uint8_t*)(p))[0] = (d)>>56; } while(0) - -#define AV_RL64(x) (((uint64_t)((const uint8_t*)(x))[7] << 56) | \ - ((uint64_t)((const uint8_t*)(x))[6] << 48) | \ - ((uint64_t)((const uint8_t*)(x))[5] << 40) | \ - ((uint64_t)((const uint8_t*)(x))[4] << 32) | \ - ((uint64_t)((const uint8_t*)(x))[3] << 24) | \ - ((uint64_t)((const uint8_t*)(x))[2] << 16) | \ - ((uint64_t)((const uint8_t*)(x))[1] << 8) | \ - (uint64_t)((const uint8_t*)(x))[0]) -#define AV_WL64(p, d) do { \ - ((uint8_t*)(p))[0] = (d); \ - ((uint8_t*)(p))[1] = (d)>>8; \ - ((uint8_t*)(p))[2] = (d)>>16; \ - ((uint8_t*)(p))[3] = (d)>>24; \ - ((uint8_t*)(p))[4] = (d)>>32; \ - ((uint8_t*)(p))[5] = (d)>>40; \ - ((uint8_t*)(p))[6] = (d)>>48; \ - ((uint8_t*)(p))[7] = (d)>>56; } while(0) -#endif /* HAVE_FAST_UNALIGNED */ - -#define AV_RB24(x) ((((const uint8_t*)(x))[0] << 16) | \ - (((const uint8_t*)(x))[1] << 8) | \ - ((const uint8_t*)(x))[2]) -#define AV_WB24(p, d) do { \ - ((uint8_t*)(p))[2] = (d); \ - ((uint8_t*)(p))[1] = (d)>>8; \ - ((uint8_t*)(p))[0] = (d)>>16; } while(0) - -#define AV_RL24(x) ((((const uint8_t*)(x))[2] << 16) | \ - (((const uint8_t*)(x))[1] << 8) | \ - ((const uint8_t*)(x))[0]) -#define AV_WL24(p, d) do { \ - ((uint8_t*)(p))[0] = (d); \ - ((uint8_t*)(p))[1] = (d)>>8; \ - ((uint8_t*)(p))[2] = (d)>>16; } while(0) - -#endif /* AVUTIL_INTREADWRITE_H */ diff --git a/libeplayer2/container/mkv.c b/libeplayer2/container/mkv.c deleted file mode 100644 index 743255c..0000000 --- a/libeplayer2/container/mkv.c +++ /dev/null @@ -1,5384 +0,0 @@ -/* -// * einwenig von mplayer ;) - */ - - - - -#include -#include -#include -#include -#include -#include -#undef memcpy -#include - -#include -#include -#include -#include -#include -#include - -#include "mkv.h" -#include "stheader.h" - -static const char FILENAME[] = "mkv.c"; - -#ifdef __cplusplus -extern "C" { -#endif - -#define IGNORE_TRACKS // prevent incompatible tracks to be added - -#ifdef DEBUG -int debugmkv = 0; -#define dprintf(x...) do { if (debugmkv)printf(x); } while (0) -#endif - -int correct_pts = 1; - -pthread_mutex_t MKVmutex; - -void getMKVMutex(const char *filename, const char *function, int line) -{ -#ifdef DEBUG - dprintf("%s::%s::%d requesting mutex\n", filename, function, line); -#endif - - pthread_mutex_lock(&MKVmutex); - -#ifdef DEBUG - dprintf("%s::%s::%d received mutex\n", filename, function, line); -#endif -} - -void releaseMKVMutex(const char *filename, const char *function, int line) -{ - pthread_mutex_unlock(&MKVmutex); - -#ifdef DEBUG - dprintf("%s::%s::%d released mutex\n", filename, function, line); -#endif -} - -/* - * Read: the element content data ID. - * Return: the ID. - */ -uint32_t -ebml_read_id(stream_t *s, int *length) -{ - int i, len_mask = 0x80; - uint32_t id; - - for (i = 0, id = stream_read_char(s); i < 4 && !(id & len_mask); i++) - len_mask >>= 1; - if (i >= 4) - return EBML_ID_INVALID; - if (length) - *length = i + 1; - while (i--) - id = (id << 8) | stream_read_char(s); - -#ifdef DEBUG - dprintf("ebml_read_id id=0x%02X \n", id); -#endif - - return id; -} -/* - * Read a variable length unsigned int. - */ -uint64_t -ebml_read_vlen_uint(uint8_t *buffer, int *length) -{ - int i, j, num_ffs = 0, len_mask = 0x80; - uint64_t num; - - for (i = 0, num = *buffer++; i < 8 && !(num & len_mask); i++) - len_mask >>= 1; - if (i >= 8) - return EBML_UINT_INVALID; - j = i + 1; - if (length) - *length = j; - if ((int)(num &= (len_mask - 1)) == len_mask - 1) - num_ffs++; - while (i--) - { - num = (num << 8) | *buffer++; - if ((num & 0xFF) == 0xFF) - num_ffs++; - } - if (j == num_ffs) - return EBML_UINT_INVALID; - return num; -} - -/* - * Read a variable length signed int. - */ -int64_t -ebml_read_vlen_int(uint8_t *buffer, int *length) -{ - uint64_t unum; - int l; - - /* read as unsigned number first */ - unum = ebml_read_vlen_uint(buffer, &l); - if (unum == EBML_UINT_INVALID) - return EBML_INT_INVALID; - if (length) - *length = l; - - return unum - ((1 << ((7 * l) - 1)) - 1); -} - -/* - * Read: element content length. - */ -uint64_t -ebml_read_length(stream_t *s, int *length) -{ - int i, j, num_ffs = 0, len_mask = 0x80; - uint64_t len; - - for (i = 0, len = stream_read_char(s); i < 8 && !(len & len_mask); i++) - len_mask >>= 1; - if (i >= 8) - return EBML_UINT_INVALID; - j = i + 1; - if (length) - *length = j; - if ((int)(len &= (len_mask - 1)) == len_mask - 1) - num_ffs++; - while (i--) - { - len = (len << 8) | stream_read_char(s); - if ((len & 0xFF) == 0xFF) - num_ffs++; - } - if (j == num_ffs) - return EBML_UINT_INVALID; - return len; -} - -/* - * Read the next element as an unsigned int. - */ -uint64_t -ebml_read_uint(stream_t *s, uint64_t *length) -{ - uint64_t len, value = 0; - int l; - - len = ebml_read_length(s, &l); - if (len == EBML_UINT_INVALID || len < 1 || len > 8) - return EBML_UINT_INVALID; - if (length) - *length = len + l; - - while (len--) - value = (value << 8) | stream_read_char(s); - - return value; -} - -/* - * Read the next element as a signed int. - */ -int64_t -ebml_read_int(stream_t *s, uint64_t *length) -{ - int64_t value = 0; - uint64_t len; - int l; - - len = ebml_read_length(s, &l); - if (len == EBML_UINT_INVALID || len < 1 || len > 8) - return EBML_INT_INVALID; - if (length) - *length = len + l; - - len--; - l = stream_read_char(s); - if (l & 0x80) - value = -1; - value = (value << 8) | l; - while (len--) - value = (value << 8) | stream_read_char(s); - - return value; -} - -/* - * Read the next element as a float. - */ -long double -ebml_read_float(stream_t *s, uint64_t *length) -{ - long double value; - uint64_t len; - int l; - - len = ebml_read_length(s, &l); - switch (len) - { - case 4: - value = av_int2flt(stream_read_dword(s)); - break; - - case 8: - value = av_int2dbl(stream_read_qword(s)); - break; - - default: - return EBML_FLOAT_INVALID; - } - - if (length) - *length = len + l; - - return value; -} - -/* - * Read the next element as an ASCII string. - */ -char * -ebml_read_ascii(stream_t *s, uint64_t *length) -{ - uint64_t len; - char *str; - int l; - - len = ebml_read_length(s, &l); - if (len == EBML_UINT_INVALID) - return NULL; - if (len > SIZE_MAX - 1) - return NULL; - if (length) - *length = len + l; - - str = (char *) malloc(len + 1); - if (stream_read(s, (unsigned char *)str, len) != (int) len) - { - free(str); - str = NULL; - return NULL; - } - str[len] = '\0'; - - return str; -} - -/* - * Read the next element as a UTF-8 string. - */ -char * -ebml_read_utf8(stream_t *s, uint64_t *length) -{ - return ebml_read_ascii(s, length); -} - -/* - * Skip the next element. - */ -int -ebml_read_skip(stream_t *s, uint64_t *length) -{ - uint64_t len; - int l; - - len = ebml_read_length(s, &l); - if (len == EBML_UINT_INVALID) - return 1; - if (length) - *length = len + l; - - stream_skip(s, len); - - return 0; -} - -/* - * Read the next element, but only the header. The contents - * are supposed to be sub-elements which can be read separately. - */ -uint32_t -ebml_read_master(stream_t *s, uint64_t *length) -{ - uint64_t len; - uint32_t id; - - id = ebml_read_id(s, NULL); - if (id == EBML_ID_INVALID) - return id; - - len = ebml_read_length(s, NULL); - if (len == EBML_UINT_INVALID) - return EBML_ID_INVALID; - if (length) - *length = len; - -#ifdef DEBUG - dprintf("id = 0x%02X\n", id); -#endif - - return id; -} - - -/* - * Read an EBML header. - */ -char * -ebml_read_header(stream_t *s, int *version) -{ - uint64_t length, l, num; - uint32_t id; - char *str = NULL; - - if (ebml_read_master(s, &length) != EBML_ID_HEADER) - return 0; - - if (version) - *version = 1; - - while (length > 0) - { - id = ebml_read_id(s, NULL); - if (id == EBML_ID_INVALID) - return NULL; - length -= 2; - - switch (id) - { - /* is our read version uptodate? */ - case EBML_ID_EBMLREADVERSION: - num = ebml_read_uint(s, &l); - if (num != EBML_VERSION) - return NULL; - break; - - /* we only handle 8 byte lengths at max */ - case EBML_ID_EBMLMAXSIZELENGTH: - num = ebml_read_uint(s, &l); - if (num != sizeof(uint64_t)) - return NULL; - break; - - /* we handle 4 byte IDs at max */ - case EBML_ID_EBMLMAXIDLENGTH: - num = ebml_read_uint(s, &l); - if (num != sizeof(uint32_t)) - return NULL; - break; - - case EBML_ID_DOCTYPE: - str = ebml_read_ascii(s, &l); - if (str == NULL) - return NULL; - break; - - case EBML_ID_DOCTYPEREADVERSION: - num = ebml_read_uint(s, &l); - if (num == EBML_UINT_INVALID) - return NULL; - if (version) - *version = num; - break; - - /* we ignore these two, they don't tell us anything we care about */ - case EBML_ID_VOID: - case EBML_ID_EBMLVERSION: - case EBML_ID_DOCTYPEVERSION: - default: - if (ebml_read_skip(s, &l)) - return NULL; - break; - } - length -= l; - } - - return str; -} -#define DEMUXER_TYPE_UNKNOWN 0 -static unsigned char sipr_swaps[38][2] = -{ - {0, 63}, {1, 22}, {2, 44}, {3, 90}, {5, 81}, {7, 31}, {8, 86}, {9, 58}, {10, 36}, {12, 68}, - {13, 39}, {14, 73}, {15, 53}, {16, 69}, {17, 57}, {19, 88}, {20, 34}, {21, 71}, {24, 46}, - {25, 94}, {26, 54}, {28, 75}, {29, 50}, {32, 70}, {33, 92}, {35, 74}, {38, 85}, {40, 56}, - {42, 87}, {43, 65}, {45, 59}, {48, 79}, {49, 93}, {51, 89}, {55, 95}, {61, 76}, {67, 83}, - {77, 80} -}; - -// Map flavour to bytes per second -#define SIPR_FLAVORS 4 -#define ATRC_FLAVORS 8 -#define COOK_FLAVORS 34 -static int sipr_fl2bps[SIPR_FLAVORS] = {813, 1062, 625, 2000}; -static int atrc_fl2bps[ATRC_FLAVORS] = {8269, 11714, 13092, 16538, 18260, 22050, 33075, 44100}; -static int cook_fl2bps[COOK_FLAVORS] = {1000, 1378, 2024, 2584, 4005, 5513, 8010, 4005, 750, 2498, - 4048, 5513, 8010, 11973, 8010, 2584, 4005, 2067, 2584, 2584, - 4005, 4005, 5513, 5513, 8010, 12059, 1550, 8010, 12059, 5513, - 12016, 16408, 22911, 33506 - }; -typedef struct -{ - uint32_t order, type, scope; - uint32_t comp_algo; - uint8_t *comp_settings; - int comp_settings_len; -} mkv_content_encoding_t; - -typedef struct mkv_track -{ - int tnum; - char *name; - - char *codec_id; - int ms_compat; - char *language; - - int type; - - uint32_t v_width, v_height, v_dwidth, v_dheight; - float v_frate; - - uint32_t a_formattag; - uint32_t a_channels, a_bps; - float a_sfreq; - - float default_duration; - - int default_track; - - void *private_data; - unsigned int private_size; - - /* stuff for realmedia */ - int realmedia; - int rv_kf_base, rv_kf_pts; - float rv_pts; /* previous video timestamp */ - float ra_pts; /* previous audio timestamp */ - - /** realaudio descrambling */ - int sub_packet_size; ///< sub packet size, per stream - int sub_packet_h; ///< number of coded frames per block - int coded_framesize; ///< coded frame size, per stream - int audiopk_size; ///< audio packet size - unsigned char *audio_buf; ///< place to store reordered audio data - float *audio_timestamp; ///< timestamp for each audio packet - int sub_packet_cnt; ///< number of subpacket already received - int audio_filepos; ///< file position of first audio packet in block - - /* stuff for quicktime */ - int fix_i_bps; - float qt_last_a_pts; - - int subtitle_type; - - /* The timecodes of video frames might have to be reordered if they're - in display order (the timecodes, not the frames themselves!). In this - case demux packets have to be cached with the help of these variables. */ - int reorder_timecodes; - demux_packet_t **cached_dps; - int num_cached_dps, num_allocated_dps; - float max_pts; - - /* generic content encoding support */ - mkv_content_encoding_t *encodings; - int num_encodings; -//FIXME - /* For VobSubs and SSA/ASS */ - sh_sub_t *sh_sub; -} mkv_track_t; - -typedef struct mkv_index -{ - int tnum; - uint64_t timecode, filepos; -} mkv_index_t; - -typedef struct mkv_attachment -{ - char *name; - char *mime; - uint64_t uid; - void *data; - unsigned int data_size; -} mkv_attachment_t; - -typedef struct mkv_demuxer -{ - off_t segment_start; - - float duration, last_pts; - uint64_t last_filepos; - - mkv_track_t **tracks; - int num_tracks; - - uint64_t tc_scale, cluster_tc, first_tc; - int has_first_tc; - - uint64_t cluster_size; - uint64_t blockgroup_size; - - mkv_index_t *indexes; - int num_indexes; - - off_t *parsed_cues; - int parsed_cues_num; - off_t *parsed_seekhead; - int parsed_seekhead_num; - - uint64_t *cluster_positions; - int num_cluster_pos; - - int64_t skip_to_timecode; - int v_skip_to_keyframe, a_skip_to_keyframe; - - int64_t stop_timecode; - - int last_aid; - int audio_tracks[MAX_A_STREAMS]; - - mkv_attachment_t *attachments; - int num_attachments; -} mkv_demuxer_t; - -#define REALHEADER_SIZE 16 -#define RVPROPERTIES_SIZE 34 -#define RAPROPERTIES4_SIZE 56 -#define RAPROPERTIES5_SIZE 70 -/** - * \brief ensures there is space for at least one additional element - * \param array array to grow - * \param nelem current number of elements in array - * \param elsize size of one array element - */ -static void grow_array(void **array, int nelem, size_t elsize) -{ -#ifdef DEBUG - dprintf("mkv.c grow_array\n\n"); -#endif - - if (!(nelem & 31)) - *array = realloc(*array, (nelem + 32) * elsize); -} - -static mkv_track_t * -demux_mkv_find_track_by_num(mkv_demuxer_t *d, int n, int type) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_find_track_by_num\n\n"); -#endif - - int i, id; - - for (i = 0, id = 0; i < d->num_tracks; i++) - if (d->tracks[i] != NULL && d->tracks[i]->type == type) - if (id++ == n) - return d->tracks[i]; - - return NULL; -} - -static mkv_track_t * -demux_mkv_find_track_by_language(mkv_demuxer_t *d, char *language, int type) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_find_track_by_language\n\n"); -#endif - - int i, len; - - language += strspn(language, ","); - while ((len = strcspn(language, ",")) > 0) - { - for (i = 0; i < d->num_tracks; i++) - if (d->tracks[i] != NULL && d->tracks[i]->language != NULL && d->tracks[i]->type == type && !strncmp(d->tracks[i]->language, language, len)) - return d->tracks[i]; - language += len; - language += strspn(language, ","); - } - - return NULL; -} - -static void -add_cluster_position(mkv_demuxer_t *mkv_d, uint64_t position) -{ -#ifdef DEBUG - dprintf("mkv.c add_cluster_position\n\n"); -#endif - - int i = mkv_d->num_cluster_pos; - - while (i--) - if (mkv_d->cluster_positions[i] == position) - return; - - grow_array((void **) &mkv_d->cluster_positions, mkv_d->num_cluster_pos, sizeof(uint64_t)); - mkv_d->cluster_positions[mkv_d->num_cluster_pos++] = position; -} - - -#define AAC_SYNC_EXTENSION_TYPE 0x02b7 -/*static int -aac_get_sample_rate_index (uint32_t sample_rate) -{ - #ifdef DEBUG - dprintf("mkv.c aac_get_sample_rate_index\n\n"); - #endif - - if (92017 <= sample_rate) - return 0; - else if (75132 <= sample_rate) - return 1; - else if (55426 <= sample_rate) - return 2; - else if (46009 <= sample_rate) - return 3; - else if (37566 <= sample_rate) - return 4; - else if (27713 <= sample_rate) - return 5; - else if (23004 <= sample_rate) - return 6; - else if (18783 <= sample_rate) - return 7; - else if (13856 <= sample_rate) - return 8; - else if (11502 <= sample_rate) - return 9; - else if (9391 <= sample_rate) - return 10; - else - return 11; -}*/ -static int -aac_get_sample_rate_index(uint32_t sample_rate) -{ -#ifdef DEBUG - dprintf("mkv.c aac_get_sample_rate_index\n\n"); -#endif - - if (96000 <= sample_rate) - return 0; - else if (88200 <= sample_rate) - return 1; - else if (64000 <= sample_rate) - return 2; - else if (48000 <= sample_rate) - return 3; - else if (44100 <= sample_rate) - return 4; - else if (32000 <= sample_rate) - return 5; - else if (24000 <= sample_rate) - return 6; - else if (22050 <= sample_rate) - return 7; - else if (16000 <= sample_rate) - return 8; - else if (12000 <= sample_rate) - return 9; - else if (11025 <= sample_rate) - return 10; - else if (8000 <= sample_rate) - return 11; - else if (7350 <= sample_rate) - return 12; - else - return 13; -} -/* -static int -vobsub_parse_size (sh_sub_t *sh, const char *start) -{ - dprintf("mkv.c vobsub_parse_size\n\n"); - if (sscanf(&start[6], "%dx%d", &sh->width, &sh->height) == 2) - { - dprintf("[mkv] VobSub size: %ux%u\n",sh->width, sh->height); - return 1; - } - return 0; -} - -static int -vobsub_parse_palette (sh_sub_t *sh, const char *start) -{ - dprintf("mkv.c vobsub_parse_palette\n\n"); - int i, r, g, b, y, u, v, tmp; - - start += 8; - while (isspace(*start)) - start++; - for (i = 0; i < 16; i++) - { - if (sscanf(start, "%06x", &tmp) != 1) - break; - r = tmp >> 16 & 0xff; - g = tmp >> 8 & 0xff; - b = tmp & 0xff; - y = av_clip_uint8( 0.1494 * r + 0.6061 * g + 0.2445 * b); - u = av_clip_uint8( 0.6066 * r - 0.4322 * g - 0.1744 * b + 128); - v = av_clip_uint8(-0.08435 * r - 0.3422 * g + 0.4266 * b + 128); - sh->palette[i] = y << 16 | u << 8 | v; - start += 6; - while ((*start == ',') || isspace(*start)) - start++; - } - if (i == 16) - { - dprintf("[mkv] VobSub palette: %06x,%06x," - "%06x,%06x,%06x,%06x,%06x,%06x,%06x,%06x,%06x,%06x,%06x," - "%06x,%06x,%06x\n", sh->palette[0], - sh->palette[1], sh->palette[2], - sh->palette[3], sh->palette[4], - sh->palette[5], sh->palette[6], - sh->palette[7], sh->palette[8], - sh->palette[9], sh->palette[10], - sh->palette[11], sh->palette[12], - sh->palette[13], sh->palette[14], - sh->palette[15]); - sh->has_palette = 1; - return 2; - } - return 0; -} - -static int -vobsub_parse_custom_colors (sh_sub_t *sh, const char *start) -{ - dprintf("mkv.c vobsub_parse_custom_colors\n\n"); - int use_custom_colors, i; - - use_custom_colors = 0; - start += 14; - while (isspace(*start)) - start++; - if (!strncasecmp(start, "ON", 2) || (*start == '1')) - use_custom_colors = 1; - else if (!strncasecmp(start, "OFF", 3) || (*start == '0')) - use_custom_colors = 0; - dprintf("[mkv] VobSub custom colors: %s\n",use_custom_colors ? "ON" : "OFF"); - if ((start = strstr(start, "colors:")) != NULL) - { - start += 7; - while (isspace(*start)) - start++; - for (i = 0; i < 4; i++) - { - if (sscanf(start, "%06x", &sh->colors[i]) != 1) - break; - start += 6; - while ((*start == ',') || isspace(*start)) - start++; - } - if (i == 4) - { - sh->custom_colors = 4; - dprintf("[mkv] VobSub colors: %06x," - "%06x,%06x,%06x\n", sh->colors[0], - sh->colors[1], sh->colors[2], - sh->colors[3]); - } - } - if (!use_custom_colors) - sh->custom_colors = 0; - return 4; -} - -static int -vobsub_parse_forced_subs (sh_sub_t *sh, const char *start) -{ - dprintf("mkv.c vobsub_parse_forced_subs\n\n"); - start += 12; - while (isspace(*start)) - start++; - if (!strncasecmp(start, "on", 2) || (*start == '1')) - sh->forced_subs_only = 1; - else if (!strncasecmp(start, "off", 3) || (*start == '0')) - sh->forced_subs_only = 0; - else - return 0; - dprintf("[mkv] VobSub forced subs: %d\n",sh->forced_subs_only); - return 8; -}*/ - -//brief Free cached demux packets -// -// Reordering the timecodes requires caching of demux packets. This function -// frees all these cached packets and the memory for the cached pointers -// itself. -// -// \param demuxer The demuxer for which the cache is to be freed. -// -static void -free_cached_dps(demuxer_t *demuxer) -{ -#ifdef DEBUG - dprintf("mkv.c free_cached_dps\n\n"); -#endif - - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - mkv_track_t *track; - int i, k; - - if (mkv_d) - { - for (k = 0; k < mkv_d->num_tracks; k++) - { - track = mkv_d->tracks[k]; - for (i = 0; i < track->num_cached_dps; i++) - free_demux_packet(track->cached_dps[i]); - - free(track->cached_dps); - track->cached_dps = NULL; - track->num_cached_dps = 0; - track->num_allocated_dps = 0; - track->max_pts = 0; - } - } -} - -static int -demux_mkv_parse_idx(mkv_track_t *t) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_parse_idx\n\n"); -#endif - - int things_found, last; - char *buf, *pos, *start; - - if ((t->private_data == NULL) || (t->private_size == 0)) - return 0; - - things_found = 0; - buf = malloc(t->private_size + 1); - - if (buf == NULL) - return 0; - - memcpy(buf, t->private_data, t->private_size); - buf[t->private_size] = 0; - //t->sh_sub->has_palette = 0; - - pos = buf; - start = buf; - last = 0; - do - { - if ((*pos == 0) || (*pos == '\r') || (*pos == '\n')) - { - if (*pos == 0) - last = 1; - *pos = 0; - - //if (!strncasecmp(start, "size: ", 6)) - // things_found |= vobsub_parse_size(t->sh_sub, start); - //else if (!strncasecmp(start, "palette:", 8)) - // things_found |= vobsub_parse_palette(t->sh_sub, start); - //else if (!strncasecmp(start, "custom colors:", 14)) - // things_found |= vobsub_parse_custom_colors(t->sh_sub, start); - //else if (!strncasecmp(start, "forced subs:", 12)) - // things_found |= vobsub_parse_forced_subs(t->sh_sub, start); - - if (last) - break; - do - { - pos++; - } - while ((*pos == '\r') || (*pos == '\n')); - start = pos; - } - else - pos++; - } - while (!last && (*start != 0)); - - free(buf); - buf = NULL; - - return (things_found & 3) == 3; -} - - -static int -demux_mkv_decode(mkv_track_t *track, uint8_t *src, uint8_t **dest, - uint32_t *size, uint32_t type) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_decode\n\n"); -#endif - - int i, result; - int modified = 0; - - *dest = src; - if (track->num_encodings <= 0) - { - -#ifdef DEBUG - dprintf("\n\nHello 1 =%d\n\n", track->num_encodings); -#endif - - return 0; - } - -#ifdef DEBUG - dprintf("\n\nHello 0\n\n"); -#endif - - for (i = 0; i < track->num_encodings; i++) - { - if (!(track->encodings[i].scope & type)) - { -#ifdef DEBUG - dprintf("\n\nHello \n\n"); -#endif - - continue; - } - - - if (track->encodings[i].comp_algo == 2) - { -#ifdef DEBUG - dprintf("------------------------mplayer mkv.c demux_mkv_decode\n\n"); -#endif - - // lzo encoded track - int dstlen = *size * 3; - - *dest = NULL; - while (1) - { - int srclen = *size; - if (dstlen > SIZE_MAX - LZO_OUTPUT_PADDING) goto lzo_fail; - *dest = realloc(*dest, dstlen + LZO_OUTPUT_PADDING); - result = lzo1x_decode(*dest, &dstlen, src, &srclen); - if (result == 0) - break; - if (!(result & LZO_OUTPUT_FULL)) - { -lzo_fail: - // mp_msg (MSGT_DEMUX, MSGL_WARN, - // MSGTR_MPDEMUX_MKV_LzoDecompressionFailed); - free(*dest); - *dest = NULL; - return modified; - } -#ifdef DEBUG - dprintf("[mkv] lzo decompression buffer too small.\n"); -#endif - - dstlen *= 2; - } - *size = dstlen; - } - } - - return modified; -} - -long int Duration = 0; - -static int -demux_mkv_read_info(demuxer_t *demuxer, stream_t *s) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_read_info\n\n"); -#endif - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - //stream_t *s = demuxer->stream; - uint64_t length, l; - int il; - uint64_t tc_scale = 1000000; - long double duration = 0.; - - length = ebml_read_length(s, NULL); - while (length > 0) - { - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_TIMECODESCALE: - { - uint64_t num = ebml_read_uint(s, &l); - if (num == EBML_UINT_INVALID) - return 1; - tc_scale = num; - -#ifdef DEBUG - printf("[mkv] | + timecode scale: %"PRIu64"\n", tc_scale); -#endif - - break; - } - - case MATROSKA_ID_DURATION: - { - long double num = ebml_read_float(s, &l); - if (num == EBML_FLOAT_INVALID) - return 1; - duration = num; - -#ifdef DEBUG - dprintf("[mkv] | + duration: %.3Lfs\n", duration * tc_scale / 1000000000.0); -#endif - - Duration = duration * tc_scale / 1000000000.0; - break; - } - - default: - ebml_read_skip(s, &l); - break; - } - length -= l + il; - } - mkv_d->tc_scale = tc_scale; - mkv_d->duration = duration * tc_scale / 1000000000.0; - return 0; -} - -//brief free array of kv_content_encoding_t -//param encodings pointer to array -//param numencodings number of encodings in array - -static void -demux_mkv_free_encodings(mkv_content_encoding_t *encodings, int numencodings) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_free_encodings\n\n"); -#endif - - while (numencodings-- > 0) - { - free(encodings[numencodings].comp_settings); - encodings[numencodings].comp_settings = NULL; - } - free(encodings); - encodings = NULL; -} - -static int -demux_mkv_read_trackencodings(demuxer_t *demuxer, mkv_track_t *track, stream_t *s) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_read_trackencodings\n\n"); -#endif - - //stream_t *s = demuxer->stream; - mkv_content_encoding_t *ce, e; - uint64_t len, length, l; - int il, n; - - ce = malloc(sizeof(*ce)); - n = 0; - - len = length = ebml_read_length(s, &il); - len += il; - while (length > 0) - { - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_CONTENTENCODING: - { - uint64_t len; - int i; - - memset(&e, 0, sizeof(e)); - e.scope = 1; - - len = ebml_read_length(s, &i); - l = len + i; - - while (len > 0) - { - uint64_t num, l; - int il; - - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_CONTENTENCODINGORDER: - num = ebml_read_uint(s, &l); - if (num == EBML_UINT_INVALID) - goto err_out; - e.order = num; - break; - - case MATROSKA_ID_CONTENTENCODINGSCOPE: - num = ebml_read_uint(s, &l); - if (num == EBML_UINT_INVALID) - goto err_out; - e.scope = num; - break; - - case MATROSKA_ID_CONTENTENCODINGTYPE: - num = ebml_read_uint(s, &l); - if (num == EBML_UINT_INVALID) - goto err_out; - e.type = num; - break; - - case MATROSKA_ID_CONTENTCOMPRESSION: - { - uint64_t le; - - le = ebml_read_length(s, &i); - l = le + i; - - while (le > 0) - { - uint64_t l; - int il; - - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_CONTENTCOMPALGO: - num = ebml_read_uint(s, &l); - if (num == EBML_UINT_INVALID) - goto err_out; - e.comp_algo = num; - break; - - case MATROSKA_ID_CONTENTCOMPSETTINGS: - l = ebml_read_length(s, &i); - e.comp_settings = malloc(l); - stream_read(s, e.comp_settings, l); - e.comp_settings_len = l; - l += i; - break; - - default: - ebml_read_skip(s, &l); - break; - } - le -= l + il; - } - -#ifdef DEBUG - if (e.type == 1) - { - dprintf("Warnung track1 tnum=%d\n", track->tnum); - } - else if (e.type != 0) - { - dprintf("Warnung track2 tnum=%d\n", track->tnum); - } - - if (e.comp_algo != 0 && e.comp_algo != 2) - { - dprintf("Warnung track3 tnum=%d\n", track->tnum);// e.comp_algo - } -#ifndef HAVE_ZLIB - else if (e.comp_algo == 0) - { - dprintf("Warnung track4 tnum=%d\n", track->tnum); - } -#endif -#endif - - break; - } - - default: - ebml_read_skip(s, &l); - break; - } - len -= l + il; - } - for (i = 0; i < n; i++) - if (e.order <= ce[i].order) - break; - ce = realloc(ce, (n + 1) * sizeof(*ce)); - memmove(ce + i + 1, ce + i, (n - i) * sizeof(*ce)); - memcpy(ce + i, &e, sizeof(e)); - n++; - break; - } - - default: - ebml_read_skip(s, &l); - break; - } - - length -= l + il; - } - - track->encodings = ce; - track->num_encodings = n; - return len; - -err_out: - demux_mkv_free_encodings(ce, n); - return 0; -} - -static int -demux_mkv_read_trackaudio(demuxer_t *demuxer, mkv_track_t *track, stream_t *s) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_read_trackaudio\n\n"); -#endif - - //stream_t *s = demuxer->stream; - uint64_t len, length, l; - int il; - - track->a_sfreq = 8000.0; - track->a_channels = 1; - - len = length = ebml_read_length(s, &il); - len += il; - while (length > 0) - { - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_AUDIOSAMPLINGFREQ: - { - long double num = ebml_read_float(s, &l); - if (num == EBML_FLOAT_INVALID) - return 0; - track->a_sfreq = num; - -#ifdef DEBUG - dprintf("[mkv] | + Sampling frequency: %f\n", track->a_sfreq); -#endif - - break; - } - - case MATROSKA_ID_AUDIOBITDEPTH: - { - uint64_t num = ebml_read_uint(s, &l); - if (num == EBML_UINT_INVALID) - return 0; - track->a_bps = num; - -#ifdef DEBUG - dprintf("[mkv] | + Bit depth: %u\n", track->a_bps); -#endif - - break; - } - - case MATROSKA_ID_AUDIOCHANNELS: - { - uint64_t num = ebml_read_uint(s, &l); - if (num == EBML_UINT_INVALID) - return 0; - track->a_channels = num; - -#ifdef DEBUG - dprintf("[mkv] | + Channels: %u\n", track->a_channels); -#endif - - break; - } - - default: - ebml_read_skip(s, &l); - break; - } - length -= l + il; - } - return len; -} - -static int -demux_mkv_read_trackvideo(demuxer_t *demuxer, mkv_track_t *track, stream_t *s) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_read_trackvideo\n\n"); -#endif - - //stream_t *s = demuxer->stream; - uint64_t len, length, l; - int il; - - len = length = ebml_read_length(s, &il); - len += il; - while (length > 0) - { - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_VIDEOFRAMERATE: - { - long double num = ebml_read_float(s, &l); - if (num == EBML_FLOAT_INVALID) - return 0; - track->v_frate = num; - -#ifdef DEBUG - dprintf("[mkv] | + Frame rate: %f\n", track->v_frate); -#endif - - if (track->v_frate > 0) - track->default_duration = 1 / track->v_frate; - break; - } - - case MATROSKA_ID_VIDEODISPLAYWIDTH: - { - uint64_t num = ebml_read_uint(s, &l); - if (num == EBML_UINT_INVALID) - return 0; - track->v_dwidth = num; - -#ifdef DEBUG - dprintf("[mkv] | + Display width: %u\n", track->v_dwidth); -#endif - - break; - } - - case MATROSKA_ID_VIDEODISPLAYHEIGHT: - { - uint64_t num = ebml_read_uint(s, &l); - if (num == EBML_UINT_INVALID) - return 0; - track->v_dheight = num; - -#ifdef DEBUG - dprintf("[mkv] | + Display height: %u\n", track->v_dheight); -#endif - - break; - } - - case MATROSKA_ID_VIDEOPIXELWIDTH: - { - uint64_t num = ebml_read_uint(s, &l); - if (num == EBML_UINT_INVALID) - return 0; - track->v_width = num; - -#ifdef DEBUG - dprintf("[mkv] | + Pixel width: %u\n", track->v_width); -#endif - - break; - } - - case MATROSKA_ID_VIDEOPIXELHEIGHT: - { - uint64_t num = ebml_read_uint(s, &l); - if (num == EBML_UINT_INVALID) - return 0; - track->v_height = num; - -#ifdef DEBUG - dprintf("[mkv] | + Pixel height: %u\n", track->v_height); -#endif - - break; - } - - default: - ebml_read_skip(s, &l); - break; - } - length -= l + il; - } - return len; -} - -// -//brief free any data associated with given track -//param track track of which to free data -// - -static void -demux_mkv_free_trackentry(mkv_track_t *track) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_free_trackentry\n\n"); -#endif - - free(track->name); - track->name = NULL; - - free(track->codec_id); - track->codec_id = NULL; - - free(track->language); - track->language = NULL; - - free(track->private_data); - track->private_data = NULL; - - free(track->audio_buf); - track->audio_buf = NULL; - - free(track->audio_timestamp); - track->audio_timestamp = NULL; - //FIXME - //#ifdef USE_ASS - // if (track->sh_sub && track->sh_sub->ass_track) - // ass_free_track (track->sh_sub->ass_track); - //#endif - demux_mkv_free_encodings(track->encodings, track->num_encodings); - - free(track); - track = NULL; -} -#define A_AC3 20 - -int getKathreinUfs910BoxType() -{ - char vType; - int vFdBox = open("/proc/boxtype", O_RDONLY); - - read(vFdBox, &vType, 1); - - close(vFdBox); - - return vType == '0' ? 0 : vType == '1' || vType == '3' ? 1 : -1; -} - -int getModel() -{ - int vFd = -1; - const int cSize = 128; - char vName[129] = "Unknown"; - int vLen = -1; - eBoxType vBoxType = Unknown; - -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - vFd = open("/proc/stb/info/model", O_RDONLY); - vLen = read(vFd, vName, cSize); - - close(vFd); - - if (vLen > 0) - { - vName[vLen - 1] = '\0'; - -#ifdef DEBUG - printf("Model: %s\n", vName); -#endif - - if (!strncasecmp(vName, "ufs910", 6)) - { - switch (getKathreinUfs910BoxType()) - { - case 0: - vBoxType = Ufs910_1W; - break; - case 1: - vBoxType = Ufs910_14W; - break; - default: - vBoxType = Unknown; - break; - } - } - else if (!strncasecmp(vName, "ufs922", 6)) - vBoxType = Ufs922; - else if (!strncasecmp(vName, "tf7700hdpvr", 11)) - vBoxType = Tf7700; - else if (!strncasecmp(vName, "hdbox", 5)) - vBoxType = HdBox; - else - vBoxType = Unknown; - } - -#ifdef DEBUG - printf("vBoxType: %d\n", vBoxType); -#endif - - return vBoxType; -} - -static eBoxType boxType = Unknown; - -static int -demux_mkv_read_trackentry(demuxer_t *demuxer, stream_t *s) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_read_trackentry\n\n"); -#endif - - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - //stream_t *s = demuxer->stream; - mkv_track_t *track; - uint64_t len, length, l; - int il; - int skip_track = 0; - - track = calloc(1, sizeof(*track)); - /* set default values */ - track->default_track = 1; - track->name = 0; - -#ifdef DEBUG - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - - track->language = strdup("eng"); - - len = length = ebml_read_length(s, &il); - len += il; - while (length > 0) - { - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_TRACKNUMBER: - { - uint64_t num = ebml_read_uint(s, &l); - if (num == EBML_UINT_INVALID) - goto err_out; - track->tnum = num; - -#ifdef DEBUG - dprintf("[mkv] | + Track number: %u\n", track->tnum); -#endif - - break; - } - - case MATROSKA_ID_TRACKNAME: - { - track->name = ebml_read_utf8(s, &l); - if (track->name == NULL) - goto err_out; - -#ifdef DEBUG - dprintf("[mkv] | + Name: %s\n", track->name); -#endif - - break; - } - - case MATROSKA_ID_TRACKTYPE: - { - uint64_t num = ebml_read_uint(s, &l); - if (num == EBML_UINT_INVALID) - return 0; - track->type = num; - -#ifdef DEBUG - dprintf("[mkv] | + Track type: "); - switch (track->type) - { - case MATROSKA_TRACK_AUDIO: - dprintf("Audio\n"); - break; - case MATROSKA_TRACK_VIDEO: - dprintf("Video\n"); - break; - case MATROSKA_TRACK_SUBTITLE: - dprintf("Subtitle\n"); - break; - default: - dprintf("unknown\n"); - break; - } -#endif - - break; - } - - case MATROSKA_ID_TRACKAUDIO: -#ifdef DEBUG - dprintf("[mkv] | + Audio track\n"); -#endif - - l = demux_mkv_read_trackaudio(demuxer, track, s); - if (l == 0) - goto err_out; - break; - - case MATROSKA_ID_TRACKVIDEO: -#ifdef DEBUG - dprintf("[mkv] | + Video track\n"); -#endif - - l = demux_mkv_read_trackvideo(demuxer, track, s); - if (l == 0) - goto err_out; - break; - - case MATROSKA_ID_CODECID: - track->codec_id = ebml_read_ascii(s, &l); - if (track->codec_id == NULL) - goto err_out; - if (!strcmp(track->codec_id, MKV_V_MSCOMP) || !strcmp(track->codec_id, MKV_A_ACM)) - track->ms_compat = 1; - else if (!strcmp(track->codec_id, MKV_S_VOBSUB)) - track->subtitle_type = MATROSKA_SUBTYPE_VOBSUB; - else if (!strcmp(track->codec_id, MKV_S_TEXTSSA) - || !strcmp(track->codec_id, MKV_S_TEXTASS) - || !strcmp(track->codec_id, MKV_S_SSA) - || !strcmp(track->codec_id, MKV_S_ASS)) - { - track->subtitle_type = MATROSKA_SUBTYPE_SSA; - } - else if (!strcmp(track->codec_id, MKV_S_TEXTASCII)) - track->subtitle_type = MATROSKA_SUBTYPE_TEXT; - if (!strcmp(track->codec_id, MKV_S_TEXTUTF8)) - { - track->subtitle_type = MATROSKA_SUBTYPE_TEXT; - } - -#ifdef DEBUG - dprintf("[mkv] | + Codec ID: %s\n", track->codec_id); -#endif - - break; - - case MATROSKA_ID_CODECPRIVATE: - { - int x; - uint64_t num = ebml_read_length(s, &x); - // audit: cheap guard against overflows later.. - if (num > SIZE_MAX - 1000) return 0; - l = x + num; - track->private_data = malloc(num + LZO_INPUT_PADDING); - if (stream_read(s, track->private_data, num) != (int) num) - goto err_out; - /* int k; - dprintf( "Test Data1\n"); - for (k = 0; k < 1028; k++) - { - dprintf("%02x ", s[k]); - if (((k+1)&31)==0) - dprintf("\n"); - }*/ - track->private_size = num; - -#ifdef DEBUG - dprintf("[mkv] | + CodecPrivate, length %u\n", track->private_size); -#endif - - break; - } - - case MATROSKA_ID_TRACKLANGUAGE: - free(track->language); - track->language = ebml_read_utf8(s, &l); - if (track->language == NULL) - goto err_out; - -#ifdef DEBUG - dprintf("[mkv] | + Language: %s\n", track->language); -#endif - - break; - - case MATROSKA_ID_TRACKFLAGDEFAULT: - { - uint64_t num = ebml_read_uint(s, &l); - if (num == EBML_UINT_INVALID) - goto err_out; - track->default_track = num; - -#ifdef DEBUG - dprintf("[mkv] | + Default flag: %u\n", track->default_track); -#endif - - break; - } - - case MATROSKA_ID_TRACKDEFAULTDURATION: - { - uint64_t num = ebml_read_uint(s, &l); - if (num == EBML_UINT_INVALID) - goto err_out; - if (num == 0) - { - -#ifdef DEBUG - dprintf("[mkv] | + Default duration: 0"); -#endif - } - else - { - track->v_frate = 1000000000.0 / num; - track->default_duration = num / 1000000000.0; - -#ifdef DEBUG - dprintf("[mkv] | + Default duration: %.3fms ( = %.3f fps)\n", num / 1000000.0, track->v_frate); -#endif - } - break; - } - - case MATROSKA_ID_TRACKENCODINGS: - l = demux_mkv_read_trackencodings(demuxer, track, s); - if (l == 0) - goto err_out; - break; - - default: - ebml_read_skip(s, &l); - break; - } - length -= l + il; - } - -#ifdef IGNORE_TRACKS - // Don't add unsupported tracks to track list - if (track->type == MATROSKA_TRACK_AUDIO) - { - if (!strcmp(track->codec_id, MKV_A_AAC_2MAIN) - || !strcmp(track->codec_id, MKV_A_AAC_2LC) - || !strcmp(track->codec_id, MKV_A_AAC_2SBR) - || !strcmp(track->codec_id, MKV_A_AAC_2SSR) - || !strcmp(track->codec_id, MKV_A_AAC_4MAIN) - || !strcmp(track->codec_id, MKV_A_AAC_4LC) - || !strcmp(track->codec_id, MKV_A_AAC_4SBR) - || !strcmp(track->codec_id, MKV_A_AAC_4SSR) - || !strcmp(track->codec_id, MKV_A_AAC_4LTP) - || !strcmp(track->codec_id, MKV_A_AAC) - || !strcmp(track->codec_id, MKV_A_AC3) -// || !strcmp (track->codec_id, MKV_A_EAC3) - || !strcmp(track->codec_id, MKV_A_DTS) -// || !strcmp (track->codec_id, MKV_A_MP2) - || !strcmp(track->codec_id, MKV_A_MP3) - || !strcmp(track->codec_id, MKV_A_PCM) - || !strcmp(track->codec_id, MKV_A_PCM_BE) - || !strcmp(track->codec_id, MKV_A_VORBIS) - || !strcmp(track->codec_id, MKV_A_ACM) - || !strcmp(track->codec_id, MKV_A_REAL28) - || !strcmp(track->codec_id, MKV_A_REALATRC) - || !strcmp(track->codec_id, MKV_A_REALCOOK) - || !strcmp(track->codec_id, MKV_A_REALDNET) - || !strcmp(track->codec_id, MKV_A_REALSIPR) - || !strcmp(track->codec_id, MKV_A_QDMC) - || !strcmp(track->codec_id, MKV_A_QDMC2) -// || !strcmp (track->codec_id, MKV_A_FLAC) - || !strcmp(track->codec_id, MKV_A_WMA) - ) - { -#ifdef DEBUG - printf("%s::%s Added Audio Codec %s to track list\n", FILENAME, __FUNCTION__, track->codec_id); -#endif - } - else - { -#ifdef DEBUG - printf("%s::%s Unknown Audio Codec %s not added to track list\n", FILENAME, __FUNCTION__, track->codec_id); -#endif - - skip_track = 1; - } - } - else if (track->type == MATROSKA_TRACK_VIDEO) - { - if (boxType == Unknown) - boxType = getModel(); - -#ifdef DEBUG - printf("%s::%s Added Video Codec %s to track list\n", FILENAME, __FUNCTION__, track->codec_id); -#endif - } -#else - if (track->type == MATROSKA_TRACK_AUDIO) - { -#ifdef DEBUG - printf("%s::%s Added Audio Codec %s to track list\n", FILENAME, __FUNCTION__, track->codec_id); -#endif - } - else if (track->type == MATROSKA_TRACK_VIDEO) - { -#ifdef DEBUG - printf("%s::%s Added Video Codec %s to track list\n", FILENAME, __FUNCTION__, track->codec_id); -#endif - } -#endif - - if (!skip_track) - { - mkv_d->tracks = realloc(mkv_d->tracks, (mkv_d->num_tracks + 1) * sizeof(*mkv_d->tracks)); - if (mkv_d->tracks == NULL) - { -#ifdef DEBUG - printf("%s::%s realloc failed!\n", FILENAME, __FUNCTION__); -#endif - - goto err_out; - } - - mkv_d->tracks[mkv_d->num_tracks++] = track; - } - else - { - demux_mkv_free_trackentry(track); - } - - return len; - -err_out: - demux_mkv_free_trackentry(track); - return 0; -} - -static int -demux_mkv_read_tracks(demuxer_t *demuxer, stream_t *s) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_read_tracks\n\n"); -#endif - - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - //stream_t *s = demuxer->stream; - uint64_t length, l; - int il; - - mkv_d->tracks = malloc(sizeof(*mkv_d->tracks)); - mkv_d->num_tracks = 0; - - length = ebml_read_length(s, NULL); - while (length > 0) - { - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_TRACKENTRY: -#ifdef DEBUG - dprintf("[mkv] | + a track...\n"); -#endif - - l = demux_mkv_read_trackentry(demuxer, s); - if (l == 0) - return 1; - break; - - default: - ebml_read_skip(s, &l); - break; - } - length -= l + il; - } - return 0; -} -int index_mode; -static int -demux_mkv_read_cues(demuxer_t *demuxer, stream_t *s) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_read_cues\n\n"); -#endif - - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - //stream_t *s = demuxer->stream; - uint64_t length, l, time, track, pos; - off_t off; - int i, il; - - if (index_mode == 0) - { - ebml_read_skip(s, NULL); - return 0; - } - off = stream_tell(s); - for (i = 0; i < mkv_d->parsed_cues_num; i++) - if (mkv_d->parsed_cues[i] == off) - { - ebml_read_skip(s, NULL); - return 0; - } - mkv_d->parsed_cues = realloc(mkv_d->parsed_cues, (mkv_d->parsed_cues_num + 1) * sizeof(off_t)); - mkv_d->parsed_cues[mkv_d->parsed_cues_num++] = off; - -#ifdef DEBUG - dprintf("[mkv] /---- [ parsing cues ] -----------\n"); -#endif - - length = ebml_read_length(s, NULL); - - while (length > 0) - { - time = track = pos = EBML_UINT_INVALID; - - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_POINTENTRY: - { - uint64_t len; - - len = ebml_read_length(s, &i); - l = len + i; - - while (len > 0) - { - uint64_t l; - int il; - - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_CUETIME: - time = ebml_read_uint(s, &l); - break; - - case MATROSKA_ID_CUETRACKPOSITION: - { - uint64_t le; - - le = ebml_read_length(s, &i); - l = le + i; - - while (le > 0) - { - uint64_t l; - int il; - - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_CUETRACK: - track = ebml_read_uint(s, &l); - break; - - case MATROSKA_ID_CUECLUSTERPOSITION: - pos = ebml_read_uint(s, &l); - break; - - default: - ebml_read_skip(s, &l); - break; - } - le -= l + il; - } - break; - } - - default: - ebml_read_skip(s, &l); - break; - } - len -= l + il; - } - break; - } - - default: - ebml_read_skip(s, &l); - break; - } - - length -= l + il; - - if (time != EBML_UINT_INVALID && track != EBML_UINT_INVALID && pos != EBML_UINT_INVALID) - { - grow_array((void **)&mkv_d->indexes, mkv_d->num_indexes, sizeof(mkv_index_t)); - mkv_d->indexes[mkv_d->num_indexes].tnum = track; - mkv_d->indexes[mkv_d->num_indexes].timecode = time; - mkv_d->indexes[mkv_d->num_indexes].filepos = mkv_d->segment_start + pos; -#ifdef DEBUG - dprintf("[mkv] |+ found cue point for track %"PRIu64": timecode %"PRIu64", filepos: %"PRIu64"\n", track, time, mkv_d->segment_start + pos); -#endif - mkv_d->num_indexes++; - } - } - -#ifdef DEBUG - dprintf("[mkv] \\---- [ parsing cues ] -----------\n"); -#endif - - return 0; -} - -static int -demux_mkv_read_chapters(demuxer_t *demuxer, stream_t *s) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_read_chapters\n\n"); -#endif - - //stream_t *s = demuxer->stream; - uint64_t length, l; - int il; - - if (demuxer->chapters) - { - ebml_read_skip(s, NULL); - return 0; - } - -#ifdef DEBUG - dprintf("[mkv] /---- [ parsing chapters ] ---------\n"); -#endif - - length = ebml_read_length(s, NULL); - - while (length > 0) - { - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_EDITIONENTRY: - { - uint64_t len; - int i; - - len = ebml_read_length(s, &i); - l = len + i; - - while (len > 0) - { - uint64_t l; - int il; - - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_CHAPTERATOM: - { - uint64_t len, start = 0, end = 0; - char *name = 0; - int i; - int cid; - - len = ebml_read_length(s, &i); - l = len + i; - - while (len > 0) - { - uint64_t l; - int il; - - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_CHAPTERTIMESTART: - start = ebml_read_uint(s, &l) / 1000000; - break; - - case MATROSKA_ID_CHAPTERTIMEEND: - end = ebml_read_uint(s, &l) / 1000000; - break; - - case MATROSKA_ID_CHAPTERDISPLAY: - { - uint64_t len; - int i; - - len = ebml_read_length(s, &i); - l = len + i; - while (len > 0) - { - uint64_t l; - int il; - - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_CHAPSTRING: - name = ebml_read_utf8(s, &l); - break; - default: - ebml_read_skip(s, &l); - break; - } - len -= l + il; - } - } - break; - - default: - ebml_read_skip(s, &l); - break; - } - len -= l + il; - } - - if (!name) - { -#ifdef DEBUG - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - - name = strdup("(unnamed)"); - } - cid = demuxer_add_chapter(demuxer, name, start, end); - -#ifdef DEBUG - dprintf("[mkv] Chapter %u from %02d:%02d:%02d.%03d to %02d:%02d:%02d.%03d, %s\n", - cid, - (int)(start / 60 / 60 / 1000), - (int)((start / 60 / 1000) % 60), - (int)((start / 1000) % 60), - (int)(start % 1000), - (int)(end / 60 / 60 / 1000), - (int)((end / 60 / 1000) % 60), - (int)((end / 1000) % 60), - (int)(end % 1000), name); -#endif - - free(name); - name = NULL; - break; - } - - default: - ebml_read_skip(s, &l); - break; - } - len -= l + il; - } - break; - } - - default: - ebml_read_skip(s, &l); - break; - } - - length -= l + il; - } - -#ifdef DEBUG - dprintf("[mkv] \\---- [ parsing chapters ] ---------\n"); -#endif - - return 0; -} - -static int -demux_mkv_read_tags(demuxer_t *demuxer) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_read_tags\n\n"); -#endif - - ebml_read_skip(demuxer->stream, NULL); - return 0; -} - -static int -demux_mkv_read_attachments(demuxer_t *demuxer, stream_t *s) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_read_attachments\n\n"); -#endif - - //stream_t *s = demuxer->stream; - uint64_t length, l; - int il; - -#ifdef DEBUG - dprintf("[mkv] /---- [ parsing attachments ] ---------\n"); -#endif - - length = ebml_read_length(s, NULL); - - while (length > 0) - { - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_ATTACHEDFILE: - /*{ //Why should we care about an attachment ?! - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - uint64_t len; - int i; - char* name = NULL; - char* mime = NULL; - uint64_t uid = 0; - unsigned char* data = NULL; - int data_size = 0; - - len = ebml_read_length (s, &i); - l = len + i; - - dprintf("[mkv] | + an attachment...\n"); - - grow_array((void**)&mkv_d->attachments, mkv_d->num_attachments,sizeof(*mkv_d->attachments)); - - while (len > 0) - { - uint64_t l; - int il; - - switch (ebml_read_id (s, &il)) - { - case MATROSKA_ID_FILENAME: - name = ebml_read_utf8 (s, &l); - if (name == NULL) - return 0; - dprintf("[mkv] | + FileName: %s\n",name); - break; - - case MATROSKA_ID_FILEMIMETYPE: - mime = ebml_read_ascii (s, &l); - if (mime == NULL) - return 0; - dprintf("[mkv] | + FileMimeType: %s\n",mime); - break; - - case MATROSKA_ID_FILEUID: - uid = ebml_read_uint (s, &l); - break; - - case MATROSKA_ID_FILEDATA: - { - int x; - uint64_t num = ebml_read_length (s, &x); - l = x + num; - free(data); - data = malloc (num); - if (stream_read(s, data, num) != (int) num) - { - free(data); - return 0; - } - int k; - dprintf( "Test MATROSKA_ID_FILEDATA:\n"); - for (k = 0; k < 1028; k++) - { - dprintf("%02x ", data[k]); - if (((k+1)&31)==0) - dprintf("\n"); - } - data_size = num; - dprintf("[mkv] | + FileData, length %u\n", data_size); - break; - } - - default: - ebml_read_skip (s, &l); - break; - } - len -= l + il; - } - - mkv_d->attachments[mkv_d->num_attachments].name = name; - mkv_d->attachments[mkv_d->num_attachments].mime = mime; - mkv_d->attachments[mkv_d->num_attachments].uid = uid; - mkv_d->attachments[mkv_d->num_attachments].data = data; - mkv_d->attachments[mkv_d->num_attachments].data_size = data_size; - mkv_d->num_attachments ++; - dprintf("[mkv] Attachment: %s, %s, %u bytes\n",name, mime, data_size); - //FIXME - //#ifdef USE_ASS - // if (ass_library && extract_embedded_fonts && name && data && data_size && - // mime && (strcmp(mime, "application/x-truetype-font") == 0 || - // strcmp(mime, "application/x-font") == 0)) - // ass_add_font(ass_library, name, data, data_size); - //#endif - break; - } - */ - default: - ebml_read_skip(s, &l); - break; - } - length -= l + il; - } - -#ifdef DEBUG - dprintf("[mkv] \\---- [ parsing attachments ] ---------\n"); -#endif - - return 0; -} -static int -demux_mkv_read_seekhead(demuxer_t *demuxer, stream_t *s) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_read_seekhead\n\n"); -#endif - - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - //stream_t *s = demuxer->stream; - uint64_t length, l, seek_pos, saved_pos, num; - uint32_t seek_id; - int i, il, res = 0; - off_t off; -//dprintf("test buf_pos=%d,buf_len=%d,pos=%d\n",s->buf_pos,s->buf_len,s->pos); - - off = stream_tell(s); -#ifdef DEBUG - dprintf("test1\n"); -#endif - - for (i = 0; i < mkv_d->parsed_seekhead_num; i++) - if (mkv_d->parsed_seekhead[i] == off) - { - ebml_read_skip(s, NULL); - return 0; - } - - mkv_d->parsed_seekhead = realloc(mkv_d->parsed_seekhead, (mkv_d->parsed_seekhead_num + 1) * sizeof(off_t)); - mkv_d->parsed_seekhead[mkv_d->parsed_seekhead_num++] = off; - -#ifdef DEBUG - dprintf("[mkv] /---- [ parsing seek head ] ---------\n"); -#endif - - length = ebml_read_length(s, NULL); - // off now holds the position of the next element after the seek head. - off = stream_tell(s) + length; - while (length > 0 && !res) - { - - seek_id = 0; - seek_pos = EBML_UINT_INVALID; - - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_SEEKENTRY: - { - uint64_t len; - - len = ebml_read_length(s, &i); - l = len + i; - - while (len > 0) - { - uint64_t l; - int il; - - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_SEEKID: - num = ebml_read_uint(s, &l); - if (num != EBML_UINT_INVALID) - seek_id = num; - break; - - case MATROSKA_ID_SEEKPOSITION: - seek_pos = ebml_read_uint(s, &l); - break; - - default: - ebml_read_skip(s, &l); - break; - } - len -= l + il; - } - - break; - } - - default: - ebml_read_skip(s, &l); - break; - } - length -= l + il; - - if (seek_id == 0 || seek_id == MATROSKA_ID_CLUSTER || seek_pos == EBML_UINT_INVALID || ((mkv_d->segment_start + seek_pos) >= (uint64_t)demuxer->movi_end)) - continue; - - saved_pos = stream_tell(s); - if (!stream_seek(s, mkv_d->segment_start + seek_pos)) - res = 1; - else - { - if (ebml_read_id(s, &il) != seek_id) - res = 1; - else - switch (seek_id) - { - case MATROSKA_ID_CUES: - if (demux_mkv_read_cues(demuxer, s)) - res = 1; - break; - - case MATROSKA_ID_TAGS: - if (demux_mkv_read_tags(demuxer)) - res = 1; - break; - - case MATROSKA_ID_SEEKHEAD: - if (demux_mkv_read_seekhead(demuxer, s)) - res = 1; - break; - - case MATROSKA_ID_CHAPTERS: - if (demux_mkv_read_chapters(demuxer, s)) - res = 1; - break; - } - } - - stream_seek(s, saved_pos); - } - if (res) - { - // If there was an error then try to skip this seek head. - if (stream_seek(s, off)) - res = 0; - } - else if (length > 0) - stream_seek(s, stream_tell(s) + length); - -#ifdef DEBUG - dprintf("[mkv] \\---- [ parsing seek head ] ---------\n"); -#endif - - return res; -} - -static int -demux_mkv_open_video(demuxer_t *demuxer, mkv_track_t *track, int vid); -static int -demux_mkv_open_audio(demuxer_t *demuxer, mkv_track_t *track, int aid); -static int -demux_mkv_open_sub(demuxer_t *demuxer, mkv_track_t *track, int sid); - -static void -display_create_tracks(demuxer_t *demuxer) -{ -#ifdef DEBUG - dprintf("mkv.c display_create_tracks\n\n"); -#endif - - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *)demuxer->priv; - int i, vid = 0, aid = 0, sid = 0; - - for (i = 0; i < mkv_d->num_tracks; i++) - { - char *type = "unknown", str[32]; - *str = '\0'; - switch (mkv_d->tracks[i]->type) - { - case MATROSKA_TRACK_VIDEO: - type = "video"; - demux_mkv_open_video(demuxer, mkv_d->tracks[i], vid); - -#ifdef DEBUG - if (mkv_d->tracks[i]->name) - dprintf("ID_VID_%d_NAME=%s\n", vid, mkv_d->tracks[i]->name); -#endif - - sprintf(str, "-vid %u", vid++); - break; - case MATROSKA_TRACK_AUDIO: - type = "audio"; - demux_mkv_open_audio(demuxer, mkv_d->tracks[i], aid); - -#ifdef DEBUG - if (mkv_d->tracks[i]->name) - dprintf("ID_AID_%d_NAME=%s\n", aid, mkv_d->tracks[i]->name); - if (mkv_d->tracks[i]->language) - dprintf("ID_AID_%d_LANG=%s\n", aid, mkv_d->tracks[i]->language); -#endif - - sprintf(str, "-aid %u, -alang %.5s", aid++, mkv_d->tracks[i]->language); - break; - case MATROSKA_TRACK_SUBTITLE: - type = "subtitles"; - demux_mkv_open_sub(demuxer, mkv_d->tracks[i], sid); - -#ifdef DEBUG - if (mkv_d->tracks[i]->name) - dprintf("ID_SID_%d_NAME=%s\n", sid, mkv_d->tracks[i]->name); - if (mkv_d->tracks[i]->language) - dprintf("ID_SID_%d_LANG=%s\n", sid, mkv_d->tracks[i]->language); -#endif - - sprintf(str, "-sid %u, -slang %.5s", sid++, mkv_d->tracks[i]->language); - break; - } - if (mkv_d->tracks[i]->name) - { - //mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_MPDEMUX_MKV_TrackIDName,mkv_d->tracks[i]->tnum, type, mkv_d->tracks[i]->codec_id, mkv_d->tracks[i]->name, str); - -#ifdef DEBUG - dprintf("Hier fehlt was\n"); -#endif - } - else - { - //mp_msg(MSGT_DEMUX, MSGL_INFO, MSGTR_MPDEMUX_MKV_TrackID,mkv_d->tracks[i]->tnum, type, mkv_d->tracks[i]->codec_id, str); -#ifdef DEBUG - dprintf("Hier fehlt auch was\n"); -#endif - } - } -} - -typedef struct -{ - char *id; - int fourcc; - int extradata; -} videocodec_info_t; - -static const videocodec_info_t vinfo[] = -{ - { MKV_V_MPEG1, mmioFOURCC('m', 'p', 'g', '1'), 0 }, - { MKV_V_MPEG2, mmioFOURCC('m', 'p', 'g', '2'), 0 }, - { MKV_V_MPEG4_SP, mmioFOURCC('m', 'p', '4', 'v'), 1 }, - { MKV_V_MPEG4_ASP, mmioFOURCC('m', 'p', '4', 'v'), 1 }, - { MKV_V_MPEG4_AP, mmioFOURCC('m', 'p', '4', 'v'), 1 }, - { MKV_V_MPEG4_AVC, mmioFOURCC('a', 'v', 'c', '1'), 1 }, - { MKV_V_THEORA, mmioFOURCC('t', 'h', 'e', 'o'), 1 }, - { NULL, 0, 0 } -}; - -static int -demux_mkv_open_video(demuxer_t *demuxer, mkv_track_t *track, int vid) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_open_video\n"); -#endif - - //printf("filename = %s, synced = %d, type = %d, file_format = %d, seekable = %d, num_chapters = %d\n",demuxer->filename,demuxer->synced,demuxer->type,demuxer->file_format,demuxer->seekable,demuxer->num_chapters); - BITMAPINFOHEADER *bih; - void *ImageDesc = NULL; - sh_video_t *sh_v; - - if (track->ms_compat) /* MS compatibility mode */ - { - BITMAPINFOHEADER *src; - - if (track->private_data == NULL || track->private_size < sizeof(BITMAPINFOHEADER)) - return 1; - - src = (BITMAPINFOHEADER *) track->private_data; - bih = calloc(1, track->private_size); - bih->biSize = le2me_32(src->biSize); - bih->biWidth = le2me_32(src->biWidth); - bih->biHeight = le2me_32(src->biHeight); - bih->biPlanes = le2me_16(src->biPlanes); - bih->biBitCount = le2me_16(src->biBitCount); - bih->biCompression = le2me_32(src->biCompression); - bih->biSizeImage = le2me_32(src->biSizeImage); - bih->biXPelsPerMeter = le2me_32(src->biXPelsPerMeter); - bih->biYPelsPerMeter = le2me_32(src->biYPelsPerMeter); - bih->biClrUsed = le2me_32(src->biClrUsed); - bih->biClrImportant = le2me_32(src->biClrImportant); - memcpy((char *) bih + sizeof(BITMAPINFOHEADER), - (char *) src + sizeof(BITMAPINFOHEADER), - track->private_size - sizeof(BITMAPINFOHEADER)); - - if (track->v_width == 0) - track->v_width = bih->biWidth; - if (track->v_height == 0) - track->v_height = bih->biHeight; - } - else - { - bih = calloc(1, sizeof(BITMAPINFOHEADER)); - bih->biSize = sizeof(BITMAPINFOHEADER); - bih->biWidth = track->v_width; - bih->biHeight = track->v_height; - bih->biBitCount = 24; - bih->biSizeImage = bih->biWidth * bih->biHeight * bih->biBitCount / 8; - - if (track->private_size >= RVPROPERTIES_SIZE - && (!strcmp(track->codec_id, MKV_V_REALV10) - || !strcmp(track->codec_id, MKV_V_REALV20) - || !strcmp(track->codec_id, MKV_V_REALV30) - || !strcmp(track->codec_id, MKV_V_REALV40))) - { - unsigned char *dst, *src; - uint32_t type2; - unsigned int cnt; - - src = track->private_data + RVPROPERTIES_SIZE; - - cnt = track->private_size - RVPROPERTIES_SIZE; - bih = realloc(bih, sizeof(BITMAPINFOHEADER) + 8 + cnt); - bih->biSize = 48 + cnt; - bih->biPlanes = 1; - type2 = AV_RB32(src - 4); - if (type2 == 0x10003000 || type2 == 0x10003001) - bih->biCompression = mmioFOURCC('R', 'V', '1', '3'); - else - bih->biCompression = mmioFOURCC('R', 'V', track->codec_id[9], '0'); - dst = (unsigned char *)(bih + 1); - // copy type1 and type2 info from rv properties - memcpy(dst, src - 8, 8); - stream_read(demuxer->stream, dst + 8, cnt); - track->realmedia = 1; - -#ifdef USE_QTX_CODECS - } - else if (track->private_size >= sizeof(ImageDescription) - && !strcmp(track->codec_id, MKV_V_QUICKTIME)) - { - ImageDescriptionPtr idesc; - - idesc = (ImageDescriptionPtr) track->private_data; - idesc->idSize = be2me_32(idesc->idSize); - idesc->cType = be2me_32(idesc->cType); - idesc->version = be2me_16(idesc->version); - idesc->revisionLevel = be2me_16(idesc->revisionLevel); - idesc->vendor = be2me_32(idesc->vendor); - idesc->temporalQuality = be2me_32(idesc->temporalQuality); - idesc->spatialQuality = be2me_32(idesc->spatialQuality); - idesc->width = be2me_16(idesc->width); - idesc->height = be2me_16(idesc->height); - idesc->hRes = be2me_32(idesc->hRes); - idesc->vRes = be2me_32(idesc->vRes); - idesc->dataSize = be2me_32(idesc->dataSize); - idesc->frameCount = be2me_16(idesc->frameCount); - idesc->depth = be2me_16(idesc->depth); - idesc->clutID = be2me_16(idesc->clutID); - bih->biPlanes = 1; - bih->biCompression = idesc->cType; - ImageDesc = idesc; -#endif /* USE_QTX_CODECS */ - - } - else - { - const videocodec_info_t *vi = vinfo; - while (vi->id && strcmp(vi->id, track->codec_id)) vi++; - bih->biCompression = vi->fourcc; - if (vi->extradata && track->private_data && (track->private_size > 0)) - { - bih->biSize += track->private_size; - bih = realloc(bih, bih->biSize); - memcpy(bih + 1, track->private_data, track->private_size); - } - track->reorder_timecodes = !correct_pts; - if (!vi->id) - { - //mp_msg (MSGT_DEMUX,MSGL_WARN, MSGTR_MPDEMUX_MKV_UnknownCodecID,track->codec_id, track->tnum); - free(bih); - bih = NULL; - return 1; - } - } - } - - sh_v = new_sh_video_vid(demuxer, track->tnum, vid); - sh_v->bih = bih; - sh_v->format = sh_v->bih->biCompression; - if (track->v_frate == 0.0) - track->v_frate = 25.0; - sh_v->fps = track->v_frate; - sh_v->frametime = 1 / track->v_frate; - sh_v->aspect = 0; - if (!track->realmedia) - { - sh_v->disp_w = track->v_width; - sh_v->disp_h = track->v_height; - if (track->v_dheight) - sh_v->aspect = (float)track->v_dwidth / (float)track->v_dheight; - } - else - { - // vd_realvid.c will set aspect to disp_w/disp_h and rederive - // disp_w and disp_h from the RealVideo stream contents returned - // by the Real DLLs. If DisplayWidth/DisplayHeight was not set in - // the Matroska file then it has already been set to PixelWidth/Height - // by check_track_information. - sh_v->disp_w = track->v_dwidth; - sh_v->disp_h = track->v_dheight; - } - sh_v->ImageDesc = ImageDesc; - -#ifdef DEBUG - dprintf("[mkv] Aspect: %f\n", sh_v->aspect); -#endif - - sh_v->ds = demuxer->video; - return 0; -} - -static int -demux_mkv_open_audio(demuxer_t *demuxer, mkv_track_t *track, int aid) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_open_audio\n\n"); -#endif - - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - sh_audio_t *sh_a = new_sh_audio_aid(demuxer, track->tnum, aid); - demux_packet_t *dp; - if (!sh_a) return 1; - mkv_d->audio_tracks[mkv_d->last_aid] = track->tnum; - - sh_a->ds = demuxer->audio; - sh_a->wf = malloc(sizeof(WAVEFORMATEX)); - if (track->ms_compat && (track->private_size >= sizeof(WAVEFORMATEX))) - { - WAVEFORMATEX *wf = (WAVEFORMATEX *)track->private_data; - sh_a->wf = realloc(sh_a->wf, track->private_size); - sh_a->wf->wFormatTag = le2me_16(wf->wFormatTag); - sh_a->wf->nChannels = le2me_16(wf->nChannels); - sh_a->wf->nSamplesPerSec = le2me_32(wf->nSamplesPerSec); - sh_a->wf->nAvgBytesPerSec = le2me_32(wf->nAvgBytesPerSec); - sh_a->wf->nBlockAlign = le2me_16(wf->nBlockAlign); - sh_a->wf->wBitsPerSample = le2me_16(wf->wBitsPerSample); - sh_a->wf->cbSize = track->private_size - sizeof(WAVEFORMATEX); - memcpy(sh_a->wf + 1, wf + 1, track->private_size - sizeof(WAVEFORMATEX)); - if (track->a_sfreq == 0.0) - track->a_sfreq = sh_a->wf->nSamplesPerSec; - if (track->a_channels == 0) - track->a_channels = sh_a->wf->nChannels; - if (track->a_bps == 0) - track->a_bps = sh_a->wf->wBitsPerSample; - track->a_formattag = sh_a->wf->wFormatTag; - } - else - { - memset(sh_a->wf, 0, sizeof(WAVEFORMATEX)); - if (!strcmp(track->codec_id, MKV_A_MP3) || !strcmp(track->codec_id, MKV_A_MP2)) - track->a_formattag = 0x0055; - else if (!strncmp(track->codec_id, MKV_A_AC3, strlen(MKV_A_AC3))) - track->a_formattag = 0x2000; - else if (!strcmp(track->codec_id, MKV_A_DTS)) - track->a_formattag = 0x2001; - else if (!strcmp(track->codec_id, MKV_A_PCM) || !strcmp(track->codec_id, MKV_A_PCM_BE)) - track->a_formattag = 0x0001; - else if (!strcmp(track->codec_id, MKV_A_AAC_2MAIN) || - !strncmp(track->codec_id, MKV_A_AAC_2LC, - strlen(MKV_A_AAC_2LC)) || - !strcmp(track->codec_id, MKV_A_AAC_2SSR) || - !strcmp(track->codec_id, MKV_A_AAC_4MAIN) || - !strncmp(track->codec_id, MKV_A_AAC_4LC, - strlen(MKV_A_AAC_4LC)) || - !strcmp(track->codec_id, MKV_A_AAC_4SSR) || - !strcmp(track->codec_id, MKV_A_AAC_4LTP) || - !strcmp(track->codec_id, MKV_A_AAC)) - track->a_formattag = mmioFOURCC('M', 'P', '4', 'A'); - else if (!strcmp(track->codec_id, MKV_A_VORBIS)) - { - if (track->private_data == NULL) - return 1; - track->a_formattag = mmioFOURCC('v', 'r', 'b', 's'); - } - else if (!strcmp(track->codec_id, MKV_A_QDMC)) - track->a_formattag = mmioFOURCC('Q', 'D', 'M', 'C'); - else if (!strcmp(track->codec_id, MKV_A_QDMC2)) - track->a_formattag = mmioFOURCC('Q', 'D', 'M', '2'); - else if (!strcmp(track->codec_id, MKV_A_FLAC)) - { - if (track->private_data == NULL || track->private_size == 0) - { - //mp_msg (MSGT_DEMUX, MSGL_WARN,MSGTR_MPDEMUX_MKV_FlacTrackDoesNotContainValidHeaders); - return 1; - } - track->a_formattag = mmioFOURCC('f', 'L', 'a', 'C'); - } - else if (track->private_size >= RAPROPERTIES4_SIZE) - { - if (!strcmp(track->codec_id, MKV_A_REAL28)) - track->a_formattag = mmioFOURCC('2', '8', '_', '8'); - else if (!strcmp(track->codec_id, MKV_A_REALATRC)) - track->a_formattag = mmioFOURCC('a', 't', 'r', 'c'); - else if (!strcmp(track->codec_id, MKV_A_REALCOOK)) - track->a_formattag = mmioFOURCC('c', 'o', 'o', 'k'); - else if (!strcmp(track->codec_id, MKV_A_REALDNET)) - track->a_formattag = mmioFOURCC('d', 'n', 'e', 't'); - else if (!strcmp(track->codec_id, MKV_A_REALSIPR)) - track->a_formattag = mmioFOURCC('s', 'i', 'p', 'r'); - } - else - { - //mp_msg (MSGT_DEMUX, MSGL_WARN, MSGTR_MPDEMUX_MKV_UnknownAudioCodec,track->codec_id, track->tnum); - free_sh_audio(demuxer, track->tnum); - return 1; - } - } - - sh_a->format = track->a_formattag; - sh_a->wf->wFormatTag = track->a_formattag; - sh_a->channels = track->a_channels; - sh_a->wf->nChannels = track->a_channels; - sh_a->samplerate = (uint32_t) track->a_sfreq; - sh_a->wf->nSamplesPerSec = (uint32_t) track->a_sfreq; - if (track->a_bps == 0) - { - sh_a->samplesize = 2; - sh_a->wf->wBitsPerSample = 16; - } - else - { - sh_a->samplesize = track->a_bps / 8; - sh_a->wf->wBitsPerSample = track->a_bps; - } - if (track->a_formattag == 0x0055) /* MP3 || MP2 */ - { - sh_a->wf->nAvgBytesPerSec = 16000; - sh_a->wf->nBlockAlign = 1152; - } - else if ((track->a_formattag == 0x2000) || /* AC3 */ - (track->a_formattag == 0x2001)) /* DTS */ - { - free(sh_a->wf); - sh_a->wf = NULL; - } - else if (track->a_formattag == 0x0001) /* PCM || PCM_BE */ - { - sh_a->wf->nAvgBytesPerSec = sh_a->channels * sh_a->samplerate * 2; - sh_a->wf->nBlockAlign = sh_a->wf->nAvgBytesPerSec; - if (!strcmp(track->codec_id, MKV_A_PCM_BE)) - sh_a->format = mmioFOURCC('t', 'w', 'o', 's'); - } - else if (!strcmp(track->codec_id, MKV_A_QDMC) || !strcmp(track->codec_id, MKV_A_QDMC2)) - { - sh_a->wf->nAvgBytesPerSec = 16000; - sh_a->wf->nBlockAlign = 1486; - track->fix_i_bps = 1; - track->qt_last_a_pts = 0.0; - if (track->private_data != NULL) - { - sh_a->codecdata = malloc(track->private_size); - memcpy(sh_a->codecdata, track->private_data, - track->private_size); - sh_a->codecdata_len = track->private_size; - } - } - else if (track->a_formattag == mmioFOURCC('M', 'P', '4', 'A')) - { - int profile, srate_idx; - - sh_a->wf->nAvgBytesPerSec = 16000; - sh_a->wf->nBlockAlign = 1024; - - if (!strcmp(track->codec_id, MKV_A_AAC) && (NULL != track->private_data)) - { - sh_a->codecdata = malloc(track->private_size); - memcpy(sh_a->codecdata, track->private_data, - track->private_size); - sh_a->codecdata_len = track->private_size; - return 0; - } - - // Recreate the 'private data' - // which faad2 uses in its initialization - srate_idx = aac_get_sample_rate_index(sh_a->samplerate); - if (!strncmp(&track->codec_id[12], "MAIN", 4)) - profile = 0; - else if (!strncmp(&track->codec_id[12], "LC", 2)) - profile = 1; - else if (!strncmp(&track->codec_id[12], "SSR", 3)) - profile = 2; - else - profile = 3; - sh_a->codecdata = malloc(5); - sh_a->codecdata[0] = ((profile + 1) << 3) | ((srate_idx & 0xE) >> 1); - sh_a->codecdata[1] = ((srate_idx & 0x1) << 7) | (track->a_channels << 3); - - if (strstr(track->codec_id, "SBR") != NULL) - { - // HE-AAC (aka SBR AAC) - sh_a->codecdata_len = 5; - - sh_a->samplerate *= 2; - sh_a->wf->nSamplesPerSec *= 2; - srate_idx = aac_get_sample_rate_index(sh_a->samplerate); - sh_a->codecdata[2] = AAC_SYNC_EXTENSION_TYPE >> 3; - sh_a->codecdata[3] = ((AAC_SYNC_EXTENSION_TYPE & 0x07) << 5) | 5; - sh_a->codecdata[4] = (1 << 7) | (srate_idx << 3); - track->default_duration = 1024.0 / (sh_a->samplerate / 2); - } - else - { - sh_a->codecdata_len = 2; - track->default_duration = 1024.0 / (float)sh_a->samplerate; - } - } - else if (track->a_formattag == mmioFOURCC('v', 'r', 'b', 's')) /* VORBIS */ - { - sh_a->wf->cbSize = track->private_size; - sh_a->wf = realloc(sh_a->wf, sizeof(WAVEFORMATEX) + sh_a->wf->cbSize); - memcpy((unsigned char *)(sh_a->wf + 1), track->private_data, sh_a->wf->cbSize); - } - else if (track->private_size >= RAPROPERTIES4_SIZE && !strncmp(track->codec_id, MKV_A_REALATRC, 7)) - { - // Common initialization for all RealAudio codecs - unsigned char *src = track->private_data; - int codecdata_length, version; - int flavor; - - sh_a->wf->nAvgBytesPerSec = 0; /* FIXME !? */ - - version = AV_RB16(src + 4); - flavor = AV_RB16(src + 22); - track->coded_framesize = AV_RB32(src + 24); - track->sub_packet_h = AV_RB16(src + 40); - sh_a->wf->nBlockAlign = - track->audiopk_size = AV_RB16(src + 42); - track->sub_packet_size = AV_RB16(src + 44); - if (version == 4) - { - src += RAPROPERTIES4_SIZE; - src += src[0] + 1; - src += src[0] + 1; - } - else - src += RAPROPERTIES5_SIZE; - - src += 3; - if (version == 5) - src++; - codecdata_length = AV_RB32(src); - src += 4; - sh_a->wf->cbSize = codecdata_length; - sh_a->wf = realloc(sh_a->wf, sizeof(WAVEFORMATEX) + sh_a->wf->cbSize); - memcpy(((char *)(sh_a->wf + 1)), src, codecdata_length); - - switch (track->a_formattag) - { - case mmioFOURCC('a', 't', 'r', 'c'): - sh_a->wf->nAvgBytesPerSec = atrc_fl2bps[flavor]; - sh_a->wf->nBlockAlign = track->sub_packet_size; - track->audio_buf = malloc(track->sub_packet_h * track->audiopk_size); - track->audio_timestamp = malloc(track->sub_packet_h * sizeof(float)); - break; - case mmioFOURCC('c', 'o', 'o', 'k'): - sh_a->wf->nAvgBytesPerSec = cook_fl2bps[flavor]; - sh_a->wf->nBlockAlign = track->sub_packet_size; - track->audio_buf = malloc(track->sub_packet_h * track->audiopk_size); - track->audio_timestamp = malloc(track->sub_packet_h * sizeof(float)); - break; - case mmioFOURCC('s', 'i', 'p', 'r'): - sh_a->wf->nAvgBytesPerSec = sipr_fl2bps[flavor]; - sh_a->wf->nBlockAlign = track->coded_framesize; - track->audio_buf = malloc(track->sub_packet_h * track->audiopk_size); - track->audio_timestamp = malloc(track->sub_packet_h * sizeof(float)); - break; - case mmioFOURCC('2', '8', '_', '8'): - sh_a->wf->nAvgBytesPerSec = 3600; - sh_a->wf->nBlockAlign = track->coded_framesize; - track->audio_buf = malloc(track->sub_packet_h * track->audiopk_size); - track->audio_timestamp = malloc(track->sub_packet_h * sizeof(float)); - break; - } - - track->realmedia = 1; - } - else if (!strcmp(track->codec_id, MKV_A_FLAC) || (track->a_formattag == 0xf1ac)) - { - unsigned char *ptr; - int size; - free(sh_a->wf); - sh_a->wf = NULL; - - if (track->a_formattag == mmioFOURCC('f', 'L', 'a', 'C')) - { - ptr = (unsigned char *)track->private_data; - size = track->private_size; - } - else - { - sh_a->format = mmioFOURCC('f', 'L', 'a', 'C'); - ptr = (unsigned char *) track->private_data + sizeof(WAVEFORMATEX); - size = track->private_size - sizeof(WAVEFORMATEX); - } - if (size < 4 || ptr[0] != 'f' || ptr[1] != 'L' || ptr[2] != 'a' || ptr[3] != 'C') - { - dp = new_demux_packet(4); - memcpy(dp->buffer, "fLaC", 4); - } - else - { - dp = new_demux_packet(size); - memcpy(dp->buffer, ptr, size); - } - dp->pts = 0; - dp->flags = 0; - ds_add_packet(demuxer->audio, dp); - } - else if (!track->ms_compat || (track->private_size < sizeof(WAVEFORMATEX))) - { - free_sh_audio(demuxer, track->tnum); - return 1; - } - - return 0; -} - -static void -demux_mkv_parse_vobsub_data(demuxer_t *demuxer) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_parse_vobsub_data\n\n"); -#endif - - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - mkv_track_t *track; - int i, m; - uint32_t size; - uint8_t *buffer; - - for (i = 0; i < mkv_d->num_tracks; i++) - { - track = mkv_d->tracks[i]; - if ((track->type != MATROSKA_TRACK_SUBTITLE) || (track->subtitle_type != MATROSKA_SUBTYPE_VOBSUB)) - continue; - - size = track->private_size; - m = demux_mkv_decode(track, track->private_data, &buffer, &size, 2); - if (buffer && m) - { - free(track->private_data); - track->private_data = buffer; - track->private_size = size; - } - if (!demux_mkv_parse_idx(track)) - { - free(track->private_data); - track->private_data = NULL; - track->private_size = 0; - } - } -} - -static int -demux_mkv_open_sub(demuxer_t *demuxer, mkv_track_t *track, int sid) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_open_sub\n\n"); -#endif - - if (track->subtitle_type != MATROSKA_SUBTYPE_UNKNOWN) - { - sh_sub_t *sh = new_sh_sub_sid(demuxer, track->tnum, sid); - track->sh_sub = sh; - sh->type = 't'; - if (track->subtitle_type == MATROSKA_SUBTYPE_VOBSUB) - sh->type = 'v'; - if (track->subtitle_type == MATROSKA_SUBTYPE_SSA) - sh->type = 'a'; - } - else - { - //mp_msg (MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_MKV_SubtitleTypeNotSupported,track->codec_id); - return 1; - } - - return 0; -} -static int demux_mkv_reverse_id(mkv_demuxer_t *d, int num, int type) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_reverse_id\n\n"); -#endif - - int i, id; - - for (i = 0, id = 0; i < d->num_tracks; i++) - if (d->tracks[i] != NULL && d->tracks[i]->type == type) - { - if (d->tracks[i]->tnum == num) - return id; - id++; - } - - return -1; -} -static int -demux_mkv_read_block_lacing(uint8_t *buffer, uint64_t *size, - uint8_t *laces, uint32_t **all_lace_sizes) -{ -//dprintf("mkv.c demux_mkv_read_block_lacing\n\n"); - uint32_t total = 0, *lace_size; - uint8_t flags; - int i; - - *all_lace_sizes = NULL; - lace_size = NULL; - /* lacing flags */ - flags = *buffer++; - (*size)--; - - switch ((flags & 0x06) >> 1) - { - case 0: /* no lacing */ - *laces = 1; - lace_size = calloc(*laces, sizeof(uint32_t)); - lace_size[0] = *size; - break; - - case 1: /* xiph lacing */ - case 2: /* fixed-size lacing */ - case 3: /* EBML lacing */ - *laces = *buffer++; - (*size)--; - (*laces)++; - lace_size = calloc(*laces, sizeof(uint32_t)); - switch ((flags & 0x06) >> 1) - { - case 1: /* xiph lacing */ - for (i = 0; i < *laces - 1; i++) - { - lace_size[i] = 0; - do - { - lace_size[i] += *buffer; - (*size)--; - } - while (*buffer++ == 0xFF); - total += lace_size[i]; - } - lace_size[i] = *size - total; - break; - - case 2: /* fixed-size lacing */ - for (i = 0; i < *laces; i++) - lace_size[i] = *size / *laces; - break; - - case 3: /* EBML lacing */ - { - int l; - uint64_t num = ebml_read_vlen_uint(buffer, &l); - if (num == EBML_UINT_INVALID) - { - free(lace_size); - lace_size = NULL; - return 1; - } - buffer += l; - *size -= l; - total = lace_size[0] = num; - for (i = 1; i < *laces - 1; i++) - { - int64_t snum; - snum = ebml_read_vlen_int(buffer, &l); - if (snum == EBML_INT_INVALID) - { - free(lace_size); - lace_size = NULL; - return 1; - } - buffer += l; - *size -= l; - lace_size[i] = lace_size[i - 1] + snum; - total += lace_size[i]; - } - lace_size[i] = *size - total; - break; - } - } - break; - } - *all_lace_sizes = lace_size; - return 0; -} - -/*static void -handle_subtitles(demuxer_t *demuxer, mkv_track_t *track, unsigned char *block, - int64_t size, uint64_t block_duration, uint64_t timecode) -{ -printf("mkv.c handle_subtitles\n\n"); - demux_packet_t *dp; - unsigned char *ptr1; - int i; - unsigned long int milliDuration = 0; - - if (block_duration == 0) - { - dprintf("DEMUX_MKV_NoBlockDurationForSubtitleTrackFound\n"); - return; - } - -#ifdef USE_ASS - if (ass_enabled && track->subtitle_type == MATROSKA_SUBTYPE_SSA) { - ass_process_chunk(track->sh_sub->ass_track, block, size, (long long)timecode, (long long)block_duration); - return; - } -#endif - - ptr1 = block; - if (track->subtitle_type == MATROSKA_SUBTYPE_SSA) - { - for (i=0; i < 8 && *ptr1 != '\0'; ptr1++) - { - dprintf("%s",ptr1); - if (*ptr1 == ',') - i++; - } - if (*ptr1 == '\0') // Broken line? - { - dprintf("\n"); - return; - } - } - - sub_utf8 = 1; - size -= ptr1 - block; - dp = new_demux_packet(size); - memcpy(dp->buffer, ptr1, size); - dp->pts = timecode / 1000.0f; - dp->endpts = (timecode + block_duration) / 1000.0f; - - subsize = size; - subpts = dp->pts*90000; - subendpts = dp->endpts*90000; - milliDuration = subendpts - subpts; - milliDuration = milliDuration / 90; - printf("mkv: %s pts:%lld milliDuration:%lld\n",dp->buffer,subpts,milliDuration); - ds_add_packet(demuxer->sub, dp); -}*/ - -static void -handle_subtitles(demuxer_t *demuxer, mkv_track_t *track, char *block, - int64_t size, uint64_t block_duration, uint64_t timecode) -{ - demux_packet_t *dp; - - if (block_duration == 0) - { - return; - } - - sub_utf8 = 1; - dp = new_demux_packet(size); - memcpy(dp->buffer, block, size); - dp->pts = timecode / 1000.0f; - dp->endpts = (timecode + block_duration) / 1000.0f; - ds_add_packet(demuxer->sub, dp); -} - -// Taken from demux_real.c. Thanks to the original developpers :) -#define SKIP_BITS(n) buffer <<= n -#define SHOW_BITS(n) ((buffer) >> (32 - (n))) - -static float real_fix_timestamp(mkv_track_t *track, unsigned char *s, - int timestamp) -{ -#ifdef DEBUG - dprintf("mkv.c real_fix_timestamp\n\n"); -#endif - - float v_pts; - uint32_t buffer = (s[0] << 24) + (s[1] << 16) + (s[2] << 8) + s[3]; - int kf = timestamp; - int pict_type; - int orig_kf; - - if (!strcmp(track->codec_id, MKV_V_REALV30) || - !strcmp(track->codec_id, MKV_V_REALV40)) - { - - if (!strcmp(track->codec_id, MKV_V_REALV30)) - { - SKIP_BITS(3); - pict_type = SHOW_BITS(2); - SKIP_BITS(2 + 7); - } - else - { - SKIP_BITS(1); - pict_type = SHOW_BITS(2); - SKIP_BITS(2 + 7 + 3); - } - kf = SHOW_BITS(13); // kf= 2*SHOW_BITS(12); - orig_kf = kf; - if (pict_type <= 1) - { - // I frame, sync timestamps: - track->rv_kf_base = timestamp - kf; -#ifdef DEBUG - dprintf("\nTS: base=%08X\n", track->rv_kf_base); -#endif - kf = timestamp; - } - else - { - // P/B frame, merge timestamps: - int tmp = timestamp - track->rv_kf_base; - kf |= tmp & (~0x1fff); // combine with packet timestamp - if (kf < (tmp - 4096)) // workaround wrap-around problems - kf += 8192; - else if (kf > (tmp + 4096)) - kf -= 8192; - kf += track->rv_kf_base; - } - if (pict_type != 3) // P || I frame -> swap timestamps - { - int tmp = kf; - kf = track->rv_kf_pts; - track->rv_kf_pts = tmp; - } - -#ifdef DEBUG - dprintf("\nTS: %08X -> %08X (%04X) %d %02X %02X %02X " - "%02X %5d\n", timestamp, kf, orig_kf, pict_type, s[0], s[1], s[2], - s[3], kf - (int)(1000.0 * track->rv_pts)); -#endif - - } - v_pts = kf * 0.001f; - track->rv_pts = v_pts; - - return v_pts; -} - -static void -handle_realvideo(demuxer_t *demuxer, mkv_track_t *track, uint8_t *buffer, - uint32_t size, int block_bref) -{ -#ifdef DEBUG - dprintf("mkv.c handle_realvideo\n\n"); -#endif - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - demux_packet_t *dp; - uint32_t timestamp = mkv_d->last_pts * 1000; - unsigned char *hdr; - uint8_t chunks; - int isize; -#ifdef WORDS_BIGENDIAN - uint8_t *p; - int i; -#endif - - chunks = *buffer++; - isize = --size - (chunks + 1) * 8; - dp = new_demux_packet(REALHEADER_SIZE + size); - memcpy(dp->buffer + REALHEADER_SIZE, buffer + (chunks + 1) * 8, isize); -#ifdef WORDS_BIGENDIAN - p = (uint8_t *)(dp->buffer + REALHEADER_SIZE + isize); - for (i = 0; i < (chunks + 1) * 8; i += 4) - { - p[i] = *((uint8_t *)buffer + i + 3); - p[i + 1] = *((uint8_t *)buffer + i + 2); - p[i + 2] = *((uint8_t *)buffer + i + 1); - p[i + 3] = *((uint8_t *)buffer + i); - } -#else - memcpy(dp->buffer + REALHEADER_SIZE + isize, buffer, (chunks + 1) * 8); -#endif - - hdr = dp->buffer; - *hdr++ = chunks; // number of chunks - *hdr++ = timestamp; // timestamp from packet header - *hdr++ = isize; // length of actual data - *hdr++ = REALHEADER_SIZE + isize; // offset to chunk offset array - - if (mkv_d->v_skip_to_keyframe) - { - dp->pts = mkv_d->last_pts; - track->rv_kf_base = 0; - track->rv_kf_pts = timestamp; - } - else - dp->pts = real_fix_timestamp(track, dp->buffer + REALHEADER_SIZE, - timestamp); - dp->pos = demuxer->filepos; - dp->flags = block_bref ? 0 : 0x10; - - ds_add_packet(demuxer->video, dp); -} - -static void -handle_realaudio(demuxer_t *demuxer, mkv_track_t *track, uint8_t *buffer, - uint32_t size, int block_bref) -{ -#ifdef DEBUG - dprintf("mkv.c handle_realaudio\n\n"); -#endif - - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - int sps = track->sub_packet_size; - int sph = track->sub_packet_h; - int cfs = track->coded_framesize; - int w = track->audiopk_size; - int spc = track->sub_packet_cnt; - demux_packet_t *dp; - int x; - - if ((track->a_formattag == mmioFOURCC('2', '8', '_', '8')) || - (track->a_formattag == mmioFOURCC('c', 'o', 'o', 'k')) || - (track->a_formattag == mmioFOURCC('a', 't', 'r', 'c')) || - (track->a_formattag == mmioFOURCC('s', 'i', 'p', 'r'))) - { -// if(!block_bref) -// spc = track->sub_packet_cnt = 0; - switch (track->a_formattag) - { - case mmioFOURCC('2', '8', '_', '8'): - for (x = 0; x < sph / 2; x++) - memcpy(track->audio_buf + x * 2 * w + spc * cfs, buffer + cfs * x, cfs); - break; - case mmioFOURCC('c', 'o', 'o', 'k'): - case mmioFOURCC('a', 't', 'r', 'c'): - for (x = 0; x < w / sps; x++) - memcpy(track->audio_buf + sps * (sph * x + ((sph + 1) / 2) * (spc & 1) + (spc >> 1)), buffer + sps * x, sps); - break; - case mmioFOURCC('s', 'i', 'p', 'r'): - memcpy(track->audio_buf + spc * w, buffer, w); - if (spc == sph - 1) - { - int n; - int bs = sph * w * 2 / 96; // nibbles per subpacket - // Perform reordering - for (n = 0; n < 38; n++) - { - int j; - int i = bs * sipr_swaps[n][0]; - int o = bs * sipr_swaps[n][1]; - // swap nibbles of block 'i' with 'o' TODO: optimize - for (j = 0; j < bs; j++) - { - int x = (i & 1) ? (track->audio_buf[i >> 1] >> 4) : (track->audio_buf[i >> 1] & 0x0F); - int y = (o & 1) ? (track->audio_buf[o >> 1] >> 4) : (track->audio_buf[o >> 1] & 0x0F); - if (o & 1) - track->audio_buf[o >> 1] = (track->audio_buf[o >> 1] & 0x0F) | (x << 4); - else - track->audio_buf[o >> 1] = (track->audio_buf[o >> 1] & 0xF0) | x; - if (i & 1) - track->audio_buf[i >> 1] = (track->audio_buf[i >> 1] & 0x0F) | (y << 4); - else - track->audio_buf[i >> 1] = (track->audio_buf[i >> 1] & 0xF0) | y; - ++i; - ++o; - } - } - } - break; - } - track->audio_timestamp[track->sub_packet_cnt] = (track->ra_pts == mkv_d->last_pts) ? 0 : (mkv_d->last_pts); - track->ra_pts = mkv_d->last_pts; - if (track->sub_packet_cnt == 0) - track->audio_filepos = demuxer->filepos; - if (++(track->sub_packet_cnt) == sph) - { - int apk_usize = ((WAVEFORMATEX *)((sh_audio_t *)demuxer->audio->sh)->wf)->nBlockAlign; - track->sub_packet_cnt = 0; - // Release all the audio packets - for (x = 0; x < sph * w / apk_usize; x++) - { - dp = new_demux_packet(apk_usize); - memcpy(dp->buffer, track->audio_buf + x * apk_usize, apk_usize); - /* Put timestamp only on packets that correspond to original audio packets in file */ - dp->pts = (x * apk_usize % w) ? 0 : track->audio_timestamp[x * apk_usize / w]; - dp->pos = track->audio_filepos; // all equal - dp->flags = x ? 0 : 0x10; // Mark first packet as keyframe - ds_add_packet(demuxer->audio, dp); - } - } - } - else // Not a codec that require reordering - { - dp = new_demux_packet(size); - memcpy(dp->buffer, buffer, size); - if (track->ra_pts == mkv_d->last_pts && !mkv_d->a_skip_to_keyframe) - dp->pts = 0; - else - dp->pts = mkv_d->last_pts; - track->ra_pts = mkv_d->last_pts; - - dp->pos = demuxer->filepos; - dp->flags = block_bref ? 0 : 0x10; - ds_add_packet(demuxer->audio, dp); - } -} - -/** Reorder timecodes and add cached demux packets to the queues. - * - * Timecode reordering is needed if a video track contains B frames that - * are timestamped in display order (e.g. MPEG-1, MPEG-2 or "native" MPEG-4). - * MPlayer doesn't like timestamps in display order. This function adjusts - * the timestamp of cached frames (which are exactly one I/P frame followed - * by one or more B frames) so that they are in coding order again. - * - * Example: The track with 25 FPS contains four frames with the timecodes - * I at 0ms, P at 120ms, B at 40ms and B at 80ms. As soon as the next I - * or P frame arrives these timecodes can be changed to I at 0ms, P at 40ms, - * B at 80ms and B at 120ms. - * - * This works for simple H.264 B-frame pyramids, but not for arbitrary orders. - * - * \param demuxer The Matroska demuxer struct for this instance. - * \param track The track structure whose cache should be handled. - */ -static void -flush_cached_dps(demuxer_t *demuxer, mkv_track_t *track/*,demux_stream_t *video*/) -{ -#ifdef DEBUG - dprintf("mkv.c flush_cached_dps\n"); -#endif - - int i, ok; - - if (track->num_cached_dps == 0) - return; - - do - { - ok = 1; - for (i = 1; i < track->num_cached_dps; i++) - if (track->cached_dps[i - 1]->pts > track->cached_dps[i]->pts) - { - float tmp_pts = track->cached_dps[i - 1]->pts; - track->cached_dps[i - 1]->pts = track->cached_dps[i]->pts; - track->cached_dps[i]->pts = tmp_pts; - ok = 0; - } - } - while (!ok); - - for (i = 0; i < track->num_cached_dps; i++) - ds_add_packet(demuxer->video, track->cached_dps[i]); - track->num_cached_dps = 0; -} - -/** Cache video frames if timecodes have to be reordered. - * - * Timecode reordering is needed if a video track contains B frames that - * are timestamped in display order (e.g. MPEG-1, MPEG-2 or "native" MPEG-4). - * This function takes in a Matroska block read from the file, allocates a - * demux packet for it, fills in its values, allocates space for storing - * pointers to the cached demux packets and adds the packet to it. If - * the packet contains an I or a P frame then ::flush_cached_dps is called - * in order to send the old cached frames downstream. - * - * \param demuxer The Matroska demuxer struct for this instance. - * \param track The packet is meant for this track. - * \param buffer The actual frame contents. - * \param size The frame size in bytes. - * \param block_bref A relative timecode (backward reference). If it is \c 0 - * then the frame is an I frame. - * \param block_fref A relative timecode (forward reference). If it is \c 0 - * then the frame is either an I frame or a P frame depending on the value - * of \a block_bref. Otherwise it's a B frame. - */ -static void -handle_video_bframes(demuxer_t *demuxer, mkv_track_t *track, uint8_t *buffer, - uint32_t size, int block_bref, int block_fref/*,demux_stream_t *audio,demux_stream_t *video,demux_stream_t *sub*/) -{ -#ifdef DEBUG - dprintf("mkv.c handle_video_bframes->\n"); -#endif - - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - demux_packet_t *dp; - - dp = new_demux_packet(size); - memcpy(dp->buffer, buffer, size); - dp->pos = demuxer->filepos; - dp->pts = mkv_d->last_pts; - if ((track->num_cached_dps > 0) && (dp->pts < track->max_pts)) - block_fref = 1; - if (block_fref == 0) /* I or P frame */ - flush_cached_dps(demuxer, track/*, video*/); - if (block_bref != 0) /* I frame, don't cache it */ - dp->flags = 0x10; - if ((track->num_cached_dps + 1) > track->num_allocated_dps) - { - track->cached_dps = (demux_packet_t **) - realloc(track->cached_dps, (track->num_cached_dps + 10) * - sizeof(demux_packet_t *)); - track->num_allocated_dps += 10; - } - track->cached_dps[track->num_cached_dps] = dp; - track->num_cached_dps++; - if (dp->pts > track->max_pts) - track->max_pts = dp->pts; - -#ifdef DEBUG - dprintf("mkv.c handle_video_bframes-<\n"); -#endif -} - -int WriteDataToDevice(int Device, unsigned char *Data, int DataLength) -{ - int len = write(Device, Data, DataLength); - return len; -} - -void Hexdump(unsigned char *Data, int length) -{ - //#ifdef DEBUG - int k; - for (k = 0; k < length; k++) - { - printf("%02x ", Data[k]); - if (((k + 1) & 31) == 0) - printf("\n"); - } - printf("\n"); - //#endif -} - -static int -handle_block(demuxer_t *demuxer, uint8_t *block, uint64_t length, - uint64_t block_duration, int64_t block_bref, int64_t block_fref, uint8_t simpleblock) -{ - -#ifdef DEBUG - dprintf("handle_block->\n"); -#endif - - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - mkv_track_t *track = NULL; - demux_stream_t *ds = NULL; - uint64_t old_length; - int64_t tc; - uint32_t *lace_size; - uint8_t laces, flags; - int i, num, tmp, use_this_block = 1; - float current_pts; - int16_t time; - - /* first byte(s): track num */ - num = ebml_read_vlen_uint(block, &tmp); -//printf("num=%d\n", num); - block += tmp; - /* time (relative to cluster time) */ - time = block[0] << 8 | block[1]; - block += 2; - length -= tmp + 2; - old_length = length; - flags = block[0]; - - if (demux_mkv_read_block_lacing(block, &length, &laces, &lace_size)) - return 0; - block += old_length - length; - - tc = ((time * mkv_d->tc_scale + mkv_d->cluster_tc) / 1000000.0 - mkv_d->first_tc); - if (tc < 0) - tc = 0; - - if (mkv_d->stop_timecode > 0 && tc > mkv_d->stop_timecode) - { - free(lace_size); - lace_size = NULL; - return -1; - } - current_pts = tc / 1000.0; - - for (i = 0; i < mkv_d->num_tracks; i++) - { - if (mkv_d->tracks[i]->tnum == num) - { - track = mkv_d->tracks[i]; - break; - } - } - - if (track == NULL) - { - free(lace_size); - lace_size = NULL; - return 1; - } - //printf("num = %d demuxer->sub->id = %d\n", num, demuxer->sub->id); - if (num == demuxer->audio->id) - { - ds = demuxer->audio; - - if (mkv_d->a_skip_to_keyframe) - { - if (simpleblock) - { - if (!(flags & 0x80)) /*current frame isn't a keyframe*/ - use_this_block = 0; - } - else if (block_bref != 0) - use_this_block = 0; - } - else if (mkv_d->v_skip_to_keyframe) - use_this_block = 0; - - if (track->fix_i_bps && use_this_block) - { - sh_audio_t *sh = (sh_audio_t *) ds->sh; - - if (block_duration != 0) - { - sh->i_bps = length * 1000 / block_duration; - track->fix_i_bps = 0; - } - else if (track->qt_last_a_pts == 0.0) - track->qt_last_a_pts = current_pts; - else if (track->qt_last_a_pts != current_pts) - { - sh->i_bps = length / (current_pts - track->qt_last_a_pts); - track->fix_i_bps = 0; - } - } - } - else if (tc < mkv_d->skip_to_timecode) - use_this_block = 0; - else if (num == demuxer->video->id) - { - ds = demuxer->video; - if (mkv_d->v_skip_to_keyframe) - { - if (simpleblock) - { - if (!(flags & 0x80)) /*current frame isn't a keyframe*/ - use_this_block = 0; - } - else if (block_bref != 0 || block_fref != 0) - use_this_block = 0; - } - } - else if (num == demuxer->sub->id) - { - - ds = demuxer->sub; - if (track->subtitle_type != MATROSKA_SUBTYPE_VOBSUB) - { - - if (!mkv_d->v_skip_to_keyframe) - handle_subtitles(demuxer, track, (char *) block, length, - block_duration, tc); - use_this_block = 0; - } - } - else - use_this_block = 0; - -#ifdef DEBUG - dprintf("use_this_block ? %d\n", use_this_block); -#endif - - if (use_this_block) - { - mkv_d->last_pts = current_pts; - mkv_d->last_filepos = demuxer->filepos; - - for (i = 0; i < laces; i++) - { - if (ds == demuxer->video && track->realmedia) - handle_realvideo(demuxer, track, block, lace_size[i], block_bref); - else if (ds == demuxer->audio && track->realmedia) - handle_realaudio(demuxer, track, block, lace_size[i], block_bref); - else if (ds == demuxer->video && track->reorder_timecodes) - handle_video_bframes(demuxer, track, block, lace_size[i], - block_bref, block_fref); - else - { - int modified; - uint32_t size = lace_size[i]; - demux_packet_t *dp; - uint8_t *buffer; - modified = demux_mkv_decode(track, block, &buffer, &size, 1); - if (buffer) - { - -//DONALD--------------------- - if (num == demuxer->audio->id) - { - - } - else if (num == demuxer->video->id) - { - - } -//DONALD--END---------------- - - dp = new_demux_packet(size); - memcpy(dp->buffer, buffer, size); - if (modified) - { - free(buffer); - buffer = NULL; - } - dp->flags = (block_bref == 0 && block_fref == 0) ? 0x10 : 0; - /* If default_duration is 0, assume no pts value is known - * for packets after the first one (rather than all pts - * values being the same) */ - if (i == 0 || track->default_duration) - dp->pts = mkv_d->last_pts + i * track->default_duration; - ds_add_packet(ds, dp); - } - } - block += lace_size[i]; - } - - if (ds == demuxer->video) - { - mkv_d->v_skip_to_keyframe = 0; - mkv_d->skip_to_timecode = 0; - } - else if (ds == demuxer->audio) - mkv_d->a_skip_to_keyframe = 0; - - free(lace_size); - lace_size = NULL; - -#ifdef DEBUG - dprintf("handle_block-< 1\n"); -#endif - - return 1; - } - - free(lace_size); - lace_size = NULL; - -#ifdef DEBUG - dprintf("handle_block-< 0\n"); -#endif - - return 0; -} - -int demux_mkv_open(demuxer_t *demuxer, stream_t *s) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_open\n\n"); -#endif - - int i, version, cont = 0; - char *str; - -#ifdef DEBUG - dprintf("fd=%d\n", s->fd); -#endif - - mkv_demuxer_t *mkv_d; - mkv_track_t *track; - //track = (mkv_track_t*)malloc ( sizeof(mkv_track_t)); - - stream_seek(s, s->start_pos); - - str = ebml_read_header(s, &version); - if (str == NULL || strcmp(str, "matroska") || version > 2) - { -#ifdef DEBUG - dprintf("[mkv] no head found\n"); -#endif - - return 0; - } - free(str); - str = NULL; - -#ifdef DEBUG - dprintf("[mkv] Found the head...\n"); -#endif - - if (ebml_read_id(s, NULL) != MATROSKA_ID_SEGMENT) - { -#ifdef DEBUG - dprintf("[mkv] but no segment :(\n"); -#endif - - return 0; - } - - ebml_read_length(s, NULL); /* return bytes number until EOF */ - -#ifdef DEBUG - dprintf("[mkv] + a segment...\n"); -#endif - - mkv_d = calloc(1, sizeof(mkv_demuxer_t)); - demuxer->priv = mkv_d; - mkv_d->tc_scale = 1000000; - mkv_d->segment_start = stream_tell(s); - mkv_d->parsed_cues = malloc(sizeof(off_t)); - mkv_d->parsed_seekhead = malloc(sizeof(off_t)); -//Trick: ab hier gibt es ein problem mit dem read und dem s->buffer - while (!cont) - { - switch (ebml_read_id(s, NULL)) - { - case MATROSKA_ID_INFO: -#ifdef DEBUG - dprintf("[mkv] |+ segment information...\n"); -#endif - - cont = demux_mkv_read_info(demuxer, s); - break; - - case MATROSKA_ID_TRACKS: -#ifdef DEBUG - dprintf("[mkv] |+ segment tracks...\n"); -#endif - - cont = demux_mkv_read_tracks(demuxer, s); - break; - - case MATROSKA_ID_CUES: - cont = demux_mkv_read_cues(demuxer, s); - break; - - case MATROSKA_ID_TAGS: - cont = demux_mkv_read_tags(demuxer); - break; - - case MATROSKA_ID_SEEKHEAD: - cont = demux_mkv_read_seekhead(demuxer, s); - break; - - case MATROSKA_ID_CHAPTERS: - cont = demux_mkv_read_chapters(demuxer, s); - break; - - case MATROSKA_ID_ATTACHMENTS: - cont = demux_mkv_read_attachments(demuxer, s); - break; - - case MATROSKA_ID_CLUSTER: - { - int p, l; - -#ifdef DEBUG - dprintf("[mkv] |+ found cluster, headers are parsed completely :)\n"); -#endif - - /* get the first cluster timecode */ - p = stream_tell(s); - l = ebml_read_length(s, NULL); - while (ebml_read_id(s, NULL) != MATROSKA_ID_CLUSTERTIMECODE) - { - ebml_read_skip(s, NULL); - if (stream_tell(s) >= p + l) - break; - } - if (stream_tell(s) < p + l) - { - uint64_t num = ebml_read_uint(s, NULL); - if (num == EBML_UINT_INVALID) - return 0; - mkv_d->first_tc = num * mkv_d->tc_scale / 1000000.0; - mkv_d->has_first_tc = 1; - } - stream_seek(s, p - 4); - cont = 1; - break; - } - - default: - cont = 1; - case EBML_ID_VOID: - ebml_read_skip(s, NULL); - break; - } - } - display_create_tracks(demuxer); - -#ifdef DEBUG - dprintf("HELLO1\n"); -#endif - - /* select video track */ - track = NULL; - //FIXME - if (demuxer->video->id == -1) /* automatically select a video track */ - //if (video->id == -1) /* automatically select a video track */ - { -#ifdef DEBUG - dprintf("HELLO1-1\n"); -#endif - - /* search for a video track that has the 'default' flag set */ - for (i = 0; i < mkv_d->num_tracks; i++) - if (mkv_d->tracks[i]->type == MATROSKA_TRACK_VIDEO && mkv_d->tracks[i]->default_track) - { - track = mkv_d->tracks[i]; - break; - } - -#ifdef DEBUG - dprintf("HELLO1-2\n"); -#endif - - if (track == NULL) - /* no track has the 'default' flag set */ - /* let's take the first video track */ - for (i = 0; i < mkv_d->num_tracks; i++) - if (mkv_d->tracks[i]->type == MATROSKA_TRACK_VIDEO) - { - track = mkv_d->tracks[i]; - break; - } - } - //FIXME - else if (demuxer->video->id != -2) /* -2 = no video at all */ - track = demux_mkv_find_track_by_num(mkv_d, demuxer->video->id, MATROSKA_TRACK_VIDEO); - -#ifdef DEBUG - dprintf("HELLO1-4\n"); -#endif - - if (track && demuxer->v_streams[track->tnum]) - { -#ifdef DEBUG - dprintf("DEMUX_MKV_WillPlayVideoTrack %d\n", track->tnum); -#endif - - demuxer->video->id = track->tnum; - demuxer->video->sh = demuxer->v_streams[track->tnum]; - } - else - { -#ifdef DEBUG - dprintf("DEMUX_MKV_NoVideoTrackFound\n"); -#endif - - demuxer->video->id = -2; - } - -#ifdef DEBUG - dprintf("HELLO2\n"); -#endif - - /* select audio track */ - track = NULL; - if (demuxer->audio->id == -1) /* automatically select an audio track */ - { - /* check if the user specified an audio language */ - if (audio_lang != NULL) - track = demux_mkv_find_track_by_language(mkv_d, audio_lang, MATROSKA_TRACK_AUDIO); - if (track == NULL) - /* no audio language specified, or language not found */ - /* search for an audio track that has the 'default' flag set */ - for (i = 0; i < mkv_d->num_tracks; i++) - if (mkv_d->tracks[i]->type == MATROSKA_TRACK_AUDIO && mkv_d->tracks[i]->default_track) - { - track = mkv_d->tracks[i]; - break; - } - - if (track == NULL) - /* no track has the 'default' flag set */ - /* let's take the first audio track */ - for (i = 0; i < mkv_d->num_tracks; i++) - if (mkv_d->tracks[i]->type == MATROSKA_TRACK_AUDIO) - { - track = mkv_d->tracks[i]; - break; - } - } - else if (demuxer->audio->id != -2) /* -2 = no audio at all */ - track = demux_mkv_find_track_by_num(mkv_d, demuxer->audio->id, MATROSKA_TRACK_AUDIO); - if (track && demuxer->a_streams[track->tnum]) - { - demuxer->audio->id = track->tnum; - demuxer->audio->sh = demuxer->a_streams[track->tnum]; - } - else - { -#ifdef DEBUG - dprintf("DEMUX_MKV_NoAudioTrackFound\n"); -#endif - - demuxer->audio->id = -2; - } - - if (demuxer->audio->id != -2) - for (i = 0; i < mkv_d->num_tracks; i++) - { - if (mkv_d->tracks[i]->type != MATROSKA_TRACK_AUDIO) - continue; - if (demuxer->a_streams[track->tnum]) - { - mkv_d->last_aid++; - if (mkv_d->last_aid == MAX_A_STREAMS) - break; - } - } - - demux_mkv_parse_vobsub_data(demuxer); -#ifdef USE_ASS - if (ass_enabled) - demux_mkv_parse_ass_data(demuxer); -#endif - - dvdsub_lang = "eng"; - /* DO NOT automatically select a subtitle track and behave like DVD */ - /* playback: only show subtitles if the user explicitely wants them. */ - track = NULL; - if (demuxer->sub->id >= 0) - { -#ifdef DEBUG - printf("demuxer->sub->id = %d", demuxer->sub->id); -#endif - - track = demux_mkv_find_track_by_num(mkv_d, demuxer->sub->id, MATROSKA_TRACK_SUBTITLE); - } - else if (dvdsub_lang != NULL) - track = demux_mkv_find_track_by_language(mkv_d, dvdsub_lang, MATROSKA_TRACK_SUBTITLE); - - if (track) - { -#ifdef DEBUG - printf("DEMUX_MKV_WillDisplaySubtitleTrack %d\n", track->tnum); -#endif - - dvdsub_id = demux_mkv_reverse_id(mkv_d, track->tnum, MATROSKA_TRACK_SUBTITLE); - demuxer->sub->id = track->tnum; - demuxer->sub->sh = demuxer->s_streams[track->tnum]; - } - else - demuxer->sub->id = -2; - - if (demuxer->chapters) - { - for (i = 0; i < (int)demuxer->num_chapters; i++) - { - demuxer->chapters[i].start -= mkv_d->first_tc; - demuxer->chapters[i].end -= mkv_d->first_tc; - } -//FIXME - /* if (dvd_last_chapter > 0 && dvd_last_chapter <= demuxer->num_chapters) - { - if (demuxer->chapters[dvd_last_chapter-1].end != 0) - mkv_d->stop_timecode = demuxer->chapters[dvd_last_chapter-1].end; - else if (dvd_last_chapter + 1 <= demuxer->num_chapters) - mkv_d->stop_timecode = demuxer->chapters[dvd_last_chapter].start; - }*/ - } - - if (s->end_pos == 0 || (mkv_d->indexes == NULL && index_mode < 0)) - demuxer->seekable = 0; - else - { - demuxer->movi_start = s->start_pos; - demuxer->movi_end = s->end_pos; - demuxer->seekable = 1; -//FIXME - /* if (demuxer->chapters && dvd_chapter>1 && dvd_chapter<=demuxer->num_chapters) - { - if (!mkv_d->has_first_tc) - { - mkv_d->first_tc = 0; - mkv_d->has_first_tc = 1; - } - demux_mkv_seek (demuxer, - demuxer->chapters[dvd_chapter-1].start/1000.0, 0.0, 1); - }*/ - } - - return DEMUXER_TYPE_MATROSKA; - -} - -int demux_mkv_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds/*, stream_t *s,demux_stream_t *audio,demux_stream_t *video,demux_stream_t *sub,PlayerContext_t *Context*/) -{ -#ifdef DEBUG - dprintf("mkv.c demux_mkv_fill_buffer\n\n"); -#endif - - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - stream_t *s = demuxer->stream; - uint64_t l; - int il, tmp; - - while (1) - { -//dprintf("cluster_size=%u\n", mkv_d->cluster_size); - while (mkv_d->cluster_size > 0) - { - uint64_t block_duration = 0, block_length = 0; - int64_t block_bref = 0, block_fref = 0; - uint8_t *block = NULL; - -//dprintf("blockgroup_size=%u\n", mkv_d->blockgroup_size); - while (mkv_d->blockgroup_size > 0) - { - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_BLOCKDURATION: - { -#ifdef DEBUG - dprintf(" ->MATROSKA_ID_BLOCKDURATION\n"); -#endif - - block_duration = ebml_read_uint(s, &l); - if (block_duration == EBML_UINT_INVALID) - { - free(block); - block = NULL; - return 0; - } - -#ifdef DEBUG - dprintf("bd = %u - ", block_duration); -#endif - - block_duration *= mkv_d->tc_scale / 1000000.0; - -#ifdef DEBUG - dprintf("%u\n", block_duration); -#endif - - break; - } - - case MATROSKA_ID_BLOCK: -#ifdef DEBUG - dprintf(" ->MATROSKA_ID_BLOCK\n"); -#endif - block_length = ebml_read_length(s, &tmp); - free(block); - block = NULL; - if (block_length > SIZE_MAX - LZO_INPUT_PADDING) return 0; - block = malloc(block_length + LZO_INPUT_PADDING); - demuxer->filepos = stream_tell(s); - -//we fill the buffer ot the stream! - if (stream_read(s, block, block_length) != (int) block_length) - { - free(block); - block = NULL; - return 0; - } - l = tmp + block_length; - break; - - case MATROSKA_ID_REFERENCEBLOCK: - { -#ifdef DEBUG - dprintf(" ->MATROSKA_ID_REFERENCEBLOCK\n"); -#endif - - int64_t num = ebml_read_int(s, &l); - if (num == EBML_INT_INVALID) - { - free(block); - block = NULL; - return 0; - } - if (num <= 0) - block_bref = num; - else - block_fref = num; - break; - } - - case EBML_ID_INVALID: -#ifdef DEBUG - dprintf(" ->EBML_ID_INVALID\n"); -#endif - - free(block); - block = NULL; - return 0; - - default: - ebml_read_skip(s, &l); - break; - } - mkv_d->blockgroup_size -= l + il; - mkv_d->cluster_size -= l + il; - } -#ifdef DEBUG - dprintf("block ? "); -#endif - - if (block) - { -#ifdef DEBUG - dprintf("true\n"); -#endif - - int res = handle_block(demuxer, block, block_length, - block_duration, block_bref, block_fref, 0/*,audio,video,sub*/); - free(block); - block = NULL; - if (res < 0) - return 0; - - if (res) - return 1; - } - else - - if (mkv_d->cluster_size > 0) - { - switch (ebml_read_id(s, &il)) - { - case MATROSKA_ID_CLUSTERTIMECODE: - { -#ifdef DEBUG - dprintf(" ->MATROSKA_ID_CLUSTERTIMECODE\n"); -#endif - - uint64_t num = ebml_read_uint(s, &l); - if (num == EBML_UINT_INVALID) - return 0; - if (!mkv_d->has_first_tc) - { - mkv_d->first_tc = num * mkv_d->tc_scale / 1000000.0; - mkv_d->has_first_tc = 1; - } - mkv_d->cluster_tc = num * mkv_d->tc_scale; - break; - } - - case MATROSKA_ID_BLOCKGROUP: -#ifdef DEBUG - dprintf(" ->MATROSKA_ID_BLOCKGROUP\n"); -#endif - - mkv_d->blockgroup_size = ebml_read_length(s, &tmp); - l = tmp; - break; - - case MATROSKA_ID_SIMPLEBLOCK: - { -#ifdef DEBUG - dprintf(" ->MATROSKA_ID_SIMPLEBLOCK\n"); -#endif - - int res; - block_length = ebml_read_length(s, &tmp); - block = malloc(block_length); - demuxer->filepos = stream_tell(s); - if (stream_read(s, block, block_length) != (int) block_length) - { - free(block); - block = NULL; - return 0; - } - -#ifdef DEBUG - int k; - dprintf("Test MATROSKA_ID_SIMPLEBLOCK\n"); - for (k = 0; k < block_length; k++) - { - dprintf("%02x ", block[k]); - if (((k + 1) & 31) == 0) - dprintf("\n"); - } -#endif - - l = tmp + block_length; - res = handle_block(demuxer, block, block_length, - block_duration, block_bref, block_fref, 1/*,audio,video,sub*/); - free(block); - block = NULL; - mkv_d->cluster_size -= l + il; - if (res < 0) - return 0; - else if (res) - return 1; - else mkv_d->cluster_size += l + il; - break; - } - case EBML_ID_INVALID: -#ifdef DEBUG - dprintf(" ->MATROSKA_ID_INVALID\n"); -#endif - return 0; - - default: - ebml_read_skip(s, &l); - break; - } - mkv_d->cluster_size -= l + il; - } - } - -#ifdef DEBUG - dprintf(" <-AND AGAIN\n"); -#endif - - if (ebml_read_id(s, &il) != MATROSKA_ID_CLUSTER) - return 0; - add_cluster_position(mkv_d, stream_tell(s) - il); - mkv_d->cluster_size = ebml_read_length(s, NULL); - } - - return 0; -} - -static int whileSeeking = 0; - -static void -demux_mkv_seek(demuxer_t *demuxer, float rel_seek_secs, float audio_delay, int flags) -{ -#ifdef DEBUG - printf("%s::%s rel_seek_secs=%f\n", FILENAME, __FUNCTION__, rel_seek_secs); -#endif - - whileSeeking = 1; - getMKVMutex(FILENAME, __FUNCTION__, __LINE__); - - free_cached_dps(demuxer); - - if (!(flags & SEEK_FACTOR)) /* time in secs */ - { -#ifdef DEBUG - printf("%s::%s TimeInSecs\n", FILENAME, __FUNCTION__); -#endif - - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - stream_t *s = demuxer->stream; - int64_t target_timecode = 0, diff, min_diff = 0xFFFFFFFFFFFFFFFLL; - int i; - - if (!(flags & SEEK_ABSOLUTE)) /* relative seek */ - target_timecode = (int64_t)(mkv_d->last_pts * 1000.0); - - target_timecode += (int64_t)(rel_seek_secs * 1000.0); - - if (target_timecode < 0) - target_timecode = 0; - - if (mkv_d->indexes == NULL) /* no index was found */ - { - uint64_t target_filepos, cluster_pos, max_pos; - - target_filepos = (uint64_t)(target_timecode * mkv_d->last_filepos - / (mkv_d->last_pts * 1000.0)); - - max_pos = mkv_d->cluster_positions[mkv_d->num_cluster_pos - 1]; - if (target_filepos > max_pos) - { - if ((off_t) max_pos > stream_tell(s)) - stream_seek(s, max_pos); - else - stream_seek(s, stream_tell(s) + mkv_d->cluster_size); - - /* parse all the clusters upto target_filepos */ - while (!s->eof && stream_tell(s) < (off_t) target_filepos) - { - switch (ebml_read_id(s, &i)) - { - case MATROSKA_ID_CLUSTER: - add_cluster_position(mkv_d, (uint64_t) stream_tell(s) - i); - break; - - case MATROSKA_ID_CUES: - //demux_mkv_read_cues (demuxer); - break; - } - ebml_read_skip(s, NULL); - } - - if (s->eof) - stream_reset(s); - } - - if (mkv_d->indexes == NULL) - { - cluster_pos = mkv_d->cluster_positions[0]; - /* Let's find the nearest cluster */ - for (i = 0; i < mkv_d->num_cluster_pos; i++) - { - diff = mkv_d->cluster_positions[i] - target_filepos; - - if (rel_seek_secs < 0 && diff < 0 && -diff < min_diff) - { - cluster_pos = mkv_d->cluster_positions[i]; - min_diff = -diff; - } - else if (rel_seek_secs > 0 && (diff < 0 ? -1 * diff : diff) < min_diff) - { - cluster_pos = mkv_d->cluster_positions[i]; - min_diff = diff < 0 ? -1 * diff : diff; - } - } - mkv_d->cluster_size = mkv_d->blockgroup_size = 0; - stream_seek(s, cluster_pos); - } - } - else - { - mkv_index_t *index = NULL; - int seek_id = (demuxer->video->id < 0) ? demuxer->audio->id : demuxer->video->id; - - /* let's find the entry in the indexes with the smallest */ - /* difference to the wanted timecode. */ - for (i = 0; i < mkv_d->num_indexes; i++) - { - if (mkv_d->indexes[i].tnum == seek_id) - { - diff = target_timecode + mkv_d->first_tc - - (int64_t) mkv_d->indexes[i].timecode * mkv_d->tc_scale / 1000000.0; - - if ((flags & SEEK_ABSOLUTE || target_timecode <= mkv_d->last_pts * 1000)) - { - // Absolute seek or seek backward: find the last index - // position before target time - if (diff < 0 || diff >= min_diff) - continue; - } - else - { - // Relative seek forward: find the first index position - // after target time. If no such index exists, find last - // position between current position and target time. - if (diff <= 0) - { - if (min_diff <= 0 && diff <= min_diff) - continue; - } - else if (diff >= FFMIN(target_timecode - mkv_d->last_pts, min_diff)) - continue; - } - min_diff = diff; - index = mkv_d->indexes + i; - } - } - - if (index) /* We've found an entry. */ - { - mkv_d->cluster_size = mkv_d->blockgroup_size = 0; - stream_seek(s, index->filepos); - } - } - - if (demuxer->video->id >= 0) - mkv_d->v_skip_to_keyframe = 1; - if (rel_seek_secs > 0.0) - mkv_d->skip_to_timecode = target_timecode; - mkv_d->a_skip_to_keyframe = 1; - - demux_mkv_fill_buffer(demuxer, NULL); - } - else if ((demuxer->movi_end <= 0) || !(flags & SEEK_ABSOLUTE)) - { -#ifdef DEBUG - printf("[mkv] seek unsupported flags\n"); -#endif - } - else - { -#ifdef DEBUG - printf("%s::%s ???\n", FILENAME, __FUNCTION__); -#endif - - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - stream_t *s = demuxer->stream; - uint64_t target_filepos; - mkv_index_t *index = NULL; - int i; - - if (mkv_d->indexes == NULL) /* no index was found */ - { - /* I'm lazy... */ -#ifdef DEBUG - printf("[mkv] seek unsupported flags\n"); -#endif - - releaseMKVMutex(FILENAME, __FUNCTION__, __LINE__); - whileSeeking = 0; - return; - } - - target_filepos = (uint64_t)(demuxer->movi_end * rel_seek_secs); - for (i = 0; i < mkv_d->num_indexes; i++) - { - if (mkv_d->indexes[i].tnum == demuxer->video->id) - { - if ((index == NULL) || - ((mkv_d->indexes[i].filepos >= target_filepos) && - ((index->filepos < target_filepos) || - (mkv_d->indexes[i].filepos < index->filepos)))) - index = &mkv_d->indexes[i]; - } - - if (!index) - { - releaseMKVMutex(FILENAME, __FUNCTION__, __LINE__); - whileSeeking = 0; - return; - } - } - - mkv_d->cluster_size = mkv_d->blockgroup_size = 0; - stream_seek(s, index->filepos); - - if (demuxer->video->id >= 0) - mkv_d->v_skip_to_keyframe = 1; - - mkv_d->skip_to_timecode = index->timecode; - mkv_d->a_skip_to_keyframe = 1; - - demux_mkv_fill_buffer(demuxer, NULL); - } - whileSeeking = 0; - - releaseMKVMutex(FILENAME, __FUNCTION__, __LINE__); -} - -////////////////////////////////////////////////////////////////7 -////////////////////////////////////////////////////////////////7 - -#include "common.h" -#include "container.h" -#include "manager.h" - - - -static demuxer_t *demuxer = NULL; -static demux_stream_t *ds = NULL; // dvd subtitle buffer/demuxer -//static stream_t *s = NULL; -static sh_audio_t *sh_audio = NULL; -static sh_video_t *sh_video = NULL; -static pthread_t PlayThread; -static int hasPlayThreadStarted = 0; - -static uint8_t *aacbuf; -static int aac; -int MkvInit(Context_t *context, char *filename) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - getMKVMutex(FILENAME, __FUNCTION__, __LINE__); - - int ret = 0; - int i = 0; - - demuxer = (demuxer_t *)malloc(sizeof(demuxer_t)); - memset(demuxer, 0, sizeof(demuxer_t)); - - demuxer->audio = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(demuxer->audio, 0, sizeof(demux_stream_t)); - - demuxer->video = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(demuxer->video, 0, sizeof(demux_stream_t)); - - demuxer->sub = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(demuxer->sub, 0, sizeof(demux_stream_t)); - - ds = (demux_stream_t *)malloc(sizeof(demux_stream_t)); - memset(ds, 0, sizeof(demux_stream_t)); - - demuxer->stream = (stream_t *)malloc(sizeof(stream_t)); - memset(demuxer->stream, 0, sizeof(stream_t)); - - - demuxer->stream->fd = context->playback->fd; - - read(demuxer->stream->fd, demuxer->stream->buffer, 2048); //this much ?? - -#ifdef DEBUG - dprintf("fd=%d\n", demuxer->stream->fd); -#endif - - //demuxer->video_play = 0; - demuxer->stream->start_pos = 0; - - if (context->playback->isFile) - { - demuxer->stream->type = STREAMTYPE_FILE; - long pos = lseek(demuxer->stream->fd, 0L, SEEK_CUR); - demuxer->stream->end_pos = lseek(demuxer->stream->fd, 0L, SEEK_END); - lseek(demuxer->stream->fd, pos, SEEK_SET); - } - else - { - demuxer->stream->type = STREAMTYPE_STREAM; - demuxer->stream->end_pos = 0; - } - - demuxer->stream->flags = 6; - demuxer->stream->sector_size = 0; - demuxer->stream->buf_pos = 0; - demuxer->stream->buf_len = 2048; - demuxer->stream->pos = 2048; - demuxer->stream->start_pos = 0; - demuxer->stream->eof = 0; - demuxer->stream->cache_pid = 0; - - ret = demux_mkv_open(demuxer, demuxer->stream); - - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - - if (demuxer->video && demuxer->video->sh) - { - sh_video = demuxer->video->sh; - -#ifdef DEBUG - printf("\nVIDEO 0x%02x\n", sh_video->format); -#endif - } - if (demuxer->audio && demuxer->audio->sh) - { - sh_audio = demuxer->audio->sh; - -#ifdef DEBUG - printf("\nAUDIO 0x%02x\n", sh_audio->format); -#endif - } - for (i = 0; i < mkv_d->num_tracks; i++) - { - if (mkv_d->tracks[i] != NULL && mkv_d->tracks[i]->type == MATROSKA_TRACK_AUDIO) - { - - if (sh_audio->format == 0x4134504d) // A_AAC -> AAC_HEADER - { - unsigned int Profile = 1; - unsigned int SampleIndex; - SampleIndex = aac_get_sample_rate_index(mkv_d->tracks[i]->a_sfreq); - aacbuf = malloc(8); - aacbuf[0] = 0xFF; - aacbuf[1] = 0xF1; - aacbuf[2] = ((Profile & 0x03) << 6) | (SampleIndex << 2) | ((mkv_d->tracks[i]->a_channels >> 2) & 0x01); - aacbuf[3] = (mkv_d->tracks[i]->a_channels & 0x03) << 6; - aacbuf[4] = 0x00; - aacbuf[5] = 0x1F; - aacbuf[6] = 0xFC; - printf("AAC_HEADER -> "); - Hexdump(aacbuf, 7); - } - Track_t Audio = - { - mkv_d->tracks[i]->language, - mkv_d->tracks[i]->codec_id, - i, - }; - context->manager->audio->Command(context, MANAGER_ADD, &Audio); - } - else if (mkv_d->tracks[i] != NULL && mkv_d->tracks[i]->type == MATROSKA_TRACK_VIDEO) - { - //ob das richtig ist?? - // if(sh_video->format == 0x34363248 || sh_video->format == 0x34363268 || sh_video->format == 0x34363258 || sh_video->format == 0x34363278 - // || sh_video->format == 0x31435641 || sh_video->format == 0x63766164 || sh_video->format == 0x43564144 - // || sh_video->format == 0x10000005) - if (sh_video->format == 0x34363248) //x264 or h264 current->buffer[0] = 0 [1] = 0 [2] = 0 [3] = 1 - { - Track_t Video = - { - mkv_d->tracks[i]->language, - "V_MPEG2/H264", - i, - }; - context->manager->video->Command(context, MANAGER_ADD, &Video); - } - else if (sh_video->format == 0x31637661) // mkv_d->tracks[i]->codec_id hier gibt es filme die nicht richtig erkannt werden! über sh_video->format geht es..... - { - Track_t Video = - { - mkv_d->tracks[i]->language, - "V_MPEG4/ISO/AVC", - i, - }; - context->manager->video->Command(context, MANAGER_ADD, &Video); - } - else if (sh_video->format == 0x3267706d) - { - Track_t Video = - { - mkv_d->tracks[i]->language, - "V_MPEG2", - i, - }; - context->manager->video->Command(context, MANAGER_ADD, &Video); - } - else if (sh_video->format == 0x31435657) // VC-1 - { - Track_t Video = - { - mkv_d->tracks[i]->language, - "V_MS/VFW/FOURCC", - i, - }; - context->manager->video->Command(context, MANAGER_ADD, &Video); - } - else if (sh_video->format == 0x34504D46 || sh_video->format == 0x34706D66 || sh_video->format == 0x58564944 || sh_video->format == 0x78766964 - || sh_video->format == 0x31564944 || sh_video->format == 0x31766964 || sh_video->format == 0x5334504D || sh_video->format == 0x7334706D - || sh_video->format == 0x3253344D || sh_video->format == 0x3273346D || sh_video->format == 0x64697678 || sh_video->format == 0x44495658 - || sh_video->format == 0x44697658 || sh_video->format == 0x58495658 || sh_video->format == 0x30355844 || sh_video->format == 0x30357864 - || sh_video->format == 0x305A4C42 || sh_video->format == 0x7634706D || sh_video->format == 0x5634504D || sh_video->format == 0x34504D55 - || sh_video->format == 0x34504D52 || sh_video->format == 0x32564933 || sh_video->format == 0x32766933 || sh_video->format == 0x4D475844 - || sh_video->format == 0x47444553 || sh_video->format == 0x34504D53 || sh_video->format == 0x34706D73 || sh_video->format == 0x4D444956 - || sh_video->format == 0x10000004 || sh_video->format == 0x6363346D || sh_video->format == 0x4343344D || sh_video->format == 0x34786468 - || sh_video->format == 0x34584448 || sh_video->format == 0x57465646 || sh_video->format == 0x77667666 || sh_video->format == 0x53444646 - || sh_video->format == 0x444F4344 || sh_video->format == 0x4D58564D || sh_video->format == 0x41344D45 || sh_video->format == 0x56344D50 - || sh_video->format == 0x3354344D || sh_video->format == 0x324B4D44 || sh_video->format == 0x49474944 || sh_video->format == 0x434D4E49) //DIVX or XVID - { - Track_t Video = - { - mkv_d->tracks[i]->language, - "V_MKV/XVID", - i, - }; - context->manager->video->Command(context, MANAGER_ADD, &Video); - } - else - { - Track_t Video = - { - mkv_d->tracks[i]->language, - mkv_d->tracks[i]->codec_id, - i, - }; - context->manager->video->Command(context, MANAGER_ADD, &Video); - } - } - else if (mkv_d->tracks[i] != NULL && mkv_d->tracks[i]->type == MATROSKA_TRACK_SUBTITLE) - { - Track_t Subtitle = - { - mkv_d->tracks[i]->language, - mkv_d->tracks[i]->codec_id, - i, - }; - context->manager->subtitle->Command(context, MANAGER_ADD, &Subtitle); - } - } - - //No Subtitle selected as default - demuxer->sub->id = -1; - - /* - //select fist subtitle track as default: - int SubTrackID = 0; - context->manager->subtitle->Command(context, MANAGER_GET, &SubTrackID); - if (SubTrackID > 0) - demuxer->sub->id = mkv_d->tracks[SubTrackID]->tnum; - */ - - releaseMKVMutex(FILENAME, __FUNCTION__, __LINE__); - - return ret; -} - -#define INVALID_PTS_VALUE 0x200000000ull -void MkvGenerateParcel(Context_t *context, const demuxer_t *demuxer) -{ - //printf("%s::%s ->\n", FILENAME, __FUNCTION__); - - const demux_stream_t *video = demuxer->video; - const demux_stream_t *audio = demuxer->audio; - const demux_stream_t *sub = demuxer->sub; - - //printf("1\n"); - - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - mkv_track_t *track; - unsigned long long int Pts = 0; - - if (sub != NULL && sub->first != NULL) - { - //printf("SUBTITLE"); - - demux_packet_t *current = sub->first; - while (current != NULL) - { - Pts = (current->pts * 90000); - float Duration = current->endpts - current->pts; - - context->output->subtitle->Write(context, current->buffer, current->len, Pts, NULL, 0, Duration, "subtitle"); - //printf("%s::%s %s [%d]\n\tpts:%8f endpts:%8f\n",FILENAME, __FUNCTION__, current->buffer, strlen(current->buffer),current->pts, current->endpts); - - current = current->next; - Pts = INVALID_PTS_VALUE; - } - } - - if (audio->first != NULL) - { - demux_packet_t *current = audio->first; - if (!(current->flags & 0x10)) //current frame isn't a keyframe - { - //printf("\tNORMALFRAME, "); - Pts = INVALID_PTS_VALUE; - } - else - { - //printf("\tKEYFRAME, "); - Pts = (current->pts * 90000); - } - - while (current != NULL) - { - if (sh_audio->format == 0x4134504d) - { - //printf("aac write\n"); - context->output->audio->Write(context, current->buffer, current->len, Pts, aacbuf, 7, 0, "audio"); - } - else - context->output->audio->Write(context, current->buffer, current->len, Pts, NULL, 0, 0, "audio"); - - current = current->next; - Pts = INVALID_PTS_VALUE; - } - } - - if (video->first != NULL) - { - demux_packet_t *current = video->first; - if (!(current->flags & 0x10)) //current frame isn't a keyframe - { - //printf("\tNORMALFRAME, "); - Pts = INVALID_PTS_VALUE; - } - else - { - //printf("\tKEYFRAME, "); - Pts = (current->pts * 90000); - } - - int num = video->id; - int i; - - track = NULL; - - for (i = 0; i < mkv_d->num_tracks; i++) - { - if (mkv_d->tracks[i] && mkv_d->tracks[i]->tnum == num) - { - track = mkv_d->tracks[i]; - break; - } - } - - if (track) - { - while (current != NULL) - { - context->output->video->Write(context, current->buffer, current->len, Pts, track->private_data, track->private_size, track->v_frate, "video"); - - current = current->next; - Pts = INVALID_PTS_VALUE; - } - } - } -} - -static void MkvThread(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - while (context->playback->isCreationPhase) - { -#ifdef DEBUG -// printf("%s::%s Thread waiting for end of init phase...\n", FILENAME, __FUNCTION__); -#endif - } - -#ifdef DEBUG - printf("%s::%s Running!\n", FILENAME, __FUNCTION__); -#endif - - while (context && context->playback && context->playback->isPlaying) - { - - //IF MOVIE IS PAUSED, WAIT - if (context->playback->isPaused) - { -#ifdef DEBUG - printf("%s::%s paused\n", FILENAME, __FUNCTION__); -#endif - - usleep(100000); - continue; - } - - if (context->playback->isSeeking) - { -#ifdef DEBUG - printf("%s::%s seeking\n", FILENAME, __FUNCTION__); -#endif - - usleep(100000); - continue; - } - - getMKVMutex(FILENAME, __FUNCTION__, __LINE__); - - if (!demux_mkv_fill_buffer(demuxer, ds)) - { -#ifdef DEBUG - printf("%s::%s demux_mkv_fill_buffer failed!\n", FILENAME, __FUNCTION__); -#endif - - if (context->playback->isSeeking || whileSeeking) - { - releaseMKVMutex(FILENAME, __FUNCTION__, __LINE__); - continue; - } - else - { - releaseMKVMutex(FILENAME, __FUNCTION__, __LINE__); - break; - } - } - else - { - MkvGenerateParcel(context, demuxer); - - if (demuxer->sub != NULL && demuxer->sub->first != NULL) - { - ds_free_packs(demuxer->sub); - } - - if (demuxer->audio != NULL && demuxer->audio->first != NULL) - { - ds_free_packs(demuxer->audio); - } - - if (demuxer->video != NULL && demuxer->video->first != NULL) - { - ds_free_packs(demuxer->video); - } - - releaseMKVMutex(FILENAME, __FUNCTION__, __LINE__); - } - - } - - hasPlayThreadStarted = 0; // prevent locking situation when calling PLAYBACK_TERM - - context->playback->Command(context, PLAYBACK_TERM, NULL); - -#ifdef DEBUG - printf("%s::%s terminating\n", FILENAME, __FUNCTION__); -#endif -} - - -static int MkvPlay(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int error; - int ret = 0; - pthread_attr_t attr; - - if (context && context->playback && context->playback->isPlaying) - { -#ifdef DEBUG - printf("%s::%s is Playing\n", FILENAME, __FUNCTION__); -#endif - } - else - { -#ifdef DEBUG - printf("%s::%s is NOT Playing\n", FILENAME, __FUNCTION__); -#endif - } - - if (hasPlayThreadStarted == 0) - { - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - - if ((error = pthread_create(&PlayThread, &attr, (void *)&MkvThread, context)) != 0) - { -#ifdef DEBUG - printf("%s::%s Error creating thread, error:%d:%s\n", FILENAME, __FUNCTION__, error, strerror(error)); -#endif - - hasPlayThreadStarted = 0; - ret = -1; - } - else - { -#ifdef DEBUG - printf("%s::%s Created thread\n", FILENAME, __FUNCTION__); -#endif - hasPlayThreadStarted = 1; - } - } - else - { -#ifdef DEBUG - printf("%s::%s A thread already exists!\n", FILENAME, __FUNCTION__); -#endif - - ret = -1; - } - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -static void -demux_close_mkv(demuxer_t *demuxer) -{ - int i; - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - - if (mkv_d) - { - free_cached_dps(demuxer); - - if (mkv_d->tracks) - { - for (i = 0; i < mkv_d->num_tracks; i++) - { - demux_mkv_free_trackentry(mkv_d->tracks[i]); - } - free(mkv_d->tracks); - mkv_d->tracks = NULL; - } - - free(mkv_d->indexes); - mkv_d->indexes = NULL; - - free(mkv_d->cluster_positions); - mkv_d->cluster_positions = NULL; - - free(mkv_d->parsed_cues); - mkv_d->parsed_cues = NULL; - - free(mkv_d->parsed_seekhead); - mkv_d->parsed_seekhead = NULL; - - free(mkv_d); - mkv_d = NULL; - } -} - -static int MkvStop(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int i; - int ret = 0; - int wait_time = 20; - - while ((hasPlayThreadStarted != 0) && (--wait_time) > 0) - { -#ifdef DEBUG - printf("%s::%s Waiting for MKV thread to terminate itself, will try another %d times\n", FILENAME, __FUNCTION__, wait_time); -#endif - - usleep(100000); - } - - if (wait_time == 0) - { -#ifdef DEBUG - printf("%s::%s Timeout waiting for MKV thread!\n", FILENAME, __FUNCTION__); -#endif - - ret = -1; - } - else - { - - getMKVMutex(FILENAME, __FUNCTION__, __LINE__); - - if (demuxer != NULL) - { - demux_close_mkv(demuxer); - - free(demuxer->stream); - demuxer->stream = NULL; - - free(demuxer->sub); - demuxer->sub = NULL; - - free(demuxer->video); - demuxer->video = NULL; - - free(demuxer->audio); - demuxer->audio = NULL; - - for (i = 0; i < MAX_A_STREAMS; i++) - { - free(demuxer->a_streams[i]); - demuxer->a_streams[i] = NULL; - } - - for (i = 0; i < MAX_V_STREAMS; i++) - { - free(demuxer->v_streams[i]); - demuxer->v_streams[i] = NULL; - } - - for (i = 0; i < MAX_S_STREAMS; i++) - { - free(demuxer->s_streams[i]); - demuxer->s_streams[i] = NULL; - } - - free(demuxer); - demuxer = NULL; - } - - free(ds); - ds = NULL; - - releaseMKVMutex(FILENAME, __FUNCTION__, __LINE__); - } - - return ret; -} - -static int MkvGetLength(demuxer_t *demuxer, double *length) -{ - int ret = 0; - - if (demuxer->priv) - { - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - - if (mkv_d->duration == 0) - ret = -1; - else - *((double *)length) = (double)mkv_d->duration; - } - else - ret = -1; - - return ret; -} - -static int MkvSwitchAudio(demuxer_t *demuxer, int *arg) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - if (demuxer && demuxer->priv && demuxer->audio) - { - - getMKVMutex(FILENAME, __FUNCTION__, __LINE__); - - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - - sh_audio_t *sh = demuxer->a_streams[demuxer->audio->id]; - int aid = *(int *)arg; - /*if (aid < 0) - aid = (sh->aid + 1) % mkv_d->last_aid; - if (aid != sh->aid) */ - { - - mkv_track_t *track = mkv_d->tracks[aid];//demux_mkv_find_track_by_num (mkv_d, aid, MATROSKA_TRACK_AUDIO); - if (track) - { -#ifdef DEBUG - printf("%s::%s track = %s\n", FILENAME, __FUNCTION__, track->codec_id); -#endif - - demuxer->audio->id = track->tnum; - sh = demuxer->a_streams[demuxer->audio->id]; - ds_free_packs(demuxer->audio); - } - else - { -#ifdef DEBUG - printf("%s::%s track == NULL\n", FILENAME, __FUNCTION__); -#endif - } - - } - - releaseMKVMutex(FILENAME, __FUNCTION__, __LINE__); - - // *(int*)arg = sh->aid; - } //else - // *(int*)arg = -2; - return 0; -} - -static int MkvSwitchSubtitle(demuxer_t *demuxer, int *arg) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - if (demuxer && demuxer->priv) - { - - getMKVMutex(FILENAME, __FUNCTION__, __LINE__); - - mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; - - //select fist subtitle track as default: - int SubTrackID = *(int *)arg; - //context->manager->subtitle->Command(context, MANAGER_GET, &SubTrackID); - if (SubTrackID >= 0) - { - if (mkv_d->tracks[SubTrackID]) - demuxer->sub->id = mkv_d->tracks[SubTrackID]->tnum; - else - demuxer->sub->id = -1; - } - else - demuxer->sub->id = -1; - - releaseMKVMutex(FILENAME, __FUNCTION__, __LINE__); - - } - - return 0; -} - -static int Command(void *_context, ContainerCmd_t command, void *argument) -{ - Context_t *context = (Context_t *) _context; -#ifdef DEBUG - printf("%s::%s Command %d\n", FILENAME, __FUNCTION__, command); -#endif - - int ret = 0; - - switch (command) - { - case CONTAINER_INIT: - { - char *FILENAME = (char *)argument; - MkvInit(context, FILENAME); - break; - } - case CONTAINER_PLAY: - { - if ((demuxer->video && demuxer->video->sh) || (demuxer->audio && demuxer->audio->sh)) // we need audio or video for playback - { - ret = MkvPlay(context); - } - else - { -#ifdef DEBUG - printf("%s::%s No audio and video tracks!\n", FILENAME, __FUNCTION__); -#endif - - ret = -1; - } - break; - } - case CONTAINER_STOP: - { - MkvStop(context); - break; - } - case CONTAINER_SEEK: - { - demux_mkv_seek(demuxer, (float) * ((float *)argument), 0.0, 0); - break; - } - case CONTAINER_LENGTH: - { - double length = 0; - if (demuxer != NULL && MkvGetLength(demuxer, &length) != 0) - *((double *)argument) = (double)0; - else - *((double *)argument) = (double)length; - break; - } - case CONTAINER_SWITCH_AUDIO: - { - if (demuxer) - MkvSwitchAudio(demuxer, (int *) argument); - break; - } - case CONTAINER_SWITCH_SUBTITLE: - { -#ifdef DEBUG - printf("%s::%s CONTAINER_SWITCH_SUBTITLE id=%d\n", FILENAME, __FUNCTION__, *((int *) argument)); -#endif - - if (demuxer) - MkvSwitchSubtitle(demuxer, (int *) argument); - break; - } - default: -#ifdef DEBUG - printf("%s::%s ContainerCmd %d not supported!\n", FILENAME, __FUNCTION__, command); -#endif - - break; - } - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -static char *MkvCapabilities[] = { "mkv", NULL }; - -Container_t MkvContainer = -{ - "MKV", - &Command, - MkvCapabilities, - -}; diff --git a/libeplayer2/container/mkv.h b/libeplayer2/container/mkv.h deleted file mode 100644 index 8e199a7..0000000 --- a/libeplayer2/container/mkv.h +++ /dev/null @@ -1,265 +0,0 @@ -#ifndef _DEMUX_MKV_H -#define _DEMUX_MKV_H - -#include - -#include "utils.h" -#include "stream.h" -#include "demuxer.h" - -#ifdef __cplusplus -extern "C" { -#endif - -int sub_utf8; - -/* EBML version supported */ -#define EBML_VERSION 1 - -/* - * EBML element IDs. max. 32-bit. - */ - -/* top-level master-IDs */ -#define EBML_ID_HEADER 0x1A45DFA3 - -/* IDs in the HEADER master */ -#define EBML_ID_EBMLVERSION 0x4286 -#define EBML_ID_EBMLREADVERSION 0x42F7 -#define EBML_ID_EBMLMAXIDLENGTH 0x42F2 -#define EBML_ID_EBMLMAXSIZELENGTH 0x42F3 -#define EBML_ID_DOCTYPE 0x4282 -#define EBML_ID_DOCTYPEVERSION 0x4287 -#define EBML_ID_DOCTYPEREADVERSION 0x4285 - -/* general EBML types */ -#define EBML_ID_VOID 0xEC - -/* ID returned in error cases */ -#define EBML_ID_INVALID 0xFFFFFFFF - - -/* - * Matroska element IDs. max. 32-bit. - */ - -/* toplevel segment */ -#define MATROSKA_ID_SEGMENT 0x18538067 - -/* matroska top-level master IDs */ -#define MATROSKA_ID_INFO 0x1549A966 -#define MATROSKA_ID_TRACKS 0x1654AE6B -#define MATROSKA_ID_CUES 0x1C53BB6B -#define MATROSKA_ID_TAGS 0x1254C367 -#define MATROSKA_ID_SEEKHEAD 0x114D9B74 -#define MATROSKA_ID_ATTACHMENTS 0x1941A469 -#define MATROSKA_ID_CHAPTERS 0x1043A770 -#define MATROSKA_ID_CLUSTER 0x1F43B675 - -/* IDs in the info master */ -#define MATROSKA_ID_TIMECODESCALE 0x2AD7B1 -#define MATROSKA_ID_DURATION 0x4489 -#define MATROSKA_ID_WRITINGAPP 0x5741 -#define MATROSKA_ID_MUXINGAPP 0x4D80 -#define MATROSKA_ID_DATEUTC 0x4461 - -/* ID in the tracks master */ -#define MATROSKA_ID_TRACKENTRY 0xAE - -/* IDs in the trackentry master */ -#define MATROSKA_ID_TRACKNUMBER 0xD7 -#define MATROSKA_ID_TRACKUID 0x73C5 -#define MATROSKA_ID_TRACKTYPE 0x83 -#define MATROSKA_ID_TRACKAUDIO 0xE1 -#define MATROSKA_ID_TRACKVIDEO 0xE0 -#define MATROSKA_ID_CODECID 0x86 -#define MATROSKA_ID_CODECPRIVATE 0x63A2 -#define MATROSKA_ID_CODECNAME 0x258688 -#define MATROSKA_ID_CODECINFOURL 0x3B4040 -#define MATROSKA_ID_CODECDOWNLOADURL 0x26B240 -#define MATROSKA_ID_TRACKNAME 0x536E -#define MATROSKA_ID_TRACKLANGUAGE 0x22B59C -#define MATROSKA_ID_TRACKFLAGENABLED 0xB9 -#define MATROSKA_ID_TRACKFLAGDEFAULT 0x88 -#define MATROSKA_ID_TRACKFLAGLACING 0x9C -#define MATROSKA_ID_TRACKMINCACHE 0x6DE7 -#define MATROSKA_ID_TRACKMAXCACHE 0x6DF8 -#define MATROSKA_ID_TRACKDEFAULTDURATION 0x23E383 -#define MATROSKA_ID_TRACKENCODINGS 0x6D80 - -/* IDs in the trackaudio master */ -#define MATROSKA_ID_AUDIOSAMPLINGFREQ 0xB5 -#define MATROSKA_ID_AUDIOBITDEPTH 0x6264 -#define MATROSKA_ID_AUDIOCHANNELS 0x9F - -/* IDs in the trackvideo master */ -#define MATROSKA_ID_VIDEOFRAMERATE 0x2383E3 -#define MATROSKA_ID_VIDEODISPLAYWIDTH 0x54B0 -#define MATROSKA_ID_VIDEODISPLAYHEIGHT 0x54BA -#define MATROSKA_ID_VIDEOPIXELWIDTH 0xB0 -#define MATROSKA_ID_VIDEOPIXELHEIGHT 0xBA -#define MATROSKA_ID_VIDEOFLAGINTERLACED 0x9A -#define MATROSKA_ID_VIDEOSTEREOMODE 0x53B9 -#define MATROSKA_ID_VIDEODISPLAYUNIT 0x54B2 -#define MATROSKA_ID_VIDEOASPECTRATIO 0x54B3 -#define MATROSKA_ID_VIDEOCOLOURSPACE 0x2EB524 -#define MATROSKA_ID_VIDEOGAMMA 0x2FB523 - -/* IDs in the trackencodings master */ -#define MATROSKA_ID_CONTENTENCODING 0x6240 -#define MATROSKA_ID_CONTENTENCODINGORDER 0x5031 -#define MATROSKA_ID_CONTENTENCODINGSCOPE 0x5032 -#define MATROSKA_ID_CONTENTENCODINGTYPE 0x5033 -#define MATROSKA_ID_CONTENTCOMPRESSION 0x5034 -#define MATROSKA_ID_CONTENTCOMPALGO 0x4254 -#define MATROSKA_ID_CONTENTCOMPSETTINGS 0x4255 - -/* ID in the cues master */ -#define MATROSKA_ID_POINTENTRY 0xBB - -/* IDs in the pointentry master */ -#define MATROSKA_ID_CUETIME 0xB3 -#define MATROSKA_ID_CUETRACKPOSITION 0xB7 - -/* IDs in the cuetrackposition master */ -#define MATROSKA_ID_CUETRACK 0xF7 -#define MATROSKA_ID_CUECLUSTERPOSITION 0xF1 - -/* IDs in the seekhead master */ -#define MATROSKA_ID_SEEKENTRY 0x4DBB - -/* IDs in the seekpoint master */ -#define MATROSKA_ID_SEEKID 0x53AB -#define MATROSKA_ID_SEEKPOSITION 0x53AC - -/* IDs in the chapters master */ -#define MATROSKA_ID_EDITIONENTRY 0x45B9 -#define MATROSKA_ID_CHAPTERATOM 0xB6 -#define MATROSKA_ID_CHAPTERTIMESTART 0x91 -#define MATROSKA_ID_CHAPTERTIMEEND 0x92 -#define MATROSKA_ID_CHAPTERDISPLAY 0x80 -#define MATROSKA_ID_CHAPSTRING 0x85 - -/* IDs in the cluster master */ -#define MATROSKA_ID_CLUSTERTIMECODE 0xE7 -#define MATROSKA_ID_BLOCKGROUP 0xA0 - -/* IDs in the blockgroup master */ -#define MATROSKA_ID_BLOCKDURATION 0x9B -#define MATROSKA_ID_BLOCK 0xA1 -#define MATROSKA_ID_SIMPLEBLOCK 0xA3 -#define MATROSKA_ID_REFERENCEBLOCK 0xFB - -/* IDs in the attachments master */ -#define MATROSKA_ID_ATTACHEDFILE 0x61A7 -#define MATROSKA_ID_FILENAME 0x466E -#define MATROSKA_ID_FILEMIMETYPE 0x4660 -#define MATROSKA_ID_FILEDATA 0x465C -#define MATROSKA_ID_FILEUID 0x46AE - -/* matroska track types */ -#define MATROSKA_TRACK_VIDEO 0x01 /* rectangle-shaped pictures aka video */ -#define MATROSKA_TRACK_AUDIO 0x02 /* anything you can hear */ -#define MATROSKA_TRACK_COMPLEX 0x03 /* audio+video in same track used by DV */ -#define MATROSKA_TRACK_LOGO 0x10 /* overlay-pictures displayed over video*/ -#define MATROSKA_TRACK_SUBTITLE 0x11 /* text-subtitles */ -#define MATROSKA_TRACK_CONTROL 0x20 /* control-codes for menu or other stuff*/ - -/* matroska subtitle types */ -#define MATROSKA_SUBTYPE_UNKNOWN 0 -#define MATROSKA_SUBTYPE_TEXT 1 -#define MATROSKA_SUBTYPE_SSA 2 -#define MATROSKA_SUBTYPE_VOBSUB 3 - -#ifndef UINT64_MAX -#define UINT64_MAX 18446744073709551615ULL -#endif - -#ifndef INT64_MAX -#define INT64_MAX 9223372036854775807LL -#endif - -#define EBML_UINT_INVALID UINT64_MAX -#define EBML_INT_INVALID INT64_MAX -#define EBML_FLOAT_INVALID -1000000000.0 - -#define MKV_A_AAC_2MAIN "A_AAC/MPEG2/MAIN" -#define MKV_A_AAC_2LC "A_AAC/MPEG2/LC" -#define MKV_A_AAC_2SBR "A_AAC/MPEG2/LC/SBR" -#define MKV_A_AAC_2SSR "A_AAC/MPEG2/SSR" -#define MKV_A_AAC_4MAIN "A_AAC/MPEG4/MAIN" -#define MKV_A_AAC_4LC "A_AAC/MPEG4/LC" -#define MKV_A_AAC_4SBR "A_AAC/MPEG4/LC/SBR" -#define MKV_A_AAC_4SSR "A_AAC/MPEG4/SSR" -#define MKV_A_AAC_4LTP "A_AAC/MPEG4/LTP" -#define MKV_A_AAC "A_AAC" -#define MKV_A_AC3 "A_AC3" -#define MKV_A_EAC3 "A_EAC3" -#define MKV_A_DTS "A_DTS" -#define MKV_A_MP2 "A_MPEG/L2" -#define MKV_A_MP3 "A_MPEG/L3" -#define MKV_A_PCM "A_PCM/INT/LIT" -#define MKV_A_PCM_BE "A_PCM/INT/BIG" -#define MKV_A_VORBIS "A_VORBIS" -#define MKV_A_ACM "A_MS/ACM" -#define MKV_A_REAL28 "A_REAL/28_8" -#define MKV_A_REALATRC "A_REAL/ATRC" -#define MKV_A_REALCOOK "A_REAL/COOK" -#define MKV_A_REALDNET "A_REAL/DNET" -#define MKV_A_REALSIPR "A_REAL/SIPR" -#define MKV_A_QDMC "A_QUICKTIME/QDMC" -#define MKV_A_QDMC2 "A_QUICKTIME/QDM2" -#define MKV_A_FLAC "A_FLAC" -#define MKV_A_WMA "A_WMA" - -#define MKV_V_MSCOMP "V_MS/VFW/FOURCC" -#define MKV_V_REALV10 "V_REAL/RV10" -#define MKV_V_REALV20 "V_REAL/RV20" -#define MKV_V_REALV30 "V_REAL/RV30" -#define MKV_V_REALV40 "V_REAL/RV40" -#define MKV_V_SORENSONV1 "V_SORENSON/V1" -#define MKV_V_SORENSONV2 "V_SORENSON/V2" -#define MKV_V_SORENSONV3 "V_SORENSON/V3" -#define MKV_V_CINEPAK "V_CINEPAK" -#define MKV_V_QUICKTIME "V_QUICKTIME" -#define MKV_V_MPEG1 "V_MPEG1" -#define MKV_V_MPEG2 "V_MPEG2" -#define MKV_V_MPEG4_SP "V_MPEG4/ISO/SP" -#define MKV_V_MPEG4_ASP "V_MPEG4/ISO/ASP" -#define MKV_V_MPEG4_AP "V_MPEG4/ISO/AP" -#define MKV_V_MPEG4_AVC "V_MPEG4/ISO/AVC" -#define MKV_V_THEORA "V_THEORA" - -#define MKV_S_TEXTASCII "S_TEXT/ASCII" -#define MKV_S_TEXTUTF8 "S_TEXT/UTF8" -#define MKV_S_TEXTSSA "S_TEXT/SSA" -#define MKV_S_TEXTASS "S_TEXT/ASS" -#define MKV_S_VOBSUB "S_VOBSUB" -#define MKV_S_SSA "S_SSA" // Deprecated -#define MKV_S_ASS "S_ASS" // Deprecated - -int subsize; -float subpts; -float subendpts; -int sub_id; -int have_mkv_subs; -int audio_id; - -void play_mkv(char *File); -uint32_t ebml_read_id(stream_t *s, int *length); -uint64_t ebml_read_vlen_uint(uint8_t *buffer, int *length); -int64_t ebml_read_vlen_int(uint8_t *buffer, int *length); -uint64_t ebml_read_length(stream_t *s, int *length); -uint64_t ebml_read_uint(stream_t *s, uint64_t *length); -int64_t ebml_read_int(stream_t *s, uint64_t *length); -long double ebml_read_float(stream_t *s, uint64_t *length); -char *ebml_read_ascii(stream_t *s, uint64_t *length); -char *ebml_read_utf8(stream_t *s, uint64_t *length); -int ebml_read_skip(stream_t *s, uint64_t *length); -uint32_t ebml_read_master(stream_t *s, uint64_t *length); -char *ebml_read_header(stream_t *s, int *version); -bool mkv_CheckKey(long int *sec); -unsigned long long eplayer_mkv_get_pts(); -bool mkv_isEOF(); - -#endif /* DEMUX_MPG_H */ diff --git a/libeplayer2/container/mp3_hdr.c b/libeplayer2/container/mp3_hdr.c deleted file mode 100644 index 9ecde28..0000000 --- a/libeplayer2/container/mp3_hdr.c +++ /dev/null @@ -1,158 +0,0 @@ -#include - -//#include "../config.h" - -int mp3_hdr_debug = 0; -#define mp3_hdr_printf(x...) do { if (mp3_hdr_debug)printf(x); } while (0) - -//----------------------- mp3 audio frame header parser ----------------------- - -static int tabsel_123[2][3][16] = -{ - { {0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 0}, - {0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 0}, - {0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 0} - }, - - { {0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 0}, - {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 0}, - {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 0} - } -}; - -static long freqs[9] = { 44100, 48000, 32000, // MPEG 1.0 - 22050, 24000, 16000, // MPEG 2.0 - 11025, 12000, 8000 - }; // MPEG 2.5 - -int mp_mp3_get_lsf(unsigned char *hbuf) -{ - unsigned long newhead = - hbuf[0] << 24 | - hbuf[1] << 16 | - hbuf[2] << 8 | - hbuf[3]; - if (newhead & ((long)1 << 20)) - { - return (newhead & ((long)1 << 19)) ? 0x0 : 0x1; - } - return 1; -} - -/* - * return frame size or -1 (bad frame) - */ -int mp_get_mp3_header(unsigned char *hbuf, int *chans, int *srate, int *spf, int *mpa_layer, int *br) -{ - int stereo, ssize, lsf, framesize, padding, bitrate_index, sampling_frequency, divisor; - int bitrate; - int layer, mult[3] = { 12000, 144000, 144000 }; - unsigned long newhead = - hbuf[0] << 24 | - hbuf[1] << 16 | - hbuf[2] << 8 | - hbuf[3]; - - mp3_hdr_printf("head=0x%08X\n", newhead); - -#if 1 - // head_check: - if ((newhead & 0xffe00000) != 0xffe00000) - { - mp3_hdr_printf("head_check failed\n"); - return -1; - } -#endif - - layer = 4 - ((newhead >> 17) & 3); - if (layer == 4) - { - mp3_hdr_printf("not layer-1/2/3\n"); - return -1; - } - - sampling_frequency = ((newhead >> 10) & 0x3); // valid: 0..2 - if (sampling_frequency == 3) - { - mp3_hdr_printf("invalid sampling_frequency\n"); - return -1; - } - - if (newhead & ((long)1 << 20)) - { - // MPEG 1.0 (lsf==0) or MPEG 2.0 (lsf==1) - lsf = (newhead & ((long)1 << 19)) ? 0x0 : 0x1; - sampling_frequency += (lsf * 3); - } - else - { - // MPEG 2.5 - lsf = 1; - sampling_frequency += 6; - } - -// crc = ((newhead>>16)&0x1)^0x1; - bitrate_index = ((newhead >> 12) & 0xf); // valid: 1..14 - padding = ((newhead >> 9) & 0x1); -// fr->extension = ((newhead>>8)&0x1); -// fr->mode = ((newhead>>6)&0x3); -// fr->mode_ext = ((newhead>>4)&0x3); -// fr->copyright = ((newhead>>3)&0x1); -// fr->original = ((newhead>>2)&0x1); -// fr->emphasis = newhead & 0x3; - - stereo = ((((newhead >> 6) & 0x3)) == 3) ? 1 : 2; - -// !checked later through tabsel_123[]! -// if(!bitrate_index || bitrate_index==15){ -// mp3_hdr_printf("Free format not supported.\n"); -// return -1; -// } - - if (lsf) - ssize = (stereo == 1) ? 9 : 17; - else - ssize = (stereo == 1) ? 17 : 32; - if (!((newhead >> 16) & 0x1)) ssize += 2; // CRC - - bitrate = tabsel_123[lsf][layer - 1][bitrate_index]; - framesize = bitrate * mult[layer - 1]; - - mp3_hdr_printf("FRAMESIZE: %d, layer: %d, bitrate: %d, mult: %d\n", - framesize, layer, tabsel_123[lsf][layer - 1][bitrate_index], mult[layer - 1]); - if (!framesize) - { - mp3_hdr_printf("invalid framesize/bitrate_index\n"); - return -1; - } - - divisor = (layer == 3 ? (freqs[sampling_frequency] << lsf) : freqs[sampling_frequency]); - framesize /= divisor; - if (layer == 1) - framesize = (framesize + padding) * 4; - else - framesize += padding; - -// if(framesize<=0 || framesize>MAXFRAMESIZE) return FALSE; - if (srate) - { - *srate = freqs[sampling_frequency]; - if (spf) - { - if (layer == 1) - *spf = 384; - else if (layer == 2) - *spf = 1152; - else if (*srate < 32000) - *spf = 576; - else - *spf = 1152; - } - } - if (mpa_layer) *mpa_layer = layer; - if (chans) *chans = stereo; - if (br) *br = bitrate; - - return framesize; -} - diff --git a/libeplayer2/container/mp3_hdr.h b/libeplayer2/container/mp3_hdr.h deleted file mode 100644 index 7a0523b..0000000 --- a/libeplayer2/container/mp3_hdr.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef EPLAYER_MP3_HDR_H -#define EPLAYER_MP3_HDR_H - -#include - -int mp_get_mp3_header(unsigned char *hbuf, int *chans, int *freq, int *spf, int *mpa_layer, int *br); - -#define mp_decode_mp3_header(hbuf) mp_get_mp3_header(hbuf,NULL,NULL,NULL,NULL,NULL) - -static inline int mp_check_mp3_header(unsigned int head) -{ -if ((head & 0x0000e0ff) != 0x0000e0ff || - (head & 0x00fc0000) == 0x00fc0000) return 0; -if (mp_decode_mp3_header((unsigned char *)(&head)) <= 0) return 0; -return 1; -} - -#endif /* EPLAYER_MP3_HDR_H */ diff --git a/libeplayer2/container/mp4.c b/libeplayer2/container/mp4.c deleted file mode 100644 index f656ab5..0000000 --- a/libeplayer2/container/mp4.c +++ /dev/null @@ -1,1727 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include "container.h" -#include "common.h" - -#include "mp4.h" - - -pthread_mutex_t mutex; -static const char FILENAME[] = "mp4.c"; - -static Mp4Info_t *Mp4Info = NULL; -static int TrackCount = -1; -static pthread_t PlayThread; -static unsigned char isPlayThreadCreated = 0; - -static off_t stream_off = 0; - -/* #define DEBUG -*/ - -static off_t myftello(Context_t *context, FILE *stream) -{ - if ((context->playback->isHttp) || (context->playback->isUPNP)) - return stream_off; - return ftello(stream); -} - -static size_t myfread(Context_t *context, void *ptr, size_t size, size_t count, FILE *stream) -{ - size_t n = fread(ptr, size, count, stream); - stream_off += (n * size); - -#ifdef DEBUG - if (n != count) printf("%s: count %d != n %d\n", __func__, count, n); -#endif - return n; -} - -static int myfseeko(Context_t *context, FILE **stream, off_t off, int whence) -{ - -#ifdef DEBUG - printf("%s ", __FUNCTION__); - printf("Stream Pos: 0x%lx ", (long unsigned int) myftello(context, *stream)); - printf("Offset: 0x%lx (%lu)", (long unsigned int) off, (long unsigned int) off); - - if (whence == SEEK_SET) - printf("SEEK_SET\n"); - else - printf("SEEK_CUR\n"); -#endif - - if ((context->playback->isHttp) || (context->playback->isUPNP)) - { - int fd; - if (whence == SEEK_SET) - { - if (off < stream_off || off - stream_off > 32000) - { - char *ext = NULL; - - fclose(*stream); - close(context->playback->fd); - stream_off = off; - - if (context->playback->isHttp) - fd = openHttpConnection(context, &ext , off); - else - fd = openUPNPConnection(context, off); - - if (fd < 0) - return fd; - - context->playback->fd = fd; - if (ext != NULL) - free(ext); - - *stream = fdopen(context->playback->fd, "r"); - - } - else - { - char t; - int x, n = off - stream_off; - - for (x = 0; x < n; x++) - myfread(context, &t, 1, 1, *stream); - } - } - else if (whence == SEEK_CUR) - { - if (off < 0 || off > 32000) - { - char *ext = NULL; - fclose(*stream); - close(context->playback->fd); - stream_off += off; - - if (context->playback->isHttp) - fd = openHttpConnection(context, &ext , stream_off); - else - fd = openUPNPConnection(context, stream_off); - - if (fd < 0) - return fd; - - context->playback->fd = fd; - if (ext != NULL) - free(ext); - *stream = fdopen(context->playback->fd, "r"); - } - else - { - char t; - int x; - for (x = 0; x < off; x++) - myfread(context, &t, 1, 1, *stream); - } - } - return 0; - } - return fseeko(*stream, off, whence); - -} - -/*{{{ CheckCode*/ -static bool CheckCode(unsigned int Code, Mp4Container_t *Container) -{ - unsigned int i; - for (i = 0; i < RECOGNISED_CODES; i++) - { - if (Code == CodeTable[i].Code) - break; - } - if (i == RECOGNISED_CODES) - { - printf("%s: ERROR - Unrecognised code '%.4s'\n", __FUNCTION__, (char *)&Code); - return true; - } - /* - if (CodeTable[i].Parent != *Container) - printf("%s: '%.4s' record encountered - terminating '%.4s'\n", __FUNCTION__, (char*)&Code, (char*)Container); - */ - *Container = CodeTable[i].Next; - return CodeTable[i].Skip; -} -/*}}} */ -/*{{{ FreeTrackData*/ -static void FreeTrackData(Mp4Track_t *Track) -{ - if (Track == NULL) - return; - - /* free chunk map */ - if (Track->ChunkMap != NULL) - { - free(Track->ChunkMap); - Track->ChunkMap = NULL; - Track->ChunkMapCount = 0; - } - /* free chunks */ - if (Track->Chunk != NULL) - { - free(Track->Chunk); - Track->Chunk = NULL; - Track->ChunkCount = 0; - } - /* free decoding time table */ - if (Track->DecodingTime != NULL) - { - free(Track->DecodingTime); - Track->DecodingTime = NULL; - Track->DecodingTimeCount = 0; - } - /* free composition time table */ - if (Track->CompositionTime != NULL) - { - free(Track->CompositionTime); - Track->CompositionTime = NULL; - Track->CompositionTimeCount = 0; - } - /* free sample table */ - if (Track->KeyFrameTable != NULL) - { - free(Track->KeyFrameTable); - Track->KeyFrameTable = NULL; - Track->KeyFrameTableCount = 0; - } - /* free samples */ - if (Track->Samples != NULL) - { - free(Track->Samples); - Track->Samples = NULL; - Track->SampleCount = 0; - } - /* free sequence data table */ - if (Track->SequenceData != NULL) - { - free(Track->SequenceData); - Track->SequenceData = NULL; - } -} -/*}}} */ -/*{{{ BuildTrackMap*/ -static PlayerStatus_t BuildTrackMap(Mp4Track_t *Track) -{ - int i, j; - unsigned int LastChunk; - unsigned int Sample; - unsigned int Count; - unsigned int DecodingTime; - unsigned int CompositionTime; - unsigned int CompositionEntry; - unsigned int CompositionCount; - -#ifdef DEBUG - printf("%s: MOV track type '%.4s': %d chunks, %d samples\n", __FUNCTION__, - (char *)&Track->Type, Track->ChunkCount, Track->SampleCount); -#endif - - /* transfer data from chunk map to chunks */ - i = Track->ChunkMapCount; - LastChunk = Track->ChunkCount; - while (i > 0) - { - --i; - for (j = Track->ChunkMap[i].FirstChunk; j < LastChunk; j++) - { - Track->Chunk[j].Description = Track->ChunkMap[i].SampleDescriptionIndex; - Track->Chunk[j].SampleCount = Track->ChunkMap[i].SamplesPerChunk; - } - LastChunk = Track->ChunkMap[i].FirstChunk; - } - - /* free chunk map table */ - free(Track->ChunkMap); - Track->ChunkMap = NULL; - Track->ChunkMapCount = 0; - - /* Cross check */ - Sample = 0; - for (i = 0; i < Track->ChunkCount; i++) - { - Track->Chunk[i].FirstSample = Sample; - Sample += Track->Chunk[i].SampleCount; - } - - Count = 0; - for (i = 0; i < Track->DecodingTimeCount; i++) - Count += Track->DecodingTime[i].Count; - - if (Count != Sample) - { - printf("%s: Sample Table and Chunk Map sample count differ (%i vs %i)\n", __FUNCTION__, Count, Sample); - if (Count > Sample) - Sample = Count; - } - - /* Create video sample sizes for fixed-size video frames */ - if ((Track->SampleCount == 0) && (Track->Type != CodeToInteger('s', 'o', 'u', 'n'))) - { - Track->SampleCount = Sample; - Track->Samples = malloc(sizeof(Mp4Sample_t) * Sample); - if (Track->Samples == NULL) - { - printf("%s: ERROR - Unable to create track sample list - not enough memory (%d)\n", __FUNCTION__, sizeof(Mp4Sample_t) * Sample); - return PlayerError; - } - - for (i = 0; i < Sample; i++) - Track->Samples[i].Length = Track->SampleSize; - Track->SampleSize = 0; - } - - if (Track->SampleCount == 0) - { - if ((Track->DecodingTimeCount == 1) || ((Track->DecodingTimeCount == 2) && Track->DecodingTime[1].Count == 1)) - Track->Duration = Track->DecodingTime[0].Delta; - else - { - printf("%s: ERROR - Constant samplesize & variable duration not yet supported\n", __FUNCTION__); - return PlayerError; - } - } - - if (Track->SampleCount < Sample) - { - printf("%s: DecodingTimeCount or Chunk Map bigger than sample count (%i vs %i)\n", __FUNCTION__, - Sample, Track->SampleCount); - Track->SampleCount = Sample; - Track->Samples = realloc(Track->Samples, sizeof(Mp4Sample_t) * Sample); - } - - Sample = 0; - DecodingTime = 0; - CompositionEntry = 0; - CompositionCount = 0; - Track->DecodingTimeValues = false; - Track->TimeDelta = 0xffffffff; - - for (i = 0; i < Track->DecodingTimeCount; i++) - { - printf("%s: TimeScale %d, Delta %d\n", __FUNCTION__, Track->TimeScale, Track->DecodingTime[i].Delta); - Track->TimeDelta = Track->DecodingTime[0].Delta; - - if (Track->CompositionTimeCount == 0) - { - printf(" *** Composition Data not present.\n"); - Track->DecodingTimeValues = true; - } - for (j = 0; j < Track->DecodingTime[i].Count; j++) - { - if (Track->CompositionTimeCount > 0) - CompositionTime = DecodingTime + Track->CompositionTime[CompositionEntry].Offset; - else - CompositionTime = DecodingTime; - /* - The following adjustment forces the first PTS to be reduced by 1 delta. If this isn't - applied the composition offset for the first frame would be non-zero and so the video - will play 1 frame behind the audio which does not usually have composition offsets. - - This is equivalent to initialising DecodingTime to -Track->DecodingTime[0].Delta; - - In one closed gop example, Delta is 1001, Timescale is 24000 giving a frame rate of - 23.976fps and the composition entries go 1001, 3003, 0, 0. This would result in the - PTS of the first video frame being 3753 rather than 0. - - In an open gop example, Delta is 1001, Timescale is 24000 giving a frame rate of - 23.976fps and the composition entries go 3003, 1001, 2002. This would result in the - PTS of the first video frame being 11261 rather than 7507. - */ - if ((j == 0) && (i == 0) && (Track->CompositionTimeCount > 0)) - Track->Samples[Sample].Pts = ((unsigned long long)(CompositionTime - Track->DecodingTime[i].Delta) * 90000ull) / Track->TimeScale; - else - { - Track->Samples[Sample].Pts = ((unsigned long long)CompositionTime * 90000ull) / Track->TimeScale; - DecodingTime += Track->DecodingTime[i].Delta; - } - Sample++; - if (Track->CompositionTimeCount > 0) - { - CompositionCount++; - if (CompositionCount == Track->CompositionTime[CompositionEntry].Count) - { - CompositionEntry++; - CompositionCount = 0; - if ((CompositionEntry == Track->CompositionTimeCount) && (Sample < Track->SampleCount)) - printf("%s: Error run out of composition data Sample %d of %d\n", __FUNCTION__, - Sample, Track->SampleCount); - } - } - - } - } - - /* Derive sample offsets in file */ - for (i = 0; i < Track->ChunkCount; i++) - { - off_t Offset = Track->Chunk[i].Offset; - for (j = Track->Chunk[i].FirstSample; j < (Track->Chunk[i].FirstSample + Track->Chunk[i].SampleCount); j++) - { - Track->Samples[j].Offset = Offset; - Offset += Track->Samples[j].Length; - } - } - - /* free time tables */ - free(Track->DecodingTime); - Track->DecodingTime = NULL; - Track->DecodingTimeCount = 0; - free(Track->CompositionTime); - Track->CompositionTime = NULL; - Track->CompositionTimeCount = 0; - - /* Fill in keyframe info then free keyframe table. All frames are key if table not present */ - if (Track->KeyFrameTableCount == 0) - for (i = 0; i < Track->SampleCount; i++) - Track->Samples[i].Flags = MP4_KEY_FRAME; - else - for (i = 0; i < Track->KeyFrameTableCount; i++) - Track->Samples[Track->KeyFrameTable[i] - 1].Flags = MP4_KEY_FRAME; - - free(Track->KeyFrameTable); - Track->KeyFrameTable = NULL; - Track->KeyFrameTableCount = 0; - - return PlayerNoError; -} - -/*}}} */ -/*{{{ FindHeader*/ -/* -#define AC3_START_CODE 0x0b77 -#define AC3_START_CODE_MASK 0xffff -#define MP3_START_CODE 0xffe0 -#define MP3_START_CODE_MASK 0xffe0 -#define AAC_START_CODE 0xffe0 -#define AAC_START_CODE_MASK 0xffe0 - - -static unsigned int FindHeader (Context_t* context) -// Return offset from start of file of first header -{ - int j; - //Mp4Info_t* Mp4Info = (Mp4Info_t*)Context->MediaContext; - Mp4Track_t* AudioTrack = &Mp4Info->Track[Mp4Info->AudioTrack]; - unsigned int AudioChunk = AudioTrack->ChunkToPlay; - Mp4Sample_t* Sample = &AudioTrack->Samples[AudioTrack->Chunk[AudioChunk].FirstSample]; - unsigned char* Data = Context->Data; - unsigned int StartCode; - unsigned int StartCodeMask; - - switch (Context->Audio->Encoding) - { - case AUDIO_ENCODING_AC3: - StartCode = AC3_START_CODE; - StartCodeMask = AC3_START_CODE_MASK; - break; - case AUDIO_ENCODING_MP3: - StartCode = MP3_START_CODE; - StartCodeMask = MP3_START_CODE_MASK; - break; - case AUDIO_ENCODING_AAC: - StartCode = AAC_START_CODE; - StartCodeMask = AAC_START_CODE_MASK; - break; - default: - return Sample->Pts; - } - - fseeko (Context->File, AudioTrack->Chunk[AudioChunk].Offset, SEEK_SET); - fread (Data, 1, Sample->Length, Context->File); - for (j = 0; j < Sample->Length; j++) - { - if ((((Data[j] << 8) | Data[j+1]) & StartCodeMask) == StartCode) - break; - } - if (j < Sample->Length) - { - unsigned int PtsDiff = (Sample+1)->Pts - Sample->Pts; - - printf("%s: In Pts %u, Out Pts %u\n", __FUNCTION__, Sample->Pts, Sample->Pts + ((j * PtsDiff) / Sample->Length)); - return Sample->Pts + ((j * PtsDiff) / Sample->Length); - } - return Sample->Pts; -}*/ - -/*}}} */ -/*{{{ SeekH264Mp4*/ -/*static PlayerStatus_t SeekH264Mp4 (Context_t* Context, int MilliSeconds) -{ - int i, j; - //Mp4Info_t* Mp4Info = (Mp4Info_t*)Context->MediaContext; - Mp4Track_t* AudioTrack = NULL; - unsigned long long AudioPts = 0ull; - - Mp4Track_t* VideoTrack = NULL; - unsigned long long VideoPts = 0ull; - - unsigned long long DesiredPts; - unsigned long long LastPts; - bool SampleFound = false; - - if (Mp4Info->AudioTrack != -1) - AudioTrack = &Mp4Info->Track[Mp4Info->AudioTrack]; - if (Mp4Info->VideoTrack != -1) - VideoTrack = &Mp4Info->Track[Mp4Info->VideoTrack]; - - DesiredPts = VideoTrack->Pts + (MilliSeconds * 90); - LastPts = (unsigned long long)VideoTrack->Samples[VideoTrack->SampleCount-1].Pts; - if (DesiredPts >= LastPts) - { - printf ("%s Error - Attempt to seek beyond end of movie Pts = %llu, LastPts %llu\n", __FUNCTION__, DesiredPts, LastPts); - return PlayerError; - } - - AudioIoctl (Context, AUDIO_CLEAR_BUFFER, NULL); - VideoIoctl (Context, VIDEO_CLEAR_BUFFER, NULL); - - printf ("%s Seeking to %u of %u seconds\n", __FUNCTION__, (unsigned int)(DesiredPts/90000), (unsigned int)(LastPts/90000)); - - for (i = VideoTrack->ChunkToPlay; (i < VideoTrack->ChunkCount) && !SampleFound; i++) - { - for (j=VideoTrack->Chunk[i].FirstSample; j<(VideoTrack->Chunk[i].FirstSample+VideoTrack->Chunk[i].SampleCount); j++) - { - VideoPts = (unsigned long long)VideoTrack->Samples[j].Pts; - if ((VideoPts >= DesiredPts) && ((VideoTrack->Samples[j].Flags & MP4_KEY_FRAME) != 0)) - { - VideoTrack->ChunkToPlay = i; - VideoTrack->SampleToPlay = j; - SampleFound = true; - break; - } - } - } - if (i < VideoTrack->ChunkCount) - { - VideoTrack->Pts = VideoPts; - SampleFound = false; - } - for (i = AudioTrack->ChunkToPlay; (i < AudioTrack->ChunkCount) && !SampleFound; i++) - { - for (j=AudioTrack->Chunk[i].FirstSample; j<(AudioTrack->Chunk[i].FirstSample+AudioTrack->Chunk[i].SampleCount); j++) - { - AudioPts = (unsigned long long)AudioTrack->Samples[j].Pts; - if (AudioPts >= VideoPts) - { - AudioTrack->ChunkToPlay = i; - AudioTrack->SampleToPlay = j; - SampleFound = true; - break; - } - } - } - if (i < AudioTrack->ChunkCount) - AudioTrack->Pts = AudioPts; - - printf ("%s Audio Chunk %u, Sample %u, Pts = %llu, Video Chunk %u, Sample %u, Pts = %llu\n", __FUNCTION__, - AudioTrack->ChunkToPlay, AudioTrack->SampleToPlay, AudioTrack->Pts, - VideoTrack->ChunkToPlay, VideoTrack->SampleToPlay, VideoTrack->Pts); - - return PlayerNoError; -}*/ -/*}}} */ -/*{{{ PlayH264Mp4Audio */ - -//static unsigned char* AudioData = NULL; -//static unsigned char* Data = NULL; - -/*}}} */ -/*{{{ PlayH264Mp4File*/ -static void PlayH264Mp4File(Context_t *Context) -{ - /*{{{ locals*/ - unsigned char *Data = NULL; //Context->Data+PADDING_LENGTH; - - FILE *Mp4File = fdopen(Context->playback->fd, "r"); //Context->File; - - - - Mp4Track_t *VideoTrack = NULL; - off_t VideoPosition; - unsigned long long VideoPts = 0ull; - unsigned int SampleSize = 0; - int VideoChunk = 0; - int VideoSample = 0; - - Mp4Track_t *AudioTrack = NULL; - //Context_t* Context = (Context_t*)ThreadParam; - - unsigned char *AudioData = NULL; - - off_t AudioPosition; - //unsigned int SampleSize = 0; - unsigned long long AudioPts = 0ull; - int AudioChunk = 0; - int AudioSample = 0; - float frameRate = 0; - -#ifdef DEBUG - printf("%s >\n", __func__); -#endif - - if (Mp4Info->VideoTrack != -1) - { - VideoTrack = &Mp4Info->Track[Mp4Info->VideoTrack]; - VideoTrack->ChunkToPlay = 0; - VideoTrack->SampleToPlay = 0; - VideoChunk = 1; /* Force to be different from ChunkToPlay so reload pts */ - VideoTrack->Pts = 0ull; - /* Quack: find framerate */ - frameRate = VideoTrack-> TimeScale; - while (frameRate > 100.0)frameRate /= 10.0; - } - - if ((Mp4Info->AudioTrack != -1) && (AudioTrack == NULL)) - { -#ifdef DEBUG - printf("%s: Initialising AudioTrack\n", __FUNCTION__); -#endif - AudioTrack = &Mp4Info->Track[Mp4Info->AudioTrack]; - AudioTrack->ChunkToPlay = 0; - AudioTrack->SampleToPlay = 0; - AudioChunk = 1; /* Force to be different from ChunkToPlay so reload pts */ - //AudioTrack->Pts = FindHeader (Context); - } - - while (Context->playback->isPlaying) - { - - //IF MOVIE IS PAUSE, WAIT - while (Context->playback->isPaused) - { - printf("paused\n"); - usleep(100000); - } - pthread_mutex_lock(&mutex); - // Values are recalculated in case we have skipped - VideoChunk = VideoTrack->ChunkToPlay; - AudioChunk = AudioTrack->ChunkToPlay; - - if (AudioChunk >= AudioTrack->ChunkCount && VideoChunk >= VideoTrack->ChunkCount) return; /* hellmaster1024: EoF detection */ - -#ifdef DEBUG - printf("Audio: %d, Video: %d\n", Context->playback->isAudio, Context->playback->isVideo); -#endif - - /*i merged the functionality of playThread and audioThread because streaming works much better this way*/ - if (Context->playback->isAudio && (AudioTrack->Samples[AudioTrack->SampleToPlay].Offset < VideoTrack->Samples[VideoTrack->SampleToPlay].Offset)) - { -#ifdef DEBUG - printf("audio comes first %llu ", AudioTrack->Samples[AudioTrack->SampleToPlay].Offset); - printf("then video %llu\n", VideoTrack->Samples[VideoTrack->SampleToPlay].Offset); -#endif - if (Context->playback->isAudio) - { - if (AudioChunk < AudioTrack->ChunkCount) - { - for (AudioSample = AudioTrack->SampleToPlay; AudioSample < (AudioTrack->Chunk[AudioChunk].FirstSample + AudioTrack->Chunk[AudioChunk].SampleCount); AudioSample++) - { - - if (!Context->playback->isPlaying)return; - - SampleSize = AudioTrack->Samples[AudioSample].Length; - AudioPosition = AudioTrack->Samples[AudioSample].Offset; - AudioPts = AudioTrack->Samples[AudioSample].Pts; - - AudioData = malloc(SampleSize); - - if (myfseeko(Context, &Mp4File, AudioPosition, SEEK_SET) < 0) - { - printf("%s: line %d seek failed\n", __func__, __LINE__); - free(AudioData); - fclose(Mp4File); - return; - } - - if (myfread(Context, AudioData, 1, SampleSize, Mp4File) == 0) - { - printf("%s: line %d read failed\n", __func__, __LINE__); - free(AudioData); - fclose(Mp4File); - return; - } - - Context->output->audio->Write(Context, AudioData, SampleSize, AudioPts, AudioTrack->SequenceData, AudioTrack->SequenceDataLength, 0, "audio"); - - free(AudioData); - - } - AudioTrack->SampleToPlay = AudioSample; - AudioChunk++; - AudioTrack->ChunkToPlay = AudioChunk; - } - } - } - else - { -#ifdef DEBUG - printf("video comes first %llu ", VideoTrack->Samples[VideoTrack->SampleToPlay].Offset); - printf("then audio %llu\n", AudioTrack->Samples[AudioTrack->SampleToPlay].Offset); -#endif - if (Context->playback->isVideo) - { - if (VideoChunk < VideoTrack->ChunkCount) - { - for (VideoSample = VideoTrack->SampleToPlay; VideoSample < (VideoTrack->Chunk[VideoChunk].FirstSample + VideoTrack->Chunk[VideoChunk].SampleCount); VideoSample++) - { - if (!Context->playback->isPlaying)return; - - SampleSize = VideoTrack->Samples[VideoSample].Length; - VideoPosition = VideoTrack->Samples[VideoSample].Offset; - VideoPts = VideoTrack->Samples[VideoSample].Pts; - Data = malloc(SampleSize); - - if (myfseeko(Context, &Mp4File, VideoPosition, SEEK_SET) < 0) - { - printf("%s: line %d seek failed\n", __func__, __LINE__); - free(Data); - fclose(Mp4File); - return; - } - - if (myfread(Context, Data, 1, SampleSize, Mp4File) == 0) - { - printf("%s: line %d read failed\n", __func__, __LINE__); - free(Data); - fclose(Mp4File); - return; - } - - Context->output->video->Write(Context, Data, SampleSize, VideoPts, VideoTrack->SequenceData, VideoTrack->SequenceDataLength, frameRate, "video"); - - free(Data); - } - VideoTrack->SampleToPlay = VideoSample; - VideoChunk++; - VideoTrack->ChunkToPlay = VideoChunk; - } - } - } - pthread_mutex_unlock(&mutex); - } -#ifdef DEBUG - printf("%s <\n", __func__); -#endif -} -/*}}} */ - -/*{{{ StartMp4*/ -static int StartMp4(Context_t *context) -{ - FILE *Mp4File = fdopen(context->playback->fd, "r"); - unsigned int Code; - unsigned long long int Length = 0; - off_t BoxStart = 0; - off_t BoxEnd = 0; - int i; - //Mp4Info_t* Mp4Info; - unsigned int TrackSelect = 0; - Mp4Container_t Container = File; - unsigned int EntryCount; - bool NewTrack = true; /* Flag so that track updated by both mdhd and hdlr */ - int Status = 0; - - //Context->StartOffset = 0; -#ifdef DEBUG - printf("%s >\n", __func__); - printf(" start %X\n", (unsigned int) myftello(context, Mp4File)); -#endif - - TrackCount = -1; - - pthread_mutex_init(&mutex, 0); - - Mp4Info = (Mp4Info_t *)malloc(sizeof(Mp4Info_t)); - if (Mp4Info == NULL) - { - printf("%s: Unable to create MP4 context\n", __FUNCTION__); - return -PlayerNoMemory; - } - else - memset(Mp4Info, 0, sizeof(Mp4Info_t)); - - Mp4Info->VideoTrack = -1; - Mp4Info->AudioTrack = -1; - -#ifdef DEBUG - printf("%s::%s (%d)\n", FILENAME, __FUNCTION__, __LINE__); -#endif - - while (!feof(Mp4File)) - { - /* Read next box length and type */ - BoxStart = myftello(context, Mp4File); - myfread(context, &Length, sizeof(unsigned int), 1, Mp4File); - myfread(context, &Code, sizeof(unsigned int), 1, Mp4File); - - if (feof(Mp4File)) - { -#ifdef DEBUG - printf("end of file\n"); -#endif - /* this must not be an error, but we must leave loop */ - break; - } - - Length = BE2ME(Length); /* Convert Length from Little to Big endian */ - if (Length == 1) /* Length == 1 indicates 64 bit length follows */ - { - myfread(context, &Length, sizeof(unsigned long long int), 1, Mp4File); - Length = BE2ME64(Length); /* Convert Length from Little to Big endian */ - } - else if (Length == 0) - { - printf("%s: Last Box '%.4s'\n", __FUNCTION__, (char *)(&Code)); - break; - } - else if (Length < 8) /* Chunk too short */ - { - printf("%s: Invalid chunk length %lld\n", __FUNCTION__, Length); - break; - } - BoxEnd = BoxStart + Length; - - if (CheckCode(Code, &Container)) /* true indicates skip contents of box */ - { - if ( - ((context->playback->isHttp) || (context->playback->isUPNP)) && - (context->playback->size > 0 && context->playback->size <= BoxEnd)) - { - printf("skipping seek because offset>filesize\n"); - if (myfseeko(context, &Mp4File, BoxStart, SEEK_SET) < 0) - { - printf("seek1 failed\n"); - goto StartMp4_error; - } - break; - } - - if (myfseeko(context, &Mp4File, BoxEnd, SEEK_SET) < 0) - { - printf("seek2 failed->BoxEnd %lld, BoxStart %lld, Length %lld\n", BoxEnd, BoxStart, Length); - goto StartMp4_error; - - } - } - - switch (Code) - { - case CodeToInteger('m', 'd', 'h', 'd'): - /*{{{ */ - { - unsigned int Version; - unsigned int TimeScale; - - if (NewTrack) - { - TrackCount++; - -#ifdef DEBUG - printf("NewTrack Count %d\n", TrackCount); -#endif - TrackSelect = TrackCount; - NewTrack = false; - } - else - NewTrack = true; - - myfread(context, &Version, sizeof(unsigned int), 1, Mp4File); - if (Version == 0) /* Indicates 32 bit structure */ - { - unsigned int Duration; - - if (myfseeko(context, &Mp4File, sizeof(unsigned int) * 2, SEEK_CUR) < 0) - { - printf("seek3 failed\n"); - goto StartMp4_error; - } - - if (myfread(context, &TimeScale, sizeof(unsigned int), 1, Mp4File) == 0) - goto StartMp4_error; - - if (myfread(context, &Duration, sizeof(unsigned int), 1, Mp4File) == 0) - goto StartMp4_error; - - Mp4Info->Track[TrackSelect].Duration = (unsigned long long)BE2ME(Duration); - } - else - { - unsigned long long Duration; - - if (myfseeko(context, &Mp4File, sizeof(unsigned long long) * 2, SEEK_CUR) < 0) - { - printf("seek4 failed\n"); - goto StartMp4_error; - } - if (myfread(context, &TimeScale, sizeof(unsigned int), 1, Mp4File) == 0) - goto StartMp4_error; - if (myfread(context, &Duration, sizeof(unsigned long long), 1, Mp4File) == 0) - goto StartMp4_error; - - Mp4Info->Track[TrackSelect].Duration = BE2ME64(Duration); - } - Mp4Info->Track[TrackSelect].TimeScale = BE2ME(TimeScale); -#ifdef DEBUG - printf("%s: 'mdhd' Track %d, TimeScale = %u, Duration = %llu (%llu)\n", __FUNCTION__, TrackSelect, - Mp4Info->Track[TrackSelect].TimeScale, Mp4Info->Track[TrackSelect].Duration, - Mp4Info->Track[TrackSelect].Duration / Mp4Info->Track[TrackSelect].TimeScale); -#endif - - if (myfseeko(context, &Mp4File, BoxEnd, SEEK_SET) < 0) - { - printf("seek5 failed\n"); - goto StartMp4_error; - } - break; - } - /*}}} */ - case CodeToInteger('h', 'd', 'l', 'r'): - /*{{{ */ - { - unsigned int HandlerType; - - if (myfseeko(context, &Mp4File, sizeof(unsigned int) * 2, SEEK_CUR) < 0) /* skip version and pre_defined */ - { - printf("seek6 failed\n"); - goto StartMp4_error; - } - myfread(context, &HandlerType, sizeof(unsigned int), 1, Mp4File); - - if (NewTrack) - { - TrackCount++; - -#ifdef DEBUG - printf("NewTrack Count %d\n", TrackCount); -#endif - - TrackSelect = TrackCount; - NewTrack = false; - } - else - NewTrack = true; - - if (HandlerType == CodeToInteger('s', 'o', 'u', 'n')) - Mp4Info->AudioTrack = TrackSelect; - else if (HandlerType == CodeToInteger('v', 'i', 'd', 'e')) - Mp4Info->VideoTrack = TrackSelect; - Mp4Info->Track[TrackSelect].Type = HandlerType; -#ifdef DEBUG - printf("%s: Track %d type = '%.4s'\n", __FUNCTION__, TrackSelect, (char *)&HandlerType); -#endif - - if (myfseeko(context, &Mp4File, BoxEnd, SEEK_SET) < 0) - { - printf("seek7 failed\n"); - goto StartMp4_error; - } - break; - } - /*}}} */ - case CodeToInteger('s', 't', 't', 's'): - /*{{{ */ - { - if (myfseeko(context, &Mp4File, sizeof(unsigned int), SEEK_CUR) < 0) /* skip version no */ - { - printf("seek8 failed\n"); - goto StartMp4_error; - } - - myfread(context, &EntryCount, sizeof(unsigned int), 1, Mp4File); - EntryCount = BE2ME(EntryCount); - -#ifdef DEBUG - printf("%s: stts Found %d\n", __FUNCTION__, EntryCount); -#endif - Mp4Info->Track[TrackSelect].DecodingTime = (Mp4TimeToSample_t *)calloc(EntryCount, sizeof(Mp4TimeToSample_t)); - if (Mp4Info->Track[TrackSelect].DecodingTime == NULL) - { - printf("%s: ERROR - unable to create Sample table - need %d bytes\n", __FUNCTION__, EntryCount * sizeof(Mp4TimeToSample_t)); - return -PlayerNoMemory; - } - else - { - Mp4Info->Track[TrackSelect].DecodingTimeCount = EntryCount; - myfread(context, Mp4Info->Track[TrackSelect].DecodingTime, sizeof(Mp4TimeToSample_t), EntryCount, Mp4File); - for (i = 0; i < EntryCount; i++) /* convert sample table to little endian */ - { - Mp4Info->Track[TrackSelect].DecodingTime[i].Count = BE2ME(Mp4Info->Track[TrackSelect].DecodingTime[i].Count); - Mp4Info->Track[TrackSelect].DecodingTime[i].Delta = BE2ME(Mp4Info->Track[TrackSelect].DecodingTime[i].Delta); - } - } - break; - } - /*}}} */ - case CodeToInteger('c', 't', 't', 's'): - /*{{{ */ - { - if (myfseeko(context, &Mp4File, sizeof(unsigned int), SEEK_CUR) < 0) /* skip version no */ - { - printf("seek9 failed\n"); - goto StartMp4_error; - } - myfread(context, &EntryCount, sizeof(unsigned int), 1, Mp4File); - EntryCount = BE2ME(EntryCount); - -#ifdef DEBUG - printf("%s: stts Found %d\n", __FUNCTION__, EntryCount); -#endif - Mp4Info->Track[TrackSelect].CompositionTime = (Mp4CompositionOffset_t *)calloc(EntryCount, sizeof(Mp4CompositionOffset_t)); - if (Mp4Info->Track[TrackSelect].CompositionTime == NULL) - { - printf("%s: ERROR - unable to create Sample table - need %d bytes\n", __FUNCTION__, EntryCount * sizeof(Mp4TimeToSample_t)); - return -PlayerNoMemory; - } - else - { - Mp4Info->Track[TrackSelect].CompositionTimeCount = EntryCount; - myfread(context, Mp4Info->Track[TrackSelect].CompositionTime, sizeof(Mp4CompositionOffset_t), EntryCount, Mp4File); - for (i = 0; i < EntryCount; i++) /* convert sample table to little endian */ - { - Mp4Info->Track[TrackSelect].CompositionTime[i].Count = BE2ME(Mp4Info->Track[TrackSelect].CompositionTime[i].Count); - Mp4Info->Track[TrackSelect].CompositionTime[i].Offset = BE2ME(Mp4Info->Track[TrackSelect].CompositionTime[i].Offset); - } - } - break; - } - /*}}} */ - case CodeToInteger('s', 't', 's', 's'): - /*{{{ */ - { - if (myfseeko(context, &Mp4File, sizeof(unsigned int), SEEK_CUR) < 0) /* skip version no */ - { - printf("seek10 failed\n"); - goto StartMp4_error; - } - - myfread(context, &EntryCount, sizeof(unsigned int), 1, Mp4File); - EntryCount = BE2ME(EntryCount); - -#ifdef DEBUG - printf("%s: 'stss' Found %d key frames\n", __FUNCTION__, EntryCount); -#endif - Mp4Info->Track[TrackSelect].KeyFrameTable = (unsigned int *)calloc(EntryCount, sizeof(unsigned int)); - if (Mp4Info->Track[TrackSelect].KeyFrameTable == NULL) - { - printf("%s: ERROR - unable to create KeyFrame table - need %d bytes\n", __FUNCTION__, EntryCount * sizeof(unsigned int)); - return -PlayerNoMemory; - } - else - { - Mp4Info->Track[TrackSelect].KeyFrameTableCount = EntryCount; - myfread(context, Mp4Info->Track[TrackSelect].KeyFrameTable, sizeof(unsigned int), EntryCount, Mp4File); - for (i = 0; i < EntryCount; i++) /* convert sample table to little endian */ - Mp4Info->Track[TrackSelect].KeyFrameTable[i] = BE2ME(Mp4Info->Track[TrackSelect].KeyFrameTable[i]); - } - if (myfseeko(context, &Mp4File, BoxEnd, SEEK_SET) < 0) - { - printf("seek11 failed\n"); - goto StartMp4_error; - } - break; - } - /*}}} */ - case CodeToInteger('s', 't', 'c', 'o'): - /*{{{ */ - { - unsigned int *ChunkOffset; - - if (myfseeko(context, &Mp4File, sizeof(unsigned int), SEEK_CUR) < 0) /* skip version no */ - { - printf("seek12 failed\n"); - goto StartMp4_error; - } - - myfread(context, &EntryCount, sizeof(unsigned int), 1, Mp4File); - EntryCount = BE2ME(EntryCount); - - ChunkOffset = (unsigned int *)malloc(EntryCount * sizeof(unsigned int)); - if (ChunkOffset == NULL) - { - printf("%s: ERROR - unable to create Chunk offset list need %d bytes\n", __FUNCTION__, EntryCount * sizeof(unsigned int)); - return -PlayerNoMemory; - } - else - { - myfread(context, ChunkOffset, sizeof(unsigned int), EntryCount, Mp4File); - Mp4Info->Track[TrackSelect].Chunk = (Mp4Chunk_t *)malloc(sizeof(Mp4Chunk_t) * EntryCount); - if (Mp4Info->Track[TrackSelect].Chunk == NULL) - { - printf("%s: ERROR - unable to create Chunk list - need %d bytes\n", __FUNCTION__, sizeof(Mp4Chunk_t) * EntryCount); - return -PlayerNoMemory; - } - else - { - Mp4Info->Track[TrackSelect].ChunkCount = EntryCount; - for (i = 0; i < EntryCount; i++) - Mp4Info->Track[TrackSelect].Chunk[i].Offset = BE2ME(ChunkOffset[i]); - } - free(ChunkOffset); - } - break; - } - /*}}} */ - case CodeToInteger('c', 'o', '6', '4'): - /*{{{ */ - { - unsigned long long *ChunkOffset; - - if (myfseeko(context, &Mp4File, sizeof(unsigned int), SEEK_CUR) < 0) /* skip version no */ - { - printf("seek13 failed\n"); - goto StartMp4_error; - } - - myfread(context, &EntryCount, sizeof(unsigned int), 1, Mp4File); - EntryCount = BE2ME(EntryCount); - - ChunkOffset = (unsigned long long *)malloc(EntryCount * sizeof(unsigned long long int)); - if (ChunkOffset == NULL) - { - printf("%s: ERROR - unable to create Chunk offset list need %u bytes\n", __FUNCTION__, EntryCount * sizeof(unsigned long long int)); - return -PlayerError; - } - else - { - myfread(context, ChunkOffset, sizeof(unsigned long long int), EntryCount, Mp4File); - Mp4Info->Track[TrackSelect].Chunk = (Mp4Chunk_t *)malloc(sizeof(Mp4Chunk_t) * EntryCount); - if (Mp4Info->Track[TrackSelect].Chunk == NULL) - { - printf("%s: ERROR - unable to create Chunk list - need %u bytes\n", __FUNCTION__, sizeof(Mp4Chunk_t) * EntryCount); - return -PlayerError; - } - else - { - Mp4Info->Track[TrackSelect].ChunkCount = EntryCount; - for (i = 0; i < EntryCount; i++) - Mp4Info->Track[TrackSelect].Chunk[i].Offset = BE2ME64(ChunkOffset[i]); - } - free(ChunkOffset); - } - break; - } - /*}}} */ - case CodeToInteger('s', 't', 's', 'c'): - /*{{{ */ - { - if (myfseeko(context, &Mp4File, sizeof(unsigned int), SEEK_CUR) < 0) /* skip version no */ - { - printf("seek13 failed\n"); - goto StartMp4_error; - } - - myfread(context, &EntryCount, sizeof(unsigned int), 1, Mp4File); - EntryCount = BE2ME(EntryCount); - - Mp4Info->Track[TrackSelect].ChunkMap = (Mp4ChunkMap_t *)malloc(sizeof(Mp4ChunkMap_t) * EntryCount); - if (Mp4Info->Track[TrackSelect].ChunkMap == NULL) - { - printf("%s: ERROR - unable to create Chunk map - need %d bytes\n", __FUNCTION__, sizeof(Mp4ChunkMap_t) * EntryCount); - return -PlayerNoMemory; - } - else - { - myfread(context, Mp4Info->Track[TrackSelect].ChunkMap, sizeof(Mp4ChunkMap_t), EntryCount, Mp4File); - Mp4Info->Track[TrackSelect].ChunkMapCount = EntryCount; - - for (i = 0; i < EntryCount; i++) - { - Mp4Info->Track[TrackSelect].ChunkMap[i].FirstChunk = BE2ME(Mp4Info->Track[TrackSelect].ChunkMap[i].FirstChunk) - 1; - Mp4Info->Track[TrackSelect].ChunkMap[i].SamplesPerChunk = BE2ME(Mp4Info->Track[TrackSelect].ChunkMap[i].SamplesPerChunk); - Mp4Info->Track[TrackSelect].ChunkMap[i].SampleDescriptionIndex = BE2ME(Mp4Info->Track[TrackSelect].ChunkMap[i].SampleDescriptionIndex); - } - } - break; - } - /*}}} */ - case CodeToInteger('s', 't', 's', 'z'): - /*{{{ */ - { - unsigned int SampleSize; - - if (myfseeko(context, &Mp4File, sizeof(unsigned int), SEEK_CUR) < 0) /* skip version no */ - { - printf("seek14 failed\n"); - goto StartMp4_error; - } - - myfread(context, &SampleSize, sizeof(unsigned int), 1, Mp4File); - myfread(context, &EntryCount, sizeof(unsigned int), 1, Mp4File); - SampleSize = BE2ME(SampleSize); - EntryCount = BE2ME(EntryCount); - - Mp4Info->Track[TrackSelect].SampleSize = SampleSize; - Mp4Info->Track[TrackSelect].SampleCount = EntryCount; - - if (SampleSize == 0) - { - unsigned int *SampleSizeList = malloc(EntryCount * sizeof(unsigned int)); - if (SampleSizeList == NULL) - { - printf("%s: ERROR - unable to create Sample size list - need %d bytes\n", __FUNCTION__, EntryCount * sizeof(unsigned int)); - return -PlayerNoMemory; - } - else - { - Mp4Info->Track[TrackSelect].Samples = (Mp4Sample_t *)calloc(EntryCount, sizeof(Mp4Sample_t)); - if (Mp4Info->Track[TrackSelect].Samples == NULL) - { - printf("%s: ERROR - unable to create Samples list - need %d bytes\n", __FUNCTION__, EntryCount * sizeof(Mp4Sample_t)); - return -PlayerNoMemory; - } - else - { - myfread(context, SampleSizeList, sizeof(unsigned int), EntryCount, Mp4File); - for (i = 0; i < EntryCount; i++) - Mp4Info->Track[TrackSelect].Samples[i].Length = BE2ME(SampleSizeList[i]); - - } - free(SampleSizeList); - } - } - break; - } - /*}}} */ - case CodeToInteger('s', 't', 's', 'd'): - /*{{{ */ - { - /* This contains the Sequence Parameters and Picture Parameters */ - if (myfseeko(context, &Mp4File, sizeof(unsigned int), SEEK_CUR) < 0) /* skip blank word */ - { - printf("seek15 failed\n"); - goto StartMp4_error; - } - - myfread(context, &EntryCount, sizeof(unsigned int), 1, Mp4File); - - EntryCount = BE2ME(EntryCount); - for (i = 0; i < EntryCount; i++) - { - unsigned int EntryLength; - unsigned int RecordType; - - myfread(context, &EntryLength, sizeof(unsigned int), 1, Mp4File); - EntryLength = BE2ME(EntryLength); - if (EntryLength < (sizeof(unsigned int) * 2)) - { - printf("%s: ERROR - Sample entry too short (%d)\n", __FUNCTION__, EntryLength); - break; - } - else if (i == 0) - { - myfread(context, &RecordType, sizeof(unsigned int), 1, Mp4File); - if ((RecordType == CodeToInteger('a', 'v', 'c', '1')) && (Mp4Info->Track[TrackSelect].Type == CodeToInteger('v', 'i', 'd', 'e'))) - { - if (myfseeko(context, &Mp4File, sizeof(avc1_t), SEEK_CUR) < 0) /* skip avc1 record */ - { - printf("seek16 failed\n"); - goto StartMp4_error; - } - myfread(context, &EntryLength, sizeof(unsigned int), 1, Mp4File); - myfread(context, &RecordType, sizeof(unsigned int), 1, Mp4File); - EntryLength = BE2ME(EntryLength); - - if (RecordType == CodeToInteger('a', 'v', 'c', 'C')) - { - Mp4Info->Track[TrackSelect].SequenceDataLength = EntryLength - (sizeof(unsigned int) * 2); - Mp4Info->Track[TrackSelect].SequenceData = malloc(EntryLength - (sizeof(unsigned int) * 2)); - if (Mp4Info->Track[TrackSelect].SequenceData == NULL) - { - printf("%s: ERROR - unable to create video sequence data need %d bytes\n", __FUNCTION__, Mp4Info->Track[TrackSelect].SequenceDataLength); - return -PlayerNoMemory; - } - myfread(context, Mp4Info->Track[TrackSelect].SequenceData, 1, EntryLength - (sizeof(unsigned int) * 2), Mp4File); - //Context->Video->Encoding = VIDEO_ENCODING_H264; - Track_t Video = - { - "und", - "V_MPEG4/ISO/AVC", - TrackSelect, - }; - context->manager->video->Command(context, MANAGER_ADD, &Video); - } - } - else if ((RecordType == CodeToInteger('m', 'p', '4', 'a')) && (Mp4Info->Track[TrackSelect].Type == CodeToInteger('s', 'o', 'u', 'n'))) - { - mp4a_t Mp4aHeader; - unsigned int SampleIndex; - unsigned int TimeScale; - unsigned int Channels; - unsigned int Profile = 1; - - myfread(context, &Mp4aHeader, sizeof(mp4a_t), 1, Mp4File); - - TimeScale = (Mp4aHeader.TimeScale[0] << 24) | (Mp4aHeader.TimeScale[1] << 16) | - (Mp4aHeader.TimeScale[2] << 8) | Mp4aHeader.TimeScale[3]; - for (SampleIndex = 0; SampleIndex < SAMPLE_RATES; SampleIndex++) - if (TimeScale == AacSampleRates[SampleIndex]) - break; - if (SampleIndex == SAMPLE_RATES) - printf("%s: ERROR unrecognised sample rate %d\n", __FUNCTION__, TimeScale); - Channels = (Mp4aHeader.Channels[0] << 8) | Mp4aHeader.Channels[1]; - - DefaultAACHeader[2] = ((Profile & 0x03) << 6) | (SampleIndex << 2) | ((Channels >> 2) & 0x01); - /*DefaultAACHeader[2] = (SampleIndex << 2) | ((Channels >> 2) & 0x01);*/ - DefaultAACHeader[3] = (Channels & 0x03) << 6; - - Mp4Info->Track[TrackSelect].SequenceDataLength = sizeof(AACHeader_t); - Mp4Info->Track[TrackSelect].SequenceData = malloc(AAC_HEADER_LENGTH); - if (Mp4Info->Track[TrackSelect].SequenceData == NULL) - { - printf("%s: ERROR - unable to create audio sequence data need %d bytes\n", __FUNCTION__, AAC_HEADER_LENGTH); - return -PlayerNoMemory; - } - memcpy(Mp4Info->Track[TrackSelect].SequenceData, DefaultAACHeader, AAC_HEADER_LENGTH); - - /* - 82 /// Sign Length Position Description - 83 /// - 84 /// A 12 (31-20) Sync code - 0 0-7 - ---- - 1 0-3 - 85 /// B 1 (19) ID - 1 4 - 86 /// C 2 (18-17) layer - 1 5-6 - 87 /// D 1 (16) protect absent - 1 7 - ---- - 88 /// E 2 (15-14) profile - 2 0-1 - 89 /// F 4 (13-10) sample freq index - 2 2-5 - 90 /// G 1 (9) private - 2 6 - 91 /// H 3 (8-6) channel config - 2 7 - ---- - 3 0-1 - 92 /// I 1 (5) original/copy - 3 2 - 93 /// J 1 (4) home - 3 3 - 94 /// K 1 (3) copyright id - 3 4 - 95 /// L 1 (2) copyright start - 3 5 - 96 /// M 13 (1-0,31-21) frame length - 3 6-7 - ---- - 4 0-7 - ---- - 5 0-2 - 97 /// N 11 (20-10) adts buffer fullness - 5 3-7 - ---- - 6 0-5 - 98 /// O 2 (9-8) num of raw data blocks in frame - 6 6-7 - */ - /* - fread (&EntryLength, sizeof(unsigned int), 1, Mp4File); - fread (&RecordType, sizeof(unsigned int), 1, Mp4File); - EntryLength = BE2ME(EntryLength); - if (RecordType == CodeToInteger('e','s','d','s')) - { - fread (Mp4Info->Track[TrackSelect].SequenceData, 1, EntryLength - (sizeof(unsigned int) * 2), Mp4File); - } - */ - - Track_t Audio = - { - "und", - "A_AAC", - TrackSelect, - }; - context->manager->audio->Command(context, MANAGER_ADD, &Audio); - } - else if ((Mp4Info->Track[TrackSelect].Type == CodeToInteger('v', 'i', 'd', 'e')) || - (Mp4Info->Track[TrackSelect].Type == CodeToInteger('s', 'o', 'u', 'n'))) - { - int k; - unsigned char Buffer[128]; - myfread(context, Buffer, 1, EntryLength - 8, Mp4File); - for (k = 0; k < EntryLength - 8; k++) - { - printf("%02x ", Buffer[k]); - if (((k + 1) & 31) == 0) - printf("\n"); - } - printf("\n"); - for (k = 0; k < EntryLength - 8; k++) - { - printf("%c ", ((Buffer[k] < 32) || (Buffer[k] > 127)) ? '.' : Buffer[k]); - if (((k + 1) & 31) == 0) - printf("\n"); - } - printf("\n"); - printf("%s: Encountered '%.4s' record for '%.4s' track\n", __FUNCTION__, (char *)&RecordType, (char *)&Mp4Info->Track[TrackSelect].Type); - //Context->Video->Encoding = VIDEO_ENCODING_MPEG4P2; - Track_t Video = - { - "und", - "V_MS/VFW/FOURCC", - TrackSelect, - }; - context->manager->video->Command(context, MANAGER_ADD, &Video); - } - } - } - if (myfseeko(context, &Mp4File, BoxEnd, SEEK_SET) < 0) - { - printf("seek17 failed\n"); - goto StartMp4_error; - } - break; - } - /*}}} */ - } - - } - -#ifdef DEBUG - printf("%s::%s (%d)\n", FILENAME, __FUNCTION__, __LINE__); -#endif - - if (Mp4Info->VideoTrack != -1) - BuildTrackMap(&Mp4Info->Track[Mp4Info->VideoTrack]); - if (Mp4Info->AudioTrack != -1) - BuildTrackMap(&Mp4Info->Track[Mp4Info->AudioTrack]); - - /* free all non video/audio data */ - for (i = 0; i < TrackCount; i++) - if ((i != Mp4Info->VideoTrack) && (i != Mp4Info->AudioTrack)) - FreeTrackData(&Mp4Info->Track[i]); - - /*Context->Audio->Encoding = AUDIO_ENCODING_AAC;//MP3; - - if (Context->Video->Required) - Status = VideoIoctl (Context, VIDEO_SET_ENCODING, (void*)Context->Video->Encoding); - - if ((Status == PlayerNoError) && (Context->Audio->Required)) - Status = AudioIoctl (Context, AUDIO_SET_ENCODING, (void*)Context->Audio->Encoding); - */ -#ifdef DEBUG - printf("%s <\n", __func__); -#endif - return Status; - -StartMp4_error: -#ifdef DEBUG - printf("StartMp4_error <\n"); -#endif - stream_off = 0; - - /* free all non video/audio data */ - for (i = 0; i < TrackCount; i++) - if ((i != Mp4Info->VideoTrack) && (i != Mp4Info->AudioTrack)) - FreeTrackData(&Mp4Info->Track[i]); - - if (Mp4Info != NULL) - free(Mp4Info); - Mp4Info = NULL; - - return -PlayerError; - -} -/*}}} */ - -static void Mp4Thread(Context_t *context) -{ - -#ifdef DEBUG - printf("%s::%s>\n", FILENAME, __FUNCTION__); -#endif - - PlayH264Mp4File(context); - - context->playback->Command(context, PLAYBACK_TERM, NULL); - - /* fixme: no more data to free here? */ - stream_off = 0; - -#ifdef DEBUG - printf("%s::%s<\n", FILENAME, __FUNCTION__); -#endif -} - - -/*{{{ PlayMp4*/ -static int PlayMp4(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s>\n", FILENAME, __FUNCTION__); -#endif - if (isPlayThreadCreated == 0) - { - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - if (pthread_create(&PlayThread, &attr, (void *)&Mp4Thread, context) != 0) - { - fprintf(stderr, "Error creating thread in %s error:%d:%s\n", __FUNCTION__, errno, strerror(errno)); - isPlayThreadCreated = 0; - return -1; - } - else - isPlayThreadCreated = 1; - } -#ifdef DEBUG - printf("%s::%s<\n", FILENAME, __FUNCTION__); -#endif - return 0; -} -/*}}} */ - -/*{{{ StopMp4*/ -static void StopMp4(Context_t *context) -{ - int i; -#ifdef DEBUG - printf("%s::%s>\n", FILENAME, __FUNCTION__); -#endif - - int result = 0; - if (isPlayThreadCreated != 0) - result = pthread_join(PlayThread, NULL); - if (result != 0) - { - printf("ERROR: Stop PlayThread\n"); - } - - isPlayThreadCreated = 0; - - usleep(100000); - - if (Mp4Info != NULL) - { -#ifdef old - if (Mp4Info->AudioTrack != -1) - FreeTrackData(&Mp4Info->Track[Mp4Info->AudioTrack]); - if (Mp4Info->VideoTrack != -1) - FreeTrackData(&Mp4Info->Track[Mp4Info->VideoTrack]); -#else - /* free all non video/audio data */ - for (i = 0; i < TrackCount; i++) - if ((i != Mp4Info->VideoTrack) && (i != Mp4Info->AudioTrack)) - FreeTrackData(&Mp4Info->Track[i]); -#endif - free(Mp4Info); - Mp4Info = NULL; - } - - stream_off = 0; - -#ifdef DEBUG - printf("%s::%s<\n", FILENAME, __FUNCTION__); -#endif -} -/*}}} */ -/*{{{ SeekMp4*/ -static PlayerStatus_t SeekMp4(Context_t *context, bool Forward) -{ - char *Encoding = NULL; - -#ifdef DEBUG - printf("%s::%s>\n", FILENAME, __FUNCTION__); -#endif - - context->manager->video->Command(context, MANAGER_GETENCODING, &Encoding); - - //if(!strcmp (Encoding, "V_MPEG4/ISO/AVC")) - // return SeekH264Mp4 (context, Forward ? 30000 : -30000); - free(Encoding); - printf("%s: Mp4 file skip not yest implemented.\n", __FUNCTION__); - -#ifdef DEBUG - printf("%s::%s<\n", FILENAME, __FUNCTION__); -#endif - return PlayerNoError; -} -/*}}} */ - -void seek_mp4(Context_t *Context, float rel_seek_secs, float audio_delay, int flags) -{ - Mp4Track_t *VideoTrack = NULL; - unsigned long long targetPts = 0ull; - unsigned long long VideoPts = 0ull; - unsigned int SampleSize = 0; - int VideoChunk = 0; - int VideoSample = 0; - - Mp4Track_t *AudioTrack = NULL; - //Context_t* Context = (Context_t*)ThreadParam; - // make shure the playthread has enuogh time to go in pause mode - // TODO: use a mutex - - pthread_mutex_lock(&mutex); - unsigned long long AudioPts = 0ull; - int AudioChunk = 0; - int AudioSample = 0; - -#ifdef DEBUG - printf("%s::%s>\n", FILENAME, __FUNCTION__); - printf("SeekMP4: %f sec\n", rel_seek_secs); -#endif - - if (Mp4Info->VideoTrack != -1) - { - VideoTrack = &Mp4Info->Track[Mp4Info->VideoTrack]; - printf("SeekMP4: pos: %d \n", VideoTrack->Samples[VideoTrack->SampleToPlay].Pts); - - printf("SamplesToPlay ->%d max %d\n", VideoTrack->SampleToPlay, VideoTrack->SampleCount); - - targetPts = VideoTrack->Samples[VideoTrack->SampleToPlay].Pts + (rel_seek_secs * 90000); - - printf("SeekMP4: target: %d \n", (int) targetPts); - - VideoTrack->ChunkToPlay = 0; - VideoTrack->SampleToPlay = 0; - VideoChunk = 1; /* Force to be different from ChunkToPlay so reload pts */ - VideoTrack->Pts = 0ull; - } - - if ((Mp4Info->AudioTrack != -1) && (AudioTrack == NULL)) - { - // printf ("%s: Initialising AudioTrack\n", __FUNCTION__); - AudioTrack = &Mp4Info->Track[Mp4Info->AudioTrack]; - AudioTrack->ChunkToPlay = 0; - AudioTrack->SampleToPlay = 0; - AudioChunk = 1; /* Force to be different from ChunkToPlay so reload pts */ - //AudioTrack->Pts = FindHeader (Context); - } - - VideoChunk = VideoTrack->ChunkToPlay; - AudioChunk = AudioTrack->ChunkToPlay; - - if (Context->playback->isVideo) - { - while (VideoPts < targetPts) - if (VideoChunk < VideoTrack->ChunkCount) - { - for (VideoSample = VideoTrack->SampleToPlay; VideoSample < (VideoTrack->Chunk[VideoChunk].FirstSample + VideoTrack->Chunk[VideoChunk].SampleCount); VideoSample++) - { - SampleSize = VideoTrack->Samples[VideoSample].Length; - VideoPts = VideoTrack->Samples[VideoSample].Pts; - } - VideoTrack->SampleToPlay = VideoSample; - VideoChunk++; - VideoTrack->ChunkToPlay = VideoChunk; - } - else - break; - - printf("videoPTS: %d ", (int) VideoPts); - printf("chunk:%d ", VideoChunk); - printf("sample:%d\n", VideoSample); - } - if (Context->playback->isAudio) - { - while (AudioPts < targetPts) - if (AudioChunk < AudioTrack->ChunkCount) - { - for (AudioSample = AudioTrack->SampleToPlay; AudioSample < (AudioTrack->Chunk[AudioChunk].FirstSample + AudioTrack->Chunk[AudioChunk].SampleCount); AudioSample++) - { - SampleSize = AudioTrack->Samples[AudioSample].Length; - AudioPts = AudioTrack->Samples[AudioSample].Pts; - } - AudioTrack->SampleToPlay = AudioSample; - AudioChunk++; - AudioTrack->ChunkToPlay = AudioChunk; - } - else break; - printf("audioPTS: %d ", (int) AudioPts); - printf("chunk:%d ", AudioChunk); - printf("sample:%d\n", AudioSample); - } - pthread_mutex_unlock(&mutex); -#ifdef DEBUG - printf("%s::%s<\n", FILENAME, __FUNCTION__); -#endif -} - -static double Mp4GetLength() -{ - -#ifdef DEBUG - printf("%s::%s<>\n", FILENAME, __FUNCTION__); -#endif - if (Mp4Info->VideoTrack != -1) - return Mp4Info->Track[Mp4Info->VideoTrack].Duration / Mp4Info->Track[Mp4Info->VideoTrack].TimeScale; - else if (Mp4Info->AudioTrack != -1) - return Mp4Info->Track[Mp4Info->AudioTrack].Duration / Mp4Info->Track[Mp4Info->AudioTrack].TimeScale; - return 0; -} - -static int Command(void *_context, ContainerCmd_t command, void *argument) -{ - Context_t *context = (Context_t *) _context; - -#ifdef DEBUG - printf("%s::%s>\n", FILENAME, __FUNCTION__); -#endif - - switch (command) - { - case CONTAINER_INIT: - { - //char * FILENAME = (char *)argument; - return StartMp4(context); - break; - } - case CONTAINER_PLAY: - { - return PlayMp4(context); - break; - } - case CONTAINER_STOP: - { - StopMp4(context); - break; - } - case CONTAINER_SEEK: - { - seek_mp4(context, (float) * ((float *)argument), 0.0, 0); - break; - } - case CONTAINER_LENGTH: - { - double length = Mp4GetLength(); - *((double *)argument) = (double)length; - break; - } - default: - printf("ConatinerCmd not supported!"); - break; - } - -#ifdef DEBUG - printf("%s::%s<\n", FILENAME, __FUNCTION__); -#endif - return 0; -} - -static char *Mp4Capabilities[] = { "mp4", "mp4a", NULL }; - -Container_t Mp4Container = -{ - "MP4", - &Command, - Mp4Capabilities, - -}; diff --git a/libeplayer2/container/mp4.h b/libeplayer2/container/mp4.h deleted file mode 100644 index 2b2c9e0..0000000 --- a/libeplayer2/container/mp4.h +++ /dev/null @@ -1,294 +0,0 @@ -#ifndef MP4_H_ -#define MP4_H_ - -#include /* -#include -#include -#include -#include -#include -#include -#include -#include -#include */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef __cplusplus -#ifndef bool -#define bool unsigned char -#define false 0 -#define true 1 -#endif -#endif - - -#define DEBUG_LEVEL 0 -#define dprintf(x, fmt, args...) if (DEBUG_LEVEL) printf(fmt, ## args) - -#define PlayerStatus_t int -#define PlayerNoError 0 -#define PlayerError 1 -#define PlayerNoMemory 2 - -#define CodeToInteger(a,b,c,d) ((a << 0) | (b << 8) | (c << 16) | (d <<24)) - - -/*{{{ defines*/ -#define BE2ME16(x) (((x & 0x00ff) << 8) | (x >> 8)) -#define BE2ME(x) (((x & 0xff) << 24) | ((x & 0xff00) << 8) | ((x >> 8) & 0xff00) | ((x>>24) & 0xff)) -#define BE2ME64(x) ( ((unsigned long long)(x & 0xff) << 56) | \ - ((unsigned long long)(x & 0xff00) << 40) | \ - ((unsigned long long)(x & 0xff0000) << 24) | \ - ((unsigned long long)(x & 0xff000000) << 8) | \ - ((unsigned long long)(x & 0xff00000000ULL) >> 8) | \ - ((unsigned long long)(x & 0xff0000000000ULL) >> 24) | \ - ((unsigned long long)(x & 0xff000000000000ULL) >> 40) | \ - ((unsigned long long)(x & 0xff00000000000000ULL) >> 56) ) - - -#define MP4_KEY_FRAME 0x01 - -/*}}} */ -/*{{{ typedefs*/ -typedef struct Mp4Chunk_s -{ - unsigned int FirstSample; - unsigned int SampleCount; - unsigned int Description; - off_t Offset; -} Mp4Chunk_t; - -typedef struct Mp4ChunkMap_s -{ - unsigned int FirstChunk; - unsigned int SamplesPerChunk; - unsigned int SampleDescriptionIndex; -} Mp4ChunkMap_t; - -typedef struct Mp4TimeToSample_s -{ - unsigned int Count; - unsigned int Delta; -} Mp4TimeToSample_t; - -typedef struct Mp4CompositionOffset_s -{ - unsigned int Count; - unsigned int Offset; -} Mp4CompositionOffset_t; - -typedef struct Mp4Sample_s -{ - unsigned int Pts; - unsigned int Flags; - unsigned int Length; - off_t Offset; -} Mp4Sample_t; - -typedef struct Mp4Track_s -{ - unsigned int Type; - - unsigned int SampleSize; - unsigned int TimeScale; - unsigned long long Duration; - int width, height; - - unsigned int SampleCount; - Mp4Sample_t *Samples; - bool DecodingTimeValues; - - unsigned int ChunkCount; - Mp4Chunk_t *Chunk; - unsigned int ChunkToPlay; - unsigned int SampleToPlay; - unsigned long long Pts; - - unsigned int SequenceDataLength; - unsigned char *SequenceData; - - /* Items read from file then discarded before play */ - unsigned int ChunkMapCount; - Mp4ChunkMap_t *ChunkMap; - unsigned int DecodingTimeCount; - Mp4TimeToSample_t *DecodingTime; - unsigned int CompositionTimeCount; - Mp4CompositionOffset_t *CompositionTime; - unsigned int KeyFrameTableCount; - unsigned int *KeyFrameTable; - - unsigned int TimeDelta; // Added by nick extracted from the data above that is discarded -} Mp4Track_t; - -typedef struct Mp4Info_s -{ - Mp4Track_t Track[10]; - unsigned int VideoTrack; - unsigned int AudioTrack; -} Mp4Info_t; - -typedef enum Container_e -{ - File = CodeToInteger('f', 'i', 'l', 'e'), - MovieBox = CodeToInteger('m', 'o', 'o', 'v'), - TrackBox = CodeToInteger('t', 'r', 'a', 'k'), - MediaBox = CodeToInteger('m', 'd', 'i', 'a'), - MediaInformationBox = CodeToInteger('m', 'i', 'n', 'f'), - SampleTableBox = CodeToInteger('s', 't', 'b', 'l'), -} Mp4Container_t; - -typedef struct Code_s -{ - unsigned int Code; - Mp4Container_t Parent; - Mp4Container_t Next; - bool Skip; -} Code_t; - -typedef struct avc1_s -{ - unsigned char Reserved1[6]; - unsigned char RefenceIndex[2]; /* BE short dataReferenceIndex */ - unsigned char Reserved2[16]; - unsigned char Width[2]; /* BE short Width */ - unsigned char Height[2]; /* BE short Height */ - unsigned char Reserved3[14]; - unsigned char CompressorName[32]; /* Should contain coding name */ - unsigned char Reserved4[4]; -} avc1_t; - -typedef avc1_t mp4v_t; - -typedef struct avcC_s -{ - unsigned char Version; /* configurationVersion */ - unsigned char Profile; /* AVCProfileIndication */ - unsigned char Compatibility; /* profile_compatibility */ - unsigned char Level; /* AVCLevelIndication */ - unsigned char NalLengthMinusOne; /* held in bottom two bits */ - unsigned char NumParamSets; /* held in bottom 5 bits */ - unsigned char Params[1]; /* {length,params}{length,params}...sequence then picture*/ -} avcC_t; - - -typedef struct mp4a_s -{ - unsigned char Reserved1[6]; - unsigned char RefenceIndex[2]; /* BE short dataReferenceIndex */ - unsigned char Version[2]; /* BE short soundVersion */ - unsigned char Reserved2[6]; - unsigned char Channels[2]; /* BE short channels */ - unsigned char SampleSize[2]; /* BE short sampleSize */ - unsigned char PacketSize[2]; /* BE short packetSize */ - unsigned char TimeScale[4]; /* BE long timeScale */ - unsigned char Reserved3[2]; -} mp4a_t; - - -#define MP4ESDescrTag 0x03 -typedef struct esds_s -{ - unsigned char Version; /* configurationVersion */ - unsigned char Flags[3]; /* flags */ - unsigned char Tag; /* Descriptor tag */ - unsigned char Length; /* Descriptor length */ - unsigned char Descriptor[1]; /* rest of descriptor */ -} esds_t; - - -#define AAC_HEADER_LENGTH 7 -typedef struct AACHeader_s -{ - unsigned char Data[AAC_HEADER_LENGTH]; -} AACHeader_t; -/*}}} */ -/*{{{ statics*/ -#define RECOGNISED_CODES 29 -static const Code_t CodeTable[RECOGNISED_CODES] = -{ - { CodeToInteger('f', 't', 'y', 'p'), File, File, true}, - { CodeToInteger('m', 'd', 'a', 't'), File, File, true}, - { CodeToInteger('f', 'r', 'e', 'e'), File, File, true}, - { CodeToInteger('s', 'k', 'i', 'p'), File, File, true}, - { CodeToInteger('j', 'u', 'n', 'k'), File, File, true}, - { CodeToInteger('m', 'o', 'o', 'v'), File, MovieBox, false}, - { CodeToInteger('m', 'v', 'h', 'd'), MovieBox, MovieBox, true}, - { CodeToInteger('t', 'r', 'a', 'k'), MovieBox, TrackBox, false}, - { CodeToInteger('t', 'k', 'h', 'd'), TrackBox, TrackBox, true}, - { CodeToInteger('e', 'd', 't', 's'), TrackBox, TrackBox, true}, - { CodeToInteger('m', 'd', 'i', 'a'), TrackBox, MediaBox, false}, - { CodeToInteger('m', 'd', 'h', 'd'), MediaBox, MediaBox, false}, - { CodeToInteger('h', 'd', 'l', 'r'), MediaBox, MediaBox, false}, - { CodeToInteger('m', 'i', 'n', 'f'), MediaBox, MediaInformationBox, false}, - { CodeToInteger('v', 'm', 'h', 'd'), MediaInformationBox, MediaInformationBox, true}, - { CodeToInteger('s', 'm', 'h', 'd'), MediaInformationBox, MediaInformationBox, true}, - { CodeToInteger('h', 'm', 'h', 'd'), MediaInformationBox, MediaInformationBox, true}, - { CodeToInteger('n', 'm', 'h', 'd'), MediaInformationBox, MediaInformationBox, true}, - { CodeToInteger('d', 'i', 'n', 'f'), MediaInformationBox, MediaInformationBox, true}, - { CodeToInteger('s', 't', 'b', 'l'), MediaInformationBox, SampleTableBox, false}, - { CodeToInteger('s', 't', 's', 's'), SampleTableBox, SampleTableBox, false}, - { CodeToInteger('s', 't', 't', 's'), SampleTableBox, SampleTableBox, false}, - { CodeToInteger('s', 't', 'c', 'o'), SampleTableBox, SampleTableBox, false}, - { CodeToInteger('c', 'o', '6', '4'), SampleTableBox, SampleTableBox, false}, - { CodeToInteger('s', 't', 's', 'c'), SampleTableBox, SampleTableBox, false}, - { CodeToInteger('s', 't', 's', 'z'), SampleTableBox, SampleTableBox, false}, - { CodeToInteger('s', 't', 's', 'd'), SampleTableBox, SampleTableBox, false}, - { CodeToInteger('c', 't', 't', 's'), SampleTableBox, SampleTableBox, false}, - { CodeToInteger('u', 'd', 't', 'a'), SampleTableBox, SampleTableBox, true}, -}; - -#define SAMPLE_RATES 16 -static const int AacSampleRates[SAMPLE_RATES] = -{ - 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, - 16000, 12000, 11025, 8000, 7350, 0, 0, 0 -}; - -static unsigned char DefaultAACHeader[] = { 0xff, 0xf1, 0x00, 0x00, 0x00, 0x1f, 0xfc }; -/* -0xffffff 12 bits Sync word -IsMpeg2 1 Mpeg2? -0x00 2 Layer -0x01 1 Protection absent -Profile 2 Profile -Frequency 4 Sampling Frequency -0x00 1 Private -Channels 3 Channel configuration -0x00 1 Original -0x00 1 Home -0x00 1 Copyright Id -0x00 1 Copyright Id start -DataLength 13 AAC Frame Length -0x7FF 11 ADTS buffer fullness -DataBlocks 2 No. raw data blocks -*/ - -/* -82 /// Sign Length Position Description -83 /// -84 /// A 12 (31-20) Sync code -85 /// B 1 (19) ID -86 /// C 2 (18-17) layer -87 /// D 1 (16) protect absent -88 /// E 2 (15-14) profile -89 /// F 4 (13-10) sample freq index -90 /// G 1 (9) private -91 /// H 3 (8-6) channel config -92 /// I 1 (5) original/copy -93 /// J 1 (4) home -94 /// K 1 (3) copyright id -95 /// L 1 (2) copyright start -96 /// M 13 (1-0,31-21) frame length -97 /// N 11 (20-10) adts buffer fullness -98 /// O 2 (9-8) num of raw data blocks in frame -*/ - -/*}}} */ - -static bool CheckCode(unsigned int Code, Mp4Container_t *Container); - - -#endif diff --git a/libeplayer2/container/mp_msg.c b/libeplayer2/container/mp_msg.c deleted file mode 100644 index 0cbe08e..0000000 --- a/libeplayer2/container/mp_msg.c +++ /dev/null @@ -1,268 +0,0 @@ -/* - * This file is part of MPlayer. - * - * MPlayer is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * MPlayer is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with MPlayer; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include -#include -#include -#include - -#ifndef __sh__ -#include "config.h" -#endif - -#ifdef CONFIG_ICONV -#include -#include -/** - * \brief gets the name of the system's terminal character set - * \return a malloced string indicating the system charset - * - * Be warned that this function on many systems is in no way thread-safe - * since it modifies global data - */ -char *get_term_charset(void); -#endif - -#ifndef __sh__ -#if defined(FOR_MENCODER) -#undef CONFIG_GUI -int use_gui; -#else -#include "gui/interface.h" -#endif -#endif - -#include "mp_msg.h" - -/* maximum message length of mp_msg */ -#define MSGSIZE_MAX 3072 - -int mp_msg_levels[MSGT_MAX]; // verbose level of this module. initialized to -2 -int mp_msg_level_all = MSGL_STATUS; -int verbose = 0; -int mp_msg_color = 0; -int mp_msg_module = 0; -#ifdef CONFIG_ICONV -char *mp_msg_charset = NULL; -static char *old_charset = NULL; -static iconv_t msgiconv; -#endif - -const char *filename_recode(const char *filename) -{ -#if !defined(CONFIG_ICONV) || !defined(MSG_CHARSET) - return filename; -#else - static iconv_t inv_msgiconv = (iconv_t)(-1); - static char recoded_filename[MSGSIZE_MAX]; - size_t filename_len, max_path; - char *precoded; - if (!mp_msg_charset || - !strcasecmp(mp_msg_charset, MSG_CHARSET) || - !strcasecmp(mp_msg_charset, "noconv")) - return filename; - if (inv_msgiconv == (iconv_t)(-1)) - { - inv_msgiconv = iconv_open(MSG_CHARSET, mp_msg_charset); - if (inv_msgiconv == (iconv_t)(-1)) - return filename; - } - filename_len = strlen(filename); - max_path = MSGSIZE_MAX - 4; - precoded = recoded_filename; - if (iconv(inv_msgiconv, &filename, &filename_len, - &precoded, &max_path) == (size_t)(-1) && errno == E2BIG) - { - precoded[0] = precoded[1] = precoded[2] = '.'; - precoded += 3; - } - *precoded = '\0'; - return recoded_filename; -#endif -} - -void mp_msg_init(void) -{ - int i; - char *env = getenv("MPLAYER_VERBOSE"); - if (env) - verbose = atoi(env); - for (i = 0; i < MSGT_MAX; i++) mp_msg_levels[i] = -2; - mp_msg_levels[MSGT_IDENTIFY] = -1; // no -identify output by default -#ifdef CONFIG_ICONV - mp_msg_charset = getenv("MPLAYER_CHARSET"); - if (!mp_msg_charset) - mp_msg_charset = get_term_charset(); -#endif -} - -int mp_msg_test(int mod, int lev) -{ - return lev <= (mp_msg_levels[mod] == -2 ? mp_msg_level_all + verbose : mp_msg_levels[mod]); -} - -static void set_msg_color(FILE *stream, int lev) -{ - static const unsigned char v_colors[10] = {9, 1, 3, 15, 7, 2, 2, 8, 8, 8}; - int c = v_colors[lev]; -#ifdef MP_ANNOY_ME - /* that's only a silly color test */ - { - int c; - static int flag = 1; - if (flag) - for (c = 0; c < 24; c++) - printf("\033[%d;3%dm*** COLOR TEST %d ***\n", c > 7, c & 7, c); - flag = 0; - } -#endif - if (mp_msg_color) - fprintf(stream, "\033[%d;3%dm", c >> 3, c & 7); -} - -static void print_msg_module(FILE *stream, int mod) -{ - static const char *module_text[MSGT_MAX] = - { - "GLOBAL", - "CPLAYER", - "GPLAYER", - "VIDEOOUT", - "AUDIOOUT", - "DEMUXER", - "DS", - "DEMUX", - "HEADER", - "AVSYNC", - "AUTOQ", - "CFGPARSER", - "DECAUDIO", - "DECVIDEO", - "SEEK", - "WIN32", - "OPEN", - "DVD", - "PARSEES", - "LIRC", - "STREAM", - "CACHE", - "MENCODER", - "XACODEC", - "TV", - "OSDEP", - "SPUDEC", - "PLAYTREE", - "INPUT", - "VFILTER", - "OSD", - "NETWORK", - "CPUDETECT", - "CODECCFG", - "SWS", - "VOBSUB", - "SUBREADER", - "AFILTER", - "NETST", - "MUXER", - "OSDMENU", - "IDENTIFY", - "RADIO", - "ASS", - "LOADER", - "STATUSLINE", - }; - int c2 = (mod + 1) % 15 + 1; - - if (!mp_msg_module) - return; - if (mp_msg_color) - fprintf(stream, "\033[%d;3%dm", c2 >> 3, c2 & 7); - fprintf(stream, "%9s", module_text[mod]); - if (mp_msg_color) - fprintf(stream, "\033[0;37m"); - fprintf(stream, ": "); -} - -void mp_msg(int mod, int lev, const char *format, ...) -{ - va_list va; - char tmp[MSGSIZE_MAX]; - FILE *stream = lev <= MSGL_WARN ? stderr : stdout; - static int header = 1; - -#ifndef __sh__ - if (!mp_msg_test(mod, lev)) return; // do not display -#endif - va_start(va, format); - vsnprintf(tmp, MSGSIZE_MAX, format, va); - va_end(va); - tmp[MSGSIZE_MAX - 2] = '\n'; - tmp[MSGSIZE_MAX - 1] = 0; - -#ifdef CONFIG_GUI - if (use_gui) - guiMessageBox(lev, tmp); -#endif - -#if defined(CONFIG_ICONV) && defined(MSG_CHARSET) - if (mp_msg_charset && strcasecmp(mp_msg_charset, "noconv")) - { - char tmp2[MSGSIZE_MAX]; - size_t inlen = strlen(tmp), outlen = MSGSIZE_MAX; - char *in = tmp, *out = tmp2; - if (!old_charset || strcmp(old_charset, mp_msg_charset)) - { - if (old_charset) - { - free(old_charset); - iconv_close(msgiconv); - } - msgiconv = iconv_open(mp_msg_charset, MSG_CHARSET); - old_charset = strdup(mp_msg_charset); - } - if (msgiconv == (iconv_t)(-1)) - { - fprintf(stderr, "iconv: conversion from %s to %s unsupported\n" - , MSG_CHARSET, mp_msg_charset); - } - else - { - memset(tmp2, 0, MSGSIZE_MAX); - while (iconv(msgiconv, &in, &inlen, &out, &outlen) == -1) - { - if (!inlen || !outlen) - break; - *out++ = *in++; - outlen--; - inlen--; - } - strncpy(tmp, tmp2, MSGSIZE_MAX); - tmp[MSGSIZE_MAX - 1] = 0; - tmp[MSGSIZE_MAX - 2] = '\n'; - } - } -#endif - - if (header) - print_msg_module(stream, mod); - set_msg_color(stream, lev); - header = tmp[strlen(tmp) - 1] == '\n' || tmp[strlen(tmp) - 1] == '\r'; - - fprintf(stream, "%s", tmp); - fflush(stream); -} diff --git a/libeplayer2/container/mp_msg.h b/libeplayer2/container/mp_msg.h deleted file mode 100644 index 4e973d8..0000000 --- a/libeplayer2/container/mp_msg.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - * This file is part of MPlayer. - * - * MPlayer is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * MPlayer is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with MPlayer; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef MPLAYER_MP_MSG_H -#define MPLAYER_MP_MSG_H - -// defined in mplayer.c and mencoder.c -extern int verbose; - -// verbosity elevel: - -/* Only messages level MSGL_FATAL-MSGL_STATUS should be translated, - * messages level MSGL_V and above should not be translated. */ - -#define MSGL_FATAL 0 // will exit/abort -#define MSGL_ERR 1 // continues -#define MSGL_WARN 2 // only warning -#define MSGL_HINT 3 // short help message -#define MSGL_INFO 4 // -quiet -#define MSGL_STATUS 5 // v=0 -#define MSGL_V 6 // v=1 -#define MSGL_DBG2 7 // v=2 -#define MSGL_DBG3 8 // v=3 -#define MSGL_DBG4 9 // v=4 -#define MSGL_DBG5 10 // v=5 - -#define MSGL_FIXME 1 // for conversions from printf where the appropriate MSGL is not known; set equal to ERR for obtrusiveness -#define MSGT_FIXME 0 // for conversions from printf where the appropriate MSGT is not known; set equal to GLOBAL for obtrusiveness - -// code/module: - -#define MSGT_GLOBAL 0 // common player stuff errors -#define MSGT_CPLAYER 1 // console player (mplayer.c) -#define MSGT_GPLAYER 2 // gui player - -#define MSGT_VO 3 // libvo -#define MSGT_AO 4 // libao - -#define MSGT_DEMUXER 5 // demuxer.c (general stuff) -#define MSGT_DS 6 // demux stream (add/read packet etc) -#define MSGT_DEMUX 7 // fileformat-specific stuff (demux_*.c) -#define MSGT_HEADER 8 // fileformat-specific header (*header.c) - -#define MSGT_AVSYNC 9 // mplayer.c timer stuff -#define MSGT_AUTOQ 10 // mplayer.c auto-quality stuff - -#define MSGT_CFGPARSER 11 // cfgparser.c - -#define MSGT_DECAUDIO 12 // av decoder -#define MSGT_DECVIDEO 13 - -#define MSGT_SEEK 14 // seeking code -#define MSGT_WIN32 15 // win32 dll stuff -#define MSGT_OPEN 16 // open.c (stream opening) -#define MSGT_DVD 17 // open.c (DVD init/read/seek) - -#define MSGT_PARSEES 18 // parse_es.c (mpeg stream parser) -#define MSGT_LIRC 19 // lirc_mp.c and input lirc driver - -#define MSGT_STREAM 20 // stream.c -#define MSGT_CACHE 21 // cache2.c - -#define MSGT_MENCODER 22 - -#define MSGT_XACODEC 23 // XAnim codecs - -#define MSGT_TV 24 // TV input subsystem - -#define MSGT_OSDEP 25 // OS-dependent parts - -#define MSGT_SPUDEC 26 // spudec.c - -#define MSGT_PLAYTREE 27 // Playtree handeling (playtree.c, playtreeparser.c) - -#define MSGT_INPUT 28 - -#define MSGT_VFILTER 29 - -#define MSGT_OSD 30 - -#define MSGT_NETWORK 31 - -#define MSGT_CPUDETECT 32 - -#define MSGT_CODECCFG 33 - -#define MSGT_SWS 34 - -#define MSGT_VOBSUB 35 -#define MSGT_SUBREADER 36 - -#define MSGT_AFILTER 37 // Audio filter messages - -#define MSGT_NETST 38 // Netstream - -#define MSGT_MUXER 39 // muxer layer - -#define MSGT_OSD_MENU 40 - -#define MSGT_IDENTIFY 41 // -identify output - -#define MSGT_RADIO 42 - -#define MSGT_ASS 43 // libass messages - -#define MSGT_LOADER 44 // dll loader messages - -#define MSGT_STATUSLINE 45 // playback/encoding status line - -#define MSGT_TELETEXT 46 // Teletext decoder - -#define MSGT_MAX 64 - -void mp_msg_init(void); -int mp_msg_test(int mod, int lev); - -#include "config.h" - -#ifdef __GNUC__ -void mp_msg(int mod, int lev, const char *format, ...) __attribute__((format(printf, 3, 4))); -# ifdef MP_DEBUG -# define mp_dbg(mod,lev, args... ) mp_msg(mod, lev, ## args ) -# else -# define mp_dbg(mod,lev, args... ) /* only useful for developers */ -# endif -#else // not GNU C -void mp_msg(int mod, int lev, const char *format, ...); -# ifdef MP_DEBUG -# define mp_dbg(mod,lev, ... ) mp_msg(mod, lev, __VA_ARGS__) -# else -# define mp_dbg(mod,lev, ... ) /* only useful for developers */ -# endif -#endif /* __GNUC__ */ - -const char *filename_recode(const char *filename); - -#endif /* MPLAYER_MP_MSG_H */ diff --git a/libeplayer2/container/mpeg_hdr.c b/libeplayer2/container/mpeg_hdr.c deleted file mode 100644 index e351c4e..0000000 --- a/libeplayer2/container/mpeg_hdr.c +++ /dev/null @@ -1,521 +0,0 @@ - -// based on libmpeg2/header.c by Aaron Holtzman - -#include -#include -#include -#include - -//#include "../config.h" -#include "mpeg_hdr.h" - -int mpeg_hdr_debug = 1; -#define mpeg_hdr_printf(x...) do { if (mpeg_hdr_debug)printf(x); } while (0) - -static float frameratecode2framerate[16] = -{ - 0, - // Official mpeg1/2 framerates: (1-8) - 24000.0 / 1001, 24, 25, - 30000.0 / 1001, 30, 50, - 60000.0 / 1001, 60, - // Xing's 15fps: (9) - 15, - // libmpeg3's "Unofficial economy rates": (10-13) - 5, 10, 12, 15, - // some invalid ones: (14-15) - 0, 0 -}; - - -int mp_header_process_sequence_header(mp_mpeg_header_t *picture, const unsigned char *buffer) -{ - int width, height; - - if ((buffer[6] & 0x20) != 0x20) - { - fprintf(stderr, "missing marker bit!\n"); - return 1; /* missing marker_bit */ - } - - height = (buffer[0] << 16) | (buffer[1] << 8) | buffer[2]; - - picture->display_picture_width = (height >> 12); - picture->display_picture_height = (height & 0xfff); - - width = ((height >> 12) + 15) & ~15; - height = ((height & 0xfff) + 15) & ~15; - - picture->aspect_ratio_information = buffer[3] >> 4; - picture->frame_rate_code = buffer[3] & 15; - picture->fps = frameratecode2framerate[picture->frame_rate_code]; - picture->bitrate = (buffer[4] << 10) | (buffer[5] << 2) | (buffer[6] >> 6); - picture->mpeg1 = 1; - picture->picture_structure = 3; //FRAME_PICTURE; - picture->display_time = 100; - return 0; -} - -static int header_process_sequence_extension(mp_mpeg_header_t *picture, - unsigned char *buffer) -{ - /* check chroma format, size extensions, marker bit */ - - if (((buffer[1] & 0x06) == 0x00) || - ((buffer[1] & 0x01) != 0x00) || (buffer[2] & 0xe0) || - ((buffer[3] & 0x01) != 0x01)) - return 1; - - picture->progressive_sequence = (buffer[1] >> 3) & 1; - picture->mpeg1 = 0; - return 0; -} - -static int header_process_picture_coding_extension(mp_mpeg_header_t *picture, unsigned char *buffer) -{ - picture->picture_structure = buffer[2] & 3; - picture->top_field_first = buffer[3] >> 7; - picture->repeat_first_field = (buffer[3] >> 1) & 1; - picture->progressive_frame = buffer[4] >> 7; - - // repeat_first implementation by A'rpi/ESP-team, based on libmpeg3: - picture->display_time = 100; - if (picture->repeat_first_field) - { - if (picture->progressive_sequence) - { - if (picture->top_field_first) - picture->display_time += 200; - else - picture->display_time += 100; - } - else if (picture->progressive_frame) - { - picture->display_time += 50; - } - } - //temopral hack. We calc time on every field, so if we have 2 fields - // interlaced we'll end with double time for 1 frame - if (picture->picture_structure != 3) picture->display_time /= 2; - return 0; -} - -int mp_header_process_extension(mp_mpeg_header_t *picture, unsigned char *buffer) -{ - switch (buffer[0] & 0xf0) - { - case 0x10: /* sequence extension */ - return header_process_sequence_extension(picture, buffer); - case 0x80: /* picture coding extension */ - return header_process_picture_coding_extension(picture, buffer); - } - return 0; -} - -float mpeg12_aspect_info(mp_mpeg_header_t *picture) -{ - float aspect = 0.0; - - switch (picture->aspect_ratio_information) - { - case 2: // PAL/NTSC SVCD/DVD 4:3 - case 8: // PAL VCD 4:3 - case 12: // NTSC VCD 4:3 - aspect = 4.0 / 3.0; - break; - case 3: // PAL/NTSC Widescreen SVCD/DVD 16:9 - case 6: // (PAL?)/NTSC Widescreen SVCD 16:9 - aspect = 16.0 / 9.0; - break; - case 4: // according to ISO-138182-2 Table 6.3 - aspect = 2.21; - break; - case 1: // VGA 1:1 - do not prescale - case 9: // Movie Type ??? / 640x480 - aspect = 0.0; - break; - default: - mpeg_hdr_printf("Detected unknown aspect_ratio_information in mpeg sequence header.\n" - "Please report the aspect value (%i) along with the movie type (VGA,PAL,NTSC," - "SECAM) and the movie resolution (720x576,352x240,480x480,...) to the EPlayer" - " developers, so that we can add support for it!\nAssuming 1:1 aspect for now.\n", - picture->aspect_ratio_information); - } - - return aspect; -} - -//MPEG4 HEADERS -unsigned char mp_getbits(unsigned char *buffer, unsigned int from, unsigned char len) -{ - unsigned int n; - unsigned char m, u, l, y; - - n = from / 8; - m = from % 8; - u = 8 - m; - l = (len > u ? len - u : 0); - - y = (buffer[n] << m); - if (8 > len) - y >>= (8 - len); - if (l) - y |= (buffer[n + 1] >> (8 - l)); - - //fprintf(stderr, "GETBITS(%d -> %d): bytes=0x%x 0x%x, n=%d, m=%d, l=%d, u=%d, Y=%d\n", - // from, (int) len, (int) buffer[n],(int) buffer[n+1], n, (int) m, (int) l, (int) u, (int) y); - return y; -} - -static inline unsigned int mp_getbits16(unsigned char *buffer, unsigned int from, unsigned char len) -{ - if (len > 8) - return (mp_getbits(buffer, from, len - 8) << 8) | mp_getbits(buffer, from + len - 8, 8); - else - return mp_getbits(buffer, from, len); -} - -#define getbits mp_getbits -#define getbits16 mp_getbits16 - -static int read_timeinc(mp_mpeg_header_t *picture, unsigned char *buffer, int n) -{ - if (picture->timeinc_bits > 8) - { - picture->timeinc_unit = getbits(buffer, n, picture->timeinc_bits - 8) << 8; - n += picture->timeinc_bits - 8; - picture->timeinc_unit |= getbits(buffer, n, 8); - n += 8; - } - else - { - picture->timeinc_unit = getbits(buffer, n, picture->timeinc_bits); - n += picture->timeinc_bits; - } - //fprintf(stderr, "TIMEINC2: %d, bits: %d\n", picture->timeinc_unit, picture->timeinc_bits); - return n; -} - -int mp4_header_process_vol(mp_mpeg_header_t *picture, unsigned char *buffer) -{ - unsigned int n, aspect = 0, aspectw = 0, aspecth = 0, x = 1, v; - - //begins with 0x0000012x - picture->fps = 0; - picture->timeinc_bits = picture->timeinc_resolution = picture->timeinc_unit = 0; - n = 9; - if (getbits(buffer, n, 1)) - n += 7; - n++; - aspect = getbits(buffer, n, 4); - n += 4; - if (aspect == 0x0f) - { - aspectw = getbits(buffer, n, 8); - n += 8; - aspecth = getbits(buffer, n, 8); - n += 8; - } - - if (getbits(buffer, n, 1)) - { - n += 4; - if (getbits(buffer, n, 1)) - n += 79; - n++; - } - else n++; - - n += 3; - - picture->timeinc_resolution = getbits(buffer, n, 8) << 8; - n += 8; - picture->timeinc_resolution |= getbits(buffer, n, 8); - n += 8; - - picture->timeinc_bits = 0; - v = picture->timeinc_resolution - 1; - while (v && (x < 16)) - { - v >>= 1; - picture->timeinc_bits++; - } - picture->timeinc_bits = (picture->timeinc_bits > 1 ? picture->timeinc_bits : 1); - - n++; //marker bit - - if (getbits(buffer, n, 1)) //fixed_vop_timeinc - { - n++; - n = read_timeinc(picture, buffer, n); - - if (picture->timeinc_unit) - picture->fps = (float) picture->timeinc_resolution / (float) picture->timeinc_unit; - } - - //fprintf(stderr, "ASPECT: %d, PARW=%d, PARH=%d, TIMEINCRESOLUTION: %d, FIXED_TIMEINC: %d (number of bits: %d), FPS: %u\n", - // aspect, aspectw, aspecth, picture->timeinc_resolution, picture->timeinc_unit, picture->timeinc_bits, picture->fps); - - return 0; -} - -void mp4_header_process_vop(mp_mpeg_header_t *picture, unsigned char *buffer) -{ - int n; - n = 0; - picture->picture_type = getbits(buffer, n, 2); - n += 2; - while (getbits(buffer, n, 1)) - n++; - n++; - getbits(buffer, n, 1); - n++; - n = read_timeinc(picture, buffer, n); -} - -#define min(a, b) ((a) <= (b) ? (a) : (b)) - -static unsigned int read_golomb(unsigned char *buffer, unsigned int *init) -{ - unsigned int x, v = 0, v2 = 0, m, len = 0, n = *init; - - while (getbits(buffer, n++, 1) == 0) - len++; - - x = len + n; - while (n < x) - { - m = min(x - n, 8); - v |= getbits(buffer, n, m); - n += m; - if (x - n > 8) - v <<= 8; - } - - v2 = 1; - for (n = 0; n < len; n++) - v2 <<= 1; - v2 = (v2 - 1) + v; - - //fprintf(stderr, "READ_GOLOMB(%u), V=2^%u + %u-1 = %u\n", *init, len, v, v2); - *init = x; - return v2; -} - - -static int h264_parse_vui(mp_mpeg_header_t *picture, unsigned char *buf, unsigned int n) -{ - unsigned int overscan, vsp_color, chroma, timing, fixed_fps; - - if (getbits(buf, n++, 1)) - { - picture->aspect_ratio_information = getbits(buf, n, 8); - n += 8; - if (picture->aspect_ratio_information == 255) - { - picture->display_picture_width = (getbits(buf, n, 8) << 8) | getbits(buf, n + 8, 8); - n += 16; - - picture->display_picture_height = (getbits(buf, n, 8) << 8) | getbits(buf, n + 8, 8); - n += 16; - } - } - - if ((overscan = getbits(buf, n++, 1))) - n++; - if ((vsp_color = getbits(buf, n++, 1))) - { - n += 4; - if (getbits(buf, n++, 1)) - n += 24; - } - if ((chroma = getbits(buf, n++, 1))) - { - read_golomb(buf, &n); - read_golomb(buf, &n); - } - if ((timing = getbits(buf, n++, 1))) - { - picture->timeinc_unit = (getbits(buf, n, 8) << 24) | (getbits(buf, n + 8, 8) << 16) | (getbits(buf, n + 16, 8) << 8) | getbits(buf, n + 24, 8); - n += 32; - - picture->timeinc_resolution = (getbits(buf, n, 8) << 24) | (getbits(buf, n + 8, 8) << 16) | (getbits(buf, n + 16, 8) << 8) | getbits(buf, n + 24, 8); - n += 32; - - fixed_fps = getbits(buf, n, 1); - - if (picture->timeinc_unit > 0 && picture->timeinc_resolution > 0) - picture->fps = (float) picture->timeinc_resolution / (float) picture->timeinc_unit; - if (fixed_fps) - picture->fps /= 2; - } - - //fprintf(stderr, "H264_PARSE_VUI, OVESCAN=%u, VSP_COLOR=%u, CHROMA=%u, TIMING=%u, DISPW=%u, DISPH=%u, TIMERES=%u, TIMEINC=%u, FIXED_FPS=%u\n", overscan, vsp_color, chroma, timing, picture->display_picture_width, picture->display_picture_height, - // picture->timeinc_resolution, picture->timeinc_unit, picture->timeinc_unit, fixed_fps); - - return n; -} - -static int mp_unescape03(unsigned char *buf, int len); - -int h264_parse_sps(mp_mpeg_header_t *picture, unsigned char *buf, int len) -{ - unsigned int n = 0, v, i, mbh; - int frame_mbs_only; - - len = mp_unescape03(buf, len); - - picture->fps = picture->timeinc_unit = picture->timeinc_resolution = 0; - n = 24; - read_golomb(buf, &n); - if (buf[0] >= 100) - { - if (read_golomb(buf, &n) == 3) - n++; - read_golomb(buf, &n); - read_golomb(buf, &n); - n++; - if (getbits(buf, n++, 1)) - { - //FIXME scaling matrix - } - } - read_golomb(buf, &n); - v = read_golomb(buf, &n); - if (v == 0) - read_golomb(buf, &n); - else if (v == 1) - { - getbits(buf, n++, 1); - read_golomb(buf, &n); - read_golomb(buf, &n); - v = read_golomb(buf, &n); - for (i = 0; i < v; i++) - read_golomb(buf, &n); - } - read_golomb(buf, &n); - getbits(buf, n++, 1); - picture->display_picture_width = 16 * (read_golomb(buf, &n) + 1); - mbh = read_golomb(buf, &n) + 1; - frame_mbs_only = getbits(buf, n++, 1); - picture->display_picture_height = 16 * (2 - frame_mbs_only) * mbh; - if (!frame_mbs_only) - getbits(buf, n++, 1); - getbits(buf, n++, 1); - if (getbits(buf, n++, 1)) - { - read_golomb(buf, &n); - read_golomb(buf, &n); - read_golomb(buf, &n); - read_golomb(buf, &n); - } - if (getbits(buf, n++, 1)) - n = h264_parse_vui(picture, buf, n); - - return n; -} - -static int mp_unescape03(unsigned char *buf, int len) -{ - unsigned char *dest; - int i, j, skip; - - dest = malloc(len); - if (! dest) - return 0; - - j = i = skip = 0; - while (i <= len - 3) - { - if (buf[i] == 0 && buf[i + 1] == 0 && buf[i + 2] == 3) - { - dest[j] = dest[j + 1] = 0; - j += 2; - i += 3; - skip++; - } - else - { - dest[j] = buf[i]; - j++; - i++; - } - } - dest[j] = buf[len - 2]; - dest[j + 1] = buf[len - 1]; - len -= skip; - memcpy(buf, dest, len); - free(dest); - - return len; -} - -int mp_vc1_decode_sequence_header(mp_mpeg_header_t *picture, unsigned char *buf, int len) -{ - int n, x; - - len = mp_unescape03(buf, len); - - picture->display_picture_width = picture->display_picture_height = 0; - picture->fps = 0; - n = 0; - x = getbits(buf, n, 2); - n += 2; - if (x != 3) //not advanced profile - return 0; - - getbits16(buf, n, 14); - n += 14; - picture->display_picture_width = getbits16(buf, n, 12) * 2 + 2; - n += 12; - picture->display_picture_height = getbits16(buf, n, 12) * 2 + 2; - n += 12; - getbits(buf, n, 6); - n += 6; - x = getbits(buf, n, 1); - n += 1; - if (x) //display info - { - getbits16(buf, n, 14); - n += 14; - getbits16(buf, n, 14); - n += 14; - if (getbits(buf, n++, 1)) //aspect ratio - { - x = getbits(buf, n, 4); - n += 4; - if (x == 15) - { - getbits16(buf, n, 16); - n += 16; - } - } - - if (getbits(buf, n++, 1)) //framerates - { - int frexp = 0, frnum = 0, frden = 0; - - if (getbits(buf, n++, 1)) - { - frexp = getbits16(buf, n, 16); - n += 16; - picture->fps = (double)(frexp + 1) / 32.0; - } - else - { - float frates[] = {0, 24000, 25000, 30000, 50000, 60000, 48000, 72000, 0}; - float frdivs[] = {0, 1000, 1001, 0}; - - frnum = getbits(buf, n, 8); - n += 8; - frden = getbits(buf, n, 4); - n += 4; - if ((frden == 1 || frden == 2) && (frnum < 8)) - picture->fps = frates[frnum] / frdivs[frden]; - } - } - } - - //free(dest); - return 1; -} diff --git a/libeplayer2/container/mpeg_hdr.h b/libeplayer2/container/mpeg_hdr.h deleted file mode 100644 index 279a726..0000000 --- a/libeplayer2/container/mpeg_hdr.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef EPLAYER_MPEG_HDR_H -#define EPLAYER_MPEG_HDR_H - -typedef struct -{ - // video info: - int mpeg1; // 0=mpeg2 1=mpeg1 - int display_picture_width; - int display_picture_height; - int aspect_ratio_information; - int frame_rate_code; - float fps; - int bitrate; // 0x3FFFF==VBR - // timing: - int picture_structure; - int progressive_sequence; - int repeat_first_field; - int progressive_frame; - int top_field_first; - int display_time; // secs*100 - //the following are for mpeg4 - unsigned int timeinc_resolution, timeinc_bits, timeinc_unit; - int picture_type; -} mp_mpeg_header_t; - -int mp_header_process_sequence_header(mp_mpeg_header_t *picture, const unsigned char *buffer); -int mp_header_process_extension(mp_mpeg_header_t *picture, unsigned char *buffer); -float mpeg12_aspect_info(mp_mpeg_header_t *picture); -int mp4_header_process_vol(mp_mpeg_header_t *picture, unsigned char *buffer); -void mp4_header_process_vop(mp_mpeg_header_t *picture, unsigned char *buffer); -int h264_parse_sps(mp_mpeg_header_t *picture, unsigned char *buf, int len); -int mp_vc1_decode_sequence_header(mp_mpeg_header_t *picture, unsigned char *buf, int len); - -#endif /* EPLAYER_MPEG_HDR_H */ diff --git a/libeplayer2/container/ms_hdr.h b/libeplayer2/container/ms_hdr.h deleted file mode 100644 index 4f47b53..0000000 --- a/libeplayer2/container/ms_hdr.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef EPLAYER_MS_HDR_H -#define EPLAYER_MS_HDR_H - -#ifndef _WAVEFORMATEX_ -#define _WAVEFORMATEX_ -typedef struct __attribute__((__packed__)) _WAVEFORMATEX -{ - unsigned short wFormatTag; - unsigned short nChannels; - unsigned int nSamplesPerSec; - unsigned int nAvgBytesPerSec; - unsigned short nBlockAlign; - unsigned short wBitsPerSample; - unsigned short cbSize; -} WAVEFORMATEX, *PWAVEFORMATEX, *NPWAVEFORMATEX, *LPWAVEFORMATEX; -#endif /* _WAVEFORMATEX_ */ - -#ifndef _MPEGLAYER3WAVEFORMAT_ -#define _MPEGLAYER3WAVEFORMAT_ -typedef struct __attribute__((__packed__)) mpeglayer3waveformat_tag -{ - WAVEFORMATEX wf; - unsigned short wID; - unsigned int fdwFlags; - unsigned short nBlockSize; - unsigned short nFramesPerBlock; - unsigned short nCodecDelay; -} MPEGLAYER3WAVEFORMAT; -#endif /* _MPEGLAYER3WAVEFORMAT_ */ - -/* windows.h #includes wingdi.h on MinGW. */ -#if !defined(_BITMAPINFOHEADER_) && !defined(_WINGDI_H) -#define _BITMAPINFOHEADER_ -typedef struct __attribute__((__packed__)) -{ - int biSize; - int biWidth; - int biHeight; - short biPlanes; - short biBitCount; - int biCompression; - int biSizeImage; - int biXPelsPerMeter; - int biYPelsPerMeter; - int biClrUsed; - int biClrImportant; -} -BITMAPINFOHEADER, *PBITMAPINFOHEADER, *LPBITMAPINFOHEADER; -typedef struct -{ - BITMAPINFOHEADER bmiHeader; - int bmiColors[1]; -} BITMAPINFO, *LPBITMAPINFO; -#endif - -#ifndef le2me_BITMAPINFOHEADER -#ifdef WORDS_BIGENDIAN -#define le2me_BITMAPINFOHEADER(h) { \ - (h)->biSize = le2me_32((h)->biSize); \ - (h)->biWidth = le2me_32((h)->biWidth); \ - (h)->biHeight = le2me_32((h)->biHeight); \ - (h)->biPlanes = le2me_16((h)->biPlanes); \ - (h)->biBitCount = le2me_16((h)->biBitCount); \ - (h)->biCompression = le2me_32((h)->biCompression); \ - (h)->biSizeImage = le2me_32((h)->biSizeImage); \ - (h)->biXPelsPerMeter = le2me_32((h)->biXPelsPerMeter); \ - (h)->biYPelsPerMeter = le2me_32((h)->biYPelsPerMeter); \ - (h)->biClrUsed = le2me_32((h)->biClrUsed); \ - (h)->biClrImportant = le2me_32((h)->biClrImportant); \ - } -#define le2me_WAVEFORMATEX(h) { \ - (h)->wFormatTag = le2me_16((h)->wFormatTag); \ - (h)->nChannels = le2me_16((h)->nChannels); \ - (h)->nSamplesPerSec = le2me_32((h)->nSamplesPerSec); \ - (h)->nAvgBytesPerSec = le2me_32((h)->nAvgBytesPerSec); \ - (h)->nBlockAlign = le2me_16((h)->nBlockAlign); \ - (h)->wBitsPerSample = le2me_16((h)->wBitsPerSample); \ - (h)->cbSize = le2me_16((h)->cbSize); \ - } -#else -#define le2me_BITMAPINFOHEADER(h) /**/ -#define le2me_WAVEFORMATEX(h) /**/ -#endif -#endif - -#endif /* EPLAYER_MS_HDR_H */ diff --git a/libeplayer2/container/parse_es.c b/libeplayer2/container/parse_es.c deleted file mode 100644 index cbaa0f6..0000000 --- a/libeplayer2/container/parse_es.c +++ /dev/null @@ -1,105 +0,0 @@ -//=================== MPEG-ES VIDEO PARSER ========================= - -#include -#include -#include - -//#include "../config.h" - -#include "stream.h" -#include "demuxer.h" -#include "parse_es.h" - -int parse_es_debug = 0; -#define parse_es_printf(x...) do { if (parse_es_debug)printf(x); } while (0) - -//static unsigned char videobuffer[MAX_VIDEO_PACKET_SIZE]; -unsigned char *videobuffer = NULL; -int videobuf_len = 0; -int next_nal = -1; -///! legacy variable, 4 if stream is synced, 0 if not -int videobuf_code_len = 0; - -#define MAX_SYNCLEN (10 * 1024 * 1024) -// sync video stream, and returns next packet code -int sync_video_packet(demux_stream_t *ds) -{ - if (!videobuf_code_len) - { - int skipped = 0; - if (!demux_pattern_3(ds, NULL, MAX_SYNCLEN, &skipped, 0x100)) - { - if (skipped == MAX_SYNCLEN) - parse_es_printf("parse_es: could not sync video stream!\n"); - goto eof_out; - } - next_nal = demux_getc(ds); - if (next_nal < 0) - goto eof_out; - videobuf_code_len = 4; - if (skipped) parse_es_printf("videobuf: %d bytes skipped (next: 0x1%02X)\n", skipped, next_nal); - } - return 0x100 | next_nal; - -eof_out: - next_nal = -1; - videobuf_code_len = 0; - return 0; -} - -// return: packet length -int read_video_packet(demux_stream_t *ds) -{ - int packet_start; - int res, read; - - if (VIDEOBUFFER_SIZE - videobuf_len < 5) - return 0; - // SYNC STREAM -// if(!sync_video_packet(ds)) return 0; // cannot sync (EOF) - - // COPY STARTCODE: - packet_start = videobuf_len; - videobuffer[videobuf_len + 0] = 0; - videobuffer[videobuf_len + 1] = 0; - videobuffer[videobuf_len + 2] = 1; - videobuffer[videobuf_len + 3] = next_nal; - videobuf_len += 4; - - // READ PACKET: - res = demux_pattern_3(ds, &videobuffer[videobuf_len], - VIDEOBUFFER_SIZE - videobuf_len, &read, 0x100); - videobuf_len += read; - if (!res) - goto eof_out; - - videobuf_len -= 3; - - parse_es_printf("videobuf: packet 0x1%02X len=%d (total=%d)\n", videobuffer[packet_start + 3], videobuf_len - packet_start, videobuf_len); - - // Save next packet code: - next_nal = demux_getc(ds); - if (next_nal < 0) - goto eof_out; - videobuf_code_len = 4; - - return videobuf_len - packet_start; - -eof_out: - next_nal = -1; - videobuf_code_len = 0; - return videobuf_len - packet_start; -} - -// return: next packet code -int skip_video_packet(demux_stream_t *ds) -{ - - // SYNC STREAM -// if(!sync_video_packet(ds)) return 0; // cannot sync (EOF) - - videobuf_code_len = 0; // force resync - - // SYNC AGAIN: - return sync_video_packet(ds); -} diff --git a/libeplayer2/container/parse_es.h b/libeplayer2/container/parse_es.h deleted file mode 100644 index ff90a41..0000000 --- a/libeplayer2/container/parse_es.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef EPLAYER_PARSE_ES_H -#define EPLAYER_PARSE_ES_H - -#include "demuxer.h" - -#define MAX_VIDEO_PACKET_SIZE (224*1024+4) -#define VIDEOBUFFER_SIZE 0x100000 - -extern unsigned char *videobuffer; -extern int videobuf_len; -extern unsigned char videobuf_code[4]; -extern int videobuf_code_len; - -// sync video stream, and returns next packet code -int sync_video_packet(demux_stream_t *ds); - -// return: packet length -int read_video_packet(demux_stream_t *ds); - -// return: next packet code -int skip_video_packet(demux_stream_t *ds); - -#endif /* EPLAYER_PARSE_ES_H */ diff --git a/libeplayer2/container/stheader.h b/libeplayer2/container/stheader.h deleted file mode 100644 index 268579d..0000000 --- a/libeplayer2/container/stheader.h +++ /dev/null @@ -1,128 +0,0 @@ -#ifndef EPLAYER_STHEADER_H -#define EPLAYER_STHEADER_H - -#include "demuxer.h" -#include "aviheader.h" -#include "ms_hdr.h" - -// Stream headers: - -typedef struct -{ - int aid; - demux_stream_t *ds; - struct codecs_st *codec; - unsigned int format; - int initialized; - float stream_delay; // number of seconds stream should be delayed (according to dwStart or similar) - // output format: - int sample_format; - int samplerate; - int samplesize; - int channels; - int o_bps; // == samplerate*samplesize*channels (uncompr. bytes/sec) - int i_bps; // == bitrate (compressed bytes/sec) - // in buffers: - int audio_in_minsize; // max. compressed packet size (== min. in buffer size) - char *a_in_buffer; - int a_in_buffer_len; - int a_in_buffer_size; - // decoder buffers: - int audio_out_minsize; // max. uncompressed packet size (==min. out buffsize) - char *a_buffer; - int a_buffer_len; - int a_buffer_size; - // output buffers: - char *a_out_buffer; - int a_out_buffer_len; - int a_out_buffer_size; -// void* audio_out; // the audio_out handle, used for this audio stream - struct af_stream_s *afilter; // the audio filter stream - struct ad_functions_s *ad_driver; -#ifdef CONFIG_DYNAMIC_PLUGINS - void *dec_handle; -#endif - // win32-compatible codec parameters: - AVIStreamHeader audio; - WAVEFORMATEX *wf; - // codec-specific: - void *context; // codec-specific stuff (usually HANDLE or struct pointer) - unsigned char *codecdata; // extra header data passed from demuxer to codec - int codecdata_len; - double pts; // last known pts value in output from decoder - int pts_bytes; // bytes output by decoder after last known pts - char *lang; // track language - int default_track; -} sh_audio_t; - -typedef struct -{ - int vid; - demux_stream_t *ds; - struct codecs_st *codec; - unsigned int format; - int initialized; - float timer; // absolute time in video stream, since last start/seek - float stream_delay; // number of seconds stream should be delayed (according to dwStart or similar) - // frame counters: - float num_frames; // number of frames played - int num_frames_decoded; // number of frames decoded - // timing (mostly for mpeg): - double pts; // predicted/interpolated PTS of the current frame - double i_pts; // PTS for the _next_ I/P frame - float next_frame_time; - double last_pts; - double buffered_pts[20]; - int num_buffered_pts; - // output format: (set by demuxer) - float fps; // frames per second (set only if constant fps) - float frametime; // 1/fps - float aspect; // aspect ratio stored in the file (for prescaling) - float stream_aspect; // aspect ratio stored in the media headers (e.g. in DVD IFO files) - int i_bps; // == bitrate (compressed bytes/sec) - int disp_w, disp_h; // display size (filled by fileformat parser) - // output driver/filters: (set by libmpcodecs core) - unsigned int outfmtidx; - struct vf_instance_s *vfilter; // the video filter chain, used for this video stream - int vf_initialized; -#ifdef CONFIG_DYNAMIC_PLUGINS - void *dec_handle; -#endif - // win32-compatible codec parameters: - AVIStreamHeader video; - BITMAPINFOHEADER *bih; - void *ImageDesc; // for quicktime codecs - // codec-specific: - void *context; // codec-specific stuff (usually HANDLE or struct pointer) -} sh_video_t; - -typedef struct -{ - int sid; - char type; // t = text, v = VobSub, a = SSA/ASS - unsigned char *extradata; // extra header data passed from demuxer - int extradata_len; -#ifdef CONFIG_ASS - ass_track_t *ass_track; // for SSA/ASS streams (type == 'a') -#endif - char *lang; // track language - int default_track; -} sh_sub_t; - -// demuxer.c: -#define new_sh_audio(d, i) new_sh_audio_aid(d, i, i) -sh_audio_t *new_sh_audio_aid(demuxer_t *demuxer, int id, int aid); -#define new_sh_video(d, i) new_sh_video_vid(d, i, i) -sh_video_t *new_sh_video_vid(demuxer_t *demuxer, int id, int vid); -#define new_sh_sub(d, i) new_sh_sub_sid(d, i, i) -sh_sub_t *new_sh_sub_sid(demuxer_t *demuxer, int id, int sid); -void free_sh_audio(demuxer_t *demuxer, int id); -void free_sh_video(sh_video_t *sh); - -// video.c: -int video_read_properties(sh_video_t *sh_video); -int video_read_frame(sh_video_t *sh_video, float *frame_time_ptr, unsigned char **start, int force_fps); - -typedef enum {Unknown, Ufs910_1W, Ufs910_14W, Ufs922, Tf7700, HdBox} eBoxType; - -#endif /* EPLAYER_STHEADER_H */ diff --git a/libeplayer2/container/stream.c b/libeplayer2/container/stream.c deleted file mode 100644 index 38b6bf4..0000000 --- a/libeplayer2/container/stream.c +++ /dev/null @@ -1,191 +0,0 @@ -#include -#include -#include - -#include -#include -#ifndef __MINGW32__ -#include -#include -#endif -#include -#include -#include - -#include "stream.h" -#include "demuxer.h" - -#ifdef __cplusplus -extern "C" { -#endif - -int stream_debug = 0; -#define stream_printf(x...) do { if (stream_debug)printf(x); } while (0) - -/////////////////////////////////////7 - -static int file_fill_buffer(stream_t *s, char *buffer, int max_len) -{ - int r = read(s->fd, buffer, max_len); - return (r <= 0) ? -1 : r; -} - -static int file_seek(stream_t *s, off_t newpos) -{ - s->pos = newpos; - if (lseek(s->fd, s->pos, SEEK_SET) < 0) - { - s->eof = 1; - return 0; - } - return 1; -} - -void file_reset(stream_t *s) -{ - if (s->eof) - { - s->pos = 0; //ftell(f); -// s->buf_pos=s->buf_len=0; - s->eof = 0; - } - //if(s->control) s->control(s,STREAM_CTRL_RESET,NULL); - lseek(s->fd, 0L, SEEK_SET); -} - -/////////////////////////////////////7 - -int stream_fill_buffer(stream_t *s) -{ - stream_printf("stream_fill_buffer->\n"); - - int len; - if (/*s->fd == NULL ||*/ s->eof) - { - stream_printf("stream_fill_buffer s->eof !\n"); - s->buf_pos = s->buf_len = 0; - return 0; - } - switch (s->type) - { - case STREAMTYPE_STREAM: - len = read(s->fd, s->buffer, STREAM_BUFFER_SIZE); - break; - case STREAMTYPE_DS: - len = demux_read_data((demux_stream_t *)s->priv, s->buffer, STREAM_BUFFER_SIZE); - break; - - default: - len = file_fill_buffer(s, (char *) s->buffer, STREAM_BUFFER_SIZE); - break; - } - stream_printf("stream_fill_buffer-< len=%d\n", len); - if (len <= 0) - { - s->eof = 1; - s->buf_pos = s->buf_len = 0; - return 0; - } - s->buf_pos = 0; - s->buf_len = len; - s->pos += len; -// stream_printf("[%d]",len);fflush(stdout); - - return len; -} - - -int stream_seek_long(stream_t *s, off_t pos) -{ - stream_printf("stream_seek_long> 0x%lx ->\n", (long unsigned int) pos); - - off_t newpos = 0; - - s->buf_pos = s->buf_len = 0; - - if (s->mode == STREAM_WRITE) - { - if (!file_seek(s, pos)) - return 0; - return 1; - } - - if (s->sector_size) - newpos = (pos / s->sector_size) * s->sector_size; - else - newpos = pos & (~((off_t)STREAM_BUFFER_SIZE - 1)); - - pos -= newpos; - - if (newpos == 0 || newpos != s->pos) - { - switch (s->type) - { - case STREAMTYPE_STREAM: - //s->pos=newpos; // real seek - // Some streaming protocol allow to seek backward and forward - // A function call that return -1 can tell that the protocol - // doesn't support seeking. - - if (newpos < s->pos) - { - stream_printf("Cannot seek backward in linear streams!\n"); - return 1; - } - while (s->pos < newpos) - { - stream_printf("\ts->pos=0x%lx < newpos=0x%lx\n", (long unsigned int) s->pos, (long unsigned int) newpos); - if (stream_fill_buffer(s) <= 0) break; // EOF - } - - //lseek(s->fd, newpos, SEEK_SET); - //s->pos=newpos; - - break; - default: - // Now seek - if (!file_seek(s, newpos)) - { - stream_printf("Seek failed\n"); - return 0; - } - } -// putchar('.');fflush(stdout); -//} else { -// putchar('%');fflush(stdout); - } - - while (stream_fill_buffer(s) > 0 && pos >= 0) - { - if (pos <= s->buf_len) - { - s->buf_pos = pos; // byte position in sector - return 1; - } - pos -= s->buf_len; - } - -// if(pos==s->buf_len) stream_printf("XXX Seek to last byte of file -> EOF\n"); - - stream_printf("stream_seek: WARNING! Can't seek to 0x%"PRIX64" !\n", (int64_t)(pos + newpos)); - return 0; -} - -int stream_control(stream_t *s, int cmd, void *arg) -{ - if (!s->control) return STREAM_UNSUPPORTED; - return s->control(s, cmd, arg); -} -void stream_reset(stream_t *s) -{ - if (s->type == STREAMTYPE_FILE) - return file_reset(s); - if (s->eof) - { - s->pos = 0; //ftell(f); -// s->buf_pos=s->buf_len=0; - s->eof = 0; - } - //if(s->control) s->control(s,STREAM_CTRL_RESET,NULL); - //lseek(s->fd, 0L, SEEK_SET); -} diff --git a/libeplayer2/container/stream.h b/libeplayer2/container/stream.h deleted file mode 100644 index 17b6759..0000000 --- a/libeplayer2/container/stream.h +++ /dev/null @@ -1,242 +0,0 @@ -#ifndef STREAM_H -#define STREAM_H - -#include -#include -#include - -#define STREAMTYPE_FILE 0 -#define STREAMTYPE_VCD 1 // raw mode-2 CDROM reading, 2324 bytes/sector -#define STREAMTYPE_STREAM 2 // same as FILE but no seeking (for net/stdin) -#define STREAMTYPE_DS 8 // read from a demuxer stream - -#define STREAM_READ 0 -#define STREAM_WRITE 1 - -#define STREAM_SEEK_BW 2 -#define STREAM_SEEK_FW 4 -#define STREAM_SEEK (STREAM_SEEK_BW|STREAM_SEEK_FW) - -#define MAX_STREAM_PROTOCOLS 10 - -#define STREAM_BUFFER_SIZE 2048 -#define VCD_SECTOR_SIZE 2352 - -#define STREAM_UNSUPPORTED -1 -#define STREAM_CTRL_RESET 0 -#define STREAM_CTRL_GET_TIME_LENGTH 1 -#define STREAM_CTRL_GET_CURRENT_TIME 5 - -#ifdef DEBUG -#define dprintf(x...) do { printf(x); } while (0) -#endif - -#define mmioFOURCC( ch0, ch1, ch2, ch3 ) \ - ( (uint32_t)(uint8_t)(ch0) | ( (uint32_t)(uint8_t)(ch1) << 8 ) | \ - ( (uint32_t)(uint8_t)(ch2) << 16 ) | ( (uint32_t)(uint8_t)(ch3) << 24 ) ) - -struct stream_st; -typedef struct stream_info_st -{ - const char *info; - const char *name; - const char *author; - const char *comment; - /// mode isn't used atm (ie always READ) but it shouldn't be ignored - /// opts is at least in it's defaults settings and may have been - /// altered by url parsing if enabled and the options string parsing. - //int (*open)(struct stream_st* st, int mode, void* opts, int* file_format); - char *protocols[MAX_STREAM_PROTOCOLS]; - void *opts; - int opts_url; /* If this is 1 we will parse the url as an option string - * too. Otherwise options are only parsed from the - * options string given to open_stream_plugin */ -} stream_info_t; - -typedef struct stream_st -{ - /*// Read - int (*fill_buffer)(struct stream_st *s, char* buffer, int max_len); - // Write - int (*write_buffer)(struct stream_st *s, char* buffer, int len); - // Seek - int (*seek)(struct stream_st *s,off_t pos); - // Control - // Will be later used to let streams like dvd and cdda report - // their structure (ie tracks, chapters, etc) - int (*control)(struct stream_st *s,int cmd,void* arg); - // Close - void (*close)(struct stream_st *s);*/ - int (*control)(struct stream_st *s, int cmd, void *arg); - - int fd; // file descriptor, see man open(2) - FILE *file; - int type; // see STREAMTYPE_* - int flags; - int sector_size; // sector size (seek will be aligned on this size if non 0) - unsigned int buf_pos, buf_len; - off_t pos, start_pos, end_pos; - int eof; - int mode; //STREAM_READ or STREAM_WRITE - unsigned int cache_pid; - void *cache_data; - void *priv; // used for DVD, TV, RTSP etc - char *url; // strdup() of filename/url - - unsigned char buffer[STREAM_BUFFER_SIZE]; -} stream_t; - -int stream_fill_buffer(stream_t *s); -int stream_seek_long(stream_t *s, off_t pos); -#define cache_stream_fill_buffer(x) stream_fill_buffer(x) -#define cache_stream_seek_long(x,y) stream_seek_long(x,y) -#define stream_enable_cache(x,y,z,w) 1 - -inline static int stream_read_char(stream_t *s) -{ - return (s->buf_pos < s->buf_len) ? s->buffer[s->buf_pos++] : - (cache_stream_fill_buffer(s) ? s->buffer[s->buf_pos++] : -256); -} -inline static unsigned int stream_read_word(stream_t *s) -{ - int x, y; - x = stream_read_char(s); - y = stream_read_char(s); - return (x << 8) | y; -} - -inline static int stream_read(stream_t *s, unsigned char *mem, int total) -{ - int len = total; - while (len > 0) - { - int x; - x = s->buf_len - s->buf_pos; - if (x == 0) - { - if (!cache_stream_fill_buffer(s)) return total - len; // EOF - x = s->buf_len - s->buf_pos; - } -#ifdef DEBUG - if (s->buf_pos > s->buf_len) dprintf("stream_read: WARNING! s->buf_pos>s->buf_len\n"); -#endif - if (x > len) x = len; - memcpy(mem, &s->buffer[s->buf_pos], x); - s->buf_pos += x; - mem += x; - len -= x; - } - return total; -} - - -inline static unsigned int stream_read_dword(stream_t *s) -{ - unsigned int y; - y = stream_read_char(s); - y = (y << 8) | stream_read_char(s); - y = (y << 8) | stream_read_char(s); - y = (y << 8) | stream_read_char(s); - return y; -} - -inline static uint64_t stream_read_qword(stream_t *s) -{ - uint64_t y; - y = stream_read_char(s); - y = (y << 8) | stream_read_char(s); - y = (y << 8) | stream_read_char(s); - y = (y << 8) | stream_read_char(s); - y = (y << 8) | stream_read_char(s); - y = (y << 8) | stream_read_char(s); - y = (y << 8) | stream_read_char(s); - y = (y << 8) | stream_read_char(s); - return y; -} - -#define stream_read_fourcc stream_read_dword_le - -inline static unsigned int stream_read_word_le(stream_t *s) -{ - int x, y; - x = stream_read_char(s); - y = stream_read_char(s); - return (y << 8) | x; -} - -inline static unsigned int stream_read_dword_le(stream_t *s) -{ - unsigned int y; - y = stream_read_char(s); - y |= stream_read_char(s) << 8; - y |= stream_read_char(s) << 16; - y |= stream_read_char(s) << 24; - return y; -} - -inline static uint64_t stream_read_qword_le(stream_t *s) -{ - uint64_t y; - y = stream_read_dword_le(s); - y |= (uint64_t)stream_read_dword_le(s) << 32; - return y; -} - -inline static int stream_eof(stream_t *s) -{ - return s->eof; -} - -inline static off_t stream_tell(stream_t *s) -{ - return s->pos + s->buf_pos - s->buf_len; -} - -inline static int stream_seek(stream_t *s, off_t pos) -{ - -#ifdef DEBUG - dprintf("seek to 0x%qX\n", (long long)pos); -#endif - - if (pos < s->pos) - { - off_t x = pos - (s->pos - s->buf_len); - if (x >= 0) - { - s->buf_pos = x; -// putchar('*');fflush(stdout); - return 1; - } - } - - return cache_stream_seek_long(s, pos); -} - -inline static int stream_skip(stream_t *s, off_t len) -{ - //if( (len<0 && (s->flags & STREAM_SEEK_BW)) || (len>2*STREAM_BUFFER_SIZE && (s->flags & STREAM_SEEK_FW)) ) { - // negative or big skip! - return stream_seek(s, stream_tell(s) + len); - //} - while (len > 0) - { - int x = s->buf_len - s->buf_pos; - if (x == 0) - { - if (!cache_stream_fill_buffer(s)) return 0; // EOF - x = s->buf_len - s->buf_pos; - } - if (x > len) x = len; - //memcpy(mem,&s->buf[s->buf_pos],x); - s->buf_pos += x; - len -= x; - } - return 1; -} -int stream_control(stream_t *s, int cmd, void *arg); -void stream_reset(stream_t *s); - -stream_t *open_stream(char *filename, char **options, int *file_format); - -#endif // STREAM_H diff --git a/libeplayer2/container/text_srt.c b/libeplayer2/container/text_srt.c deleted file mode 100644 index 8c93d91..0000000 --- a/libeplayer2/container/text_srt.c +++ /dev/null @@ -1,546 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -//#ifndef DEBUG -//#define DEBUG // FIXME: until this is set properly by Makefile -//#endif - -static const char FILENAME[] = "text_srt.c"; -#define TEXTSRTOFFSET 100 - -#include "common.h" -static pthread_t thread_sub; - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -typedef struct -{ -char *File; -int Id; -} SrtTrack_t; - -#define TRACKWRAP 20 -static SrtTrack_t *Tracks; -static int TrackCount = 0; -static int CurrentTrack = -1; //no as default. - -static void SrtManagerAdd(Context_t *context, SrtTrack_t track) -{ -#ifdef DEBUG -printf("%s::%s %s %d\n", FILENAME, __FUNCTION__, track.File, track.Id); -#endif - -if (Tracks == NULL) -{ - Tracks = malloc(sizeof(SrtTrack_t) * TRACKWRAP); -} - -if (TrackCount < TRACKWRAP) -{ -#ifdef DEBUG - printf("2strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - Tracks[TrackCount].File = strdup(track.File); - Tracks[TrackCount].Id = track.Id; - TrackCount++; -} -else -{ - //Track_t * tmp_Tracks = realoc(sizeof(Tracks)); -} -} - -static char **SrtManagerList(Context_t *context) -{ - char **tracklist = NULL; -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - if (Tracks != NULL) - { - char help[256]; - int i = 0, j = 0; - tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1)); - for (i = 0, j = 0; i < TrackCount; i++, j += 2) - { -#ifdef DEBUG - printf("2strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - sprintf(help, "%d", Tracks[i].Id); - tracklist[j] = strdup(help); - tracklist[j + 1] = strdup(Tracks[i].File); - } - tracklist[j] = NULL; - } - - return tracklist; -} - -static void SrtManagerDel(Context_t *context) -{ - - int i = 0; - if (Tracks != NULL) - { - for (i = 0; i < TrackCount; i++) - { - free(Tracks[i].File); - Tracks[i].File = NULL; - } - free(Tracks); - Tracks = NULL; - } - - TrackCount = 0; - CurrentTrack = -1; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -static int getExtension(char fileName[PATH_MAX], char extension[PATH_MAX]) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int i = 0; - int extensionLength = -1; - int stringLength = (int) strlen(fileName); - - for (i = 0; stringLength - i > 0; i++) - { - if (fileName[stringLength - i - 1] == '.') - { - extensionLength = i; - strncpy(extension, &fileName[stringLength - i], extensionLength); - extension[extensionLength] = '\0'; - break; - } - } - return extensionLength; -} - -static int getParentFolder(char fileName[PATH_MAX], char folder[PATH_MAX]) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int i = 0; - int folderLength = -1; - int stringLength = (int) strlen(fileName); - - for (i = 0; stringLength - i > 0; i++) - { - if (fileName[stringLength - i - 1] == '/') - { - folderLength = stringLength - i - 1; - strncpy(folder, fileName, folderLength); - folder[folderLength] = '\0'; - break; - } - } - return folderLength; -} - -static int compare(char fileNameA[PATH_MAX], char fileNameB[PATH_MAX]) -{ - int i = 0; - int stringLengthA = strlen(fileNameA); - int stringLengthB = strlen(fileNameB); - - if (stringLengthA > stringLengthB) - return -1; - - for (i = 0; i < stringLengthA; i++) - if (fileNameA[i] != fileNameB[i]) - break; - - if (i == stringLengthA) - i = 0; - - return i; -} - -static void SrtGetSubtitle(Context_t *context, char *_fileName) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - struct dirent *dirzeiger; - DIR *dir; - int i = TEXTSRTOFFSET; - - int absFileNameLength = 0; - int absFileNameFolderLength = 0; - int relFileNameLength = 0; - int relFileNameExtensionLength = 0; - int relFileNameShortLength = 0; - - char absFileName[PATH_MAX]; - char absFileNameFolder[PATH_MAX]; - char relFileName[PATH_MAX]; - char relFileNameExtension[PATH_MAX]; - char relFileNameShort[PATH_MAX]; - char relFileNameSubExtension[PATH_MAX]; - - absFileName[0] = '\0'; - absFileNameFolder[0] = '\0'; - relFileName[0] = '\0'; - relFileNameExtension[0] = '\0'; - relFileNameShort[0] = '\0'; - relFileNameSubExtension[0] = '\0'; - - // Absolut File Name - absFileNameLength = strlen(_fileName); - strncpy(absFileName, _fileName, absFileNameLength); - absFileName[absFileNameLength] = '\0'; - - // Absolut Folder Path - absFileNameFolderLength = getParentFolder(absFileName, absFileNameFolder); - - // Relativ File Name - relFileNameLength = absFileNameLength - absFileNameFolderLength - 1; - strncpy(relFileName, &absFileName[absFileNameFolderLength + 1], relFileNameLength); - relFileName[relFileNameLength] = '\0'; - - // Extension of Relativ File Name - relFileNameExtensionLength = getExtension(relFileName, relFileNameExtension); - - // Relativ File Name without Extension - relFileNameShortLength = relFileNameLength - relFileNameExtensionLength - 1 /* . */; - strncpy(relFileNameShort, relFileName, relFileNameShortLength); - relFileNameShort[relFileNameShortLength] = '\0'; - - if ((dir = opendir(absFileNameFolder)) != NULL) - { - while ((dirzeiger = readdir(dir)) != NULL) - { -#ifdef DEBUG - printf("%s\n", (*dirzeiger).d_name); -#endif - - int relSubtitleFileNameLength = 0; - int relSubtitleFileNameExtensionLength = 0; - - char relSubtitleFileName[PATH_MAX]; - char relSubtitleFileNameExtension[PATH_MAX]; - - // Relativ Subtitle File Name - relSubtitleFileNameLength = strlen((*dirzeiger).d_name); - strncpy(relSubtitleFileName, (*dirzeiger).d_name, relSubtitleFileNameLength); - relSubtitleFileName[relSubtitleFileNameLength] = '\0'; - - // Extension of Relativ Subtitle File Name - relSubtitleFileNameExtensionLength = getExtension(relSubtitleFileName, relSubtitleFileNameExtension); - - if (relSubtitleFileNameExtensionLength <= 0) - continue; - - if (!strncmp(relSubtitleFileNameExtension, "srt", 3)) - { - - if (compare(relFileNameShort, relSubtitleFileName) == 0) - { -#ifdef DEBUG - printf("%s\n", relSubtitleFileName); -#endif - - int absSubtitleFileNameLength = 0; - int relSubtitleFileNameShortLength = 0; - int relSubtitleFileNameSubExtensionLength = 0; - - char absSubtitleFileName[PATH_MAX]; - char relSubtitleFileNameShort[PATH_MAX]; - char relSubtitleFileNameSubExtension[PATH_MAX]; - - relSubtitleFileNameShort[0] = '\0'; - relSubtitleFileNameSubExtension[0] = '\0'; - - // Relativ File Name without Extension - relSubtitleFileNameShortLength = relSubtitleFileNameLength - relSubtitleFileNameExtensionLength - 1 /* . */; - strncpy(relSubtitleFileNameShort, relSubtitleFileName, relSubtitleFileNameShortLength); - relSubtitleFileNameShort[relSubtitleFileNameShortLength] = '\0'; - - // SubExtension of Relativ File Name - relSubtitleFileNameSubExtensionLength = getExtension(relSubtitleFileNameShort, relSubtitleFileNameSubExtension); - - if (relSubtitleFileNameSubExtensionLength <= 0 || relSubtitleFileNameSubExtensionLength > 3) - { - strncpy(relSubtitleFileNameSubExtension, "und", 3); - relSubtitleFileNameSubExtension[3] = '\0'; - } - - absSubtitleFileNameLength = absFileNameFolderLength; - strncpy(absSubtitleFileName, absFileNameFolder, absFileNameFolderLength); - absSubtitleFileName[absSubtitleFileNameLength] = '/'; - absSubtitleFileNameLength++; - strncpy(&absSubtitleFileName[absSubtitleFileNameLength], relSubtitleFileName, relSubtitleFileNameLength); - absSubtitleFileNameLength += relSubtitleFileNameLength; - absSubtitleFileName[absSubtitleFileNameLength] = '\0'; - - printf("SRT: %s [%s]\n", relSubtitleFileNameSubExtension, relSubtitleFileNameShort); - printf("\t->%s\n", absSubtitleFileName); - - SrtTrack_t SrtSubtitle = - { - absSubtitleFileName, - i, - }; - SrtManagerAdd(context, SrtSubtitle); - - Track_t Subtitle = - { - relSubtitleFileNameSubExtension, - "S_TEXT/SRT", - i++, - }; - context->manager->subtitle->Command(context, MANAGER_ADD, &Subtitle); - - } - } - } - closedir(dir); - } - -} - - - - -FILE *fsub = NULL; -#define MAXLINELENGTH 80 - -static int SrtOpenSubtitle(Context_t *context, int trackid) -{ - - if (trackid < TEXTSRTOFFSET) - { - return -1; - } - - trackid %= TEXTSRTOFFSET; - -#ifdef DEBUG - printf("%s::%s %s\n", FILENAME, __FUNCTION__, Tracks[trackid].File); -#endif - - fsub = fopen(Tracks[trackid].File, "rb"); -#ifdef DEBUG - printf("%s::%s %s\n", FILENAME, __FUNCTION__, fsub ? "fsub!=NULL" : "fsub==NULL"); -#endif - if (!fsub) - return -1; - - return 0; -} - -static int SrtCloseSubtitle(Context_t *context) -{ - - if (fsub) - fclose(fsub); - - fsub = NULL; - - return 0; -} - - -static void *SrtSubtitleThread(void *data) -{ - Context_t *context = (Context_t *) data; -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - int pos = 0; - char Data[MAXLINELENGTH]; - unsigned long long int Pts = 0; - float Duration = 0; - char *Text = NULL; - - while (context->playback->isPlaying && fsub && fgets(Data, MAXLINELENGTH, fsub)) - { -#ifdef DEBUG - printf("%s::%s pos=%d\n", FILENAME, __FUNCTION__, pos); -#endif - if (pos == 0) - { - //int numScene = 0; - //ret = sscanf(line, "%li", &numScene); - pos++; - - } - else if (pos == 1) - { - int ret, horIni, minIni, secIni, milIni, horFim, minFim, secFim, milFim; - - ret = sscanf(Data, "%d:%d:%d,%d --> %d:%d:%d,%d", &horIni, &minIni, &secIni, &milIni, &horFim, &minFim, &secFim, &milFim); - - Pts = (horIni * 3600 + minIni * 60 + secIni) * 1000 + milIni; - Duration = ((horFim * 3600 + minFim * 60 + secFim) * 1000 + milFim - Pts) / 1000.0; - Pts = Pts * 90; - - pos++; - - } - else if (pos == 2) - { -#ifdef DEBUG - printf("Data[0] = %d \'%c\'\n", Data[0], Data[0]); -#endif - if (Data[0] == '\n' || Data[0] == '\0' || Data[0] == 13 /* ^M */) - { -#ifdef DEBUG - printf("--> Text= \"%s\"\n", Text); -#endif - context->output->subtitle->Write(context, (unsigned char *) Text, strlen(Text), Pts, NULL, 0, Duration, "subtitle"); -#ifdef DEBUG - printf("<-- Text= \"%s\"\n", Text); -#endif - free(Text); - Text = NULL; - pos = 0; - continue; - } - - if (!Text) - { -#ifdef DEBUG - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - Text = strdup(Data); - - Text[-1] = '\0'; - } - else - { - int length = strlen(Text) /* \0 -> \n */ + strlen(Data) + 2 /* \0 */; -#ifdef DEBUG - printf("Alloc: %d\n", length); - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - char *tmpText = strdup(Text); - free(Text); - Text = (char *)malloc(length); - strcpy(Text, tmpText); - strcat(Text, "\n"); - strcat(Text, Data); - free(tmpText); - } - } - } - if (Text) - { - free(Text); - Text = NULL; - } - return NULL; -} - -static int SrtPlay(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int curtrackid = -1; - context->manager->subtitle->Command(context, MANAGER_GET, &curtrackid); - - if (SrtOpenSubtitle(context, curtrackid) == 0) - { - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - pthread_create(&thread_sub, &attr, &SrtSubtitleThread, context); - } - return 0; -} - -static int SrtSwitchSubtitle(Context_t *context, int *arg) -{ - - SrtCloseSubtitle(context); - - if (SrtOpenSubtitle(context, *arg) == 0) - { - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - pthread_create(&thread_sub, &attr, &SrtSubtitleThread, context); - } - return 0; -} - -static int SrtDel(Context_t *context) -{ - - SrtCloseSubtitle(context); - SrtManagerDel(context); - return 0; -} - -static int Command(void *_context, ContainerCmd_t command, void *argument) -{ - Context_t *context = (Context_t *) _context; -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - switch (command) - { - case CONTAINER_INIT: - { - char *filename = (char *)argument; - SrtGetSubtitle(context, filename); - break; - } - case CONTAINER_PLAY: - { - SrtPlay(context); - break; - } - case CONTAINER_DEL: - { - SrtDel(context); - break; - } - case CONTAINER_SWITCH_SUBTITLE: - { -#ifdef DEBUG - printf("%s::%s CONTAINER_SWITCH_SUBTITLE id=%d\n", FILENAME, __FUNCTION__, *((int *) argument)); -#endif - - SrtSwitchSubtitle(context, (int *) argument); - break; - } - default: -#ifdef DEBUG - printf("%s::%s ConatinerCmd not supported! %d\n", FILENAME, __FUNCTION__, command); -#endif - break; - } - - return 0; -} - -static char *SrtCapabilities[] = { "srt", NULL }; - -Container_t SrtContainer = -{ - "SRT", - &Command, - SrtCapabilities, -}; diff --git a/libeplayer2/container/text_ssa.c b/libeplayer2/container/text_ssa.c deleted file mode 100644 index 2f6bb11..0000000 --- a/libeplayer2/container/text_ssa.c +++ /dev/null @@ -1,563 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//#ifndef DEBUG -//#define DEBUG // FIXME: until this is set properly by Makefile -//#endif - -static const char FILENAME[] = "text_ssa.c"; -#define TEXTSSAOFFSET 200 - -#include "common.h" -static pthread_t thread_sub; - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -typedef struct -{ - char *File; - int Id; -} SsaTrack_t; - -#define TRACKWRAP 20 -static SsaTrack_t *Tracks; -static int TrackCount = 0; -static int CurrentTrack = -1; //no as default. - -static void SsaManagerAdd(Context_t *context, SsaTrack_t track) -{ -#ifdef DEBUG - printf("%s::%s %s %d\n", FILENAME, __FUNCTION__, track.File, track.Id); -#endif - - if (Tracks == NULL) - { - Tracks = malloc(sizeof(SsaTrack_t) * TRACKWRAP); - } - - if (TrackCount < TRACKWRAP) - { -#ifdef DEBUG - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - Tracks[TrackCount].File = strdup(track.File); - Tracks[TrackCount].Id = track.Id; - TrackCount++; - } - else - { - //Track_t * tmp_Tracks = realoc(sizeof(Tracks)); - } -} - -static char **SsaManagerList(Context_t *context) -{ - char **tracklist = NULL; -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - if (Tracks != NULL) - { - char help[256]; - int i = 0, j = 0; - tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1)); - for (i = 0, j = 0; i < TrackCount; i++, j += 2) - { -#ifdef DEBUG - printf("2strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - sprintf(help, "%d", Tracks[i].Id); - tracklist[j] = strdup(help); - tracklist[j + 1] = strdup(Tracks[i].File); - } - tracklist[j] = NULL; - } - - return tracklist; -} - -static void SsaManagerDel(Context_t *context) -{ - - int i = 0; - if (Tracks != NULL) - { - for (i = 0; i < TrackCount; i++) - { - free(Tracks[i].File); - Tracks[i].File = NULL; - } - free(Tracks); - Tracks = NULL; - } - - TrackCount = 0; - CurrentTrack = -1; -} - -//////////////////////////////////////////////////////////////////////////////////////////////////// - -static void getExtension(char *FILENAMEname, char **extension) -{ - - int i = 0; - int stringlength = (int) strlen(FILENAMEname); -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - for (i = 0; stringlength - i > 0; i++) - { - if (FILENAMEname[stringlength - i - 1] == '.') - { -#ifdef DEBUG - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - *extension = strdup(FILENAMEname + (stringlength - i)); - break; - } - } -} - -static void getParentFolder(char *Filename, char **folder) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int i = 0; - int stringlength = strlen(Filename); - - for (i = 0; stringlength - i > 0; i++) - { - if (Filename[stringlength - i - 1] == '/') - { - char *sTmp = (char *)malloc(stringlength - i); - strncpy(sTmp, Filename, stringlength - i - 1); - sTmp[stringlength - i - 1] = '\0'; -#ifdef DEBUG - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - *folder = strdup(sTmp); - free(sTmp); - break; - } - } -} - -static void SsaGetSubtitle(Context_t *context, char *Filename) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - struct dirent *dirzeiger; - DIR *dir; - int i = TEXTSSAOFFSET; - char *FilenameExtension = NULL; - char *FilenameFolder = NULL; - char *FilenameShort = NULL; - int FilenameLength = 0; - int FilenameShortLength = 0; - int FilenameFolderLength = 0; - int FilenameExtensionLength = 0; - - FilenameLength = strlen(Filename); - -#ifdef DEBUG - printf("%s::%s %s %d\n", FILENAME, __FUNCTION__, Filename, FilenameLength); -#endif - - getParentFolder(Filename, &FilenameFolder); - FilenameFolderLength = strlen(FilenameFolder); - -#ifdef DEBUG - printf("%s::%s %s %d\n", FILENAME, __FUNCTION__, FilenameFolder, FilenameFolderLength); -#endif - - getExtension(Filename, &FilenameExtension); - FilenameExtensionLength = strlen(FilenameExtension); - -#ifdef DEBUG - printf("%s::%s %s %d\n", FILENAME, __FUNCTION__, FilenameExtension, FilenameExtensionLength); -#endif - - FilenameShortLength = FilenameLength - FilenameFolderLength - 1 /* / */ - FilenameExtensionLength - 1 /* . */; - FilenameShort = (char *) malloc(FilenameShortLength + 1 /* \0 */); - strncpy(FilenameShort, Filename + (strlen(FilenameFolder) + 1 /* / */), FilenameShortLength); - FilenameShort[FilenameShortLength] = '\0'; - -#ifdef DEBUG - printf("%s::%s %s %d\n", FILENAME, __FUNCTION__, FilenameShort, FilenameShortLength); - printf("%s\n%s | %s | %s\n", Filename, FilenameFolder, FilenameShort, FilenameExtension); -#endif - - if ((dir = opendir(FilenameFolder)) != NULL) - { - while ((dirzeiger = readdir(dir)) != NULL) - { - char *extension = NULL; - -#ifdef DEBUG - printf("%s\n", (*dirzeiger).d_name); -#endif - getExtension((*dirzeiger).d_name, &extension); - - if (extension != NULL) - { - if (!strncmp(extension, "ssa", 3)) - { - //often the used language is added before .ssa so check - char *name = NULL; - char *subExtension = NULL; - char *language = NULL; - int nameLength = strlen((*dirzeiger).d_name) - 4; - - name = (char *) malloc(nameLength + 1); - strncpy(name, (*dirzeiger).d_name, nameLength); - name[nameLength] = '\0'; - - getExtension(name, &subExtension); -#ifdef DEBUG - printf("%s %s\n", name, subExtension); -#endif - - if (subExtension == NULL) - { -#ifdef DEBUG - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - language = strdup("und"); - - } - else - { - int tmpLength = strlen(name) /*- strlen(subExtension) - 1*/; - char *tmpName = (char *) malloc(tmpLength + 1); - strncpy(tmpName, name, tmpLength); - tmpName[tmpLength] = '\0'; - - free(name); -#ifdef DEBUG - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - name = strdup(tmpName); - free(tmpName); -#ifdef DEBUG - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - language = strdup(subExtension); - free(subExtension); - } - -#ifdef DEBUG - printf("%s %s %d\n", name, FilenameShort, FilenameShortLength); -#endif - - if (!strncmp(name, FilenameShort, FilenameShortLength)) - { - char *absSubtitleFilenam = (char *) malloc(strlen(FilenameFolder) + 1 + strlen((*dirzeiger).d_name)); - strcpy(absSubtitleFilenam, FilenameFolder); - strcat(absSubtitleFilenam, "/"); - strcat(absSubtitleFilenam, (*dirzeiger).d_name); - - SsaTrack_t SsaSubtitle = - { - absSubtitleFilenam, - i, - }; - SsaManagerAdd(context, SsaSubtitle); - - Track_t Subtitle = - { - language, - "S_TEXT/SSA", - i++, - }; - context->manager->subtitle->Command(context, MANAGER_ADD, &Subtitle); - } - - } - - free(extension); - } - } - closedir(dir); - } - - free(FilenameExtension); - free(FilenameFolder); - free(FilenameShort); - -} - -FILE *fssa = NULL; -#define MAXLINELENGTH 1000 - -static int SsaOpenSubtitle(Context_t *context, int trackid) -{ - - if (trackid < TEXTSSAOFFSET) - { - return -1; - } - - trackid %= TEXTSSAOFFSET; - -#ifdef DEBUG - printf("%s::%s %s\n", FILENAME, __FUNCTION__, Tracks[trackid].File); -#endif - - fssa = fopen(Tracks[trackid].File, "rb"); -#ifdef DEBUG - printf("%s::%s %s\n", FILENAME, __FUNCTION__, fssa ? "fssa!=NULL" : "fssa==NULL"); -#endif - if (!fssa) - return -1; - - return 0; -} - -static int SsaCloseSubtitle(Context_t *context) -{ - - if (fssa) - fclose(fssa); - - fssa = NULL; - - return 0; -} - -//Buffer size used in getLine function. Do not set to value less than 1 !!! -#define BUFFER_SIZE 14 - -char *SSAgetLine(FILE **fssa) -{ - char *strAux = NULL, *strInput; - char c[BUFFER_SIZE], ch; - int k, tam, tamAux; - - k = tamAux = 0; - - if (BUFFER_SIZE > 0) - { - - strInput = (char *)malloc(1 * sizeof(char)); - strInput[0] = '\0'; - - while (tamAux != 1) - { - - if ((ch = fgetc(*fssa)) != EOF) - { - ungetc(ch , *fssa); - fgets(c, BUFFER_SIZE, *fssa); - strAux = (char *)strchr(c, '\n'); - tam = strlen(c); - if (strAux != NULL) - { - tamAux = strlen(strAux); - tam--; - } - - k = k + tam; - strInput = (char *)realloc(strInput, (k + 1) * sizeof(char)); - - if (k != tam) - strncat(strInput, c, tam); - else - strncpy(strInput, c, tam); - - strInput[k] = '\0'; - - } - else tamAux = 1; - } - - } - - return strInput; - -} - -static void *SsaSubtitleThread(void *data) -{ - Context_t *context = (Context_t *) data; -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - unsigned long long int Pts = 0; - float Duration = 0; - char *Text = NULL; - - while (context->playback->isPlaying && fssa /*&& fgets(Data, MAXLINELENGTH, fssa)*/) - { -#ifdef DEBUG - printf("%s::%s \n", FILENAME, __FUNCTION__); -#endif - int comma; - static int max_comma = 32; /* let's use 32 for the case that the */ - /* amount of commas increase with newer SSA versions */ - - int hour1, min1, sec1, hunsec1, - hour2, min2, sec2, hunsec2, nothing; - char *line = NULL; - char line3[MAXLINELENGTH + 1], *line2; - char *tmp; - - do - { - line = SSAgetLine(&fssa); - } - while (sscanf(line, "Dialogue: Marked=%d,%d:%d:%d.%d,%d:%d:%d.%d," - "%[^\n\r]", ¬hing, - &hour1, &min1, &sec1, &hunsec1, - &hour2, &min2, &sec2, &hunsec2, - line3) < 9 - && - sscanf(line, "Dialogue: %d,%d:%d:%d.%d,%d:%d:%d.%d," - "%[^\n\r]", ¬hing, - &hour1, &min1, &sec1, &hunsec1, - &hour2, &min2, &sec2, &hunsec2, - line3) < 9); - - line2 = strchr(line3, ','); - for (comma = 4; comma < max_comma; comma ++) - { - tmp = line2; - if (!(tmp = strchr(++tmp, ','))) break; - if (*(++tmp) == ' ') break; - /* a space after a comma means we're already in a sentence */ - line2 = tmp; - } - - if (comma < max_comma)max_comma = comma; - /* eliminate the trailing comma */ - if (*line2 == ',') line2++; - - Pts = (hour1 * 3600 + min1 * 60 + sec1) * 1000 + hunsec1; - Duration = (hour2 * 3600 + min2 * 60 + sec2) * 1000 + hunsec2 - Pts; - Pts = Pts * 90; -#ifdef DEBUG - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - Text = strdup(line2); - context->output->subtitle->Write(context, (unsigned char *) Text, strlen(Text), Pts, NULL, 0, Duration, "subtitle"); - - free(Text); - Text = NULL; - continue; - } - if (Text) - { - free(Text); - Text = NULL; - } - - return NULL; -} - -static int SsaPlay(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int curtrackid = -1; - context->manager->subtitle->Command(context, MANAGER_GET, &curtrackid); - - if (SsaOpenSubtitle(context, curtrackid) == 0) - { - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - pthread_create(&thread_sub, &attr, &SsaSubtitleThread, context); - } - - return 0; -} - -static int SsaSwitchSubtitle(Context_t *context, int *arg) -{ - - SsaCloseSubtitle(context); - if (SsaOpenSubtitle(context, *arg) == 0) - { - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - pthread_create(&thread_sub, &attr, &SsaSubtitleThread, context); - } - - return 0; -} - -static int SsaDel(Context_t *context) -{ - - SsaCloseSubtitle(context); - SsaManagerDel(context); - return 0; -} - -static int Command(void *_context, ContainerCmd_t command, void *argument) -{ - Context_t *context = (Context_t *) _context; -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - switch (command) - { - case CONTAINER_INIT: - { - char *filename = (char *)argument; - SsaGetSubtitle(context, filename); - break; - } - case CONTAINER_PLAY: - { - SsaPlay(context); - break; - } - case CONTAINER_DEL: - { - SsaDel(context); - break; - } - case CONTAINER_SWITCH_SUBTITLE: - { -#ifdef DEBUG - printf("%s::%s CONTAINER_SWITCH_SUBTITLE id=%d\n", FILENAME, __FUNCTION__, *((int *) argument)); -#endif - - SsaSwitchSubtitle(context, (int *) argument); - break; - } - default: -#ifdef DEBUG - printf("%s::%s ConatinerCmd not supported! %d\n", FILENAME, __FUNCTION__, command); -#endif - break; - } - - return 0; -} - -static char *SsaCapabilities[] = { "ssa", NULL }; - -Container_t SsaContainer = -{ - "SSA", - &Command, - SsaCapabilities, -}; diff --git a/libeplayer2/container/utils.c b/libeplayer2/container/utils.c deleted file mode 100644 index e57c9f1..0000000 --- a/libeplayer2/container/utils.c +++ /dev/null @@ -1,114 +0,0 @@ -#include -#include -#include -#include -#include -#include -#undef memcpy -#include - -#include -#include -#include -#include -#include -#include -#include "utils.h" - -#ifdef __cplusplus -extern "C" { -#endif - -int utils_debug = 0; -#define utils_printf(x...) do { if (utils_debug)printf(x); } while (0) - -int lzo1x_decode(void *out, int *outlen, void *in, int *inlen) -{ - int state = 0; - int x; - LZOContext c; - c.in = in; - c.in_end = (uint8_t *)in + *inlen; - c.out = c.out_start = out; - c.out_end = (uint8_t *)out + * outlen; - c.error = 0; - x = GETB(c); - if (x > 17) - { - copy(&c, x - 17); - x = GETB(c); - if (x < 16) c.error |= LZO_ERROR; - } - if (c.in > c.in_end) - c.error |= LZO_INPUT_DEPLETED; - while (!c.error) - { - int cnt, back; - if (x > 15) - { - if (x > 63) - { - cnt = (x >> 5) - 1; - back = (GETB(c) << 3) + ((x >> 2) & 7) + 1; - } - else if (x > 31) - { - cnt = get_len(&c, x, 31); - x = GETB(c); - back = (GETB(c) << 6) + (x >> 2) + 1; - } - else - { - cnt = get_len(&c, x, 7); - back = (1 << 14) + ((x & 8) << 11); - x = GETB(c); - back += (GETB(c) << 6) + (x >> 2); - if (back == (1 << 14)) - { - if (cnt != 1) - c.error |= LZO_ERROR; - break; - } - } - } - else if (!state) - { - cnt = get_len(&c, x, 15); - copy(&c, cnt + 3); - x = GETB(c); - if (x > 15) - continue; - cnt = 1; - back = (1 << 11) + (GETB(c) << 2) + (x >> 2) + 1; - } - else - { - cnt = 0; - back = (GETB(c) << 2) + (x >> 2) + 1; - } - copy_backptr(&c, back, cnt + 2); - state = - cnt = x & 3; - copy(&c, cnt); - x = GETB(c); - } - *inlen = c.in_end - c.in; - if (c.in > c.in_end) - *inlen = 0; - *outlen = c.out_end - c.out; - return c.error; -} - -double av_int2dbl(int64_t v) -{ - if (v + v > 0xFFEULL << 52) - return 0.0 / 0.0; - return ldexp(((v & ((1LL << 52) - 1)) + (1LL << 52)) * (v >> 63 | 1), (v >> 52 & 0x7FF) - 1075); -} - -float av_int2flt(int32_t v) -{ - if (v + v > 0xFF000000U) - return 0.0 / 0.0; - return ldexp(((v & 0x7FFFFF) + (1 << 23)) * (v >> 31 | 1), (v >> 23 & 0xFF) - 150); -} diff --git a/libeplayer2/container/utils.h b/libeplayer2/container/utils.h deleted file mode 100644 index 0574802..0000000 --- a/libeplayer2/container/utils.h +++ /dev/null @@ -1,452 +0,0 @@ -#ifndef _UTILS_H -#define _UTILS_H - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Defines used by various modules */ - -#ifndef __cplusplus -#ifndef bool -#define bool unsigned char -#define false 0 -#define true 1 -#endif -#endif - -#define fast_memcpy(a,b,c) memcpy(a,b,c) -#define FFMAX(a,b) ((a) > (b) ? (a) : (b)) -#ifndef SIZE_MAX -#define SIZE_MAX ((size_t)-1) -#endif - -#define LZO_INPUT_DEPLETED 1 -#define LZO_OUTPUT_FULL 2 -#define LZO_INVALID_BACKPTR 4 -#define LZO_ERROR 8 - -#define LZO_INPUT_PADDING 8 -#define LZO_OUTPUT_PADDING 12 - -typedef struct LZOContext -{ - uint8_t *in, *in_end; - uint8_t *out_start, *out, *out_end; - int error; -} LZOContext; -static inline int get_byte(LZOContext *c) -{ - if (c->in < c->in_end) - return *c->in++; - c->error |= LZO_INPUT_DEPLETED; - return 1; -} - -#ifdef INBUF_PADDED -#define GETB(c) (*(c).in++) -#else -#define GETB(c) get_byte(&(c)) -#endif -static inline int get_len(LZOContext *c, int x, int mask) -{ - int cnt = x & mask; - if (!cnt) - { - while (!(x = get_byte(c))) cnt += 255; - cnt += mask + x; - } - return cnt; -} - -//#define UNALIGNED_LOADSTORE -#define BUILTIN_MEMCPY -#ifdef UNALIGNED_LOADSTORE -#define COPY2(d, s) *(uint16_t *)(d) = *(uint16_t *)(s); -#define COPY4(d, s) *(uint32_t *)(d) = *(uint32_t *)(s); -#elif defined(BUILTIN_MEMCPY) -#define COPY2(d, s) memcpy(d, s, 2); -#define COPY4(d, s) memcpy(d, s, 4); -#else -#define COPY2(d, s) (d)[0] = (s)[0]; (d)[1] = (s)[1]; -#define COPY4(d, s) (d)[0] = (s)[0]; (d)[1] = (s)[1]; (d)[2] = (s)[2]; (d)[3] = (s)[3]; -#endif - -/** - * \brief copy bytes from input to output buffer with checking - * \param cnt number of bytes to copy, must be >= 0 - */ -static inline void copy(LZOContext *c, int cnt) -{ - register uint8_t *src = c->in; - register uint8_t *dst = c->out; - if (cnt > c->in_end - src) - { - cnt = FFMAX(c->in_end - src, 0); - c->error |= LZO_INPUT_DEPLETED; - } - if (cnt > c->out_end - dst) - { - cnt = FFMAX(c->out_end - dst, 0); - c->error |= LZO_OUTPUT_FULL; - } -#if defined(INBUF_PADDED) && defined(OUTBUF_PADDED) - COPY4(dst, src); - src += 4; - dst += 4; - cnt -= 4; - if (cnt > 0) -#endif - memcpy(dst, src, cnt); - c->in = src + cnt; - c->out = dst + cnt; -} - -/** - * \brief copy previously decoded bytes to current position - * \param back how many bytes back we start - * \param cnt number of bytes to copy, must be >= 0 - * - * cnt > back is valid, this will copy the bytes we just copied, - * thus creating a repeating pattern with a period length of back. - */ -static inline void copy_backptr(LZOContext *c, int back, int cnt) -{ - register uint8_t *src = &c->out[-back]; - register uint8_t *dst = c->out; - if (src < c->out_start || src > dst) - { - c->error |= LZO_INVALID_BACKPTR; - return; - } - if (cnt > c->out_end - dst) - { - cnt = FFMAX(c->out_end - dst, 0); - c->error |= LZO_OUTPUT_FULL; - } - if (back == 1) - { - memset(dst, *src, cnt); - dst += cnt; - } - else - { -#ifdef OUTBUF_PADDED - COPY2(dst, src); - COPY2(dst + 2, src + 2); - src += 4; - dst += 4; - cnt -= 4; - if (cnt > 0) - { - COPY2(dst, src); - COPY2(dst + 2, src + 2); - COPY2(dst + 4, src + 4); - COPY2(dst + 6, src + 6); - src += 8; - dst += 8; - cnt -= 8; - } -#endif - if (cnt > 0) - { - int blocklen = back; - while (cnt > blocklen) - { - memcpy(dst, src, blocklen); - dst += blocklen; - cnt -= blocklen; - blocklen <<= 1; - } - memcpy(dst, src, cnt); - } - dst += cnt; - } - c->out = dst; -} - -int lzo1x_decode(void *out, int *outlen, void *in, int *inlen); -double av_int2dbl(int64_t v); -float av_int2flt(int32_t v); - -// Endianness -#define AF_FORMAT_BE (0<<0) // Big Endian -#define AF_FORMAT_LE (1<<0) // Little Endian -#define AF_FORMAT_END_MASK (1<<0) - -#if WORDS_BIGENDIAN // Native endian of cpu -#define AF_FORMAT_NE AF_FORMAT_BE -#else -#define AF_FORMAT_NE AF_FORMAT_LE -#endif - -// Signed/unsigned -#define AF_FORMAT_SI (0<<1) // Signed -#define AF_FORMAT_US (1<<1) // Unsigned -#define AF_FORMAT_SIGN_MASK (1<<1) - -// Fixed or floating point -#define AF_FORMAT_I (0<<2) // Int -#define AF_FORMAT_F (1<<2) // Foating point -#define AF_FORMAT_POINT_MASK (1<<2) - -// Bits used -#define AF_FORMAT_8BIT (0<<3) -#define AF_FORMAT_16BIT (1<<3) -#define AF_FORMAT_24BIT (2<<3) -#define AF_FORMAT_32BIT (3<<3) -#define AF_FORMAT_40BIT (4<<3) -#define AF_FORMAT_48BIT (5<<3) -#define AF_FORMAT_BITS_MASK (7<<3) - -// Special flags refering to non pcm data -#define AF_FORMAT_MU_LAW (1<<6) -#define AF_FORMAT_A_LAW (2<<6) -#define AF_FORMAT_MPEG2 (3<<6) // MPEG(2) audio -#define AF_FORMAT_AC3 (4<<6) // Dolby Digital AC3 -#define AF_FORMAT_IMA_ADPCM (5<<6) -#define AF_FORMAT_SPECIAL_MASK (7<<6) - -// PREDEFINED formats - -#define AF_FORMAT_U8 (AF_FORMAT_I|AF_FORMAT_US|AF_FORMAT_8BIT|AF_FORMAT_NE) -#define AF_FORMAT_S8 (AF_FORMAT_I|AF_FORMAT_SI|AF_FORMAT_8BIT|AF_FORMAT_NE) -#define AF_FORMAT_U16_LE (AF_FORMAT_I|AF_FORMAT_US|AF_FORMAT_16BIT|AF_FORMAT_LE) -#define AF_FORMAT_U16_BE (AF_FORMAT_I|AF_FORMAT_US|AF_FORMAT_16BIT|AF_FORMAT_BE) -#define AF_FORMAT_S16_LE (AF_FORMAT_I|AF_FORMAT_SI|AF_FORMAT_16BIT|AF_FORMAT_LE) -#define AF_FORMAT_S16_BE (AF_FORMAT_I|AF_FORMAT_SI|AF_FORMAT_16BIT|AF_FORMAT_BE) -#define AF_FORMAT_U24_LE (AF_FORMAT_I|AF_FORMAT_US|AF_FORMAT_24BIT|AF_FORMAT_LE) -#define AF_FORMAT_U24_BE (AF_FORMAT_I|AF_FORMAT_US|AF_FORMAT_24BIT|AF_FORMAT_BE) -#define AF_FORMAT_S24_LE (AF_FORMAT_I|AF_FORMAT_SI|AF_FORMAT_24BIT|AF_FORMAT_LE) -#define AF_FORMAT_S24_BE (AF_FORMAT_I|AF_FORMAT_SI|AF_FORMAT_24BIT|AF_FORMAT_BE) -#define AF_FORMAT_U32_LE (AF_FORMAT_I|AF_FORMAT_US|AF_FORMAT_32BIT|AF_FORMAT_LE) -#define AF_FORMAT_U32_BE (AF_FORMAT_I|AF_FORMAT_US|AF_FORMAT_32BIT|AF_FORMAT_BE) -#define AF_FORMAT_S32_LE (AF_FORMAT_I|AF_FORMAT_SI|AF_FORMAT_32BIT|AF_FORMAT_LE) -#define AF_FORMAT_S32_BE (AF_FORMAT_I|AF_FORMAT_SI|AF_FORMAT_32BIT|AF_FORMAT_BE) - -#define AF_FORMAT_FLOAT_LE (AF_FORMAT_F|AF_FORMAT_32BIT|AF_FORMAT_LE) -#define AF_FORMAT_FLOAT_BE (AF_FORMAT_F|AF_FORMAT_32BIT|AF_FORMAT_BE) - -#ifdef WORDS_BIGENDIAN -#define AF_FORMAT_U16_NE AF_FORMAT_U16_BE -#define AF_FORMAT_S16_NE AF_FORMAT_S16_BE -#define AF_FORMAT_U24_NE AF_FORMAT_U24_BE -#define AF_FORMAT_S24_NE AF_FORMAT_S24_BE -#define AF_FORMAT_U32_NE AF_FORMAT_U32_BE -#define AF_FORMAT_S32_NE AF_FORMAT_S32_BE -#define AF_FORMAT_FLOAT_NE AF_FORMAT_FLOAT_BE -#else -#define AF_FORMAT_U16_NE AF_FORMAT_U16_LE -#define AF_FORMAT_S16_NE AF_FORMAT_S16_LE -#define AF_FORMAT_U24_NE AF_FORMAT_U24_LE -#define AF_FORMAT_S24_NE AF_FORMAT_S24_LE -#define AF_FORMAT_U32_NE AF_FORMAT_U32_LE -#define AF_FORMAT_S32_NE AF_FORMAT_S32_LE -#define AF_FORMAT_FLOAT_NE AF_FORMAT_FLOAT_LE -#endif - -#define AF_FORMAT_UNKNOWN (-1) - -// be2me ... BigEndian to MachineEndian -// le2me ... LittleEndian to MachineEndian - -#ifdef WORDS_BIGENDIAN -#define be2me_16(x) (x) -#define be2me_32(x) (x) -#define be2me_64(x) (x) -#define le2me_16(x) bswap_16(x) -#define le2me_32(x) bswap_32(x) -#define le2me_64(x) bswap_64(x) -#else -#define be2me_16(x) bswap_16(x) -#define be2me_32(x) bswap_32(x) -#define be2me_64(x) bswap_64(x) -#define le2me_16(x) (x) -#define le2me_32(x) (x) -#define le2me_64(x) (x) -#endif - -#ifdef __GNUC__ - -struct unaligned_64 -{ - uint64_t l; -} __attribute__((packed)); -struct unaligned_32 -{ - uint32_t l; -} __attribute__((packed)); -struct unaligned_16 -{ - uint16_t l; -} __attribute__((packed)); - -#define AV_RN16(a) (((const struct unaligned_16 *) (a))->l) -#define AV_RN32(a) (((const struct unaligned_32 *) (a))->l) -#define AV_RN64(a) (((const struct unaligned_64 *) (a))->l) - -#define AV_WN16(a, b) (((struct unaligned_16 *) (a))->l) = (b) -#define AV_WN32(a, b) (((struct unaligned_32 *) (a))->l) = (b) -#define AV_WN64(a, b) (((struct unaligned_64 *) (a))->l) = (b) - -#else /* __GNUC__ */ - -#define AV_RN16(a) (*((uint16_t*)(a))) -#define AV_RN32(a) (*((uint32_t*)(a))) -#define AV_RN64(a) (*((uint64_t*)(a))) - -#define AV_WN16(a, b) *((uint16_t*)(a)) = (b) -#define AV_WN32(a, b) *((uint32_t*)(a)) = (b) -#define AV_WN64(a, b) *((uint64_t*)(a)) = (b) - -#endif /* !__GNUC__ */ - -/* endian macros */ -#define AV_RB8(x) (((uint8_t*)(x))[0]) -#define AV_WB8(p, d) do { ((uint8_t*)(p))[0] = (d); } while(0) - -#define AV_RL8(x) AV_RB8(x) -#define AV_WL8(p, d) AV_WB8(p, d) - -#ifdef HAVE_FAST_UNALIGNED -# ifdef WORDS_BIGENDIAN -# define AV_RB16(x) AV_RN16(x) -# define AV_WB16(p, d) AV_WN16(p, d) - -# define AV_RL16(x) bswap_16(AV_RN16(x)) -# define AV_WL16(p, d) AV_WN16(p, bswap_16(d)) -# else /* WORDS_BIGENDIAN */ -# define AV_RB16(x) bswap_16(AV_RN16(x)) -# define AV_WB16(p, d) AV_WN16(p, bswap_16(d)) - -# define AV_RL16(x) AV_RN16(x) -# define AV_WL16(p, d) AV_WN16(p, d) -# endif -#else /* HAVE_FAST_UNALIGNED */ -#define AV_RB16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1]) -#define AV_WB16(p, d) do { \ - ((uint8_t*)(p))[1] = (d); \ - ((uint8_t*)(p))[0] = (d)>>8; } while(0) - -#define AV_RL16(x) ((((uint8_t*)(x))[1] << 8) | \ - ((uint8_t*)(x))[0]) -#define AV_WL16(p, d) do { \ - ((uint8_t*)(p))[0] = (d); \ - ((uint8_t*)(p))[1] = (d)>>8; } while(0) -#endif - -#define AV_RB24(x) ((((uint8_t*)(x))[0] << 16) | \ - (((uint8_t*)(x))[1] << 8) | \ - ((uint8_t*)(x))[2]) -#define AV_WB24(p, d) do { \ - ((uint8_t*)(p))[2] = (d); \ - ((uint8_t*)(p))[1] = (d)>>8; \ - ((uint8_t*)(p))[0] = (d)>>16; } while(0) - -#define AV_RL24(x) ((((uint8_t*)(x))[2] << 16) | \ - (((uint8_t*)(x))[1] << 8) | \ - ((uint8_t*)(x))[0]) -#define AV_WL24(p, d) do { \ - ((uint8_t*)(p))[0] = (d); \ - ((uint8_t*)(p))[1] = (d)>>8; \ - ((uint8_t*)(p))[2] = (d)>>16; } while(0) - -#ifdef HAVE_FAST_UNALIGNED -# ifdef WORDS_BIGENDIAN -# define AV_RB32(x) AV_RN32(x) -# define AV_WB32(p, d) AV_WN32(p, d) - -# define AV_RL32(x) bswap_32(AV_RN32(x)) -# define AV_WL32(p, d) AV_WN32(p, bswap_32(d)) -# else /* WORDS_BIGENDIAN */ -# define AV_RB32(x) bswap_32(AV_RN32(x)) -# define AV_WB32(p, d) AV_WN32(p, bswap_32(d)) - -# define AV_RL32(x) AV_RN32(x) -# define AV_WL32(p, d) AV_WN32(p, d) -# endif -#else /* HAVE_FAST_UNALIGNED */ -#define AV_RB32(x) ((((uint8_t*)(x))[0] << 24) | \ - (((uint8_t*)(x))[1] << 16) | \ - (((uint8_t*)(x))[2] << 8) | \ - ((uint8_t*)(x))[3]) -#define AV_WB32(p, d) do { \ - ((uint8_t*)(p))[3] = (d); \ - ((uint8_t*)(p))[2] = (d)>>8; \ - ((uint8_t*)(p))[1] = (d)>>16; \ - ((uint8_t*)(p))[0] = (d)>>24; } while(0) - -#define AV_RL32(x) ((((uint8_t*)(x))[3] << 24) | \ - (((uint8_t*)(x))[2] << 16) | \ - (((uint8_t*)(x))[1] << 8) | \ - ((uint8_t*)(x))[0]) -#define AV_WL32(p, d) do { \ - ((uint8_t*)(p))[0] = (d); \ - ((uint8_t*)(p))[1] = (d)>>8; \ - ((uint8_t*)(p))[2] = (d)>>16; \ - ((uint8_t*)(p))[3] = (d)>>24; } while(0) -#endif - -#ifdef HAVE_FAST_UNALIGNED -# ifdef WORDS_BIGENDIAN -# define AV_RB64(x) AV_RN64(x) -# define AV_WB64(p, d) AV_WN64(p, d) - -# define AV_RL64(x) bswap_64(AV_RN64(x)) -# define AV_WL64(p, d) AV_WN64(p, bswap_64(d)) -# else /* WORDS_BIGENDIAN */ -# define AV_RB64(x) bswap_64(AV_RN64(x)) -# define AV_WB64(p, d) AV_WN64(p, bswap_64(d)) - -# define AV_RL64(x) AV_RN64(x) -# define AV_WL64(p, d) AV_WN64(p, d) -# endif -#else /* HAVE_FAST_UNALIGNED */ -#define AV_RB64(x) (((uint64_t)((uint8_t*)(x))[0] << 56) | \ - ((uint64_t)((uint8_t*)(x))[1] << 48) | \ - ((uint64_t)((uint8_t*)(x))[2] << 40) | \ - ((uint64_t)((uint8_t*)(x))[3] << 32) | \ - ((uint64_t)((uint8_t*)(x))[4] << 24) | \ - ((uint64_t)((uint8_t*)(x))[5] << 16) | \ - ((uint64_t)((uint8_t*)(x))[6] << 8) | \ - (uint64_t)((uint8_t*)(x))[7]) -#define AV_WB64(p, d) do { \ - ((uint8_t*)(p))[7] = (d); \ - ((uint8_t*)(p))[6] = (d)>>8; \ - ((uint8_t*)(p))[5] = (d)>>16; \ - ((uint8_t*)(p))[4] = (d)>>24; \ - ((uint8_t*)(p))[3] = (d)>>32; \ - ((uint8_t*)(p))[2] = (d)>>40; \ - ((uint8_t*)(p))[1] = (d)>>48; \ - ((uint8_t*)(p))[0] = (d)>>56; } while(0) - -#define AV_RL64(x) (((uint64_t)((uint8_t*)(x))[7] << 56) | \ - ((uint64_t)((uint8_t*)(x))[6] << 48) | \ - ((uint64_t)((uint8_t*)(x))[5] << 40) | \ - ((uint64_t)((uint8_t*)(x))[4] << 32) | \ - ((uint64_t)((uint8_t*)(x))[3] << 24) | \ - ((uint64_t)((uint8_t*)(x))[2] << 16) | \ - ((uint64_t)((uint8_t*)(x))[1] << 8) | \ - (uint64_t)((uint8_t*)(x))[0]) -#define AV_WL64(p, d) do { \ - ((uint8_t*)(p))[0] = (d); \ - ((uint8_t*)(p))[1] = (d)>>8; \ - ((uint8_t*)(p))[2] = (d)>>16; \ - ((uint8_t*)(p))[3] = (d)>>24; \ - ((uint8_t*)(p))[4] = (d)>>32; \ - ((uint8_t*)(p))[5] = (d)>>40; \ - ((uint8_t*)(p))[6] = (d)>>48; \ - ((uint8_t*)(p))[7] = (d)>>56; } while(0) -#endif - -static inline uint8_t av_clip_uint8(int a) -{ - if (a & (~255)) return (-a) >> 31; - else return a; -} - -#endif /* UTILS_H */ diff --git a/libeplayer2/include/common.h b/libeplayer2/include/common.h deleted file mode 100644 index 29839d4..0000000 --- a/libeplayer2/include/common.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef COMMON_H_ -#define COMMON_H_ - -#include "container.h" -#include "output.h" -#include "manager.h" -#include "playback.h" -#include - -typedef struct Context_s -{ - PlaybackHandler_t *playback; - ContainerHandler_t *container; - OutputHandler_t *output; - ManagerHandler_t *manager; -} Context_t; - - -#endif diff --git a/libeplayer2/include/container.h b/libeplayer2/include/container.h deleted file mode 100644 index f4be378..0000000 --- a/libeplayer2/include/container.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef CONTAINER_H_ -#define CONTAINER_H_ - -#include - -typedef enum { CONTAINER_INIT, CONTAINER_ADD, CONTAINER_CAPABILITIES, CONTAINER_PLAY, CONTAINER_STOP, CONTAINER_SEEK, CONTAINER_LENGTH, CONTAINER_DEL, CONTAINER_SWITCH_AUDIO, CONTAINER_SWITCH_SUBTITLE, CONTAINER_INFO } ContainerCmd_t; - -typedef struct Container_s -{ - char *Name; - int (* Command)(/*Context_t*/void *, ContainerCmd_t, void *); - char **Capabilities; - -} Container_t; - - -extern Container_t MkvContainer; -extern Container_t AviContainer; -extern Container_t Mp4Container; -extern Container_t AUDIOContainer; -extern Container_t TSContainer; -extern Container_t MPGContainer; -extern Container_t ASFContainer; - -static Container_t *AvailableContainer[] = -{ - &MkvContainer, - &AviContainer, - &Mp4Container, - &AUDIOContainer, - &TSContainer, - &MPGContainer, - &ASFContainer, - NULL -}; - -typedef struct ContainerHandler_s -{ - char *Name; - Container_t *selectedContainer; - Container_t *textSrtContainer; - Container_t *textSsaContainer; - int (* Command)(/*Context_t*/void *, ContainerCmd_t, void *); -} ContainerHandler_t; - -#endif diff --git a/libeplayer2/include/manager.h b/libeplayer2/include/manager.h deleted file mode 100644 index 0d0ccec..0000000 --- a/libeplayer2/include/manager.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef MANAGER_H_ -#define MANAGER_H_ - -#include - -typedef enum { MANAGER_ADD, MANAGER_LIST, MANAGER_GET, MANAGER_GETNAME, MANAGER_SET, MANAGER_GETENCODING, MANAGER_DEL } ManagerCmd_t; - -typedef struct Track_s -{ - char *Name; - char *Encoding; - int Id; -} Track_t; - -typedef struct Manager_s -{ - char *Name; - int (* Command)(/*Context_t*/void *, ManagerCmd_t, void *); - char **Capabilities; - -} Manager_t; - -typedef struct ManagerHandler_s -{ - char *Name; - Manager_t *audio; - Manager_t *video; - Manager_t *subtitle; -} ManagerHandler_t; - -#endif diff --git a/libeplayer2/include/output.h b/libeplayer2/include/output.h deleted file mode 100644 index 969b9eb..0000000 --- a/libeplayer2/include/output.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef OUTPUT_H_ -#define OUTPUT_H_ - -#include - -typedef enum {OUTPUT_INIT, OUTPUT_ADD, OUTPUT_DEL, OUTPUT_CAPABILITIES, OUTPUT_PLAY, OUTPUT_STOP, OUTPUT_PAUSE, OUTPUT_OPEN, OUTPUT_CLOSE, OUTPUT_FLUSH, OUTPUT_CONTINUE, OUTPUT_FASTFORWARD, OUTPUT_AVSYNC, OUTPUT_CLEAR, OUTPUT_PTS, OUTPUT_SWITCH, OUTPUT_SLOWMOTION, OUTPUT_AUDIOMUTE} OutputCmd_t; - - -typedef struct Output_s -{ - char *Name; - int (* Command)(/*Context_t*/void *, OutputCmd_t, void *); - int (* Write)(/*Context_t*/void *, unsigned char *, int, unsigned long long int, unsigned char *, const int, float, char *); - char **Capabilities; - -} Output_t; - -extern Output_t LinuxDvbOutput; -extern Output_t Enigma2Output; - -static Output_t *AvailableOutput[] = -{ - &LinuxDvbOutput, - &Enigma2Output, - NULL -}; - -typedef struct OutputHandler_s -{ - char *Name; - Output_t *audio; - Output_t *video; - Output_t *subtitle; - int (* Command)(/*Context_t*/void *, OutputCmd_t, void *); -} OutputHandler_t; - -#endif diff --git a/libeplayer2/include/playback.h b/libeplayer2/include/playback.h deleted file mode 100644 index fe2c8b0..0000000 --- a/libeplayer2/include/playback.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef PLAYBACK_H_ -#define PLAYBACK_H_ -#include - -typedef enum {PLAYBACK_OPEN, PLAYBACK_CLOSE, PLAYBACK_PLAY, PLAYBACK_STOP, PLAYBACK_PAUSE, PLAYBACK_CONTINUE, PLAYBACK_FLUSH, PLAYBACK_TERM, PLAYBACK_FASTFORWARD, PLAYBACK_SEEK, PLAYBACK_PTS, PLAYBACK_LENGTH, PLAYBACK_SWITCH_AUDIO, PLAYBACK_SWITCH_SUBTITLE, PLAYBACK_INFO, PLAYBACK_SLOWMOTION, PLAYBACK_FASTBACKWARD} PlaybackCmd_t; - -typedef struct PlaybackHandler_s -{ - char *Name; - - int fd; - - unsigned char isFile; - unsigned char isHttp; - unsigned char isUPNP; - - unsigned char isPlaying; - unsigned char isPaused; - unsigned char isForwarding; - unsigned char isSeeking; - unsigned char isCreationPhase; - - float BackWard; - int SlowMotion; - int Speed; - int AVSync; - - unsigned char isVideo; - unsigned char isAudio; - unsigned char isSubtitle; - - int (* Command)(/*Context_t*/void *, PlaybackCmd_t, void *); - char *uri; - off_t size; -} PlaybackHandler_t; - -#endif diff --git a/libeplayer2/include/stm_ioctls.h b/libeplayer2/include/stm_ioctls.h deleted file mode 100644 index 27cbd1c..0000000 --- a/libeplayer2/include/stm_ioctls.h +++ /dev/null @@ -1,263 +0,0 @@ -/* - * stm_ioctls.h - * - * Copyright (C) STMicroelectronics Limited 2005. All rights reserved. - * - * Extensions to the LinuxDVB API (v3) implemented by the Havana implemenation. - */ - -#ifndef H_STM_IOCTLS -#define H_STM_IOCTLS - -#define DVB_SPEED_NORMAL_PLAY 1000 -#define DVB_SPEED_STOPPED 0 -#define DVB_SPEED_REVERSE_STOPPED 0x80000000 -#define DVB_FRAME_RATE_MULTIPLIER 1000 - -#define VIDEO_FULL_SCREEN (VIDEO_CENTER_CUT_OUT+1) - -/* - * Extra events - */ - -#define VIDEO_EVENT_FIRST_FRAME_ON_DISPLAY 5 /*(VIDEO_EVENT_VSYNC+1)*/ -#define VIDEO_EVENT_FRAME_DECODED_LATE (VIDEO_EVENT_FIRST_FRAME_ON_DISPLAY+1) -#define VIDEO_EVENT_DATA_DELIVERED_LATE (VIDEO_EVENT_FRAME_DECODED_LATE+1) -#define VIDEO_EVENT_STREAM_UNPLAYABLE (VIDEO_EVENT_DATA_DELIVERED_LATE+1) -#define VIDEO_EVENT_TRICK_MODE_CHANGE (VIDEO_EVENT_STREAM_UNPLAYABLE+1) - -/* - * List of possible container types - used to select demux.. If stream_source is VIDEO_SOURCE_DEMUX - * then default is TRANSPORT, if stream_source is VIDEO_SOURCE_MEMORY then default is PES - */ -typedef enum -{ - STREAM_TYPE_NONE, /* Deprecated */ - STREAM_TYPE_TRANSPORT,/* Use latest PTI driver so it can be Deprecated */ - STREAM_TYPE_PES, - STREAM_TYPE_ES, /* Deprecated */ - STREAM_TYPE_PROGRAM, /* Deprecated */ - STREAM_TYPE_SYSTEM, /* Deprecated */ - STREAM_TYPE_SPU, /* Deprecated */ - STREAM_TYPE_NAVI, /* Deprecated */ - STREAM_TYPE_CSS, /* Deprecated */ - STREAM_TYPE_AVI, /* Deprecated */ - STREAM_TYPE_MP3, /* Deprecated */ - STREAM_TYPE_H264, /* Deprecated */ - STREAM_TYPE_ASF, /* Needs work so it can be deprecated */ - STREAM_TYPE_MP4, /* Deprecated */ - STREAM_TYPE_RAW, /* Deprecated */ -} stream_type_t; - -/* - * List of possible video encodings - used to select frame parser and codec. - */ -typedef enum -{ - VIDEO_ENCODING_AUTO, - VIDEO_ENCODING_MPEG1, - VIDEO_ENCODING_MPEG2, - VIDEO_ENCODING_MJPEG, - VIDEO_ENCODING_DIVX3, - VIDEO_ENCODING_DIVX4, - VIDEO_ENCODING_DIVX5, - VIDEO_ENCODING_MPEG4P2, - VIDEO_ENCODING_H264, - VIDEO_ENCODING_WMV, - VIDEO_ENCODING_VC1, - VIDEO_ENCODING_RAW, - VIDEO_ENCODING_H263, - VIDEO_ENCODING_FLV1, - VIDEO_ENCODING_VP6, - VIDEO_ENCODING_NONE, - VIDEO_ENCODING_PRIVATE -} video_encoding_t; - - -/* - * List of possible audio encodings - used to select frame parser and codec. - */ -typedef enum -{ - AUDIO_ENCODING_AUTO, - AUDIO_ENCODING_PCM, - AUDIO_ENCODING_LPCM, - AUDIO_ENCODING_MPEG1, - AUDIO_ENCODING_MPEG2, - AUDIO_ENCODING_MP3, - AUDIO_ENCODING_AC3, - AUDIO_ENCODING_DTS, - AUDIO_ENCODING_AAC, - AUDIO_ENCODING_WMA, - AUDIO_ENCODING_RAW, - AUDIO_ENCODING_LPCMA, - AUDIO_ENCODING_LPCMH, - AUDIO_ENCODING_LPCMB, - AUDIO_ENCODING_SPDIF, /* -#include - -#include "manager.h" -#include "common.h" - -static const char FILENAME[] = "audio.c"; - -#define TRACKWRAP 20 -static Track_t *Tracks; -static int TrackCount = 0; -static int CurrentTrack = 0; //TRACK[0] as default. - -static void ManagerAdd(Context_t *context, Track_t track) -{ - printf("%s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); - if (Tracks == NULL) - { - Tracks = malloc(sizeof(Track_t) * TRACKWRAP); - } - - if (TrackCount < TRACKWRAP) - { - Tracks[TrackCount].Name = strdup(track.Name); - Tracks[TrackCount].Encoding = strdup(track.Encoding); - Tracks[TrackCount].Id = track.Id; - TrackCount++; - } - else - { - //Track_t * tmp_Tracks = realoc(sizeof(Tracks)); - } - - if (TrackCount > 0) - context->playback->isAudio = 1; -} - -static char **ManagerList(Context_t *context) -{ - char **tracklist = NULL; - printf("%s::%s\n", FILENAME, __FUNCTION__); - if (Tracks != NULL) - { - int i = 0, j = 0; - tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1)); - for (i = 0, j = 0; i < TrackCount; i++, j += 2) - { - tracklist[j] = strdup(Tracks[i].Name); - tracklist[j + 1] = strdup(Tracks[i].Encoding); - } - tracklist[j] = NULL; - } - - return tracklist; -} - -static void ManagerDel(Context_t *context) -{ - - int i = 0; - if (Tracks != NULL) - { - for (i = 0; i < TrackCount; i++) - { - free(Tracks[i].Name); - free(Tracks[i].Encoding); - Tracks[i].Name = NULL; - Tracks[i].Encoding = NULL; - } - free(Tracks); - Tracks = NULL; - } - - TrackCount = 0; - CurrentTrack = 0; - context->playback->isAudio = 0; -} - - -static int Command(Context_t *context, ManagerCmd_t command, void *argument) -{ - //printf("%s::%s\n", FILENAME, __FUNCTION__); - - switch (command) - { - case MANAGER_ADD: - { - Track_t *track = argument; - ManagerAdd(context, *track); - break; - } - case MANAGER_LIST: - { - *((char ** *)argument) = (char **)ManagerList(context); - break; - } - case MANAGER_GET: - { - printf("%s::%s MANAGER_GET\n", FILENAME, __FUNCTION__); - if (TrackCount > 0) - *((int *)argument) = (int)Tracks[CurrentTrack].Id; - else - *((int *)argument) = (int) - 1; - break; - } - case MANAGER_GETENCODING: - { - if (TrackCount > 0) - *((char **)argument) = (char *)strdup(Tracks[CurrentTrack].Encoding); - else - *((char **)argument) = (char *)strdup(""); - break; - } - case MANAGER_GETNAME: - { - if (TrackCount > 0) - *((char **)argument) = (char *)strdup(Tracks[CurrentTrack].Name); - else - *((char **)argument) = (char *)strdup(""); - break; - } - case MANAGER_SET: - { - int id = *((int *)argument); - printf("%s::%s MANAGER_SET id=%d\n", FILENAME, __FUNCTION__, id); - if (id < TrackCount) - CurrentTrack = id; - break; - } - case MANAGER_DEL: - { - ManagerDel(context); - break; - } - default: - printf("%s::%s ContainerCmd %d not supported!\n", FILENAME, __FUNCTION__, command); - break; - } - - return 0; -} - - -struct Manager_s AudioManager = -{ - "Audio", - &Command, - NULL, - -}; diff --git a/libeplayer2/manager/manager.c b/libeplayer2/manager/manager.c deleted file mode 100644 index 78a5a36..0000000 --- a/libeplayer2/manager/manager.c +++ /dev/null @@ -1,13 +0,0 @@ -#include "manager.h" - -extern Manager_t AudioManager; -extern Manager_t VideoManager; -extern Manager_t SubtitleManager; - -ManagerHandler_t ManagerHandler = -{ - "ManagerHandler", - &AudioManager, - &VideoManager, - &SubtitleManager, -}; diff --git a/libeplayer2/manager/subtitle.c b/libeplayer2/manager/subtitle.c deleted file mode 100644 index b9238cb..0000000 --- a/libeplayer2/manager/subtitle.c +++ /dev/null @@ -1,149 +0,0 @@ -#include -#include - -#include "manager.h" -#include "common.h" - -static const char FILENAME[] = "subtitle.c"; - -#define TRACKWRAP 20 -static Track_t *Tracks; -static int TrackCount = 0; -static int CurrentTrack = -1; //no as default. - -static void ManagerAdd(Context_t *context, Track_t track) -{ - printf("%s::%s %s %s %d\n", FILENAME, __FUNCTION__, track.Name, track.Encoding, track.Id); - - if (Tracks == NULL) - { - Tracks = malloc(sizeof(Track_t) * TRACKWRAP); - } - - if (TrackCount < TRACKWRAP) - { - Tracks[TrackCount].Name = strdup(track.Name); - Tracks[TrackCount].Encoding = strdup(track.Encoding); - Tracks[TrackCount].Id = track.Id; - TrackCount++; - } - else - { - //Track_t * tmp_Tracks = realoc(sizeof(Tracks)); - } - - if (TrackCount > 0) - context->playback->isSubtitle = 1; -} - -static char **ManagerList(Context_t *context) -{ - char **tracklist = NULL; - printf("%s::%s\n", FILENAME, __FUNCTION__); - if (Tracks != NULL) - { - int i = 0, j = 0; - tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1)); - for (i = 0, j = 0; i < TrackCount; i++, j += 2) - { - tracklist[j] = strdup(Tracks[i].Name); - tracklist[j + 1] = strdup(Tracks[i].Encoding); - } - tracklist[j] = NULL; - } - - return tracklist; -} - -static void ManagerDel(Context_t *context) -{ - - int i = 0; - if (Tracks != NULL) - { - for (i = 0; i < TrackCount; i++) - { - free(Tracks[i].Name); - free(Tracks[i].Encoding); - Tracks[i].Name = NULL; - Tracks[i].Encoding = NULL; - } - free(Tracks); - Tracks = NULL; - } - - TrackCount = 0; - CurrentTrack = -1; - context->playback->isSubtitle = 0; -} - -static int Command(Context_t *context, ManagerCmd_t command, void *argument) -{ - //printf("%s::%s %d\n", FILENAME, __FUNCTION__, command); - - switch (command) - { - case MANAGER_ADD: - { - Track_t *track = argument; - ManagerAdd(context, *track); - break; - } - case MANAGER_LIST: - { - *((char ** *)argument) = (char **)ManagerList(context); - break; - } - case MANAGER_GET: - { - if (TrackCount > 0 && CurrentTrack >= 0) - *((int *)argument) = (int)Tracks[CurrentTrack].Id; - else - *((int *)argument) = (int) - 1; - break; - } - case MANAGER_GETENCODING: - { - if (TrackCount > 0 && CurrentTrack >= 0) - *((char **)argument) = (char *)strdup(Tracks[CurrentTrack].Encoding); - else - *((char **)argument) = (char *)strdup(""); - break; - } - case MANAGER_GETNAME: - { - if (TrackCount > 0 && CurrentTrack >= 0) - *((char **)argument) = (char *)strdup(Tracks[CurrentTrack].Name); - else - *((char **)argument) = (char *)strdup(""); - break; - } - case MANAGER_SET: - { - int id = *((int *)argument); - printf("%s::%s MANAGER_SET id=%d\n", FILENAME, __FUNCTION__, id); - if (id < TrackCount) - CurrentTrack = id; - break; - } - case MANAGER_DEL: - { - ManagerDel(context); - break; - } - default: - printf("ConatinerCmd not supported!"); - break; - } - - return 0; -} - - -struct Manager_s SubtitleManager = -{ - "Subtitle", - &Command, - NULL, - -}; diff --git a/libeplayer2/manager/video.c b/libeplayer2/manager/video.c deleted file mode 100644 index 23d1058..0000000 --- a/libeplayer2/manager/video.c +++ /dev/null @@ -1,148 +0,0 @@ -#include -#include - -#include "manager.h" -#include "common.h" - -static const char FILENAME[] = "video.c"; - -#define TRACKWRAP 4 -static Track_t *Tracks; -static int TrackCount = 0; -static int CurrentTrack = 0; //TRACK[0] as default. - -static void ManagerAdd(Context_t *context, Track_t track) -{ - printf("%s::%s\n", FILENAME, __FUNCTION__); - if (Tracks == NULL) - { - Tracks = malloc(sizeof(Track_t) * TRACKWRAP); - } - - if (TrackCount < TRACKWRAP) - { - Tracks[TrackCount].Name = strdup(track.Name); - Tracks[TrackCount].Encoding = strdup(track.Encoding); - Tracks[TrackCount].Id = track.Id; - TrackCount++; - } - else - { - //Track_t * tmp_Tracks = realoc(sizeof(Tracks)); - } - - if (TrackCount > 0) - context->playback->isVideo = 1; -} - -static char **ManagerList(Context_t *context) -{ - char **tracklist = NULL; - printf("%s::%s\n", FILENAME, __FUNCTION__); - if (Tracks != NULL) - { - int i = 0, j = 0; - tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1)); - for (i = 0, j = 0; i < TrackCount; i++, j += 2) - { - tracklist[j] = strdup(Tracks[i].Name); - tracklist[j + 1] = strdup(Tracks[i].Encoding); - } - tracklist[j] = NULL; - } - - return tracklist; -} - -static void ManagerDel(Context_t *context) -{ - - int i = 0; - if (Tracks != NULL) - { - for (i = 0; i < TrackCount; i++) - { - free(Tracks[i].Name); - free(Tracks[i].Encoding); - Tracks[i].Name = NULL; - Tracks[i].Encoding = NULL; - } - free(Tracks); - Tracks = NULL; - } - - TrackCount = 0; - CurrentTrack = 0; - context->playback->isVideo = 0; -} - -static int Command(void *_context, ManagerCmd_t command, void *argument) -{ - Context_t *context = (Context_t *) _context; - //printf("%s::%s\n", FILENAME, __FUNCTION__); - - switch (command) - { - case MANAGER_ADD: - { - Track_t *track = argument; - ManagerAdd(context, *track); - break; - } - case MANAGER_LIST: - { - *((char ** *)argument) = (char **)ManagerList(context); - break; - } - case MANAGER_GET: - { - if (TrackCount > 0) - *((int *)argument) = (int)Tracks[CurrentTrack].Id; - else - *((int *)argument) = (int) - 1; - break; - } - case MANAGER_GETENCODING: - { - if (TrackCount > 0) - *((char **)argument) = (char *)strdup(Tracks[CurrentTrack].Encoding); - else - *((char **)argument) = (char *)strdup(""); - break; - } - case MANAGER_GETNAME: - { - if (TrackCount > 0) - *((char **)argument) = (char *)strdup(Tracks[CurrentTrack].Name); - else - *((char **)argument) = (char *)strdup(""); - break; - } - case MANAGER_SET: - { - int id = (int) argument; - if (id < TrackCount) - CurrentTrack = id; - break; - } - case MANAGER_DEL: - { - ManagerDel(context); - break; - } - default: - printf("%s::%s ContainerCmd %d not supported!\n", FILENAME, __FUNCTION__, command); - break; - } - - return 0; -} - - -struct Manager_s VideoManager = -{ - "Video", - &Command, - NULL, - -}; diff --git a/libeplayer2/output/enigma2.c b/libeplayer2/output/enigma2.c deleted file mode 100644 index cecb1f3..0000000 --- a/libeplayer2/output/enigma2.c +++ /dev/null @@ -1,549 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" - -//#ifndef DEBUG -//#define DEBUG // FIXME: until this is set properly by Makefile -//#endif - -static const char FILENAME[] = "enigma2.c"; - -/* -Number, Style, Name,, MarginL, MarginR, MarginV, Effect,, Text - -1038,0,tdk,,0000,0000,0000,,That's not good. -1037,0,tdk,,0000,0000,0000,,{\i1}Rack them up, rack them up,{\i0}\N{\i1}rack them up.{\i0} [90] -1036,0,tdk,,0000,0000,0000,,Okay, rack them up. -*/ - -void replace_all(char **string, char *search, char *replace) -{ - - int len = 0; - char *ptr = NULL; - char tempString[512]; - char newString[512]; - newString[0] = '\0'; - strncpy(tempString, *string, 511); - tempString[511] = '\0'; - - free(*string); - - - - while ((ptr = strstr(tempString, search)) != NULL) - { - len = ptr - tempString; - strncpy(newString, tempString, len); - newString[len] = '\0'; - strcat(newString, replace); - - len += strlen(search); - strcat(newString, tempString + len); - - strcpy(tempString, newString); - } -#ifdef DEBUG - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - if (newString[0] != '\0') - *string = strdup(newString); - else - *string = strdup(tempString); - -} - -int Enigma2ParseASS(char **Line) -{ -#ifdef DEBUG - printf("%s::%s -> Text=%s\n", FILENAME, __FUNCTION__, *Line); - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - char *Text = strdup(*Line); - int i; - char *ptr1; - - ptr1 = Text; - for (i = 0; i < 8 && *ptr1 != '\0'; ptr1++) - { -#ifdef DEBUG - printf("%s", ptr1); -#endif - if (*ptr1 == ',') - i++; - } - - free(*Line); -#ifdef DEBUG - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - *Line = strdup(ptr1); - free(Text); - - replace_all(Line, "\\N", "\n"); - - replace_all(Line, "{\\i1}", ""); - replace_all(Line, "{\\i0}", ""); - -#ifdef DEBUG - printf("%s::%s <- Text=%s\n", FILENAME, __FUNCTION__, *Line); -#endif - return 0; -} - -int Enigma2ParseSRT(char **Line) -{ -#ifdef DEBUG - printf("%s::%s -> Text=%s\n", FILENAME, __FUNCTION__, *Line); -#endif - - replace_all(Line, "\x0d", ""); - replace_all(Line, "\n\n", "\\N"); - replace_all(Line, "\n", ""); - replace_all(Line, "\\N", "\n"); - replace_all(Line, "ö", "oe"); - replace_all(Line, "ä", "ae"); - replace_all(Line, "ü", "ue"); - replace_all(Line, "Ö", "Oe"); - replace_all(Line, "Ä", "Ae"); - replace_all(Line, "Ü", "Ue"); - replace_all(Line, "ß", "ss"); - -#ifdef DEBUG - printf("%s::%s <- Text=%s\n", FILENAME, __FUNCTION__, *Line); -#endif - return 0; -} - -int Enigma2ParseSSA(char **Line) -{ -#ifdef DEBUG - printf("%s::%s -> Text=%s\n", FILENAME, __FUNCTION__, *Line); -#endif - - replace_all(Line, "\x0d", ""); - replace_all(Line, "\n\n", "\\N"); - replace_all(Line, "\n", ""); - replace_all(Line, "\\N", "\n"); - replace_all(Line, "ö", "oe"); - replace_all(Line, "ä", "ae"); - replace_all(Line, "ü", "ue"); - replace_all(Line, "Ö", "Oe"); - replace_all(Line, "Ä", "Ae"); - replace_all(Line, "Ü", "Ue"); - replace_all(Line, "ß", "ss"); - -#ifdef DEBUG - printf("%s::%s <- Text=%s\n", FILENAME, __FUNCTION__, *Line); -#endif - return 0; -} - -static pthread_t thread_sub; -void *_smp3 = NULL; -void (*_fkt)(long int, size_t, char *, void *); - -int eplayerCreateSubtitleSink() -{ -#ifdef DEBUG - printf("eplayerCreateSubtitleSink->\n"); -#endif - - return 0; -} - -struct sub_t -{ - char *text; - unsigned long long int pts; - unsigned long int milliDuration; -}; - -#define PUFFERSIZE 2 -static struct sub_t subPuffer[PUFFERSIZE]; -static int nextSubPointer = 0; -static int freeSubPointer = 0; - - -void addSub(Context_t *context, char *text, unsigned long long int pts, unsigned long int milliDuration) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - if (context && context->playback && !context->playback->isPlaying) - return; - - while (subPuffer[freeSubPointer].text != NULL) - { - //List is full, wait till we got some free space - - if (context && context->playback && !context->playback->isPlaying) - return; - - sleep(1); - } -#ifdef DEBUG - printf("from mkv: %s pts:%lld milliDuration:%lld\n", text, pts, milliDuration); - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - subPuffer[freeSubPointer].text = strdup(text); - subPuffer[freeSubPointer].pts = pts; - subPuffer[freeSubPointer].milliDuration = milliDuration; - - freeSubPointer++; - freeSubPointer %= PUFFERSIZE; - -} - -int getNextSub(char **text, unsigned long long int *pts, long int *milliDuration) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - if (subPuffer[nextSubPointer].text == NULL || - subPuffer[nextSubPointer].pts == 0 || - subPuffer[nextSubPointer].milliDuration == 0) - { - - return -1; - } -#ifdef DEBUG - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - *text = strdup(subPuffer[nextSubPointer].text); - free(subPuffer[nextSubPointer].text); - subPuffer[nextSubPointer].text = NULL; - - *pts = subPuffer[nextSubPointer].pts; - subPuffer[nextSubPointer].pts = 0; - - *milliDuration = subPuffer[nextSubPointer].milliDuration; - subPuffer[nextSubPointer].milliDuration = 0; - - nextSubPointer++; - nextSubPointer %= PUFFERSIZE; -#ifdef DEBUG - printf("nextSubPointer %d\n", nextSubPointer); -#endif - - return 0; -} - -static void *Enigma2SubtitleThread(void *data) -{ - Context_t *context = (Context_t *) data; -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - char *subText = NULL; - long int subMilliDuration = 0; - unsigned long long int subPts = 0; - unsigned long long int Pts = 0; - - //wait a little, so isPlaying is set - //sleep(1); - while (context->playback->isCreationPhase) - { -#ifdef DEBUG - printf("%s::%s Thread waiting for end of init phase...\n", FILENAME, __FUNCTION__); -#endif - } - - while (context && - context->playback && - context->playback->isPlaying) - { - - int curtrackid = -1; - if (context && context->manager && context->manager->subtitle) - context->manager->subtitle->Command(context, MANAGER_GET, &curtrackid); - - if (curtrackid >= 0) - { - if (getNextSub(&subText, &subPts, &subMilliDuration) != 0) - { - usleep(500000); - continue; - } - - if (context && context->playback) - context->playback->Command(context, PLAYBACK_PTS, &Pts); - else return NULL; - - if (Pts > subPts) - { - if (subText != NULL) - free(subText); - continue; - } - -#ifdef DEBUG - printf("%s::%s %llu < %llu\n", FILENAME, __FUNCTION__, Pts, subPts); -#endif - - while (context && - context->playback && - context->playback->isPlaying && - Pts < subPts) - { - - unsigned long int diff = subPts - Pts; - diff = (diff * 1000) / 90.0; -#ifdef DEBUG - printf("DIFF: %d\n", diff); -#endif - if (diff > 100) - usleep(diff); - - if (context && context->playback) - context->playback->Command(context, PLAYBACK_PTS, &Pts); - else return NULL; - -#ifdef DEBUG - printf("%s::%s cur: %llu wanted: %llu\n", FILENAME, __FUNCTION__, Pts, subPts); -#endif - } - - if (context && - context->playback && - context->playback->isPlaying && - subText != NULL) - { - - if (_fkt != NULL) - _fkt(subMilliDuration, strlen(subText), subText, _smp3); -#ifdef DEBUG - else - printf("%s::%s \{%ld\} \[%d\] \"%s\"\n", FILENAME, __FUNCTION__, subMilliDuration, strlen(subText), subText); -#endif - - free(subText); - } - - } - else //Wait - usleep(500000); - - } - return NULL; -} - - - - -static int Write(void *_context, unsigned char *PLAYERData, int DataLength, unsigned long long int Pts, unsigned char *Private, const int PrivateLength, float Duration, char *type) -{ - Context_t *context = (Context_t *) _context; -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - char *Encoding = NULL; - char *Text = strdup((const char *) PLAYERData); - - context->manager->subtitle->Command(context, MANAGER_GETENCODING, &Encoding); - -#ifdef DEBUG - printf("%s::%s %s\n", FILENAME, __FUNCTION__, Encoding); - printf("%s::%s %s [%d]\n", FILENAME, __FUNCTION__, Text, DataLength); -#endif - - if (!strncmp("S_TEXT/SSA", Encoding, 10) || - !strncmp("S_SSA", Encoding, 5)) - Enigma2ParseSSA(&Text); - else if (!strncmp("S_TEXT/ASS", Encoding, 10) || - !strncmp("S_AAS", Encoding, 5)) - Enigma2ParseASS(&Text); - else if (!strncmp("S_TEXT/SRT", Encoding, 10) || - !strncmp("S_SRT", Encoding, 5)) - Enigma2ParseSRT(&Text); - else - ; - -#ifdef DEBUG - printf("%s::%s %s\n", FILENAME, __FUNCTION__, Text); -#endif - - addSub(context, Text, Pts, Duration * 1000); - free(Text); - free(Encoding); - - return 0; -} - -static int Enigma2Open(context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - //Reset all - nextSubPointer = 0; - freeSubPointer = 0; - int i; - for (i = 0; i < PUFFERSIZE; i++) - { - subPuffer[i].text = NULL; - subPuffer[i].pts = 0; - subPuffer[i].milliDuration = 0; - } - - return 0; -} - -static int Enigma2Close(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - //Reset all - nextSubPointer = 0; - freeSubPointer = 0; - int i; - for (i = 0; i < PUFFERSIZE; i++) - { - subPuffer[i].text = NULL; - subPuffer[i].pts = 0; - subPuffer[i].milliDuration = 0; - } - - return 0; -} - -static int Enigma2Play(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - pthread_create(&thread_sub, &attr, &Enigma2SubtitleThread, (void *) context); - - return 0; -} - -static int Enigma2Stop(context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - //pthread_join (&thread_sub, NULL, &sub_loop, NULL); - - return 0; -} - -void Enigma2SignalConnect(void (*fkt)(long int, size_t, char *, void *)) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - _fkt = fkt; -} - -void Enigma2SignalConnectBuffer(void *smp3) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - _smp3 = smp3; -} - -static int Command(void *_context, OutputCmd_t command, void *argument) -{ - Context_t *context = (Context_t *) _context; -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int ret = 0; - - switch (command) - { - case OUTPUT_OPEN: - { - Enigma2Open(context); - break; - } - case OUTPUT_CLOSE: - { - Enigma2Close(context); - break; - } - case OUTPUT_PLAY: - { - Enigma2Play(context); - break; - } - case OUTPUT_STOP: - { - Enigma2Stop(context); - break; - } - case OUTPUT_SWITCH: - { - //Enigma2Switch(context, (char*)argument); - break; - } - case 222: //Subtitle function register hack - { - Enigma2SignalConnect(argument); - break; - } - case 223: //Subtitle buffer register hack - { - Enigma2SignalConnectBuffer(argument); - break; - } - /*case OUTPUT_FLUSH: { - Enigma2Flush(context, (char*)argument); - break; - } - case OUTPUT_PAUSE: { - Enigma2Pause(context, (char*)argument); - break; - } - case OUTPUT_CONTINUE: { - Enigma2Continue(context, (char*)argument); - break; - }*/ - - default: -#ifdef DEBUG - printf("%s::%s OutputCmd %d not supported!\n", FILENAME, __FUNCTION__, command); -#endif - break; - } - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - - -static char *Enigma2Capabilitis[] = { "subtitle", NULL }; - -struct Output_s Enigma2Output = -{ - "Enigma2", - &Command, - &Write, - Enigma2Capabilitis, - -}; - diff --git a/libeplayer2/output/linuxdvb.c b/libeplayer2/output/linuxdvb.c deleted file mode 100644 index 329448d..0000000 --- a/libeplayer2/output/linuxdvb.c +++ /dev/null @@ -1,1821 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" -#include "stm_ioctls.h" - -/* #define DEBUG */ - -#ifdef DEBUG -int debugdvb = 0; -#define dprintf(x...) do { if (debugdvb)printf(x); } while (0) -#endif - -static const char FILENAME[] = "linuxdvb.c"; - -static const char VIDEODEV[] = "/dev/dvb/adapter0/video0"; -static const char AUDIODEV[] = "/dev/dvb/adapter0/audio0"; -static const char DVRDEV[] = "/dev/dvb/adapter0/dvr0"; - -static int videofd = -1; -static int audiofd = -1; -static int dvrfd = -1; - -static int LinuxDvbPtsStart(Context_t *context); -static pthread_t PtsThread; -static unsigned char isPTSThreadCreated = 0; - -unsigned long long int sCURRENT_PTS = 0; -static const unsigned int cSLEEPTIME = 500000; - -pthread_mutex_t LinuxDVBmutex; - -void getLinuxDVBMutex(const char *filename, const char *function, int line) -{ -#ifdef DEBUG - printf("%s::%s::%d requesting mutex\n", filename, function, line); -#endif - pthread_mutex_lock(&LinuxDVBmutex); -#ifdef DEBUG - printf("%s::%s::%d received mutex\n", filename, function, line); -#endif -} - -void releaseLinuxDVBMutex(const char *filename, const char *function, int line) -{ - pthread_mutex_unlock(&LinuxDVBmutex); -#ifdef DEBUG - printf("%s::%s::%d released mutex\n", filename, function, line); -#endif -} - -int LinuxDvbOpen(Context_t *context, char *type) -{ - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - -#ifdef DEBUG - printf("%s::%s v%d a%d\n", FILENAME, __FUNCTION__, video, audio); -#endif - - if (video && videofd == -1) - { - videofd = open(VIDEODEV, O_RDWR); - - if (videofd < 0) - { - printf("%s::%s %s\n", FILENAME, __FUNCTION__, strerror(errno)); - return -1; - } - - ioctl(videofd, VIDEO_CLEAR_BUFFER , 0); - ioctl(videofd, VIDEO_SELECT_SOURCE, (void *)VIDEO_SOURCE_MEMORY); - ioctl(videofd, VIDEO_SET_STREAMTYPE, (void *)STREAM_TYPE_PROGRAM); - - } - if (audio && audiofd == -1) - { - audiofd = open(AUDIODEV, O_RDWR); - - if (audiofd < 0) - { - printf("%s::%s %s\n", FILENAME, __FUNCTION__, strerror(errno)); - return -1; - } - - ioctl(audiofd, AUDIO_CLEAR_BUFFER, 0); - ioctl(audiofd, AUDIO_SELECT_SOURCE, (void *)AUDIO_SOURCE_MEMORY); - ioctl(audiofd, AUDIO_SET_STREAMTYPE, (void *)STREAM_TYPE_PROGRAM); - } - if ((video || audio) && dvrfd == -1) - dvrfd = open(DVRDEV, O_RDWR); - - return 0; -} - -int LinuxDvbClose(Context_t *context, char *type) -{ - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - -#ifdef DEBUG - printf("%s::%s v%d a%d\n", FILENAME, __FUNCTION__, video, audio); -#endif - - if (video && videofd != -1) - { - close(videofd); - videofd = -1; - } - if (audio && audiofd != -1) - { - close(audiofd); - audiofd = -1; - } - if ((video || audio) && dvrfd != -1) - { - close(dvrfd); - dvrfd = -1; - } - - return 0; -} - -int LinuxDvbPlay(Context_t *context, char *type) -{ - int ret = -1; - - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - -#ifdef DEBUG - printf("%s::%s v%d a%d\n", FILENAME, __FUNCTION__, video, audio); -#endif - - //if (!context->playback->isPlaying) { - if (video && videofd != -1) - { - char *Encoding = NULL; - context->manager->video->Command(context, MANAGER_GETENCODING, &Encoding); - -#ifdef DEBUG - printf("%s::%s V %s\n", FILENAME, __FUNCTION__, Encoding); -#endif - if (!strcmp(Encoding, "V_MPEG2")) - ioctl(videofd, VIDEO_SET_ENCODING, (void *)VIDEO_ENCODING_AUTO); - else if (!strcmp(Encoding, "V_MSCOMP") || !strcmp(Encoding, "V_MS/VFW/FOURCC") || !strcmp(Encoding, "V_MKV/XVID")) - ioctl(videofd, VIDEO_SET_ENCODING, (void *)VIDEO_ENCODING_MPEG4P2); - else if (!strcmp(Encoding, "V_MPEG4/ISO/AVC") || !strcmp(Encoding, "V_MPEG2/H264")) - ioctl(videofd, VIDEO_SET_ENCODING, (void *)VIDEO_ENCODING_H264); - else if (!strcmp(Encoding, "V_WMV")) - ioctl(videofd, VIDEO_SET_ENCODING, (void *)VIDEO_ENCODING_WMV); - else - ioctl(videofd, VIDEO_SET_ENCODING, (void *)VIDEO_ENCODING_AUTO); - - ioctl(videofd, VIDEO_PLAY, NULL); - free(Encoding); - } - if (audio && audiofd != -1) - { - char *Encoding = NULL; - context->manager->audio->Command(context, MANAGER_GETENCODING, &Encoding); - -#ifdef DEBUG - printf("%s::%s A %s\n", FILENAME, __FUNCTION__, Encoding); -#endif - if (!strcmp(Encoding, "A_AC3")) - ioctl(audiofd, AUDIO_SET_ENCODING, (void *)AUDIO_ENCODING_AC3); - else if (!strcmp(Encoding, "A_MP3") || !strcmp(Encoding, "A_MPEG/L3") || !strcmp(Encoding, "A_MS/ACM")) - ioctl(audiofd, AUDIO_SET_ENCODING, (void *)AUDIO_ENCODING_MP3); - else if (!strcmp(Encoding, "A_DTS")) - ioctl(audiofd, AUDIO_SET_ENCODING, (void *)AUDIO_ENCODING_DTS); - else if (!strcmp(Encoding, "A_AAC")) - ioctl(audiofd, AUDIO_SET_ENCODING, (void *)AUDIO_ENCODING_AAC); - else if (!strcmp(Encoding, "A_WMA")) - ioctl(audiofd, AUDIO_SET_ENCODING, (void *)AUDIO_ENCODING_WMA); - else - ioctl(audiofd, AUDIO_SET_ENCODING, (void *)AUDIO_ENCODING_AUTO); - - ioctl(audiofd, AUDIO_PLAY, NULL); - free(Encoding); - } - - ret = LinuxDvbPtsStart(context); - //} - - return ret; -} - -int LinuxDvbStop(Context_t *context, char *type) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int ret = 0; - int wait_time = 20; - - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - -#ifdef DEBUG - printf("%s::%s v%d a%d\n", FILENAME, __FUNCTION__, video, audio); -#endif - - while ((isPTSThreadCreated != 0) && (--wait_time) > 0) - { -#ifdef DEBUG - printf("%s::%s Waiting for LinuxDVB thread to terminate itself, will try another %d times\n", FILENAME, __FUNCTION__, wait_time); -#endif - usleep(cSLEEPTIME); - } - - if (wait_time == 0) - { -#ifdef DEBUG - printf("%s::%s Timeout waiting for LinuxDVB thread!\n", FILENAME, __FUNCTION__); -#endif - ret = -1; - } - else - { -#ifdef DEBUG - printf("%s::%s LinuxDVB thread is terminated\n", FILENAME, __FUNCTION__); -#endif - ret = 0; - } - - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - -// if ( context && context->playback && (context->playback->isPlaying || context->playback->isPaused) ) { - if (video && videofd != -1) - { - ioctl(videofd, VIDEO_CLEAR_BUFFER , 0); - ioctl(videofd, VIDEO_STOP, NULL); - } - if (audio && audiofd != -1) - { - ioctl(audiofd, AUDIO_CLEAR_BUFFER , 0); - ioctl(audiofd, AUDIO_STOP, NULL); - } - /* } else { - #ifdef DEBUG - printf("%s::%s not doing ioctl!\n", FILENAME, __FUNCTION__); - #endif - } - */ - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - - return ret; -} - -int LinuxDvbPause(Context_t *context, char *type) -{ - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - -#ifdef DEBUG - printf("%s::%s v%d a%d\n", FILENAME, __FUNCTION__, video, audio); -#endif - - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - - //if (!context->playback->isPaused) { - if (video && videofd != -1) - { - ioctl(videofd, VIDEO_FREEZE, NULL); - } - if (audio && audiofd != -1) - { - ioctl(audiofd, AUDIO_PAUSE, NULL); - } - //} - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - - - return 0; -} - -int LinuxDvbContinue(Context_t *context, char *type) -{ - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - -#ifdef DEBUG - printf("%s::%s v%d a%d\n", FILENAME, __FUNCTION__, video, audio); -#endif - - //if (context->playback->isPaused || context->playback->isForwarding || context->playback->SlowMotion) { - if (video && videofd != -1) - { - ioctl(videofd, VIDEO_CONTINUE, NULL); - } - if (audio && audiofd != -1) - { - ioctl(audiofd, AUDIO_CONTINUE, NULL); - } - //} - -#ifdef DEBUG - printf("%s::%s exiting\n", FILENAME, __FUNCTION__); -#endif - - return 0; -} - -int LinuxDvbAudioMute(Context_t *context, char *flag) -{ - -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - //if (context->playback->isPaused || context->playback->isForwarding || context->playback->SlowMotion) { - if (audiofd != -1) - { - if (*flag == '1') - ioctl(audiofd, AUDIO_SET_MUTE, 1); - else - ioctl(audiofd, AUDIO_SET_MUTE, 0); - } - //} - -#ifdef DEBUG - printf("%s::%s exiting\n", FILENAME, __FUNCTION__); -#endif - - return 0; -} - - -int LinuxDvbFlush(Context_t *context, char *type) -{ - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - -#ifdef DEBUG - printf("%s::%s v%d a%d\n", FILENAME, __FUNCTION__, video, audio); -#endif - - //if (context->playback->isPlaying || context->playback->isPaused) { - if ((video && videofd != -1) || (audio && audiofd != -1)) // trick to create only one Mutex - { - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - - if (video && videofd != -1) - { - ioctl(videofd, VIDEO_FLUSH , NULL); - ioctl(videofd, VIDEO_STOP, NULL); - } - - if (audio && audiofd != -1) - { - ioctl(audiofd, AUDIO_FLUSH , NULL); - ioctl(audiofd, AUDIO_STOP, NULL); - } - - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - } - //} - -#ifdef DEBUG - printf("%s::%s exiting\n", FILENAME, __FUNCTION__); -#endif - return 0; -} - -int LinuxDvbFastForward(Context_t *context, char *type) -{ - int ret = 0; - - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - -#ifdef DEBUG - printf("%s::%s v%d a%d\n", FILENAME, __FUNCTION__, video, audio); -#endif - - //if (context->playback->isPlaying && !context->playback->isPaused) { - if ((video && videofd != -1) || (audio && audiofd != -1)) // trick to create only one Mutex - { - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - - if (video && videofd != -1) - { - ioctl(videofd, VIDEO_FAST_FORWARD, context->playback->Speed); - } - if (audio && audiofd != -1) //not supported - { - // ioctl(audiofd, AUDIO_FAST_FORWARD, context->playback->Speed); - ret = -1; - } - - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - } - //} - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -int LinuxDvbSlowMotion(Context_t *context, char *type) -{ - int ret = 0; - - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - -#ifdef DEBUG - printf("%s::%s v%d a%d\n", FILENAME, __FUNCTION__, video, audio); -#endif - - //if (context->playback->isPlaying && !context->playback->isPaused) { - if ((video && videofd != -1) || (audio && audiofd != -1)) // trick to create only one Mutex - { - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - - if (video && videofd != -1) - { - ioctl(videofd, VIDEO_SLOWMOTION, context->playback->SlowMotion); - } - if (audio && audiofd != -1) //not supported - { - // ioctl(audiofd, AUDIO_SLOWMOTION, context->playback->SlowMotion); - ret = -1; - } - - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - } - //} - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -int LinuxDvbAVSync(Context_t *context, char *type) -{ -#ifdef DEBUG - unsigned char video = !strcmp("video", type); -#endif - unsigned char audio = !strcmp("audio", type); - -#ifdef DEBUG - printf("%s::%s v%d a%d\n", FILENAME, __FUNCTION__, video, audio); -#endif - - if (audio && audiofd != -1) - { - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - ioctl(audiofd, AUDIO_SET_AV_SYNC, context->playback->AVSync); - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - } - - return 0; -} - -int LinuxDvbClear(Context_t *context, char *type) -{ - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - -#ifdef DEBUG - printf("%s::%s v%d a%d\n", FILENAME, __FUNCTION__, video, audio); -#endif - - //if (context->playback->isPlaying || context->playback->isPaused) { - if ((video && videofd != -1) || (audio && audiofd != -1)) // trick to create only one Mutex - { - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - if (video && videofd != -1) - { - ioctl(videofd, VIDEO_CLEAR_BUFFER , 0); - } - if (audio && audiofd != -1) - { - ioctl(audiofd, AUDIO_CLEAR_BUFFER , 0); - } - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - } - //} - -#ifdef DEBUG - printf("%s::%s exiting\n", FILENAME, __FUNCTION__); -#endif - - return 0; -} - -static void LinuxDvbPtsThread(Context_t *context) -{ - int count; -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - while (context->playback->isCreationPhase) - { -#ifdef DEBUG - printf("%s::%s Thread waiting for end of init phase...\n", FILENAME, __FUNCTION__); -#endif - } - -#ifdef DEBUG - printf("%s::%s Running!\n", FILENAME, __FUNCTION__); -#endif - - while (context && context->playback && context->playback->isPlaying /*videofd != -1 || audiofd != -1*/) - { - - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - - if (videofd != -1) - ioctl(videofd, VIDEO_GET_PTS, (void *)&sCURRENT_PTS); - else if (audiofd != -1) - ioctl(audiofd, AUDIO_GET_PTS, (void *)&sCURRENT_PTS); - else - sCURRENT_PTS = 0; - - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - - /* bei einer zu grossen sleeptime auf einmal, kann es vorkommen, das - der thread nicht erkennt, wenn ein playback zu ende ist weil er im sleep wartet. - Es kann dann passieren, das er durchlaeuft, weil schon der naechste playback - gestartet wurde, das kann dann zum absturz fuehren */ - count = 0; - while (context && context->playback && context->playback->isPlaying && count < 10) - { - count++; - usleep(100000); - } - //usleep(cSLEEPTIME); - } - -#ifdef DEBUG - printf("%s::%s terminating\n", FILENAME, __FUNCTION__); -#endif - - isPTSThreadCreated = 0; -} - -static int LinuxDvbPtsStart(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - int error; - int ret = 0; - -#ifdef DEBUG - if (context && context->playback && context->playback->isCreationPhase) - { - printf("%s::%s is Creation Phase\n", FILENAME, __FUNCTION__); - } - else - { - printf("%s::%s is NOT Creation Phase\n", FILENAME, __FUNCTION__); - } -#endif - - if (isPTSThreadCreated == 0) - { - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - if ((error = pthread_create(&PtsThread, &attr, (void *)&LinuxDvbPtsThread, context)) != 0) - { -#ifdef DEBUG - printf("%s::%s Error creating thread, error:%d:%s\n", FILENAME, __FUNCTION__, error, strerror(error)); -#endif - isPTSThreadCreated = 0; - ret = -1; - } - else - { -#ifdef DEBUG - printf("%s::%s Created thread\n", FILENAME, __FUNCTION__); -#endif - isPTSThreadCreated = 1; - } - } - else - { -#ifdef DEBUG - printf("%s::%s PtsThread already exists, ignoring creation!\n", FILENAME, __FUNCTION__); -#endif - ret = 0; // FIXME? - } - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -int LinuxDvbPts(Context_t *context, unsigned long long int *pts) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - //if (context->playback->isPlaying) { - *((unsigned long long int *)pts) = (unsigned long long int)sCURRENT_PTS; - - //} else - // *((unsigned long long int *)pts)=(unsigned long long int)0; - - return 0; -} - -int LinuxDvbSwitch(Context_t *context, char *type) -{ - unsigned char audio = !strcmp("audio", type); - unsigned char video = !strcmp("video", type); - -#ifdef DEBUG - printf("%s::%s v%d a%d\n", FILENAME, __FUNCTION__, video, audio); -#endif - - if ((video && videofd != -1) || (audio && audiofd != -1)) // trick to create only one Mutex - { - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - - if (audio && audiofd != -1) - { - char *Encoding = NULL; - if (context && context->manager && context->manager->audio) - { - context->manager->audio->Command(context, MANAGER_GETENCODING, &Encoding); - - ioctl(audiofd, AUDIO_STOP , NULL); - ioctl(audiofd, AUDIO_CLEAR_BUFFER , NULL); -#ifdef DEBUG - printf("%s::%s A %s\n", FILENAME, __FUNCTION__, Encoding); -#endif - - if (!strcmp(Encoding, "A_AC3")) - ioctl(audiofd, AUDIO_SET_ENCODING, (void *)AUDIO_ENCODING_AC3); - else if (!strcmp(Encoding, "A_MP3") || !strcmp(Encoding, "A_MPEG/L3")) - ioctl(audiofd, AUDIO_SET_ENCODING, (void *)AUDIO_ENCODING_MP3); - else if (!strcmp(Encoding, "A_DTS")) - ioctl(audiofd, AUDIO_SET_ENCODING, (void *)AUDIO_ENCODING_DTS); - else if (!strcmp(Encoding, "A_AAC")) - ioctl(audiofd, AUDIO_SET_ENCODING, (void *)AUDIO_ENCODING_AAC); - else - ioctl(audiofd, AUDIO_SET_ENCODING, (void *)AUDIO_ENCODING_AUTO); - - ioctl(audiofd, AUDIO_PLAY, NULL); - free(Encoding); - } -#ifdef DEBUG - else - printf("%s::%s no context for Audio\n", FILENAME, __FUNCTION__); -#endif - } - - if (video && videofd != -1) - { - char *Encoding = NULL; - if (context && context->manager && context->manager->video) - { - context->manager->video->Command(context, MANAGER_GETENCODING, &Encoding); - - ioctl(videofd, VIDEO_STOP , NULL); - ioctl(videofd, VIDEO_CLEAR_BUFFER , NULL); -#ifdef DEBUG - printf("%s::%s V %s\n", FILENAME, __FUNCTION__, Encoding); -#endif - if (!strcmp(Encoding, "V_MPEG2")) - ioctl(videofd, VIDEO_SET_ENCODING, (void *)VIDEO_ENCODING_AUTO); - else if (!strcmp(Encoding, "V_MSCOMP") || !strcmp(Encoding, "V_MS/VFW/FOURCC") || !strcmp(Encoding, "V_MKV/XVID")) - ioctl(videofd, VIDEO_SET_ENCODING, (void *)VIDEO_ENCODING_MPEG4P2); - else if (!strcmp(Encoding, "V_MPEG4/ISO/AVC") || !strcmp(Encoding, "V_MPEG2/H264")) - ioctl(videofd, VIDEO_SET_ENCODING, (void *)VIDEO_ENCODING_H264); - else - ioctl(videofd, VIDEO_SET_ENCODING, (void *)VIDEO_ENCODING_AUTO); - - ioctl(videofd, VIDEO_PLAY, NULL); - free(Encoding); - } -#ifdef DEBUG - else - printf("%s::%s no context for Video\n", FILENAME, __FUNCTION__); -#endif - } - - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - - } - -#ifdef DEBUG - printf("%s::%s exiting\n", FILENAME, __FUNCTION__); -#endif - - return 0; -} - -////////////////////////////////////////////////////////// - -#define AC3_START_CODE 0x0b77 -#define AC3_START_CODE_MASK 0xffff -#define MP3_START_CODE 0xffe0 -#define MP3_START_CODE_MASK 0xffe0 -#define AAC_AUDIO_PES_START_CODE 0xcf -#define AAC_START_CODE 0xffe0 -#define AAC_HEADER_LENGTH 7 - -typedef struct AACHeader_s -{ - unsigned char Data[AAC_HEADER_LENGTH]; -} AACHeader_t; - -#define MPEG_AUDIO_PES_START_CODE 0xc0 -#define PES_MAX_HEADER_SIZE 64 -#define PRIVATE_STREAM_1_PES_START_CODE 0xbd -#define MPEG_VIDEO_PES_START_CODE 0xe0 -#define H264_VIDEO_PES_START_CODE 0xe2 -#define PES_START_CODE_RESERVED_4 0xfd -#define PES_VERSION_FAKE_START_CODE 0x31 -#define PCM_PES_START_CODE 0xbd - -/*#define BIG_READS*/ -#if defined (BIG_READS) -#define BLOCK_COUNT 8 -#else -#define BLOCK_COUNT 1 -#endif -#define TP_PACKET_SIZE 188 -#define BD_TP_PACKET_SIZE 192 -#define NUMBER_PACKETS (199*BLOCK_COUNT) -#define BUFFER_SIZE (TP_PACKET_SIZE*NUMBER_PACKETS) -#define PADDING_LENGTH (1024*BLOCK_COUNT) - -#define MAX_PES_PACKET_SIZE 65400 -#define INVALID_PTS_VALUE 0x200000000ull - -typedef struct MKV_BitPacker_s -{ - unsigned char *Ptr; /* write pointer */ - unsigned int BitBuffer; /* bitreader shifter */ - int Remaining; /* number of remaining in the shifter */ -#ifdef DEBUG_PUTBITS - int debug; -#endif /* DEBUG_PUTBITS */ -} MKV_BitPacker_t; -static void MKV_PutBits(MKV_BitPacker_t *ld, unsigned int code, unsigned int length) -{ - unsigned int bit_buf; - int bit_left; - - bit_buf = ld->BitBuffer; - bit_left = ld->Remaining; - -#ifdef DEBUG_PUTBITS - if (ld->debug) - dprintf("code = %d, length = %d, bit_buf = 0x%x, bit_left = %d\n", code, length, bit_buf, bit_left); -#endif /* DEBUG_PUTBITS */ - - if (length < bit_left) - { - /* fits into current buffer */ - bit_buf = (bit_buf << length) | code; - bit_left -= length; - } - else - { - /* doesn't fit */ - bit_buf <<= bit_left; - bit_buf |= code >> (length - bit_left); - ld->Ptr[0] = (char)(bit_buf >> 24); - ld->Ptr[1] = (char)(bit_buf >> 16); - ld->Ptr[2] = (char)(bit_buf >> 8); - ld->Ptr[3] = (char)bit_buf; - ld->Ptr += 4; - length -= bit_left; - bit_buf = code & ((1 << length) - 1); - bit_left = 32 - length; - } - -#ifdef DEBUG_PUTBITS - if (ld->debug) - dprintf("bit_left = %d, bit_buf = 0x%x\n", bit_left, bit_buf); -#endif /* DEBUG_PUTBITS */ - - /* writeback */ - ld->BitBuffer = bit_buf; - ld->Remaining = bit_left; -} - -static void MKV_FlushBits(MKV_BitPacker_t *ld) -{ - ld->BitBuffer <<= ld->Remaining; - while (ld->Remaining < 32) - { -#ifdef DEBUG_PUTBITS - if (ld->debug) - dprintf("flushing 0x%2.2x\n", ld->BitBuffer >> 24); -#endif /* DEBUG_PUTBITS */ - *ld->Ptr++ = ld->BitBuffer >> 24; - ld->BitBuffer <<= 8; - ld->Remaining += 8; - } - ld->Remaining = 32; - ld->BitBuffer = 0; -} -int MKV_InsertPesHeader(unsigned char *data, int size, unsigned char stream_id, unsigned long long int pts, int pic_start_code) -{ - MKV_BitPacker_t ld2 = {data, 0, 32}; - -#ifdef DEBUG - if (size > MAX_PES_PACKET_SIZE) - dprintf("%s: Packet bigger than 63.9K eeeekkkkk\n", __FUNCTION__); -#endif - - MKV_PutBits(&ld2, 0x0 , 8); - MKV_PutBits(&ld2, 0x0 , 8); - MKV_PutBits(&ld2, 0x1 , 8); // Start Code - MKV_PutBits(&ld2, stream_id , 8); // Stream_id = Audio Stream - //4 - MKV_PutBits(&ld2, size + 3 + (pts != INVALID_PTS_VALUE ? 5 : 0) + (pic_start_code ? (5) : 0), 16); // PES_packet_length - //6 = 4+2 - MKV_PutBits(&ld2, 0x2 , 2); // 10 - MKV_PutBits(&ld2, 0x0 , 2); // PES_Scrambling_control - MKV_PutBits(&ld2, 0x0 , 1); // PES_Priority - MKV_PutBits(&ld2, 0x0 , 1); // data_alignment_indicator - MKV_PutBits(&ld2, 0x0 , 1); // Copyright - MKV_PutBits(&ld2, 0x0 , 1); // Original or Copy - //7 = 6+1 - - if (pts != INVALID_PTS_VALUE) - MKV_PutBits(&ld2, 0x2 , 2); - else - MKV_PutBits(&ld2, 0x0 , 2); // PTS_DTS flag - - MKV_PutBits(&ld2, 0x0 , 1); // ESCR_flag - MKV_PutBits(&ld2, 0x0 , 1); // ES_rate_flag - MKV_PutBits(&ld2, 0x0 , 1); // DSM_trick_mode_flag - MKV_PutBits(&ld2, 0x0 , 1); // additional_copy_ingo_flag - MKV_PutBits(&ld2, 0x0 , 1); // PES_CRC_flag - MKV_PutBits(&ld2, 0x0 , 1); // PES_extension_flag - //8 = 7+1 - - if (pts != INVALID_PTS_VALUE) - MKV_PutBits(&ld2, 0x5, 8); - else - MKV_PutBits(&ld2, 0x0 , 8); // PES_header_data_length - //9 = 8+1 - - if (pts != INVALID_PTS_VALUE) - { - MKV_PutBits(&ld2, 0x2, 4); - MKV_PutBits(&ld2, (pts >> 30) & 0x7, 3); - MKV_PutBits(&ld2, 0x1, 1); - MKV_PutBits(&ld2, (pts >> 15) & 0x7fff, 15); - MKV_PutBits(&ld2, 0x1, 1); - MKV_PutBits(&ld2, pts & 0x7fff, 15); - MKV_PutBits(&ld2, 0x1, 1); - } - //14 = 9+5 - - if (pic_start_code) - { - MKV_PutBits(&ld2, 0x0 , 8); - MKV_PutBits(&ld2, 0x0 , 8); - MKV_PutBits(&ld2, 0x1 , 8); // Start Code - MKV_PutBits(&ld2, pic_start_code & 0xff , 8); // 00, for picture start - MKV_PutBits(&ld2, (pic_start_code >> 8) & 0xff, 8); // For any extra information (like in mpeg4p2, the pic_start_code) - //14 + 4 = 18 - } - - MKV_FlushBits(&ld2); - - return (ld2.Ptr - data); - -} - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// dts // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#define PES_AUDIO_PRIVATE_HEADER_SIZE 16 // consider maximum private header size. -#define PES_AUDIO_HEADER_SIZE (32 + PES_AUDIO_PRIVATE_HEADER_SIZE) -#define PES_AUDIO_PACKET_SIZE 2028 -#define SPDIF_AUDIO_PACKET_SIZE (1024 * sizeof(unsigned int) * 2) // stereo 32bit samples. -static int dts(const unsigned char *PLAYERData, int DataLength, unsigned long long int Pts) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - int i = 0; - unsigned char PesHeader[PES_AUDIO_HEADER_SIZE]; - memset(PesHeader, '0', PES_AUDIO_HEADER_SIZE); - - unsigned char *Data = 0; - Data = (unsigned char *) malloc(DataLength); - memcpy(Data, PLAYERData, DataLength); - - /* 16-bit byte swap all data before injecting it */ - for (i = 0; i < DataLength; i += 2) - { - unsigned char Tmp = Data[i]; - Data[i] = Data[i + 1]; - Data[i + 1] = Tmp; - } - - int HeaderLength = MKV_InsertPesHeader(PesHeader, DataLength, MPEG_AUDIO_PES_START_CODE/*PRIVATE_STREAM_1_PES_START_CODE*/, Pts, 0); - unsigned char *PacketStart = malloc(DataLength + HeaderLength); - memcpy(PacketStart, PesHeader, HeaderLength); - memcpy(PacketStart + HeaderLength, PLAYERData, DataLength); - - int len = write(audiofd, PacketStart, DataLength + HeaderLength); - - free(PacketStart); - free(Data); - - return len; -} -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// mp3 // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -static int mp3(const unsigned char *PLAYERData, int DataLength, unsigned long long int Pts) -{ -#ifdef DEBUG - printf("%s::%s %llu\n", FILENAME, __FUNCTION__, Pts); -#endif - - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - - int HeaderLength = MKV_InsertPesHeader(PesHeader, DataLength, MPEG_AUDIO_PES_START_CODE, Pts, 0); - - unsigned char *PacketStart = malloc(DataLength + HeaderLength); - memcpy(PacketStart, PesHeader, HeaderLength); - memcpy(PacketStart + HeaderLength, PLAYERData, DataLength); - - int len = write(audiofd, PacketStart, DataLength + HeaderLength); - - if (len < 0) - { - printf("%s: %s\n", __func__, strerror(errno)); - } - - free(PacketStart); - -#ifdef DEBUG - printf("mp3_Write-< len=%d, audiofd %d\n", len, audiofd); -#endif - return len; -} - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// wma // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -static int wmaInitialHeaderRequired = 1; - -static int wma(const unsigned char *PLAYERData, int DataLength, unsigned long long int Pts, const void *private_data, unsigned int private_size) -{ -#ifdef DEBUG - printf("%s::%s %llu\n", FILENAME, __FUNCTION__, Pts); -#endif - - int len = 0; - - if (wmaInitialHeaderRequired) - { - - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - int HeaderLength = MKV_InsertPesHeader(PesHeader, private_size, MPEG_AUDIO_PES_START_CODE, 0, 0); - - unsigned char *PacketStart = malloc(private_size + HeaderLength); - memcpy(PacketStart, PesHeader, HeaderLength); - memcpy(PacketStart + HeaderLength, private_data, private_size); - - len = write(audiofd, PacketStart, private_size + HeaderLength); - - free(PacketStart); - - wmaInitialHeaderRequired = 0; - } - - if (DataLength > 0 && PLAYERData) - { - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - - int HeaderLength = MKV_InsertPesHeader(PesHeader, DataLength, MPEG_AUDIO_PES_START_CODE, Pts, 0); - - unsigned char *PacketStart = malloc(DataLength + HeaderLength); - memcpy(PacketStart, PesHeader, HeaderLength); - memcpy(PacketStart + HeaderLength, PLAYERData, DataLength); - - len = write(audiofd, PacketStart, DataLength + HeaderLength); - - free(PacketStart); - } - -#ifdef DEBUG - printf("wma-< len=%d\n", len); -#endif - return len; -} - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// ac3 // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -static int ac3(const unsigned char *PLAYERData, const int DataLength, unsigned long long int Pts) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - - int HeaderLength = MKV_InsertPesHeader(PesHeader, DataLength, PRIVATE_STREAM_1_PES_START_CODE, Pts, 0); - - unsigned char *PacketStart = malloc(DataLength + HeaderLength); - memcpy(PacketStart, PesHeader, HeaderLength); - memcpy(PacketStart + HeaderLength, PLAYERData, DataLength); - - int len = write(audiofd, PacketStart, DataLength + HeaderLength); - - free(PacketStart); - - return len; -} - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// aac_mpeg4 // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -static unsigned char DefaultAACHeader[] = { 0xff, 0xf1, /*0x00, 0x00*/0x50, 0x80, 0x00, 0x1f, 0xfc };//Trick: ob es bei allen geht?? - -int aac_mpeg4(const unsigned char *PLAYERData, const int DataLength, unsigned long long int Pts, const void *private_data, unsigned int private_size) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - if (private_data == NULL) - { -#ifdef DEBUG - printf("private_data = NULL\n"); -#endif - private_data = DefaultAACHeader; - private_size = 7; - } - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - unsigned char ExtraData[AAC_HEADER_LENGTH]; - unsigned int PacketLength = DataLength + AAC_HEADER_LENGTH; - - memcpy(ExtraData, (AACHeader_t *)private_data, AAC_HEADER_LENGTH); - ExtraData[3] |= (PacketLength >> 12) & 0x3; - ExtraData[4] = (PacketLength >> 3) & 0xff; - ExtraData[5] |= (PacketLength << 5) & 0xe0; - - unsigned int HeaderLength = MKV_InsertPesHeader(PesHeader, PacketLength, AAC_AUDIO_PES_START_CODE, Pts, 0); - - unsigned char *PacketStart = malloc(HeaderLength + sizeof(ExtraData) + DataLength); - memcpy(PacketStart, PesHeader, HeaderLength); - memcpy(PacketStart + HeaderLength, ExtraData, sizeof(ExtraData)); - memcpy(PacketStart + HeaderLength + sizeof(ExtraData), PLAYERData, DataLength); - - int len = write(audiofd, PacketStart, HeaderLength + DataLength + sizeof(ExtraData)); - - free(PacketStart); - - return len; -} - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// mpeg2 // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -static int mpeg2(const unsigned char *PLAYERData, int DataLength, long long int Pts) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - int len = 0; - - - int Position = 0; - - while (1) - { - int PacketLength = (DataLength - Position) <= MAX_PES_PACKET_SIZE ? (DataLength - Position) : MAX_PES_PACKET_SIZE; - -#ifdef DEBUG - int Remaining = DataLength - Position - PacketLength; - printf("PacketLength=%d, Remaining=%d, Position=%d\n", PacketLength, Remaining, Position); -#endif - int HeaderLength = MKV_InsertPesHeader(PesHeader, PacketLength, 0xe0, Pts, 0); - unsigned char *PacketStart = malloc(PacketLength + HeaderLength); - memcpy(PacketStart, PesHeader, HeaderLength); - memcpy(PacketStart + HeaderLength, PLAYERData + Position, PacketLength); - - len = write(videofd, PacketStart, PacketLength + HeaderLength); - -#ifdef DEBUG - printf("%s len=%d\n", __func__, len); - if (len < 0) - { - printf("%s: %s\n", __func__, strerror(errno)); - } -#endif - - free(PacketStart); - - Position += PacketLength; - Pts = INVALID_PTS_VALUE; - if (Position == DataLength) - break; - } - - - return len; -} -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// xvid // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -static int divx(const unsigned char *PLAYERData, int DataLength, long long int Pts, unsigned int mpf) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); - printf("\tmpf=%d\n", mpf); -#endif - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - - //XVID IS LIKE DIVX5 - - unsigned char FakeHeaders[64]; // 64bytes should be enough to make the fake headers - unsigned int FakeHeaderLength; - unsigned char Version = 5; - unsigned int FakeStartCode = (Version << 8) | PES_VERSION_FAKE_START_CODE; - unsigned int HeaderLength = 0; - - MKV_BitPacker_t ld = {FakeHeaders, 0, 32}; - memset(FakeHeaders, 0, sizeof(FakeHeaders)); - - //{{{ Create info record for frame parser - { - // divx4 & 5 - // VOS - //PutBits(&ld, 0x0, 8); - //PutBits(&ld, 0x0, 8); - MKV_PutBits(&ld, 0x1b0, 32); // startcode - MKV_PutBits(&ld, 0, 8); // profile = reserved - MKV_PutBits(&ld, 0x1b2, 32); // startcode (user data) - MKV_PutBits(&ld, 0x53545443, 32); // STTC - an embedded ST timecode from an avi file - MKV_PutBits(&ld, mpf , 32); - // microseconds per frame - MKV_FlushBits(&ld); - } - //}}} - - FakeHeaderLength = (ld.Ptr - (FakeHeaders)); - - HeaderLength = MKV_InsertPesHeader(PesHeader, DataLength, MPEG_VIDEO_PES_START_CODE, Pts, FakeStartCode); - unsigned char *PacketStart = malloc(DataLength + HeaderLength + FakeHeaderLength); - memcpy(PacketStart, PesHeader, HeaderLength); - memcpy(PacketStart + HeaderLength, FakeHeaders, FakeHeaderLength); - memcpy(PacketStart + HeaderLength + FakeHeaderLength, PLAYERData, DataLength); - - int len = write(videofd, PacketStart, DataLength + HeaderLength + FakeHeaderLength); - - free(PacketStart); - -#ifdef DEBUG - printf("xvid_Write-< len=%d\n", len); -#endif - return len; -} - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// h264 // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -static int h264InitialHeaderRequired = 1; -static unsigned int NalLengthBytes = 1; -typedef struct avcC_s -{ - unsigned char Version; /* configurationVersion */ - unsigned char Profile; /* AVCProfileIndication */ - unsigned char Compatibility; /* profile_compatibility */ - unsigned char Level; /* AVCLevelIndication */ - unsigned char NalLengthMinusOne; /* held in bottom two bits */ - unsigned char NumParamSets; /* held in bottom 5 bits */ - unsigned char Params[1]; /* {length,params}{length,params}...sequence then picture*/ -} avcC_t; - -const unsigned char Head[] = {0, 0, 0, 1}; - - -static int h264(const unsigned char *PLAYERData, int DataLength, unsigned long long int Pts, const void *private_data, unsigned int private_size, unsigned int TimeDelta, unsigned int TimeScale) -{ -#ifdef DEBUG - printf("%s::%s %d %d\n", FILENAME, __FUNCTION__, TimeDelta, TimeScale); -#endif - - //unsigned int TimeDelta = 23976; - //unsigned int TimeScale = 1000; - - unsigned char *PacketStart = NULL; - unsigned int PacketStartSIZE = 0; - unsigned int HeaderLength; - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - unsigned long long int VideoPts = Pts; - - int len = 0; - - if (h264InitialHeaderRequired) - { - unsigned char *HeaderData = malloc(BUFFER_SIZE + PADDING_LENGTH); - avcC_t *avcCHeader = (avcC_t *)private_data; - int i; - unsigned int ParamSets; - unsigned int ParamOffset; - unsigned int InitialHeaderLength = 0; - unsigned int ParametersLength; - -#ifdef DEBUG - if (avcCHeader->Version != 1) - printf("%s: Error unknown avcC version (%x). Expect problems.\n", __FUNCTION__, avcCHeader->Version); -#endif - -#define NALU_TYPE_PLAYER2_CONTAINER_PARAMETERS 24 -#define CONTAINER_PARAMETERS_VERSION 0x00 - - ParametersLength = 0; - - HeaderData[ParametersLength++] = 0x00; // Start code - HeaderData[ParametersLength++] = 0x00; - HeaderData[ParametersLength++] = 0x01; - HeaderData[ParametersLength++] = NALU_TYPE_PLAYER2_CONTAINER_PARAMETERS; - // Container message version - changes when/if we vary the format of the message - HeaderData[ParametersLength++] = CONTAINER_PARAMETERS_VERSION; - HeaderData[ParametersLength++] = 0xff; // Field separator - - if (TimeDelta == 0xffffffff) - TimeDelta = (TimeScale > 1000) ? 1001 : 1; - - HeaderData[ParametersLength++] = (TimeScale >> 24) & 0xff; // Output the timescale - HeaderData[ParametersLength++] = (TimeScale >> 16) & 0xff; - HeaderData[ParametersLength++] = 0xff; - HeaderData[ParametersLength++] = (TimeScale >> 8) & 0xff; - HeaderData[ParametersLength++] = TimeScale & 0xff; - HeaderData[ParametersLength++] = 0xff; - - HeaderData[ParametersLength++] = (TimeDelta >> 24) & 0xff; // Output frame period - HeaderData[ParametersLength++] = (TimeDelta >> 16) & 0xff; - HeaderData[ParametersLength++] = 0xff; - HeaderData[ParametersLength++] = (TimeDelta >> 8) & 0xff; - HeaderData[ParametersLength++] = TimeDelta & 0xff; - HeaderData[ParametersLength++] = 0xff; - HeaderData[ParametersLength++] = 0x80; // Rsbp trailing bits - - HeaderLength = MKV_InsertPesHeader(PesHeader, ParametersLength, MPEG_VIDEO_PES_START_CODE, INVALID_PTS_VALUE, 0); - - PacketStart = malloc(HeaderLength + ParametersLength); - PacketStartSIZE = HeaderLength + ParametersLength; - memcpy(PacketStart, PesHeader, HeaderLength); - memcpy(PacketStart + HeaderLength, HeaderData, ParametersLength); - len += write(videofd, PacketStart, HeaderLength + ParametersLength); - - NalLengthBytes = (avcCHeader->NalLengthMinusOne & 0x03) + 1; - ParamSets = avcCHeader->NumParamSets & 0x1f; -#ifdef DEBUG - printf("%s: avcC contents:\n", __FUNCTION__); - printf(" version: %d\n", avcCHeader->Version); - printf(" profile: %d\n", avcCHeader->Profile); - printf(" profile compatibility: %d\n", avcCHeader->Compatibility); - printf(" level: %d\n", avcCHeader->Level); - printf(" nal length bytes: %d\n", NalLengthBytes); - printf(" number of sequence param sets: %d\n", ParamSets); -#endif - - ParamOffset = 0; - for (i = 0; i < ParamSets; i++) - { - unsigned int PsLength = (avcCHeader->Params[ParamOffset] << 8) + avcCHeader->Params[ParamOffset + 1]; -#ifdef DEBUG - dprintf(" sps %d has length %d\n", i, PsLength); -#endif - - if (HeaderLength + InitialHeaderLength + sizeof(Head) > PacketStartSIZE) - { - PacketStart = realloc(PacketStart, HeaderLength + InitialHeaderLength + sizeof(Head)); - PacketStartSIZE = HeaderLength + InitialHeaderLength + sizeof(Head); - } - - memcpy(PacketStart + HeaderLength + InitialHeaderLength, Head, sizeof(Head)); - InitialHeaderLength += sizeof(Head); - - if (HeaderLength + InitialHeaderLength + PsLength > PacketStartSIZE) - { - PacketStart = realloc(PacketStart, HeaderLength + InitialHeaderLength + PsLength); - PacketStartSIZE = HeaderLength + InitialHeaderLength + PsLength; - } - - memcpy(PacketStart + HeaderLength + InitialHeaderLength, &avcCHeader->Params[ParamOffset + 2], PsLength); - - InitialHeaderLength += PsLength; - ParamOffset += PsLength + 2; - } - - ParamSets = avcCHeader->Params[ParamOffset]; -#ifdef DEBUG - dprintf(" number of picture param sets: %d\n", ParamSets); -#endif - ParamOffset++; - for (i = 0; i < ParamSets; i++) - { - unsigned int PsLength = (avcCHeader->Params[ParamOffset] << 8) + avcCHeader->Params[ParamOffset + 1]; -#ifdef DEBUG - dprintf(" pps %d has length %d\n", i, PsLength); -#endif - if (HeaderLength + InitialHeaderLength + sizeof(Head) > PacketStartSIZE) - { - PacketStart = realloc(PacketStart, HeaderLength + InitialHeaderLength + sizeof(Head)); - PacketStartSIZE = HeaderLength + InitialHeaderLength + sizeof(Head); - } - - memcpy(PacketStart + HeaderLength + InitialHeaderLength, Head, sizeof(Head)); - InitialHeaderLength += sizeof(Head); - - if (HeaderLength + InitialHeaderLength + PsLength > PacketStartSIZE) - { - PacketStart = realloc(PacketStart, HeaderLength + InitialHeaderLength + PsLength); - PacketStartSIZE = HeaderLength + InitialHeaderLength + PsLength; - } - - memcpy(PacketStart + HeaderLength + InitialHeaderLength, &avcCHeader->Params[ParamOffset + 2], PsLength); - InitialHeaderLength += PsLength; - ParamOffset += PsLength + 2; - } - - HeaderLength = MKV_InsertPesHeader(PesHeader, InitialHeaderLength, MPEG_VIDEO_PES_START_CODE, INVALID_PTS_VALUE, 0); - memcpy(PacketStart, PesHeader, HeaderLength); - - len += write(videofd, PacketStart, HeaderLength + InitialHeaderLength); - - h264InitialHeaderRequired = 0; - - free(PacketStart); - free(HeaderData); - } - - unsigned int SampleSize = DataLength; - unsigned int NalStart = 0; - unsigned int VideoPosition = 0; - - do - { - unsigned int NalLength; - unsigned char NalData[4]; - int NalPresent = 1; - - memcpy(NalData, PLAYERData + VideoPosition, NalLengthBytes); - VideoPosition += NalLengthBytes; - NalLength = (NalLengthBytes == 1) ? NalData[0] : - (NalLengthBytes == 2) ? (NalData[0] << 8) | NalData[1] : - (NalLengthBytes == 3) ? (NalData[0] << 16) | (NalData[1] << 8) | NalData[2] : - (NalData[0] << 24) | (NalData[1] << 16) | (NalData[2] << 8) | NalData[3]; - -#ifdef DEBUG - printf("NalStart = %u + NalLength = %u > SampleSize = %u\n", NalStart, NalLength, SampleSize); -#endif - - if (NalStart + NalLength > SampleSize) - { -#ifdef DEBUG - printf("%s: nal length past end of buffer - size %u frame offset %u left %u\n", __FUNCTION__, - NalLength, NalStart , SampleSize - NalStart); -#endif - NalStart = SampleSize; - } - else - { - NalStart += NalLength + NalLengthBytes; - while (NalLength > 0) - { - unsigned int PacketLength = (NalLength < BUFFER_SIZE) ? NalLength : BUFFER_SIZE; - int ExtraLength = 0; - unsigned char *PacketStart; - - NalLength -= PacketLength; - - if (NalPresent) - { - PacketStart = malloc(sizeof(Head) + PacketLength); - memcpy(PacketStart + sizeof(Head), PLAYERData + VideoPosition, PacketLength); - VideoPosition += PacketLength; - - memcpy(PacketStart, Head, sizeof(Head)); - ExtraLength = sizeof(Head); - } - else - { - PacketStart = malloc(PacketLength); - memcpy(PacketStart, PLAYERData + VideoPosition, PacketLength); - VideoPosition += PacketLength; - } - - PacketLength += ExtraLength; - -#ifdef DEBUG - printf("%s: pts=%llu\n", __FUNCTION__, VideoPts); -#endif - - HeaderLength = MKV_InsertPesHeader(PesHeader, PacketLength, MPEG_VIDEO_PES_START_CODE, VideoPts, 0); - - - unsigned char *WritePacketStart = malloc(HeaderLength + PacketLength); - memcpy(WritePacketStart, PesHeader, HeaderLength); - memcpy(WritePacketStart + HeaderLength, PacketStart, PacketLength); - free(PacketStart); - - PacketLength += HeaderLength; - len += write(videofd, WritePacketStart, PacketLength); - free(WritePacketStart); - - NalPresent = 0; - VideoPts = INVALID_PTS_VALUE; - } - } - } - while (NalStart < SampleSize); - - return len; -} - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// wmv // -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#define PES_PRIVATE_DATA_FLAG 0x80 -#define PES_PRIVATE_DATA_LENGTH 8 - -#define PES_LENGTH_BYTE_0 5 -#define PES_LENGTH_BYTE_1 4 -#define PES_FLAGS_BYTE 7 -#define PES_EXTENSION_DATA_PRESENT 0x01 -#define PES_HEADER_DATA_LENGTH_BYTE 8 - -int MKV_InsertVideoPrivateDataHeader(unsigned char *data, int payload_size) -{ - MKV_BitPacker_t ld2 = {data, 0, 32}; - int i; - - MKV_PutBits(&ld2, PES_PRIVATE_DATA_FLAG, 8); - MKV_PutBits(&ld2, payload_size & 0xff, 8); - MKV_PutBits(&ld2, (payload_size >> 8) & 0xff, 8); - MKV_PutBits(&ld2, (payload_size >> 16) & 0xff, 8); - - for (i = 4; i < (PES_PRIVATE_DATA_LENGTH + 1); i++) - MKV_PutBits(&ld2, 0, 8); - - MKV_FlushBits(&ld2); - - return PES_PRIVATE_DATA_LENGTH + 1; - -} - -#define PES_MIN_HEADER_SIZE 9 -#define WMV3_PRIVATE_DATA_LENGTH 4 -#define VC1_VIDEO_PES_START_CODE 0xfd -static int wmvInitialHeaderRequired = 1; -typedef struct -{ - unsigned char privateData[WMV3_PRIVATE_DATA_LENGTH]; - unsigned int width; - unsigned int height; - unsigned int framerate; -} awmv_t; - -#define METADATA_STRUCT_A_START 12 -#define METADATA_STRUCT_B_START 24 -#define METADATA_STRUCT_B_FRAMERATE_START 32 -#define METADATA_STRUCT_C_START 8 -static const unsigned char Metadata[] = {0x00, 0x00, 0x00, 0xc5, - 0x04, 0x00, 0x00, 0x00, - 0xc0, 0x00, 0x00, 0x00, /* Struct C set for for advanced profile*/ - 0x00, 0x00, 0x00, 0x00, /* Struct A */ - 0x00, 0x00, 0x00, 0x00, - 0x0c, 0x00, 0x00, 0x00, - 0x60, 0x00, 0x00, 0x00, /* Struct B */ - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 - }; - - -static int wmv(const unsigned char *PLAYERData, int DataLength, unsigned long long int Pts, const awmv_t *private_data, unsigned int private_size) -{ - int len = 0; - -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - if (wmvInitialHeaderRequired) - { - unsigned char PesPacket[PES_MIN_HEADER_SIZE + 128]; - unsigned char *PesPtr; - unsigned int MetadataLength; - -#ifdef DEBUG - printf("Framerate: %u\n", private_data->framerate); - printf("biWidth: %d\n", private_data->width); - printf("biHeight: %d\n", private_data->height); -#endif - PesPtr = &PesPacket[PES_MIN_HEADER_SIZE]; - - memcpy(PesPtr, Metadata, sizeof(Metadata)); - PesPtr += METADATA_STRUCT_C_START; - - memcpy(PesPtr, private_data->privateData, WMV3_PRIVATE_DATA_LENGTH); - PesPtr += WMV3_PRIVATE_DATA_LENGTH; - - /* Metadata Header Struct A */ - *PesPtr++ = (private_data->height >> 0) & 0xff; - *PesPtr++ = (private_data->height >> 8) & 0xff; - *PesPtr++ = (private_data->height >> 16) & 0xff; - *PesPtr++ = private_data->height >> 24; - *PesPtr++ = (private_data->width >> 0) & 0xff; - *PesPtr++ = (private_data->width >> 8) & 0xff; - *PesPtr++ = (private_data->width >> 16) & 0xff; - *PesPtr++ = private_data->width >> 24; - - PesPtr += 12; /* Skip flag word and Struct B first 8 bytes */ - - *PesPtr++ = (private_data->framerate >> 0) & 0xff; - *PesPtr++ = (private_data->framerate >> 8) & 0xff; - *PesPtr++ = (private_data->framerate >> 16) & 0xff; - *PesPtr++ = private_data->framerate >> 24; - - MetadataLength = PesPtr - &PesPacket[PES_MIN_HEADER_SIZE]; - - int HeaderLength = MKV_InsertPesHeader(PesPacket, MetadataLength, VC1_VIDEO_PES_START_CODE, INVALID_PTS_VALUE, 0); - - /*int i , j; - printf ("%s: (%d), Data = ", __FUNCTION__, HeaderLength+MetadataLength); - for(j=0; j< HeaderLength+MetadataLength;) { - for (i=0; i<16 && j < HeaderLength+MetadataLength; i++, j++) - printf ("%02x ", PesPacket[j]); - printf ("\n"); - }*/ - - len = write(videofd, PesPacket, HeaderLength + MetadataLength); - wmvInitialHeaderRequired = 0; - } - -//o 00 00 01 fd 27 c9 80 81 | 0e . 21 00 1b bb a1 80 b8 27 00 00 00 00 00 00 -//d 00 00 01 fd 27 c9 80 81 | 0e . 31 00 1b d2 d5 80 b8 27 00 00 00 00 00 00 - - if (DataLength > 0 && PLAYERData) - { - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - int HeaderLength = MKV_InsertPesHeader(PesHeader, DataLength, VC1_VIDEO_PES_START_CODE, Pts, 0); - - { - unsigned int FrameSize = DataLength/*BufferDataLength*/; - unsigned int PesLength; - unsigned int PrivateHeaderLength; - - PrivateHeaderLength = MKV_InsertVideoPrivateDataHeader(&PesHeader[HeaderLength], - FrameSize); - /* Update PesLength */ - PesLength = PesHeader[PES_LENGTH_BYTE_0] + (PesHeader[PES_LENGTH_BYTE_1] << 8) + PrivateHeaderLength; - PesHeader[PES_LENGTH_BYTE_0] = PesLength & 0xff; - PesHeader[PES_LENGTH_BYTE_1] = (PesLength >> 8) & 0xff; - PesHeader[PES_HEADER_DATA_LENGTH_BYTE] += PrivateHeaderLength; - PesHeader[PES_FLAGS_BYTE] |= PES_EXTENSION_DATA_PRESENT; - - HeaderLength += PrivateHeaderLength; - } - - unsigned char *PacketStart = malloc(DataLength + HeaderLength); - memcpy(PacketStart, PesHeader, HeaderLength); - memcpy(PacketStart + HeaderLength, PLAYERData, DataLength); - - /*int j; - printf ("%s: (%6d | %04x) ", __FUNCTION__, DataLength+HeaderLength, DataLength+HeaderLength); - for(j = 0; j < HeaderLength; j++) { - printf ("%02x ", PacketStart[j]); - } - printf (" | "); - for(j = 0; j < 4; j++) { - printf ("%02x ", PacketStart[HeaderLength+j]); - } - printf ("\n");*/ - - len = write(videofd, PacketStart, DataLength + HeaderLength); - - free(PacketStart); - } - - //dprintf("xvid_Write-< len=%d\n", len); - return len; -} - - - - - -static int Write(void *_context, unsigned char *PLAYERData, int DataLength, unsigned long long int Pts, unsigned char *Private, const int PrivateLength, float FrameRate, char *type) -{ - Context_t *context = (Context_t *) _context; - - int ret = 0; - int result; - -#ifdef DEBUG - printf("%s::%s DataLength=%u PrivateLength=%u Pts=%llu FrameRate=%f\n", FILENAME, __FUNCTION__, DataLength, PrivateLength, Pts, FrameRate); -#endif - - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - unsigned int TimeDelta; - unsigned int TimeScale; -#ifdef DEBUG - printf("%s::%s v%d a%d\n", FILENAME, __FUNCTION__, video, audio); -#endif - - if (video) - { - char *Encoding = NULL; - context->manager->video->Command(context, MANAGER_GETENCODING, &Encoding); - -#ifdef DEBUG - printf("%s::%s Encoding = %s\n", FILENAME, __FUNCTION__, Encoding); -#endif - - if (!strcmp(Encoding, "V_MPEG2") || !strcmp(Encoding, "V_MPEG2/H264")) - result = mpeg2(PLAYERData, DataLength, Pts); - else if (!strcmp(Encoding, "V_MPEG4/ISO/AVC")) - { - TimeDelta = FrameRate * 1000.0; - TimeScale = 1000; - result = h264(PLAYERData, DataLength, Pts, Private, PrivateLength, TimeDelta, TimeScale); - } - else if (!strcmp(Encoding, "V_MSCOMP") || !strcmp(Encoding, "V_MS/VFW/FOURCC") || !strcmp(Encoding, "V_MKV/XVID")) - result = divx(PLAYERData, DataLength, Pts, FrameRate); - else if (!strcmp(Encoding, "V_WMV")) - result = wmv(PLAYERData, DataLength, Pts, (const awmv_t *)Private, PrivateLength); - else - { -#ifdef DEBUG - printf("unknown video codec %s\n", Encoding); -#endif - } - free(Encoding); - } - else if (audio) - { - char *Encoding = NULL; - context->manager->audio->Command(context, MANAGER_GETENCODING, &Encoding); - -#ifdef DEBUG - printf("%s::%s Encoding = %s\n", FILENAME, __FUNCTION__, Encoding); -#endif - - if (!strcmp(Encoding, "A_AC3")) - result = ac3(PLAYERData, DataLength, Pts); - else if (!strcmp(Encoding, "A_MP3") || !strcmp(Encoding, "A_MPEG/L3") || !strcmp(Encoding, "A_MS/ACM")) - result = mp3(PLAYERData, DataLength, Pts); - else if (!strcmp(Encoding, "A_AAC")) - result = aac_mpeg4(PLAYERData, DataLength, Pts, Private, PrivateLength); - else if (!strcmp(Encoding, "A_DTS")) - result = dts(PLAYERData, DataLength, Pts); - else if (!strcmp(Encoding, "A_WMA")) - result = wma(PLAYERData, DataLength, Pts, (const unsigned char *) Private, PrivateLength); - else - { -#ifdef DEBUG - printf("unknown audio codec %s\n", Encoding); -#endif - } - free(Encoding); - } - - return ret; -} - -static int Command(void *_context, OutputCmd_t command, void *argument) -{ - Context_t *context = (Context_t *) _context; -#ifdef DEBUG - printf("%s::%s Command %d\n", FILENAME, __FUNCTION__, command); -#endif - - int ret = 0; - - switch (command) - { - case OUTPUT_OPEN: - { - ret = LinuxDvbOpen(context, (char *)argument); - break; - } - case OUTPUT_CLOSE: - { - LinuxDvbClose(context, (char *)argument); - h264InitialHeaderRequired = 1; - wmaInitialHeaderRequired = 1; - wmvInitialHeaderRequired = 1; - sCURRENT_PTS = 0; - break; - } - case OUTPUT_PLAY: // 4 - { - h264InitialHeaderRequired = 1; - wmaInitialHeaderRequired = 1; - wmvInitialHeaderRequired = 1; - sCURRENT_PTS = 0; - LinuxDvbPlay(context, (char *)argument); - break; - } - case OUTPUT_STOP: - { - LinuxDvbStop(context, (char *)argument); - h264InitialHeaderRequired = 1; - wmaInitialHeaderRequired = 1; - wmvInitialHeaderRequired = 1; - sCURRENT_PTS = 0; - break; - } - case OUTPUT_FLUSH: - { - LinuxDvbFlush(context, (char *)argument); - h264InitialHeaderRequired = 1; - wmaInitialHeaderRequired = 1; - wmvInitialHeaderRequired = 1; - sCURRENT_PTS = 0; - break; - } - case OUTPUT_PAUSE: - { - LinuxDvbPause(context, (char *)argument); - break; - } - case OUTPUT_CONTINUE: - { - LinuxDvbContinue(context, (char *)argument); - break; - } - case OUTPUT_FASTFORWARD: - { - return LinuxDvbFastForward(context, (char *)argument); - break; - } - case OUTPUT_AVSYNC: - { - LinuxDvbAVSync(context, (char *)argument); - break; - } - case OUTPUT_CLEAR: - { - LinuxDvbClear(context, (char *)argument); - break; - } - case OUTPUT_PTS: - { - unsigned long long int pts = 0; - LinuxDvbPts(context, &pts); - *((unsigned long long int *)argument) = (unsigned long long int)pts; - break; - } - case OUTPUT_SWITCH: - { - LinuxDvbSwitch(context, (char *)argument); - break; - } - case OUTPUT_SLOWMOTION: - { - return LinuxDvbSlowMotion(context, (char *)argument); - break; - } - case OUTPUT_AUDIOMUTE: - { - return LinuxDvbAudioMute(context, (char *)argument); - break; - } - default: -#ifdef DEBUG - printf("%s::%s ContainerCmd %d not supported!\n", FILENAME, __FUNCTION__, command); -#endif - break; - } - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -static char *LinuxDvbCapabilities[] = { "audio", "video", NULL }; - -struct Output_s LinuxDvbOutput = -{ - "LinuxDvb", - &Command, - &Write, - LinuxDvbCapabilities, - -}; - diff --git a/libeplayer2/output/output.c b/libeplayer2/output/output.c deleted file mode 100644 index 03e4e7e..0000000 --- a/libeplayer2/output/output.c +++ /dev/null @@ -1,318 +0,0 @@ -#include -#include -#include "common.h" -#include "output.h" - -//#ifndef DEBUG -//#define DEBUG // FIXME: until this is set properly by Makefile -//#endif - -static const char FILENAME[] = "output.c"; - -static void printOutputCapabilities() -{ - int i, j; -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - printf("Capabilities:\n"); - for (i = 0; AvailableOutput[i] != NULL; i++) - { - printf("\t%s : ", AvailableOutput[i]->Name); - for (j = 0; AvailableOutput[i]->Capabilities[j] != NULL; j++) - printf("%s ", AvailableOutput[i]->Capabilities[j]); - printf("\n"); - } -} - -static void OutputAdd(Context_t *context, char *port) -{ - int i, j; -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - for (i = 0; AvailableOutput[i] != NULL; i++) - for (j = 0; AvailableOutput[i]->Capabilities[j] != NULL; j++) - if (!strcmp(AvailableOutput[i]->Capabilities[j], port)) - { - if (!strcmp("audio", port)) - context->output->audio = AvailableOutput[i]; - else if (!strcmp("video", port)) - context->output->video = AvailableOutput[i]; - else if (!strcmp("subtitle", port)) - context->output->subtitle = AvailableOutput[i]; - break; - } -} - -static void OutputDel(Context_t *context, char *port) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - if (!strcmp("audio", port)) - context->output->audio = NULL; - else if (!strcmp("video", port)) - context->output->video = NULL; - else if (!strcmp("subtitle", port)) - context->output->subtitle = NULL; - -} - -static int Command(void *_context, OutputCmd_t command, void *argument) -{ - Context_t *context = (Context_t *) _context; -#ifdef DEBUG - printf("%s::%s Command %d\n", FILENAME, __FUNCTION__, command); -#endif - - int ret = 0; - - switch (command) - { - case OUTPUT_OPEN: - { - if (context && context->playback) - { - if (context->playback->isVideo) - context->output->video->Command(context, OUTPUT_OPEN, "video"); - if (context->playback->isAudio) - context->output->audio->Command(context, OUTPUT_OPEN, "audio"); - if (context->playback->isSubtitle) - context->output->subtitle->Command(context, OUTPUT_OPEN, "subtitle"); - } - else - ret = -1; - break; - } - case OUTPUT_CLOSE: - { - if (context && context->playback) - { - if (context->playback->isVideo) - context->output->video->Command(context, OUTPUT_CLOSE, "video"); - if (context->playback->isAudio) - context->output->audio->Command(context, OUTPUT_CLOSE, "audio"); - if (context->playback->isSubtitle) - context->output->subtitle->Command(context, OUTPUT_CLOSE, "subtitle"); - } - else - ret = -1; - break; - } - case OUTPUT_ADD: - { - OutputAdd(context, (char *) argument); - break; - } - case OUTPUT_DEL: - { - OutputDel(context, (char *) argument); - break; - } - case OUTPUT_CAPABILITIES: - { - printOutputCapabilities(); - break; - } - case OUTPUT_PLAY: // 4 - { - if (context && context->playback) - { - if (context->playback->isVideo) - ret = context->output->video->Command(context, OUTPUT_PLAY, "video"); - - if (!ret) // success or not executed, dunn care - { - if (context->playback->isAudio) - ret = context->output->audio->Command(context, OUTPUT_PLAY, "audio"); - - if (!ret) // success or not executed, dunn care - { - if (context->playback->isSubtitle) - ret = context->output->subtitle->Command(context, OUTPUT_PLAY, "subtitle"); - } - } - } - else - ret = -1; - break; - } - case OUTPUT_STOP: - { - if (context && context->playback) - { - if (context->playback->isVideo) - context->output->video->Command(context, OUTPUT_STOP, "video"); - if (context->playback->isAudio) - context->output->audio->Command(context, OUTPUT_STOP, "audio"); - if (context->playback->isSubtitle) - context->output->subtitle->Command(context, OUTPUT_STOP, "subtitle"); - } - else - ret = -1; - break; - } - case OUTPUT_FLUSH: - { - if (context && context->playback) - { - if (context->playback->isVideo) - context->output->video->Command(context, OUTPUT_FLUSH, "video"); - if (context->playback->isAudio) - context->output->audio->Command(context, OUTPUT_FLUSH, "audio"); - //if (context->playback->isSubtitle) - // context->output->subtitle->Command(context, OUTPUT_FLUSH, "subtitle"); - } - else - ret = -1; - break; - } - case OUTPUT_PAUSE: // 6 - { - if (context && context->playback) - { - if (context->playback->isVideo) - context->output->video->Command(context, OUTPUT_PAUSE, "video"); - if (context->playback->isAudio) - context->output->audio->Command(context, OUTPUT_PAUSE, "audio"); - //if (context->playback->isSubtitle) - // context->output->subtitle->Command(context, OUTPUT_PAUSE, "subtitle"); - } - else - ret = -1; - break; - } - case OUTPUT_FASTFORWARD: - { - if (context && context->playback) - { - if (context->playback->isVideo) - context->output->video->Command(context, OUTPUT_FASTFORWARD, "video"); - if (context->playback->isAudio) - context->output->audio->Command(context, OUTPUT_FASTFORWARD, "audio"); - //if (context->playback->isSubtitle) - // context->output->subtitle->Command(context, OUTPUT_PAUSE, "subtitle"); - } - else - ret = -1; - break; - } - case OUTPUT_CONTINUE: - { - if (context && context->playback) - { - if (context->playback->isVideo) - context->output->video->Command(context, OUTPUT_CONTINUE, "video"); - if (context->playback->isAudio) - context->output->audio->Command(context, OUTPUT_CONTINUE, "audio"); - //if (context->playback->isSubtitle) - // context->output->subtitle->Command(context, OUTPUT_CONTINUE, "subtitle"); - } - else - ret = -1; - break; - } - case OUTPUT_AVSYNC: - { - if (context && context->playback) - { - if (context->playback->isVideo && context->playback->isAudio) - context->output->audio->Command(context, OUTPUT_AVSYNC, "audio"); - } - else - ret = -1; - break; - } - case OUTPUT_CLEAR: - { - if (context && context->playback) - { - if (context->playback->isVideo && (argument == NULL || *(char *) argument == 'v')) - context->output->video->Command(context, OUTPUT_CLEAR, "video"); - if (context->playback->isAudio && (argument == NULL || *(char *) argument == 'a')) - context->output->audio->Command(context, OUTPUT_CLEAR, "audio"); - //if (context->playback->isSubtitle && (argument == NULL || *(char *) argument == 's')) - // context->output->subtitle->Command(context, OUTPUT_CLEAR, "subtitle"); - } - else - ret = -1; - break; - } - case OUTPUT_PTS: - { - if (context && context->playback) - { - if (context->playback->isVideo) - return context->output->video->Command(context, OUTPUT_PTS, argument); - if (context->playback->isAudio) - return context->output->audio->Command(context, OUTPUT_PTS, argument); - //if (context->playback->isSubtitle) - // return context->output->subtitle->Command(context, OUTPUT_PTS, "subtitle"); - } - else - ret = -1; - break; - } - case OUTPUT_SWITCH: - { - if (context && context->playback) - { - if (context->playback->isAudio) - return context->output->audio->Command(context, OUTPUT_SWITCH, "audio"); - if (context->playback->isVideo) - return context->output->video->Command(context, OUTPUT_SWITCH, "video"); - } - else - ret = -1; - break; - } - case OUTPUT_SLOWMOTION: - { - if (context && context->playback) - { - if (context->playback->isVideo) - context->output->video->Command(context, OUTPUT_SLOWMOTION, "video"); - if (context->playback->isAudio) - context->output->audio->Command(context, OUTPUT_SLOWMOTION, "audio"); - //if (context->playback->isSubtitle) - // context->output->subtitle->Command(context, OUTPUT_PAUSE, "subtitle"); - } - else - ret = -1; - break; - } - case OUTPUT_AUDIOMUTE: - { - if (context && context->playback) - { - if (context->playback->isAudio) - context->output->audio->Command(context, OUTPUT_AUDIOMUTE, (char *) argument); - } - else - ret = -1; - break; - } - default: -#ifdef DEBUG - printf("%s::%s OutputCmd %d not supported!\n", FILENAME, __FUNCTION__, command); -#endif - break; - } - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -OutputHandler_t OutputHandler = -{ - "Output", - NULL, - NULL, - NULL, - &Command, -}; diff --git a/libeplayer2/playback/playback.c b/libeplayer2/playback/playback.c deleted file mode 100644 index f221196..0000000 --- a/libeplayer2/playback/playback.c +++ /dev/null @@ -1,1767 +0,0 @@ -// #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "playback.h" -#include "common.h" - -#define DEBUG - -static const char FILENAME[] = "playback.c"; - -//little helper functions -static int playback_getline(char **pbuffer, size_t *pbufsize, int fd) -{ - size_t i = 0; - int rc; - while (1) - { - if (i >= *pbufsize) - { - char *newbuf = (char *)realloc(*pbuffer, (*pbufsize) + 1024); - if (newbuf == NULL) - return -1; - *pbuffer = newbuf; - *pbufsize = (*pbufsize) + 1024; - } - rc = read(fd, (*pbuffer) + i, 1); - if (rc <= 0 || (*pbuffer)[i] == '\n') - { - (*pbuffer)[i] = '\0'; - return rc <= 0 ? -1 : i; - } - if ((*pbuffer)[i] != '\r') i++; - } -} - -int openHttpConnection(Context_t *context, char **content, off_t off) -{ - char *url = context->playback->uri; - char host[256]; - int port = 80; - char uri[512]; - int x; - int slash = 0; - for (x = 7; x < strlen(url) - 1; x++) - { - if (url[x] == '/') - { - slash = x; - break; - } - } - if (slash > 0) - { - strncpy(host, url + 7, slash - 7); - host[slash - 7] = '\0'; - strcpy(uri, url + slash); - } - else - { - strcpy(host, url + 7); - strcpy(uri, "/"); - } - int dp = 0; - for (x = 0; x < strlen(host) - 1; x++) - { - if (host[x] == ':') - { - dp = x; - break; - } - } - if (dp > 0) - { - port = atoi(host + dp + 1); - //host = host.substr(0, dp); - host[dp] = '\0'; - } -#ifdef DEBUG - printf("URL: %s\n", url); - printf("Host: %s\n", host); - printf("URI: %s\n", uri); - printf("Port: %d\n", port); -#endif - - struct hostent *h = gethostbyname(host); - if (h == NULL || h->h_addr_list == NULL) - { - printf("hostlookup failed\n"); - return 0; - } - int fd = socket(PF_INET, SOCK_STREAM, 0); - if (fd == -1) - { - printf("creating socket failed"); - return 0; - } - struct sockaddr_in addr; - addr.sin_family = AF_INET; - addr.sin_addr.s_addr = *((in_addr_t *)h->h_addr_list[0]); - addr.sin_port = htons(port); - -#ifdef DEBUG - printf("connecting to %s\n", url); -#endif - - if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) == -1) - { - printf("connect failed for: %s\n", url); - return 0; - } - char request[1024]; - strcpy(request, "GET "); - strcat(request, uri); - strcat(request, " HTTP/1.1\r\n"); - strcat(request, "Host: "); - strcat(request, host); - if (port != 80) - { - char p[16]; - sprintf(p, "%d", port); - strcat(request, ":"); - strcat(request, p); - } - strcat(request, "\r\n"); - - char b[32]; - - /* konfetti: I think this must be %lu because in case of big files the value becomes - * negative in %ld case which might not work!!! - * I dont know how to test so I did not change...(see openUPNPConnection which works fine) - */ - sprintf(b, "%ld", (long int) off); - strcat(request, "Range: bytes="); - strcat(request, b); - strcat(request, "-\r\n"); - - //strcat(request,"User-Agent: VLC mediaplayer - version 1.0.2\r\n"); - //strcat(request,"Range: bytes=0-\r\n"); - //strcat(request,"Icy-MetaData: 1\r\n"); - strcat(request, "Accept: */*\r\n"); - strcat(request, "Connection: close\r\n"); - strcat(request, "\r\n"); -#ifdef DEBUG - printf("sending:\n%s", request); -#endif - write(fd, request, strlen(request)); - - int rc, ext_found = 0; - size_t buflen = 1000; - char *linebuf = (char *)malloc(1000); - - rc = playback_getline(&linebuf, &buflen, fd); -#ifdef DEBUG - printf("RECV(%d): %s\n", rc, linebuf); -#endif - if (rc <= 0) - { - close(fd); - free(linebuf); - return 0; - } - - char proto[100]; - int statuscode = 0; - char statusmsg[100]; - rc = sscanf(linebuf, "%99s %d %99s", proto, &statuscode, statusmsg); - if (statuscode == 303) - { -#ifdef DEBUG - printf("redirecting.\n"); - printf("got: %s\n", linebuf); -#endif - while ((rc = playback_getline(&linebuf, &buflen, fd)) > 0) - { - if (!strncmp("Location: ", linebuf, 10)) - { - close(fd); - free(context->playback->uri); - context->playback->uri = strdup(linebuf + 10); - return openHttpConnection(context, content, off); - } -#ifdef DEBUG - printf("RECV(%d): %s\n", rc, linebuf); -#endif - } - free(linebuf); - close(fd); - return 0; - } - if (rc != 3 || (statuscode != 200 && statuscode != 206)) - { - printf("wrong response: \"200 OK\" expected.\n"); -#ifdef DEBUG - printf("got: %s\n", linebuf); -#endif - while ((rc = playback_getline(&linebuf, &buflen, fd)) > 0) - { -#ifdef DEBUG - printf("RECV(%d): %s\n", rc, linebuf); -#endif - } - free(linebuf); - close(fd); - return 0; - } -#ifdef DEBUG - printf("proto=%s, code=%d, msg=%s\n", proto, statuscode, statusmsg); -#endif - while ((rc = playback_getline(&linebuf, &buflen, fd)) > 0) - { -#ifdef DEBUG - printf("RECV(%d): %s\n", rc, linebuf); -#endif - if (!strncmp("Content-Length: ", linebuf, 16)) - { - long int pos; - sscanf(linebuf + 16, "%ld", &pos); - context->playback->size = pos + off; - } - if (rc == 24) //ContentType - { - int ret = 0; -#ifdef DEBUG - printf("%s: Content-Type: ", __func__); -#endif - if (!(ret = strncmp("audio/mpeg", linebuf + 14, 10))) - { -#ifdef DEBUG - printf("mp3"); - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - *content = strdup("mp3"); - ext_found = 1; - } - else - { - printf(" Unknown (%s) %d", linebuf, ret); - } - printf("\n"); - } - else if (rc == 23) - { - int ret = 0; -#ifdef DEBUG - printf("%s: Content-Type: ", __func__); -#endif - if (!(ret = strncmp("audio/mpeg", linebuf + 13, 10))) - { -#ifdef DEBUG - printf("mp3"); - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - *content = strdup("mp3"); - ext_found = 1; - } - if (!(ret = strncmp("video/mp4", linebuf + 14, 9))) - { -#ifdef DEBUG - printf("mp4"); - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - *content = strdup("mp4"); - ext_found = 1; - } - else - { - printf(" Unknown (%s) %d", linebuf, ret); - } - printf("\n"); - } - else - { - - } - } - free(linebuf); - if (!ext_found) - { - //default mp3 -#ifdef DEBUG - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - *content = strdup("mp3"); - } - return fd; -} - -/* konfetti: hack hack: copied from neutrino netfile.cpp - * I dont like most of the stuff in this file. we should - * implement a mechanism like netfile.cpp to open _ALL_ - * media file formats in the correct manner. just for the - * first shot and because of missing time hacking the world ... - */ -int ConnectToUPNPServer(char *hostname, int port) -{ - struct hostent *host; - struct sockaddr_in sock; - int fd, addr; - struct pollfd pfd; - char err_txt[2048]; - - printf("looking up hostname: %s\n", hostname); - - host = gethostbyname(hostname); - - if (host == NULL) - { - herror(err_txt); - return -1; - } - - addr = htonl(*(int *)host->h_addr); - - printf("connecting to %s [%d.%d.%d.%d], port %d\n", host->h_name, - (addr & 0xff000000) >> 24, - (addr & 0x00ff0000) >> 16, - (addr & 0x0000ff00) >> 8, - (addr & 0x000000ff), port); - - fd = socket(AF_INET, SOCK_STREAM, 0); - - if (fd == -1) - { - strcpy(err_txt, strerror(errno)); - return -1; - } - - memset(&sock, 0, sizeof(sock)); - memmove((char *)&sock.sin_addr, host->h_addr, host->h_length); - - sock.sin_family = AF_INET; - sock.sin_port = htons(port); - - int flgs = fcntl(fd, F_GETFL, 0); - fcntl(fd, F_SETFL, flgs | O_NONBLOCK); - - if (connect(fd, (struct sockaddr *)&sock, sizeof(sock)) == -1) - { - if (errno != EINPROGRESS) - { - close(fd); - strcpy(err_txt, strerror(errno)); - printf("error connecting to %s: %s\n", hostname, err_txt); - return -1; - } - } - printf("connected to %s\n", hostname); - pfd.fd = fd; - pfd.events = POLLOUT | POLLERR | POLLHUP; - pfd.revents = 0; - - int ret = poll(&pfd, 1, 5000); - if (ret != 1) - { - strcpy(err_txt, strerror(errno)); - printf("error connecting to %s: %s\n", hostname, err_txt); - close(fd); - return -1; - } - if ((pfd.revents & POLLOUT) == POLLOUT) - { - fcntl(fd, F_SETFL, flgs & ~ O_NONBLOCK); - return fd; - } - - return fd; -} - -/* adapted from netfile.cpp */ -void parseURL(char *url, char *host, char *file, int *port) -{ - char *ptr = strstr(url, "://"); - - if (ptr) /* otherwise this is not an url */ - { - if (strstr(url, "http") == NULL) - { - printf("%s: not an url ? (%s)\n", __func__, url); - return; - } - - strcpy(host, ptr + 3); - - /* extract the file path from the url */ - ptr = strchr(ptr + 3, '/'); - if (ptr) - { - strcpy(file, ptr); - } - else - { - strcpy(file, "/"); - } - - /* extract the host part from the url */ - ptr = strchr(host, '/'); - if (ptr) - *ptr = 0; - -#ifdef login_supported - if ((ptr = strchr(host, '@'))) - { - *ptr = 0; - base64_encode(buffer, url.host); - strcpy(url.logindata, buffer); - - strcpy(buffer, ptr + 1); - strcpy(url.host, buffer); - } - else - url.logindata[0] = 0; -#endif - ptr = strrchr(host, ':'); - - if (ptr) - { - *port = atoi(ptr + 1); - *ptr = 0; - } - } - else - { - printf("%s: not an url ? (%s)\n", __func__, url); - } -} - -int openUPNPConnection(Context_t *context, off_t off) -{ - char *url = context->playback->uri; - char host[256], uri[512], request[1024], proto[100], statusmsg[100]; - int port = 80, statuscode = 0, fd, rc; - size_t buflen = 1000; - char *linebuf = (char *)malloc(1000); - - printf("%s (0x%lx %lu) linebuf = %p>\n", __func__, (long unsigned int) off, (long unsigned int) off, linebuf); - - parseURL(url, host, uri, &port); - -#ifdef DEBUG - printf("URL: %s\n", url); - printf("Host: %s\n", host); - printf("URI: %s\n", uri); - printf("Port: %d\n", port); -#endif - - fd = ConnectToUPNPServer(host, port); - - /* send the get message (only http/1.1 supported) */ - strcpy(request, "GET "); - strcat(request, uri); - strcat(request, " HTTP/1.1\r\n"); - send(fd, request, strlen(request), 0); - - /* now send hostname */ - sprintf(request, "Host: %s:%d\r\n", host, port); - send(fd, request, strlen(request), 0); - - /* send the offset */ - sprintf(request, "Range: bytes=%lu-\r\n", (unsigned long int) off); - printf("send: %s\n", request); - send(fd, request, strlen(request), 0); - - /* now send a "faked" user agent */ - sprintf(request, "User-Agent: WinampMPEG/5.52\r\n"); - send(fd, request, strlen(request), 0); - - /* fixme: authorization if needed (see netfile.cpp) */ - - sprintf(request, "Accept: */*\r\n"); - send(fd, request, strlen(request), 0); - - sprintf(request , "Connection: close\r\n"); - send(fd, request, strlen(request), 0); - - /* end request */ - sprintf(request , "\r\n"); - send(fd, request, strlen(request), 0); - - rc = playback_getline(&linebuf, &buflen, fd); -#ifdef DEBUG - printf("RECV(%d): %s\n", rc, linebuf); -#endif - if (rc <= 0) - { - close(fd); - free(linebuf); - return -1; - } - - rc = sscanf(linebuf, "%99s %d %99s", proto, &statuscode, statusmsg); - -#ifdef DEBUG - printf("proto %s\n", proto); - printf("statuscode %d\n", statuscode); - printf("statuscode %s\n", statusmsg); -#endif - - /* we currently only accept http 1.1 */ - if (strstr(proto, "HTTP/1.1") == NULL) - { - printf("%s: not an HTTP/1.1 response (%s)\n", __func__, proto); - free(linebuf); - return -1; - } - - switch (statuscode) - { - case 200: /* OK */ - case 206: /* Partial */ -#ifdef DEBUG - printf("%s: statuscode ok or partial %d\n", __func__, statuscode); -#endif - while ((rc = playback_getline(&linebuf, &buflen, fd)) > 0) - { -#ifdef DEBUG - printf("RECV(%d): %s\n", rc, linebuf); -#endif - if (!strncmp("Content-Length: ", linebuf, 16)) - { - long int pos; - - sscanf(linebuf + 16, "%ld", &pos); - context->playback->size = pos + off; - } - } - -#ifdef DEBUG - printf("linebuf %p\n", linebuf); -#endif - break; - case 301: /* moved */ - printf("%s: error: file has been moved\n", __func__); - close(fd); - free(linebuf); - return -1; - break; - - case 302: /* found; tmp redirecting */ - /* this means the resource is tmp on another uri but - * later we must use the orig uri. - */ - printf("%s: error: temp resource redirecting not supported\n", __func__); - close(fd); - free(linebuf); - return -1; - break; - case 303: /* see other; redirecting */ -#ifdef DEBUG - printf("%s: status redirecting\n", __func__); - printf("%s: got: %s\n", __func__, linebuf); -#endif - while ((rc = playback_getline(&linebuf, &buflen, fd)) > 0) - { - int ret; - - if (!strncmp("Location: ", linebuf, 10)) - { - close(fd); - free(context->playback->uri); - context->playback->uri = strdup(linebuf + 10); - - /* konfetti: otherwise we loose the linebuf - * allocation every recursion. (leek return) - */ - ret = openUPNPConnection(context, off); - free(linebuf); - return ret; - } -#ifdef DEBUG - printf("%s: RECV(%d): %s\n", __func__, rc, linebuf); -#endif - } - free(linebuf); - close(fd); - return -1; - - break; - - case 401: /* unauthorized */ - printf("%s: error: not authorized\n", __func__); - close(fd); - free(linebuf); - return -1; - break; - - case 403: /* forbidden */ - printf("%s: error: forbidden\n", __func__); - close(fd); - free(linebuf); - return -1; - break; - - case 404: /* file not found */ - printf("%s: error: file not found\n", __func__); - close(fd); - free(linebuf); - return -1; - break; - default: - printf("%s: error: unexpected status code %d\n", __func__, statuscode); - /* not sure if we should close here? close(fd);*/ - free(linebuf); - return -1; - break; - } - - free(linebuf); - printf("%s < connection established\n", __func__); - return fd; -} - - -static int openMmsConnection(char *url, char **content) -{ - char host[256]; - int port = 80; - char uri[512]; - int x; - int slash = 0; - for (x = 6; x < strlen(url) - 1; x++) - { - if (url[x] == '/') - { - slash = x; - break; - } - } - if (slash > 0) - { - strncpy(host, url + 6, slash - 6); - host[slash - 6] = '\0'; - strcpy(uri, url + slash); - } - else - { - strcpy(host, url + 6); - strcpy(uri, "/"); - } - int dp = 0; - for (x = 0; x < strlen(host) - 1; x++) - { - if (host[x] == ':') - { - dp = x; - break; - } - } - if (dp > 0) - { - port = atoi(host + dp + 1); - //host = host.substr(0, dp); - host[dp] = '\0'; - } -#ifdef DEBUG - printf("URL: %s\n", url); - printf("Host: %s\n", host); - printf("URI: %s\n", uri); - printf("Port: %d\n", port); -#endif - - struct hostent *h = gethostbyname(host); - if (h == NULL || h->h_addr_list == NULL) - { - printf("hotlookup failed\n"); - return 0; - } - int fd = socket(PF_INET, SOCK_STREAM, 0); - if (fd == -1) - { - printf("creating socket failed"); - return 0; - } - struct sockaddr_in addr; - addr.sin_family = AF_INET; - addr.sin_addr.s_addr = *((in_addr_t *)h->h_addr_list[0]); - addr.sin_port = htons(port); - -#ifdef DEBUG - printf("connecting to %s\n", url); -#endif - - if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) == -1) - { - printf("connect failed for: %s\n", url); - return 0; - } -#ifdef DEBUG - printf("connected!\n"); -#endif - char request[1024]; - strcpy(request, "GET "); - strcat(request, uri); - strcat(request, " HTTP/1.1\n"); - strcat(request, "Host: "); - strcat(request, host); - strcat(request, "\n"); - strcat(request, "Accept: */*\n"); - strcat(request, "Connection: close\n"); - strcat(request, "\n"); -#ifdef DEBUG - printf("sending:\n%s", request); -#endif - write(fd, request, strlen(request)); - - int rc; - size_t buflen = 1000; - char *linebuf = (char *)malloc(1000); - - rc = playback_getline(&linebuf, &buflen, fd); -#ifdef DEBUG - printf("RECV(%d): %s\n", rc, linebuf); -#endif - if (rc <= 0) - { - close(fd); - free(linebuf); - return 0; - } - - char proto[100]; - int statuscode = 0; - char statusmsg[100]; - rc = sscanf(linebuf, "%99s %d %99s", proto, &statuscode, statusmsg); - if (rc != 3 || statuscode != 200) - { - printf("wrong response: \"200 OK\" expected.\n"); -#ifdef DEBUG - printf("got: %s\n", linebuf); -#endif - free(linebuf); - close(fd); - return 0; - } -#ifdef DEBUG - printf("proto=%s, code=%d, msg=%s\n", proto, statuscode, statusmsg); -#endif - while (rc > 0) - { - rc = playback_getline(&linebuf, &buflen, fd); -#ifdef DEBUG - printf("RECV(%d): %s\n", rc, linebuf); -#endif - if (rc == 24) //ContentType - { - int ret = 0; -#ifdef DEBUG - printf("%s: Content-Type: ", __func__); -#endif - if (!(ret = strncmp("audio/mpeg", linebuf + 14, 10))) - { -#ifdef DEBUG - printf("mp3"); - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - *content = strdup("mp3"); - } - else - { - printf(" Unknown (%s) %d", linebuf, ret); - } - printf("\n"); - } - } - free(linebuf); - - return fd; -} - -static void getExtension(char *FILENAMEname, char **extension) -{ - - int i = 0; - int stringlength = (int) strlen(FILENAMEname); -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - for (i = 0; stringlength - i > 0; i++) - { - if (FILENAMEname[stringlength - i - 1] == '.') - { -#ifdef DEBUG - printf("strdup in %s::%s:%d\n", FILENAME, __FUNCTION__, __LINE__); -#endif - *extension = strdup(FILENAMEname + (stringlength - i)); - break; - } - } -} - -static void getUPNPExtension(char *FILENAMEname, char **extension) -{ - char *str = strstr(FILENAMEname, "ext="); - - if (str != NULL) - { - *extension = strdup(str + strlen("ext=") + 1); - printf("%s: extension found %s\n", __func__, *extension); - return; - } - printf("%s: no extension found\n", __func__); - *extension = NULL; -} - -static void getParentFolder(char *Filename, char **folder) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int i = 0; - int stringlength = (int) strlen(Filename); - - for (i = 0; stringlength - i > 0; i++) - { - if (Filename[stringlength - i - 1] == '/') - { - *folder = (char *)malloc(stringlength - i - 1); - strncpy(*folder, Filename, stringlength - i - 1); - break; - } - } -} - -//konfetti: explanation on wrong handling: -//pthread_t is not a pointer type and cannot set to NULL -//as it is done in PlaybackOpen. This may work but is very unproper - -static pthread_t DummyThread1; -static unsigned char isThread1Created = 0; -static pthread_t DummyThread2; -static unsigned char isThread2Created = 0; -static pthread_t DummyThread3; -static unsigned char isThread3Created = 0; - -static void DummyThread(Context_t *context) -{ -#ifdef DEBUG - printf("dummy thread started\n"); -#endif - usleep(10000); -} - -static int PlaybackOpen(Context_t *context, char *uri) -{ -#ifdef DEBUG - printf("%s::%s URI=%s\n", FILENAME, __FUNCTION__, uri); -#endif - /* make sure that 3 thread are created - if the first file we play is a file without subtitles (no subtitles thread is created) - on playback of the second file pthread_create fails with cannot allocate memory - because we did not create the subtitle thread - so we need to make sure that we created 3 threads before starting the first file. - this is a quick and dirty fix and needs to be investigated if there is a better solution*/ - int error; - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - if ((error = pthread_create(&DummyThread1, &attr, (void *)&DummyThread, NULL)) != 0) - { - fprintf(stderr, "Error creating thread in %s error:%d:%s\n", __FUNCTION__, error, strerror(error)); - isThread1Created = 0; - } - else - isThread1Created = 1; - - if ((error = pthread_create(&DummyThread2, &attr, (void *)&DummyThread, NULL)) != 0) - { - fprintf(stderr, "Error creating thread in %s error:%d:%s\n", __FUNCTION__, error, strerror(error)); - isThread2Created = 0; - } - else - isThread2Created = 1; - - if ((error = pthread_create(&DummyThread3, &attr, (void *)&DummyThread, NULL)) != 0) - { - fprintf(stderr, "Error creating thread in %s error:%d:%s\n", __FUNCTION__, error, strerror(error)); - isThread3Created = 0; - } - else - isThread3Created = 1; -#ifdef DEBUG - printf("joining dummy threads\n"); -#endif - if (isThread1Created) error = pthread_join(DummyThread1, NULL); - if (isThread2Created) error = pthread_join(DummyThread2, NULL); - if (isThread3Created) error = pthread_join(DummyThread3, NULL); - - context->playback->uri = strdup(uri); - - if (!context->playback->isPlaying) - { - if (!strncmp("file://", uri, 7)) - { - char *extension = NULL; - context->playback->isFile = 1; - context->playback->isHttp = 0; - context->playback->isUPNP = 0; - - context->playback->fd = open(uri + 7, O_RDONLY); - if (context->playback->fd == -1) - { -#ifdef DEBUG - printf("context->playback->fd == -1!\n"); -#endif - return -1; - } - - getExtension(uri + 7, &extension); - if (!extension) return -1; - - if (context->container->Command(context, CONTAINER_ADD, extension) < 0) - return -1; - if (context->container->selectedContainer != NULL) - { - if (context->container->selectedContainer->Command(context, CONTAINER_INIT, uri + 7) < 0) - return -1; - } - else - { - return -1; - } - - free(extension); - - //CHECK FOR SUBTITLES - if (context->container && context->container->textSrtContainer) - context->container->textSrtContainer->Command(context, CONTAINER_INIT, uri + 7); - //if(context->playback->isSubtitle<=0) - if (context->container && context->container->textSsaContainer) - context->container->textSsaContainer->Command(context, CONTAINER_INIT, uri + 7); - - } - else if (!strncmp("http://", uri, 7)) - { - char *extension = NULL; - context->playback->isFile = 0; - context->playback->isHttp = 1; - context->playback->isUPNP = 0; - - context->playback->fd = openHttpConnection(context, &extension, 0); -#ifdef DEBUG - printf("context->playback->fd = %d\n", context->playback->fd); -#endif - if (context->playback->fd == 0) - { -#ifdef DEBUG - printf("context->playback->fd == 0!\n"); -#endif - return -1; - } - - if (!extension) getExtension(uri + 7, &extension); - if (!extension) return -1; - - if (context->container->Command(context, CONTAINER_ADD, extension) < 0) - return -1; - if (context->container->selectedContainer != NULL) - { - if (context->container->selectedContainer->Command(context, CONTAINER_INIT, uri + 7) < 0) - return -1; - } - else - { - return -1; - } - - free(extension); - } /* http */ - else if (!strncmp("mms://", uri, 6)) - { - char *extension = NULL; - context->playback->isFile = 0; - context->playback->isHttp = 1; - context->playback->isUPNP = 0; - - context->playback->fd = openMmsConnection(uri, &extension); -#ifdef DEBUG - printf("context->playback->fd = %d\n", context->playback->fd); -#endif - if (context->playback->fd == 0) - { -#ifdef DEBUG - printf("context->playback->fd == 0!\n"); -#endif - return -1; - } - - if (!extension) getExtension(uri + 6, &extension); - if (!extension) return -1; - - if (context->container->Command(context, CONTAINER_ADD, extension) < 0) - return -1; - if (context->container->selectedContainer != NULL) - { - if (context->container->selectedContainer->Command(context, CONTAINER_INIT, uri + 6) < 0) - return -1; - } - else - { - return -1; - } - - free(extension); - } /* mms */ - else if (!strncmp("upnp://", uri, 7)) - { - char *extension = NULL; - context->playback->isFile = 0; - context->playback->isHttp = 0; - context->playback->isUPNP = 1; - - context->playback->uri += 7; /* jump over upnp:// */ - - context->playback->fd = openUPNPConnection(context, 0); - - if (context->playback->fd <= 0) - { - printf("context->playback->fd == -1!\n"); - return -1; - } - else - printf("%s: file is open at %d\n", __func__, context->playback->fd); - - getUPNPExtension(uri + 7, &extension); - if (!extension) return -1; - - if (context->container->Command(context, CONTAINER_ADD, extension) < 0) - { - printf("%s: container CONTAINER_ADD failed\n", __func__); - return -1; - } - if (context->container->selectedContainer != NULL) - { - if (context->container->selectedContainer->Command(context, CONTAINER_INIT, uri + 7) < 0) - { - printf("%s: container CONTAINER_INIT failed\n", __func__); - return -1; - } - } - else - { - printf("%s: selected container is null\n", __func__); - return -1; - } - - free(extension); - - } /* upnp */ - else - { - printf("Unknown stream!\n"); - return -1; - } - } - else - return -1; - - return 0; -} - -static int PlaybackClose(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s \n", FILENAME, __FUNCTION__); -#endif - - context->container->Command(context, CONTAINER_DEL, NULL); - -//FIXME KILLED BY signal 7 or 11 - if (context->container && context->container->textSrtContainer) - context->container->textSrtContainer->Command(context, CONTAINER_DEL, NULL); - - if (context->container && context->container->textSsaContainer) - context->container->textSsaContainer->Command(context, CONTAINER_DEL, NULL); - - context->manager->audio->Command(context, MANAGER_DEL, NULL); - context->manager->video->Command(context, MANAGER_DEL, NULL); - context->manager->subtitle->Command(context, MANAGER_DEL, NULL); - - close(context->playback->fd); - - context->playback->isPaused = 0; - context->playback->isPlaying = 0; - context->playback->isForwarding = 0; - context->playback->BackWard = 0; - context->playback->SlowMotion = 0; - context->playback->Speed = 0; - - return 0; -} - -static int PlaybackPlay(Context_t *context) -{ - int ret = 0; -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - if (!context->playback->isPlaying) - { - context->playback->AVSync = 1; - context->output->Command(context, OUTPUT_AVSYNC, NULL); - - context->playback->isCreationPhase = 1; // allows the created thread to go into wait mode - ret = context->output->Command(context, OUTPUT_PLAY, NULL); - - if (ret != 0) - { -#ifdef DEBUG - printf("%s::%s OUTPUT_PLAY failed!\n", FILENAME, __FUNCTION__); -#endif -#ifdef DEBUG - printf("%s::%s clearing isCreationPhase!\n", FILENAME, __FUNCTION__); -#endif - context->playback->isCreationPhase = 0; // allow thread to go into next state - } - else - { - context->playback->isPlaying = 1; - context->playback->isPaused = 0; - context->playback->isForwarding = 0; - context->playback->BackWard = 0; - context->playback->SlowMotion = 0; - context->playback->Speed = 1; - -#ifdef DEBUG - printf("%s::%s clearing isCreationPhase!\n", FILENAME, __FUNCTION__); -#endif - context->playback->isCreationPhase = 0; // allow thread to go into next state - - ret = context->container->selectedContainer->Command(context, CONTAINER_PLAY, NULL); - if (ret != 0) - { -#ifdef DEBUG - printf("%s::%s CONTAINER_PLAY failed!\n", FILENAME, __FUNCTION__); -#endif - } - - } - - } - else - ret = -1; - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -static int PlaybackPause(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - if (context->playback->isPlaying && !context->playback->isPaused) - { - - if (context->playback->SlowMotion) - context->output->Command(context, OUTPUT_CLEAR, NULL); - - context->output->Command(context, OUTPUT_PAUSE, NULL); - - context->playback->isPaused = 1; - //context->playback->isPlaying = 1; - context->playback->isForwarding = 0; - context->playback->BackWard = 0; - context->playback->SlowMotion = 0; - context->playback->Speed = 1; - } - else - return -1; - - return 0; -} - -static int PlaybackContinue(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - if (context->playback->isPlaying && - (context->playback->isPaused || context->playback->isForwarding || context->playback->BackWard || context->playback->SlowMotion)) - { - - if (context->playback->SlowMotion) - context->output->Command(context, OUTPUT_CLEAR, NULL); - - context->output->Command(context, OUTPUT_CONTINUE, NULL); - - context->playback->isPaused = 0; - //context->playback->isPlaying = 1; - context->playback->isForwarding = 0; - context->playback->BackWard = 0; - context->playback->SlowMotion = 0; - context->playback->Speed = 1; - } - else - return -1; - - return 0; -} - -static int PlaybackStop(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - if (context->playback->isPlaying) - { - - context->playback->isPaused = 0; - context->playback->isPlaying = 0; - context->playback->isForwarding = 0; - context->playback->BackWard = 0; - context->playback->SlowMotion = 0; - context->playback->Speed = 0; - - context->output->Command(context, OUTPUT_STOP, NULL); - context->container->selectedContainer->Command(context, CONTAINER_STOP, NULL); - - //PlaybackClose(context); - } - else - return -1; - - return 0; -} - -static int PlaybackTerminate(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - int ret = 0; - - if (context && context->playback && context->playback->isPlaying) - { - //First Flush and than delete container, else e2 cant read length of file anymore - context->output->Command(context, OUTPUT_FLUSH, NULL); - ret = context->container->selectedContainer->Command(context, CONTAINER_STOP, NULL); - - context->playback->isPaused = 0; - context->playback->isPlaying = 0; - context->playback->isForwarding = 0; - context->playback->BackWard = 0; - context->playback->SlowMotion = 0; - context->playback->Speed = 0; - - //PlaybackClose(context); - } - else - ret = -1; - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -static int PlaybackFastForward(Context_t *context, int *speed) -{ - - - //Audio only forwarding not supported - if (context->playback->isVideo && !context->playback->isHttp && !context->playback->BackWard && (!context->playback->isPaused || context->playback->isPlaying)) - { - - context->playback->isForwarding = 1; - - switch (*speed) - { - case 2: - context->playback->Speed = 1; - break; - case 4: - context->playback->Speed = 2; - break; - case 8: - context->playback->Speed = 3; - break; - case 48: //16x - context->playback->Speed = 4; - break; - case 96: //32x - context->playback->Speed = 5; - break; - case 192: //64x - context->playback->Speed = 6; - break; - case 384: //128x - context->playback->Speed = 7; - break; - } - -#ifdef DEBUG - printf("%s::%s Speed: %d x {%d}\n", FILENAME, __FUNCTION__, *speed, context->playback->Speed); -#endif - - context->output->Command(context, OUTPUT_FASTFORWARD, NULL); - } - else - return -1; - return 0; -} - -static pthread_t FBThread; -/* konfetti: see below */ -static unsigned char isFBThreadStarted = 0; - -static void FastBackwardThread(Context_t *context) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - context->output->Command(context, OUTPUT_AUDIOMUTE, "1"); - while (context->playback && context->playback->isPlaying && context->playback->BackWard) - { - context->playback->isSeeking = 1; - context->output->Command(context, OUTPUT_CLEAR, NULL); - context->output->Command(context, OUTPUT_PAUSE, NULL); - context->output->Command(context, OUTPUT_CLEAR, NULL); - context->container->selectedContainer->Command(context, CONTAINER_SEEK, &context->playback->BackWard); - context->output->Command(context, OUTPUT_CLEAR, NULL); - context->playback->isSeeking = 0; - context->output->Command(context, OUTPUT_CONTINUE, NULL); - - //context->container->selectedContainer->Command(context, CONTAINER_SEEK, &context->playback->BackWard); - //context->output->Command(context, OUTPUT_CLEAR, "video"); - usleep(500000); - } - //context->output->Command(context, OUTPUT_CLEAR, NULL); - context->output->Command(context, OUTPUT_AUDIOMUTE, "0"); - isFBThreadStarted = 0; -#ifdef DEBUG - printf("%s::%s exit\n", FILENAME, __FUNCTION__); -#endif -} - -static int PlaybackFastBackward(Context_t *context, int *speed) -{ - - //Audio only backwarding not supported - if (context->playback->isVideo && !context->playback->isHttp && !context->playback->isForwarding && (!context->playback->isPaused || context->playback->isPlaying)) - { - context->playback->BackWard = 0; - - switch (*speed) - { - case 8: - context->playback->BackWard = -8; - break; - case 16: - context->playback->BackWard = -16; - break; - case 32: - context->playback->BackWard = -32; - break; - case 64: - context->playback->BackWard = -64; - break; - case 128: - context->playback->BackWard = -128; - break; - default: - return -1; - } - -#ifdef DEBUG - printf("%s::%s Speed: %d x {%f}\n", FILENAME, __FUNCTION__, *speed, context->playback->BackWard); -#endif - - int error; - pthread_attr_t attr; - - if (!isFBThreadStarted) - { - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - - if ((error = pthread_create(&FBThread, &attr, (void *)&FastBackwardThread, context)) != 0) - { - fprintf(stderr, "Error creating thread in %s error:%d:%s\n", __FUNCTION__, error, strerror(error)); - isFBThreadStarted = 0; - return -1; - } - else - isFBThreadStarted = 1; - - } - } - else - return -1; - return 0; -} - -static int PlaybackSlowMotion(Context_t *context, int *speed) -{ - - - //Audio only forwarding not supported - if (context->playback->isVideo && !context->playback->isHttp && context->playback->isPlaying) - { - if (context->playback->isPaused) - PlaybackContinue(context); - - switch (*speed) - { - case 2: - context->playback->SlowMotion = 2; - break; - case 4: - context->playback->SlowMotion = 4; - break; - case 8: - context->playback->SlowMotion = 8; - break; - } - -#ifdef DEBUG - printf("%s::%s SlowMotion: %d x {%d}\n", FILENAME, __FUNCTION__, *speed, context->playback->SlowMotion); -#endif - - context->output->Command(context, OUTPUT_SLOWMOTION, NULL); - } - else - return -1; - return 0; -} - -static int PlaybackSeek(Context_t *context, float *pos) -{ -#ifdef DEBUG - printf("%s::%s pos: %f\n", FILENAME, __FUNCTION__, *pos); -#endif - - if (!context->playback->isHttp && context->playback->isPlaying && !context->playback->isForwarding && !context->playback->BackWard && !context->playback->SlowMotion && !context->playback->isPaused) - { - context->playback->isSeeking = 1; - context->output->Command(context, OUTPUT_CLEAR, NULL); - PlaybackPause(context); - context->output->Command(context, OUTPUT_CLEAR, NULL); - context->container->selectedContainer->Command(context, CONTAINER_SEEK, pos); - context->output->Command(context, OUTPUT_CLEAR, NULL); - context->playback->isSeeking = 0; - - PlaybackContinue(context); - } - else - return -1; - - return 0; -} - -static int PlaybackPts(Context_t *context, unsigned long long int *pts) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int ret = 0; - - *pts = 0; - - if (context->playback->isPlaying) - { - context->output->Command(context, OUTPUT_PTS, pts); - } - else - ret = -1; - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -static int PlaybackLength(Context_t *context, double *length) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - *length = 0; - - if (context->playback->isPlaying) - { - if (context->container && context->container->selectedContainer) - context->container->selectedContainer->Command(context, CONTAINER_LENGTH, length); - } - else - return -1; - - - return 0; -} - -static int PlaybackSwitchAudio(Context_t *context, int *track) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int curtrackid = 0; - int nextrackid = 0; - - if (context->playback->isPlaying) - { - if (context->manager && context->manager->audio) - { - context->manager->audio->Command(context, MANAGER_GET, &curtrackid); - context->manager->audio->Command(context, MANAGER_SET, track); - context->manager->audio->Command(context, MANAGER_GET, &nextrackid); - } - - if (nextrackid != curtrackid) - { - - //PlaybackPause(context); - - if (context->output && context->output->audio) - context->output->audio->Command(context, OUTPUT_SWITCH, (void *)"audio"); - - if (context->container && context->container->selectedContainer) - context->container->selectedContainer->Command(context, CONTAINER_SWITCH_AUDIO, &nextrackid); - - //PlaybackContinue(context); - } - } - else - return -1; - - - return 0; -} - -static int PlaybackSwitchSubtitle(Context_t *context, int *track) -{ -#ifdef DEBUG - printf("%s::%s Track: %d\n", FILENAME, __FUNCTION__, *track); -#endif - - int curtrackid = 0; - int nextrackid = 0; - int ret = 0; - - if (context && context->playback && context->playback->isPlaying) - { - if (context->manager && context->manager->subtitle) - { - context->manager->subtitle->Command(context, MANAGER_GET, &curtrackid); - context->manager->subtitle->Command(context, MANAGER_SET, track); - context->manager->subtitle->Command(context, MANAGER_GET, &nextrackid); - -#ifdef DEBUG - printf("%s::%s nextrackid: %d != curtrackid: %d\n", FILENAME, __FUNCTION__, nextrackid, curtrackid); -#endif - - if (nextrackid != curtrackid) - { - - //PlaybackPause(context); - - if (context->container && context->container->selectedContainer) - { - context->container->selectedContainer->Command(context, CONTAINER_SWITCH_SUBTITLE, &nextrackid); - - if (nextrackid == 100) - { - if (context->container && context->container->textSrtContainer) - context->container->textSrtContainer->Command(context, CONTAINER_SWITCH_SUBTITLE, &nextrackid); - } - else if (nextrackid == 200) - { - if (context->container && context->container->textSsaContainer) - context->container->textSsaContainer->Command(context, CONTAINER_SWITCH_SUBTITLE, &nextrackid); - } - - if (context->output && context->output->subtitle) - context->output->subtitle->Command(context, OUTPUT_SWITCH, (void *)"subtitle"); - else - ret = -1; - } - else - ret = -1; - - //PlaybackContinue(context); - } - - } - else - ret = -1; - } - else - ret = -1; - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - -static int PlaybackInfo(Context_t *context, char **infoString) -{ -#ifdef DEBUG - printf("%s::%s\n", FILENAME, __FUNCTION__); -#endif - - int ret = 0; - - if (context->playback->isPlaying) - { - if (context->container && context->container->selectedContainer) - context->container->selectedContainer->Command(context, CONTAINER_INFO, infoString); - } - else - ret = -1; - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - return ret; -} - -static int Command(void *_context, PlaybackCmd_t command, void *argument) -{ - Context_t *context = (Context_t *) _context; /* to satisfy compiler */ -#ifdef DEBUG - printf("%s::%s Command %d\n", FILENAME, __FUNCTION__, command); -#endif - int ret = -1; - - switch (command) - { - case PLAYBACK_OPEN: - { - ret = PlaybackOpen(context, (char *)argument); - break; - } - case PLAYBACK_CLOSE: - { - ret = PlaybackClose(context); - break; - } - case PLAYBACK_PLAY: - { - ret = PlaybackPlay(context); - break; - } - case PLAYBACK_STOP: - { - ret = PlaybackStop(context); - break; - } - case PLAYBACK_PAUSE: // 4 - { - ret = PlaybackPause(context); - break; - } - case PLAYBACK_CONTINUE: - { - ret = PlaybackContinue(context); - break; - } - case PLAYBACK_TERM: - { - ret = PlaybackTerminate(context); - break; - } - case PLAYBACK_FASTFORWARD: - { - ret = PlaybackFastForward(context, (int *)argument); - break; - } - case PLAYBACK_SEEK: - { - ret = PlaybackSeek(context, (float *)argument); - break; - } - case PLAYBACK_PTS: // 10 - { - ret = PlaybackPts(context, (unsigned long long int *)argument); - break; - } - case PLAYBACK_LENGTH: // 11 - { - ret = PlaybackLength(context, (double *)argument); - break; - } - case PLAYBACK_SWITCH_AUDIO: - { - ret = PlaybackSwitchAudio(context, (int *)argument); - break; - } - case PLAYBACK_SWITCH_SUBTITLE: - { - ret = PlaybackSwitchSubtitle(context, (int *)argument); - break; - } - case PLAYBACK_INFO: - { - ret = PlaybackInfo(context, (char **)argument); - break; - } - case PLAYBACK_SLOWMOTION: - { - ret = PlaybackSlowMotion(context, (int *)argument); - break; - } - case PLAYBACK_FASTBACKWARD: - { - ret = PlaybackFastBackward(context, (int *)argument); - break; - } - default: -#ifdef DEBUG - printf("%s::%s PlaybackCmd %d not supported!\n", FILENAME, __FUNCTION__, command); -#endif - break; - } - -#ifdef DEBUG - printf("%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); -#endif - - return ret; -} - - -PlaybackHandler_t PlaybackHandler = -{ - "Playback", - -1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - &Command, - "", - 0, -}; diff --git a/libeplayer3/Makefile.am b/libeplayer3/Makefile.am deleted file mode 100644 index 5e6d261..0000000 --- a/libeplayer3/Makefile.am +++ /dev/null @@ -1,32 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 -AUTOMAKE_OPTIONS = subdir-objects -AM_CFLAGS = -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE - -CXXFLAGS = -Wall - -AM_CPPFLAGS = \ - -Iinclude - -lib_LTLIBRARIES = libeplayer3.la - -libeplayer3_la_SOURCES = \ - container/container.c container/container_ffmpeg.c container/text_srt.c \ - container/text_ssa.c container/container_ass.c \ - manager/manager.c \ - output/output_subtitle.c output/linuxdvb.c output/output.c \ - playback/playback.c output/writer/writer.c output/writer/aac.c output/writer/wmv.c \ - output/writer/ac3.c output/writer/divx.c output/writer/pes.c \ - output/writer/dts.c output/writer/mpeg2.c output/writer/mp3.c output/writer/misc.c \ - output/writer/h264.c output/writer/h263.c output/writer/vc1.c output/writer/framebuffer.c \ - output/writer/flac.c output/writer/pcm.c - -libeplayer3_la_LIBADD = -lpthread -lavformat -lavcodec -lavutil -lswresample -lz -lass -lm -lpng - -bin_PROGRAMS = eplayer3 meta -eplayer3_SOURCES = tools/eplayer2.c -eplayer3_LDADD = -leplayer3 -lpthread -lass -lm -lpng -eplayer3_DEPENDENCIES = libeplayer3.la - -meta_SOURCES = tools/meta.c -meta_LDADD = -leplayer3 -lpthread -lavformat -lavcodec -lavutil -lass -lm -lpng -meta_DEPENDENCIES = libeplayer3.la diff --git a/libeplayer3/README b/libeplayer3/README deleted file mode 100644 index fce93a3..0000000 --- a/libeplayer3/README +++ /dev/null @@ -1,72 +0,0 @@ -/* - * SCOPE: - * ------- - * - * libeplayer3 was developed to create a cleaner and more stable - * version of the libeplayer2. - * Currently the lib supports only one container, which handle all - * files by using the ffmpeg library. - * - * FEATURES: - * ----------------------- - * - * - more stable than libeplayer2. - * - more multimedia files are supported than libeplayer2. - * - mms stream support. - * - new videocodec support: - * - wmv and vc1 (sti7109 & sti7111 & sti7105 only). - * - flv. - * - improved http streaming support - * - subtitle rendering (ssa / ass) by using libass - * - * STYLE GUIDELINES: - * ------------------ - * - * If you decide to add some lines of code please ensure the following: - * - do not use a windows editor. - * - a tab must be emulated by 4 spaces (most editors support this). - * If you accidental break this rule use astyle to reorganize indentation, - * and dos2unix to remove windows style. - * - * Programming GUIDLINES: - * ----------------------- - * - * - the compiler is intentionally set to Wall, it would be nice if all - * programmer looks for warnings and solve them. - * - make sanity checks where ever you can. - * - freeing memory is an act of solidarity, but it also increases uptime - * of your receiver. ;) - * - if you detect stuff which may be generic, then make it generic. - * - commenting code is not a bad idea. - * - * KNOWN BUGS / PROBLEMS: - * ---------------------- - * - * - reverse playback needs improvement - * - some formats makes problems ? - * - getting stream info currently leads to a memory leak in e2. this is - * not a problem of this implementation its also exists in libeplayer2. - * e2 delivers a strdupped variable which is overwritten by what the container - * delivers. this is very hacky ;) -> (see comment in container_ffmpeg_get_info) - * - * License: - * -------- - * - * Copyright (C) 2010 crow, schischu, hellmaster1024 and konfetti. - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ diff --git a/libeplayer3/autogen.sh b/libeplayer3/autogen.sh deleted file mode 100755 index abf3b5b..0000000 --- a/libeplayer3/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-libeplayer3" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/libeplayer3/configure.ac b/libeplayer3/configure.ac deleted file mode 100644 index 4039c50..0000000 --- a/libeplayer3/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT(libeplayer3,1-0,,libeplayer3-1.0) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_OUTPUT([ -Makefile -]) diff --git a/libeplayer3/container/container.c b/libeplayer3/container/container.c deleted file mode 100644 index 464d03a..0000000 --- a/libeplayer3/container/container.c +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Main Container Handling. - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#include -#include - -#include "common.h" - -#define CONTAINER_DEBUG - -#ifdef CONTAINER_DEBUG - -static short debug_level = 0; - -#define container_printf(level, x...) do { \ - if (debug_level >= level) printf(x); } while (0) -#else -#define container_printf(level, x...) -#endif - -#ifndef CONTAINER_SILENT -#define container_err(x...) do { printf(x); } while (0) -#else -#define container_err(x...) -#endif - -static const char FILENAME[] = __FILE__; - -static Container_t *AvailableContainer[] = -{ - &FFMPEGContainer, - NULL -}; - -static void printContainerCapabilities() -{ - int i, j; - - container_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); - container_printf(10, "Capabilities: "); - for (i = 0; AvailableContainer[i] != NULL; i++) - for (j = 0; AvailableContainer[i]->Capabilities[j] != NULL; j++) - container_printf(10, "%s ", AvailableContainer[i]->Capabilities[j]); - container_printf(10, "\n"); -} - -static int selectContainer(Context_t *context, char *extension) -{ - int i, j; - int ret = -1; - - container_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); - for (i = 0; AvailableContainer[i] != NULL; i++) - { - for (j = 0; AvailableContainer[i]->Capabilities[j] != NULL; j++) - if (!strcasecmp(AvailableContainer[i]->Capabilities[j], extension)) - { - context->container->selectedContainer = AvailableContainer[i]; - container_printf(10, "Selected Container: %s\n", context->container->selectedContainer->Name); - ret = 0; - break; - } - if (ret == 0) - break; - } - if (ret != 0) - { - container_err("No Container found :-(\n"); - } - return ret; -} - -static int Command(Context_t *context, ContainerCmd_t command, void *argument) -{ - int ret = 0; - container_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); - switch (command) - { - case CONTAINER_ADD: - { - ret = selectContainer(context, (char *) argument); - break; - } - case CONTAINER_CAPABILITIES: - { - printContainerCapabilities(); - break; - } - case CONTAINER_DEL: - { - context->container->selectedContainer = NULL; - break; - } - default: - container_err("%s::%s ContainerCmd %d not supported!\n", FILENAME, __FUNCTION__, command); - break; - } - return ret; -} - -extern Container_t SrtContainer; -extern Container_t SsaContainer; -extern Container_t ASSContainer; - -ContainerHandler_t ContainerHandler = -{ - "Output", - NULL, - &SrtContainer, - &SsaContainer, - &ASSContainer, - Command -}; diff --git a/libeplayer3/container/container_ass.c b/libeplayer3/container/container_ass.c deleted file mode 100644 index ff67c7b..0000000 --- a/libeplayer3/container/container_ass.c +++ /dev/null @@ -1,692 +0,0 @@ -/* - * Container handling for subtitles handled by libass - * konfetti 2010; based on code from crow - * - * The subtitle handling as container is not a very proper solution, in - * a proper architecture this should be handled as subcontainer or something - * like that. But we dont want to make more effort as necessary here ;) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include "common.h" -#include "misc.h" -#include "subtitle.h" -#include "writer.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ - -#define ASS_DEBUG - -#ifdef ASS_DEBUG - -static short debug_level = 10; - -#define ass_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define ass_printf(level, fmt, x...) -#endif - -#ifndef ASS_SILENT -#define ass_err(fmt, x...) do { printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define ass_err(fmt, x...) -#endif - -/* Error Constants */ -#define cERR_CONTAINER_ASS_NO_ERROR 0 -#define cERR_CONTAINER_ASS_ERROR -1 - -#define ASS_RING_SIZE 5 - -#define ASS_FONT "/usr/share/fonts/LiberationSans-Regular.ttf" - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -typedef struct ass_s -{ - unsigned char *data; - int len; - unsigned char *extradata; - int extralen; - - long long int pts; - float duration; -} ass_t; - -typedef struct region_s -{ - unsigned int x; - unsigned int y; - unsigned int w; - unsigned int h; - time_t undisplay; - - struct region_s *next; -} region_t; - -/* ***************************** */ -/* Variables */ -/* ***************************** */ - -static pthread_mutex_t mutex; - -static pthread_t PlayThread; -static int hasPlayThreadStarted = 0; - -static unsigned char isContainerRunning = 0; - -static ASS_Library *ass_library; -static ASS_Renderer *ass_renderer; - -static float ass_font_scale = 0.7; -static float ass_line_spacing = 0.7; - -static unsigned int screen_width = 0; -static unsigned int screen_height = 0; -static int shareFramebuffer = 0; -static int framebufferFD = -1; -static unsigned char *destination = NULL; -static int destStride = 0; -static void (*framebufferBlit)() = NULL; -static int needsBlit = 0; - -static ASS_Track *ass_track = NULL; - -static region_t *firstRegion = NULL; - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ - -void ass_msg_callback(int level __attribute__((unused)), const char *format, va_list va, void *ctx __attribute__((unused))) -{ - int n; - char *str; - va_list dst; - - va_copy(dst, va); - n = vsnprintf(NULL, 0, format, va); - if (n > 0 && (str = malloc(n + 1))) - { - vsnprintf(str, n + 1, format, dst); - ass_printf(100, "%s\n", str); - free(str); - } -} - -static void getMutex(int line) -{ - ass_printf(150, "%d requesting mutex\n", line); - pthread_mutex_lock(&mutex); - ass_printf(150, "%d received mutex\n", line); -} - -static void releaseMutex(int line) -{ - pthread_mutex_unlock(&mutex); - ass_printf(150, "%d released mutex\n", line); -} - -/* ********************************* */ -/* Region Undisplay handling */ -/* ********************************* */ - -/* release and undisplay all saved regions - */ -void releaseRegions(Writer_t *writer) -{ - region_t *next, *old; - if (firstRegion == NULL) - return; - if (writer == NULL) - { - ass_err("no framebuffer writer found!\n"); - return; - } - next = firstRegion; - while (next != NULL) - { - if (writer) - { - WriterFBCallData_t out; - ass_printf(100, "release: w %d h %d x %d y %d\n", - next->w, next->h, next->x, next->y); - out.fd = framebufferFD; - out.data = NULL; - out.Width = next->w; - out.Height = next->h; - out.x = next->x; - out.y = next->y; - out.Screen_Width = screen_width; - out.Screen_Height = screen_height; - out.destination = destination; - out.destStride = destStride; - writer->writeData(&out); - needsBlit = 1; - } - old = next; - next = next->next; - free(old); - } - firstRegion = NULL; -} - -/* check for regions which should be undisplayed. - * we are very tolerant on time here, because - * regions are also released when new regions are - * detected (see ETSI EN 300 743 Chapter Page Composition) - */ -void checkRegions(Writer_t *writer) -{ -#define cDeltaTime 2 - region_t *next, *old, *prev; - time_t now = time(NULL); - if (firstRegion == NULL) - { - return; - } - if (!writer) - { - ass_err("no framebuffer writer found!\n"); - return; - } - prev = next = firstRegion; - while (next != NULL) - { - if (now > next->undisplay + cDeltaTime) - { - ass_printf(100, "undisplay: %ld > %ld\n", now, next->undisplay + cDeltaTime); - if (writer) - { - WriterFBCallData_t out; - ass_printf(100, "release: w %d h %d x %d y %d\n", - next->w, next->h, next->x, next->y); - out.fd = framebufferFD; - out.data = NULL; - out.Width = next->w; - out.Height = next->h; - out.x = next->x; - out.y = next->y; - out.Screen_Width = screen_width; - out.Screen_Height = screen_height; - out.destination = destination; - out.destStride = destStride; - writer->writeData(&out); - needsBlit = 1; - } - old = next; - next = prev->next = next->next; - if (old == firstRegion) - firstRegion = next; - free(old); - } - else - { - prev = next; - next = next->next; - } - } -} - -/* store a display region for later release */ -void storeRegion(unsigned int x, unsigned int y, unsigned int w, unsigned int h, time_t undisplay) -{ - region_t **new = &firstRegion; - ass_printf(100, "%d %d %d %d %ld\n", x, y, w, h, undisplay); - while (*new) - new = &(*new)->next; - *new = malloc(sizeof(region_t)); - if (*new != NULL) - { - (*new)->next = NULL; - (*new)->x = x; - (*new)->y = y; - (*new)->w = w; - (*new)->h = h; - (*new)->undisplay = undisplay; - } - ass_printf(20, "<\n"); -} - -/* **************************** */ -/* Worker Thread */ -/* **************************** */ - -static void ASSThread(Context_t *context) -{ - char threadname[17]; - strncpy(threadname, __func__, sizeof(threadname)); - threadname[16] = 0; - prctl(PR_SET_NAME, (unsigned long)&threadname); - Writer_t *writer; - ass_printf(10, ">\n"); - hasPlayThreadStarted = 1; - while (context->playback->isCreationPhase || isContainerRunning == 0) - { - ass_err("Thread waiting for end of init phase...\n"); - usleep(1000); - } - ass_printf(10, "Running!\n"); - writer = getDefaultFramebufferWriter(); - if (writer == NULL) - { - ass_err("no framebuffer writer found!\n"); - } - while (context && context->playback && context->playback->isPlaying && hasPlayThreadStarted == 1) - { - //IF MOVIE IS PAUSED, WAIT - if (context->playback->isPaused) - { - ass_printf(20, "paused\n"); - usleep(100000); - continue; - } - if (context->playback->isSeeking) - { - ass_printf(10, "seeking\n"); - usleep(100000); - continue; - } - if ((isContainerRunning) && (ass_track)) - { - ASS_Image *img = NULL; - int change = 0; - unsigned long int playPts = 0; - if (context && context->playback) - { - if (context->playback->Command(context, PLAYBACK_PTS, &playPts) < 0) - continue; - } - //FIXME: durch den sleep bleibt die cpu usage zw. 5 und 13%, ohne - // steigt sie bei Verwendung von subtiteln bis auf 95%. - // ich hoffe dadurch gehen keine subtitle verloren, wenn die playPts - // durch den sleep verschlafen wird. Besser wäre es den nächsten - // subtitel zeitpunkt zu bestimmen und solange zu schlafen. - usleep(1000); - getMutex(__LINE__); - checkRegions(writer); - if (ass_renderer && ass_track) - img = ass_render_frame(ass_renderer, ass_track, playPts / 90.0, &change); - ass_printf(150, "img %p pts %lu %f\n", img, playPts, playPts / 90.0); - if (img != NULL && ass_renderer && ass_track) - { - /* the spec says, that if a new set of regions is present - * the complete display switches to the new state. So lets - * release the old regions on display. - */ - if (change != 0) - releaseRegions(writer); - while (context && context->playback && context->playback->isPlaying && - (img) && (change != 0)) - { - WriterFBCallData_t out; - time_t now = time(NULL); - time_t undisplay = now + 10; - if (ass_track && ass_track->events) - { - undisplay = now + ass_track->events->Duration / 1000 + 0.5; - } - ass_printf(100, "w %d h %d s %d x %d y %d c %d chg %d now %ld und %ld\n", - img->w, img->h, img->stride, - img->dst_x, img->dst_y, img->color, - change, now, undisplay); - /* api docu said w and h can be zero which - * means image should not be rendered - */ - if ((img->w != 0) && (img->h != 0) && writer) - { - out.fd = framebufferFD; - out.data = img->bitmap; - out.Width = img->w; - out.Height = img->h; - out.Stride = img->stride; - out.x = img->dst_x; - out.y = img->dst_y; - out.color = img->color; - out.Screen_Width = screen_width; - out.Screen_Height = screen_height; - out.destination = destination; - out.destStride = destStride; - storeRegion(img->dst_x, img->dst_y, - img->w, img->h, undisplay); - if (shareFramebuffer) - { - if (context && context->playback && context->playback->isPlaying && writer) - { - writer->writeData(&out); - needsBlit = 1; - } - } - else - { - /* application does not want to share framebuffer, - * so there is hopefully installed an output callback - * in the subtitle output! - */ - SubtitleOut_t out; - out.type = eSub_Gfx; - if (ass_track->events) - { - /* fixme: check values */ - out.pts = ass_track->events->Start * 90.0; - out.duration = ass_track->events->Duration / 1000.0; - } - else - { - out.pts = playPts; - out.duration = 10.0; - } - out.u.gfx.data = img->bitmap; - out.u.gfx.Width = img->w; - out.u.gfx.Height = img->h; - out.u.gfx.x = img->dst_x; - out.u.gfx.y = img->dst_y; - if (context && context->playback && context->playback->isPlaying && - context->output && context->output->subtitle) - context->output->subtitle->Write(context, &out); - } - } - /* Next image */ - img = img->next; - } - } - releaseMutex(__LINE__); - } - else - { - usleep(1000); - } - /* cleanup no longer used but not overwritten regions */ - checkRegions(writer); - if (framebufferBlit != NULL && needsBlit) - { - needsBlit = 0; - (*framebufferBlit)(); - } - } /* while */ - hasPlayThreadStarted = 0; - ass_printf(10, "terminating\n"); - pthread_exit(NULL); -} - -/* **************************** */ -/* Container part for ass */ -/* **************************** */ - -int container_ass_init(Context_t *context) -{ - SubtitleOutputDef_t output; - - ass_printf(10, ">\n"); - ass_library = ass_library_init(); - if (!ass_library) - { - ass_err("ass_library_init failed!\n"); - return cERR_CONTAINER_ASS_ERROR; - } - if (debug_level >= 100) - ass_set_message_cb(ass_library, ass_msg_callback, NULL); - ass_set_extract_fonts(ass_library, 1); - ass_set_style_overrides(ass_library, NULL); - ass_renderer = ass_renderer_init(ass_library); - if (!ass_renderer) - { - ass_err("ass_renderer_init failed!\n"); - if (ass_library) - ass_library_done(ass_library); - ass_library = NULL; - return cERR_CONTAINER_ASS_ERROR; - } - context->output->subtitle->Command(context, OUTPUT_GET_SUBTITLE_OUTPUT, &output); - screen_width = output.screen_width; - screen_height = output.screen_height; - shareFramebuffer = output.shareFramebuffer; - framebufferFD = output.framebufferFD; - destination = output.destination; - destStride = output.destStride; - framebufferBlit = output.framebufferBlit; - ass_printf(10, "width %d, height %d, share %d, fd %d\n", - screen_width, screen_height, shareFramebuffer, framebufferFD); - ass_set_frame_size(ass_renderer, screen_width, screen_height); - ass_set_margins(ass_renderer, (int)(0.03 * screen_height), (int)(0.03 * screen_height) , - (int)(0.03 * screen_width), (int)(0.03 * screen_width)); - ass_set_use_margins(ass_renderer, 0); - ass_set_font_scale(ass_renderer, ass_font_scale); - ass_set_hinting(ass_renderer, ASS_HINTING_LIGHT); - ass_set_line_spacing(ass_renderer, ass_line_spacing); - ass_set_fonts(ass_renderer, ASS_FONT, "Arial", 0, NULL, 1); - ass_set_aspect_ratio(ass_renderer, 1.0, 1.0); - isContainerRunning = 1; - return cERR_CONTAINER_ASS_NO_ERROR; -} - -int container_ass_process_data(Context_t *context __attribute__((unused)), SubtitleData_t *data) -{ - int first_kiss = 0; - - ass_printf(20, ">\n"); - if (!isContainerRunning) - { - ass_err("Container not running\n"); - return cERR_CONTAINER_ASS_ERROR; - } - if (ass_track == NULL) - { - first_kiss = 1; - ass_track = ass_new_track(ass_library); - if (ass_track == NULL) - { - ass_err("error creating ass_track\n"); - return cERR_CONTAINER_ASS_ERROR; - } - ass_track->PlayResX = screen_width; - ass_track->PlayResY = screen_height; - } - if ((data->extradata) && (first_kiss)) - { - ass_printf(30, "processing private %d bytes\n", data->extralen); - ass_process_codec_private(ass_track, (char *) data->extradata, data->extralen); - ass_printf(30, "processing private done\n"); - } - if (data->data) - { - ass_printf(30, "processing data %d bytes\n", data->len); - ass_process_data(ass_track, (char *) data->data, data->len); - ass_printf(30, "processing data done\n"); - } - return cERR_CONTAINER_ASS_NO_ERROR; -} - -static int container_ass_stop(Context_t *context __attribute__((unused))) -{ - int ret = cERR_CONTAINER_ASS_NO_ERROR; - int wait_time = 100; - Writer_t *writer; - - ass_printf(10, "\n"); - if (!isContainerRunning) - { - ass_err("Container not running\n"); - return cERR_CONTAINER_ASS_ERROR; - } - if (hasPlayThreadStarted != 0) - { - hasPlayThreadStarted = 2; - while ((hasPlayThreadStarted != 0) && (--wait_time) > 0) - { - ass_printf(10, "Waiting for ass thread to terminate itself, will try another %d times\n", wait_time); - usleep(100000); - } - } - if (wait_time == 0) - { - ass_err("Timeout waiting for thread!\n"); - ret = cERR_CONTAINER_ASS_ERROR; - } - getMutex(__LINE__); - writer = getDefaultFramebufferWriter(); - releaseRegions(writer); - if (ass_track) - ass_free_track(ass_track); - ass_track = NULL; - if (ass_renderer) - ass_renderer_done(ass_renderer); - ass_renderer = NULL; - if (ass_library) - ass_library_done(ass_library); - ass_library = NULL; - isContainerRunning = 0; - hasPlayThreadStarted = 0; - if (writer) - { - writer->reset(); - } - releaseMutex(__LINE__); - ass_printf(10, "ret %d\n", ret); - return ret; -} - -static int container_ass_switch_subtitle(Context_t *context, int *arg __attribute__((unused))) -{ - int error; - int ret = cERR_CONTAINER_ASS_NO_ERROR; - pthread_attr_t attr; - Writer_t *writer; - - ass_printf(10, "\n"); - if (!isContainerRunning) - { - ass_err("Container not running\n"); - return cERR_CONTAINER_ASS_ERROR; - } - if (context && context->playback && context->playback->isPlaying) - { - ass_printf(10, "is Playing\n"); - } - else - { - ass_printf(10, "is NOT Playing\n"); - } - if (hasPlayThreadStarted == 0) - { - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - if ((error = pthread_create(&PlayThread, &attr, (void *)&ASSThread, context)) != 0) - { - ass_printf(10, "Error creating thread, error:%d:%s\n", error, strerror(error)); - hasPlayThreadStarted = 0; - ret = cERR_CONTAINER_ASS_ERROR; - } - else - { - ass_printf(10, "Created thread\n"); - } - } - else - { - ass_printf(10, "A thread already exists!\n"); - ret = cERR_CONTAINER_ASS_ERROR; - } - getMutex(__LINE__); - writer = getDefaultFramebufferWriter(); - releaseRegions(writer); - /* free the track so extradata will be written next time - * process_data is called. - */ - if (ass_track) - ass_free_track(ass_track); - ass_track = NULL; - releaseMutex(__LINE__); - ass_printf(10, "exiting with value %d\n", ret); - return ret; -} - -static int Command(Context_t *context, ContainerCmd_t command, void *argument) -{ - int ret = cERR_CONTAINER_ASS_NO_ERROR; - - ass_printf(50, "Command %d\n", command); - switch (command) - { - case CONTAINER_INIT: - { - ret = container_ass_init(context); - break; - } - case CONTAINER_STOP: - { - ret = container_ass_stop(context); - break; - } - case CONTAINER_SWITCH_SUBTITLE: - { - ret = container_ass_switch_subtitle(context, (int *) argument); - break; - } - case CONTAINER_DATA: - { - SubtitleData_t *data = (SubtitleData_t *) argument; - ret = container_ass_process_data(context, data); - break; - } - default: - ass_err("ContainerCmd %d not supported!\n", command); - ret = cERR_CONTAINER_ASS_ERROR; - break; - } - ass_printf(50, "exiting with value %d\n", ret); - return ret; -} - -static char *ASS_Capabilities[] = {"ass", NULL }; - -Container_t ASSContainer = -{ - "ASS", - &Command, - ASS_Capabilities -}; diff --git a/libeplayer3/container/container_ffmpeg.c b/libeplayer3/container/container_ffmpeg.c deleted file mode 100644 index b572747..0000000 --- a/libeplayer3/container/container_ffmpeg.c +++ /dev/null @@ -1,1296 +0,0 @@ -/* - * Container handling for all stream's handled by ffmpeg - * konfetti 2010; based on code from crow - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "common.h" -#include "misc.h" -#include "debug.h" -#include "aac.h" -#include "pcm.h" -#include "ffmpeg_metadata.h" -#include "subtitle.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ - -#define FFMPEG_DEBUG - -#ifdef FFMPEG_DEBUG - -static short debug_level = 10; - -#define ffmpeg_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, FILENAME, __FUNCTION__, ## x); } while (0) -#else -#define ffmpeg_printf(level, fmt, x...) -#endif - -#ifndef FFMPEG_SILENT -#define ffmpeg_err(fmt, x...) do { printf("[%s:%s] " fmt, FILENAME, __FUNCTION__, ## x); } while (0) -#else -#define ffmpeg_err(fmt, x...) -#endif - -/* Error Constants */ -#define cERR_CONTAINER_FFMPEG_NO_ERROR 0 -#define cERR_CONTAINER_FFMPEG_INIT -1 -#define cERR_CONTAINER_FFMPEG_NOT_SUPPORTED -2 -#define cERR_CONTAINER_FFMPEG_INVALID_FILE -3 -#define cERR_CONTAINER_FFMPEG_RUNNING -4 -#define cERR_CONTAINER_FFMPEG_NOMEM -5 -#define cERR_CONTAINER_FFMPEG_OPEN -6 -#define cERR_CONTAINER_FFMPEG_STREAM -7 -#define cERR_CONTAINER_FFMPEG_NULL -8 -#define cERR_CONTAINER_FFMPEG_ERR -9 -#define cERR_CONTAINER_FFMPEG_END_OF_FILE -10 - -static const char *FILENAME = "container_ffmpeg.c"; - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -/* ***************************** */ -/* Variables */ -/* ***************************** */ - -static pthread_t PlayThread; -volatile static int hasPlayThreadStarted = 0; -static AVFormatContext *avContext = NULL; -volatile static unsigned int isContainerRunning = 0; -static float seek_sec_rel = 0.0; -#if 0 -static float seek_sec_abs = -1.0; -#endif - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ - -static char *Codec2Encoding(AVCodecContext *codec) -{ - fprintf(stderr, "Codec ID: %ld (%.8lx)\n", (long)codec->codec_id, (long)codec->codec_id); - switch (codec->codec_id) - { - case AV_CODEC_ID_MPEG1VIDEO: - case AV_CODEC_ID_MPEG2VIDEO: - return "V_MPEG1"; - case AV_CODEC_ID_H263: - case AV_CODEC_ID_H263P: - case AV_CODEC_ID_H263I: - return "V_H263"; - case AV_CODEC_ID_FLV1: - return "V_FLV"; - case AV_CODEC_ID_VP5: - case AV_CODEC_ID_VP6: - case AV_CODEC_ID_VP6F: - return "V_VP6"; - case AV_CODEC_ID_RV10: - case AV_CODEC_ID_RV20: - return "V_RMV"; - case AV_CODEC_ID_MPEG4: - case AV_CODEC_ID_MSMPEG4V1: - case AV_CODEC_ID_MSMPEG4V2: - case AV_CODEC_ID_MSMPEG4V3: - return "V_MSCOMP"; - case AV_CODEC_ID_WMV1: - case AV_CODEC_ID_WMV2: - case AV_CODEC_ID_WMV3: - return "V_WMV"; - case AV_CODEC_ID_VC1: - return "V_VC1"; - case AV_CODEC_ID_H264: - return "V_MPEG4/ISO/AVC"; - case AV_CODEC_ID_AVS: - return "V_AVS"; - case AV_CODEC_ID_MP2: - return "A_MPEG/L3"; - case AV_CODEC_ID_MP3: - return "A_MP3"; - case AV_CODEC_ID_AC3: - return "A_AC3"; - case AV_CODEC_ID_DTS: - return "A_DTS"; - case AV_CODEC_ID_AAC: - return "A_AAC"; - /* subtitle */ - case AV_CODEC_ID_SSA: - return "S_TEXT/ASS"; /* Hellmaster1024: seems to be ASS instead of SSA */ - case AV_CODEC_ID_TEXT: /* Hellmaster1024: i dont have most of this, but lets hope it is normal text :-) */ - case AV_CODEC_ID_DVD_SUBTITLE: - case AV_CODEC_ID_DVB_SUBTITLE: - case AV_CODEC_ID_XSUB: - case AV_CODEC_ID_MOV_TEXT: - case AV_CODEC_ID_HDMV_PGS_SUBTITLE: - case AV_CODEC_ID_DVB_TELETEXT: - case AV_CODEC_ID_SRT: - case AV_CODEC_ID_SUBRIP: - return "S_TEXT/SRT"; /* fixme */ - default: - // Default to injected-pcm for unhandled audio types. - if (codec->codec_type == AVMEDIA_TYPE_AUDIO) - return "A_IPCM"; - if (codec->codec_type == AVMEDIA_TYPE_SUBTITLE) - return "S_TEXT/SRT"; - ffmpeg_err("Codec ID %ld (%.8lx) not found\n", (long)codec->codec_id, (long)codec->codec_id); - } - return NULL; -} - -long long int calcPts(AVStream *stream, int64_t pts) -{ - if (pts == AV_NOPTS_VALUE) - return INVALID_PTS_VALUE; - pts = 90000 * (double)pts * stream->time_base.num / stream->time_base.den; - if (avContext->start_time != AV_NOPTS_VALUE) - pts -= 90000 * avContext->start_time / AV_TIME_BASE; - if (pts < 0) - return INVALID_PTS_VALUE; - return pts; -} - -/*Hellmaster1024: get the Duration of the subtitle from the SSA line*/ -float getDurationFromSSALine(unsigned char *line) -{ - int i, h, m, s, ms; - char *Text = strdup((char *) line); - char *ptr1; - char *ptr[10]; - long int msec; - - ptr1 = Text; - ptr[0] = Text; - for (i = 0; i < 3 && *ptr1 != '\0'; ptr1++) - { - if (*ptr1 == ',') - { - ptr[++i] = ptr1 + 1; - *ptr1 = '\0'; - } - } - sscanf(ptr[2], "%d:%d:%d.%d", &h, &m, &s, &ms); - msec = (ms * 10) + (s * 1000) + (m * 60 * 1000) + (h * 24 * 60 * 1000); - sscanf(ptr[1], "%d:%d:%d.%d", &h, &m, &s, &ms); - msec -= (ms * 10) + (s * 1000) + (m * 60 * 1000) + (h * 24 * 60 * 1000); - ffmpeg_printf(10, "%s %s %f\n", ptr[2], ptr[1], (float) msec / 1000.0); - free(Text); - return (float)msec / 1000.0; -} - -/* search for metadata in context and stream - * and map it to our metadata. - */ - -static char *searchMeta(AVDictionary *metadata, char *ourTag) -{ - AVDictionaryEntry *tag = NULL; - int i = 0; - - while (metadata_map[i]) - { - if (!strcasecmp(ourTag, metadata_map[i])) - { - while ((tag = av_dict_get(metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) - { - if (!strcasecmp(tag->key, ourTag) || !strcmp(tag->key, metadata_map[i + 1])) - { - return tag->value; - } - } - } - i += 2; - } - return NULL; -} - -/* **************************** */ -/* Worker Thread */ -/* **************************** */ - -static void FFMPEGThread(Context_t *context) -{ - char threadname[17]; - strncpy(threadname, __func__, sizeof(threadname)); - threadname[16] = 0; - prctl(PR_SET_NAME, (unsigned long)&threadname); - hasPlayThreadStarted = 1; - long long int currentVideoPts = -1, currentAudioPts = -1, showtime = 0, bofcount = 0; - AudioVideoOut_t avOut; - SwrContext *swr = NULL; - AVFrame *decoded_frame = NULL; - int out_sample_rate = 44100; - int out_channels = 2; - uint64_t out_channel_layout = AV_CH_LAYOUT_STEREO; - int restart_audio_resampling = 0; - ffmpeg_printf(10, "\n"); - while (context->playback->isCreationPhase) - { - ffmpeg_err("Thread waiting for end of init phase...\n"); - usleep(1000); - } - ffmpeg_printf(10, "Running!\n"); - while (context && context->playback && context->playback->isPlaying && !context->playback->abortRequested) - { - //IF MOVIE IS PAUSED, WAIT - if (context->playback->isPaused) - { - ffmpeg_printf(20, "paused\n"); - usleep(100000); - continue; - } - int seek_target_flag = 0; - int64_t seek_target = INT64_MIN; - if (seek_sec_rel != 0.0) - { - if (avContext->iformat->flags & AVFMT_TS_DISCONT) - { - float br = (avContext->bit_rate) ? avContext->bit_rate / 8.0 : 180000.0; - seek_target_flag = AVSEEK_FLAG_BYTE; - seek_target = avio_tell(avContext->pb) + seek_sec_rel * br; - } - else - { - seek_target = ((((currentVideoPts > 0) ? currentVideoPts : currentAudioPts) / 90000.0) + seek_sec_rel) * AV_TIME_BASE; - } - seek_sec_rel = 0.0; -#if 0 - } - else if (seek_sec_abs >= 0.0) - { - if (avContext->iformat->flags & AVFMT_TS_DISCONT) - { - float br = (avContext->bit_rate) ? avContext->bit_rate / 8.0 : 180000.0; - seek_target_flag = AVSEEK_FLAG_BYTE; - seek_target = seek_sec_abs * br; - } - else - { - seek_target = seek_sec_abs * AV_TIME_BASE; - } - seek_sec_abs = -1.0; -#endif - } - else if (context->playback->BackWard && av_gettime_relative() >= showtime) - { - context->output->Command(context, OUTPUT_CLEAR, "video"); - if (bofcount == 1) - { - showtime = av_gettime_relative(); - usleep(100000); - continue; - } - if (avContext->iformat->flags & AVFMT_TS_DISCONT) - { - off_t pos = avio_tell(avContext->pb); - if (pos > 0) - { - float br; - if (avContext->bit_rate) - br = avContext->bit_rate / 8.0; - else - br = 180000.0; - seek_target = pos + context->playback->Speed * 8 * br; - seek_target_flag = AVSEEK_FLAG_BYTE; - } - } - else - { - seek_target = ((((currentVideoPts > 0) ? currentVideoPts : currentAudioPts) / 90000.0) + context->playback->Speed * 8) * AV_TIME_BASE;; - } - showtime = av_gettime_relative() + 300000; //jump back every 300ms - } - else - { - bofcount = 0; - } - if (seek_target > INT64_MIN) - { - int res; - if (seek_target < 0) - seek_target = 0; - res = avformat_seek_file(avContext, -1, INT64_MIN, seek_target, INT64_MAX, seek_target_flag); - if (res < 0 && context->playback->BackWard) - bofcount = 1; - seek_target = INT64_MIN; - restart_audio_resampling = 1; - // flush streams - unsigned int i; - for (i = 0; i < avContext->nb_streams; i++) - if (avContext->streams[i]->codec && avContext->streams[i]->codec->codec) - avcodec_flush_buffers(avContext->streams[i]->codec); - } - AVPacket packet; - av_init_packet(&packet); - packet.data = NULL; - packet.size = 0; - int av_res = av_read_frame(avContext, &packet); - if (av_res == AVERROR(EAGAIN)) - { - av_packet_unref(&packet); - continue; - } - if (av_res) // av_read_frame failed - { - ffmpeg_err("no data ->end of file reached ?\n"); - av_packet_unref(&packet); - break; // while - } - uint8_t *packet_data = packet.data; - int packet_size = packet.size; - Track_t *videoTrack = NULL; - Track_t *audioTrack = NULL; - Track_t *subtitleTrack = NULL; - context->playback->readCount += packet_size; - int pid = avContext->streams[packet.stream_index]->id; - if (context->manager->video->Command(context, MANAGER_GET_TRACK, &videoTrack) < 0) - ffmpeg_err("error getting video track\n"); - if (context->manager->audio->Command(context, MANAGER_GET_TRACK, &audioTrack) < 0) - ffmpeg_err("error getting audio track\n"); - if (context->manager->subtitle->Command(context, MANAGER_GET_TRACK, &subtitleTrack) < 0) - ffmpeg_err("error getting subtitle track\n"); - ffmpeg_printf(200, "packet_size %d - index %d\n", packet_size, pid); - if (videoTrack && (videoTrack->Id == pid)) - { - currentVideoPts = videoTrack->pts = calcPts(videoTrack->stream, packet.pts); - avOut.data = packet_data; - avOut.len = packet_size; - avOut.pts = currentVideoPts; - avOut.extradata = videoTrack->extraData; - avOut.extralen = videoTrack->extraSize; - avOut.frameRate = videoTrack->frame_rate; - avOut.timeScale = videoTrack->TimeScale; - avOut.width = videoTrack->width; - avOut.height = videoTrack->height; - avOut.type = OUTPUT_TYPE_VIDEO; - if (context->output->video->Write(context, &avOut) < 0) - { - ffmpeg_err("writing data to video device failed\n"); - } - } - else if (audioTrack && (audioTrack->Id == pid) && !context->playback->BackWard) - { - currentAudioPts = audioTrack->pts = calcPts(audioTrack->stream, packet.pts); - ffmpeg_printf(200, "AudioTrack index = %d\n", pid); - if (audioTrack->inject_as_pcm == 1) - { - AVCodecContext *c = ((AVStream *)(audioTrack->stream))->codec; - if (restart_audio_resampling) - { - restart_audio_resampling = 0; - if (swr) - { - swr_free(&swr); - swr = NULL; - } - if (decoded_frame) - { - av_frame_free(&decoded_frame); - decoded_frame = NULL; - } - context->output->Command(context, OUTPUT_CLEAR, NULL); - context->output->Command(context, OUTPUT_PLAY, NULL); - } - while (packet_size > 0) - { - int got_frame = 0; - if (!decoded_frame) - { - if (!(decoded_frame = av_frame_alloc())) - { - fprintf(stderr, "out of memory\n"); - exit(1); - } - } - else - av_frame_unref(decoded_frame); - int len = avcodec_decode_audio4(c, decoded_frame, &got_frame, &packet); - if (len < 0) - { - //fprintf(stderr, "avcodec_decode_audio4: %d\n", len); - break; - } - packet_data += len; - packet_size -= len; - if (!got_frame) - continue; - int e; - if (!swr) - { - int in_rate = c->sample_rate; - // rates in descending order - int rates[] = { 192000, 176400, 96000, 88200, 48000, 44100, 0 }; - int i = 0; - // find the next equal or smallest rate - while (rates[i] && in_rate < rates[i]) i++; - if (rates[i]) out_sample_rate = rates[i]; - swr = swr_alloc(); - out_channels = c->channels; - if (c->channel_layout == 0) - { - // FIXME -- need to guess, looks pretty much like a bug in the FFMPEG WMA decoder - c->channel_layout = AV_CH_LAYOUT_STEREO; - } - out_channel_layout = c->channel_layout; - // player2 won't play mono - if (out_channel_layout == AV_CH_LAYOUT_MONO) - { - out_channel_layout = AV_CH_LAYOUT_STEREO; - out_channels = 2; - } - av_opt_set_int(swr, "in_channel_layout", c->channel_layout, 0); - av_opt_set_int(swr, "out_channel_layout", out_channel_layout, 0); - av_opt_set_int(swr, "in_sample_rate", c->sample_rate, 0); - av_opt_set_int(swr, "out_sample_rate", out_sample_rate, 0); - av_opt_set_sample_fmt(swr, "in_sample_fmt", c->sample_fmt, 0); - av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16, 0); - e = swr_init(swr); - if (e < 0) - { - fprintf(stderr, "swr_init: %d (icl=%d ocl=%d isr=%d osr=%d isf=%d osf=%d\n", - -e, - (int)c->channel_layout, (int)out_channel_layout, c->sample_rate, out_sample_rate, c->sample_fmt, AV_SAMPLE_FMT_S16); - swr_free(&swr); - swr = NULL; - continue; - } - } - uint8_t *output = NULL; - int in_samples = decoded_frame->nb_samples; - int out_samples = av_rescale_rnd(swr_get_delay(swr, c->sample_rate) + in_samples, out_sample_rate, c->sample_rate, AV_ROUND_UP); - int out_linesize; - e = av_samples_alloc(&output, &out_linesize, out_channels, out_samples, AV_SAMPLE_FMT_S16, 1); - if (e < 0) - { - fprintf(stderr, "av_samples_alloc: %d\n", -e); - continue; - } - int64_t next_in_pts = av_rescale(av_frame_get_best_effort_timestamp(decoded_frame), - ((AVStream *) audioTrack->stream)->time_base.num * (int64_t)out_sample_rate * c->sample_rate, - ((AVStream *) audioTrack->stream)->time_base.den); - int64_t next_out_pts = av_rescale(swr_next_pts(swr, next_in_pts), - ((AVStream *) audioTrack->stream)->time_base.den, - ((AVStream *) audioTrack->stream)->time_base.num * (int64_t)out_sample_rate * c->sample_rate); - currentAudioPts = audioTrack->pts = calcPts(audioTrack->stream, next_out_pts); - out_samples = swr_convert(swr, &output, out_samples, (const uint8_t **) &decoded_frame->data[0], in_samples); - if (out_samples < 0) - { - continue; - } - int out_buffsize = av_samples_get_buffer_size(&out_linesize, out_channels, out_samples, AV_SAMPLE_FMT_S16, 1); - if (out_buffsize < 0) - { - continue; - } - pcmPrivateData_t extradata; - extradata.uSampleRate = out_sample_rate; - extradata.uNoOfChannels = av_get_channel_layout_nb_channels(out_channel_layout); - extradata.uBitsPerSample = 16; - extradata.bLittleEndian = 1; - avOut.data = output; - avOut.len = out_buffsize; - avOut.pts = currentAudioPts; - avOut.extradata = (unsigned char *)&extradata; - avOut.extralen = sizeof(extradata); - avOut.frameRate = 0; - avOut.timeScale = 0; - avOut.width = 0; - avOut.height = 0; - avOut.type = OUTPUT_TYPE_AUDIO; - if (context->output->audio->Write(context, &avOut) < 0) - ffmpeg_err("writing data to audio device failed\n"); - av_freep(&output); - } - } - else if (audioTrack->have_aacheader == 1) - { - ffmpeg_printf(200, "write audio aac\n"); - avOut.data = packet.data; - avOut.len = packet.size; - avOut.pts = currentAudioPts; - avOut.extradata = audioTrack->aacbuf; - avOut.extralen = audioTrack->aacbuflen; - avOut.frameRate = 0; - avOut.timeScale = 0; - avOut.width = 0; - avOut.height = 0; - avOut.type = OUTPUT_TYPE_AUDIO; - if (context->output->audio->Write(context, &avOut) < 0) - { - ffmpeg_err("(aac) writing data to audio device failed\n"); - } - } - else - { - avOut.data = packet_data; - avOut.len = packet_size; - avOut.pts = currentAudioPts; - avOut.extradata = NULL; - avOut.extralen = 0; - avOut.frameRate = 0; - avOut.timeScale = 0; - avOut.width = 0; - avOut.height = 0; - avOut.type = OUTPUT_TYPE_AUDIO; - if (context->output->audio->Write(context, &avOut) < 0) - { - ffmpeg_err("writing data to audio device failed\n"); - } - } - } - else if (subtitleTrack && (subtitleTrack->Id == pid)) - { - float duration = 3.0; - long long int Subtitlepts; - ffmpeg_printf(100, "subtitleTrack->stream %p \n", subtitleTrack->stream); - Subtitlepts = calcPts(subtitleTrack->stream, packet.pts); -#if (LIBAVFORMAT_VERSION_MAJOR == 57 && LIBAVFORMAT_VERSION_MINOR == 25) - ffmpeg_printf(20, "Packet duration %lld\n", packet.duration); -#else - ffmpeg_printf(20, "Packet duration %d\n", packet.duration); -#endif - if (packet.duration != 0) - duration = ((float)packet.duration) / 1000.0; - else if (((AVStream *)subtitleTrack->stream)->codec->codec_id == AV_CODEC_ID_SSA) - { - /*Hellmaster1024 if the duration is not stored in packet.duration - we need to calculate it any other way, for SSA it is stored in - the Text line*/ - duration = getDurationFromSSALine(packet_data); - } - else - { - /* no clue yet */ - } - /* konfetti: I've found cases where the duration from getDurationFromSSALine - * is zero (start end and are really the same in text). I think it make's - * no sense to pass those. - */ - if (duration > 0.0) - { - /* is there a decoder ? */ - if (((AVStream *) subtitleTrack->stream)->codec->codec) - { - AVSubtitle sub; - int got_sub_ptr; - if (avcodec_decode_subtitle2(((AVStream *) subtitleTrack->stream)->codec, &sub, &got_sub_ptr, &packet) < 0) - { - ffmpeg_err("error decoding subtitle\n"); - } - else - { - unsigned int i; - ffmpeg_printf(0, "format %d\n", sub.format); - ffmpeg_printf(0, "start_display_time %d\n", sub.start_display_time); - ffmpeg_printf(0, "end_display_time %d\n", sub.end_display_time); - ffmpeg_printf(0, "num_rects %d\n", sub.num_rects); - ffmpeg_printf(0, "pts %lld\n", sub.pts); - for (i = 0; i < sub.num_rects; i++) - { - ffmpeg_printf(0, "x %d\n", sub.rects[i]->x); - ffmpeg_printf(0, "y %d\n", sub.rects[i]->y); - ffmpeg_printf(0, "w %d\n", sub.rects[i]->w); - ffmpeg_printf(0, "h %d\n", sub.rects[i]->h); - ffmpeg_printf(0, "nb_colors %d\n", sub.rects[i]->nb_colors); - ffmpeg_printf(0, "type %d\n", sub.rects[i]->type); - ffmpeg_printf(0, "text %s\n", sub.rects[i]->text); - ffmpeg_printf(0, "ass %s\n", sub.rects[i]->ass); - // pict ->AVPicture - } - } - } - else - { - if (((AVStream *)subtitleTrack->stream)->codec->codec_id == AV_CODEC_ID_SSA) - { - SubtitleData_t data; - ffmpeg_printf(10, "videoPts %lld\n", currentVideoPts); - data.data = packet_data; - data.len = packet_size; - data.extradata = subtitleTrack->extraData; - data.extralen = subtitleTrack->extraSize; - data.pts = Subtitlepts; - data.duration = duration; - context->container->assContainer->Command(context, CONTAINER_DATA, &data); - } - else - { - /* hopefully native text ;) */ - unsigned char *line = text_to_ass((char *)packet_data, Subtitlepts / 90, duration); - ffmpeg_printf(50, "text line is %s\n", (char *)packet_data); - ffmpeg_printf(50, "Sub line is %s\n", line); - ffmpeg_printf(20, "videoPts %lld %f\n", currentVideoPts, currentVideoPts / 90000.0); - SubtitleData_t data; - data.data = line; - data.len = strlen((char *)line); - data.extradata = (unsigned char *) DEFAULT_ASS_HEAD; - data.extralen = strlen(DEFAULT_ASS_HEAD); - data.pts = Subtitlepts; - data.duration = duration; - context->container->assContainer->Command(context, CONTAINER_DATA, &data); - free(line); - } - } - } /* duration */ - } - av_packet_unref(&packet); - }/* while */ - if (context && context->playback && context->output && context->playback->abortRequested) - context->output->Command(context, OUTPUT_CLEAR, NULL); // Freeing the allocated buffer for softdecoding - if (swr) - swr_free(&swr); - if (decoded_frame) - av_frame_free(&decoded_frame); - if (context->playback) - context->playback->abortPlayback = 1; - hasPlayThreadStarted = 0; - ffmpeg_printf(10, "terminating\n"); -} - -/* **************************** */ -/* Container part for ffmpeg */ -/* **************************** */ - -static int terminating = 0; -static int interrupt_cb(void *ctx) -{ - PlaybackHandler_t *p = (PlaybackHandler_t *)ctx; - return p->abortPlayback | p->abortRequested; -} - -int container_ffmpeg_update_tracks(Context_t *context, char *filename) -{ - if (terminating) - return cERR_CONTAINER_FFMPEG_NO_ERROR; - if (context->manager->video) - context->manager->video->Command(context, MANAGER_INIT_UPDATE, NULL); - if (context->manager->audio) - context->manager->audio->Command(context, MANAGER_INIT_UPDATE, NULL); - - ffmpeg_printf(20, "dump format\n"); - av_dump_format(avContext, 0, filename, 0); - ffmpeg_printf(1, "number streams %d\n", avContext->nb_streams); - unsigned int n; - for (n = 0; n < avContext->nb_streams; n++) - { - Track_t track; - AVStream *stream = avContext->streams[n]; - char *encoding = Codec2Encoding(stream->codec); - if (!stream->id) - stream->id = n; - if (encoding != NULL) - ffmpeg_printf(1, "%d. encoding = %s\n", stream->id, encoding); - /* some values in track are unset and therefor copyTrack segfaults. - * so set it by default to NULL! - */ - memset(&track, 0, sizeof(track)); - - AVDictionaryEntry *lang; - - lang = av_dict_get(stream->metadata, "language", NULL, 0); - track.Name = lang ? lang->value : "und"; - ffmpeg_printf(10, "Language %s\n", track.Name); - track.Encoding = encoding; - track.stream = stream; - track.Id = stream->id; - track.aacbuf = 0; - track.have_aacheader = -1; - if (stream->duration == AV_NOPTS_VALUE) - { - ffmpeg_printf(10, "Stream has no duration so we take the duration from context\n"); - track.duration = (double) avContext->duration / 1000.0; - } - else - { - track.duration = (double) stream->duration * av_q2d(stream->time_base) * 1000.0; - } - switch (stream->codec->codec_type) - { - case AVMEDIA_TYPE_VIDEO: - ffmpeg_printf(10, "CODEC_TYPE_VIDEO %d\n", stream->codec->codec_type); - track.type = eTypeES; - track.width = stream->codec->width; - track.height = stream->codec->height; - track.extraData = stream->codec->extradata; - track.extraSize = stream->codec->extradata_size; - track.frame_rate = stream->r_frame_rate.num; - double frame_rate = av_q2d(stream->r_frame_rate); /* rational to double */ - ffmpeg_printf(10, "frame_rate = %f\n", frame_rate); - track.frame_rate = frame_rate * 1000.0; - /* fixme: revise this */ - if (track.frame_rate < 23970) - track.TimeScale = 1001; - else - track.TimeScale = 1000; - ffmpeg_printf(10, "bit_rate = %d\n", (int)stream->codec->bit_rate); - ffmpeg_printf(10, "flags = %d\n", stream->codec->flags); - ffmpeg_printf(10, "frame_bits = %d\n", stream->codec->frame_bits); - ffmpeg_printf(10, "time_base.den %d\n", stream->time_base.den); - ffmpeg_printf(10, "time_base.num %d\n", stream->time_base.num); - ffmpeg_printf(10, "frame_rate.num %d\n", stream->r_frame_rate.num); - ffmpeg_printf(10, "frame_rate.den %d\n", stream->r_frame_rate.den); - ffmpeg_printf(10, "frame_rate %d\n", track.frame_rate); - ffmpeg_printf(10, "TimeScale %d\n", track.TimeScale); - if (context->manager->video && context->manager->video->Command(context, MANAGER_ADD, &track) < 0) - { - /* konfetti: fixme: is this a reason to return with error? */ - ffmpeg_err("failed to add track %d\n", n); - } - break; - case AVMEDIA_TYPE_AUDIO: - ffmpeg_printf(10, "CODEC_TYPE_AUDIO %d\n", stream->codec->codec_type); - track.type = eTypeES; - if (!strncmp(encoding, "A_AAC", 5)) - { - /* extradata - 13 10 56 e5 9d 48 00 (anderen cops) - object_type: 00010 2 = LC - sample_rate: 011 0 6 = 24000 - chan_config: 0010 2 = Stereo - 000 0 - 1010110 111 = 0x2b7 - 00101 = SBR - 1 - 0011 = 48000 - 101 01001000 = 0x548 - ps = 0 - 0000000 - */ - unsigned int extradata_size = stream->codec->extradata_size; - unsigned int object_type = 2; // LC - unsigned int sample_index = aac_get_sample_rate_index(stream->codec->sample_rate); - unsigned int chan_config = stream->codec->channels; - if (extradata_size >= 2) - { - object_type = stream->codec->extradata[0] >> 3; - sample_index = ((stream->codec->extradata[0] & 0x7) << 1) - + (stream->codec->extradata[1] >> 7); - chan_config = (stream->codec->extradata[1] >> 3) && 0xf; - } - ffmpeg_printf(10, "aac extradata_size %d\n", extradata_size); - ffmpeg_printf(10, "aac object_type %d\n", object_type); - ffmpeg_printf(10, "aac sample_index %d\n", sample_index); - ffmpeg_printf(10, "aac chan_config %d\n", chan_config); - if ((extradata_size <= 1) || (object_type == 1)) - { - ffmpeg_printf(10, "use resampling for AAC\n"); - encoding = "A_IPCM"; - track.Encoding = "A_IPCM"; - } - else - { - ffmpeg_printf(10, "Create AAC ExtraData\n"); - Hexdump(stream->codec->extradata, extradata_size); - object_type -= 1; // Cause of ADTS - track.aacbuflen = AAC_HEADER_LENGTH; - track.aacbuf = malloc(8); - track.aacbuf[0] = 0xFF; - track.aacbuf[1] = 0xF1; - track.aacbuf[2] = ((object_type & 0x03) << 6) | (sample_index << 2) | ((chan_config >> 2) & 0x01); - track.aacbuf[3] = (chan_config & 0x03) << 6; - track.aacbuf[4] = 0x00; - track.aacbuf[5] = 0x1F; - track.aacbuf[6] = 0xFC; - printf("AAC_HEADER -> "); - Hexdump(track.aacbuf, 7); - track.have_aacheader = 1; - } - } - if (!strncmp(encoding, "A_IPCM", 6)) - { - track.inject_as_pcm = 1; - ffmpeg_printf(10, " Handle inject_as_pcm = %d\n", track.inject_as_pcm); - AVCodec *codec = avcodec_find_decoder(stream->codec->codec_id); - if (codec != NULL && !avcodec_open2(stream->codec, codec, NULL)) - printf("AVCODEC__INIT__SUCCESS\n"); - else - printf("AVCODEC__INIT__FAILED\n"); - } - if (context->manager->audio) - { - if (context->manager->audio->Command(context, MANAGER_ADD, &track) < 0) - { - /* konfetti: fixme: is this a reason to return with error? */ - ffmpeg_err("failed to add track %d\n", n); - } - } - break; - case AVMEDIA_TYPE_SUBTITLE: - ffmpeg_printf(10, "CODEC_TYPE_SUBTITLE %d\n", stream->codec->codec_type); - track.width = -1; /* will be filled online from videotrack */ - track.height = -1; /* will be filled online from videotrack */ - track.extraData = stream->codec->extradata; - track.extraSize = stream->codec->extradata_size; - ffmpeg_printf(1, "subtitle codec %d\n", stream->codec->codec_id); - ffmpeg_printf(1, "subtitle width %d\n", stream->codec->width); - ffmpeg_printf(1, "subtitle height %d\n", stream->codec->height); - ffmpeg_printf(1, "subtitle stream %p\n", stream); - ffmpeg_printf(10, "FOUND SUBTITLE %s\n", track.Name); - if (context->manager->subtitle) - { - if (!stream->codec->codec) - { - stream->codec->codec = avcodec_find_decoder(stream->codec->codec_id); - if (!stream->codec->codec) - ffmpeg_err("avcodec_find_decoder failed for subtitle track %d\n", n); - else if (avcodec_open2(stream->codec, stream->codec->codec, NULL)) - { - ffmpeg_err("avcodec_open2 failed for subtitle track %d\n", n); - stream->codec->codec = NULL; - } - } - if (context->manager->subtitle->Command(context, MANAGER_ADD, &track) < 0) - { - /* konfetti: fixme: is this a reason to return with error? */ - ffmpeg_err("failed to add subtitle track %d\n", n); - } - } - break; - case AVMEDIA_TYPE_UNKNOWN: - case AVMEDIA_TYPE_DATA: - case AVMEDIA_TYPE_ATTACHMENT: - case AVMEDIA_TYPE_NB: - default: - ffmpeg_err("not handled or unknown codec_type %d\n", stream->codec->codec_type); - break; - } - } /* for */ - return cERR_CONTAINER_FFMPEG_NO_ERROR; -} - -static int container_ffmpeg_init(Context_t *context, char *filename) -{ - int ret = 0; - unsigned int n = 1; - int no_probe = 0; - ffmpeg_printf(10, ">\n"); - if (filename == NULL) - { - ffmpeg_err("filename NULL\n"); - return cERR_CONTAINER_FFMPEG_NULL; - } - if (context == NULL) - { - ffmpeg_err("context NULL\n"); - return cERR_CONTAINER_FFMPEG_NULL; - } - ffmpeg_printf(10, "filename %s\n", filename); - if (isContainerRunning) - { - ffmpeg_err("ups already running?\n"); - return cERR_CONTAINER_FFMPEG_RUNNING; - } - - if (strstr(filename, ":31339/id=") || strstr(filename, ":8001/")) - no_probe = 1; - - isContainerRunning = 0; - /* initialize ffmpeg */ - av_register_all(); - avformat_network_init(); - //av_log_set_level( AV_LOG_DEBUG ); - context->playback->abortRequested = 0; - context->playback->abortPlayback = 0; -again: - avContext = avformat_alloc_context(); - if (!avContext) - { - ffmpeg_err("avformat_alloc_context failed\n"); - ret = cERR_CONTAINER_FFMPEG_OPEN; - goto fail_alloc; - } - avContext->interrupt_callback.callback = interrupt_cb; - avContext->interrupt_callback.opaque = context->playback; - avContext->flags |= AVFMT_FLAG_GENPTS; - if (context->playback->isHttp && !no_probe) - avContext->flags |= AVFMT_FLAG_NONBLOCK | AVIO_FLAG_NONBLOCK | AVFMT_NO_BYTE_SEEK; - if (no_probe || (context->playback->isHttp && n)) -#if (LIBAVFORMAT_VERSION_MAJOR == 57 && LIBAVFORMAT_VERSION_MINOR == 25) - if (no_probe) - avContext->max_analyze_duration = 1; - else - avContext->max_analyze_duration = 1 * AV_TIME_BASE; - else - avContext->max_analyze_duration = 0; -#else - if (no_probe) - avContext->max_analyze_duration2 = 1; - else - avContext->max_analyze_duration2 = 1 * AV_TIME_BASE; - else - avContext->max_analyze_duration2 = 0; -#endif - ret = avformat_open_input(&avContext, filename, NULL, NULL); - if (ret < 0) - { - char error[512]; - ffmpeg_err("avformat_open_input failed %d (%s)\n", ret, filename); - av_strerror(ret, error, sizeof error); - ffmpeg_err("Cause: %s\n", error); - ret = cERR_CONTAINER_FFMPEG_OPEN; - goto fail; - } - avContext->iformat->flags |= AVFMT_SEEK_TO_PTS; - ffmpeg_printf(20, "Find_streaminfo\n"); - ret = avformat_find_stream_info(avContext, NULL); - if (!no_probe) - { - if (ret < 0) - { - ffmpeg_err("Error avformat_find_stream_info\n"); - if (n) - { - n = 0; - avformat_close_input(&avContext); - ffmpeg_err("Try again with default probe size\n"); - goto again; - } -#ifdef this_is_ok - /* crow reports that sometimes this returns an error - * but the file is played back well. so remove this - * until other works are done and we can prove this. - */ - ret = cERR_CONTAINER_FFMPEG_STREAM; - goto fail; -#endif - } - } - ret = cERR_CONTAINER_FFMPEG_STREAM; - for (n = 0; n < avContext->nb_streams; n++) - { - AVStream *stream = avContext->streams[n]; - switch (stream->codec->codec_type) - { - case AVMEDIA_TYPE_AUDIO: - case AVMEDIA_TYPE_VIDEO: - ret = 0; - default: - break; - } - } - if (ret < 0) - { - ffmpeg_err("Not found video or audio stream\n"); - goto fail; - } - terminating = 0; - ret = container_ffmpeg_update_tracks(context, filename); - isContainerRunning = 1; - return ret; -fail: - avformat_close_input(&avContext); -fail_alloc: - avformat_network_deinit(); - return ret; -} - -static int container_ffmpeg_play(Context_t *context) -{ - int error; - int ret = 0; - pthread_attr_t attr; - - ffmpeg_printf(10, "\n"); - if (context && context->playback && context->playback->isPlaying) - { - ffmpeg_printf(10, "is Playing\n"); - } - else - { - ffmpeg_printf(10, "is NOT Playing\n"); - } - if (hasPlayThreadStarted == 0) - { - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - if ((error = pthread_create(&PlayThread, &attr, (void *)&FFMPEGThread, context)) != 0) - { - ffmpeg_printf(10, "Error creating thread, error:%d:%s\n", error, strerror(error)); - ret = cERR_CONTAINER_FFMPEG_ERR; - } - else - { - ffmpeg_printf(10, "Created thread\n"); - } - } - else - { - ffmpeg_printf(10, "A thread already exists!\n"); - ret = cERR_CONTAINER_FFMPEG_ERR; - } - ffmpeg_printf(10, "exiting with value %d\n", ret); - return ret; -} - -static int container_ffmpeg_stop(Context_t *context) -{ - int ret = cERR_CONTAINER_FFMPEG_NO_ERROR; - int wait_time = 20; - - ffmpeg_printf(10, "\n"); - if (!isContainerRunning) - { - ffmpeg_err("Container not running\n"); - return cERR_CONTAINER_FFMPEG_ERR; - } - if (context->playback) - context->playback->abortRequested = 1; - while ((hasPlayThreadStarted != 0) && (--wait_time) > 0) - { - ffmpeg_printf(10, "Waiting for ffmpeg thread to terminate itself, will try another %d times\n", wait_time); - usleep(100000); - } - if (wait_time == 0) - { - ffmpeg_err("Timeout waiting for thread!\n"); - ret = cERR_CONTAINER_FFMPEG_ERR; - usleep(100000); - } - terminating = 1; - if (avContext) - { - avformat_close_input(&avContext); - } - isContainerRunning = 0; - avformat_network_deinit(); - ffmpeg_printf(10, "ret %d\n", ret); - return ret; -} - -static int container_ffmpeg_seek(float sec, int absolute) -{ -#if 0 - if (absolute) - seek_sec_abs = sec, seek_sec_rel = 0.0; - else - seek_sec_abs = -1.0, seek_sec_rel = sec; -#else - seek_sec_rel = sec; -#endif - return cERR_CONTAINER_FFMPEG_NO_ERROR; -} - -static int container_ffmpeg_get_length(Context_t *context, double *length) -{ - ffmpeg_printf(50, "\n"); - Track_t *videoTrack = NULL; - Track_t *audioTrack = NULL; - Track_t *subtitleTrack = NULL; - Track_t *current = NULL; - if (length == NULL) - { - ffmpeg_err("null pointer passed\n"); - return cERR_CONTAINER_FFMPEG_ERR; - } - context->manager->video->Command(context, MANAGER_GET_TRACK, &videoTrack); - context->manager->audio->Command(context, MANAGER_GET_TRACK, &audioTrack); - context->manager->subtitle->Command(context, MANAGER_GET_TRACK, &subtitleTrack); - if (videoTrack != NULL) - current = videoTrack; - else if (audioTrack != NULL) - current = audioTrack; - else if (subtitleTrack != NULL) - current = subtitleTrack; - *length = 0.0; - if (current != NULL) - { - if (current->duration == 0) - return cERR_CONTAINER_FFMPEG_ERR; - else - *length = (current->duration / 1000.0); - } - else - { - if (avContext != NULL) - { - *length = (avContext->duration / 1000.0); - } - else - { - ffmpeg_err("no Track not context ->no problem :D\n"); - return cERR_CONTAINER_FFMPEG_ERR; - } - } - return cERR_CONTAINER_FFMPEG_NO_ERROR; -} - -static int container_ffmpeg_switch_audio(Context_t *context, int *arg) -{ - ffmpeg_printf(10, "track %d\n", *arg); - /* Hellmaster1024: nothing to do here!*/ - float sec = -5.0; - context->playback->Command(context, PLAYBACK_SEEK, (void *)&sec); - return cERR_CONTAINER_FFMPEG_NO_ERROR; -} - -static int container_ffmpeg_switch_subtitle(Context_t *context __attribute__((unused)), int *arg __attribute__((unused))) -{ - /* Hellmaster1024: nothing to do here!*/ - return cERR_CONTAINER_FFMPEG_NO_ERROR; -} - -/* konfetti comment: I dont like the mechanism of overwriting - * the pointer in infostring. This lead in most cases to - * user errors, like it is in the current version (libeplayer2 <-->e2->servicemp3.cpp) - * From e2 there is passed a tag=strdup here and we overwrite this - * strdupped tag. This lead to dangling pointers which are never freed! - * I do not free the string here because this is the wrong way. The mechanism - * should be changed, or e2 should pass it in a different way... - */ -static int container_ffmpeg_get_info(Context_t *context, char **infoString) -{ - Track_t *videoTrack = NULL; - Track_t *audioTrack = NULL; - char *meta = NULL; - ffmpeg_printf(20, ">\n"); - if (avContext != NULL) - { - if ((infoString == NULL) || (*infoString == NULL)) - { - ffmpeg_err("infostring NULL\n"); - return cERR_CONTAINER_FFMPEG_ERR; - } - ffmpeg_printf(20, "%s\n", *infoString); - context->manager->video->Command(context, MANAGER_GET_TRACK, &videoTrack); - context->manager->audio->Command(context, MANAGER_GET_TRACK, &audioTrack); - if ((meta = searchMeta(avContext->metadata, *infoString)) == NULL) - { - if (audioTrack != NULL) - { - AVStream *stream = audioTrack->stream; - meta = searchMeta(stream->metadata, *infoString); - } - if ((meta == NULL) && (videoTrack != NULL)) - { - AVStream *stream = videoTrack->stream; - meta = searchMeta(stream->metadata, *infoString); - } - } - if (meta != NULL) - { - *infoString = strdup(meta); - } - else - { - ffmpeg_printf(1, "no metadata found for \"%s\"\n", *infoString); - *infoString = strdup("not found"); - } - } - else - { - ffmpeg_err("avContext NULL\n"); - return cERR_CONTAINER_FFMPEG_ERR; - } - return cERR_CONTAINER_FFMPEG_NO_ERROR; -} - -static int Command(Context_t *context, ContainerCmd_t command, void *argument) -{ - int ret = cERR_CONTAINER_FFMPEG_NO_ERROR; - char *FILENAME = NULL; - double length = 0; - - ffmpeg_printf(50, "Command %d\n", command); - if (command != CONTAINER_INIT && !avContext) - return cERR_CONTAINER_FFMPEG_ERR; - if (command == CONTAINER_INIT && avContext) - return cERR_CONTAINER_FFMPEG_ERR; - switch (command) - { - case CONTAINER_INIT: - FILENAME = (char *)argument; - ret = container_ffmpeg_init(context, FILENAME); - break; - case CONTAINER_PLAY: - ret = container_ffmpeg_play(context); - break; - case CONTAINER_STOP: - ret = container_ffmpeg_stop(context); - break; - case CONTAINER_SEEK: - ret = container_ffmpeg_seek((float) * ((float *)argument), 0); - break; -#if 0 - case CONTAINER_SEEK_ABS: - ret = container_ffmpeg_seek((float) * ((float *)argument), -1); - break; -#endif - case CONTAINER_LENGTH: - ret = container_ffmpeg_get_length(context, &length); - *((double *)argument) = (double)length; - break; - case CONTAINER_SWITCH_AUDIO: - ret = container_ffmpeg_switch_audio(context, (int *) argument); - break; - case CONTAINER_SWITCH_SUBTITLE: - ret = container_ffmpeg_switch_subtitle(context, (int *) argument); - break; - case CONTAINER_INFO: - ret = container_ffmpeg_get_info(context, (char **)argument); - break; - case CONTAINER_STATUS: - *((int *)argument) = hasPlayThreadStarted; - break; - default: - ffmpeg_err("ContainerCmd %d not supported!\n", command); - ret = cERR_CONTAINER_FFMPEG_ERR; - break; - } - ffmpeg_printf(50, "exiting with value %d\n", ret); - return ret; -} - -static char *FFMPEG_Capabilities[] = {"avi", "mkv", "mp4", "ts", "mov", "flv", "flac", "mp3", "mpg", "m2ts", "vob", "wmv", "wma", "asf", "mp2", "m4v", "m4a", "divx", "dat", "mpeg", "trp", "mts", "vdr", "ogg", "wav", "wtv", "asx", "mvi", "png", "jpg", "m3u8", "ogm", "3gp", NULL }; - -Container_t FFMPEGContainer = -{ - "FFMPEG", - &Command, - FFMPEG_Capabilities -}; diff --git a/libeplayer3/container/text_srt.c b/libeplayer3/container/text_srt.c deleted file mode 100644 index a1d83c5..0000000 --- a/libeplayer3/container/text_srt.c +++ /dev/null @@ -1,453 +0,0 @@ -/* - * subtitle handling for srt files. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "misc.h" -#include "subtitle.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ - -#define SRT_DEBUG - -#ifdef SRT_DEBUG - -static short debug_level = 0; - -#define srt_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, FILENAME, __FUNCTION__, ## x); } while (0) -#else -#define srt_printf(level, fmt, x...) -#endif - -#ifndef SRT_SILENT -#define srt_err(fmt, x...) do { printf("[%s:%s] " fmt, FILENAME, __FUNCTION__, ## x); } while (0) -#else -#define srt_err(fmt, x...) -#endif - -/* Error Constants */ -#define cERR_SRT_NO_ERROR 0 -#define cERR_SRT_ERROR -1 - -#define TRACKWRAP 20 -#define MAXLINELENGTH 80 - -static const char FILENAME[] = "text_srt.c"; - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -typedef struct -{ - char *File; - int Id; -} SrtTrack_t; - -static pthread_t thread_sub; - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ - -static SrtTrack_t *Tracks; -static int TrackCount = 0; -static int CurrentTrack = -1; //no as default. - -FILE *fsub = NULL; - -static int hasThreadStarted = 0; - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ - -void data_to_manager(Context_t *context, char *Text, unsigned long long int Pts, double Duration) -{ - srt_printf(20, "--> Text= \"%s\"\n", Text); - if (context && - context->playback && - context->playback->isPlaying && Text) - { - int sl = strlen(Text) - 1; - while (sl >= 0 && (Text[sl] == '\n' || Text[sl] == '\r')) Text[sl--] = '\0'; /*Delete last \n or \r */ - unsigned char *line = text_to_ass(Text, Pts, Duration); - if (line != NULL) - { - srt_printf(50, "Sub text is %s\n", Text); - srt_printf(50, "Sub line is %s\n", line); - SubtitleData_t data; - data.data = line; - data.len = strlen((char *)line); - data.extradata = (unsigned char *) DEFAULT_ASS_HEAD; - data.extralen = strlen(DEFAULT_ASS_HEAD); - data.pts = Pts * 90; - data.duration = Duration; - context->container->assContainer->Command(context, CONTAINER_DATA, &data); - free(line); - } - } - srt_printf(20, "<-- Text= \"%s\"\n", Text); -} - -/* ***************************** */ -/* Worker Thread */ -/* ***************************** */ - -static void *SrtSubtitleThread(void *data) -{ - int pos = 0; - char Data[MAXLINELENGTH]; - unsigned long long int Pts = 0; - double Duration = 0; - char *Text = NULL; - Context_t *context = (Context_t *) data; - srt_printf(10, "\n"); - while (context && context->playback && context->playback->isPlaying && fsub && fgets(Data, MAXLINELENGTH, fsub)) - { - srt_printf(20, "pos=%d\n", pos); - if (pos == 0) - { - if (Data[0] == '\n' || Data[0] == '\0' || Data[0] == 13 /* ^M */) - continue; /* Empty line not allowed here */ - pos++; - } - else if (pos == 1) - { - int ret, horIni, minIni, secIni, milIni, horFim, minFim, secFim, milFim; - ret = sscanf(Data, "%d:%d:%d,%d --> %d:%d:%d,%d", &horIni, &minIni, &secIni, &milIni, &horFim, &minFim, &secFim, &milFim); - if (ret != 8) continue; /* Data is not in correct format */ - Pts = (horIni * 3600 + minIni * 60 + secIni) * 1000 + milIni; - Duration = ((horFim * 3600 + minFim * 60 + secFim) * 1000 + milFim - Pts) / 1000.0; - pos++; - } - else if (pos == 2) - { - srt_printf(20, "Data[0] = %d \'%c\'\n", Data[0], Data[0]); - if (Data[0] == '\n' || Data[0] == '\0' || Data[0] == 13 /* ^M */) - { - if (Text == NULL) - Text = strdup(" \n"); /* better to display at least one character */ - /*Hellmaster 1024 since we have waited, we have to check if we are still paying */ - data_to_manager(context, Text, Pts, Duration); - free(Text); - Text = NULL; - pos = 0; - continue; - } - if (!Text) - { - Text = strdup(Data); - } - else - { - int length = strlen(Text) /* \0 -> \n */ + strlen(Data) + 2 /* \0 */; - char *tmpText = Text; - Text = (char *)malloc(length); - strcpy(Text, tmpText); - strcat(Text, Data); - free(tmpText); - } - } - } /* while */ - hasThreadStarted = 0; - if (Text) - { - data_to_manager(context, Text, Pts, Duration); - free(Text); - Text = NULL; - } - srt_printf(0, "thread has ended\n"); - return NULL; -} - -/* ***************************** */ -/* Functions */ -/* ***************************** */ - -static void SrtManagerAdd(Context_t *context __attribute__((unused)), SrtTrack_t track) -{ - srt_printf(10, "%s %d\n", track.File, track.Id); - if (Tracks == NULL) - { - Tracks = malloc(sizeof(SrtTrack_t) * TRACKWRAP); - } - if (TrackCount < TRACKWRAP) - { - Tracks[TrackCount].File = strdup(track.File); - Tracks[TrackCount].Id = track.Id; - TrackCount++; - } -} - -#if 0 -static char **SrtManagerList(Context_t *context __attribute__((unused))) -{ - char **tracklist = NULL; - srt_printf(10, "\n"); - if (Tracks != NULL) - { - char help[256]; - int i = 0, j = 0; - tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1)); - for (i = 0, j = 0; i < TrackCount; i++, j += 2) - { - sprintf(help, "%d", Tracks[i].Id); - tracklist[j] = strdup(help); - tracklist[j + 1] = strdup(Tracks[i].File); - } - tracklist[j] = NULL; - } - return tracklist; -} -#endif - -static void SrtManagerDel(Context_t *context __attribute__((unused))) -{ - int i = 0; - srt_printf(10, "\n"); - - if (Tracks != NULL) - { - for (i = 0; i < TrackCount; i++) - { - if (Tracks[i].File != NULL) - free(Tracks[i].File); - Tracks[i].File = NULL; - } - free(Tracks); - Tracks = NULL; - } - TrackCount = 0; - CurrentTrack = -1; -} - -static int SrtGetSubtitle(Context_t *context, char *Filename) -{ - struct dirent *dirzeiger; - DIR *dir; - int i = TEXTSRTOFFSET; - char *copyFilename = NULL; - char *FilenameExtension = NULL; - char *FilenameFolder = NULL; - char *FilenameShort = NULL; - - srt_printf(10, "\n"); - if (Filename == NULL) - { - srt_err("Filename NULL\n"); - return cERR_SRT_ERROR; - } - srt_printf(10, "file: %s\n", Filename); - copyFilename = strdup(Filename); - if (copyFilename == NULL) - { - srt_err("copyFilename NULL\n"); - return cERR_SRT_ERROR; - } - FilenameFolder = dirname(copyFilename); - srt_printf(10, "folder: %s\n", FilenameFolder); - FilenameExtension = getExtension(copyFilename); - if (FilenameExtension == NULL) - { - srt_err("FilenameExtension NULL\n"); - free(copyFilename); - return cERR_SRT_ERROR; - } - srt_printf(10, "ext: %s\n", FilenameExtension); - FilenameShort = basename(copyFilename); - /* cut extension */ - FilenameShort[strlen(FilenameShort) - strlen(FilenameExtension) - 1] = '\0'; - srt_printf(10, "basename: %s\n", FilenameShort); - srt_printf(10, "%s\n%s | %s | %s\n", copyFilename, FilenameFolder, FilenameShort, FilenameExtension); - if ((dir = opendir(FilenameFolder)) != NULL) - { - while ((dirzeiger = readdir(dir)) != NULL) - { - char subtitleFilename[PATH_MAX]; - char *subtitleExtension = NULL; - srt_printf(20, "%s\n", (*dirzeiger).d_name); - strcpy(subtitleFilename, (*dirzeiger).d_name); - // Extension of Relativ Subtitle File Name - subtitleExtension = getExtension(subtitleFilename); - if (subtitleExtension == NULL) - continue; - if (strcmp(subtitleExtension, "srt") != 0) - continue; - /* cut extension */ - subtitleFilename[strlen(subtitleFilename) - strlen(subtitleExtension) - 1] = '\0'; - srt_printf(10, "%s %s\n", FilenameShort, subtitleFilename); - if (strncmp(FilenameShort, subtitleFilename, strlen(FilenameShort)) == 0) - { - char absSubtitleFileName[PATH_MAX]; - /* found something of interest, so now make an absolut path name */ - sprintf(absSubtitleFileName, "%s/%s.%s", FilenameFolder, subtitleFilename, subtitleExtension); - srt_printf(10, "SRT: %s [%s]\n", subtitleExtension, subtitleFilename); - srt_printf(10, "\t->%s\n", absSubtitleFileName); - SrtTrack_t SrtSubtitle = - { - absSubtitleFileName, - i, - }; - SrtManagerAdd(context, SrtSubtitle); - - Track_t Subtitle; - - memset(&Subtitle, 0, sizeof(Subtitle)); - Subtitle.Name = subtitleExtension; - Subtitle.Encoding = "S_TEXT/SRT"; - Subtitle.Id = i++, - context->manager->subtitle->Command(context, MANAGER_ADD, &Subtitle); - } - } /* while */ - closedir(dir); - } /* if dir */ - free(copyFilename); - srt_printf(10, "<\n"); - return cERR_SRT_NO_ERROR; -} - -static int SrtOpenSubtitle(Context_t *context __attribute__((unused)), int pid) -{ - srt_printf(10, "\n"); - if (pid < TEXTSRTOFFSET) - { - srt_err("trackid not for us\n"); - return cERR_SRT_ERROR; - } - - int trackid; - - for (trackid = 0; trackid < TrackCount; trackid++) - if (Tracks[trackid].Id == pid) - break; - if (trackid == TrackCount) - { - srt_err("trackid not for us\n"); - return cERR_SRT_ERROR; - } - srt_printf(10, "%s\n", Tracks[trackid].File); - fsub = fopen(Tracks[trackid].File, "rb"); - srt_printf(10, "%s\n", fsub ? "fsub!=NULL" : "fsub==NULL"); - if (!fsub) - { - srt_err("cannot open file %s\n", Tracks[trackid].File); - return cERR_SRT_ERROR; - } - return cERR_SRT_NO_ERROR; -} - -static int SrtCloseSubtitle(Context_t *context __attribute__((unused))) -{ - srt_printf(10, "\n"); - if (fsub) - fclose(fsub); - /* this closes the thread! */ - fsub = NULL; - hasThreadStarted = 0; - return cERR_SRT_NO_ERROR; -} - -static int SrtSwitchSubtitle(Context_t *context, int *arg) -{ - int ret = cERR_SRT_NO_ERROR; - srt_printf(10, "arg:%d\n", *arg); - ret = SrtCloseSubtitle(context); - if (((ret |= SrtOpenSubtitle(context, *arg)) == cERR_SRT_NO_ERROR) && (!hasThreadStarted)) - { - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - pthread_create(&thread_sub, &attr, &SrtSubtitleThread, context); - hasThreadStarted = 1; - } - return ret; -} - -static int SrtDel(Context_t *context) -{ - int ret = cERR_SRT_NO_ERROR; - srt_printf(10, "\n"); - ret = SrtCloseSubtitle(context); - SrtManagerDel(context); - return ret; -} - -static int Command(Context_t *context, ContainerCmd_t command, void *argument) -{ - int ret = cERR_SRT_NO_ERROR; - - srt_printf(10, "\n"); - switch (command) - { - case CONTAINER_INIT: - { - char *filename = (char *)argument; - ret = SrtGetSubtitle(context, filename); - break; - } - case CONTAINER_DEL: - { - ret = SrtDel(context); - break; - } - case CONTAINER_SWITCH_SUBTITLE: - { - ret = SrtSwitchSubtitle(context, (int *) argument); - break; - } - default: - srt_err("ConatinerCmd not supported! %d\n", command); - break; - } - srt_printf(10, "ret = %d\n", ret); - return 0; -} - -static char *SrtCapabilities[] = { "srt", NULL }; - -Container_t SrtContainer = -{ - "SRT", - &Command, - SrtCapabilities -}; diff --git a/libeplayer3/container/text_ssa.c b/libeplayer3/container/text_ssa.c deleted file mode 100644 index 2be813e..0000000 --- a/libeplayer3/container/text_ssa.c +++ /dev/null @@ -1,453 +0,0 @@ -/* - * subtitle handling for ssa files. - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "misc.h" -#include "subtitle.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ - -#define SSA_DEBUG - -#ifdef SSA_DEBUG - -static short debug_level = 10; - -#define ssa_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, FILENAME, __FUNCTION__, ## x); } while (0) -#else -#define ssa_printf(level, fmt, x...) -#endif - -#ifndef SSA_SILENT -#define ssa_err(fmt, x...) do { printf("[%s:%s] " fmt, FILENAME, __FUNCTION__, ## x); } while (0) -#else -#define ssa_err(fmt, x...) -#endif - -/* Error Constants */ -#define cERR_SSA_NO_ERROR 0 -#define cERR_SSA_ERROR -1 - -#define TRACKWRAP 20 -#define MAXLINELENGTH 1000 - -static const char FILENAME[] = "text_ssa.c"; - -//Buffer size used in getLine function. Do not set to value less than 1 !!! -#define SSA_BUFFER_SIZE 14 - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -typedef struct -{ - char *File; - int Id; -} SsaTrack_t; - -/* ***************************** */ -/* Variables */ -/* ***************************** */ - -static pthread_t thread_sub; - -static SsaTrack_t *Tracks; -static int TrackCount = 0; -FILE *fssa = NULL; - -static int hasThreadStarted = 0; - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ -char *SSAgetLine() -{ - char *strAux = NULL, *strInput; - char c[SSA_BUFFER_SIZE]; - int ch; - int k, tam, tamAux; - - k = tamAux = 0; - if (SSA_BUFFER_SIZE > 0) - { - strInput = (char *)malloc(1 * sizeof(char)); - strInput[0] = '\0'; - while (tamAux != 1) - { - if ((ch = fgetc(fssa)) != EOF) - { - ungetc(ch , fssa); - fgets(c, SSA_BUFFER_SIZE, fssa); - strAux = (char *)strchr(c, '\n'); - tam = strlen(c); - if (strAux != NULL) - { - tamAux = strlen(strAux); - tam--; - } - k = k + tam; - strInput = (char *)realloc(strInput, (k + 1) * sizeof(char)); - if (k != tam) - strncat(strInput, c, tam); - else - strncpy(strInput, c, tam); - strInput[k] = '\0'; - } - else - { - tamAux = 1; - fclose(fssa); - fssa = NULL; - } - } - } - return strInput; -} - -/* ***************************** */ -/* Worker Thread */ -/* ***************************** */ -static void *SsaSubtitleThread(void *Data) -{ - Context_t *context = (Context_t *) Data; - char *head = malloc(sizeof(char) * 1); - ssa_printf(10, "\n"); - head[0] = '\0'; - while (context && context->playback && context->playback->isPlaying && fssa) - { - char *line = NULL; - do - { - line = SSAgetLine(); - if (strncmp(line, "Dialogue: ", 10)) - { - int head_len = strlen(head); - int line_len = strlen(line); - head = realloc(head, line_len + head_len + 2); - memcpy(head + head_len, line, sizeof(char)*line_len + 1); - head[head_len + line_len] = '\n'; - head[head_len + line_len + 1] = '\0'; - } - } - while (strncmp(line, "Dialogue: ", 10) != 0 && fssa); - /*Hellmaster 1024 since we have waited, we have to check if we are still paying */ - if (context && - context->playback && - context->playback->isPlaying) - { - SubtitleData_t data; - - data.data = (unsigned char *) line; - data.len = strlen(line); - data.extradata = (unsigned char *) head; - data.extralen = strlen(head); - data.pts = 0; - data.duration = 0.0; - context->container->assContainer->Command(context, CONTAINER_DATA, &data); - } - free(line); - line = NULL; - continue; - } - hasThreadStarted = 0; - if (head) - { - free(head); - head = NULL; - } - ssa_printf(0, "thread has ended\n"); - return NULL; -} - -/* ***************************** */ -/* Functions */ -/* ***************************** */ - -static void SsaManagerAdd(Context_t *context __attribute__((unused)), SsaTrack_t track) -{ - ssa_printf(10, "%s %d\n", track.File, track.Id); - if (Tracks == NULL) - { - Tracks = malloc(sizeof(SsaTrack_t) * TRACKWRAP); - } - if (TrackCount < TRACKWRAP) - { - Tracks[TrackCount].File = strdup(track.File); - Tracks[TrackCount].Id = track.Id; - TrackCount++; - } -} - -#if 0 -static char **SsaManagerList(Context_t *context __attribute__((unused))) -{ - char **tracklist = NULL; - - ssa_printf(10, "\n"); - if (Tracks != NULL) - { - char help[256]; - int i = 0, j = 0; - tracklist = malloc(sizeof(char *) * ((TrackCount * 2) + 1)); - for (i = 0, j = 0; i < TrackCount; i++, j += 2) - { - sprintf(help, "%d", Tracks[i].Id); - tracklist[j] = strdup(help); - tracklist[j + 1] = strdup(Tracks[i].File); - } - tracklist[j] = NULL; - } - return tracklist; -} -#endif - -static void SsaManagerDel(Context_t *context __attribute__((unused))) -{ - int i = 0; - - ssa_printf(10, "\n"); - if (Tracks != NULL) - { - for (i = 0; i < TrackCount; i++) - { - if (Tracks[i].File != NULL) - free(Tracks[i].File); - Tracks[i].File = NULL; - } - free(Tracks); - Tracks = NULL; - } - TrackCount = 0; -} - -static int SsaGetSubtitle(Context_t *context, char *Filename) -{ - struct dirent *dirzeiger; - DIR *dir; - int i = TEXTSSAOFFSET; - char *copyFilename = NULL; - char *FilenameExtension = NULL; - char *FilenameFolder = NULL; - char *FilenameShort = NULL; - - ssa_printf(10, "\n"); - if (Filename == NULL) - { - ssa_err("Filename NULL\n"); - return cERR_SSA_ERROR; - } - ssa_printf(10, "file: %s\n", Filename); - copyFilename = strdup(Filename); - if (copyFilename == NULL) - { - ssa_err("copyFilename NULL\n"); - return cERR_SSA_ERROR; - } - FilenameFolder = dirname(copyFilename); - ssa_printf(10, "folder: %s\n", FilenameFolder); - FilenameExtension = getExtension(copyFilename); - if (FilenameExtension == NULL) - { - ssa_err("FilenameExtension NULL\n"); - free(copyFilename); - return cERR_SSA_ERROR; - } - ssa_printf(10, "ext: %s\n", FilenameExtension); - FilenameShort = basename(copyFilename); - /* cut extension */ - FilenameShort[strlen(FilenameShort) - strlen(FilenameExtension) - 1] = '\0'; - ssa_printf(10, "basename: %s\n", FilenameShort); - ssa_printf(10, "%s\n%s | %s | %s\n", copyFilename, FilenameFolder, FilenameShort, FilenameExtension); - if ((dir = opendir(FilenameFolder)) != NULL) - { - while ((dirzeiger = readdir(dir)) != NULL) - { - char subtitleFilename[PATH_MAX]; - char *subtitleExtension = NULL; - - ssa_printf(20, "%s\n", (*dirzeiger).d_name); - strcpy(subtitleFilename, (*dirzeiger).d_name); - // Extension of Relativ Subtitle File Name - subtitleExtension = getExtension(subtitleFilename); - if (subtitleExtension == NULL) - continue; - if (strcmp(subtitleExtension, "ssa") != 0 && strcmp(subtitleExtension, "ass") != 0) - continue; - /* cut extension */ - subtitleFilename[strlen(subtitleFilename) - strlen(subtitleExtension) - 1] = '\0'; - ssa_printf(10, "%s %s\n", FilenameShort, subtitleFilename); - if (strncmp(FilenameShort, subtitleFilename, strlen(FilenameShort)) == 0) - { - char absSubtitleFileName[PATH_MAX]; - /* found something of interest, so now make an absolut path name */ - sprintf(absSubtitleFileName, "%s/%s.%s", FilenameFolder, subtitleFilename, subtitleExtension); - ssa_printf(10, "SSA: %s [%s]\n", subtitleExtension, subtitleFilename); - ssa_printf(10, "\t->%s\n", absSubtitleFileName); - SsaTrack_t SsaSubtitle = - { - absSubtitleFileName, - i, - }; - SsaManagerAdd(context, SsaSubtitle); - Track_t Subtitle; - memset(&Subtitle, 0, sizeof(Subtitle)); - Subtitle.Name = subtitleExtension; - Subtitle.Encoding = "S_TEXT/SSA"; - Subtitle.Id = i++; - context->manager->subtitle->Command(context, MANAGER_ADD, &Subtitle); - } - } /* while */ - closedir(dir); - } /* if dir */ - free(copyFilename); - ssa_printf(10, "<\n"); - return cERR_SSA_NO_ERROR; -} - -static int SsaOpenSubtitle(Context_t *context __attribute__((unused)), int pid) -{ - ssa_printf(10, "\n"); - if (pid < TEXTSSAOFFSET) - { - ssa_err("trackid not for us\n"); - return cERR_SSA_ERROR; - } - int trackid; - for (trackid = 0; trackid < TrackCount; trackid++) - if (Tracks[trackid].Id == pid) - break; - if (trackid == TrackCount) - { - ssa_err("trackid not for us\n"); - return cERR_SSA_ERROR; - } - ssa_printf(10, "%s\n", Tracks[trackid].File); - fssa = fopen(Tracks[trackid].File, "rb"); - ssa_printf(10, "%s\n", fssa ? "fssa!=NULL" : "fssa==NULL"); - if (!fssa) - { - ssa_err("cannot open file %s\n", Tracks[trackid].File); - return cERR_SSA_ERROR; - } - return cERR_SSA_NO_ERROR; -} - -static int SsaCloseSubtitle(Context_t *context __attribute__((unused))) -{ - ssa_printf(10, "\n"); - if (fssa) - fclose(fssa); - /* this closes the thread! */ - fssa = NULL; - hasThreadStarted = 0; - return cERR_SSA_NO_ERROR; -} - -static int SsaSwitchSubtitle(Context_t *context, int *arg) -{ - int ret = cERR_SSA_NO_ERROR; - - ssa_printf(10, "\n"); - ret = SsaCloseSubtitle(context); - if (((ret |= SsaOpenSubtitle(context, *arg)) == cERR_SSA_NO_ERROR) && (!hasThreadStarted)) - { - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - pthread_create(&thread_sub, &attr, &SsaSubtitleThread, context); - hasThreadStarted = 1; - } - return ret; -} - -static int SsaDel(Context_t *context) -{ - int ret = cERR_SSA_NO_ERROR; - - ssa_printf(10, "\n"); - ret = SsaCloseSubtitle(context); - SsaManagerDel(context); - return ret; -} - -static int Command(Context_t *context, ContainerCmd_t command, void *argument) -{ - int ret = cERR_SSA_NO_ERROR; - - ssa_printf(10, "\n"); - switch (command) - { - case CONTAINER_INIT: - { - char *filename = (char *)argument; - ret = SsaGetSubtitle(context, filename); - break; - } - case CONTAINER_DEL: - { - ret = SsaDel(context); - break; - } - case CONTAINER_SWITCH_SUBTITLE: - { - ret = SsaSwitchSubtitle(context, (int *) argument); - break; - } - default: - ssa_err("ConatinerCmd not supported! %d\n", command); - break; - } - ssa_printf(10, "ret = %d\n", ret); - return 0; -} - -static char *SsaCapabilities[] = { "ssa", NULL }; - -Container_t SsaContainer = -{ - "SSA", - &Command, - SsaCapabilities -}; diff --git a/libeplayer3/include/aac.h b/libeplayer3/include/aac.h deleted file mode 100644 index 93c7294..0000000 --- a/libeplayer3/include/aac.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * aac helper - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef acc_123 -#define acc_123 - -#define AAC_HEADER_LENGTH 7 - -static inline int aac_get_sample_rate_index(uint32_t sample_rate) -{ - if (96000 <= sample_rate) - return 0; - else if (88200 <= sample_rate) - return 1; - else if (64000 <= sample_rate) - return 2; - else if (48000 <= sample_rate) - return 3; - else if (44100 <= sample_rate) - return 4; - else if (32000 <= sample_rate) - return 5; - else if (24000 <= sample_rate) - return 6; - else if (22050 <= sample_rate) - return 7; - else if (16000 <= sample_rate) - return 8; - else if (12000 <= sample_rate) - return 9; - else if (11025 <= sample_rate) - return 10; - else if (8000 <= sample_rate) - return 11; - else if (7350 <= sample_rate) - return 12; - else - return 13; -} - -#endif diff --git a/libeplayer3/include/common.h b/libeplayer3/include/common.h deleted file mode 100644 index 8d6c7cc..0000000 --- a/libeplayer3/include/common.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef COMMON_H_ -#define COMMON_H_ - -#include "container.h" -#include "output.h" -#include "manager.h" -#include "playback.h" -#include - -typedef struct Context_s -{ - PlaybackHandler_t *playback; - ContainerHandler_t *container; - OutputHandler_t *output; - ManagerHandler_t *manager; -} Context_t; - -#endif diff --git a/libeplayer3/include/container.h b/libeplayer3/include/container.h deleted file mode 100644 index 1e6ef19..0000000 --- a/libeplayer3/include/container.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef CONTAINER_H_ -#define CONTAINER_H_ - -#include - -typedef enum -{ - CONTAINER_INIT, - CONTAINER_ADD, - CONTAINER_CAPABILITIES, - CONTAINER_PLAY, - CONTAINER_STOP, - CONTAINER_SEEK, - CONTAINER_SEEK_ABS, - CONTAINER_LENGTH, - CONTAINER_DEL, - CONTAINER_SWITCH_AUDIO, - CONTAINER_SWITCH_SUBTITLE, - CONTAINER_SWITCH_DVBSUBTITLE, - CONTAINER_SWITCH_TELETEXT, - CONTAINER_INFO, - CONTAINER_STATUS, - CONTAINER_LAST_PTS, - CONTAINER_DATA, - CONTAINER_SET_BUFFER_SEEK_TIME, - CONTAINER_SET_BUFFER_SIZE, - CONTAINER_GET_BUFFER_SIZE, - CONTAINER_GET_BUFFER_STATUS, - CONTAINER_STOP_BUFFER -} ContainerCmd_t; - -struct Context_s; -typedef struct Context_s Context_t; - -typedef struct Container_s -{ - char *Name; - int (* Command)(Context_t *, ContainerCmd_t, void *); - char **Capabilities; - -} Container_t; - -extern Container_t FFMPEGContainer; - -typedef struct ContainerHandler_s -{ - char *Name; - Container_t *selectedContainer; - Container_t *textSrtContainer; - Container_t *textSsaContainer; - Container_t *assContainer; - - int (* Command)(Context_t *, ContainerCmd_t, void *); -} ContainerHandler_t; - -#endif diff --git a/libeplayer3/include/debug.h b/libeplayer3/include/debug.h deleted file mode 100644 index 9149895..0000000 --- a/libeplayer3/include/debug.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef debug_123 -#define debug_123 - -#include -#include - -static inline void Hexdump(unsigned char *Data, int length) -{ - int k; - for (k = 0; k < length; k++) - { - printf("%02x ", Data[k]); - if (((k + 1) & 31) == 0) - printf("\n"); - } - printf("\n"); -} - -#endif diff --git a/libeplayer3/include/ffmpeg_metadata.h b/libeplayer3/include/ffmpeg_metadata.h deleted file mode 100644 index 0a2a946..0000000 --- a/libeplayer3/include/ffmpeg_metadata.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _ffmpeg_metadata_123 -#define _ffmpeg_metadata_123 - -/* these file contains a list of metadata tags which can be used by applications - * to stream specific information. it maps the tags to ffmpeg specific tags. - * - * fixme: if we add other container for some resons later (maybe some other libs - * support better demuxing or something like this), then we should think on a - * more generic mechanism! - */ - -/* metatdata map list: - */ -char *metadata_map[] = -{ - /* our tags ffmpeg tag / id3v2 */ - "Title", "TIT2", - "Title", "TT2", - "Artist", "TPE1", - "Artist", "TP1", - "AlbumArtist", "TPE2", - "AlbumArtist", "TP2", - "Album", "TALB", - "Album", "TAL", - "Year", "TDRL", /* fixme */ - "Year", "TDRC", /* fixme */ - "Comment", "unknown", - "Track", "TRCK", - "Track", "TRK", - "Copyright", "TCOP", - "Composer", "TCOM", - "Genre", "TCON", - "Genre", "TCO", - "EncodedBy", "TENC", - "EncodedBy", "TEN", - "Language", "TLAN", - "Performer", "TPE3", - "Performer", "TP3", - "Publisher", "TPUB", - "Encoder", "TSSE", - "Disc", "TPOS", - NULL -}; - -#endif diff --git a/libeplayer3/include/manager.h b/libeplayer3/include/manager.h deleted file mode 100644 index bc6df0f..0000000 --- a/libeplayer3/include/manager.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef MANAGER_H_ -#define MANAGER_H_ - -#include -#include - -typedef enum -{ - MANAGER_ADD, - MANAGER_LIST, - MANAGER_GET, - MANAGER_GETNAME, - MANAGER_SET, - MANAGER_GETENCODING, - MANAGER_DEL, - MANAGER_GET_TRACK, - MANAGER_INIT_UPDATE -} ManagerCmd_t; - -typedef enum -{ - eTypeES, - eTypePES -} eTrackTypeEplayer; - -typedef struct Track_s -{ - char *Name; - char *Encoding; - int Id; - - /* new field for ffmpeg - add at the end so no problem - * can occur with not changed srt saa container - */ - char *language; - - /* length of track */ - long long int duration; - unsigned int frame_rate; - unsigned int TimeScale; - long long int pts; - - /* for later use: */ - eTrackTypeEplayer type; - int width; - int height; - - /* stream from ffmpeg */ - void *stream; - /* codec extra data (header or some other stuff) */ - void *extraData; - int extraSize; - - uint8_t *aacbuf; - unsigned int aacbuflen; - int have_aacheader; - - /* If player2 or the elf do not support decoding of audio codec set this. - * AVCodec is than used for softdecoding and stream will be injected as PCM */ - int inject_as_pcm; - - int pending; -} Track_t; - -struct Context_s; -typedef struct Context_s Context_t; - -typedef struct Manager_s -{ - char *Name; - int (* Command)(Context_t *, ManagerCmd_t, void *); - char **Capabilities; -} Manager_t; - -typedef struct ManagerHandler_s -{ - char *Name; - Manager_t *audio; - Manager_t *video; - Manager_t *subtitle; -} ManagerHandler_t; - -void freeTrack(Track_t *track); -void copyTrack(Track_t *to, Track_t *from); - -#endif diff --git a/libeplayer3/include/misc.h b/libeplayer3/include/misc.h deleted file mode 100644 index df43845..0000000 --- a/libeplayer3/include/misc.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef misc_123 -#define misc_123 - -#include - -/* some useful things needed by many files ... */ - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -typedef struct BitPacker_s -{ - unsigned char *Ptr; /* write pointer */ - unsigned int BitBuffer; /* bitreader shifter */ - int Remaining; /* number of remaining in the shifter */ -} BitPacker_t; - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ - -#define INVALID_PTS_VALUE 0x200000000ull - -/* subtitle hacks ->for file subtitles */ -#define TEXTSRTOFFSET 100 -#define TEXTSSAOFFSET 200 - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -void PutBits(BitPacker_t *ld, unsigned int code, unsigned int length); -void FlushBits(BitPacker_t *ld); - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ - -static inline char *getExtension(char *name) -{ - if (name) - { - char *ext = strrchr(name, '.'); - if (ext) - return ext + 1; - } - return NULL; -} - -/* the function returns the base name */ -static inline char *basename(char *name) -{ - int i = 0; - int pos = 0; - - while (name[i] != 0) - { - if (name[i] == '/') - pos = i; - i++; - } - if (name[pos] == '/') - pos++; - return name + pos; -} - -/* the function returns the directry name */ -static inline char *dirname(char *name) -{ - static char path[100]; - unsigned int i = 0; - int pos = 0; - - while ((name[i] != 0) && (i < sizeof(path))) - { - if (name[i] == '/') - pos = i; - path[i] = name[i]; - i++; - } - path[i] = 0; - path[pos] = 0; - return path; -} - -#endif diff --git a/libeplayer3/include/output.h b/libeplayer3/include/output.h deleted file mode 100644 index de7a633..0000000 --- a/libeplayer3/include/output.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef OUTPUT_H_ -#define OUTPUT_H_ - -#include -#include - -typedef enum -{ - OUTPUT_INIT, - OUTPUT_ADD, - OUTPUT_DEL, - OUTPUT_PLAY, - OUTPUT_STOP, - OUTPUT_PAUSE, - OUTPUT_OPEN, - OUTPUT_CLOSE, - OUTPUT_FLUSH, - OUTPUT_CONTINUE, - OUTPUT_FASTFORWARD, - OUTPUT_AVSYNC, - OUTPUT_CLEAR, - OUTPUT_PTS, - OUTPUT_SWITCH, - OUTPUT_SLOWMOTION, - OUTPUT_AUDIOMUTE, - OUTPUT_REVERSE, - OUTPUT_DISCONTINUITY_REVERSE, - /* fixme: e2 */ - OUTPUT_SUBTITLE_REGISTER_FUNCTION = 222, - OUTPUT_SUBTITLE_REGISTER_BUFFER = 223, - OUTPUT_GET_SUBTITLE_OUTPUT, - OUTPUT_SET_SUBTITLE_OUTPUT -} OutputCmd_t; - -typedef enum -{ - OUTPUT_TYPE_AUDIO, - OUTPUT_TYPE_VIDEO, -} OutputType_t; - -typedef struct -{ - unsigned char *data; - unsigned int len; - - unsigned char *extradata; - unsigned int extralen; - - unsigned long long int pts; - - float frameRate; - unsigned int timeScale; - - unsigned int width; - unsigned int height; - - OutputType_t type; -} AudioVideoOut_t; - -struct Context_s; -typedef struct Context_s Context_t; - -typedef struct Output_s -{ - char *Name; - int (* Command)(Context_t *, OutputCmd_t, void *); - int (* Write)(Context_t *, void *privateData); - char **Capabilities; -} Output_t; - -extern Output_t LinuxDvbOutput; -extern Output_t SubtitleOutput; - -typedef struct OutputHandler_s -{ - char *Name; - Output_t *audio; - Output_t *video; - Output_t *subtitle; - int (* Command)(Context_t *, OutputCmd_t, void *); -} OutputHandler_t; - -#endif diff --git a/libeplayer3/include/pcm.h b/libeplayer3/include/pcm.h deleted file mode 100644 index bf77a75..0000000 --- a/libeplayer3/include/pcm.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * pcm helper - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -#ifndef pcm_h_ -#define pcm_h_ - -typedef struct pcmPrivateData_s -{ - int uNoOfChannels; - int uSampleRate; - int uBitsPerSample; - int bLittleEndian; -} pcmPrivateData_t; -#endif diff --git a/libeplayer3/include/pes.h b/libeplayer3/include/pes.h deleted file mode 100644 index fc948a9..0000000 --- a/libeplayer3/include/pes.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef pes_123 -#define pes_123 - -#define PES_MAX_HEADER_SIZE 64 -#define PES_PRIVATE_DATA_FLAG 0x80 -#define PES_PRIVATE_DATA_LENGTH 8 -#define PES_LENGTH_BYTE_0 5 -#define PES_LENGTH_BYTE_1 4 -#define PES_FLAGS_BYTE 7 -#define PES_EXTENSION_DATA_PRESENT 0x01 -#define PES_HEADER_DATA_LENGTH_BYTE 8 -#define PES_START_CODE_RESERVED_4 0xfd -#define PES_VERSION_FAKE_START_CODE 0x31 - -#define MAX_PES_PACKET_SIZE (65535) - -/* start codes */ -#define PCM_PES_START_CODE 0xbd -#define PRIVATE_STREAM_1_PES_START_CODE 0xbd -#define H263_VIDEO_PES_START_CODE 0xfe -#define H264_VIDEO_PES_START_CODE 0xe2 -#define MPEG_VIDEO_PES_START_CODE 0xe0 -#define MPEG_AUDIO_PES_START_CODE 0xc0 -#define VC1_VIDEO_PES_START_CODE 0xfd -#define AAC_AUDIO_PES_START_CODE 0xcf - -int InsertPesHeader(unsigned char *data, unsigned int size, unsigned char stream_id, unsigned long long int pts, int pic_start_code); -int InsertVideoPrivateDataHeader(unsigned char *data, unsigned int payload_size); - -#endif diff --git a/libeplayer3/include/playback.h b/libeplayer3/include/playback.h deleted file mode 100644 index 0db5f5c..0000000 --- a/libeplayer3/include/playback.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef PLAYBACK_H_ -#define PLAYBACK_H_ -#include - -typedef enum {PLAYBACK_OPEN, PLAYBACK_CLOSE, PLAYBACK_PLAY, PLAYBACK_STOP, PLAYBACK_PAUSE, PLAYBACK_CONTINUE, PLAYBACK_TERM, PLAYBACK_FASTFORWARD, PLAYBACK_SEEK, PLAYBACK_SEEK_ABS, PLAYBACK_PTS, PLAYBACK_LENGTH, PLAYBACK_SWITCH_AUDIO, PLAYBACK_SWITCH_SUBTITLE, PLAYBACK_INFO, PLAYBACK_SLOWMOTION, PLAYBACK_FASTBACKWARD, PLAYBACK_SWITCH_TELETEXT, PLAYBACK_SWITCH_DVBSUBTITLE, PLAYBACK_FRAMEBUFFER_LOCK, PLAYBACK_FRAMEBUFFER_UNLOCK} PlaybackCmd_t; - -struct Context_s; -typedef struct Context_s Context_t; - -typedef struct PlaybackHandler_s -{ - char *Name; - - int fd; - - unsigned char isHttp; - unsigned char isPlaying; - unsigned char isPaused; - unsigned char isForwarding; - unsigned char isSeeking; - unsigned char isCreationPhase; - - float BackWard; - int SlowMotion; - int Speed; - int AVSync; - - unsigned char isVideo; - unsigned char isAudio; - unsigned char isSubtitle; - unsigned char abortRequested; - unsigned char abortPlayback; - - int (* Command)(Context_t *, PlaybackCmd_t, void *); - char *uri; - unsigned long long readCount; -} PlaybackHandler_t; - -void libeplayerThreadStop(); // Tell enigma2 that we stop - -#endif diff --git a/libeplayer3/include/stm_ioctls.h b/libeplayer3/include/stm_ioctls.h deleted file mode 100644 index 64906cd..0000000 --- a/libeplayer3/include/stm_ioctls.h +++ /dev/null @@ -1,331 +0,0 @@ -/* - * stm_ioctls.h - * - * Copyright (C) STMicroelectronics Limited 2005. All rights reserved. - * - * Extensions to the LinuxDVB API (v3) implemented by the Havana implemenation. - */ - -#ifndef H_STM_IOCTLS -#define H_STM_IOCTLS - -/* - * Whenever a sequence of values is extended (define or enum) always add the new values - * So that old values are unchange to maintain binary compatibility. - */ - -#define DVB_SPEED_NORMAL_PLAY 1000 -#define DVB_SPEED_STOPPED 0 -#define DVB_SPEED_REVERSE_STOPPED 0x80000000 -#define DVB_FRAME_RATE_MULTIPLIER 1000 - -#define VIDEO_FULL_SCREEN (VIDEO_CENTER_CUT_OUT+1) - -#define DMX_FILTER_BY_PRIORITY_LOW 0x00010000 /* These flags tell the transport pes filter whether to filter */ -#define DMX_FILTER_BY_PRIORITY_HIGH 0x00020000 /* using the ts priority bit and, if so, whether to filter on */ -#define DMX_FILTER_BY_PRIORITY_MASK 0x00030000 /* bit set or bit clear */ - -/* - * Extra events - */ - -#define VIDEO_EVENT_FIRST_FRAME_ON_DISPLAY 5 /*(VIDEO_EVENT_VSYNC+1)*/ -#define VIDEO_EVENT_FRAME_DECODED_LATE (VIDEO_EVENT_FIRST_FRAME_ON_DISPLAY+1) -#define VIDEO_EVENT_DATA_DELIVERED_LATE (VIDEO_EVENT_FRAME_DECODED_LATE+1) -#define VIDEO_EVENT_STREAM_UNPLAYABLE (VIDEO_EVENT_DATA_DELIVERED_LATE+1) -#define VIDEO_EVENT_TRICK_MODE_CHANGE (VIDEO_EVENT_STREAM_UNPLAYABLE+1) -#define VIDEO_EVENT_VSYNC_OFFSET_MEASURED (VIDEO_EVENT_TRICK_MODE_CHANGE+1) -#define VIDEO_EVENT_FATAL_ERROR (VIDEO_EVENT_VSYNC_OFFSET_MEASURED+1) -#define VIDEO_EVENT_OUTPUT_SIZE_CHANGED (VIDEO_EVENT_FATAL_ERROR+1) -#define VIDEO_EVENT_FATAL_HARDWARE_FAILURE (VIDEO_EVENT_OUTPUT_SIZE_CHANGED+1) - -/* - * List of possible container types - used to select demux.. If stream_source is VIDEO_SOURCE_DEMUX - * then default is TRANSPORT, if stream_source is VIDEO_SOURCE_MEMORY then default is PES - */ -typedef enum -{ - STREAM_TYPE_NONE, /* Deprecated */ - STREAM_TYPE_TRANSPORT,/* Use latest PTI driver so it can be Deprecated */ - STREAM_TYPE_PES, - STREAM_TYPE_ES, /* Deprecated */ - STREAM_TYPE_PROGRAM, /* Deprecated */ - STREAM_TYPE_SYSTEM, /* Deprecated */ - STREAM_TYPE_SPU, /* Deprecated */ - STREAM_TYPE_NAVI, /* Deprecated */ - STREAM_TYPE_CSS, /* Deprecated */ - STREAM_TYPE_AVI, /* Deprecated */ - STREAM_TYPE_MP3, /* Deprecated */ - STREAM_TYPE_H264, /* Deprecated */ - STREAM_TYPE_ASF, /* Needs work so it can be deprecated */ - STREAM_TYPE_MP4, /* Deprecated */ - STREAM_TYPE_RAW /* Deprecated */ -} stream_type_t; - -/* - * List of possible video encodings - used to select frame parser and codec. - */ -typedef enum -{ - VIDEO_ENCODING_AUTO, - VIDEO_ENCODING_MPEG1, - VIDEO_ENCODING_MPEG2, - VIDEO_ENCODING_MJPEG, - VIDEO_ENCODING_DIVX3, - VIDEO_ENCODING_DIVX4, - VIDEO_ENCODING_DIVX5, - VIDEO_ENCODING_MPEG4P2, - VIDEO_ENCODING_H264, - VIDEO_ENCODING_WMV, - VIDEO_ENCODING_VC1, - VIDEO_ENCODING_RAW, - VIDEO_ENCODING_H263, - VIDEO_ENCODING_FLV1, - VIDEO_ENCODING_VP6, - VIDEO_ENCODING_RMV, - VIDEO_ENCODING_DIVXHD, - VIDEO_ENCODING_AVS, - VIDEO_ENCODING_VP3, - VIDEO_ENCODING_THEORA, - VIDEO_ENCODING_COMPOCAP, - VIDEO_ENCODING_NONE, - VIDEO_ENCODING_PRIVATE -} video_encoding_t; - -/* - * List of possible audio encodings - used to select frame parser and codec. - */ -typedef enum -{ - AUDIO_ENCODING_AUTO, - AUDIO_ENCODING_PCM, - AUDIO_ENCODING_LPCM, - AUDIO_ENCODING_MPEG1, - AUDIO_ENCODING_MPEG2, - AUDIO_ENCODING_MP3, - AUDIO_ENCODING_AC3, - AUDIO_ENCODING_DTS, - AUDIO_ENCODING_AAC, - AUDIO_ENCODING_WMA, - AUDIO_ENCODING_RAW, - AUDIO_ENCODING_LPCMA, - AUDIO_ENCODING_LPCMH, - AUDIO_ENCODING_LPCMB, - AUDIO_ENCODING_SPDIF, /* 5) && (text[x - 1] == ',')) //It seems that this is already ass block, text starts here - { - pos = 0; - comma = 32; - } - } - } - } - buf[pos++] = '\0'; - len = 80 + strlen(buf); - long long int end_pts = pts + (duration * 1000.0); - char *line = (char *)malloc(sizeof(char) * len); - int sc = pts / 10; - int ec = end_pts / 10; - int sh, sm, ss, eh, em, es; - sh = sc / 360000; - sc -= 360000 * sh; - sm = sc / 6000; - sc -= 6000 * sm; - ss = sc / 100; - sc -= 100 * ss; - eh = ec / 360000; - ec -= 360000 * eh; - em = ec / 6000; - ec -= 6000 * em; - es = ec / 100; - ec -= 100 * es; - snprintf(line, len, "Dialogue: Marked=0,%d:%02d:%02d.%02d,%d:%02d:%02d.%02d,Default,NTP,0000,0000,0000,!Effect,%s\n", - sh, sm, ss, sc, eh, em, es, ec, buf); - return (unsigned char *)line; -} - -typedef enum -{ - eSub_Gfx, - eSub_Txt -} SubType_t; - -typedef struct -{ - unsigned char *data; - int len; -} SubText_t; - -typedef struct -{ - unsigned char *data; - unsigned int Width; - unsigned int Height; - unsigned int Stride; - unsigned int x; - unsigned int y; - unsigned int color; -} SubGfx_t; - -typedef struct -{ - SubType_t type; - long long int pts; - float duration; - - union - { - SubText_t text; - SubGfx_t gfx; - } u; -} SubtitleOut_t; - -typedef struct -{ - unsigned char *data; - int len; - - unsigned char *extradata; - int extralen; - - long long int pts; - float duration; -} SubtitleData_t; - -typedef struct -{ - unsigned char *destination; - unsigned int screen_width; - unsigned int screen_height; - unsigned int destStride; - - void (*framebufferBlit)(); - int shareFramebuffer; - int framebufferFD; -} SubtitleOutputDef_t; - -#endif diff --git a/libeplayer3/include/writer.h b/libeplayer3/include/writer.h deleted file mode 100644 index c9fb20f..0000000 --- a/libeplayer3/include/writer.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef WRITER_H_ -#define WRITER_H_ - -#include -#include - -typedef enum { eNone, eAudio, eVideo, eGfx} eWriterType_t; - -typedef struct -{ - int fd; - unsigned char *data; - unsigned int len; - unsigned long long int Pts; - unsigned char *private_data; - unsigned int private_size; - unsigned int FrameRate; - unsigned int FrameScale; - unsigned int Width; - unsigned int Height; - unsigned char Version; -} WriterAVCallData_t; - -typedef struct -{ - unsigned char *data; - unsigned int Width; - unsigned int Height; - unsigned int Stride; - unsigned int color; - - unsigned int x; /* dst x ->given by ass */ - unsigned int y; /* dst y ->given by ass */ - - /* destination values if we use a shared framebuffer */ - int fd; - unsigned int Screen_Width; - unsigned int Screen_Height; - unsigned char *destination; - unsigned int destStride; -} WriterFBCallData_t; - -typedef struct WriterCaps_s -{ - char *name; - eWriterType_t type; - char *textEncoding; - /* fixme: revise if this is an enum! */ - int dvbEncoding; -} WriterCaps_t; - -typedef struct Writer_s -{ - int (* reset)(); - int (* writeData)(void *); - WriterCaps_t *caps; -} Writer_t; - -extern Writer_t WriterAudioIPCM; -extern Writer_t WriterAudioPCM; -extern Writer_t WriterAudioMP3; -extern Writer_t WriterAudioMPEGL3; -extern Writer_t WriterAudioAC3; -extern Writer_t WriterAudioAAC; -extern Writer_t WriterAudioDTS; -extern Writer_t WriterAudioFLAC; -extern Writer_t WriterAudioVORBIS; - -extern Writer_t WriterVideoMPEG2; -extern Writer_t WriterVideoMPEGH264; -extern Writer_t WriterVideoH264; -extern Writer_t WriterVideoWMV; -extern Writer_t WriterVideoDIVX; -extern Writer_t WriterVideoFOURCC; -extern Writer_t WriterVideoMSCOMP; -extern Writer_t WriterVideoH263; -extern Writer_t WriterVideoFLV; -extern Writer_t WriterVideoVC1; -extern Writer_t WriterFramebuffer; -extern Writer_t WriterPipe; -extern Writer_t WriterDVBSubtitle; - -Writer_t *getWriter(char *encoding); - -Writer_t *getDefaultVideoWriter(); -Writer_t *getDefaultAudioWriter(); -Writer_t *getDefaultFramebufferWriter(); - -#endif diff --git a/libeplayer3/manager/manager.c b/libeplayer3/manager/manager.c deleted file mode 100644 index 555134f..0000000 --- a/libeplayer3/manager/manager.c +++ /dev/null @@ -1,368 +0,0 @@ -/* - * generic manager handling. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include - -#include -#include "manager.h" -#include "common.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ -#define TRACKWRAP 50 - -#define MGR_DEBUG -#ifdef MGR_DEBUG - -static short debug_level = 0; - -#define mgr_printf(level, x...) do { \ - if (debug_level >= level) printf(x); } while (0) -#else -#define mgr_printf(level, x...) -#endif - -#ifndef MGR_SILENT -#define mgr_err(x...) do { printf(x); } while (0) -#else -#define mgr_err(x...) -#endif - -/* Error Constants */ -#define cERR_MGR_NO_ERROR (0) -#define cERR_MGR_ERROR (-1) - -static const char FILENAME[] = __FILE__; - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -/* ***************************** */ -/* Variables */ -/* ***************************** */ - -enum TrackType -{ - TRACK_TYPE_AUDIO, - TRACK_TYPE_VIDEO, - TRACK_TYPE_SUBTITLE, - TRACK_TYPE_MAX -}; - -struct TracksInfo -{ - Track_t *Tracks; - int Count; - int Current; - enum TrackType Type; -}; - -static int initialized = 0; - -static struct TracksInfo tracksInfo[TRACK_TYPE_MAX]; - -static void Initialize() -{ - int i, j; - for (i = 0; i < TRACK_TYPE_MAX; ++i) - { - tracksInfo[i].Type = (enum TrackType)i; - tracksInfo[i].Current = (TRACK_TYPE_AUDIO == i || TRACK_TYPE_VIDEO == i) ? 0 : -1; - tracksInfo[i].Count = 0; - tracksInfo[i].Tracks = malloc(sizeof(Track_t) * TRACKWRAP); - if (NULL == tracksInfo[i].Tracks) - { - mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__); - initialized = -1; - return; - } - for (j = 0; j < TRACKWRAP; ++j) tracksInfo[i].Tracks[j].Id = -1; - } - initialized = 1; -} - -void copyTrack(Track_t *to, Track_t *from) -{ - *to = *from; - to->Name = (from->Name != NULL) ? strdup(from->Name) : strdup("Unknown"); - to->Encoding = (from->Encoding != NULL) ? strdup(from->Encoding) : strdup("Unknown"); - to->language = (from->language != NULL) ? strdup(from->language) : strdup("Unknown"); -} - -void freeTrack(Track_t *track) -{ - if (track->Name != NULL) - { - free(track->Name); - track->Name = NULL; - } - if (track->Encoding != NULL) - { - free(track->Encoding); - track->Encoding = NULL; - } - if (track->language != NULL) - { - free(track->language); - track->language = NULL; - } - if (track->aacbuf != NULL) - free(track->aacbuf); - track->aacbuf = NULL; -} - -static int ManagerAdd(struct TracksInfo *t, Context_t *context, Track_t track) -{ - int i; - mgr_printf(10, "%s::%s name=\"%s\" encoding=\"%s\" id=%d\n", FILENAME, __FUNCTION__, track.Name, track.Encoding, track.Id); - for (i = 0; i < t->Count; i++) - { - if (t->Tracks[i].Id == track.Id) - return cERR_MGR_NO_ERROR; - } - if (t->Count < TRACKWRAP) - { - copyTrack(&(t->Tracks[t->Count]), &track); - t->Count++; - } - else - { - mgr_err("%s:%s TrackCount out if range %d - %d\n", FILENAME, __FUNCTION__, t->Count, TRACKWRAP); - return cERR_MGR_ERROR; - } - if (t->Count > 0) - { - switch (t->Type) - { - case TRACK_TYPE_AUDIO: - context->playback->isAudio = 1; - break; - case TRACK_TYPE_VIDEO: - context->playback->isVideo = 1; - break; - case TRACK_TYPE_SUBTITLE: - context->playback->isSubtitle = 1; - break; - default: - break; - } - } - mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); - return cERR_MGR_NO_ERROR; -} - -static char **ManagerList(struct TracksInfo *t, Context_t *context) -{ - int i, j; - char **tracklist = NULL; - mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); - if (t->Count > 0) - { - tracklist = malloc(sizeof(char *) * ((t->Count * 2) + 1)); - if (tracklist == NULL) - { - mgr_err("%s:%s malloc failed\n", FILENAME, __FUNCTION__); - return NULL; - } - for (i = 0, j = 0; i < t->Count; i++) - { - tracklist[j++] = strdup(t->Tracks[i].Name); - tracklist[j++] = strdup(t->Tracks[i].Encoding); - } - tracklist[j] = NULL; - } - mgr_printf(10, "%s::%s return %p (%d - %d)\n", FILENAME, __FUNCTION__, tracklist, j, t->Count); - return tracklist; -} - -static int ManagerDel(struct TracksInfo *t, Context_t *context) -{ - int i = 0; - mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); - if (t->Tracks != NULL) - { - for (i = 0; i < t->Count; i++) - { - freeTrack(&(t->Tracks[i])); - } - } - else - { - mgr_err("%s::%s nothing to delete!\n", FILENAME, __FUNCTION__); - return cERR_MGR_ERROR; - } - t->Count = 0; - switch (t->Type) - { - case TRACK_TYPE_AUDIO: - context->playback->isAudio = 0; - break; - case TRACK_TYPE_VIDEO: - context->playback->isVideo = 0; - break; - case TRACK_TYPE_SUBTITLE: - context->playback->isSubtitle = 0; - break; - default: - break; - } - t->Current = (TRACK_TYPE_AUDIO == t->Type || TRACK_TYPE_VIDEO == t->Type) ? 0 : -1; - mgr_printf(10, "%s::%s return no error\n", FILENAME, __FUNCTION__); - return cERR_MGR_NO_ERROR; -} - -static int Command(struct TracksInfo *t, Context_t *context, ManagerCmd_t command, void *argument) -{ - int ret = cERR_MGR_NO_ERROR; - if (initialized == 0) - { - Initialize(); - } - if (initialized == -1) return cERR_MGR_ERROR; - mgr_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); - switch (command) - { - case MANAGER_ADD: - { - Track_t *track = argument; - ret = ManagerAdd(t, context, *track); - break; - } - case MANAGER_LIST: - { - *((char ** *)argument) = ManagerList(t, context); - break; - } - case MANAGER_GET: - { - mgr_printf(20, "%s::%s MANAGER_GET\n", FILENAME, __FUNCTION__); - if (t->Count > 0 && t->Current >= 0) - *((int *)argument) = (int)t->Tracks[t->Current].Id; - else - *((int *)argument) = (int) - 1; - break; - } - case MANAGER_GET_TRACK: - { - mgr_printf(20, "%s::%s MANAGER_GET_TRACK\n", FILENAME, __FUNCTION__); - if (t->Count > 0 && t->Current >= 0) - *((Track_t **)argument) = (Track_t *) &t->Tracks[t->Current]; - else - *((Track_t **)argument) = NULL; - break; - } - case MANAGER_GETENCODING: - { - if (t->Count > 0 && t->Current >= 0) - // track encoding points to a static string, so no need to strdup() - *((char **)argument) = (char *)t->Tracks[t->Current].Encoding; - else - *((char **)argument) = NULL ; - break; - } - case MANAGER_GETNAME: - { - if (t->Count > 0 && t->Current >= 0) - *((char **)argument) = (char *)t->Tracks[t->Current].Name; - else - *((char **)argument) = (char *)""; - break; - } - case MANAGER_SET: - { - int id = *((int *)argument); - mgr_printf(20, "%s::%s MANAGER_SET id=%d\n", FILENAME, __FUNCTION__, id); - if (id < t->Count) - t->Current = id; - else - { - mgr_err("%s::%s track id out of range (%d - %d)\n", FILENAME, __FUNCTION__, id, t->Count); - ret = cERR_MGR_ERROR; - } - break; - } - case MANAGER_DEL: - { - ret = ManagerDel(t, context); - break; - } - case MANAGER_INIT_UPDATE: - { - t->Count = 0; - break; - } - default: - mgr_err("%s::%s ContainerCmd %d not supported!\n", FILENAME, __FUNCTION__, command); - ret = cERR_MGR_ERROR; - break; - } - mgr_printf(10, "%s:%s: returning %d\n", FILENAME, __FUNCTION__, ret); - return ret; -} - -static int Command_audio(Context_t *context, ManagerCmd_t command, void *argument) -{ - return Command(&tracksInfo[TRACK_TYPE_AUDIO], context, command, argument); -} - -static int Command_video(Context_t *context, ManagerCmd_t command, void *argument) -{ - return Command(&tracksInfo[TRACK_TYPE_VIDEO], context, command, argument); -} - -static int Command_subtitle(Context_t *context, ManagerCmd_t command, void *argument) -{ - return Command(&tracksInfo[TRACK_TYPE_SUBTITLE], context, command, argument); -} - -struct Manager_s AudioManager = -{ - "Audio", - &Command_audio, - NULL -}; - -struct Manager_s VideoManager = -{ - "Video", - &Command_video, - NULL -}; - -struct Manager_s SubtitleManager = -{ - "Subtitle", - &Command_subtitle, - NULL -}; - -ManagerHandler_t ManagerHandler = -{ - "ManagerHandler", - &AudioManager, - &VideoManager, - &SubtitleManager -}; diff --git a/libeplayer3/output/linuxdvb.c b/libeplayer3/output/linuxdvb.c deleted file mode 100644 index 413a27d..0000000 --- a/libeplayer3/output/linuxdvb.c +++ /dev/null @@ -1,1011 +0,0 @@ -/* - * LinuxDVB Output handling. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" -#include "writer.h" -#include "misc.h" -#include "pes.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ - -#define LINUXDVB_DEBUG - -static short debug_level = 0; - -static const char FILENAME[] = __FILE__; - -#ifdef LINUXDVB_DEBUG -#define linuxdvb_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x ); } while (0) -#else -#define linuxdvb_printf(x...) -#endif - -#ifndef LINUXDVB_SILENT -#define linuxdvb_err(fmt, x...) do { printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define linuxdvb_err(x...) -#endif - -#define cERR_LINUXDVB_NO_ERROR 0 -#define cERR_LINUXDVB_ERROR -1 - -static const char VIDEODEV[] = "/dev/dvb/adapter0/video0"; -static const char AUDIODEV[] = "/dev/dvb/adapter0/audio0"; - -static int videofd = -1; -static int audiofd = -1; - -unsigned long long int sCURRENT_PTS = 0; - -pthread_mutex_t LinuxDVBmutex; - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ -int LinuxDvbStop(Context_t *context, char *type); - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ - -void getLinuxDVBMutex(const char *filename __attribute__((unused)), const char *function __attribute__((unused)), int line __attribute__((unused))) -{ - linuxdvb_printf(250, "requesting mutex\n"); - pthread_mutex_lock(&LinuxDVBmutex); - linuxdvb_printf(250, "received mutex\n"); -} - -void releaseLinuxDVBMutex(const char *filename __attribute__((unused)), const char *function __attribute__((unused)), int line __attribute__((unused))) -{ - pthread_mutex_unlock(&LinuxDVBmutex); - linuxdvb_printf(250, "released mutex\n"); -} - -int LinuxDvbOpen(Context_t *context __attribute__((unused)), char *type) -{ - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - linuxdvb_printf(10, "v%d a%d\n", video, audio); - if (video && videofd < 0) - { - videofd = open(VIDEODEV, O_RDWR); - if (videofd < 0) - { - linuxdvb_err("failed to open %s - errno %d\n", VIDEODEV, errno); - linuxdvb_err("%s\n", strerror(errno)); - return cERR_LINUXDVB_ERROR; - } - if (ioctl(videofd, VIDEO_CLEAR_BUFFER) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_CLEAR_BUFFER: %s\n", strerror(errno)); - } - if (ioctl(videofd, VIDEO_SELECT_SOURCE, (void *)VIDEO_SOURCE_MEMORY) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_SELECT_SOURCE: %s\n", strerror(errno)); - } - if (ioctl(videofd, VIDEO_SET_STREAMTYPE, (void *)STREAM_TYPE_PROGRAM) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_SET_STREAMTYPE: %s\n", strerror(errno)); - } - if (ioctl(videofd, VIDEO_SET_SPEED, DVB_SPEED_NORMAL_PLAY) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_SET_SPEED: %s\n", strerror(errno)); - } - } - if (audio && audiofd < 0) - { - audiofd = open(AUDIODEV, O_RDWR); - if (audiofd < 0) - { - linuxdvb_err("failed to open %s - errno %d\n", AUDIODEV, errno); - linuxdvb_err("%s\n", strerror(errno)); - if (videofd < 0) - close(videofd); - return cERR_LINUXDVB_ERROR; - } - if (ioctl(audiofd, AUDIO_CLEAR_BUFFER) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_CLEAR_BUFFER: %s\n", strerror(errno)); - } - if (ioctl(audiofd, AUDIO_SELECT_SOURCE, (void *)AUDIO_SOURCE_MEMORY) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_SELECT_SOURCE: %s\n", strerror(errno)); - } - if (ioctl(audiofd, AUDIO_SET_STREAMTYPE, (void *)STREAM_TYPE_PROGRAM) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_SET_STREAMTYPE: %s\n", strerror(errno)); - } - } - return cERR_LINUXDVB_NO_ERROR; -} - -int LinuxDvbClose(Context_t *context, char *type) -{ - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - linuxdvb_printf(10, "v%d a%d\n", video, audio); - /* closing stand alone is not allowed, so prevent - * user from closing and dont call stop. stop will - * set default values for us (speed and so on). - */ - LinuxDvbStop(context, type); - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - if (video && videofd != -1) - { - close(videofd); - videofd = -1; - } - if (audio && audiofd != -1) - { - close(audiofd); - audiofd = -1; - } - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - return cERR_LINUXDVB_NO_ERROR; -} - -int LinuxDvbPlay(Context_t *context, char *type) -{ - int ret = cERR_LINUXDVB_NO_ERROR; - Writer_t *writer = NULL; - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - - linuxdvb_printf(10, "v%d a%d\n", video, audio); - if (video && videofd != -1) - { - char *Encoding = NULL; - context->manager->video->Command(context, MANAGER_GETENCODING, &Encoding); - linuxdvb_printf(10, "V %s\n", Encoding); - if (Encoding != NULL) - writer = getWriter(Encoding); - if (writer == NULL) - { - linuxdvb_err("cannot found writer for encoding %s using default\n", Encoding); - if (ioctl(videofd, VIDEO_SET_ENCODING, (void *) VIDEO_ENCODING_AUTO) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_SET_ENCODING: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - } - else - { - linuxdvb_printf(20, "found writer %s for encoding %s\n", writer->caps->name, Encoding); - if (ioctl(videofd, VIDEO_SET_ENCODING, (void *) writer->caps->dvbEncoding) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_SET_ENCODING: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - } - if (ioctl(videofd, VIDEO_PLAY, NULL) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_PLAY: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - } - if (audio && audiofd != -1) - { - char *Encoding = NULL; - context->manager->audio->Command(context, MANAGER_GETENCODING, &Encoding); - linuxdvb_printf(20, "0 A %s\n", Encoding); - if (Encoding != NULL) - writer = getWriter(Encoding); - if (writer == NULL) - { - linuxdvb_err("cannot found writer for encoding %s using default\n", Encoding); - if (ioctl(audiofd, AUDIO_SET_ENCODING, (void *)AUDIO_ENCODING_MP3) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_SET_ENCODING: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - } - else - { - linuxdvb_printf(20, "found writer %s for encoding %s\n", writer->caps->name, Encoding); - if (ioctl(audiofd, AUDIO_SET_ENCODING, (void *) writer->caps->dvbEncoding) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_SET_ENCODING: %s\n", strerror(errno)); - ret = -1; - } - } - if (ioctl(audiofd, AUDIO_PLAY, NULL) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_PLAY: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - } - return ret; -} - -int LinuxDvbStop(Context_t *context __attribute__((unused)), char *type) -{ - int ret = cERR_LINUXDVB_NO_ERROR; - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - - linuxdvb_printf(10, "v%d a%d\n", video, audio); - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - if (video && videofd != -1) - { - if (ioctl(videofd, VIDEO_CLEAR_BUFFER) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_CLEAR_BUFFER: %s\n", strerror(errno)); - } - /* set back to normal speed (end trickmodes) */ - if (ioctl(videofd, VIDEO_SET_SPEED, DVB_SPEED_NORMAL_PLAY) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_SET_SPEED: %s\n", strerror(errno)); - } - if (ioctl(videofd, VIDEO_STOP, NULL) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_STOP: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - } - if (audio && audiofd != -1) - { - if (ioctl(audiofd, AUDIO_CLEAR_BUFFER) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_CLEAR_BUFFER: %s\n", strerror(errno)); - } - /* set back to normal speed (end trickmodes) */ - if (ioctl(audiofd, AUDIO_SET_SPEED, DVB_SPEED_NORMAL_PLAY) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_SET_SPEED: %s\n", strerror(errno)); - } - if (ioctl(audiofd, AUDIO_STOP, NULL) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_STOP: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - } - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - return ret; -} - -int LinuxDvbPause(Context_t *context __attribute__((unused)), char *type) -{ - int ret = cERR_LINUXDVB_NO_ERROR; - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - - linuxdvb_printf(10, "v%d a%d\n", video, audio); - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - if (video && videofd != -1) - { - if (ioctl(videofd, VIDEO_FREEZE, NULL) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_FREEZE: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - } - if (audio && audiofd != -1) - { - if (ioctl(audiofd, AUDIO_PAUSE, NULL) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_PAUSE: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - } - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - return ret; -} - -int LinuxDvbContinue(Context_t *context __attribute__((unused)), char *type) -{ - int ret = cERR_LINUXDVB_NO_ERROR; - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - linuxdvb_printf(10, "v%d a%d\n", video, audio); - if (video && videofd != -1) - { - if (ioctl(videofd, VIDEO_CONTINUE, NULL) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_CONTINUE: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - } - if (audio && audiofd != -1) - { - if (ioctl(audiofd, AUDIO_CONTINUE, NULL) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_CONTINUE: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - } - linuxdvb_printf(10, "exiting\n"); - return ret; -} - -int LinuxDvbReverseDiscontinuity(Context_t *context __attribute__((unused)), int *surplus) -{ - int ret = cERR_LINUXDVB_NO_ERROR; - int dis_type = VIDEO_DISCONTINUITY_CONTINUOUS_REVERSE | *surplus; - linuxdvb_printf(50, "\n"); - if (ioctl(videofd, VIDEO_DISCONTINUITY, (void *) dis_type) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_DISCONTINUITY: %s\n", strerror(errno)); - } - linuxdvb_printf(50, "exiting\n"); - return ret; -} - -int LinuxDvbAudioMute(Context_t *context __attribute__((unused)), char *flag) -{ - int ret = cERR_LINUXDVB_NO_ERROR; - linuxdvb_printf(10, "\n"); - if (audiofd != -1) - { - if (*flag == '1') - { - //AUDIO_SET_MUTE has no effect with new player - //if (ioctl(audiofd, AUDIO_SET_MUTE, 1) == -1) - if (ioctl(audiofd, AUDIO_STOP, NULL) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - //linuxdvb_err("AUDIO_SET_MUTE: %s\n", strerror(errno)); - linuxdvb_err("AUDIO_STOP: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - } - else - { - //AUDIO_SET_MUTE has no effect with new player - //if (ioctl(audiofd, AUDIO_SET_MUTE, 0) == -1) - if (ioctl(audiofd, AUDIO_PLAY, NULL) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - //linuxdvb_err("AUDIO_SET_MUTE: %s\n", strerror(errno)); - linuxdvb_err("AUDIO_PLAY: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - } - } - linuxdvb_printf(10, "exiting\n"); - return ret; -} - -int LinuxDvbFlush(Context_t *context __attribute__((unused)), char *type) -{ - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - linuxdvb_printf(10, "v%d a%d\n", video, audio); - if ((video && videofd != -1) || (audio && audiofd != -1)) - { - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - if (video && videofd != -1) - { - if (ioctl(videofd, VIDEO_FLUSH, NULL) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_FLUSH: %s\n", strerror(errno)); - } - } - if (audio && audiofd != -1) - { - if (ioctl(audiofd, AUDIO_FLUSH, NULL) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_FLUSH: %s\n", strerror(errno)); - } - } - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - } - linuxdvb_printf(10, "exiting\n"); - return cERR_LINUXDVB_NO_ERROR; -} - -#ifndef use_set_speed_instead_ff -int LinuxDvbFastForward(Context_t *context, char *type) -{ - int ret = cERR_LINUXDVB_NO_ERROR; - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - linuxdvb_printf(10, "v%d a%d speed %d\n", video, audio, context->playback->Speed); - if (video && videofd != -1) - { - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - /* konfetti comment: speed is a value given in skipped frames */ - if (ioctl(videofd, VIDEO_FAST_FORWARD, context->playback->Speed) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_FAST_FORWARD: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - } - linuxdvb_printf(10, "exiting with value %d\n", ret); - return ret; -} -#else - -static unsigned int SpeedList[] = -{ - 1000, 1100, 1200, 1300, 1500, - 2000, 3000, 4000, 5000, 8000, - 12000, 16000, - 125, 250, 500, 700, 800, 900 -}; - -int LinuxDvbFastForward(Context_t *context, char *type) -{ - int ret = cERR_LINUXDVB_NO_ERROR; - int speedIndex; - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - linuxdvb_printf(10, "v%d a%d\n", video, audio); - - if (video && videofd != -1) - { - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - speedIndex = context->playback->Speed % (sizeof(SpeedList) / sizeof(int)); - linuxdvb_printf(1, "speedIndex %d\n", speedIndex); - if (ioctl(videofd, VIDEO_SET_SPEED, SpeedList[speedIndex]) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_SET_SPEED: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - } - if (audio && audiofd != -1) - { - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - speedIndex = context->playback->Speed % (sizeof(SpeedList) / sizeof(int)); - linuxdvb_printf(1, "speedIndex %d\n", speedIndex); - if (ioctl(audiofd, AUDIO_SET_SPEED, SpeedList[speedIndex]) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_SET_SPEED: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - } - linuxdvb_printf(10, "exiting with value %d\n", ret); - return ret; -} -#endif - -int LinuxDvbReverse(Context_t *context __attribute__((unused)), char *type __attribute__((unused))) -{ - int ret = cERR_LINUXDVB_NO_ERROR; - return ret; -} - -int LinuxDvbSlowMotion(Context_t *context, char *type) -{ - int ret = cERR_LINUXDVB_NO_ERROR; - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - linuxdvb_printf(10, "v%d a%d\n", video, audio); - if ((video && videofd != -1) || (audio && audiofd != -1)) - { - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - if (video && videofd != -1) - { - if (ioctl(videofd, VIDEO_SLOWMOTION, context->playback->SlowMotion) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_SLOWMOTION: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - } - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - } - linuxdvb_printf(10, "exiting with value %d\n", ret); - return ret; -} - -int LinuxDvbAVSync(Context_t *context, char *type __attribute__((unused))) -{ - int ret = cERR_LINUXDVB_NO_ERROR; - /* konfetti: this one is dedicated to audiofd so we - * are ignoring what is given by type! I think we should - * remove this param. Therefor we should add a variable - * setOn or something like that instead, this would remove - * using a variable inside the structure. - */ - if (audiofd != -1) - { - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - if (ioctl(audiofd, AUDIO_SET_AV_SYNC, context->playback->AVSync) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_SET_AV_SYNC: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - } - return ret; -} - -int LinuxDvbClear(Context_t *context __attribute__((unused)), char *type) -{ - int ret = cERR_LINUXDVB_NO_ERROR; - unsigned char video = !strcmp("video", type); - unsigned char audio = !strcmp("audio", type); - linuxdvb_printf(10, "v%d a%d\n", video, audio); - if ((video && videofd != -1) || (audio && audiofd != -1)) - { - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - if (video && videofd != -1) - { - if (ioctl(videofd, VIDEO_CLEAR_BUFFER) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_CLEAR_BUFFER: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - } - if (audio && audiofd != -1) - { - if (ioctl(audiofd, AUDIO_CLEAR_BUFFER) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_CLEAR_BUFFER: %s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - } - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - } - linuxdvb_printf(10, "exiting\n"); - return ret; -} - -int LinuxDvbPts(Context_t *context __attribute__((unused)), unsigned long long int *pts) -{ - int ret = cERR_LINUXDVB_ERROR; - linuxdvb_printf(50, "\n"); - if (videofd > -1 && !ioctl(videofd, VIDEO_GET_PTS, (void *)&sCURRENT_PTS)) - { - ret = cERR_LINUXDVB_NO_ERROR; - } - else - { - linuxdvb_err("VIDEO_GET_PTS: %d (%s)\n", errno, strerror(errno)); - if (audiofd > -1 && !ioctl(audiofd, AUDIO_GET_PTS, (void *)&sCURRENT_PTS)) - { - ret = cERR_LINUXDVB_NO_ERROR; - } - else - { - linuxdvb_err("AUDIO_GET_PTS: %d (%s)\n", errno, strerror(errno)); - sCURRENT_PTS = 0; - } - } - *((unsigned long long int *)pts) = (unsigned long long int)sCURRENT_PTS; - return ret; -} - -int LinuxDvbSwitch(Context_t *context, char *type) -{ - unsigned char audio = !strcmp("audio", type); - unsigned char video = !strcmp("video", type); - Writer_t *writer = NULL; - linuxdvb_printf(10, "v%d a%d\n", video, audio); - if ((video && videofd != -1) || (audio && audiofd != -1)) - { - getLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - if (audio && audiofd != -1) - { - char *Encoding = NULL; - if (context && context->manager && context->manager->audio) - { - context->manager->audio->Command(context, MANAGER_GETENCODING, &Encoding); - linuxdvb_printf(10, "A %s\n", Encoding); - if (Encoding != NULL) - writer = getWriter(Encoding); - if (ioctl(audiofd, AUDIO_STOP , NULL) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_STOP: %s\n", strerror(errno)); - } - if (ioctl(audiofd, AUDIO_CLEAR_BUFFER) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_CLEAR_BUFFER: %s\n", strerror(errno)); - } - if (writer == NULL) - { - linuxdvb_err("cannot found writer for encoding %s using default\n", Encoding); - if (ioctl(audiofd, AUDIO_SET_ENCODING, (void *) AUDIO_ENCODING_MP3) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_SET_ENCODING: %s\n", strerror(errno)); - } - } - else - { - linuxdvb_printf(10, "found writer %s for encoding %s\n", writer->caps->name, Encoding); - if (ioctl(audiofd, AUDIO_SET_ENCODING, (void *) writer->caps->dvbEncoding) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_SET_ENCODING: %s\n", strerror(errno)); - } - } - if (ioctl(audiofd, AUDIO_PLAY, NULL) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("AUDIO_PLAY: %s\n", strerror(errno)); - } - } - else - linuxdvb_printf(20, "no context for Audio\n"); - } - if (video && videofd != -1) - { - char *Encoding = NULL; - if (context && context->manager && context->manager->video) - { - context->manager->video->Command(context, MANAGER_GETENCODING, &Encoding); - if (ioctl(videofd, VIDEO_STOP , NULL) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_STOP: %s\n", strerror(errno)); - } - if (ioctl(videofd, VIDEO_CLEAR_BUFFER) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_CLEAR_BUFFER: %s\n", strerror(errno)); - } - linuxdvb_printf(10, "V %s\n", Encoding); - if (Encoding != NULL) - writer = getWriter(Encoding); - if (writer == NULL) - { - linuxdvb_err("cannot found writer for encoding %s using default\n", Encoding); - if (ioctl(videofd, VIDEO_SET_ENCODING, (void *) VIDEO_ENCODING_AUTO) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_SET_ENCODING: %s\n", strerror(errno)); - } - } - else - { - linuxdvb_printf(10, "found writer %s for encoding %s\n", writer->caps->name, Encoding); - if (ioctl(videofd, VIDEO_SET_ENCODING, (void *) writer->caps->dvbEncoding) == -1) - { - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_SET_ENCODING: %s\n", strerror(errno)); - } - } - if (ioctl(videofd, VIDEO_PLAY, NULL) == -1) - { - /* konfetti: fixme: think on this, I think we should - * return an error here and stop the playback mode - */ - linuxdvb_err("ioctl failed with errno %d\n", errno); - linuxdvb_err("VIDEO_PLAY: %s\n", strerror(errno)); - } - } - else - linuxdvb_printf(20, "no context for Video\n"); - } - releaseLinuxDVBMutex(FILENAME, __FUNCTION__, __LINE__); - } - linuxdvb_printf(10, "exiting\n"); - return cERR_LINUXDVB_NO_ERROR; -} - -static char *videoEncoding = NULL; -static char *audioEncoding = NULL; -static Writer_t *videoWriter = NULL; -static Writer_t *audioWriter = NULL; - -static int Write(Context_t *context, void *_out) -{ - AudioVideoOut_t *out = (AudioVideoOut_t *) _out; - int ret = cERR_LINUXDVB_NO_ERROR; - int res = 0; - WriterAVCallData_t call; - - if (out == NULL) - { - linuxdvb_err("null pointer passed\n"); - return cERR_LINUXDVB_ERROR; - } - linuxdvb_printf(20, "DataLength=%u PrivateLength=%u Pts=%llu FrameRate=%f\n", - out->len, out->extralen, out->pts, out->frameRate); - linuxdvb_printf(20, "type: %d [0 - audio, 1- video]\n", out->type); - if (OUTPUT_TYPE_VIDEO == out->type) - { - char *Encoding = NULL; - context->manager->video->Command(context, MANAGER_GETENCODING, &Encoding); - linuxdvb_printf(20, "Encoding = %s\n", Encoding); - if (videoEncoding != Encoding) - { - videoEncoding = Encoding; - videoWriter = getWriter(Encoding); - } - if (videoWriter == NULL) - { - linuxdvb_printf(20, "searching default writer ... %s\n", Encoding); - videoWriter = getDefaultVideoWriter(); - } - if (videoWriter == NULL) - { - linuxdvb_err("unknown video codec and no default writer %s\n", Encoding); - ret = cERR_LINUXDVB_ERROR; - } - else - { - call.fd = videofd; - call.data = out->data; - call.len = out->len; - call.Pts = out->pts; - call.private_data = out->extradata; - call.private_size = out->extralen; - call.FrameRate = out->frameRate; - call.FrameScale = out->timeScale; - call.Width = out->width; - call.Height = out->height; - call.Version = 0; // is unsingned char - if (videoWriter->writeData) - res = videoWriter->writeData(&call); - if (res < 0) - { - linuxdvb_err("failed to write data %d - %d\n", res, errno); - linuxdvb_err("%s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - } - } - else if (OUTPUT_TYPE_AUDIO == out->type) - { - char *Encoding = NULL; - context->manager->audio->Command(context, MANAGER_GETENCODING, &Encoding); - linuxdvb_printf(20, "%s::%s Encoding = %s\n", FILENAME, __FUNCTION__, Encoding); - if (audioEncoding != Encoding) - { - audioEncoding = Encoding; - audioWriter = getWriter(Encoding); - } - if (audioWriter == NULL) - { - linuxdvb_printf(20, "searching default writer ... %s\n", Encoding); - audioWriter = getDefaultAudioWriter(); - } - if (audioWriter == NULL) - { - linuxdvb_err("unknown audio codec %s and no default writer\n", Encoding); - ret = cERR_LINUXDVB_ERROR; - } - else - { - call.fd = audiofd; - call.data = out->data; - call.len = out->len; - call.Pts = out->pts; - call.private_data = out->extradata; - call.private_size = out->extralen; - call.FrameRate = out->frameRate; - call.FrameScale = out->timeScale; - call.Version = 0; /* -1; unsigned char cannot be negative */ - if (audioWriter->writeData) - res = audioWriter->writeData(&call); - if (res < 0) - { - linuxdvb_err("failed to write data %d - %d\n", res, errno); - linuxdvb_err("%s\n", strerror(errno)); - ret = cERR_LINUXDVB_ERROR; - } - } - } - return ret; -} - -static int reset(Context_t *context) -{ - int ret = cERR_LINUXDVB_NO_ERROR; - Writer_t *writer = NULL; - char *Encoding = NULL; - - context->manager->video->Command(context, MANAGER_GETENCODING, &Encoding); - if (Encoding != NULL) - writer = getWriter(Encoding); - if (writer == NULL) - { - linuxdvb_err("unknown video codec %s\n", Encoding); - ret = cERR_LINUXDVB_ERROR; - } - else - { - writer->reset(); - } - Encoding = NULL; - context->manager->audio->Command(context, MANAGER_GETENCODING, &Encoding); - if (Encoding != NULL) - writer = getWriter(Encoding); - if (writer == NULL) - { - linuxdvb_err("unknown video codec %s\n", Encoding); - ret = cERR_LINUXDVB_ERROR; - } - else - { - writer->reset(); - } - return ret; -} - -static int Command(Context_t *context, OutputCmd_t command, void *argument) -{ - int ret = cERR_LINUXDVB_NO_ERROR; - - linuxdvb_printf(50, "Command %d\n", command); - - switch (command) - { - case OUTPUT_OPEN: - { - ret = LinuxDvbOpen(context, (char *)argument); - break; - } - case OUTPUT_CLOSE: - { - ret = LinuxDvbClose(context, (char *)argument); - reset(context); - sCURRENT_PTS = 0; - break; - } - case OUTPUT_PLAY: // 4 - { - sCURRENT_PTS = 0; - ret = LinuxDvbPlay(context, (char *)argument); - break; - } - case OUTPUT_STOP: - { - reset(context); - ret = LinuxDvbStop(context, (char *)argument); - sCURRENT_PTS = 0; - break; - } - case OUTPUT_FLUSH: - { - ret = LinuxDvbFlush(context, (char *)argument); - reset(context); - sCURRENT_PTS = 0; - break; - } - case OUTPUT_PAUSE: - { - ret = LinuxDvbPause(context, (char *)argument); - break; - } - case OUTPUT_CONTINUE: - { - ret = LinuxDvbContinue(context, (char *)argument); - break; - } - case OUTPUT_FASTFORWARD: - { - ret = LinuxDvbFastForward(context, (char *)argument); - break; - } - case OUTPUT_REVERSE: - { - ret = LinuxDvbReverse(context, (char *)argument); - break; - } - case OUTPUT_AVSYNC: - { - ret = LinuxDvbAVSync(context, (char *)argument); - break; - } - case OUTPUT_CLEAR: - { - ret = LinuxDvbClear(context, (char *)argument); - reset(context); - sCURRENT_PTS = 0; - break; - } - case OUTPUT_PTS: - { - unsigned long long int pts = 0; - ret = LinuxDvbPts(context, &pts); - *((unsigned long long int *)argument) = (unsigned long long int)pts; - break; - } - case OUTPUT_SWITCH: - { - ret = LinuxDvbSwitch(context, (char *)argument); - break; - } - case OUTPUT_SLOWMOTION: - { - ret = LinuxDvbSlowMotion(context, (char *)argument); - break; - } - case OUTPUT_AUDIOMUTE: - { - ret = LinuxDvbAudioMute(context, (char *)argument); - break; - } - case OUTPUT_DISCONTINUITY_REVERSE: - { - ret = LinuxDvbReverseDiscontinuity(context, (int *)argument); - break; - } - default: - linuxdvb_err("ContainerCmd %d not supported!\n", command); - ret = cERR_LINUXDVB_ERROR; - break; - } - linuxdvb_printf(50, "exiting with value %d\n", ret); - return ret; -} - -static char *LinuxDvbCapabilities[] = { "audio", "video", NULL }; - -struct Output_s LinuxDvbOutput = -{ - "LinuxDvb", - &Command, - &Write, - LinuxDvbCapabilities -}; diff --git a/libeplayer3/output/output.c b/libeplayer3/output/output.c deleted file mode 100644 index 1921d1d..0000000 --- a/libeplayer3/output/output.c +++ /dev/null @@ -1,361 +0,0 @@ -/* - * Output handling. - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include "common.h" -#include "output.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ - -#define OUTPUT_DEBUG - -#ifdef OUTPUT_DEBUG - -static short debug_level = 0; - -#define output_printf(level, x...) do { \ - if (debug_level >= level) fprintf(stderr, x); } while (0) -#else -#define output_printf(level, x...) -#endif - -#ifndef OUTPUT_SILENT -#define output_err(x...) do { printf(x); } while (0) -#else -#define output_err(x...) -#endif - -/* Error Constants */ -#define cERR_OUTPUT_NO_ERROR 0 -#define cERR_OUTPUT_INTERNAL_ERROR -1 - -static const char *FILENAME = "output.c"; - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -/* ***************************** */ -/* Variables */ -/* ***************************** */ - -static Output_t *AvailableOutput[] = -{ - &LinuxDvbOutput, - &SubtitleOutput, - NULL -}; - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ - -/* ***************************** */ -/* Output Functions */ -/* ***************************** */ - -static void OutputAdd(Context_t *context, char *port) -{ - int i, j; - - output_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); - for (i = 0; AvailableOutput[i] != NULL; i++) - for (j = 0; AvailableOutput[i]->Capabilities[j] != NULL; j++) - if (!strcmp(AvailableOutput[i]->Capabilities[j], port)) - { - if (!strcmp("audio", port)) - { - context->output->audio = AvailableOutput[i]; - return; - } - if (!strcmp("video", port)) - { - context->output->video = AvailableOutput[i]; - return; - } - if (!strcmp("subtitle", port)) - { - context->output->subtitle = AvailableOutput[i]; - return; - } - } -} - -static void OutputDel(Context_t *context, char *port) -{ - output_printf(10, "%s::%s\n", FILENAME, __FUNCTION__); - if (!strcmp("audio", port)) - context->output->audio = NULL; - else if (!strcmp("video", port)) - context->output->video = NULL; - else if (!strcmp("subtitle", port)) - context->output->subtitle = NULL; -} - -static int Command(Context_t *context, OutputCmd_t command, void *argument) -{ - int ret = cERR_OUTPUT_NO_ERROR; - - output_printf(10, "%s::%s Command %d\n", FILENAME, __FUNCTION__, command); - switch (command) - { - case OUTPUT_OPEN: - { - if (context && context->playback) - { - if (context->playback->isVideo) - ret |= context->output->video->Command(context, OUTPUT_OPEN, "video"); - if (context->playback->isAudio) - ret |= context->output->audio->Command(context, OUTPUT_OPEN, "audio"); - } - else - ret = cERR_OUTPUT_INTERNAL_ERROR; - break; - } - case OUTPUT_CLOSE: - { - if (context && context->playback) - { - if (context->playback->isVideo) - ret |= context->output->video->Command(context, OUTPUT_CLOSE, "video"); - if (context->playback->isAudio) - ret |= context->output->audio->Command(context, OUTPUT_CLOSE, "audio"); - } - else - ret = cERR_OUTPUT_INTERNAL_ERROR; - break; - } - case OUTPUT_ADD: - { - OutputAdd(context, (char *) argument); - break; - } - case OUTPUT_DEL: - { - OutputDel(context, (char *) argument); - break; - } - case OUTPUT_PLAY: // 4 - { - if (context && context->playback) - { - if (context->playback->isVideo) - ret = context->output->video->Command(context, OUTPUT_PLAY, "video"); - if (!ret) // success or not executed, dunn care - { - if (context->playback->isAudio) - ret = context->output->audio->Command(context, OUTPUT_PLAY, "audio"); - } - } - else - ret = cERR_OUTPUT_INTERNAL_ERROR; - break; - } - case OUTPUT_STOP: - { - if (context && context->playback) - { - if (context->playback->isVideo) - ret |= context->output->video->Command(context, OUTPUT_STOP, "video"); - if (context->playback->isAudio) - ret |= context->output->audio->Command(context, OUTPUT_STOP, "audio"); - } - else - ret = cERR_OUTPUT_INTERNAL_ERROR; - break; - } - case OUTPUT_FLUSH: - { - if (context && context->playback) - { - if (context->playback->isVideo) - ret |= context->output->video->Command(context, OUTPUT_FLUSH, "video"); - if (context->playback->isAudio) - ret |= context->output->audio->Command(context, OUTPUT_FLUSH, "audio"); - } - else - ret = cERR_OUTPUT_INTERNAL_ERROR; - break; - } - case OUTPUT_PAUSE: - { - if (context && context->playback) - { - if (context->playback->isVideo) - ret |= context->output->video->Command(context, OUTPUT_PAUSE, "video"); - if (context->playback->isAudio) - ret |= context->output->audio->Command(context, OUTPUT_PAUSE, "audio"); - } - else - ret = cERR_OUTPUT_INTERNAL_ERROR; - break; - } - case OUTPUT_FASTFORWARD: - { - if (context && context->playback) - { - if (context->playback->isVideo) - ret |= context->output->video->Command(context, OUTPUT_FASTFORWARD, "video"); - if (context->playback->isAudio) - ret |= context->output->audio->Command(context, OUTPUT_FASTFORWARD, "audio"); - } - else - ret = cERR_OUTPUT_INTERNAL_ERROR; - break; - } - case OUTPUT_REVERSE: - { - if (context && context->playback) - { - if (context->playback->isVideo) - ret |= context->output->video->Command(context, OUTPUT_REVERSE, "video"); - if (context->playback->isAudio) - ret |= context->output->audio->Command(context, OUTPUT_REVERSE, "audio"); - } - else - ret = cERR_OUTPUT_INTERNAL_ERROR; - break; - } - case OUTPUT_CONTINUE: - { - if (context && context->playback) - { - if (context->playback->isVideo) - ret |= context->output->video->Command(context, OUTPUT_CONTINUE, "video"); - if (context->playback->isAudio) - ret |= context->output->audio->Command(context, OUTPUT_CONTINUE, "audio"); - } - else - ret = cERR_OUTPUT_INTERNAL_ERROR; - break; - } - case OUTPUT_AVSYNC: - { - if (context && context->playback) - { - if (context->playback->isVideo && context->playback->isAudio) - ret |= context->output->audio->Command(context, OUTPUT_AVSYNC, "audio"); - } - else - ret = cERR_OUTPUT_INTERNAL_ERROR; - break; - } - case OUTPUT_CLEAR: - { - if (context && context->playback) - { - if (context->playback->isVideo && (argument == NULL || *(char *) argument == 'v')) - ret |= context->output->video->Command(context, OUTPUT_CLEAR, "video"); - if (context->playback->isAudio && (argument == NULL || *(char *) argument == 'a')) - ret |= context->output->audio->Command(context, OUTPUT_CLEAR, "audio"); - } - else - ret = cERR_OUTPUT_INTERNAL_ERROR; - break; - } - case OUTPUT_PTS: - { - if (context && context->playback) - { - if (context->playback->isVideo) - return context->output->video->Command(context, OUTPUT_PTS, argument); - if (context->playback->isAudio) - return context->output->audio->Command(context, OUTPUT_PTS, argument); - } - else - ret = cERR_OUTPUT_INTERNAL_ERROR; - break; - } - case OUTPUT_SWITCH: - { - if (context && context->playback) - { - if (context->playback->isAudio) - return context->output->audio->Command(context, OUTPUT_SWITCH, "audio"); - if (context->playback->isVideo) - return context->output->video->Command(context, OUTPUT_SWITCH, "video"); - } - else - ret = cERR_OUTPUT_INTERNAL_ERROR; - break; - } - case OUTPUT_SLOWMOTION: - { - if (context && context->playback) - { - if (context->playback->isVideo) - ret |= context->output->video->Command(context, OUTPUT_SLOWMOTION, "video"); - if (context->playback->isAudio) - ret |= context->output->audio->Command(context, OUTPUT_SLOWMOTION, "audio"); - } - else - ret = cERR_OUTPUT_INTERNAL_ERROR; - break; - } - case OUTPUT_AUDIOMUTE: - { - if (context && context->playback) - { - if (context->playback->isAudio) - ret |= context->output->audio->Command(context, OUTPUT_AUDIOMUTE, (char *) argument); - } - else - ret = cERR_OUTPUT_INTERNAL_ERROR; - break; - } - case OUTPUT_DISCONTINUITY_REVERSE: - { - if (context && context->playback) - { - if (context->playback->isVideo) - ret |= context->output->video->Command(context, OUTPUT_DISCONTINUITY_REVERSE, (void *) argument); - } - else - ret = cERR_OUTPUT_INTERNAL_ERROR; - break; - } - default: - output_err("%s::%s OutputCmd %d not supported!\n", FILENAME, __FUNCTION__, command); - ret = cERR_OUTPUT_INTERNAL_ERROR; - break; - } - output_printf(10, "%s::%s exiting with value %d\n", FILENAME, __FUNCTION__, ret); - return ret; -} - -OutputHandler_t OutputHandler = -{ - "Output", - NULL, - NULL, - NULL, - &Command -}; diff --git a/libeplayer3/output/output_subtitle.c b/libeplayer3/output/output_subtitle.c deleted file mode 100644 index 24a6a35..0000000 --- a/libeplayer3/output/output_subtitle.c +++ /dev/null @@ -1,443 +0,0 @@ -/* - * Subtitle output to one registered client. - * - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" -#include "subtitle.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ - -#define SUBTITLE_DEBUG - -#ifdef SUBTITLE_DEBUG - -static short debug_level = 0; - -#define subtitle_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define subtitle_printf(level, fmt, x...) -#endif - -#ifndef SUBTITLE_SILENT -#define subtitle_err(fmt, x...) do { printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define subtitle_err(fmt, x...) -#endif - -/* Error Constants */ -#define cERR_SUBTITLE_NO_ERROR 0 -#define cERR_SUBTITLE_ERROR -1 - -static const char FILENAME[] = "subtitle.c"; - -/* -Number, Style, Name,, MarginL, MarginR, MarginV, Effect,, Text - -1038,0,tdk,,0000,0000,0000,,That's not good. -1037,0,tdk,,0000,0000,0000,,{\i1}Rack them up, rack them up,{\i0}\N{\i1}rack them up.{\i0} [90] -1036,0,tdk,,0000,0000,0000,,Okay, rack them up. -*/ - -#define PUFFERSIZE 20 - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -struct sub_t -{ - char *text; - unsigned long long int pts; - unsigned long int milliDuration; -}; - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ - -static pthread_mutex_t mutex; - -void *clientData = NULL; -void (*clientFunction)(long int, size_t, char *, void *); - -static struct sub_t subPuffer[PUFFERSIZE]; -static int readPointer = 0; -static int writePointer = 0; - -static int screen_width = 0; -static int screen_height = 0; -static int destStride = 0; -static int shareFramebuffer = 0; -static int framebufferFD = -1; -static unsigned char *destination = NULL; -static void (*framebufferBlit)() = NULL; - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ -static void getMutex(int line) -{ - subtitle_printf(100, "%d requesting mutex\n", line); - pthread_mutex_lock(&mutex); - subtitle_printf(100, "%d received mutex\n", line); -} - -static void releaseMutex(int line) -{ - pthread_mutex_unlock(&mutex); - subtitle_printf(100, "%d released mutex\n", line); -} - -void replace_all(char **string, char *search, char *replace) -{ - int len = 0; - char *ptr = NULL; - char tempString[512]; - char newString[512]; - - newString[0] = '\0'; - if ((string == NULL) || (*string == NULL) || (search == NULL) || (replace == NULL)) - { - subtitle_err("null pointer passed\n"); - return; - } - strncpy(tempString, *string, 511); - tempString[511] = '\0'; - free(*string); - while ((ptr = strstr(tempString, search)) != NULL) - { - len = ptr - tempString; - strncpy(newString, tempString, len); - newString[len] = '\0'; - strcat(newString, replace); - len += strlen(search); - strcat(newString, tempString + len); - strcpy(tempString, newString); - } - subtitle_printf(20, "strdup in line %d\n", __LINE__); - if (newString[0] != '\0') - *string = strdup(newString); - else - *string = strdup(tempString); -} - -int subtitle_ParseASS(char **Line) -{ - char *Text; - int i; - char *ptr1; - - if ((Line == NULL) || (*Line == NULL)) - { - subtitle_err("null pointer passed\n"); - return cERR_SUBTITLE_ERROR; - } - Text = strdup(*Line); - subtitle_printf(10, "-> Text = %s\n", *Line); - ptr1 = Text; - for (i = 0; i < 9 && *ptr1 != '\0'; ptr1++) - { - subtitle_printf(20, "%s", ptr1); - if (*ptr1 == ',') - i++; - } - free(*Line); - *Line = strdup(ptr1); - free(Text); - replace_all(Line, "\\N", "\n"); - replace_all(Line, "{\\i1}", ""); - replace_all(Line, "{\\i0}", ""); - subtitle_printf(10, "<- Text=%s\n", *Line); - return cERR_SUBTITLE_NO_ERROR; -} - -int subtitle_ParseSRT(char **Line) -{ - if ((Line == NULL) || (*Line == NULL)) - { - subtitle_err("null pointer passed\n"); - return cERR_SUBTITLE_ERROR; - } - subtitle_printf(20, "-> Text=%s\n", *Line); - replace_all(Line, "\x0d", ""); - replace_all(Line, "\n\n", "\\N"); - replace_all(Line, "\n", ""); - replace_all(Line, "\\N", "\n"); - replace_all(Line, "ö", "oe"); - replace_all(Line, "ä", "ae"); - replace_all(Line, "ü", "ue"); - replace_all(Line, "Ö", "Oe"); - replace_all(Line, "Ä", "Ae"); - replace_all(Line, "Ãœ", "Ue"); - replace_all(Line, "ß", "ss"); - replace_all(Line, "", ""); - replace_all(Line, "", ""); - replace_all(Line, "", ""); - replace_all(Line, "", ""); - replace_all(Line, "", ""); - replace_all(Line, "", ""); - subtitle_printf(10, "<- Text=%s\n", *Line); - return cERR_SUBTITLE_NO_ERROR; -} - -int subtitle_ParseSSA(char **Line) -{ - if ((Line == NULL) || (*Line == NULL)) - { - subtitle_err("null pointer passed\n"); - return cERR_SUBTITLE_ERROR; - } - subtitle_printf(20, "-> Text=%s\n", *Line); - replace_all(Line, "\x0d", ""); - replace_all(Line, "\n\n", "\\N"); - replace_all(Line, "\n", ""); - replace_all(Line, "\\N", "\n"); - replace_all(Line, "ö", "oe"); - replace_all(Line, "ä", "ae"); - replace_all(Line, "ü", "ue"); - replace_all(Line, "Ö", "Oe"); - replace_all(Line, "Ä", "Ae"); - replace_all(Line, "Ãœ", "Ue"); - replace_all(Line, "ß", "ss"); - replace_all(Line, "", ""); - replace_all(Line, "", ""); - replace_all(Line, "", ""); - replace_all(Line, "", ""); - replace_all(Line, "", ""); - replace_all(Line, "", ""); - subtitle_printf(10, "<- Text=%s\n", *Line); - return cERR_SUBTITLE_NO_ERROR; -} - -void addSub(Context_t *context, char *text, unsigned long long int pts, unsigned long int milliDuration) -{ - int count = 20; - subtitle_printf(50, "index %d\n", writePointer); - if (context && context->playback && !context->playback->isPlaying) - { - subtitle_err("1. aborting ->no playback\n"); - return; - } - if (text == NULL) - { - subtitle_err("null pointer passed\n"); - return; - } - if (pts == 0) - { - subtitle_err("pts 0\n"); - return; - } - if (milliDuration == 0) - { - subtitle_err("duration 0\n"); - return; - } - while (subPuffer[writePointer].text != NULL) - { - //List is full, wait till we got some free space - if (context && context->playback && !context->playback->isPlaying) - { - subtitle_err("2. aborting ->no playback\n"); - return; - } - /* konfetti: we dont want to block forever here. if no buffer - * is available we start ring from the beginning and loose some stuff - * which is acceptable! - */ - subtitle_printf(10, "waiting on free buffer %d - %d (%d) ...\n", writePointer, readPointer, count); - usleep(10000); - count--; - if (count == 0) - { - subtitle_err("abort waiting on buffer...\n"); - break; - } - } - subtitle_printf(20, "from mkv: %s pts:%lld milliDuration:%lud\n", text, pts, milliDuration); - getMutex(__LINE__); - if (count == 0) - { - int i; - - subtitle_err("freeing not delivered data\n"); - //Reset all - readPointer = 0; - writePointer = 0; - for (i = 0; i < PUFFERSIZE; i++) - { - if (subPuffer[i].text != NULL) - free(subPuffer[i].text); - subPuffer[i].text = NULL; - subPuffer[i].pts = 0; - subPuffer[i].milliDuration = 0; - } - } - subPuffer[writePointer].text = strdup(text); - subPuffer[writePointer].pts = pts; - subPuffer[writePointer].milliDuration = milliDuration; - writePointer++; - if (writePointer == PUFFERSIZE) - writePointer = 0; - if (writePointer == readPointer) - { - /* this should not happen, and means that there is nor reader or - * the reader has performance probs ;) - * the recovery is done at startup of this function - but next time - */ - subtitle_err("ups something went wrong. no more readers? \n"); - } - releaseMutex(__LINE__); - subtitle_printf(10, "<\n"); -} - -/* ***************************** */ -/* Functions */ -/* ***************************** */ - -static int Write(Context_t *context, void *data) -{ - char *Encoding = NULL; - char *Text = NULL; - SubtitleOut_t *out; - int DataLength; - unsigned long long int Pts; - float Duration; - - subtitle_printf(10, "\n"); - if (data == NULL) - { - subtitle_err("null pointer passed\n"); - return cERR_SUBTITLE_ERROR; - } - out = (SubtitleOut_t *) data; - if (out->type == eSub_Txt) - { - Text = strdup((const char *) out->u.text.data); - } - else - { - /* fixme handle gfx subs from container_ass and send it to - * the callback. this must be implemented also in e2/neutrino - * then. - */ - subtitle_err("subtitle gfx currently not handled\n"); - return cERR_SUBTITLE_ERROR; - } - DataLength = out->u.text.len; - Pts = out->pts; - Duration = out->duration; - context->manager->subtitle->Command(context, MANAGER_GETENCODING, &Encoding); - if (Encoding == NULL) - { - subtitle_err("encoding unknown\n"); - if (Text) free(Text); - return cERR_SUBTITLE_ERROR; - } - subtitle_printf(20, "Encoding:%s Text:%s Len:%d\n", Encoding, Text, DataLength); - if (!strncmp("S_TEXT/SSA", Encoding, 10) || - !strncmp("S_SSA", Encoding, 5)) - subtitle_ParseSSA(&Text); - else if (!strncmp("S_TEXT/ASS", Encoding, 10) || - !strncmp("S_AAS", Encoding, 5)) - subtitle_ParseASS(&Text); - else if (!strncmp("S_TEXT/SRT", Encoding, 10) || - !strncmp("S_SRT", Encoding, 5)) - subtitle_ParseSRT(&Text); - else - { - subtitle_err("unknown encoding %s\n", Encoding); - return cERR_SUBTITLE_ERROR; - } - subtitle_printf(10, "Text:%s Duration:%f\n", Text, Duration); - addSub(context, Text, Pts, Duration * 1000); - if (Text) free(Text); - subtitle_printf(10, "<\n"); - return cERR_SUBTITLE_NO_ERROR; -} - -static int Command(Context_t *context, OutputCmd_t command, void *argument) -{ - int ret = cERR_SUBTITLE_NO_ERROR; - - subtitle_printf(50, "%d\n", command); - switch (command) - { - case OUTPUT_GET_SUBTITLE_OUTPUT: - { - SubtitleOutputDef_t *out = (SubtitleOutputDef_t *)argument; - out->screen_width = screen_width; - out->screen_height = screen_height; - out->shareFramebuffer = shareFramebuffer; - out->framebufferFD = framebufferFD; - out->destination = destination; - out->destStride = destStride; - out->framebufferBlit = framebufferBlit; - break; - } - case OUTPUT_SET_SUBTITLE_OUTPUT: - { - SubtitleOutputDef_t *out = (SubtitleOutputDef_t *)argument; - screen_width = out->screen_width; - screen_height = out->screen_height; - shareFramebuffer = out->shareFramebuffer; - framebufferFD = out->framebufferFD; - destination = out->destination; - destStride = out->destStride; - framebufferBlit = out->framebufferBlit; - break; - } - default: - subtitle_err("OutputCmd %d not supported!\n", command); - ret = cERR_SUBTITLE_ERROR; - break; - } - subtitle_printf(50, "exiting with value %d\n", ret); - return ret; -} - -static char *SubtitleCapabilitis[] = { "subtitle", NULL }; - -struct Output_s SubtitleOutput = -{ - "Subtitle", - &Command, - &Write, - SubtitleCapabilitis -}; diff --git a/libeplayer3/output/writer/aac.c b/libeplayer3/output/writer/aac.c deleted file mode 100644 index 3b51f4e..0000000 --- a/libeplayer3/output/writer/aac.c +++ /dev/null @@ -1,278 +0,0 @@ -/* - * linuxdvb output/writer handling. - * - * konfetti 2010 based on linuxdvb.c code from libeplayer2 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" -#include "debug.h" -#include "misc.h" -#include "pes.h" -#include "writer.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ - -#define AAC_HEADER_LENGTH 7 - -#define AAC_DEBUG - -#ifdef AAC_DEBUG - -static short debug_level = 0; - -#define aac_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define aac_printf(level, fmt, x...) -#endif - -#ifndef AAC_SILENT -#define aac_err(fmt, x...) do { printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define aac_err(fmt, x...) -#endif - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ - -/// ** AAC ADTS format ** -/// -/// AAAAAAAA AAAABCCD EEFFFFGH HHIJKLMM -/// MMMMMMMM MMMNNNNN NNNNNNOO ........ -/// -/// Sign Length Position Description -/// -/// A 12 (31-20) Sync code -/// B 1 (19) ID -/// C 2 (18-17) layer -/// D 1 (16) protect absent -/// E 2 (15-14) profile -/// F 4 (13-10) sample freq index -/// G 1 (9) private -/// H 3 (8-6) channel config -/// I 1 (5) original/copy -/// J 1 (4) home -/// K 1 (3) copyright id -/// L 1 (2) copyright start -/// M 13 (1-0,31-21) frame length -/// N 11 (20-10) adts buffer fullness -/// O 2 (9-8) num of raw data blocks in frame - -/* -LC: Audio: aac, 44100 Hz, stereo, s16, 192 kb/ ->ff f1 50 80 00 1f fc -HE: Audio: aac, 48000 Hz, stereo, s16, 77 kb/s ->ff f1 4c 80 00 1f fc -*/ - -/* -ADIF = basic format called Audio Data Interchange Format (ADIF) - consisting of a single header followed by the raw AAC audio data blocks -ADTS = streaming format called Audio Data Transport Stream (ADTS) - consisting of a series of frames, each frame having a header followed by the AAC audio data -LOAS = Low Overhead Audio Stream (LOAS), a self-synchronizing streaming format -*/ - -/* -AvailableBytes = Writen Bytes -Sync = Bits.Get(11); -if (Sync == AAC_AUDIO_LOAS_ASS_SYNC_WORD{0x2b7}) - Type = AAC_AUDIO_LOAS_FORMAT; - FrameSize = Bits.Get(13) + AAC_LOAS_ASS_SYNC_LENGTH_HEADER_SIZE{3}; - if (FrameSize > AAC_LOAS_ASS_MAX_FRAME_SIZE{8192}) - // ERROR - AvailableBytes = AvailableBytes - AAC_LOAS_ASS_MAX_FRAME_SIZE{8192}; - - ImplicitSbrExtension = true; - ExplicitSbrExtension = false; - - if (AvailableBytes > 0) - useSameStreamMux = Bits->Get(1); - else - useSameStreamMux = true; - - if ( !useSameStreamMux ) - audioMuxVersion = Bits->Get(1); // Has to be 0 - if (!audioMuxVersion) - // only get program 0 and layer 0 information ... - Bits->FlushUnseen(1 + 6 + 4 + 3); // allStreamSameTimeFraming, numSubFrames, numProgram, numLayer - audioObjectType = Bits->Get(5); - if ((audioObjectType != AAC_AUDIO_PROFILE_LC{2}) && (audioObjectType != AAC_AUDIO_PROFILE_SBR{5})) - // Error - - samplingFrequencyIndex = Bits->Get(4); - channelConfiguration = Bits->Get(4); - if (audioObjectType == AAC_AUDIO_PROFILE_SBR{5}) - ImplicitSbrExtension = false; - ExplicitSbrExtension = true; - samplingFrequencyIndex = Bits->Get(4); - audioObjectType = Bits->Get(5); - if (audioObjectType != AAC_AUDIO_PROFILE_LC{2}) - // Error - *SampleCount = 1024 * ((ImplicitSbrExtension || ExplicitSbrExtension)?2:1); - *SamplingFrequency *= (ImplicitSbrExtension?2:1); -else - Sync |= Bits.Get(1) << 11; - if (Sync == AAC_AUDIO_ADTS_SYNC_WORD{0xfff}) - Type = AAC_AUDIO_ADTS_FORMAT; // Supports only LC - ID = Bits.Get(1); - Layer = Bits.Get(2); // Has to be 0 - protection_absent = Bits.Get(1); - profile_ObjectType = Bits.Get(2); - if ((profile_ObjectType+1) != AAC_AUDIO_PROFILE_LC) - return - sampling_frequency_index = Bits.Get(4); - SamplingFrequency = aac_sample_rates[sampling_frequency_index] * 2; - Bits.FlushUnseen(1); //private_bit - channel_configuration = Bits.Get(3); - Bits.FlushUnseen(1 + 1 + 1 + 1); //original/copy, home, copyright_identification_bit, copyright_identification_start - FrameSize = Bits.Get(13); // aac_frame_length - if (FrameSize < AAC_ADTS_MIN_FRAME_SIZE{7}) - // Error - Bits.FlushUnseen(11); //adts_buffer_fullness - no_raw_data_blocks_in_frame = Bits.Get(2); - // multiple the sample count by two in case a sbr object is present - SampleCount = (no_raw_data_blocks_in_frame + 1) * 1024 * 2 ; - else - Sync |= Bits.Get(4) << 12; - if (Sync == AAC_AUDIO_LOAS_EPASS_SYNC_WORD{0x4de1}) - Type = AAC_AUDIO_LOAS_FORMAT; - ... - else - Sync |= Bits.Get(16) << 16; - if (Sync == AAC_AUDIO_ADIF_SYNC_WORD{0x41444946}) - Type = AAC_AUDIO_ADIF_FORMAT; - //not supported - -*/ - -static unsigned char DefaultAACHeader[] = -{ - 0xff, - 0xf1, - /*0x00, 0x00*/0x50, //((Profile & 0x03) << 6) | (SampleIndex << 2) | ((Channels >> 2) & 0x01);s - 0x80, //(Channels & 0x03) << 6; - 0x00, - 0x1f, - 0xfc -}; - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ -static int reset() -{ - return 0; -} - -static int writeData(void *_call) -{ - WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - unsigned char ExtraData[AAC_HEADER_LENGTH]; - unsigned int PacketLength; - - aac_printf(10, "\n"); - - if (call == NULL) - { - aac_err("call data is NULL...\n"); - return 0; - } - aac_printf(10, "AudioPts %lld\n", call->Pts); - PacketLength = call->len + AAC_HEADER_LENGTH; - if ((call->data == NULL) || (call->len <= 0)) - { - aac_err("parsing NULL Data. ignoring...\n"); - return 0; - } - if (call->fd < 0) - { - aac_err("file pointer < 0. ignoring ...\n"); - return 0; - } - if (call->private_data == NULL) - { - aac_printf(10, "private_data = NULL\n"); - call->private_data = DefaultAACHeader; - call->private_size = AAC_HEADER_LENGTH; - } - memcpy(ExtraData, call->private_data, AAC_HEADER_LENGTH); - ExtraData[3] |= (PacketLength >> 11) & 0x3; - ExtraData[4] = (PacketLength >> 3) & 0xff; - ExtraData[5] |= (PacketLength << 5) & 0xe0; - unsigned int HeaderLength = InsertPesHeader(PesHeader, PacketLength, AAC_AUDIO_PES_START_CODE, call->Pts, 0); - struct iovec iov[3]; - iov[0].iov_base = PesHeader; - iov[0].iov_len = HeaderLength; - iov[1].iov_base = ExtraData; - iov[1].iov_len = AAC_HEADER_LENGTH; - iov[2].iov_base = call->data; - iov[2].iov_len = call->len; - return writev(call->fd, iov, 3); -} - -/* ***************************** */ -/* Writer Definition */ -/* ***************************** */ - -static WriterCaps_t caps = -{ - "aac", - eAudio, - "A_AAC", - AUDIO_ENCODING_AAC -}; - -struct Writer_s WriterAudioAAC = -{ - &reset, - &writeData, - &caps -}; diff --git a/libeplayer3/output/writer/ac3.c b/libeplayer3/output/writer/ac3.c deleted file mode 100644 index 6925664..0000000 --- a/libeplayer3/output/writer/ac3.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - * linuxdvb output/writer handling. - * - * konfetti 2010 based on linuxdvb.c code from libeplayer2 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" -#include "debug.h" -#include "misc.h" -#include "pes.h" -#include "writer.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ -#define AC3_HEADER_LENGTH 7 - -#define AC3_DEBUG - -#ifdef AC3_DEBUG - -static short debug_level = 0; - -#define ac3_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define ac3_printf(level, fmt, x...) -#endif - -#ifndef AC3_SILENT -#define ac3_err(fmt, x...) do { printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define ac3_err(fmt, x...) -#endif - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ - -static int reset() -{ - return 0; -} - -static int writeData(void *_call) -{ - WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - ac3_printf(10, "\n"); - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - - if (call == NULL) - { - ac3_err("call data is NULL...\n"); - return 0; - } - ac3_printf(10, "AudioPts %lld\n", call->Pts); - if ((call->data == NULL) || (call->len <= 0)) - { - ac3_err("parsing NULL Data. ignoring...\n"); - return 0; - } - if (call->fd < 0) - { - ac3_err("file pointer < 0. ignoring ...\n"); - return 0; - } - struct iovec iov[2]; - iov[0].iov_base = PesHeader; - iov[0].iov_len = InsertPesHeader(PesHeader, call->len, PRIVATE_STREAM_1_PES_START_CODE, call->Pts, 0); - iov[1].iov_base = call->data; - iov[1].iov_len = call->len; - return writev(call->fd, iov, 2); -} - -/* ***************************** */ -/* Writer Definition */ -/* ***************************** */ - -static WriterCaps_t caps_ac3 = -{ - "ac3", - eAudio, - "A_AC3", - AUDIO_ENCODING_AC3 -}; - -struct Writer_s WriterAudioAC3 = -{ - &reset, - &writeData, - &caps_ac3 -}; diff --git a/libeplayer3/output/writer/divx.c b/libeplayer3/output/writer/divx.c deleted file mode 100644 index ae68a90..0000000 --- a/libeplayer3/output/writer/divx.c +++ /dev/null @@ -1,205 +0,0 @@ -/* - * linuxdvb output/writer handling. - * - * konfetti 2010 based on linuxdvb.c code from libeplayer2 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" -#include "debug.h" -#include "misc.h" -#include "pes.h" -#include "writer.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ - -#define DIVX_DEBUG - -#ifdef DIVX_DEBUG - -static short debug_level = 0; - -#define divx_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define divx_printf(level, fmt, x...) -#endif - -#ifndef DIVX_SILENT -#define divx_err(fmt, x...) do { printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define divx_err(fmt, x...) -#endif - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ -static int initialHeader = 1; - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ -static int reset() -{ - initialHeader = 1; - return 0; -} - -static int writeData(void *_call) -{ - WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - unsigned char FakeHeaders[64] = { 0 }; // 64bytes should be enough to make the fake headers - unsigned int FakeHeaderLength; - unsigned char Version = 5; - unsigned int FakeStartCode = (Version << 8) | PES_VERSION_FAKE_START_CODE; - unsigned int usecPerFrame = 41708; /* Hellmaster1024: default value */ - BitPacker_t ld = {FakeHeaders, 0, 32}; - - divx_printf(10, "\n"); - if (call == NULL) - { - divx_err("call data is NULL...\n"); - return 0; - } - if ((call->data == NULL) || (call->len <= 0)) - { - divx_err("parsing NULL Data. ignoring...\n"); - return 0; - } - if (call->fd < 0) - { - divx_err("file pointer < 0. ignoring ...\n"); - return 0; - } - divx_printf(10, "AudioPts %lld\n", call->Pts); - usecPerFrame = 1000000000 / call->FrameRate; - divx_printf(10, "Microsecends per frame = %d\n", usecPerFrame); - memset(FakeHeaders, 0, sizeof(FakeHeaders)); - /* Create info record for frame parser */ - /* divx4 & 5 - VOS - PutBits(&ld, 0x0, 8); - PutBits(&ld, 0x0, 8); - */ - PutBits(&ld, 0x1b0, 32); // startcode - PutBits(&ld, 0, 8); // profile = reserved - PutBits(&ld, 0x1b2, 32); // startcode (user data) - PutBits(&ld, 0x53545443, 32); // STTC - an embedded ST timecode from an avi file - PutBits(&ld, usecPerFrame , 32); - // microseconds per frame - FlushBits(&ld); - FakeHeaderLength = (ld.Ptr - (FakeHeaders)); - struct iovec iov[4]; - int ic = 0; - iov[ic].iov_base = PesHeader; - iov[ic++].iov_len = InsertPesHeader(PesHeader, call->len, MPEG_VIDEO_PES_START_CODE, call->Pts, FakeStartCode); - iov[ic].iov_base = FakeHeaders; - iov[ic++].iov_len = FakeHeaderLength; - if (initialHeader) - { - iov[ic].iov_base = call->private_data; - iov[ic++].iov_len = call->private_size; - initialHeader = 0; - } - iov[ic].iov_base = call->data; - iov[ic++].iov_len = call->len; - int len = writev(call->fd, iov, ic); - divx_printf(10, "xvid_Write < len=%d\n", len); - return len; -} - -/* ***************************** */ -/* Writer Definition */ -/* ***************************** */ - -static WriterCaps_t mpeg4p2_caps = -{ - "mscomp", - eVideo, - "V_MSCOMP", - VIDEO_ENCODING_MPEG4P2 -}; - -struct Writer_s WriterVideoMSCOMP = -{ - &reset, - &writeData, - &mpeg4p2_caps -}; - -static WriterCaps_t fourcc_caps = -{ - "fourcc", - eVideo, - "V_MS/VFW/FOURCC", - VIDEO_ENCODING_MPEG4P2 -}; - -struct Writer_s WriterVideoFOURCC = -{ - &reset, - &writeData, - &fourcc_caps -}; - -static WriterCaps_t divx_caps = -{ - "divx", - eVideo, - "V_MKV/XVID", - VIDEO_ENCODING_MPEG4P2 -}; - -struct Writer_s WriterVideoDIVX = -{ - &reset, - &writeData, - &divx_caps -}; diff --git a/libeplayer3/output/writer/dts.c b/libeplayer3/output/writer/dts.c deleted file mode 100644 index e1a781d..0000000 --- a/libeplayer3/output/writer/dts.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - * linuxdvb output/writer handling. - * - * konfetti 2010 based on linuxdvb.c code from libeplayer2 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" -#include "debug.h" -#include "misc.h" -#include "pes.h" -#include "writer.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ -#define PES_AUDIO_PRIVATE_HEADER_SIZE 16 // consider maximum private header size. -#define PES_AUDIO_HEADER_SIZE (32 + PES_AUDIO_PRIVATE_HEADER_SIZE) -#define PES_AUDIO_PACKET_SIZE 2028 -#define SPDIF_AUDIO_PACKET_SIZE (1024 * sizeof(unsigned int) * 2) // stereo 32bit samples. - -#define DTS_DEBUG - -#ifdef DTS_DEBUG - -static short debug_level = 0; - -#define dts_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define dts_printf(level, fmt, x...) -#endif - -#ifndef DTS_SILENT -#define dts_err(fmt, x...) do { printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define dts_err(fmt, x...) -#endif - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ -static int reset() -{ - return 0; -} - -static int writeData(void *_call) -{ - WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - unsigned char PesHeader[PES_AUDIO_HEADER_SIZE]; - dts_printf(10, "\n"); - - if (call == NULL) - { - dts_err("call data is NULL...\n"); - return 0; - } - dts_printf(10, "AudioPts %lld\n", call->Pts); - if ((call->data == NULL) || (call->len <= 0)) - { - dts_err("parsing NULL Data. ignoring...\n"); - return 0; - } - if (call->fd < 0) - { - dts_err("file pointer < 0. ignoring ...\n"); - return 0; - } -// #define DO_BYTESWAP -#ifdef DO_BYTESWAP - unsigned char *Data = (unsigned char *) malloc(call->len); - memcpy(Data, call->data, call->len); - /* 16-bit byte swap all data before injecting it */ - for (i = 0; i < call->len; i += 2) - { - unsigned char Tmp = Data[i]; - Data[i] = Data[i + 1]; - Data[i + 1] = Tmp; - } -#endif - struct iovec iov[2]; - iov[0].iov_base = PesHeader; - iov[0].iov_len = InsertPesHeader(PesHeader, call->len, MPEG_AUDIO_PES_START_CODE/*PRIVATE_STREAM_1_PES_START_CODE*/, call->Pts, 0); -#ifdef DO_BYTESPWAP - iov[1].iov_base = Data; -#else - iov[1].iov_base = call->data; -#endif - iov[1].iov_len = call->len; - int len = writev(call->fd, iov, 2); -#ifdef DO_BYTESWAP - free(Data); -#endif - dts_printf(10, "< len %d\n", len); - return len; -} - -/* ***************************** */ -/* Writer Definition */ -/* ***************************** */ - -static WriterCaps_t caps = -{ - "dts", - eAudio, - "A_DTS", - AUDIO_ENCODING_DTS -}; - -struct Writer_s WriterAudioDTS = -{ - &reset, - &writeData, - &caps -}; diff --git a/libeplayer3/output/writer/flac.c b/libeplayer3/output/writer/flac.c deleted file mode 100644 index bb8f240..0000000 --- a/libeplayer3/output/writer/flac.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - * linuxdvb output/writer handling. - * - * konfetti 2010 based on linuxdvb.c code from libeplayer2 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" -#include "debug.h" -#include "misc.h" -#include "pes.h" -#include "writer.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ -#define FLAC_DEBUG - -#ifdef FLAC_DEBUG - -static short debug_level = 0; - -#define flac_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define flac_printf(level, fmt, x...) -#endif - -#ifndef FLAC_SILENT -#define flac_err(fmt, x...) do { printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define flac_err(fmt, x...) -#endif - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ - -static int reset() -{ - return 0; -} - -static int writeData(void *_call) -{ - WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - flac_printf(10, "\n"); - - if (call == NULL) - { - flac_err("call data is NULL...\n"); - return 0; - } - flac_printf(10, "AudioPts %lld\n", call->Pts); - if ((call->data == NULL) || (call->len <= 0)) - { - flac_err("parsing NULL Data. ignoring...\n"); - return 0; - } - if (call->fd < 0) - { - flac_err("file pointer < 0. ignoring ...\n"); - return 0; - } - struct iovec iov[2]; - iov[0].iov_base = PesHeader; - iov[0].iov_len = InsertPesHeader(PesHeader, call->len , MPEG_AUDIO_PES_START_CODE, call->Pts, 0); - iov[1].iov_base = call->data; - iov[1].iov_len = call->len; - int len = writev(call->fd, iov, 2); - flac_printf(10, "flac_Write-< len=%d\n", len); - return len; -} - -/* ***************************** */ -/* Writer Definition */ -/* ***************************** */ - -static WriterCaps_t caps_flac = -{ - "flac", - eAudio, - "A_FLAC", - AUDIO_ENCODING_LPCM //AUDIO_ENCODING_FLAC -}; - -struct Writer_s WriterAudioFLAC = -{ - &reset, - &writeData, - &caps_flac -}; diff --git a/libeplayer3/output/writer/framebuffer.c b/libeplayer3/output/writer/framebuffer.c deleted file mode 100644 index 7faaa03..0000000 --- a/libeplayer3/output/writer/framebuffer.c +++ /dev/null @@ -1,204 +0,0 @@ -/* - * framebuffer output/writer handling. - * - * This is a hacky implementation of a framebuffer output for the subtitling. - * This is ment as a POV, later this should be implemented in enigma2 and - * neutrino. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" -#include "debug.h" -#include "misc.h" -#include "writer.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ - -#define FB_DEBUG - -#ifdef FB_DEBUG - -static short debug_level = 0; - -#define fb_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define fb_printf(level, fmt, x...) -#endif - -#ifndef FB_SILENT -#define fb_err(fmt, x...) do { printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define fb_err(fmt, x...) -#endif - -#define _r(c) ((c)>>24) -#define _g(c) (((c)>>16)&0xFF) -#define _b(c) (((c)>>8)&0xFF) -#define _a(c) ((c)&0xFF) - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ - -/* ***************************** */ -/* Writer Functions */ -/* ***************************** */ - -static int reset() -{ - return 0; -} - -static int writeData(void *_call) -{ - unsigned char a; - int y; - int res = 0; - WriterFBCallData_t *call = (WriterFBCallData_t *) _call; - - fb_printf(100, "\n"); - if (call == NULL) - { - fb_err("call data is NULL...\n"); - return 0; - } - if (call->destination == NULL) - { - fb_err("file pointer < 0. ignoring ...\n"); - return 0; - } - if (call->data != NULL) - { - unsigned int opacity = 255 - ((unsigned int)_a(call->color)); - unsigned int r = (unsigned int)_r(call->color); - unsigned int g = (unsigned int)_g(call->color); - unsigned int b = (unsigned int) _b(call->color); - int src_stride = call->Stride; - int dst_stride = call->destStride; - int dst_delta = dst_stride - call->Width * 4; - int x, y; - const unsigned char *src = call->data; - unsigned char *dst = call->destination + (call->y * dst_stride + call->x * 4); - //uint32_t *dst = call->destination + call->y * dst_stride + call->x; - unsigned int k, ck, t; - static uint32_t last_color = 0, colortable[256]; - if (last_color != call->color) - { - // call->color is rgba, our spark frame buffer is argb - uint32_t c = call->color >> 8, a = 255 - (call->color & 0xff); - int i; - for (i = 0; i < 256; i++) - { - uint32_t k = (a * i) >> 8; - colortable[i] = k ? (c | (k << 24)) : 0; - } - last_color = call->color; - } - fb_printf(100, "x %d\n", call->x); - fb_printf(100, "y %d\n", call->y); - fb_printf(100, "width %d\n", call->Width); - fb_printf(100, "height %d\n", call->Height); - fb_printf(100, "stride %d\n", call->Stride); - fb_printf(100, "color 0x%.8X\n", call->color); - fb_printf(100, "data %p\n", call->data); - fb_printf(100, "dest %p\n", call->destination); - fb_printf(100, "dest.stride %d\n", call->destStride); - fb_printf(100, "r 0x%hhx, g 0x%hhx, b 0x%hhx, a 0x%hhx, opacity %d\n", r, g, b, a, opacity); - for (y = 0; y < call->Height; y++) - { - for (x = 0; x < call->Width; x++) - { - //uint32_t c = colortable[src[x]]; - //if (c) - // *dst = c; - - k = ((unsigned)src[x]) * opacity / 255; - ck = 255 - k; - t = *dst; - *dst++ = (k * b + ck * t) / 255; - t = *dst; - *dst++ = (k * g + ck * t) / 255; - t = *dst; - *dst++ = (k * r + ck * t) / 255; - t = *dst; - if (k > t)*dst++ = k; - else dst++; - } - dst += dst_delta; - src += src_stride; - } - } - else - { - for (y = 0; y < call->Height; y++) - memset(call->destination + ((call->y + y) * call->destStride) + call->x * 4, 0, call->Width * 4); - } - fb_printf(100, "< %d\n", res); - return res; -} - -/* ***************************** */ -/* Writer Definition */ -/* ***************************** */ -static WriterCaps_t caps = -{ - "framebuffer", - eGfx, - "framebuffer", - 0 -}; - -struct Writer_s WriterFramebuffer = -{ - &reset, - &writeData, - &caps -}; diff --git a/libeplayer3/output/writer/h263.c b/libeplayer3/output/writer/h263.c deleted file mode 100644 index 71c6088..0000000 --- a/libeplayer3/output/writer/h263.c +++ /dev/null @@ -1,165 +0,0 @@ -/* - * linuxdvb output/writer handling. - * - * crow 2010 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" -#include "debug.h" -#include "misc.h" -#include "pes.h" -#include "writer.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ -#define H263_DEBUG - -#ifdef H263_DEBUG - -static short debug_level = 0; -static const char *FILENAME = "h263.c"; - -#define h263_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, FILENAME, __FUNCTION__, ## x); } while (0) -#else -#define h263_printf(level, fmt, x...) -#endif - -#ifndef H263_SILENT -#define h263_err(fmt, x...) do { printf("[%s:%s] " fmt, FILENAME, __FUNCTION__, ## x); } while (0) -#else -#define h263_err(fmt, x...) -#endif -/* ***************************** */ -/* Types */ -/* ***************************** */ - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ - -static int reset() -{ - return 0; -} - -static int writeData(void *_call) -{ - WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - - h263_printf(10, "\n"); - if (call == NULL) - { - h263_err("call data is NULL...\n"); - return 0; - } - h263_printf(10, "VideoPts %lld\n", call->Pts); - if ((call->data == NULL) || (call->len <= 0)) - { - h263_err("NULL Data. ignoring...\n"); - return 0; - } - if (call->fd < 0) - { - h263_err("file pointer < 0. ignoring ...\n"); - return 0; - } - int HeaderLength = InsertPesHeader(PesHeader, call->len, H263_VIDEO_PES_START_CODE, call->Pts, 0); - int PrivateHeaderLength = InsertVideoPrivateDataHeader(&PesHeader[HeaderLength], call->len); - int PesLength = PesHeader[PES_LENGTH_BYTE_0] + (PesHeader[PES_LENGTH_BYTE_1] << 8) + PrivateHeaderLength; - PesHeader[PES_LENGTH_BYTE_0] = PesLength & 0xff; - PesHeader[PES_LENGTH_BYTE_1] = (PesLength >> 8) & 0xff; - PesHeader[PES_HEADER_DATA_LENGTH_BYTE] += PrivateHeaderLength; - PesHeader[PES_FLAGS_BYTE] |= PES_EXTENSION_DATA_PRESENT; - - HeaderLength += PrivateHeaderLength; - struct iovec iov[2]; - iov[0].iov_base = PesHeader; - iov[0].iov_len = HeaderLength; - iov[1].iov_base = call->data; - iov[1].iov_len = call->len; - int len = writev(call->fd, iov, 2); - h263_printf(10, "< len %d\n", len); - return len; -} - -/* ***************************** */ -/* Writer Definition */ -/* ***************************** */ - -static WriterCaps_t caps_h263 = -{ - "h263", - eVideo, - "V_H263", - VIDEO_ENCODING_H263 -}; - -struct Writer_s WriterVideoH263 = -{ - &reset, - &writeData, - &caps_h263 -}; - -static WriterCaps_t caps_flv = -{ - "FLV", - eVideo, - "V_FLV", - VIDEO_ENCODING_FLV1 -}; - -struct Writer_s WriterVideoFLV = -{ - &reset, - &writeData, - &caps_flv -}; diff --git a/libeplayer3/output/writer/h264.c b/libeplayer3/output/writer/h264.c deleted file mode 100644 index afa1bb2..0000000 --- a/libeplayer3/output/writer/h264.c +++ /dev/null @@ -1,343 +0,0 @@ -/* - * linuxdvb output/writer handling. - * - * konfetti 2010 based on linuxdvb.c code from libeplayer2 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" -#include "debug.h" -#include "misc.h" -#include "pes.h" -#include "writer.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ -#define H264_DEBUG - -#ifdef H264_DEBUG - -static short debug_level = 0; - -#define h264_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define h264_printf(level, fmt, x...) -#endif - -#ifndef H264_SILENT -#define h264_err(fmt, x...) do { printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define h264_err(fmt, x...) -#endif - -#define NALU_TYPE_PLAYER2_CONTAINER_PARAMETERS 24 -#define CONTAINER_PARAMETERS_VERSION 0x00 - -/* ***************************** */ -/* Types */ -/* ***************************** */ -typedef struct avcC_s -{ - unsigned char Version; /* configurationVersion */ - unsigned char Profile; /* AVCProfileIndication */ - unsigned char Compatibility; /* profile_compatibility */ - unsigned char Level; /* AVCLevelIndication */ - unsigned char NalLengthMinusOne; /* held in bottom two bits */ - unsigned char NumParamSets; /* held in bottom 5 bits */ - unsigned char Params[1]; /* {length,params}{length,params}...sequence then picture*/ -} avcC_t; - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ -const unsigned char Head[] = {0, 0, 0, 1}; -static int initialHeader = 1; -static unsigned int NalLengthBytes = 1; - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ - -static int reset() -{ - initialHeader = 1; - return 0; -} - -static int writeData(void *_call) -{ - WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - unsigned long long int VideoPts; - unsigned int TimeDelta; - unsigned int TimeScale; - int len = 0; - int ic = 0; - struct iovec iov[128]; - - h264_printf(10, "\n"); - if (call == NULL) - { - h264_err("call data is NULL...\n"); - return 0; - } - TimeDelta = call->FrameRate; - TimeScale = call->FrameScale; - VideoPts = call->Pts; - h264_printf(10, "VideoPts %lld - %d %d\n", call->Pts, TimeDelta, TimeScale); - if ((call->data == NULL) || (call->len <= 0)) - { - h264_err("NULL Data. ignoring...\n"); - return 0; - } - if (call->fd < 0) - { - h264_err("file pointer < 0. ignoring ...\n"); - return 0; - } - if ((call->len > 3) && ((call->data[0] == 0x00 && call->data[1] == 0x00 && call->data[2] == 0x00 && call->data[3] == 0x01) || - (call->data[0] == 0xff && call->data[1] == 0xff && call->data[2] == 0xff && call->data[3] == 0xff))) - { - unsigned int PacketLength = 0; - unsigned int FakeStartCode = (call->Version << 8) | PES_VERSION_FAKE_START_CODE; - iov[ic++].iov_base = PesHeader; - if (initialHeader) - { - initialHeader = 0; - iov[ic].iov_base = call->private_data; - iov[ic++].iov_len = call->private_size; - PacketLength += call->private_size; - } - iov[ic].iov_base = call->data; - iov[ic++].iov_len = call->len; - PacketLength += call->len; - /*Hellmaster1024: some packets will only be accepted by the player if we send one byte more than - data is available. The content of this byte does not matter. It will be ignored - by the player */ - iov[ic].iov_base = ""; - iov[ic++].iov_len = 1; - iov[0].iov_len = InsertPesHeader(PesHeader, PacketLength, MPEG_VIDEO_PES_START_CODE, call->Pts, FakeStartCode); - return writev(call->fd, iov, ic); - } - if (initialHeader) - { - avcC_t *avcCHeader = (avcC_t *)call->private_data; - unsigned int i; - unsigned int ParamSets; - unsigned int ParamOffset; - unsigned int InitialHeaderLength = 0; - unsigned int ParametersLength; - - if (avcCHeader == NULL) - { - h264_err("private_data NULL\n"); - return -1; - } - if (avcCHeader->Version != 1) - h264_err("Error unknown avcC version (%x). Expect problems.\n", avcCHeader->Version); - ParametersLength = 0; - unsigned char HeaderData[19]; - HeaderData[ParametersLength++] = 0x00; // Start code - HeaderData[ParametersLength++] = 0x00; - HeaderData[ParametersLength++] = 0x01; - HeaderData[ParametersLength++] = NALU_TYPE_PLAYER2_CONTAINER_PARAMETERS; - // Container message version - changes when/if we vary the format of the message - HeaderData[ParametersLength++] = CONTAINER_PARAMETERS_VERSION; - HeaderData[ParametersLength++] = 0xff; // Field separator - if (TimeDelta == 0xffffffff) - TimeDelta = (TimeScale > 1000) ? 1001 : 1; - HeaderData[ParametersLength++] = (TimeScale >> 24) & 0xff; // Output the timescale - HeaderData[ParametersLength++] = (TimeScale >> 16) & 0xff; - HeaderData[ParametersLength++] = 0xff; - HeaderData[ParametersLength++] = (TimeScale >> 8) & 0xff; - HeaderData[ParametersLength++] = TimeScale & 0xff; - HeaderData[ParametersLength++] = 0xff; - HeaderData[ParametersLength++] = (TimeDelta >> 24) & 0xff; // Output frame period - HeaderData[ParametersLength++] = (TimeDelta >> 16) & 0xff; - HeaderData[ParametersLength++] = 0xff; - HeaderData[ParametersLength++] = (TimeDelta >> 8) & 0xff; - HeaderData[ParametersLength++] = TimeDelta & 0xff; - HeaderData[ParametersLength++] = 0xff; - HeaderData[ParametersLength++] = 0x80; // Rsbp trailing bits - assert(ParametersLength <= sizeof(HeaderData)); - ic = 0; - iov[ic].iov_base = PesHeader; - iov[ic++].iov_len = InsertPesHeader(PesHeader, ParametersLength, MPEG_VIDEO_PES_START_CODE, INVALID_PTS_VALUE, 0); - iov[ic].iov_base = HeaderData; - iov[ic++].iov_len = ParametersLength; - len = writev(call->fd, iov, ic); - if (len < 0) - return len; - NalLengthBytes = (avcCHeader->NalLengthMinusOne & 0x03) + 1; - ParamSets = avcCHeader->NumParamSets & 0x1f; - h264_printf(20, "avcC contents:\n"); - h264_printf(20, " version: %d\n", avcCHeader->Version); - h264_printf(20, " profile: %d\n", avcCHeader->Profile); - h264_printf(20, " profile compatibility: %d\n", avcCHeader->Compatibility); - h264_printf(20, " level: %d\n", avcCHeader->Level); - h264_printf(20, " nal length bytes: %d\n", NalLengthBytes); - h264_printf(20, " number of sequence param sets: %d\n", ParamSets); - ParamOffset = 0; - ic = 0; - iov[ic++].iov_base = PesHeader; - for (i = 0; i < ParamSets; i++) - { - unsigned int PsLength = (avcCHeader->Params[ParamOffset] << 8) + avcCHeader->Params[ParamOffset + 1]; - h264_printf(20, " sps %d has length %d\n", i, PsLength); - iov[ic].iov_base = (char *)Head; - iov[ic++].iov_len = sizeof(Head); - InitialHeaderLength += sizeof(Head); - iov[ic].iov_base = &avcCHeader->Params[ParamOffset + 2]; - iov[ic++].iov_len = PsLength; - InitialHeaderLength += PsLength; - ParamOffset += PsLength + 2; - } - ParamSets = avcCHeader->Params[ParamOffset]; - h264_printf(20, " number of picture param sets: %d\n", ParamSets); - ParamOffset++; - for (i = 0; i < ParamSets; i++) - { - unsigned int PsLength = (avcCHeader->Params[ParamOffset] << 8) + avcCHeader->Params[ParamOffset + 1]; - h264_printf(20, " pps %d has length %d\n", i, PsLength); - iov[ic].iov_base = (char *) Head; - iov[ic++].iov_len = sizeof(Head); - InitialHeaderLength += sizeof(Head); - iov[ic].iov_base = &avcCHeader->Params[ParamOffset + 2]; - iov[ic++].iov_len = PsLength; - InitialHeaderLength += PsLength; - ParamOffset += PsLength + 2; - } - iov[0].iov_len = InsertPesHeader(PesHeader, InitialHeaderLength, MPEG_VIDEO_PES_START_CODE, INVALID_PTS_VALUE, 0); - ssize_t l = writev(call->fd, iov, ic); - if (l < 0) - return l; - len += l; - initialHeader = 0; - } - unsigned int SampleSize = call->len; - unsigned int NalStart = 0; - unsigned int VideoPosition = 0; - do - { - unsigned int NalLength; - unsigned char NalData[4]; - int NalPresent = 1; - - memcpy(NalData, call->data + VideoPosition, NalLengthBytes); - VideoPosition += NalLengthBytes; - NalStart += NalLengthBytes; - switch (NalLengthBytes) - { - case 1: - NalLength = (NalData[0]); - break; - case 2: - NalLength = (NalData[0] << 8) | (NalData[1]); - break; - case 3: - NalLength = (NalData[0] << 16) | (NalData[1] << 8) | (NalData[2]); - break; - default: - NalLength = (NalData[0] << 24) | (NalData[1] << 16) | (NalData[2] << 8) | (NalData[3]); - break; - } - h264_printf(20, "NalStart = %u + NalLength = %u > SampleSize = %u\n", NalStart, NalLength, SampleSize); - if (NalStart + NalLength > SampleSize) - { - h264_printf(20, "nal length past end of buffer - size %u frame offset %u left %u\n", - NalLength, NalStart , SampleSize - NalStart); - NalStart = SampleSize; - } - else - { - NalStart += NalLength; - ic = 0; - iov[ic++].iov_base = PesHeader; - if (NalPresent) - { - NalPresent = 0; - iov[ic].iov_base = (char *)Head; - iov[ic++].iov_len = sizeof(Head); - } - iov[ic].iov_base = call->data + VideoPosition; - iov[ic++].iov_len = NalLength; - VideoPosition += NalLength; - h264_printf(20, " pts=%llu\n", VideoPts); - iov[0].iov_len = InsertPesHeader(PesHeader, NalLength, MPEG_VIDEO_PES_START_CODE, VideoPts, 0); - ssize_t l = writev(call->fd, iov, ic); - if (l < 0) - return l; - len += l; - VideoPts = INVALID_PTS_VALUE; - } - } - while (NalStart < SampleSize); - if (len < 0) - { - h264_err("error writing data errno = %d\n", errno); - h264_err("%s\n", strerror(errno)); - } - h264_printf(10, "< len %d\n", len); - return len; -} -/* ***************************** */ -/* Writer Definition */ -/* ***************************** */ - -static WriterCaps_t caps = -{ - "h264", - eVideo, - "V_MPEG4/ISO/AVC", - VIDEO_ENCODING_H264 -}; - -struct Writer_s WriterVideoH264 = -{ - &reset, - &writeData, - &caps -}; diff --git a/libeplayer3/output/writer/misc.c b/libeplayer3/output/writer/misc.c deleted file mode 100644 index 51469be..0000000 --- a/libeplayer3/output/writer/misc.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * LinuxDVB Output handling. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" -#include "debug.h" -#include "misc.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ - -void PutBits(BitPacker_t *ld, unsigned int code, unsigned int length) -{ - unsigned int bit_buf; - unsigned int bit_left; - - bit_buf = ld->BitBuffer; - bit_left = ld->Remaining; -#ifdef DEBUG_PUTBITS - if (ld->debug) - dprintf("code = %d, length = %d, bit_buf = 0x%x, bit_left = %d\n", code, length, bit_buf, bit_left); -#endif /* DEBUG_PUTBITS */ - if (length < bit_left) - { - /* fits into current buffer */ - bit_buf = (bit_buf << length) | code; - bit_left -= length; - } - else - { - /* doesn't fit */ - bit_buf <<= bit_left; - bit_buf |= code >> (length - bit_left); - ld->Ptr[0] = (char)(bit_buf >> 24); - ld->Ptr[1] = (char)(bit_buf >> 16); - ld->Ptr[2] = (char)(bit_buf >> 8); - ld->Ptr[3] = (char)bit_buf; - ld->Ptr += 4; - length -= bit_left; - bit_buf = code & ((1 << length) - 1); - bit_left = 32 - length; - bit_buf = code; - } -#ifdef DEBUG_PUTBITS - if (ld->debug) - dprintf("bit_left = %d, bit_buf = 0x%x\n", bit_left, bit_buf); -#endif /* DEBUG_PUTBITS */ - /* writeback */ - ld->BitBuffer = bit_buf; - ld->Remaining = bit_left; -} - -void FlushBits(BitPacker_t *ld) -{ - ld->BitBuffer <<= ld->Remaining; - while (ld->Remaining < 32) - { -#ifdef DEBUG_PUTBITS - if (ld->debug) - dprintf("flushing 0x%2.2x\n", ld->BitBuffer >> 24); -#endif /* DEBUG_PUTBITS */ - *ld->Ptr++ = ld->BitBuffer >> 24; - ld->BitBuffer <<= 8; - ld->Remaining += 8; - } - ld->Remaining = 32; - ld->BitBuffer = 0; -} diff --git a/libeplayer3/output/writer/mp3.c b/libeplayer3/output/writer/mp3.c deleted file mode 100644 index 1d49da7..0000000 --- a/libeplayer3/output/writer/mp3.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * linuxdvb output/writer handling. - * - * konfetti 2010 based on linuxdvb.c code from libeplayer2 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" -#include "debug.h" -#include "misc.h" -#include "pes.h" -#include "writer.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ -#define MP3_DEBUG - -#ifdef MP3_DEBUG - -static short debug_level = 0; - -#define mp3_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define mp3_printf(level, fmt, x...) -#endif - -#ifndef MP3_SILENT -#define mp3_err(fmt, x...) do { printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define mp3_err(fmt, x...) -#endif - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ - -static int reset() -{ - return 0; -} - -static int writeData(void *_call) -{ - WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - - mp3_printf(10, "\n"); - if (call == NULL) - { - mp3_err("call data is NULL...\n"); - return 0; - } - mp3_printf(10, "AudioPts %lld\n", call->Pts); - if ((call->data == NULL) || (call->len <= 0)) - { - mp3_err("parsing NULL Data. ignoring...\n"); - return 0; - } - if (call->fd < 0) - { - mp3_err("file pointer < 0. ignoring ...\n"); - return 0; - } - struct iovec iov[2]; - iov[0].iov_base = PesHeader; - iov[0].iov_len = InsertPesHeader(PesHeader, call->len , MPEG_AUDIO_PES_START_CODE, call->Pts, 0); - iov[1].iov_base = call->data; - iov[1].iov_len = call->len; - int len = writev(call->fd, iov, 2); - mp3_printf(10, "mp3_Write-< len=%d\n", len); - return len; -} - -/* ***************************** */ -/* Writer Definition */ -/* ***************************** */ - -static WriterCaps_t caps_mp3 = -{ - "mp3", - eAudio, - "A_MP3", - AUDIO_ENCODING_MP3 -}; - -struct Writer_s WriterAudioMP3 = -{ - &reset, - &writeData, - &caps_mp3 -}; - -static WriterCaps_t caps_mpegl3 = -{ - "mpeg/l3", - eAudio, - "A_MPEG/L3", - AUDIO_ENCODING_MPEG2 -}; - -struct Writer_s WriterAudioMPEGL3 = -{ - &reset, - &writeData, - &caps_mpegl3 -}; - -static WriterCaps_t caps_vorbis = -{ - "vorbis", - eAudio, - "A_VORBIS", - AUDIO_ENCODING_VORBIS -}; - -struct Writer_s WriterAudioVORBIS = -{ - &reset, - &writeData, - &caps_vorbis -}; diff --git a/libeplayer3/output/writer/mpeg2.c b/libeplayer3/output/writer/mpeg2.c deleted file mode 100644 index a2ce9b4..0000000 --- a/libeplayer3/output/writer/mpeg2.c +++ /dev/null @@ -1,174 +0,0 @@ -/* - * linuxdvb output/writer handling. - * - * konfetti 2010 based on linuxdvb.c code from libeplayer2 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" -#include "debug.h" -#include "misc.h" -#include "pes.h" -#include "writer.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ - -#define MPEG2_DEBUG - -#ifdef MPEG2_DEBUG - -static short debug_level = 0; - -#define mpeg2_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define mpeg2_printf(level, fmt, x...) -#endif - -#ifndef MPEG2_SILENT -#define mpeg2_err(fmt, x...) do { printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define mpeg2_err(fmt, x...) -#endif - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ - -static int reset() -{ - return 0; -} - -static int writeData(void *_call) -{ - WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - int len = 0; - unsigned int Position = 0; - - mpeg2_printf(10, "\n"); - if (call == NULL) - { - mpeg2_err("call data is NULL...\n"); - return 0; - } - mpeg2_printf(10, "VideoPts %lld\n", call->Pts); - if ((call->data == NULL) || (call->len <= 0)) - { - mpeg2_err("parsing NULL Data. ignoring...\n"); - return 0; - } - if (call->fd < 0) - { - mpeg2_err("file pointer < 0. ignoring ...\n"); - return 0; - } - while (Position < call->len) - { - int PacketLength = (call->len - Position) <= MAX_PES_PACKET_SIZE ? - (call->len - Position) : MAX_PES_PACKET_SIZE; - int Remaining = call->len - Position - PacketLength; - - mpeg2_printf(20, "PacketLength=%d, Remaining=%d, Position=%d\n", PacketLength, Remaining, Position); - struct iovec iov[2]; - iov[0].iov_base = PesHeader; - iov[0].iov_len = InsertPesHeader(PesHeader, PacketLength, 0xe0, call->Pts, 0); - iov[1].iov_base = call->data + Position; - iov[1].iov_len = PacketLength; - ssize_t l = writev(call->fd, iov, 2); - if (l < 0) - { - len = l; - break; - } - len += l; - Position += PacketLength; - call->Pts = INVALID_PTS_VALUE; - } - mpeg2_printf(10, "< len %d\n", len); - return len; -} - -/* ***************************** */ -/* Writer Definition */ -/* ***************************** */ -static WriterCaps_t caps = -{ - "mpeg2", - eVideo, - "V_MPEG2", - VIDEO_ENCODING_AUTO -}; - -struct Writer_s WriterVideoMPEG2 = -{ - &reset, - &writeData, - &caps -}; - -static WriterCaps_t h264_caps = -{ - "mpges_h264", - eVideo, - "V_MPEG2/H264", - VIDEO_ENCODING_H264 -}; - -struct Writer_s WriterVideoMPEGH264 = -{ - &reset, - &writeData, - &h264_caps -}; diff --git a/libeplayer3/output/writer/pcm.c b/libeplayer3/output/writer/pcm.c deleted file mode 100644 index 957f543..0000000 --- a/libeplayer3/output/writer/pcm.c +++ /dev/null @@ -1,318 +0,0 @@ -/* - * linuxdvb output/writer handling. - * - * konfetti 2010 based on linuxdvb.c code from libeplayer2 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" -#include "debug.h" -#include "misc.h" -#include "pes.h" -#include "writer.h" -#include "pcm.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ -#define PCM_DEBUG - -#ifdef PCM_DEBUG - -static short debug_level = 0; - -#define pcm_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define pcm_printf(level, fmt, x...) -#endif - -#ifndef PCM_SILENT -#define pcm_err(fmt, x...) do { printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define pcm_err(fmt, x...) -#endif - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ - -static int initialHeader = 1; - -static unsigned int SubFrameLen = 0; -static unsigned int SubFramesPerPES = 0; - -// reference: search for TypeLpcmDVDAudio in player/frame_parser/frame_parser_audio_lpcm.cpp -static const unsigned char clpcm_prv[14] = { 0xA0, //sub_stream_id - 0, 0, //resvd and UPC_EAN_ISRC stuff, unused - 0x0A, //private header length - 0, 9, //first_access_unit_pointer - 0x00, //emph,rsvd,stereo,downmix - 0x0F, //quantisation word length 1,2 - 0x0F, //audio sampling freqency 1,2 - 0, //resvd, multi channel type - 0, //bit shift on channel GR2, assignment - 0x80, //dynamic range control - 0, 0 //resvd for copyright management - }; - -static unsigned char lpcm_prv[14]; - -static unsigned char breakBuffer[8192]; -static unsigned int breakBufferFillSize = 0; - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ - -static int prepareClipPlay(int uNoOfChannels, int uSampleRate, int uBitsPerSample, int bLittleEndian __attribute__((unused))) -{ - printf("rate: %d ch: %d bits: %d (%d bps)\n", - uSampleRate/*Format->dwSamplesPerSec*/, - uNoOfChannels/*Format->wChannels*/, - uBitsPerSample/*Format->wBitsPerSample*/, - (uBitsPerSample/*Format->wBitsPerSample*/ / 8) - ); - SubFrameLen = 0; - SubFramesPerPES = 0; - breakBufferFillSize = 0; - memcpy(lpcm_prv, clpcm_prv, sizeof(lpcm_prv)); - //figure out size of subframe - //and set up sample rate - switch (uSampleRate) - { - case 48000: - SubFrameLen = 40; - break; - case 96000: - lpcm_prv[8] |= 0x10; - SubFrameLen = 80; - break; - case 192000: - lpcm_prv[8] |= 0x20; - SubFrameLen = 160; - break; - case 44100: - lpcm_prv[8] |= 0x80; - SubFrameLen = 40; - break; - case 88200: - lpcm_prv[8] |= 0x90; - SubFrameLen = 80; - break; - case 176400: - lpcm_prv[8] |= 0xA0; - SubFrameLen = 160; - break; - default: - break; - } - SubFrameLen *= uNoOfChannels; - SubFrameLen *= (uBitsPerSample / 8); - //rewrite PES size to have as many complete subframes per PES as we can - // FIXME: PES header size was hardcoded to 18 in previous code. Actual size returned by InsertPesHeader is 14. - SubFramesPerPES = ((2048 - 18) - sizeof(lpcm_prv)) / SubFrameLen; - SubFrameLen *= SubFramesPerPES; - //set number of channels - lpcm_prv[10] = uNoOfChannels - 1; - switch (uBitsPerSample) - { - case 24: - lpcm_prv[7] |= 0x20; - case 16: - break; - default: - printf("inappropriate bits per sample (%d) - must be 16 or 24\n", uBitsPerSample); - return 1; - } - return 0; -} - -static int reset() -{ - initialHeader = 1; - return 0; -} - -static int writeData(void *_call) -{ - WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - - pcm_printf(10, "\n"); - if (!call) - { - pcm_err("call data is NULL...\n"); - return 0; - } - pcm_printf(10, "AudioPts %lld\n", call->Pts); - if (!call->data || (call->len <= 0)) - { - pcm_err("parsing NULL Data. ignoring...\n"); - return 0; - } - if (call->fd < 0) - { - pcm_err("file pointer < 0. ignoring ...\n"); - return 0; - } - pcmPrivateData_t *pcmPrivateData = (pcmPrivateData_t *)call->private_data; - if (initialHeader) - { - initialHeader = 0; - prepareClipPlay(pcmPrivateData->uNoOfChannels, pcmPrivateData->uSampleRate, - pcmPrivateData->uBitsPerSample, pcmPrivateData->bLittleEndian); - } - unsigned char *buffer = call->data; - unsigned int size = call->len; - unsigned int n; - unsigned char *injectBuffer = (unsigned char *)malloc(SubFrameLen); - unsigned int pos; - for (pos = 0; pos < size;) - { - //printf("PCM %s - Position=%d\n", __FUNCTION__, pos); - if ((size - pos) < SubFrameLen) - { - breakBufferFillSize = size - pos; - memcpy(breakBuffer, &buffer[pos], sizeof(unsigned char) * breakBufferFillSize); - //printf("PCM %s - Unplayed=%d\n", __FUNCTION__, breakBufferFillSize); - break; - } - //get first PES's worth - if (breakBufferFillSize > 0) - { - memcpy(injectBuffer, breakBuffer, sizeof(unsigned char)*breakBufferFillSize); - memcpy(&injectBuffer[breakBufferFillSize], &buffer[pos], sizeof(unsigned char) * (SubFrameLen - breakBufferFillSize)); - pos += (SubFrameLen - breakBufferFillSize); - breakBufferFillSize = 0; - } - else - { - memcpy(injectBuffer, &buffer[pos], sizeof(unsigned char)*SubFrameLen); - pos += SubFrameLen; - } - struct iovec iov[3]; - iov[0].iov_base = PesHeader; - iov[1].iov_base = lpcm_prv; - iov[1].iov_len = sizeof(lpcm_prv); - iov[2].iov_base = injectBuffer; - iov[2].iov_len = SubFrameLen; - //write the PCM data - if (pcmPrivateData->uBitsPerSample == 16) - { - for (n = 0; n < SubFrameLen; n += 2) - { - unsigned char tmp; - tmp = injectBuffer[n]; - injectBuffer[n] = injectBuffer[n + 1]; - injectBuffer[n + 1] = tmp; - } - } - else - { - // 0 1 2 3 4 5 6 7 8 9 10 11 - // A1c A1b A1a-B1c B1b B1a-A2c A2b A2a-B2c B2b B2a - // to A1a A1b B1a B1b.A2a A2b B2a B2b-A1c B1c A2c B2c - for (n = 0; n < SubFrameLen; n += 12) - { - unsigned char t, *p = &injectBuffer[n]; - t = p[0]; - p[ 0] = p[ 2]; - p[ 2] = p[ 5]; - p[ 5] = p[ 7]; - p[ 7] = p[11]; - p[11] = p[ 9]; - p[ 9] = p[ 3]; - p[ 3] = p[ 4]; - p[ 4] = p[ 8]; - p[ 8] = t; - } - } - //increment err... subframe count? - lpcm_prv[1] = ((lpcm_prv[1] + SubFramesPerPES) & 0x1F); - iov[0].iov_len = InsertPesHeader(PesHeader, iov[1].iov_len + iov[2].iov_len, PCM_PES_START_CODE, call->Pts, 0); - int len = writev(call->fd, iov, 3); - if (len < 0) - break; - } - free(injectBuffer); - return size; -} - -/* ***************************** */ -/* Writer Definition */ -/* ***************************** */ - -static WriterCaps_t caps_pcm = -{ - "pcm", - eAudio, - "A_PCM", - AUDIO_ENCODING_LPCMA -}; - -struct Writer_s WriterAudioPCM = -{ - &reset, - &writeData, - &caps_pcm -}; - -static WriterCaps_t caps_ipcm = -{ - "ipcm", - eAudio, - "A_IPCM", - AUDIO_ENCODING_LPCMA -}; - -struct Writer_s WriterAudioIPCM = -{ - &reset, - &writeData, - &caps_ipcm -}; diff --git a/libeplayer3/output/writer/pes.c b/libeplayer3/output/writer/pes.c deleted file mode 100644 index 673a66f..0000000 --- a/libeplayer3/output/writer/pes.c +++ /dev/null @@ -1,146 +0,0 @@ -/* - * linuxdvb output/writer handling. - * - * konfetti 2010 based on linuxdvb.c code from libeplayer2 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" -#include "debug.h" -#include "misc.h" -#include "pes.h" -#include "writer.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* Functions */ -/* ***************************** */ - -int InsertVideoPrivateDataHeader(unsigned char *data, unsigned int payload_size) -{ - BitPacker_t ld2 = {data, 0, 32}; - int i; - - PutBits(&ld2, PES_PRIVATE_DATA_FLAG, 8); - PutBits(&ld2, payload_size & 0xff, 8); - PutBits(&ld2, (payload_size >> 8) & 0xff, 8); - PutBits(&ld2, (payload_size >> 16) & 0xff, 8); - for (i = 4; i < (PES_PRIVATE_DATA_LENGTH + 1); i++) - PutBits(&ld2, 0, 8); - FlushBits(&ld2); - return PES_PRIVATE_DATA_LENGTH + 1; -} - -int InsertPesHeader(unsigned char *data, unsigned int size, unsigned char stream_id, unsigned long long int pts, int pic_start_code) -{ - BitPacker_t ld2 = {data, 0, 32}; - /* - if (size > MAX_PES_PACKET_SIZE) - { - printf("%s: Packet size %u bigger than %uK eeeekkkkk\n",__FUNCTION__, size, (unsigned int)(MAX_PES_PACKET_SIZE/1024)); - size = 0; // unbounded - } - */ - PutBits(&ld2, 0x0 , 8); - PutBits(&ld2, 0x0 , 8); - PutBits(&ld2, 0x1 , 8); // Start Code - PutBits(&ld2, stream_id , 8); // Stream_id = Audio Stream - //4 - PutBits(&ld2, size + 3 + (pts != INVALID_PTS_VALUE ? 5 : 0) + (pic_start_code ? (5) : 0), 16); // PES_packet_length - //6 = 4+2 - PutBits(&ld2, 0x2 , 2); // 10 - PutBits(&ld2, 0x0 , 2); // PES_Scrambling_control - PutBits(&ld2, 0x0 , 1); // PES_Priority - PutBits(&ld2, 0x0 , 1); // data_alignment_indicator - PutBits(&ld2, 0x0 , 1); // Copyright - PutBits(&ld2, 0x0 , 1); // Original or Copy - //7 = 6+1 - if (pts != INVALID_PTS_VALUE) - PutBits(&ld2, 0x2 , 2); - else - PutBits(&ld2, 0x0 , 2); // PTS_DTS flag - PutBits(&ld2, 0x0 , 1); // ESCR_flag - PutBits(&ld2, 0x0 , 1); // ES_rate_flag - PutBits(&ld2, 0x0 , 1); // DSM_trick_mode_flag - PutBits(&ld2, 0x0 , 1); // additional_copy_ingo_flag - PutBits(&ld2, 0x0 , 1); // PES_CRC_flag - PutBits(&ld2, 0x0 , 1); // PES_extension_flag - //8 = 7+1 - if (pts != INVALID_PTS_VALUE) - PutBits(&ld2, 0x5, 8); - else - PutBits(&ld2, 0x0 , 8); // PES_header_data_length - //9 = 8+1 - if (pts != INVALID_PTS_VALUE) - { - PutBits(&ld2, 0x2, 4); - PutBits(&ld2, (pts >> 30) & 0x7, 3); - PutBits(&ld2, 0x1, 1); - PutBits(&ld2, (pts >> 15) & 0x7fff, 15); - PutBits(&ld2, 0x1, 1); - PutBits(&ld2, pts & 0x7fff, 15); - PutBits(&ld2, 0x1, 1); - } - //14 = 9+5 - if (pic_start_code) - { - PutBits(&ld2, 0x0 , 8); - PutBits(&ld2, 0x0 , 8); - PutBits(&ld2, 0x1 , 8); // Start Code - PutBits(&ld2, pic_start_code & 0xff , 8); // 00, for picture start - PutBits(&ld2, (pic_start_code >> 8) & 0xff, 8); // For any extra information (like in mpeg4p2, the pic_start_code) - //14 + 4 = 18 - } - FlushBits(&ld2); - return (ld2.Ptr - data); -} diff --git a/libeplayer3/output/writer/vc1.c b/libeplayer3/output/writer/vc1.c deleted file mode 100644 index 90acb2d..0000000 --- a/libeplayer3/output/writer/vc1.c +++ /dev/null @@ -1,257 +0,0 @@ -/* - * linuxdvb output/writer handling. - * - * konfetti 2010 based on linuxdvb.c code from libeplayer2 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" -#include "debug.h" -#include "misc.h" -#include "pes.h" -#include "writer.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ - -#define WMV3_PRIVATE_DATA_LENGTH 4 - -#define METADATA_STRUCT_A_START 12 -#define METADATA_STRUCT_B_START 24 -#define METADATA_STRUCT_B_FRAMERATE_START 32 -#define METADATA_STRUCT_C_START 8 - -#define VC1_SEQUENCE_LAYER_METADATA_START_CODE 0x80 -#define VC1_FRAME_START_CODE 0x0d - -#define VC1_DEBUG - -#ifdef VC1_DEBUG - -static short debug_level = 0; - -#define vc1_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define vc1_printf(level, fmt, x...) -#endif - -#ifndef VC1_SILENT -#define vc1_err(fmt, x...) do { printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define vc1_err(fmt, x...) -#endif - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -static const unsigned char SequenceLayerStartCode[] = {0x00, 0x00, 0x01, VC1_SEQUENCE_LAYER_METADATA_START_CODE}; - -static const unsigned char Metadata[] = -{ - 0x00, 0x00, 0x00, 0xc5, - 0x04, 0x00, 0x00, 0x00, - 0xc0, 0x00, 0x00, 0x00, /* Struct C set for for advanced profile*/ - 0x00, 0x00, 0x00, 0x00, /* Struct A */ - 0x00, 0x00, 0x00, 0x00, - 0x0c, 0x00, 0x00, 0x00, - 0x60, 0x00, 0x00, 0x00, /* Struct B */ - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 -}; - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ -static int initialHeader = 1; -static unsigned char FrameHeaderSeen = 0; - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ -static int reset() -{ - initialHeader = 1; - FrameHeaderSeen = 0; - return 0; -} - -static int writeData(void *_call) -{ - WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - int len = 0; - - vc1_printf(10, "\n"); - if (call == NULL) - { - vc1_err("call data is NULL...\n"); - return 0; - } - if ((call->data == NULL) || (call->len <= 0)) - { - vc1_err("parsing NULL Data. ignoring...\n"); - return 0; - } - if (call->fd < 0) - { - vc1_err("file pointer < 0. ignoring ...\n"); - return 0; - } - vc1_printf(10, "VideoPts %lld\n", call->Pts); - vc1_printf(10, "Got Private Size %d\n", call->private_size); - if (initialHeader) - { - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - unsigned char PesPayload[128]; - unsigned char *PesPtr; - unsigned int crazyFramerate = 0; - struct iovec iov[2]; - vc1_printf(10, "Framerate: %u\n", call->FrameRate); - vc1_printf(10, "biWidth: %d\n", call->Width); - vc1_printf(10, "biHeight: %d\n", call->Height); - crazyFramerate = ((10000000.0 / call->FrameRate) * 1000.0); - vc1_printf(10, "crazyFramerate: %u\n", crazyFramerate); - memset(PesPayload, 0, sizeof(PesPayload)); - PesPtr = PesPayload; - memcpy(PesPtr, SequenceLayerStartCode, sizeof(SequenceLayerStartCode)); - PesPtr += sizeof(SequenceLayerStartCode); - memcpy(PesPtr, Metadata, sizeof(Metadata)); - PesPtr += METADATA_STRUCT_C_START; - PesPtr += WMV3_PRIVATE_DATA_LENGTH; - /* Metadata Header Struct A */ - *PesPtr++ = (call->Height >> 0) & 0xff; - *PesPtr++ = (call->Height >> 8) & 0xff; - *PesPtr++ = (call->Height >> 16) & 0xff; - *PesPtr++ = call->Height >> 24; - *PesPtr++ = (call->Width >> 0) & 0xff; - *PesPtr++ = (call->Width >> 8) & 0xff; - *PesPtr++ = (call->Width >> 16) & 0xff; - *PesPtr++ = call->Width >> 24; - PesPtr += 12; /* Skip flag word and Struct B first 8 bytes */ - *PesPtr++ = (crazyFramerate >> 0) & 0xff; - *PesPtr++ = (crazyFramerate >> 8) & 0xff; - *PesPtr++ = (crazyFramerate >> 16) & 0xff; - *PesPtr++ = crazyFramerate >> 24; - iov[0].iov_base = PesHeader; - iov[1].iov_base = PesPayload; - iov[1].iov_len = PesPtr - PesPayload; - iov[0].iov_len = InsertPesHeader(PesHeader, iov[1].iov_len, VC1_VIDEO_PES_START_CODE, INVALID_PTS_VALUE, 0); - len = writev(call->fd, iov, 2); - /* For VC1 the codec private data is a standard vc1 sequence header so we just copy it to the output */ - iov[0].iov_base = PesHeader; - iov[1].iov_base = call->private_data; - iov[1].iov_len = call->private_size; - iov[0].iov_len = InsertPesHeader(PesHeader, iov[1].iov_len, VC1_VIDEO_PES_START_CODE, INVALID_PTS_VALUE, 0); - len = writev(call->fd, iov, 2); - initialHeader = 0; - } - if (call->len > 0 && call->data) - { - unsigned int Position = 0; - unsigned char insertSampleHeader = 1; - while (Position < call->len) - { - int PacketLength = (call->len - Position) <= MAX_PES_PACKET_SIZE ? - (call->len - Position) : MAX_PES_PACKET_SIZE; - int Remaining = call->len - Position - PacketLength; - vc1_printf(20, "PacketLength=%d, Remaining=%d, Position=%d\n", PacketLength, Remaining, Position); - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - int HeaderLength = InsertPesHeader(PesHeader, PacketLength, VC1_VIDEO_PES_START_CODE, call->Pts, 0); - if (insertSampleHeader) - { - const unsigned char Vc1FrameStartCode[] = {0, 0, 1, VC1_FRAME_START_CODE}; - /* - vc1_printf(10, "Data Start: {00 00 01 0d} - "); - int i; - for (i = 0; i < 4; i++) vc1_printf(10, "%02x ", call->data[i]); - vc1_printf(10, "\n"); - */ - if (!FrameHeaderSeen && (call->len > 3) && (memcmp(call->data, Vc1FrameStartCode, 4) == 0)) - FrameHeaderSeen = 1; - if (!FrameHeaderSeen) - { - memcpy(&PesHeader[HeaderLength], Vc1FrameStartCode, sizeof(Vc1FrameStartCode)); - HeaderLength += sizeof(Vc1FrameStartCode); - } - insertSampleHeader = 0; - } - struct iovec iov[2]; - iov[0].iov_base = PesHeader; - iov[0].iov_len = HeaderLength; - iov[1].iov_base = call->data + Position; - iov[1].iov_len = PacketLength; - ssize_t l = writev(call->fd, iov, 2); - if (l < 0) - { - len = l; - break; - } - len += l; - Position += PacketLength; - call->Pts = INVALID_PTS_VALUE; - } - } - vc1_printf(10, "< %d\n", len); - return len; -} - -/* ***************************** */ -/* Writer Definition */ -/* ***************************** */ - -static WriterCaps_t caps = -{ - "vc1", - eVideo, - "V_VC1", - VIDEO_ENCODING_VC1 -}; - -struct Writer_s WriterVideoVC1 = -{ - &reset, - &writeData, - &caps -}; diff --git a/libeplayer3/output/writer/vorbis.c b/libeplayer3/output/writer/vorbis.c deleted file mode 100644 index 7a8badc..0000000 --- a/libeplayer3/output/writer/vorbis.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * linuxdvb output/writer handling. - * - * konfetti 2010 based on linuxdvb.c code from libeplayer2 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" -#include "debug.h" -#include "stm_ioctls.h" -#include "misc.h" -#include "pes.h" -#include "writer.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ -#define VORBIS_DEBUG - -#ifdef VORBIS_DEBUG - -static short debug_level = 1; - -#define vorbis_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define vorbis_printf(level, fmt, x...) -#endif - -#ifndef VORBIS_SILENT -#define vorbis_err(fmt, x...) do { printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define vorbis_err(fmt, x...) -#endif - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ - -static int reset() -{ - return 0; -} - -static int writeData(void *_call) -{ - WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - vorbis_printf(10, "\n"); - if (call == NULL) - { - vorbis_err("call data is NULL...\n"); - return 0; - } - vorbis_printf(10, "AudioPts %lld\n", call->Pts); - if ((call->data == NULL) || (call->len <= 0)) - { - vorbis_err("parsing NULL Data. ignoring...\n"); - return 0; - } - if (call->fd < 0) - { - vorbis_err("file pointer < 0. ignoring ...\n"); - return 0; - } - int HeaderLength = InsertPesHeader(PesHeader, call->len , MPEG_AUDIO_PES_START_CODE, call->Pts, 0); - unsigned char *PacketStart = malloc(call->len + HeaderLength); - memcpy(PacketStart, PesHeader, HeaderLength); - memcpy(PacketStart + HeaderLength, call->data, call->len); - int len = write(call->fd, PacketStart, call->len + HeaderLength); - free(PacketStart); - vorbis_printf(10, "vorbis_Write-< len=%d\n", len); - return len; -} - -/* ***************************** */ -/* Writer Definition */ -/* ***************************** */ - -static WriterCaps_t caps_vorbis = -{ - "vorbis", - eAudio, - "A_VORBIS", - AUDIO_ENCODING_VORBIS -}; - -struct Writer_s WriterAudioVORBIS = -{ - &reset, - &writeData, - &caps_vorbis -}; diff --git a/libeplayer3/output/writer/wmv.c b/libeplayer3/output/writer/wmv.c deleted file mode 100644 index 6a0a8e2..0000000 --- a/libeplayer3/output/writer/wmv.c +++ /dev/null @@ -1,247 +0,0 @@ -/* - * linuxdvb output/writer handling. - * - * konfetti 2010 based on linuxdvb.c code from libeplayer2 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "output.h" -#include "debug.h" -#include "misc.h" -#include "pes.h" -#include "writer.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ - -#define WMV3_PRIVATE_DATA_LENGTH 4 - -#define METADATA_STRUCT_A_START 12 -#define METADATA_STRUCT_B_START 24 -#define METADATA_STRUCT_B_FRAMERATE_START 32 -#define METADATA_STRUCT_C_START 8 - -#define WMV_DEBUG - -#ifdef WMV_DEBUG - -static short debug_level = 0; - -#define wmv_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define wmv_printf(level, fmt, x...) -#endif - -#ifndef WMV_SILENT -#define wmv_err(fmt, x...) do { printf("[%s:%s] " fmt, __FILE__, __FUNCTION__, ## x); } while (0) -#else -#define wmv_err(fmt, x...) -#endif - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -typedef struct -{ - unsigned char privateData[WMV3_PRIVATE_DATA_LENGTH]; - unsigned int width; - unsigned int height; - unsigned int framerate; -} awmv_t; - -static const unsigned char Metadata[] = -{ - 0x00, 0x00, 0x00, 0xc5, - 0x04, 0x00, 0x00, 0x00, - 0xc0, 0x00, 0x00, 0x00, /* Struct C set for for advanced profile*/ - 0x00, 0x00, 0x00, 0x00, /* Struct A */ - 0x00, 0x00, 0x00, 0x00, - 0x0c, 0x00, 0x00, 0x00, - 0x60, 0x00, 0x00, 0x00, /* Struct B */ - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 -}; - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ -static int initialHeader = 1; - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ -static int reset() -{ - initialHeader = 1; - return 0; -} - -static int writeData(void *_call) -{ - WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - awmv_t private_data; - int len = 0; - - wmv_printf(10, "\n"); - if (call == NULL) - { - wmv_err("call data is NULL...\n"); - return 0; - } - if ((call->data == NULL) || (call->len <= 0)) - { - wmv_err("parsing NULL Data. ignoring...\n"); - return 0; - } - if (call->fd < 0) - { - wmv_err("file pointer < 0. ignoring ...\n"); - return 0; - } - wmv_printf(10, "VideoPts %lld\n", call->Pts); - wmv_printf(10, "Got Private Size %d\n", call->private_size); - memcpy(private_data.privateData, call->private_data, - call->private_size > WMV3_PRIVATE_DATA_LENGTH ? WMV3_PRIVATE_DATA_LENGTH : call->private_size); - private_data.width = call->Width; - private_data.height = call->Height; - private_data.framerate = call->FrameRate; -#define PES_MIN_HEADER_SIZE 9 - if (initialHeader) - { - unsigned char PesPacket[PES_MIN_HEADER_SIZE + 128]; - unsigned char *PesPtr; - unsigned int MetadataLength; - unsigned int crazyFramerate = 0; - wmv_printf(10, "Framerate: %u\n", private_data.framerate); - wmv_printf(10, "biWidth: %d\n", private_data.width); - wmv_printf(10, "biHeight: %d\n", private_data.height); - crazyFramerate = ((10000000.0 / private_data.framerate) * 1000.0); - wmv_printf(10, "crazyFramerate: %u\n", crazyFramerate); - PesPtr = &PesPacket[PES_MIN_HEADER_SIZE]; - memcpy(PesPtr, Metadata, sizeof(Metadata)); - PesPtr += METADATA_STRUCT_C_START; - memcpy(PesPtr, private_data.privateData, WMV3_PRIVATE_DATA_LENGTH); - PesPtr += WMV3_PRIVATE_DATA_LENGTH; - /* Metadata Header Struct A */ - *PesPtr++ = (private_data.height >> 0) & 0xff; - *PesPtr++ = (private_data.height >> 8) & 0xff; - *PesPtr++ = (private_data.height >> 16) & 0xff; - *PesPtr++ = private_data.height >> 24; - *PesPtr++ = (private_data.width >> 0) & 0xff; - *PesPtr++ = (private_data.width >> 8) & 0xff; - *PesPtr++ = (private_data.width >> 16) & 0xff; - *PesPtr++ = private_data.width >> 24; - PesPtr += 12; /* Skip flag word and Struct B first 8 bytes */ - *PesPtr++ = (crazyFramerate >> 0) & 0xff; - *PesPtr++ = (crazyFramerate >> 8) & 0xff; - *PesPtr++ = (crazyFramerate >> 16) & 0xff; - *PesPtr++ = crazyFramerate >> 24; - MetadataLength = PesPtr - &PesPacket[PES_MIN_HEADER_SIZE]; - int HeaderLength = InsertPesHeader(PesPacket, MetadataLength, VC1_VIDEO_PES_START_CODE, INVALID_PTS_VALUE, 0); - len = write(call->fd, PesPacket, HeaderLength + MetadataLength); - initialHeader = 0; - } - if (call->len > 0 && call->data) - { - unsigned int Position = 0; - unsigned char insertSampleHeader = 1; - while (Position < call->len) - { - int PacketLength = (call->len - Position) <= MAX_PES_PACKET_SIZE ? - (call->len - Position) : MAX_PES_PACKET_SIZE; - int Remaining = call->len - Position - PacketLength; - wmv_printf(20, "PacketLength=%d, Remaining=%d, Position=%d\n", PacketLength, Remaining, Position); - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - memset(PesHeader, '0', PES_MAX_HEADER_SIZE); - int HeaderLength = InsertPesHeader(PesHeader, PacketLength, VC1_VIDEO_PES_START_CODE, call->Pts, 0); - unsigned char *PacketStart; - if (insertSampleHeader) - { - unsigned int PesLength; - unsigned int PrivateHeaderLength; - PrivateHeaderLength = InsertVideoPrivateDataHeader(&PesHeader[HeaderLength], - call->len); - /* Update PesLength */ - PesLength = PesHeader[PES_LENGTH_BYTE_0] + - (PesHeader[PES_LENGTH_BYTE_1] << 8) + PrivateHeaderLength; - PesHeader[PES_LENGTH_BYTE_0] = PesLength & 0xff; - PesHeader[PES_LENGTH_BYTE_1] = (PesLength >> 8) & 0xff; - PesHeader[PES_HEADER_DATA_LENGTH_BYTE] += PrivateHeaderLength; - PesHeader[PES_FLAGS_BYTE] |= PES_EXTENSION_DATA_PRESENT; - HeaderLength += PrivateHeaderLength; - insertSampleHeader = 0; - } - PacketStart = malloc(call->len + HeaderLength); - memcpy(PacketStart, PesHeader, HeaderLength); - memcpy(PacketStart + HeaderLength, call->data + Position, PacketLength); - len = write(call->fd, PacketStart, PacketLength + HeaderLength); - free(PacketStart); - Position += PacketLength; - call->Pts = INVALID_PTS_VALUE; - } - } - wmv_printf(10, "< %d\n", len); - return len; -} - -/* ***************************** */ -/* Writer Definition */ -/* ***************************** */ - -static WriterCaps_t caps = -{ - "wmv", - eVideo, - "V_WMV", - VIDEO_ENCODING_WMV -}; - -struct Writer_s WriterVideoWMV = -{ - &reset, - &writeData, - &caps -}; diff --git a/libeplayer3/output/writer/writer.c b/libeplayer3/output/writer/writer.c deleted file mode 100644 index feb12e9..0000000 --- a/libeplayer3/output/writer/writer.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * linuxdvb output/writer handling. - * - * konfetti 2010 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include - -#include "writer.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ - -#define WRITER_DEBUG - -#ifdef WRITER_DEBUG - -static short debug_level = 0; - -#define writer_printf(level, x...) do { \ - if (debug_level >= level) printf(x); } while (0) -#else -#define writer_printf(level, x...) -#endif - -#ifndef WRITER_SILENT -#define writer_err(x...) do { printf(x); } while (0) -#else -#define writer_err(x...) -#endif - -/* ***************************** */ -/* Types */ -/* ***************************** */ - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ - -static Writer_t *AvailableWriter[] = -{ - &WriterAudioIPCM, - &WriterAudioPCM, - &WriterAudioMP3, - &WriterAudioMPEGL3, - &WriterAudioAC3, - &WriterAudioAAC, - &WriterAudioDTS, - &WriterAudioFLAC, - &WriterAudioVORBIS, - - &WriterVideoMPEG2, - &WriterVideoMPEGH264, - &WriterVideoH264, - &WriterVideoDIVX, - &WriterVideoFOURCC, - &WriterVideoMSCOMP, - &WriterVideoWMV, - &WriterVideoH263, - &WriterVideoFLV, - &WriterVideoVC1, - &WriterFramebuffer, - NULL -}; - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ - -/* ***************************** */ -/* Functions */ -/* ***************************** */ - -Writer_t *getWriter(char *encoding) -{ - int i; - - for (i = 0; AvailableWriter[i] != NULL; i++) - { - if (strcmp(AvailableWriter[i]->caps->textEncoding, encoding) == 0) - { - writer_printf(50, "%s: found writer \"%s\" for \"%s\"\n", __func__, AvailableWriter[i]->caps->name, encoding); - return AvailableWriter[i]; - } - } - writer_printf(1, "%s: no writer found for \"%s\"\n", __func__, encoding); - return NULL; -} - -Writer_t *getDefaultVideoWriter() -{ - int i; - - for (i = 0; AvailableWriter[i] != NULL; i++) - { - if (strcmp(AvailableWriter[i]->caps->textEncoding, "V_MPEG2") == 0) - { - writer_printf(50, "%s: found writer \"%s\"\n", __func__, AvailableWriter[i]->caps->name); - return AvailableWriter[i]; - } - } - writer_printf(1, "%s: no writer found\n", __func__); - return NULL; -} - -Writer_t *getDefaultAudioWriter() -{ - int i; - for (i = 0; AvailableWriter[i] != NULL; i++) - { - if (strcmp(AvailableWriter[i]->caps->textEncoding, "A_MP3") == 0) - { - writer_printf(50, "%s: found writer \"%s\"\n", __func__, AvailableWriter[i]->caps->name); - return AvailableWriter[i]; - } - } - writer_printf(1, "%s: no writer found\n", __func__); - return NULL; -} - -Writer_t *getDefaultFramebufferWriter() -{ - int i; - for (i = 0; AvailableWriter[i] != NULL; i++) - { - writer_printf(10, "%s\n", AvailableWriter[i]->caps->textEncoding); - if (strcmp(AvailableWriter[i]->caps->textEncoding, "framebuffer") == 0) - { - writer_printf(50, "%s: found writer \"%s\"\n", __func__, AvailableWriter[i]->caps->name); - return AvailableWriter[i]; - } - } - writer_printf(1, "%s: no writer found\n", __func__); - return NULL; -} diff --git a/libeplayer3/playback/playback.c b/libeplayer3/playback/playback.c deleted file mode 100644 index 1995eb9..0000000 --- a/libeplayer3/playback/playback.c +++ /dev/null @@ -1,761 +0,0 @@ -/* - * GPL - * duckbox 2010 - */ - -/* ***************************** */ -/* Includes */ -/* ***************************** */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "playback.h" -#include "common.h" -#include "misc.h" - -/* ***************************** */ -/* Makros/Constants */ -/* ***************************** */ - -#define PLAYBACK_DEBUG - -static short debug_level = 0; - -static const char *FILENAME = "playback.c"; -#ifdef PLAYBACK_DEBUG -#define playback_printf(level, fmt, x...) do { \ - if (debug_level >= level) printf("[%s:%s] " fmt, FILENAME, __FUNCTION__, ## x); } while (0) -#else -#define playback_printf(level, fmt, x...) -#endif - -#ifndef PLAYBACK_SILENT -#define playback_err(fmt, x...) do { printf("[%s:%s] " fmt, FILENAME, __FUNCTION__, ## x); } while (0) -#else -#define playback_err(fmt, x...) -#endif - -#define cERR_PLAYBACK_NO_ERROR 0 -#define cERR_PLAYBACK_ERROR -1 - -#define cMaxSpeed_ff 128 /* fixme: revise */ -#define cMaxSpeed_fr -320 /* fixme: revise */ - -/* ***************************** */ -/* Varaibles */ -/* ***************************** */ - -static pthread_t supervisorThread; -static int hasThreadStarted = 0; - -/* ***************************** */ -/* Prototypes */ -/* ***************************** */ -static int PlaybackTerminate(Context_t *context); - -/* ***************************** */ -/* MISC Functions */ -/* ***************************** */ - -void libeplayerThreadStop() {} // Tell enigma2 that we stop - -/* **************************** */ -/* Supervisor Thread */ -/* **************************** */ - -static void SupervisorThread(Context_t *context) -{ - hasThreadStarted = 1; - playback_printf(10, ">\n"); - while (context && context->playback && context->playback->isPlaying && !(context->playback->abortRequested | context->playback->abortPlayback)) - usleep(100000); - playback_printf(10, "<\n"); - hasThreadStarted = 2; - PlaybackTerminate(context); - playback_printf(0, "terminating\n"); - hasThreadStarted = 0; - libeplayerThreadStop(); -} - -/* ***************************** */ -/* Functions */ -/* ***************************** */ - -static int PlaybackStop(Context_t *context); - -static int PlaybackOpen(Context_t *context, char *uri) -{ - if (context->playback->isPlaying) - PlaybackStop(context); - playback_printf(10, "URI=%s\n", uri); - if (context->playback->isPlaying) // shouldn't happen - { - playback_err("playback already running\n"); - return cERR_PLAYBACK_ERROR; - } - char *extension = NULL; - context->playback->uri = strdup(uri); - context->playback->isHttp = 0; - if (!strncmp("myts://", uri, 7)) - { - memcpy(context->playback->uri, "file", 4); - context->playback->isHttp = 1; - } - if (context->container && context->container->assContainer) - context->container->assContainer->Command(context, CONTAINER_INIT, NULL); - if (!strncmp("file://", uri, 7) || !strncmp("bluray://", uri, 9) || !strncmp("ftp://", uri, 6)) - { - extension = getExtension(context->playback->uri + 7); - if (!extension) - { - playback_printf(1, "Extension not found, use mp3\n"); - extension = "mp3"; - } - if (context->container && context->container->textSrtContainer) - context->container->textSrtContainer->Command(context, CONTAINER_INIT, context->playback->uri + 7); - if (context->container && context->container->textSsaContainer) - context->container->textSsaContainer->Command(context, CONTAINER_INIT, context->playback->uri + 7); - } - else if (strstr(uri, "://")) - { - context->playback->isHttp = 1; - extension = "mp3"; - if (!strncmp("mms://", uri, 6)) // mms is in reality called rtsp, and ffmpeg expects this - { - char *tUri = (char *)malloc(strlen(uri) + 2); - strncpy(tUri + 1, uri, strlen(uri) + 1); - strncpy(tUri, "rtsp", 4); - free(context->playback->uri); - context->playback->uri = tUri; - } - } - else - { - playback_err("Unknown stream (%s)\n", uri); - return cERR_PLAYBACK_ERROR; - } - if ((context->container->Command(context, CONTAINER_ADD, extension) < 0) - || (!context->container->selectedContainer) - || (context->container->selectedContainer->Command(context, CONTAINER_INIT, context->playback->uri) < 0)) - return cERR_PLAYBACK_ERROR; - playback_printf(10, "exiting with value 0\n"); - return cERR_PLAYBACK_NO_ERROR; -} - -static int PlaybackClose(Context_t *context) -{ - int ret = cERR_PLAYBACK_NO_ERROR; - playback_printf(10, "\n"); - if (context->container->Command(context, CONTAINER_DEL, NULL) < 0) - { - playback_err("container delete failed\n"); - } - if (context->container && context->container->textSrtContainer) - context->container->textSrtContainer->Command(context, CONTAINER_DEL, NULL); - if (context->container && context->container->textSsaContainer) - context->container->textSsaContainer->Command(context, CONTAINER_DEL, NULL); - context->manager->audio->Command(context, MANAGER_DEL, NULL); - context->manager->video->Command(context, MANAGER_DEL, NULL); - context->manager->subtitle->Command(context, MANAGER_DEL, NULL); - context->playback->isPaused = 0; - context->playback->isPlaying = 0; - context->playback->isForwarding = 0; - context->playback->BackWard = 0; - context->playback->SlowMotion = 0; - context->playback->Speed = 0; - if (context->playback->uri) - { - free(context->playback->uri); - context->playback->uri = NULL; - } - playback_printf(10, "exiting with value %d\n", ret); - return ret; -} - -static int PlaybackPlay(Context_t *context) -{ - pthread_attr_t attr; - int ret = cERR_PLAYBACK_NO_ERROR; - playback_printf(10, "\n"); - if (!context->playback->isPlaying) - { - context->playback->AVSync = 1; - context->output->Command(context, OUTPUT_AVSYNC, NULL); - context->playback->isCreationPhase = 1; // allows the created thread to go into wait mode - ret = context->output->Command(context, OUTPUT_PLAY, NULL); - if (ret != 0) - { - playback_err("OUTPUT_PLAY failed!\n"); - playback_err("clearing isCreationPhase!\n"); - context->playback->isCreationPhase = 0; // allow thread to go into next state - context->playback->isPlaying = 0; - context->playback->isPaused = 0; - context->playback->isForwarding = 0; - context->playback->BackWard = 0; - context->playback->SlowMotion = 0; - context->playback->Speed = 0; - context->container->selectedContainer->Command(context, CONTAINER_STOP, NULL); - } - else - { - context->playback->isPlaying = 1; - context->playback->isPaused = 0; - context->playback->isForwarding = 0; - context->playback->BackWard = 0; - context->playback->SlowMotion = 0; - context->playback->Speed = 1; - if (hasThreadStarted == 0) - { - int error; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - if ((error = pthread_create(&supervisorThread, &attr, (void *)&SupervisorThread, context)) != 0) - { - playback_printf(10, "Error creating thread, error:%d:%s\n", error, strerror(error)); - ret = cERR_PLAYBACK_ERROR; - } - else - { - playback_printf(10, "Created thread\n"); - } - } - playback_printf(10, "clearing isCreationPhase!\n"); - context->playback->isCreationPhase = 0; // allow thread to go into next state - ret = context->container->selectedContainer->Command(context, CONTAINER_PLAY, NULL); - if (ret != 0) - { - playback_err("CONTAINER_PLAY failed!\n"); - } - } - } - else - { - playback_err("playback already running\n"); - ret = cERR_PLAYBACK_ERROR; - } - playback_printf(10, "exiting with value %d\n", ret); - return ret; -} - -static int PlaybackPause(Context_t *context) -{ - int ret = cERR_PLAYBACK_NO_ERROR; - playback_printf(10, "\n"); - if (context->playback->isPlaying && !context->playback->isPaused) - { - if (context->playback->SlowMotion) - context->output->Command(context, OUTPUT_CLEAR, NULL); - context->output->Command(context, OUTPUT_PAUSE, NULL); - context->playback->isPaused = 1; - //context->playback->isPlaying = 1; - context->playback->isForwarding = 0; - context->playback->BackWard = 0; - context->playback->SlowMotion = 0; - context->playback->Speed = 1; - } - else - { - playback_err("playback not playing or already in pause mode\n"); - ret = cERR_PLAYBACK_ERROR; - } - playback_printf(10, "exiting with value %d\n", ret); - return ret; -} - -static int PlaybackContinue(Context_t *context) -{ - int ret = cERR_PLAYBACK_NO_ERROR; - playback_printf(10, "\n"); - if (context->playback->isPlaying && - (context->playback->isPaused || context->playback->isForwarding || context->playback->BackWard || context->playback->SlowMotion)) - { - if (context->playback->SlowMotion) - context->output->Command(context, OUTPUT_CLEAR, NULL); - context->output->Command(context, OUTPUT_CONTINUE, NULL); - context->playback->isPaused = 0; - //context->playback->isPlaying = 1; - context->playback->isForwarding = 0; - context->playback->BackWard = 0; - context->playback->SlowMotion = 0; - context->playback->Speed = 1; - } - else - { - playback_err("continue not possible\n"); - ret = cERR_PLAYBACK_ERROR; - } - playback_printf(10, "exiting with value %d\n", ret); - return ret; -} - -static int PlaybackStop(Context_t *context) -{ - int ret = cERR_PLAYBACK_NO_ERROR; - int wait_time = 20; - playback_printf(10, "\n"); - if (context && context->playback && context->playback->isPlaying) - { - context->playback->isPaused = 0; - context->playback->isPlaying = 0; - context->playback->isForwarding = 0; - context->playback->BackWard = 0; - context->playback->SlowMotion = 0; - context->playback->Speed = 0; - context->output->Command(context, OUTPUT_STOP, NULL); - context->container->selectedContainer->Command(context, CONTAINER_STOP, NULL); - } - else - { - playback_err("stop not possible\n"); - ret = cERR_PLAYBACK_ERROR; - } - while ((hasThreadStarted == 1) && (--wait_time) > 0) - { - playback_printf(10, "Waiting for supervisor thread to terminate itself, will try another %d times\n", wait_time); - usleep(100000); - } - if (wait_time == 0) - { - playback_err("Timeout waiting for thread!\n"); - ret = cERR_PLAYBACK_ERROR; - } - playback_printf(10, "exiting with value %d\n", ret); - return ret; -} - -static int PlaybackTerminate(Context_t *context) -{ - int ret = cERR_PLAYBACK_NO_ERROR; - int wait_time = 20; - - playback_printf(20, "\n"); - if (context && context->playback && context->playback->isPlaying) - { - //First Flush and than delete container, else e2 cant read length of file anymore - if (context->output->Command(context, OUTPUT_FLUSH, NULL) < 0) - { - playback_err("failed to flush output.\n"); - } - ret = context->container->selectedContainer->Command(context, CONTAINER_STOP, NULL); - context->playback->isPaused = 0; - context->playback->isPlaying = 0; - context->playback->isForwarding = 0; - context->playback->BackWard = 0; - context->playback->SlowMotion = 0; - context->playback->Speed = 0; - } - else - { - playback_err("%p %p %d\n", context, context->playback, context->playback->isPlaying); - /* fixme: konfetti: we should return an error here but this seems to be a condition which - * can happen and is not a real error, which leads to a dead neutrino. should investigate - * here later. - */ - } - while ((hasThreadStarted == 1) && (--wait_time) > 0) - { - playback_printf(10, "Waiting for supervisor thread to terminate itself, will try another %d times\n", wait_time); - usleep(100000); - } - if (wait_time == 0) - { - playback_err("Timeout waiting for thread!\n"); - ret = cERR_PLAYBACK_ERROR; - } - playback_printf(20, "exiting with value %d\n", ret); - return ret; -} - -static int PlaybackFastForward(Context_t *context, int *speed) -{ - int ret = cERR_PLAYBACK_NO_ERROR; - playback_printf(10, "speed %d\n", *speed); - /* Audio only forwarding not supported */ - if (context->playback->isVideo && !context->playback->isHttp && !context->playback->BackWard && (!context->playback->isPaused || context->playback->isPlaying)) - { - if ((*speed <= 0) || (*speed > cMaxSpeed_ff)) - { - playback_err("speed %d out of range (1 - %d) \n", *speed, cMaxSpeed_ff); - return cERR_PLAYBACK_ERROR; - } - context->playback->isForwarding = 1; - context->playback->Speed = *speed; - playback_printf(20, "Speed: %d x {%d}\n", *speed, context->playback->Speed); - context->output->Command(context, OUTPUT_FASTFORWARD, NULL); - } - else - { - playback_err("fast forward not possible\n"); - ret = cERR_PLAYBACK_ERROR; - } - playback_printf(10, "exiting with value %d\n", ret); - return ret; -} - -static int PlaybackFastBackward(Context_t *context, int *speed) -{ - int ret = cERR_PLAYBACK_NO_ERROR; - playback_printf(10, "speed = %d\n", *speed); - /* Audio only reverse play not supported */ - if (context->playback->isVideo && !context->playback->isForwarding && (!context->playback->isPaused || context->playback->isPlaying)) - { - if ((*speed > 0) || (*speed < cMaxSpeed_fr)) - { - playback_err("speed %d out of range (0 - %d) \n", *speed, cMaxSpeed_fr); - return cERR_PLAYBACK_ERROR; - } - if (*speed == 0) - { - context->playback->BackWard = 0; - context->playback->Speed = 0; /* reverse end */ - } - else - { - context->playback->isSeeking = 1; - context->playback->Speed = *speed; - context->playback->BackWard = 2 ^ (*speed); - playback_printf(1, "S %d B %f\n", context->playback->Speed, context->playback->BackWard); - } - context->output->Command(context, OUTPUT_AUDIOMUTE, "1"); - context->output->Command(context, OUTPUT_CLEAR, NULL); - if (context->output->Command(context, OUTPUT_REVERSE, NULL) < 0) - { - playback_err("OUTPUT_REVERSE failed\n"); - context->playback->BackWard = 0; - context->playback->Speed = 1; - context->playback->isSeeking = 0; - ret = cERR_PLAYBACK_ERROR; - } - } - else - { - playback_err("fast backward not possible\n"); - ret = cERR_PLAYBACK_ERROR; - } - context->playback->isSeeking = 0; - playback_printf(10, "exiting with value %d\n", ret); - return ret; -} - -static int PlaybackSlowMotion(Context_t *context, int *speed) -{ - int ret = cERR_PLAYBACK_NO_ERROR; - playback_printf(10, "\n"); - //Audio only forwarding not supported - if (context->playback->isVideo && !context->playback->isHttp && context->playback->isPlaying) - { - if (context->playback->isPaused) - PlaybackContinue(context); - switch (*speed) - { - case 2: - context->playback->SlowMotion = 2; - break; - case 4: - context->playback->SlowMotion = 4; - break; - case 8: - context->playback->SlowMotion = 8; - break; - } - playback_printf(20, "SlowMotion: %d x {%d}\n", *speed, context->playback->SlowMotion); - context->output->Command(context, OUTPUT_SLOWMOTION, NULL); - } - else - { - playback_err("slowmotion not possible\n"); - ret = cERR_PLAYBACK_ERROR; - } - playback_printf(10, "exiting with value %d\n", ret); - return ret; -} - -static int PlaybackSeek(Context_t *context, float *pos, int absolute) -{ - int ret = cERR_PLAYBACK_NO_ERROR; - playback_printf(10, "pos: %f\n", *pos); - if (context->playback->isPlaying && !context->playback->isForwarding && !context->playback->BackWard && !context->playback->SlowMotion && !context->playback->isPaused) - { - context->playback->isSeeking = 1; - context->output->Command(context, OUTPUT_CLEAR, NULL); -#if 0 - if (absolute) - context->container->selectedContainer->Command(context, CONTAINER_SEEK_ABS, pos); - else -#endif - context->container->selectedContainer->Command(context, CONTAINER_SEEK, pos); - context->playback->isSeeking = 0; - } - else - { - playback_err("not possible\n"); - ret = cERR_PLAYBACK_ERROR; - } - playback_printf(10, "exiting with value %d\n", ret); - return ret; -} - -static int PlaybackPts(Context_t *context, unsigned long long int *pts) -{ - int ret = cERR_PLAYBACK_NO_ERROR; - playback_printf(20, "\n"); - *pts = 0; - if (context->playback->isPlaying) - { - ret = context->output->Command(context, OUTPUT_PTS, pts); - } - else - { - playback_err("not possible\n"); - ret = cERR_PLAYBACK_ERROR; - } - playback_printf(20, "exiting with value %d\n", ret); - return ret; -} - -static int PlaybackLength(Context_t *context, double *length) -{ - int ret = cERR_PLAYBACK_NO_ERROR; - - playback_printf(20, "\n"); - *length = -1; - if (context->playback->isPlaying) - { - if (context->container && context->container->selectedContainer) - context->container->selectedContainer->Command(context, CONTAINER_LENGTH, length); - } - else - { - playback_err("not possible\n"); - ret = cERR_PLAYBACK_ERROR; - } - playback_printf(20, "exiting with value %d\n", ret); - return ret; -} - -static int PlaybackSwitchAudio(Context_t *context, int *track) -{ - int ret = cERR_PLAYBACK_NO_ERROR; - int curtrackid = 0; - int nextrackid = 0; - - playback_printf(10, "\n"); - if (context->playback->isPlaying) - { - if (context->manager && context->manager->audio) - { - context->manager->audio->Command(context, MANAGER_GET, &curtrackid); - context->manager->audio->Command(context, MANAGER_SET, track); - context->manager->audio->Command(context, MANAGER_GET, &nextrackid); - } - if (nextrackid != curtrackid) - { - //PlaybackPause(context); - if (context->output && context->output->audio) - context->output->audio->Command(context, OUTPUT_SWITCH, (void *)"audio"); - if (context->container && context->container->selectedContainer) - context->container->selectedContainer->Command(context, CONTAINER_SWITCH_AUDIO, &nextrackid); - //PlaybackContinue(context); - } - } - else - { - playback_err("switch audio not possible\n"); - ret = cERR_PLAYBACK_ERROR; - } - playback_printf(10, "exiting with value %d\n", ret); - return ret; -} - -static int PlaybackSwitchSubtitle(Context_t *context, int *track) -{ - int ret = cERR_PLAYBACK_NO_ERROR; - - playback_printf(10, "Track: %d\n", *track); - if (context && context->playback && context->playback->isPlaying) - { - if (context->manager && context->manager->subtitle) - { - int trackid; - if (context->manager->subtitle->Command(context, MANAGER_SET, track) < 0) - { - playback_err("manager set track failed\n"); - } - context->manager->subtitle->Command(context, MANAGER_GET, &trackid); - /* konfetti: I make this hack a little bit nicer, - * but its still a hack in my opinion ;) - */ - if (context->container && context->container->assContainer) - context->container->assContainer->Command(context, CONTAINER_SWITCH_SUBTITLE, &trackid); - if (trackid >= TEXTSRTOFFSET) - { - if (context->container && context->container->textSrtContainer) - context->container->textSrtContainer->Command(context, CONTAINER_SWITCH_SUBTITLE, &trackid); - } - if (trackid >= TEXTSSAOFFSET) - { - if (context->container && context->container->textSsaContainer) - context->container->textSsaContainer->Command(context, CONTAINER_SWITCH_SUBTITLE, &trackid); - } - } - else - { - ret = cERR_PLAYBACK_ERROR; - playback_err("no subtitle\n"); - } - } - else - { - playback_err("not possible\n"); - ret = cERR_PLAYBACK_ERROR; - } - playback_printf(10, "exiting with value %d\n", ret); - return ret; -} - -static int PlaybackInfo(Context_t *context, char **infoString) -{ - int ret = cERR_PLAYBACK_NO_ERROR; - playback_printf(10, "\n"); - /* konfetti comment: - * removed if clause here (playback running) because its - * not necessary for all container. e.g. in case of ffmpeg - * container playback must not play to get the info. - */ - if (context->container && context->container->selectedContainer) - context->container->selectedContainer->Command(context, CONTAINER_INFO, infoString); - playback_printf(10, "exiting with value %d\n", ret); - return ret; -} - -static int Command(Context_t *context, PlaybackCmd_t command, void *argument) -{ - int ret = cERR_PLAYBACK_NO_ERROR; - - playback_printf(20, "Command %d\n", command); - switch (command) - { - case PLAYBACK_OPEN: - { - ret = PlaybackOpen(context, (char *)argument); - break; - } - case PLAYBACK_CLOSE: - { - ret = PlaybackClose(context); - break; - } - case PLAYBACK_PLAY: - { - ret = PlaybackPlay(context); - break; - } - case PLAYBACK_STOP: - { - ret = PlaybackStop(context); - break; - } - case PLAYBACK_PAUSE: // 4 - { - ret = PlaybackPause(context); - break; - } - case PLAYBACK_CONTINUE: - { - ret = PlaybackContinue(context); - break; - } - case PLAYBACK_FASTFORWARD: - { - ret = PlaybackFastForward(context, (int *)argument); - break; - } - case PLAYBACK_SEEK: - { - ret = PlaybackSeek(context, (float *)argument, 0); - break; - } -#if 0 - case PLAYBACK_SEEK_ABS: - { - ret = PlaybackSeek(context, (float *)argument, -1); - break; - } -#endif - case PLAYBACK_PTS: // 10 - { - ret = PlaybackPts(context, (unsigned long long int *)argument); - break; - } - case PLAYBACK_LENGTH: // 11 - { - ret = PlaybackLength(context, (double *)argument); - break; - } - case PLAYBACK_SWITCH_AUDIO: - { - ret = PlaybackSwitchAudio(context, (int *)argument); - break; - } - case PLAYBACK_SWITCH_SUBTITLE: - { - ret = PlaybackSwitchSubtitle(context, (int *)argument); - break; - } - case PLAYBACK_INFO: - { - ret = PlaybackInfo(context, (char **)argument); - break; - } - case PLAYBACK_SLOWMOTION: - { - ret = PlaybackSlowMotion(context, (int *)argument); - break; - } - case PLAYBACK_FASTBACKWARD: - { - ret = PlaybackFastBackward(context, (int *)argument); - break; - } - default: - playback_err("PlaybackCmd %d not supported!\n", command); - ret = cERR_PLAYBACK_ERROR; - break; - } - playback_printf(20, "exiting with value %d\n", ret); - return ret; -} - -PlaybackHandler_t PlaybackHandler = -{ - "Playback", - -1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - &Command, - "", - 0 -}; diff --git a/libeplayer3/tools/eplayer2.c b/libeplayer3/tools/eplayer2.c deleted file mode 100644 index e21a95b..0000000 --- a/libeplayer3/tools/eplayer2.c +++ /dev/null @@ -1,606 +0,0 @@ -/* - * eplayer3: command line playback using libeplayer3 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "common.h" -#include "subtitle.h" - -extern OutputHandler_t OutputHandler; -extern PlaybackHandler_t PlaybackHandler; -extern ContainerHandler_t ContainerHandler; -extern ManagerHandler_t ManagerHandler; - -Context_t *player = NULL; - -/* ******************************************** */ -/* Framebuffer for subtitle */ -/* ******************************************** */ -static int fd = -1; -static unsigned char *lfb = NULL; -struct fb_fix_screeninfo fix; -struct fb_var_screeninfo screeninfo, oldscreen; - -static int stride = 0; -static int xRes = 0; -static int yRes = 0; -static int bpp = 0; - -int kbhit(void) -{ - struct timeval tv; - fd_set read_fd; - tv.tv_sec = 1; - tv.tv_usec = 0; - FD_ZERO(&read_fd); - FD_SET(0, &read_fd); - if (select(1, &read_fd, NULL, NULL, &tv) == -1) - return 0; - if (FD_ISSET(0, &read_fd)) - return 1; - return 0; -} - -void framebuffer_init() -{ - int available = 0; - - fd = open("/dev/fb0", O_RDWR); - if (fd < 0) - { - perror("/dev/fb0"); - return; - } - if (ioctl(fd, FBIOGET_VSCREENINFO, &screeninfo) < 0) - { - perror("FBIOGET_VSCREENINFO"); - return; - } - memcpy(&oldscreen, &screeninfo, sizeof(screeninfo)); - ioctl(fd, FBIOGET_VSCREENINFO, &screeninfo); - printf("mode %d, %d, %d\n", screeninfo.xres, screeninfo.yres, screeninfo.bits_per_pixel); - if (ioctl(fd, FBIOGET_FSCREENINFO, &fix) < 0) - { - perror("FBIOGET_FSCREENINFO"); - printf("fb failed\n"); - } - stride = fix.line_length; - xRes = screeninfo.xres; - yRes = screeninfo.yres; - bpp = screeninfo.bits_per_pixel; - printf("stride = %d, width %d\n", stride, xRes); - available = fix.smem_len; - printf("%dk video mem\n", available / 1024); - lfb = (unsigned char *) mmap(0, available, PROT_WRITE | PROT_READ, MAP_SHARED, fd, 0); - if (lfb == NULL) - { - perror("mmap"); - return; - } - memset(lfb, 0, available); -} - -int main(int argc, char *argv[]) -{ - SubtitleOutputDef_t out; - int showInfos = 0, noinput = 0; - char file[255] = {""}; - int speed = 0, speedmap = 0; - printf("%s >\n", __FILE__); - if (argc < 2) - { - printf("give me a filename please\n"); - exit(1); - } - if (strstr(argv[1], "://") == NULL) - { - strcpy(file, "file://"); - } - strcat(file, argv[1]); - /* debug helper */ - if (argc == 3 && !strcmp(argv[2], "-d")) - { - showInfos = 1; - } - if (argc == 3 && !strcmp(argv[2], "-n")) - noinput = 1; - player = malloc(sizeof(Context_t)); - player->playback = &PlaybackHandler; - player->output = &OutputHandler; - player->container = &ContainerHandler; - player->manager = &ManagerHandler; - printf("%s\n", player->output->Name); - //Registrating output devices - player->output->Command(player, OUTPUT_ADD, "audio"); - player->output->Command(player, OUTPUT_ADD, "video"); - player->output->Command(player, OUTPUT_ADD, "subtitle"); - framebuffer_init(); - /* for testing ass subtitles */ - out.screen_width = xRes; - out.screen_height = yRes; - out.destination = lfb; - out.destStride = stride; - player->output->subtitle->Command(player, OUTPUT_SET_SUBTITLE_OUTPUT, &out); - if (player->playback->Command(player, PLAYBACK_OPEN, file) < 0) - return 10; - { - char **TrackList = NULL; - player->manager->audio->Command(player, MANAGER_LIST, &TrackList); - if (TrackList != NULL) - { - printf("AudioTrack List\n"); - int i = 0; - for (i = 0; TrackList[i] != NULL; i += 2) - { - printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]); - free(TrackList[i]); - free(TrackList[i + 1]); - } - free(TrackList); - } - player->manager->video->Command(player, MANAGER_LIST, &TrackList); - if (TrackList != NULL) - { - printf("VideoTrack List\n"); - int i = 0; - for (i = 0; TrackList[i] != NULL; i += 2) - { - printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]); - free(TrackList[i]); - free(TrackList[i + 1]); - } - free(TrackList); - } - player->manager->subtitle->Command(player, MANAGER_LIST, &TrackList); - if (TrackList != NULL) - { - printf("SubtitleTrack List\n"); - int i = 0; - for (i = 0; TrackList[i] != NULL; i += 2) - { - printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]); - free(TrackList[i]); - free(TrackList[i + 1]); - } - free(TrackList); - } - } - { - int AudioTrackId = -1; - char *AudioTrackEncoding = NULL; - char *AudioTrackName = NULL; - player->manager->audio->Command(player, MANAGER_GET, &AudioTrackId); - player->manager->audio->Command(player, MANAGER_GETENCODING, &AudioTrackEncoding); - player->manager->audio->Command(player, MANAGER_GETNAME, &AudioTrackName); - printf("Current Audio Track : %d %s %s\n", AudioTrackId, AudioTrackEncoding, AudioTrackName); - AudioTrackEncoding = NULL; - AudioTrackName = NULL; - player->manager->video->Command(player, MANAGER_GET, &AudioTrackId); - player->manager->video->Command(player, MANAGER_GETENCODING, &AudioTrackEncoding); - player->manager->video->Command(player, MANAGER_GETNAME, &AudioTrackName); - printf("Current Video Track : %d %s %s\n", AudioTrackId, AudioTrackEncoding, AudioTrackName); - AudioTrackEncoding = NULL; - AudioTrackName = NULL; - player->manager->subtitle->Command(player, MANAGER_GET, &AudioTrackId); - player->manager->subtitle->Command(player, MANAGER_GETENCODING, &AudioTrackEncoding); - player->manager->subtitle->Command(player, MANAGER_GETNAME, &AudioTrackName); - printf("Current Subtitle Track : %d %s %s\n", AudioTrackId, AudioTrackEncoding, AudioTrackName); - AudioTrackEncoding = NULL; - AudioTrackName = NULL; - /* player->manager->audio->Command(player, MANAGER_SET, 2); - player->manager->audio->Command(player, MANAGER_GET, &AudioTrackId); - player->manager->audio->Command(player, MANAGER_GETNAME, &AudioTrackName); - free(AudioTrackName); - AudioTrackName = NULL; - */ - } - { - player->output->Command(player, OUTPUT_OPEN, NULL); - if (showInfos == 1) - { - char *tags[] = - { - "Title", - "Artist", - "Album", - "Year", - "Genre", - "Comment", - "Track", - "Copyright", - "TestLibEplayer", - NULL - }; - int i = 0; - while (tags[i] != NULL) - { - char *tag = tags[i]; - player->playback->Command(player, PLAYBACK_INFO, &tag); -#if !defined(VDR1722) - if (tag != NULL) - printf("\t%s:\t%s\n", tags[i], tag); - else - printf("\t%s:\tNULL\n", tags[i]); -#endif - i++; - } - player->output->Command(player, OUTPUT_CLOSE, NULL); - exit(1); - } - else - player->playback->Command(player, PLAYBACK_PLAY, NULL); - /*{ - int pid = 0; - player->playback->Command(player, PLAYBACK_SWITCH_SUBTITLE, (void*)&pid); - }*/ - while (player->playback->isPlaying) - { - int Key = 0; - if (kbhit()) - if (noinput == 0) - Key = getchar(); - if (!player->playback->isPlaying) - { - break; - } - if (Key == 0) - continue; - switch (Key) - { - case 'a': - { - int Key2 = getchar(); - switch (Key2) - { - case 'l': - { - char **TrackList = NULL; - player->manager->audio->Command(player, MANAGER_LIST, &TrackList); - if (TrackList != NULL) - { - printf("AudioTrack List\n"); - int i = 0; - for (i = 0; TrackList[i] != NULL; i += 2) - { - printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]); - free(TrackList[i]); - free(TrackList[i + 1]); - } - free(TrackList); - } - break; - } - case 'c': - { - int AudioTrackId = -1; - char *AudioTrackEncoding = NULL; - char *AudioTrackName = NULL; - player->manager->audio->Command(player, MANAGER_GET, &AudioTrackId); - player->manager->audio->Command(player, MANAGER_GETENCODING, &AudioTrackEncoding); - player->manager->audio->Command(player, MANAGER_GETNAME, &AudioTrackName); - printf("Current Audio Track : %d %s %s\n", AudioTrackId, AudioTrackEncoding, AudioTrackName); - AudioTrackEncoding = NULL; - AudioTrackName = NULL; - break; - } - default: - { - Key2 -= 0x30; - if (Key2 >= 0 && Key2 <= 9) - { - player->playback->Command(player, PLAYBACK_SWITCH_AUDIO, (void *)&Key2); - } - } - } - break; - } - case 's': - { - int Key2 = getchar(); - switch (Key2) - { - case 'l': - { - char **TrackList = NULL; - player->manager->subtitle->Command(player, MANAGER_LIST, &TrackList); - if (TrackList != NULL) - { - printf("SubtitleTrack List\n"); - int i = 0; - for (i = 0; TrackList[i] != NULL; i += 2) - { - printf("\t%s - %s\n", TrackList[i], TrackList[i + 1]); - free(TrackList[i]); - free(TrackList[i + 1]); - } - free(TrackList); - } - break; - } - case 'c': - { - int SubtitleTrackId = -1; - char *SubtitleTrackEncoding = NULL; - char *SubtitleTrackName = NULL; - player->manager->subtitle->Command(player, MANAGER_GET, &SubtitleTrackId); - player->manager->subtitle->Command(player, MANAGER_GETENCODING, &SubtitleTrackEncoding); - player->manager->subtitle->Command(player, MANAGER_GETNAME, &SubtitleTrackName); - printf("Current Subtitle Track : %d %s %s\n", SubtitleTrackId, SubtitleTrackEncoding, SubtitleTrackName); - SubtitleTrackEncoding = NULL; - SubtitleTrackName = NULL; - break; - } - default: - { - Key2 -= 0x30; - if (Key2 >= 0 && Key2 <= 9) - { - player->playback->Command(player, PLAYBACK_SWITCH_SUBTITLE, (void *)&Key2); - } - } - } - break; - } - case 'q': - player->playback->Command(player, PLAYBACK_STOP, NULL); - break; - case 'c': - player->playback->Command(player, PLAYBACK_CONTINUE, NULL); - break; - case 'p': - player->playback->Command(player, PLAYBACK_PAUSE, NULL); - break; - case 'f': - { - if (speed < 0) - speed = 0; - speed++; - if (speed > 7) - speed = 1; - switch (speed) - { - case 1: - speedmap = 1; - break; - case 2: - speedmap = 3; - break; - case 3: - speedmap = 7; - break; - case 4: - speedmap = 15; - break; - case 5: - speedmap = 31; - break; - case 6: - speedmap = 63; - break; - case 7: - speedmap = 127; - break; - } - player->playback->Command(player, PLAYBACK_FASTFORWARD, &speedmap); - break; - } - case 'b': - { - if (speed > 0) - speed = 0; - speed--; - if (speed < -7) - speed = -1; - switch (speed) - { - case -1: - speedmap = -5; - break; - case -2: - speedmap = -10; - break; - case -3: - speedmap = -20; - break; - case -4: - speedmap = -40; - break; - case -5: - speedmap = -80; - break; - case -6: - speedmap = -160; - break; - case -7: - speedmap = -320; - break; - } - player->playback->Command(player, PLAYBACK_FASTBACKWARD, &speedmap); - break; - } -#if defined(VDR1722) - case 'g': - { - char gotoString [256]; - gets(gotoString); - int gotoPos = atoi(gotoString); - double length = 0; - float sec; - printf("gotoPos %i\n", gotoPos); - if (player->container && player->container->selectedContainer) - player->container->selectedContainer->Command(player, CONTAINER_LENGTH, &length); - if (gotoPos <= 0) - { - printf("kleiner als erlaubt\n"); - sec = 0.0; - } - else if (gotoPos >= ((int)length - 10)) - { - printf("laenger als erlaubt\n"); - sec = (int)length - 10; - } - else - { - printf("normal action\n"); - sec = gotoPos; - } - player->playback->Command(player, PLAYBACK_SEEK, (void *)&sec); - printf("goto postion (%i sec)\n", sec); - break; - } -#endif - case 'k': - { -#if !defined(VDR1722) - int Key2 = getchar() - 48; - float sec = 0.0; - printf("seconds %d \n", Key2); - switch (Key2) - { - case 1: - sec = -15.0; - break; - case 4: - sec = -60.0; - break; - case 7: - sec = -300.0; - break; - case 3: - sec = 15.0; - break; - case 6: - sec = 60.0; - break; - case 9: - sec = 300.0; - break; - } -#else - char seek[256]; - gets(seek); - unsigned int seekTo = atoi(seek); - double length = 0; - float sec; - unsigned long long int CurrentPTS = 0; - player->playback->Command(player, PLAYBACK_PTS, &CurrentPTS); - if (player->container && player->container->selectedContainer) - player->container->selectedContainer->Command(player, CONTAINER_LENGTH, &length); - int CurrentSec = CurrentPTS / 90000; - printf("CurrentSec = %i, seekTo = %i, abs(seekTo) = %i seekTo + CurrentSec %i\n", CurrentSec, seekTo, abs(seekTo), (seekTo + CurrentSec)); - int ergSec = CurrentSec + seekTo; - if (ergSec < 0) - { - printf("kleiner als erlaubt\n"); - sec = 0.0; - } - else if ((CurrentSec + seekTo) >= ((int)length - 10)) - { - printf("laenger als erlaubt\n"); - sec = (int)length - 10; - } - else - { - printf("normal action\n"); - sec = seekTo + CurrentSec; - } - printf("springe %i \n", (int)sec); -#endif - player->playback->Command(player, PLAYBACK_SEEK, (void *)&sec); - break; - } - case 'l': - { - double length = 0; - if (player->container && player->container->selectedContainer) - player->container->selectedContainer->Command(player, CONTAINER_LENGTH, &length); - printf("Length = %02d:%02d:%02d (%.4f sec)\n", (int)((length / 60) / 60) % 60, (int)(length / 60) % 60, (int)length % 60, length); - break; - } - case 'j': - { - unsigned long long int pts = 0; - player->playback->Command(player, PLAYBACK_PTS, &pts); - unsigned long long int sec = pts / 90000; - printf("Pts = %02d:%02d:%02d (%llu.0000 sec)\n", (int)((sec / 60) / 60) % 60, (int)(sec / 60) % 60, (int)sec % 60, sec); - break; - } - case 'i': - { - char *tags[] = - { - "Title", - "Artist", - "Album", - "Year", - "Genre", - "Comment", - "Track", - "Copyright", - "TestLibEplayer", - NULL - }; - int i = 0; - while (tags[i] != NULL) - { - char *tag = tags[i]; - player->playback->Command(player, PLAYBACK_INFO, &tag); - if (tag != NULL) - printf("\t%s:\t%s\n", tags[i], tag); - else - printf("\t%s:\tNULL\n", tags[i]); - i++; - } - break; - } - default: - { - printf("Control:\n"); - printf("al: List audio tracks\n"); - printf("ac: List current audio track\n"); - printf("a[id] Select audio track\n"); - printf("sl: List subtitles\n"); - printf("sc: List current subtitle\n"); - printf("s[id] Select subtitles\n"); - printf("q: Stop\n"); - printf("c: Continue\n"); - printf("p: Pause\n"); - printf("f: Increase speed (Fast forward) (stepwise)\n"); - printf("b: Decrease speed (Fast reverse) (stepwise)\n"); - printf("l: Print duration\n"); - printf("j: Print current PTS\n"); - printf("k[1,4,7]: Jump back [15,60,300] seconds\n"); - printf("k[3,6,9]: Jump forward [15,60,300] seconds\n"); - printf("i: Print Info\n"); - break; - } - } - } - player->output->Command(player, OUTPUT_CLOSE, NULL); - } - //printOutputCapabilities(); - exit(0); -} diff --git a/libeplayer3/tools/meta.c b/libeplayer3/tools/meta.c deleted file mode 100644 index 0d5ce99..0000000 --- a/libeplayer3/tools/meta.c +++ /dev/null @@ -1,67 +0,0 @@ -/* konfetti - * gpl - * 2010 - * - * example utitility to show metatags with ffmpeg. - */ - -#include -#include -#include - -#include -#include - -static AVFormatContext *avContext = NULL; - -void dump_metadata() -{ - AVDictionaryEntry *tag = NULL; - while ((tag = av_dict_get(avContext->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) - printf("%s: %s\n", tag->key, tag->value); -} - -int main(int argc, char *argv[]) -{ - char file[255] = {""}; - unsigned int i; - int err; - if (argc < 2) - { - printf("give me a filename please\n"); - return -1; - } - if (strstr(argv[1], "://") == NULL) - { - strcpy(file, "file://"); - } - strcat(file, argv[1]); - av_register_all(); - if ((err = avformat_open_input(&avContext, file, NULL, 0)) != 0) - { - char error[512]; - printf("avformat_open_input failed %d (%s)\n", err, file); - av_strerror(err, error, 512); - printf("Cause: %s\n", error); - return -1; - } - if (avformat_find_stream_info(avContext, NULL) < 0) - { - printf("Error avformat_find_stream_info\n"); - } - printf("\n***\n"); - dump_metadata(); - printf("\nstream specific metadata:\n"); - for (i = 0; i < avContext->nb_streams; i++) - { - AVStream *stream = avContext->streams[i]; - if (stream) - { - AVDictionaryEntry *tag = NULL; - if (stream->metadata != NULL) - while ((tag = av_dict_get(stream->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) - printf("%s: %s\n", tag->key, tag->value); - } - } - return 0; -} diff --git a/libmme_host/Makefile.am b/libmme_host/Makefile.am deleted file mode 100644 index 57dfec1..0000000 --- a/libmme_host/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -lib_LTLIBRARIES = libmme_host.la - -libmme_host_la_SOURCES = \ - $(DRIVER_TOPDIR)/multicom/mme/mme_linux_user.c \ - $(DRIVER_TOPDIR)/multicom/mme/ExecutionLoop.c \ - $(DRIVER_TOPDIR)/multicom/mme/LocalTransformer.c \ - $(DRIVER_TOPDIR)/multicom/mme/LookupTable.c \ - $(DRIVER_TOPDIR)/multicom/mme/MMEMessageQueue.c \ - $(DRIVER_TOPDIR)/multicom/mme/mme_tune.c \ - $(DRIVER_TOPDIR)/multicom/embxshell/embx_linux.c - -AM_CFLAGS = -Wall -D__LINUX__ -I $(DRIVER_TOPDIR)/include/multicom -I$(DRIVER_TOPDIR)/multicom/mme diff --git a/libmme_host/autogen.sh b/libmme_host/autogen.sh deleted file mode 100755 index e5b393e..0000000 --- a/libmme_host/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-libmme_host" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/libmme_host/configure.ac b/libmme_host/configure.ac deleted file mode 100644 index 12998a0..0000000 --- a/libmme_host/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT([libmme_host],[1.0],[],[libmme_host]) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_OUTPUT([ -Makefile -]) diff --git a/libmme_image/Makefile.am b/libmme_image/Makefile.am deleted file mode 100644 index 66d0f22..0000000 --- a/libmme_image/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -lib_LTLIBRARIES = libmmeimage.la - -libmmeimage_la_SOURCES = libmmeimage.c hw_interface.c libmmeimg_jpeg.c - -AM_CFLAGS = -Wall -I$(DRIVER_TOPDIR)/include/multicom -I$(DRIVER_TOPDIR)/bpamem -I$(DRIVER_TOPDIR)/include/player2 diff --git a/libmme_image/autogen.sh b/libmme_image/autogen.sh deleted file mode 100755 index e8b559c..0000000 --- a/libmme_image/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-libmmeimage" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/libmme_image/configure.ac b/libmme_image/configure.ac deleted file mode 100644 index 2327040..0000000 --- a/libmme_image/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT([libmmeimage],[1.0],[],[libmmeimage]) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_OUTPUT([ -Makefile -]) diff --git a/libmme_image/hw_interface.c b/libmme_image/hw_interface.c deleted file mode 100644 index 0893283..0000000 --- a/libmme_image/hw_interface.c +++ /dev/null @@ -1,501 +0,0 @@ -#include "hw_interface.h" -#include "libmmeimg_debug.h" -#include -#include -#include // was forgotten in stmfb.h -#include -#include -#include -#include -#include -#include -#include - -// debug strings -const char *mme_event_strings[] = -{ - "MME_COMMAND_COMPLETED_EVT", - "MME_DATA_UNDERFLOW_EVT", - "MME_NOT_ENOUGH_MEMORY_EVT", - "MME_NEW_COMMAND_EVT", -}; - -const char *mme_error_type_strings[] = -{ - "MME_SUCCESS", - "MME_DRIVER_NOT_INITIALIZED", - "MME_DRIVER_ALREADY_INITIALIZED", - "MME_NOMEM", - "MME_INVALID_TRANSPORT", - "MME_INVALID_HANDLE", - "MME_INVALID_ARGUMENT", - "MME_UNKNOWN_TRANSFORMER", - "MME_TRANSFORMER_NOT_RESPONDING", - "MME_HANDLES_STILL_OPEN", - "MME_COMMAND_STILL_EXECUTING", - "MME_COMMAND_ABORTED", - "MME_DATA_UNDERFLOW", - "MME_DATA_OVERFLOW", - "MME_TRANSFORM_DEFERRED", - "MME_SYSTEM_INTERRUPT", - "MME_EMBX_ERROR", - "MME_INTERNAL_ERROR", - "MME_NOT_IMPLEMENTED" -}; - -MME_Init_func MME_Init = (MME_Init_func) _mme_default_func; -MME_Term_func MME_Term = (MME_Term_func) _mme_default_func; -MME_SendCommand_func MME_SendCommand = (MME_SendCommand_func) _mme_default_func; -MME_AbortCommand_func MME_AbortCommand = (MME_AbortCommand_func) _mme_default_func; -MME_AllocDataBuffer_func MME_AllocDataBuffer = (MME_AllocDataBuffer_func) _mme_default_func; -MME_FreeDataBuffer_func MME_FreeDataBuffer = (MME_FreeDataBuffer_func) _mme_default_func; -MME_InitTransformer_func MME_InitTransformer = (MME_InitTransformer_func) _mme_default_func; -MME_TermTransformer_func MME_TermTransformer = (MME_TermTransformer_func) _mme_default_func; - -void *libmme; - - -MME_ERROR _mme_default_func(void) -{ - return MME_DRIVER_NOT_INITIALIZED; -} - -const char *get_mme_event_string(MME_Event_t ev) -{ - return (((unsigned int) ev) < ARRAY_SIZE(mme_event_strings)) ? mme_event_strings[ev] : "* unknown event code *"; -} - -const char *get_mme_error_string(MME_ERROR e) -{ - return (((unsigned int) e) < ARRAY_SIZE(mme_error_type_strings)) ? mme_error_type_strings[e] : "unknown error code"; -} -inline void print_mme_error(MME_ERROR e) -{ - DEBUG_PRINT("Result : %s\n", get_mme_error_string(e)); -} - -LIBMMEIMG_ERROR mme_loadlib(void) -{ - if (!libmme) - { - if ((libmme = dlopen("libmme_host.so", RTLD_LAZY)) != NULL) - { - _MME_Init = (MME_Init_func)dlsym(libmme, "MME_Init"); - _MME_Term = (MME_Term_func)dlsym(libmme, "MME_Term"); - _MME_SendCommand = (MME_SendCommand_func)dlsym(libmme, "MME_SendCommand"); - _MME_AbortCommand = (MME_AbortCommand_func)dlsym(libmme, "MME_AbortCommand"); - _MME_AllocDataBuffer = (MME_AllocDataBuffer_func)dlsym(libmme, "MME_AllocDataBuffer"); - _MME_FreeDataBuffer = (MME_FreeDataBuffer_func)dlsym(libmme, "MME_FreeDataBuffer"); - _MME_InitTransformer = (MME_InitTransformer_func)dlsym(libmme, "MME_InitTransformer"); - _MME_TermTransformer = (MME_TermTransformer_func)dlsym(libmme, "MME_TermTransformer"); - - if (!_MME_Init || !_MME_Term || - !_MME_SendCommand || !_MME_AbortCommand || - !_MME_AllocDataBuffer || !_MME_FreeDataBuffer || - !_MME_InitTransformer || !_MME_TermTransformer) - { - _MME_Init = (MME_Init_func) _mme_default_func; - _MME_Term = (MME_Term_func) _mme_default_func; - _MME_SendCommand = (MME_SendCommand_func) _mme_default_func; - _MME_AbortCommand = (MME_AbortCommand_func) _mme_default_func; - _MME_AllocDataBuffer = (MME_AllocDataBuffer_func) _mme_default_func; - _MME_FreeDataBuffer = (MME_FreeDataBuffer_func) _mme_default_func; - _MME_InitTransformer = (MME_InitTransformer_func) _mme_default_func; - _MME_TermTransformer = (MME_TermTransformer_func) _mme_default_func; - - dlclose(libmme); - libmme = NULL; - } - } - - if (!libmme) - { - DEBUG_PRINT("%s: Couldn't resolve libmme_host.so!\n", __FUNCTION__); - return LIBMMEIMG_MISC_ERROR; - } - } - - return LIBMMEIMG_SUCCESS; -} - -static unsigned int init_count = 0; -static sem_t mme_init_sem; -static int mme_init_sem_initialized = 0; - -LIBMMEIMG_ERROR mme_init_multi(void) -{ - MME_ERROR res_mme; - - if (!mme_init_sem_initialized) - { - sem_init(&mme_init_sem, 0, 1); - mme_init_sem_initialized = 1; - } - - sem_wait(&mme_init_sem); - if (init_count == 0) - { - res_mme = MME_Init(); - if (res_mme != MME_SUCCESS && res_mme != MME_DRIVER_ALREADY_INITIALIZED) - { - sem_post(&mme_init_sem); - return LIBMMEIMG_MISC_ERROR; - } - else - { - init_count++; - sem_post(&mme_init_sem); - return LIBMMEIMG_SUCCESS; - } - } - else - { - init_count++; - sem_post(&mme_init_sem); - return LIBMMEIMG_SUCCESS; - } - - -} - -LIBMMEIMG_ERROR mme_term_multi(void) -{ - MME_ERROR res_mme; - - sem_wait(&mme_init_sem); - res_mme = MME_Term(); - if (res_mme != MME_SUCCESS && res_mme != MME_DRIVER_ALREADY_INITIALIZED) - { - sem_post(&mme_init_sem); - return LIBMMEIMG_MISC_ERROR; - } - else - { - init_count--; - sem_post(&mme_init_sem); - return LIBMMEIMG_SUCCESS; - } -} - -LIBMMEIMG_ERROR mme_init_transformer(MMEData *data, const char *transformer_names[], void (*transformer_callback)(MME_Event_t, MME_Command_t *, void *)) -{ - unsigned int index = 0; - - MME_ERROR ret; - MME_TransformerInitParams_t params; - - params.StructSize = sizeof(params); - params.Priority = MME_PRIORITY_BELOW_NORMAL; - params.Callback = (void *)transformer_callback; - params.CallbackUserData = data; - params.TransformerInitParamsSize = 0; - params.TransformerInitParams_p = NULL; - - do - { - DEBUG_PRINT("initializing transformer %s\n", transformer_names[index]); - ret = MME_InitTransformer(transformer_names[index], ¶ms, &data->transformer_handle); - } - while (ret != MME_SUCCESS && transformer_names[++index] != NULL); - - if (ret != MME_SUCCESS) - { - if (ret != MME_DRIVER_NOT_INITIALIZED) - DEBUG_PRINT("transformer initialisation failed: %s", get_mme_error_string(ret)); - data->transformer_handle = 0; - return LIBMMEIMG_MISC_ERROR; - } - - return LIBMMEIMG_SUCCESS; -} - -LIBMMEIMG_ERROR mme_deinit_transformer(MMEData *data) -{ - MME_ERROR ret; - - if (!data->transformer_handle) - return LIBMMEIMG_INVALIDARG; - - DEBUG_PRINT("terminating transformer with handle %d\n", data->transformer_handle); - - ret = MME_TermTransformer(data->transformer_handle); - if (ret == MME_COMMAND_STILL_EXECUTING) - { - mme_abort_transformer(data); - ret = MME_TermTransformer(data->transformer_handle); - } - - free_mme_data_buffer(data->transform_command->DataBuffers_p[0]); - free_mme_command(data->transform_command); - - if (ret) - { - DEBUG_PRINT("Couldn't terminate transformer: %s", get_mme_error_string(ret)); - return LIBMMEIMG_MISC_ERROR; - } - - data->transformer_handle = 0; - return LIBMMEIMG_SUCCESS; -} - -LIBMMEIMG_ERROR create_mme_data_buffer(MME_DataBuffer_t **buf, unsigned int flags, void *dstbuf, unsigned long size) -{ - DEBUG_PRINT("creating databuffer of size = %d, dstbuf = %x\n", size, dstbuf); - - *buf = (MME_DataBuffer_t *)malloc(sizeof(MME_DataBuffer_t)); - if (!*buf) - return LIBMMEIMG_NOMEM; - (*buf)->StructSize = sizeof(MME_DataBuffer_t); - (*buf)->Flags = flags; - (*buf)->StreamNumber = 0; - (*buf)->NumberOfScatterPages = 1; - (*buf)->UserData_p = NULL; - - (*buf)->ScatterPages_p = (MME_ScatterPage_t *)malloc(sizeof(MME_ScatterPage_t)); - if (!(*buf)->ScatterPages_p) - { - free(*buf); - return LIBMMEIMG_NOMEM; - } - (*buf)->TotalSize = size; - (*buf)->StartOffset = 0; - - (*buf)->ScatterPages_p[0].Page_p = dstbuf; - (*buf)->ScatterPages_p[0].Size = size; - (*buf)->ScatterPages_p[0].BytesUsed = 0; - (*buf)->ScatterPages_p[0].FlagsIn = 0; - (*buf)->ScatterPages_p[0].FlagsOut = 0; - return LIBMMEIMG_SUCCESS; -} - -void free_mme_data_buffer(MME_DataBuffer_t *buf) -{ - if (buf) - { - if (buf->ScatterPages_p) - free(buf->ScatterPages_p); - - free(buf); - } -} - -LIBMMEIMG_ERROR mme_start_transformer(MMEData *data, size_t return_params_size, void *return_params, size_t params_size, void *params, void *out_buffer, unsigned long out_buffer_size) -{ - data->transform_command = (MME_Command_t *) malloc(sizeof(MME_Command_t)); - if (!data->transform_command) - return LIBMMEIMG_NOMEM; - - data->transform_command->DataBuffers_p = (MME_DataBuffer_t **) malloc(sizeof(MME_DataBuffer_t *)); - - data->transform_command->NumberInputBuffers = 0; - data->transform_command->NumberOutputBuffers = 1; - - if (create_mme_data_buffer(data->transform_command->DataBuffers_p, MME_ALLOCATION_PHYSICAL, out_buffer, out_buffer_size)) - { - DEBUG_PRINT("error in create_mme_data_buffer"); - return LIBMMEIMG_MISC_ERROR; - } - - // init the commandstatus - memset(&(data->transform_command->CmdStatus), 0, sizeof(MME_CommandStatus_t)); - data->transform_command->CmdStatus.AdditionalInfoSize = return_params_size; - data->transform_command->CmdStatus.AdditionalInfo_p = return_params; - - // set up the command - data->transform_command->StructSize = sizeof(MME_Command_t); - data->transform_command->CmdCode = MME_TRANSFORM; - data->transform_command->CmdEnd = MME_COMMAND_END_RETURN_NOTIFY; - data->transform_command->DueTime = (MME_Time_t)0; - data->transform_command->ParamSize = params_size; - data->transform_command->Param_p = params; - - data->transform_command->DataBuffers_p[0]->ScatterPages_p[0].Size = data->transform_command->DataBuffers_p[0]->TotalSize; - data->transform_command->DataBuffers_p[0]->ScatterPages_p[0].BytesUsed = 0; - data->transform_command->DataBuffers_p[0]->ScatterPages_p[0].FlagsIn = 0; - data->transform_command->DataBuffers_p[0]->ScatterPages_p[0].FlagsOut = 0; - DEBUG_PRINT("start transformer\n"); - - /*DEBUG_PRINT("Databuffer dump: StructSize %d, UserData_p 0x%x, Flags %d, StreamNumber %d, NumberOfScatterPages %d, ScatterPages_p 0x%x, ScatterPages_p[0] 0x%x, TotalSize %d, StartOffset %d\n", - data->transform_command->DataBuffers_p[0]->StructSize, - data->transform_command->DataBuffers_p[0]->UserData_p, - data->transform_command->DataBuffers_p[0]->Flags, - data->transform_command->DataBuffers_p[0]->StreamNumber, - data->transform_command->DataBuffers_p[0]->NumberOfScatterPages, - data->transform_command->DataBuffers_p[0]->ScatterPages_p, - data->transform_command->DataBuffers_p[0]->ScatterPages_p[0], - data->transform_command->DataBuffers_p[0]->TotalSize, - data->transform_command->DataBuffers_p[0]->StartOffset);*/ - - MME_ERROR mmeRes = MME_SendCommand(data->transformer_handle, data->transform_command); - if (mmeRes != MME_SUCCESS) - { - print_mme_error(mmeRes); - return LIBMMEIMG_MISC_ERROR; - } - - return LIBMMEIMG_SUCCESS; -} - -LIBMMEIMG_ERROR create_mme_input_command(MME_Command_t **command, MME_DataBuffer_t *data_buffer) -{ - // Allocates a command and populate it - *command = (MME_Command_t *)malloc(sizeof(MME_Command_t)); - if (!*command) - return LIBMMEIMG_NOMEM; - (*command)->NumberInputBuffers = 1; - (*command)->NumberOutputBuffers = 0; - (*command)->StructSize = sizeof(MME_Command_t); - (*command)->CmdCode = MME_SEND_BUFFERS; - (*command)->CmdEnd = MME_COMMAND_END_RETURN_NOTIFY; - (*command)->DueTime = (MME_Time_t) 0; - (*command)->DataBuffers_p = (MME_DataBuffer_t **)malloc(sizeof(MME_DataBuffer_t *)); - if (!(*command)->DataBuffers_p) - { - free(*command); - return LIBMMEIMG_NOMEM; - } - - (*command)->DataBuffers_p[0] = data_buffer; - (*command)->ParamSize = 0; - (*command)->Param_p = NULL; - memset(&((*command)->CmdStatus), 0, sizeof(MME_CommandStatus_t)); - (*command)->CmdStatus.AdditionalInfoSize = 0; - (*command)->CmdStatus.AdditionalInfo_p = NULL; - return LIBMMEIMG_SUCCESS; -} - -void free_mme_command(MME_Command_t *command) -{ - if (command) - { - if (command->DataBuffers_p) - free(command->DataBuffers_p); - - free(command); - } - -} - -void mme_abort_transformer(MMEData *data) -{ - if (data && data->transform_command) - { - DEBUG_PRINT("aborting transform command"); - if (MME_AbortCommand(data->transformer_handle, data->transform_command->CmdStatus.CmdId) != MME_SUCCESS) - DEBUG_PRINT("abort failed"); - } -} - -// data_content needs to be hardware adressable -LIBMMEIMG_ERROR mme_send_data(MMEData *data, char *data_content, unsigned long data_size) -{ - MME_ERROR res = MME_SUCCESS; - MME_DataBuffer_t *data_buffer; - MME_Command_t *mme_command; - - sem_init(&data->decode_event, 0, 0); - - DEBUG_PRINT("sending %d bytes of data to coproc", data_size); - - if (create_mme_data_buffer(&data_buffer, MME_ALLOCATION_PHYSICAL, data_content, data_size)) - { - DEBUG_PRINT("error in create_mme_data_buffer\n"); - return LIBMMEIMG_MISC_ERROR; - } - - if (create_mme_input_command(&mme_command, data_buffer)) - { - DEBUG_PRINT("error in create_mme_input_command\n"); - return LIBMMEIMG_MISC_ERROR; - } - - - /*DEBUG_PRINT("Databuffer dump: StructSize %d, UserData_p 0x%x, Flags %d, StreamNumber %d, NumberOfScatterPages %d, ScatterPages_p 0x%x, ScatterPages_p[0] 0x%x, TotalSize %d, StartOffset %d\n", - data_buffer->StructSize, - data_buffer->UserData_p, - data_buffer->Flags, - data_buffer->StreamNumber, - data_buffer->NumberOfScatterPages, - data_buffer->ScatterPages_p, - data_buffer->ScatterPages_p[0], - data_buffer->TotalSize, - data_buffer->StartOffset);*/ - - // send the command - res = MME_SendCommand(data->transformer_handle, mme_command); - if (res != MME_SUCCESS) - { - DEBUG_PRINT("send data command failed : %s, aborting data command", get_mme_error_string(res)); - // abort command - if (MME_AbortCommand(data->transformer_handle, mme_command->CmdStatus.CmdId) != MME_SUCCESS) - DEBUG_PRINT("abort failed"); - free_mme_data_buffer(data_buffer); - free_mme_command(mme_command); - return MME_INTERNAL_ERROR; - } - - DEBUG_PRINT("waiting for completion data, \n"); - - // wait until the decode is complete - sem_wait(&data->decode_event); - - free_mme_data_buffer(data_buffer); - free_mme_command(mme_command); - - return LIBMMEIMG_SUCCESS; -} - -// needs modified stmfb to allow blitting on external mem, output is BGR -// memsize needs to be the whole size of srcdestmem -LIBMMEIMG_ERROR blit_decoder_result(char *srcmem, unsigned long srcmem_size, char *destmem, unsigned long destmem_size, unsigned int width, unsigned int height, unsigned int dest_width, unsigned int dest_height, unsigned int removeright, unsigned int removebottom) -{ - int fd; - STMFBIO_BLT_EXTERN_DATA blt_data; - int error; - - fd = open("/dev/fb0", O_RDWR); - - DEBUG_PRINT("blitting result"); - - if (fd < 0) - { - DEBUG_PRINT("cannot access /dev/fb0! err = %d", fd); - return LIBMMEIMG_NO_DEVACCESS; - } - - memset(&blt_data, 0, sizeof(STMFBIO_BLT_EXTERN_DATA)); - blt_data.operation = BLT_OP_COPY; - blt_data.ulFlags = 0; - blt_data.srcOffset = 0; - blt_data.srcPitch = width * 2; - blt_data.dstOffset = 0; - blt_data.dstPitch = dest_width * 3; - blt_data.src_top = 0; - blt_data.src_left = 0; - blt_data.src_right = width - removeright; // fix macroblock limit - blt_data.src_bottom = height - removebottom; - blt_data.dst_left = 0; - blt_data.dst_top = 0; - blt_data.dst_right = dest_width; - blt_data.dst_bottom = dest_height; - blt_data.srcFormat = SURF_YCBCR422R; - blt_data.dstFormat = SURF_BGR888; - blt_data.srcMemBase = srcmem; - blt_data.dstMemBase = destmem; - blt_data.srcMemSize = srcmem_size; - blt_data.dstMemSize = destmem_size; - - error = ioctl(fd, STMFBIO_BLT_EXTERN, &blt_data); - if (error != 0) - { - DEBUG_PRINT("blitting failed with error %d", error); - close(fd); - return LIBMMEIMG_MISC_ERROR; - } - - // wait until finished - ioctl(fd, STMFBIO_SYNC_BLITTER); - close(fd); - - return LIBMMEIMG_SUCCESS; -} diff --git a/libmme_image/hw_interface.h b/libmme_image/hw_interface.h deleted file mode 100644 index 1304668..0000000 --- a/libmme_image/hw_interface.h +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef _HWINTERFACE_H -#define _HWINTERFACE_H -#include "libmmeimg_error.h" -#include -#include -#include -#include -#ifdef STM22 // STM22 compatibility -#include -#else -#include -#define JPEGD_TransformParams_t JPEGDEC_TransformParams_t -#define JPEGD_TransformReturnParams_t JPEGDEC_TransformReturnParams_t -#endif - -typedef struct -{ - unsigned int original_width; - unsigned int original_height; - - unsigned int decode_width; - unsigned int decode_height; - MME_TransformerHandle_t transformer_handle; - - // provide input/output buffer and request transform - MME_Command_t *transform_command; - - // wait for coproc to finish decode - sem_t decode_event; - - int decode_success; -} MMEData; - -#define ARRAY_SIZE(array) ((int)(sizeof(array) / sizeof((array)[0]))) - -typedef MME_ERROR(*MME_Init_func)(void); -typedef MME_ERROR(*MME_Term_func)(void); -typedef MME_ERROR(*MME_SendCommand_func)(MME_TransformerHandle_t Handle, - MME_Command_t *CmdInfo_p); -typedef MME_ERROR(*MME_AbortCommand_func)(MME_TransformerHandle_t Handle, - MME_CommandId_t CmdId); -typedef MME_ERROR(*MME_AllocDataBuffer_func)(MME_TransformerHandle_t handle, - MME_UINT size, - MME_AllocationFlags_t flags, - MME_DataBuffer_t **dataBuffer_p); -typedef MME_ERROR(*MME_FreeDataBuffer_func)(MME_DataBuffer_t *DataBuffer_p); -typedef MME_ERROR(*MME_InitTransformer_func)(const char *Name, - MME_TransformerInitParams_t *Params_p, - MME_TransformerHandle_t *Handle_p); -typedef MME_ERROR(*MME_TermTransformer_func)(MME_TransformerHandle_t handle); - -MME_ERROR _mme_default_func(void); - -extern MME_Init_func _MME_Init; -extern MME_Term_func _MME_Term; -extern MME_SendCommand_func _MME_SendCommand; -extern MME_AbortCommand_func _MME_AbortCommand; -extern MME_AllocDataBuffer_func _MME_AllocDataBuffer; -extern MME_FreeDataBuffer_func _MME_FreeDataBuffer; -extern MME_InitTransformer_func _MME_InitTransformer; -extern MME_TermTransformer_func _MME_TermTransformer; -#define MME_Init _MME_Init -#define MME_Term _MME_Term -#define MME_SendCommand _MME_SendCommand -#define MME_AbortCommand _MME_AbortCommand -#define MME_AllocDataBuffer _MME_AllocDataBuffer -#define MME_FreeDataBuffer _MME_FreeDataBuffer -#define MME_InitTransformer _MME_InitTransformer -#define MME_TermTransformer _MME_TermTransformer - -const char *get_mme_event_string(MME_Event_t ev); - -const char *get_mme_error_string(MME_ERROR e); - -inline void print_mme_error(MME_ERROR e); - -// non debug functions - -LIBMMEIMG_ERROR mme_init_multi(); -LIBMMEIMG_ERROR mme_term_multi(); - -LIBMMEIMG_ERROR mme_loadlib(); - -LIBMMEIMG_ERROR mme_init_transformer(MMEData *data, const char *transformer_names[], void (*transformer_callback)(MME_Event_t, MME_Command_t *, void *)); - -LIBMMEIMG_ERROR mme_deinit_transformer(MMEData *data); - -LIBMMEIMG_ERROR create_mme_data_buffer(MME_DataBuffer_t **buf, unsigned int flags, void *dstbuf, unsigned long size); - -void free_mme_data_buffer(MME_DataBuffer_t *buf); - -LIBMMEIMG_ERROR mme_start_transformer(MMEData *data, size_t return_params_size, void *return_params, size_t params_size, void *params, void *out_buffer, unsigned long out_buffer_size); - -LIBMMEIMG_ERROR create_mme_input_command(MME_Command_t **command, MME_DataBuffer_t *data_buffer); - -void free_mme_command(MME_Command_t *command); - -void mme_abort_transformer(MMEData *data); - -LIBMMEIMG_ERROR mme_send_data(MMEData *data, char *data_content, unsigned long data_size); - -// needs modified stmfb to allow blitting on external mem, output is BGR -// memsize needs to be the whole size of srcdestmem -LIBMMEIMG_ERROR blit_decoder_result(char *srcmem, unsigned long srcmem_size, char *destmem, unsigned long destmem_size, unsigned int width, unsigned int height, unsigned int dest_width, unsigned int dest_height, unsigned int removeright, unsigned int removebottom); - - -#endif diff --git a/libmme_image/libmmeimage.c b/libmme_image/libmmeimage.c deleted file mode 100644 index 1cbf746..0000000 --- a/libmme_image/libmmeimage.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "libmmeimage.h" - - diff --git a/libmme_image/libmmeimage.h b/libmme_image/libmmeimage.h deleted file mode 100644 index 37400d0..0000000 --- a/libmme_image/libmmeimage.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef _LIBMMEIMAGE_H -#define _LIBMMEIMAGE_H - -#include "libmmeimg_error.h" -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -// FILE pointers provided to any of these functions need to be opened!! - -// This function is only provided for conveniency because the hardware is a quite fast in -// resizing images at decode time. However for providing the correct scaled image sizes one -// will need the original image sizes quite often. -LIBMMEIMG_ERROR get_jpeg_img_size(FILE *fp, unsigned int *width, unsigned int *height); - -// output is in BGR/user space (3 bytes per pixel) -LIBMMEIMG_ERROR decode_jpeg(FILE *fp, unsigned int original_width, unsigned int original_height, unsigned int dst_width, unsigned int dst_height, char **dest_data); - -// output is in BGR (3 bytes per pixel), but allocs no memory -LIBMMEIMG_ERROR decode_jpeg_noalloc(FILE *fp, unsigned int original_width, unsigned int original_height, unsigned int dst_width, unsigned int dst_height, char *dest_data, int mem_is_hw_writeable); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/libmme_image/libmmeimg_debug.h b/libmme_image/libmmeimg_debug.h deleted file mode 100644 index 8a61180..0000000 --- a/libmme_image/libmmeimg_debug.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _LIBMMEIMG_DEBUG_H -#define _LIBMMEIMG_DEBUG_H - -#include -#define DEBUG -#ifdef DEBUG -#define DEBUG_PRINT(format, ...) printf("(%s): " format "\n", __func__, ## __VA_ARGS__) -#else -#define DEBUG_PRINT(format,...) -#endif - -#endif diff --git a/libmme_image/libmmeimg_error.h b/libmme_image/libmmeimg_error.h deleted file mode 100644 index f891abf..0000000 --- a/libmme_image/libmmeimg_error.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _LIBMMEIMG_ERROR_H -#define _LIBMMEIMG_ERROR_H - -#define LIBMMEIMG_ERROR unsigned int - -#define LIBMMEIMG_SUCCESS 0 -#define LIBMMEIMG_MISC_ERROR 1 -#define LIBMMEIMG_NOMEM 2 -#define LIBMMEIMG_INVALIDARG 3 -#define LIBMMEIMG_NO_DEVACCESS 4 -#define LIBMMEIMG_DECODE_ERROR 5 - -#endif diff --git a/libmme_image/libmmeimg_jpeg.c b/libmme_image/libmmeimg_jpeg.c deleted file mode 100644 index 16f7716..0000000 --- a/libmme_image/libmmeimg_jpeg.c +++ /dev/null @@ -1,388 +0,0 @@ -#include "libmmeimage.h" -#include "libmmeimg_error.h" -#include "libmmeimg_debug.h" -#include "hw_interface.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -typedef struct -{ - MMEData data; - - JPEGD_TransformParams_t output_params; - JPEGD_TransformReturnParams_t return_params; - -} DecodeJPEGData; - -// do scaling at decoding time (within the limts of the jpeg decoder) -void pre_scale(unsigned int src_width, unsigned int src_height, unsigned int dst_width, unsigned int dst_height, unsigned int *out_width, unsigned int *out_height, unsigned int *out_removeright, unsigned int *out_removebottom) -{ - unsigned int src_width_mc = (src_width + 15) & ~15; // macro block limit - unsigned int src_height_mc = (src_height + 15) & ~15; - unsigned int scale; - unsigned int width_mc_diff = src_width_mc - src_width; - unsigned int height_mc_diff = src_height_mc - src_height; - - if ((src_width_mc / 8 >= dst_width) && (src_height_mc / 8 >= dst_height)) - scale = 8; - else if ((src_width_mc / 4 >= dst_width) && (src_height_mc / 4 >= dst_height)) - scale = 4; - else if ((src_width_mc / 2 >= dst_width) && (src_height_mc / 2 >= dst_height)) - scale = 2; - else - scale = 1; - - *out_width = src_width_mc / scale; - *out_height = src_height_mc / scale; - *out_removeright = width_mc_diff / scale + (width_mc_diff & 1); - *out_removebottom = height_mc_diff / scale + (height_mc_diff & 1); -} - -void jpeg_transformer_callback(MME_Event_t event, MME_Command_t *callback_data, void *user_data) -{ - JPEGD_TransformReturnParams_t *returnparams = (JPEGD_TransformReturnParams_t *)callback_data->CmdStatus.AdditionalInfo_p; - MMEData *data = (MMEData *)user_data; - - DEBUG_PRINT("transformer callback with event: %d - %s\n", event, get_mme_event_string(event)); - - switch (event) - { - case MME_COMMAND_COMPLETED_EVT: - { - if (callback_data->CmdStatus.State == MME_COMMAND_FAILED) - { - if (callback_data->CmdStatus.AdditionalInfoSize != 0) - { - MME_ERROR res; - - DEBUG_PRINT("command failed, JPEG return code: %d \n", returnparams->ErrorType); - - res = MME_AbortCommand(data->transformer_handle, callback_data->CmdStatus.CmdId); - - if (res != MME_SUCCESS) - DEBUG_PRINT("abort command failed: %d - %s\n", res, get_mme_error_string(res)); - - sem_post(&data->decode_event); - } - } - else - { - if (callback_data->CmdStatus.AdditionalInfoSize != 0) - { - - DEBUG_PRINT("expanded bytes: %d\n", returnparams->bytes_written); - DEBUG_PRINT("decode w/h: %dx%d\n", returnparams->decodedImageWidth, returnparams->decodedImageHeight); - DEBUG_PRINT("JPEG result code: %d\n", returnparams->ErrorType); - - data->decode_success = 1; - sem_post(&data->decode_event); - } - - } - break; - } - case MME_DATA_UNDERFLOW_EVT: - { - DEBUG_PRINT("data underflow (this is normal if it only occurs once)\n"); - break; - } - - - default: - { - DEBUG_PRINT("unhandled event %d - %s occured\n", event, get_mme_event_string(event)); - - if (callback_data->CmdStatus.AdditionalInfoSize != 0) - { - DEBUG_PRINT(" -> CmdStatus.AdditionalInfoSize: %d", callback_data->CmdStatus.AdditionalInfoSize); - DEBUG_PRINT(" -> returnparams->bytes_written: %d", returnparams->bytes_written); - DEBUG_PRINT(" -> returnparams->decodedImageHeight: %d", returnparams->decodedImageHeight); - DEBUG_PRINT(" -> returnparams->decodedImageWidth: %d", returnparams->decodedImageWidth); - DEBUG_PRINT("JPEG result code: %d\n", returnparams->ErrorType); - } - break; - } - }; -} - -// sequentiallize the requests -static sem_t jpeg_sem; -static int jpeg_sem_initialized = 0; - -LIBMMEIMG_ERROR decode_jpeg(FILE *fp, unsigned int original_width, unsigned int original_height, unsigned int dst_width, unsigned int dst_height, char **dest_data) -{ - LIBMMEIMG_ERROR ret; - - *dest_data = NULL; - // look if we have enough mem before starting the decode - *dest_data = (char *)malloc(dst_width * dst_height * 3); - if (!*dest_data) - { - DEBUG_PRINT("could not alloc sys mem for image"); - return LIBMMEIMG_NOMEM; - } - - ret = decode_jpeg_noalloc(fp, original_width, original_height, dst_width, dst_height, *dest_data, 0); - - if (ret != LIBMMEIMG_SUCCESS) - free(*dest_data); - return ret; -} - -LIBMMEIMG_ERROR decode_jpeg_noalloc(FILE *fp, unsigned int original_width, unsigned int original_height, unsigned int dst_width, unsigned int dst_height, char *dest_data, int mem_is_hw_writeable) -{ - DecodeJPEGData decode_data; - unsigned int pre_scaled_width, pre_scaled_height, removeright, removebottom; - int fd_bpa; - unsigned long filesize; - BPAMemAllocMemData bpa_data; - int res, i; - LIBMMEIMG_ERROR res_img; - - char bpa_mem_device[30]; - char *decode_surface; - - if (!jpeg_sem_initialized) - { - sem_init(&jpeg_sem, 0, 1); - jpeg_sem_initialized = 1; - } - - sem_wait(&jpeg_sem); - - res_img = mme_loadlib(); - if (res_img != LIBMMEIMG_SUCCESS) - { - sem_post(&jpeg_sem); - return res_img; - } - - fseek(fp, 0, SEEK_END); - filesize = ftell(fp); - fseek(fp, 0, SEEK_SET); - - pre_scale(original_width, original_height, dst_width, dst_height, &pre_scaled_width, &pre_scaled_height, &removeright, &removebottom); - - DEBUG_PRINT("pre-scaling to width %d height %d from width %d height %d, macro block limit border width = %d, height = %d\n", pre_scaled_width, pre_scaled_height, original_width, original_height, removeright, removebottom); - - fd_bpa = open("/dev/bpamem0", O_RDWR); - - if (fd_bpa < 0) - { - DEBUG_PRINT("cannot access /dev/bpamem0! err = %d", fd_bpa); - sem_post(&jpeg_sem); - return LIBMMEIMG_NO_DEVACCESS; - } - - bpa_data.bpa_part = "LMI_VID"; // TODO: good for ufs910 - please adapt this for other boxes - bpa_data.mem_size = pre_scaled_width * pre_scaled_height * 2; // we get the image in UYVY which is 2 byte per pixel - if (dst_width * dst_height * 3 > filesize) - if (mem_is_hw_writeable) - bpa_data.mem_size += filesize; - else - bpa_data.mem_size += dst_width * dst_height * 3; - else - bpa_data.mem_size += filesize; // temporarily store the whole file in mem - streaming is slow (at least on ufs910) - - res = ioctl(fd_bpa, BPAMEMIO_ALLOCMEM, &bpa_data); // request memory from bpamem - if (res) - { - DEBUG_PRINT("cannot alloc required mem"); - sem_post(&jpeg_sem); - return LIBMMEIMG_NOMEM; - } - - sprintf(bpa_mem_device, "/dev/bpamem%d", bpa_data.device_num); - close(fd_bpa); - - fd_bpa = open(bpa_mem_device, O_RDWR); - - // if somebody forgot to add all bpamem devs then this gets really bad here - if (fd_bpa < 0) - { - DEBUG_PRINT("cannot access %s! err = %d", bpa_mem_device, fd_bpa); - sem_post(&jpeg_sem); - return LIBMMEIMG_NO_DEVACCESS; - } - - decode_surface = (char *)mmap(0, bpa_data.mem_size, PROT_WRITE | PROT_READ, MAP_SHARED, fd_bpa, 0); - - if (decode_surface == MAP_FAILED) - { - DEBUG_PRINT("could not map bpa mem"); - ioctl(fd_bpa, BPAMEMIO_FREEMEM); - close(fd_bpa); - sem_post(&jpeg_sem); - return LIBMMEIMG_NOMEM; - } - - if (mme_init_multi() != LIBMMEIMG_SUCCESS) - { - DEBUG_PRINT("mme did not init"); - munmap(decode_surface, bpa_data.mem_size); - ioctl(fd_bpa, BPAMEMIO_FREEMEM); - close(fd_bpa); - sem_post(&jpeg_sem); - return LIBMMEIMG_NOMEM; - } - - // read in the file - fread(decode_surface + pre_scaled_width * pre_scaled_height * 2, 1, filesize, fp); - - // clear cache - msync(decode_surface + pre_scaled_width * pre_scaled_height * 2, filesize, MS_SYNC); - - static const char *transformers[] = { "JPEG_DECODER0", - "JPEG_Transformer0", - "JPEG_DECODER1", - "JPEG_DECODER2", - "JPEG_DECODER3", - "JPEG_DECODER4", - "JPEG_DECODER", - "JPEG_Transformer1", - "JPEG_Transformer2", - "JPEG_Transformer3", - "JPEG_Transformer4", - "JPEG_Transformer", - NULL - }; - - decode_data.data.decode_success = 0; - decode_data.data.transform_command = NULL; - res_img = mme_init_transformer(&decode_data.data, transformers, &jpeg_transformer_callback); - if (res_img == LIBMMEIMG_SUCCESS) - { - // init output settings - decode_data.output_params.outputSettings.xvalue0 = 0; - decode_data.output_params.outputSettings.xvalue1 = 0; - decode_data.output_params.outputSettings.yvalue0 = 0; - decode_data.output_params.outputSettings.yvalue1 = 0; - - decode_data.output_params.outputSettings.outputWidth = 0; - decode_data.output_params.outputSettings.outputHeight = 0; - decode_data.output_params.outputSettings.ROTATEFLAG = 0; - decode_data.output_params.outputSettings.Rotatedegree = 0; - decode_data.output_params.outputSettings.HorizantalFlip = 0; - decode_data.output_params.outputSettings.VerticalFlip = 0; -#ifndef STM22 - decode_data.output_params.outputSettings.ROTATEFLAG = 0x80000000; - decode_data.output_params.outputSettings.Pitch = pre_scaled_width * 2; -#endif - - res_img = mme_start_transformer(&decode_data.data, sizeof(JPEGD_TransformReturnParams_t), (void *)&decode_data.return_params, sizeof(JPEGD_TransformParams_t), (void *)&decode_data.output_params, decode_surface, pre_scaled_width * pre_scaled_height * 2); - - if (res_img == LIBMMEIMG_SUCCESS) - res_img = mme_send_data(&decode_data.data, decode_surface + pre_scaled_width * pre_scaled_height * 2, filesize); - } - - if (res_img != LIBMMEIMG_SUCCESS || !decode_data.data.decode_success) - { - mme_abort_transformer(&decode_data.data); - mme_deinit_transformer(&decode_data.data); - munmap(decode_surface, bpa_data.mem_size); - ioctl(fd_bpa, BPAMEMIO_FREEMEM); - close(fd_bpa); - sem_post(&jpeg_sem); - return LIBMMEIMG_DECODE_ERROR; - } - - mme_deinit_transformer(&decode_data.data); - mme_term_multi(); - sem_post(&jpeg_sem); - - if (mem_is_hw_writeable) - res_img = blit_decoder_result(decode_surface, bpa_data.mem_size, dest_data, dst_width * dst_height * 3, pre_scaled_width, pre_scaled_height, dst_width, dst_height, removeright, removebottom); - else - res_img = blit_decoder_result(decode_surface, bpa_data.mem_size, decode_surface + pre_scaled_width * pre_scaled_height * 2, dst_width * dst_height * 3, pre_scaled_width, pre_scaled_height, dst_width, dst_height, removeright, removebottom); - - if (res_img != LIBMMEIMG_SUCCESS) - { - munmap(decode_surface, bpa_data.mem_size); - ioctl(fd_bpa, BPAMEMIO_FREEMEM); - close(fd_bpa); - return LIBMMEIMG_DECODE_ERROR; - } - - if (mem_is_hw_writeable) - // clear cache - msync(dest_data, dst_width * dst_height * 3, MS_SYNC); - else - { - // clear cache - msync(decode_surface + pre_scaled_width * pre_scaled_height * 2, dst_width * dst_height * 3, MS_SYNC); - - // memcpy doesn't work - for (i = 0; i < dst_width * dst_height * 3; i++) - *(dest_data + i) = *(decode_surface + pre_scaled_width * pre_scaled_height * 2 + i); - } - - DEBUG_PRINT("JPEG decode finished"); - munmap(decode_surface, bpa_data.mem_size); - ioctl(fd_bpa, BPAMEMIO_FREEMEM); - close(fd_bpa); - - - return LIBMMEIMG_SUCCESS; -} - - -//------------------------------------- non hw stuff - -struct r_jpeg_error_mgr -{ - struct jpeg_error_mgr pub; - jmp_buf envbuffer; -}; - -void jpeg_cb_error_exit(j_common_ptr cinfo) -{ - struct r_jpeg_error_mgr *mptr; - mptr = (struct r_jpeg_error_mgr *) cinfo->err; - (*cinfo->err->output_message)(cinfo); - longjmp(mptr->envbuffer, 1); -} - -LIBMMEIMG_ERROR get_jpeg_img_size(FILE *fp, unsigned int *width, unsigned int *height) -{ - struct jpeg_decompress_struct cinfo; - struct jpeg_decompress_struct *ciptr = &cinfo; - struct r_jpeg_error_mgr emgr; - - fseek(fp, 0, SEEK_SET); - - ciptr->err = jpeg_std_error(&emgr.pub); - emgr.pub.error_exit = jpeg_cb_error_exit; - if (setjmp(emgr.envbuffer) == 1) - { - jpeg_destroy_decompress(ciptr); - return LIBMMEIMG_MISC_ERROR; - } - - jpeg_create_decompress(ciptr); - jpeg_stdio_src(ciptr, fp); - jpeg_read_header(ciptr, TRUE); - - jpeg_start_decompress(ciptr); - - *width = ciptr->output_width; - *height = ciptr->output_height; - - jpeg_abort_decompress(&cinfo); - jpeg_destroy_decompress(&cinfo); - fseek(fp, 0, SEEK_SET); - return LIBMMEIMG_SUCCESS; -} diff --git a/libs/gst-plugins-dvbmediasink-0.10.1/.gitignore b/libs/gst-plugins-dvbmediasink-0.10.1/.gitignore deleted file mode 100644 index 4434cad..0000000 --- a/libs/gst-plugins-dvbmediasink-0.10.1/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -Makefile -*-marshal.c -*-marshal.h -stamp-h1 diff --git a/libs/gst-plugins-dvbmediasink-0.10.1/AUTHORS b/libs/gst-plugins-dvbmediasink-0.10.1/AUTHORS deleted file mode 100644 index ea4940b..0000000 --- a/libs/gst-plugins-dvbmediasink-0.10.1/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -Felix Domke diff --git a/libs/gst-plugins-dvbmediasink-0.10.1/ChangeLog b/libs/gst-plugins-dvbmediasink-0.10.1/ChangeLog deleted file mode 100644 index e69de29..0000000 diff --git a/libs/gst-plugins-dvbmediasink-0.10.1/Makefile.am b/libs/gst-plugins-dvbmediasink-0.10.1/Makefile.am deleted file mode 100644 index 538a4b1..0000000 --- a/libs/gst-plugins-dvbmediasink-0.10.1/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -SUBDIRS = m4 src - -EXTRA_DIST = autogen.sh diff --git a/libs/gst-plugins-dvbmediasink-0.10.1/README b/libs/gst-plugins-dvbmediasink-0.10.1/README deleted file mode 100644 index 67a203e..0000000 --- a/libs/gst-plugins-dvbmediasink-0.10.1/README +++ /dev/null @@ -1,50 +0,0 @@ -This code is based on the gstreamer "dvbmediasink" plugin for dreamboxes -by Felix Domke . - -The original source can be obtained at: -https://schwerkraft.elitedvb.net/plugins/scmgit/cgi-bin/gitweb.cgi?p=dvbmediasink/dvbmediasink.git;a=summary - -/* GStreamer DVB Media Sink - * Copyright 2006 Felix Domke - * based on code by: - * Copyright 2005 Thomas Vander Stichele - * Copyright 2005 Ronald S. Bultje - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Alternatively, the contents of this file may be used under the - * GNU Lesser General Public License Version 2.1 (the "LGPL"), in - * which case the following provisions apply instead of the ones - * mentioned above: - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ diff --git a/libs/gst-plugins-dvbmediasink-0.10.1/TESTING b/libs/gst-plugins-dvbmediasink-0.10.1/TESTING deleted file mode 100644 index c289d72..0000000 --- a/libs/gst-plugins-dvbmediasink-0.10.1/TESTING +++ /dev/null @@ -1 +0,0 @@ -gst-launch -v playbin2 uri=file:///mnt/usb/music.mp3 diff --git a/libs/gst-plugins-dvbmediasink-0.10.1/common/glib-gen.mak b/libs/gst-plugins-dvbmediasink-0.10.1/common/glib-gen.mak deleted file mode 100644 index f9027da..0000000 --- a/libs/gst-plugins-dvbmediasink-0.10.1/common/glib-gen.mak +++ /dev/null @@ -1,44 +0,0 @@ -# these are the variables your Makefile.am should set -# the example is based on the colorbalance interface - -#glib_enum_headers=$(colorbalance_headers) -#glib_enum_define=GST_COLOR_BALANCE -#glib_enum_prefix=gst_color_balance - -enum_headers=$(foreach h,$(glib_enum_headers),\n\#include \"$(h)\") - -# these are all the rules generating the relevant files -%-marshal.h: %-marshal.list - glib-genmarshal --header --prefix=$(glib_enum_prefix)_marshal $^ > $*-marshal.h.tmp - mv $*-marshal.h.tmp $*-marshal.h - -%-marshal.c: %-marshal.list - echo "#include \"$*-marshal.h\"" >> $*-marshal.c.tmp - glib-genmarshal --body --prefix=$(glib_enum_prefix)_marshal $^ >> $*-marshal.c.tmp - mv $*-marshal.c.tmp $*-marshal.c - -%-enumtypes.h: $(glib_enum_headers) - glib-mkenums \ - --fhead "#ifndef __$(glib_enum_define)_ENUM_TYPES_H__\n#define __$(glib_enum_define)_ENUM_TYPES_H__\n\n#include \n\nG_BEGIN_DECLS\n" \ - --fprod "\n/* enumerations from \"@filename@\" */\n" \ - --vhead "GType @enum_name@_get_type (void);\n#define GST_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \ - --ftail "G_END_DECLS\n\n#endif /* __$(glib_enum_define)_ENUM_TYPES_H__ */" \ - $^ > $@ - -%-enumtypes.c: $(glib_enum_headers) - @if test "x$(glib_enum_headers)" == "x"; then echo "ERROR: glib_enum_headers is empty, please fix Makefile"; exit 1; fi - glib-mkenums \ - --fhead "#include \"$*-enumtypes.h\"\n$(enum_headers)" \ - --fprod "\n/* enumerations from \"@filename@\" */" \ - --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \ - --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ - --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \ - $^ > $@ - -# a hack rule to make sure .Plo files exist because they get include'd -# from Makefile's -.deps/%-marshal.Plo: - touch $@ - -.deps/%-enumtypes.Plo: - touch $@ diff --git a/libs/gst-plugins-dvbmediasink-0.10.1/configure.ac b/libs/gst-plugins-dvbmediasink-0.10.1/configure.ac deleted file mode 100644 index f77a695..0000000 --- a/libs/gst-plugins-dvbmediasink-0.10.1/configure.ac +++ /dev/null @@ -1,131 +0,0 @@ -AC_INIT - -dnl versions of gstreamer and plugins-base -GST_MAJORMINOR=0.10 -GST_REQUIRED=0.10.0 -GSTPB_REQUIRED=0.10.0 - -dnl fill in your package name and version here -dnl the fourth (nano) number should be 0 for a release, 1 for CVS, -dnl and 2... for a prerelease - -dnl when going to/from release please set the nano correctly ! -dnl releases only do Wall, cvs and prerelease does Werror too -AS_VERSION(gst-plugin, GST_PLUGIN_VERSION, 0, 10, 0, 1, - GST_PLUGIN_CVS="no", GST_PLUGIN_CVS="yes") - -dnl AM_MAINTAINER_MODE provides the option to enable maintainer mode -AM_MAINTAINER_MODE - -AM_INIT_AUTOMAKE($PACKAGE, $VERSION) - -dnl make aclocal work in maintainer mode -AC_SUBST(ACLOCAL_AMFLAGS, "-I m4") - -AM_CONFIG_HEADER(config.h) - -dnl check for tools -AC_PROG_CC -AC_PROG_LIBTOOL - - -dnl decide on error flags -AS_COMPILER_FLAG(-Wall, GST_WALL="yes", GST_WALL="no") - -if test "x$GST_WALL" = "xyes"; then - GST_ERROR="$GST_ERROR -Wall" - - if test "x$GST_CVS" = "xyes"; then - AS_COMPILER_FLAG(-Werror,GST_ERROR="$GST_ERROR -Werror",GST_ERROR="$GST_ERROR") - fi -fi - -dnl Check for pkgconfig first -AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no) - -dnl Give error and exit if we don't have pkgconfig -if test "x$HAVE_PKGCONFIG" = "xno"; then - AC_MSG_ERROR(you need to have pkgconfig installed !) -fi - -dnl Now we're ready to ask for gstreamer libs and cflags -dnl And we can also ask for the right version of gstreamer - - -PKG_CHECK_MODULES(GST, \ - gstreamer-$GST_MAJORMINOR >= $GST_REQUIRED, - HAVE_GST=yes,HAVE_GST=no) - -dnl Give error and exit if we don't have gstreamer -if test "x$HAVE_GST" = "xno"; then - AC_MSG_ERROR(you need gstreamer development packages installed !) -fi - -dnl append GST_ERROR cflags to GST_CFLAGS -GST_CFLAGS="$GST_CFLAGS $GST_ERROR" - -dnl make GST_CFLAGS and GST_LIBS available -AC_SUBST(GST_CFLAGS) -AC_SUBST(GST_LIBS) - -dnl make GST_MAJORMINOR available in Makefile.am -AC_SUBST(GST_MAJORMINOR) - -dnl If we need them, we can also use the base class libraries -PKG_CHECK_MODULES(GST_BASE, gstreamer-base-$GST_MAJORMINOR >= $GST_REQUIRED, - HAVE_GST_BASE=yes, HAVE_GST_BASE=no) - -dnl Give a warning if we don't have gstreamer libs -dnl you can turn this into an error if you need them -if test "x$HAVE_GST_BASE" = "xno"; then - AC_MSG_NOTICE(no GStreamer base class libraries found (gstreamer-base-$GST_MAJORMINOR)) -fi - -dnl make _CFLAGS and _LIBS available -AC_SUBST(GST_BASE_CFLAGS) -AC_SUBST(GST_BASE_LIBS) - -dnl If we need them, we can also use the gstreamer-plugins-base libraries -PKG_CHECK_MODULES(GSTPB_BASE, - gstreamer-plugins-base-$GST_MAJORMINOR >= $GSTPB_REQUIRED, - HAVE_GSTPB_BASE=yes, HAVE_GSTPB_BASE=no) - -dnl Give a warning if we don't have gstreamer libs -dnl you can turn this into an error if you need them -if test "x$HAVE_GSTPB_BASE" = "xno"; then - AC_MSG_NOTICE(no GStreamer Plugins Base libraries found (gstreamer-plugins-base-$GST_MAJORMINOR)) -fi - -dnl make _CFLAGS and _LIBS available -AC_SUBST(GSTPB_BASE_CFLAGS) -AC_SUBST(GSTPB_BASE_LIBS) - -dnl If we need them, we can also use the gstreamer-controller libraries -PKG_CHECK_MODULES(GSTCTRL, - gstreamer-controller-$GST_MAJORMINOR >= $GSTPB_REQUIRED, - HAVE_GSTCTRL=yes, HAVE_GSTCTRL=no) - -dnl Give a warning if we don't have gstreamer-controller -dnl you can turn this into an error if you need them -if test "x$HAVE_GSTCTRL" = "xno"; then - AC_MSG_NOTICE(no GStreamer Controller libraries found (gstreamer-controller-$GST_MAJORMINOR)) -fi - -dnl make _CFLAGS and _LIBS available -AC_SUBST(GSTCTRL_CFLAGS) -AC_SUBST(GSTCTRL_LIBS) - -dnl set the plugindir where plugins should be installed -if test "x${prefix}" = "x$HOME"; then - plugindir="$HOME/.gstreamer-$GST_MAJORMINOR/plugins" -else - plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR" -fi -AC_SUBST(plugindir) - -dnl set proper LDFLAGS for plugins -GST_PLUGIN_LDFLAGS='-module -avoid-version -export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*' -AC_SUBST(GST_PLUGIN_LDFLAGS) - -AC_OUTPUT(Makefile m4/Makefile src/Makefile) - diff --git a/libs/gst-plugins-dvbmediasink-0.10.1/m4/Makefile.am b/libs/gst-plugins-dvbmediasink-0.10.1/m4/Makefile.am deleted file mode 100644 index 4a44032..0000000 --- a/libs/gst-plugins-dvbmediasink-0.10.1/m4/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -EXTRA_DIST = as-version.m4 as-compiler-flag.m4 diff --git a/libs/gst-plugins-dvbmediasink-0.10.1/m4/as-compiler-flag.m4 b/libs/gst-plugins-dvbmediasink-0.10.1/m4/as-compiler-flag.m4 deleted file mode 100644 index 2f0ba19..0000000 --- a/libs/gst-plugins-dvbmediasink-0.10.1/m4/as-compiler-flag.m4 +++ /dev/null @@ -1,25 +0,0 @@ -dnl as-compiler-flag.m4 0.0.1 -dnl autostars m4 macro for detection of compiler flags -dnl -dnl ds@schleef.org - -AC_DEFUN([AS_COMPILER_FLAG], -[ - AC_MSG_CHECKING([to see if compiler understands $1]) - - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $1" - - AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no]) - CFLAGS="$save_CFLAGS" - - if test "X$flag_ok" = Xyes ; then - $2 - true - else - $3 - true - fi - AC_MSG_RESULT([$flag_ok]) -]) - diff --git a/libs/gst-plugins-dvbmediasink-0.10.1/m4/as-version.m4 b/libs/gst-plugins-dvbmediasink-0.10.1/m4/as-version.m4 deleted file mode 100644 index 68abdf9..0000000 --- a/libs/gst-plugins-dvbmediasink-0.10.1/m4/as-version.m4 +++ /dev/null @@ -1,66 +0,0 @@ -dnl as-version.m4 0.1.0 - -dnl autostars m4 macro for versioning - -dnl Thomas Vander Stichele - -dnl $Id$ - -dnl AS_VERSION(PACKAGE, PREFIX, MAJOR, MINOR, MICRO, NANO, -dnl ACTION-IF-NO-NANO, [ACTION-IF-NANO]) - -dnl example -dnl AS_VERSION(gstreamer, GST_VERSION, 0, 3, 2,) -dnl for a 0.3.2 release version - -dnl this macro -dnl - defines [$PREFIX]_MAJOR, MINOR and MICRO -dnl - if NANO is empty, then we're in release mode, else in cvs/dev mode -dnl - defines [$PREFIX], VERSION, and [$PREFIX]_RELEASE -dnl - executes the relevant action -dnl - AC_SUBST's PACKAGE, VERSION, [$PREFIX] and [$PREFIX]_RELEASE -dnl as well as the little ones -dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents -dnl maintainer mode from running ok -dnl -dnl don't forget to put #undef [$2] and [$2]_RELEASE in acconfig.h -dnl if you use acconfig.h - -AC_DEFUN([AS_VERSION], -[ - PACKAGE=[$1] - [$2]_MAJOR=[$3] - [$2]_MINOR=[$4] - [$2]_MICRO=[$5] - NANO=[$6] - [$2]_NANO=$NANO - if test "x$NANO" = "x" || test "x$NANO" = "x0"; - then - AC_MSG_NOTICE(configuring [$1] for release) - VERSION=[$3].[$4].[$5] - [$2]_RELEASE=1 - dnl execute action - ifelse([$7], , :, [$7]) - else - AC_MSG_NOTICE(configuring [$1] for development with nano $NANO) - VERSION=[$3].[$4].[$5].$NANO - [$2]_RELEASE=0.`date +%Y%m%d.%H%M%S` - dnl execute action - ifelse([$8], , :, [$8]) - fi - - [$2]=$VERSION - AC_DEFINE_UNQUOTED([$2], "$[$2]", [Define the version]) - AC_SUBST([$2]) - AC_DEFINE_UNQUOTED([$2]_RELEASE, "$[$2]_RELEASE", [Define the release version]) - AC_SUBST([$2]_RELEASE) - - AC_SUBST([$2]_MAJOR) - AC_SUBST([$2]_MINOR) - AC_SUBST([$2]_MICRO) - AC_SUBST([$2]_NANO) - AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define the package name]) - AC_SUBST(PACKAGE) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define the version]) - AC_SUBST(VERSION) -]) diff --git a/libs/gst-plugins-dvbmediasink-0.10.1/src/Makefile.am b/libs/gst-plugins-dvbmediasink-0.10.1/src/Makefile.am deleted file mode 100644 index 08eda59..0000000 --- a/libs/gst-plugins-dvbmediasink-0.10.1/src/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -glib_enum_prefix = gst_dvbsink - -include $(top_srcdir)/common/glib-gen.mak - -built_sources = gstdvbsink-marshal.c -built_headers = gstdvbsink-marshal.h - -BUILT_SOURCES = $(built_sources) $(built_headers) -# plugindir is set in configure - -CLEANFILES = $(BUILT_SOURCES) - -EXTRA_DIST = gstdvbsink-marshal.list - -plugin_LTLIBRARIES = libgstdvbvideosink.la libgstdvbaudiosink.la - -# for the next set of variables, rename the prefix if you renamed the .la - -# sources used to compile this plug-in -libgstdvbvideosink_la_SOURCES = gstdvbvideosink.c $(built_sources) -libgstdvbaudiosink_la_SOURCES = gstdvbaudiosink.c $(built_sources) - -# flags used to compile this plugin -# add other _CFLAGS and _LIBS as needed -libgstdvbvideosink_la_CFLAGS = $(GST_CFLAGS) -libgstdvbvideosink_la_LIBADD = $(GST_LIBS) -lgstbase-0.10 -lgstaudio-0.10 -libgstdvbvideosink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) - -libgstdvbaudiosink_la_CFLAGS = $(GST_CFLAGS) -libgstdvbaudiosink_la_LIBADD = $(GST_LIBS) -lgstbase-0.10 -lgstaudio-0.10 -libgstdvbaudiosink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) - -# headers we need but don't want installed -noinst_HEADERS = gstdvbvideosink.h gstdvbaudiosink.h - diff --git a/libs/gst-plugins-dvbmediasink-0.10.1/src/gstdvbaudiosink.c b/libs/gst-plugins-dvbmediasink-0.10.1/src/gstdvbaudiosink.c deleted file mode 100644 index 17da313..0000000 --- a/libs/gst-plugins-dvbmediasink-0.10.1/src/gstdvbaudiosink.c +++ /dev/null @@ -1,1895 +0,0 @@ - /* - * GStreamer DVB Media Sink - * Copyright 2006 Felix Domke - * based on code by: - * Copyright 2005 Thomas Vander Stichele - * Copyright 2005 Ronald S. Bultje - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Alternatively, the contents of this file may be used under the - * GNU Lesser General Public License Version 2.1 (the "LGPL"), in - * which case the following provisions apply instead of the ones - * mentioned above: - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/** - * SECTION:element-plugin - * - * - * Example launch line - * - * - * gst-launch -v -m audiotestsrc ! plugin ! fakesink silent=TRUE - * - * - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef __sh__ -#include -#endif - -#include - -#include "gstdvbaudiosink.h" -#include "gstdvbsink-marshal.h" - -/* We add a control socket as in fdsrc to make it shutdown quickly when it's blocking on the fd. - * Poll is used to determine when the fd is ready for use. When the element state is changed, - * it happens from another thread while fdsink is poll'ing on the fd. The state-change thread - * sends a control message, so fdsink wakes up and changes state immediately otherwise - * it would stay blocked until it receives some data. */ - -/* the poll call is also performed on the control sockets, that way - * we can send special commands to unblock the poll call */ -#define CONTROL_STOP 'S' /* stop the poll call */ -#define CONTROL_SOCKETS(sink) sink->control_sock -#define WRITE_SOCKET(sink) sink->control_sock[1] -#define READ_SOCKET(sink) sink->control_sock[0] - -#define SEND_COMMAND(sink, command) \ -G_STMT_START { \ - unsigned char c; c = command; \ - write (WRITE_SOCKET(sink), &c, 1); \ -} G_STMT_END - -#define READ_COMMAND(sink, command, res) \ -G_STMT_START { \ - res = read(READ_SOCKET(sink), &command, 1); \ -} G_STMT_END - -#ifndef AUDIO_GET_PTS -#define AUDIO_GET_PTS _IOR('o', 19, gint64) -#endif - -#define PROP_LOCATION 99 - -GST_DEBUG_CATEGORY_STATIC (dvbaudiosink_debug); -#define GST_CAT_DEFAULT dvbaudiosink_debug - -enum -{ - SIGNAL_GET_DECODER_TIME, - LAST_SIGNAL -}; - -static guint gst_dvbaudiosink_signals[LAST_SIGNAL] = { 0 }; - -static guint AdtsSamplingRates[] = { 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350, 0 }; - -static GstStaticPadTemplate sink_factory_ati_xilleon = -GST_STATIC_PAD_TEMPLATE ( - "sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ("audio/mpeg, " - "mpegversion = (int) 1, " - "layer = (int) [ 1, 2 ], " - "framed = (boolean) true; " - "audio/x-ac3, " - "framed = (boolean) true; " - "audio/x-private1-ac3, " - "framed = (boolean) true") -); - -static GstStaticPadTemplate sink_factory_broadcom_dts = -GST_STATIC_PAD_TEMPLATE ( - "sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ("audio/mpeg, " - "framed = (boolean) true; " - "audio/x-ac3, " - "framed = (boolean) true; " - "audio/x-private1-ac3, " - "framed = (boolean) true; " - "audio/x-dts, " - "framed = (boolean) true; " - "audio/x-private1-dts, " - "framed = (boolean) true; " - "audio/x-private1-lpcm, " - "framed = (boolean) true") -); - -static GstStaticPadTemplate sink_factory_broadcom = -GST_STATIC_PAD_TEMPLATE ( - "sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ("audio/mpeg, " - "framed = (boolean) true; " - "audio/x-ac3, " - "framed = (boolean) true; " - "audio/x-private1-ac3, " - "framed = (boolean) true") -); - -#define SINK_FACTORY_STM_BASE \ -GST_STATIC_PAD_TEMPLATE ( \ - "sink", \ - GST_PAD_SINK, \ - GST_PAD_ALWAYS, \ - GST_STATIC_CAPS ("audio/mpeg, " \ - "framed = (boolean) true; " \ - "audio/x-ac3, " \ - "framed = (boolean) true; " \ - "audio/x-eac3, " \ - "framed = (boolean) true; " \ - "audio/x-private1-ac3, " \ - "framed = (boolean) true; " \ - "audio/x-dts, " \ - "framed = (boolean) true; " \ - "audio/x-private1-dts, " \ - "framed = (boolean) true; " \ - "audio/x-private1-lpcm, " \ - "framed = (boolean) true; " \ - "audio/x-wma, " \ - "framed = (boolean) true; " \ - "audio/x-ms-wma, " \ - "framed = (boolean) true") \ -) - -#define SINK_FACTORY_STM_BASE_EXTENDED \ -GST_STATIC_PAD_TEMPLATE ( \ - "sink", \ - GST_PAD_SINK, \ - GST_PAD_ALWAYS, \ - GST_STATIC_CAPS ("audio/mpeg, " \ - "framed = (boolean) true; " \ - "audio/x-ac3, " \ - "framed = (boolean) true; " \ - "audio/x-eac3, " \ - "framed = (boolean) true; " \ - "audio/x-private1-ac3, " \ - "framed = (boolean) true; " \ - "audio/x-dts, " \ - "framed = (boolean) true; " \ - "audio/x-private1-dts, " \ - "framed = (boolean) true; " \ - "audio/x-raw-int; " \ - "audio/x-private1-lpcm, " \ - "framed = (boolean) true; " \ - "audio/x-wma, " \ - "framed = (boolean) true; " \ - "audio/x-ms-wma, " \ - "framed = (boolean) true") \ -) - -// FIRST GENERATION -static GstStaticPadTemplate sink_factory_stm_stx7100 = SINK_FACTORY_STM_BASE_EXTENDED; -static GstStaticPadTemplate sink_factory_stm_stx7101 = SINK_FACTORY_STM_BASE_EXTENDED; -static GstStaticPadTemplate sink_factory_stm_stx7109 = SINK_FACTORY_STM_BASE_EXTENDED; - -//#define TODO_ALSASINK_WORKING //Todo: Some iamge have problems with the alsasink, needs investigation. -#if defined(TODO_ALSASINK_WORKING) -// SECOND GENERATION -static GstStaticPadTemplate sink_factory_stm_stx7105 = SINK_FACTORY_STM_BASE; -static GstStaticPadTemplate sink_factory_stm_stx7111 = SINK_FACTORY_STM_BASE; - -// THIRD GENERATION -static GstStaticPadTemplate sink_factory_stm_stx7106 = SINK_FACTORY_STM_BASE; -static GstStaticPadTemplate sink_factory_stm_stx7108 = SINK_FACTORY_STM_BASE; -#else -// SECOND GENERATION -static GstStaticPadTemplate sink_factory_stm_stx7105 = SINK_FACTORY_STM_BASE_EXTENDED; -static GstStaticPadTemplate sink_factory_stm_stx7111 = SINK_FACTORY_STM_BASE_EXTENDED; - -// THIRD GENERATION -static GstStaticPadTemplate sink_factory_stm_stx7106 = SINK_FACTORY_STM_BASE_EXTENDED; -static GstStaticPadTemplate sink_factory_stm_stx7108 = SINK_FACTORY_STM_BASE_EXTENDED; -#endif - -#define DEBUG_INIT(bla) \ - GST_DEBUG_CATEGORY_INIT (dvbaudiosink_debug, "dvbaudiosink", 0, "dvbaudiosink element"); - -GST_BOILERPLATE_FULL (GstDVBAudioSink, gst_dvbaudiosink, GstBaseSink, GST_TYPE_BASE_SINK, DEBUG_INIT); - -static void gst_dvbaudiosink_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); -static void gst_dvbaudiosink_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); - -static gboolean gst_dvbaudiosink_start (GstBaseSink * sink); -static gboolean gst_dvbaudiosink_stop (GstBaseSink * sink); -static gboolean gst_dvbaudiosink_event (GstBaseSink * sink, GstEvent * event); -static GstFlowReturn gst_dvbaudiosink_render (GstBaseSink * sink, GstBuffer * buffer); -static gboolean gst_dvbaudiosink_unlock (GstBaseSink * basesink); -static gboolean gst_dvbaudiosink_unlock_stop (GstBaseSink * basesink); -static gboolean gst_dvbaudiosink_set_caps (GstBaseSink * sink, GstCaps * caps); -static void gst_dvbaudiosink_dispose (GObject * object); -static GstStateChangeReturn gst_dvbaudiosink_change_state (GstElement * element, GstStateChange transition); -static gint64 gst_dvbaudiosink_get_decoder_time (GstDVBAudioSink *self); - -#define PES_MAX_HEADER_SIZE 64 - -typedef enum { HW_UNKNOWN, - DM7025, DM800, DM8000, DM500HD, DM800SE, DM7020HD, - STX7100, STX7101, STX7109, STX7105, STX7111, STX7106, STX7108 -} hardware_type_t; - -typedef enum { PF_UNKNOWN, DM, HAVANA } platform_type_t; - -static hardware_type_t hwtype = HW_UNKNOWN; -static platform_type_t pftype = PF_UNKNOWN; - -//Please correct if wrong -#define BYPASS_UNKNOWN 0xFF -#define BYPASS_AC3 0x00 -#define BYPASS_MPEG1 0x01 -#define BYPASS_DTS 0x02 -#define BYPASS_PCMB 0x04 -#define BYPASS_PCML 0x05 -#define BYPASS_LPCM 0x06 -#define BYPASS_MPEG1_L3 0x0A -#define BYPASS_AAC 0x0B -#define BYPASS_WMA 0x0C -#define BYPASS_VORBIS 0x0D -#define BYPASS_FLAC 0x0E - -#define AUDIO_ENCODING_UNKNOWN 0xFF - -unsigned int bypass_to_encoding (unsigned int bypass) -{ -#ifdef AUDIO_SET_ENCODING - switch(bypass) - { - case BYPASS_AC3: - return AUDIO_ENCODING_AC3; - case BYPASS_MPEG1: - return AUDIO_ENCODING_MPEG1; - case BYPASS_DTS: - return AUDIO_ENCODING_DTS; - case BYPASS_PCMB: - case BYPASS_PCML: - case BYPASS_LPCM: - return AUDIO_ENCODING_LPCMA; - case BYPASS_MPEG1_L3: - return AUDIO_ENCODING_MP3; - case BYPASS_AAC: - return AUDIO_ENCODING_AAC; - case BYPASS_WMA: - return AUDIO_ENCODING_WMA; - case BYPASS_VORBIS: - return AUDIO_ENCODING_VORBIS; - case BYPASS_FLAC: - return AUDIO_ENCODING_FLAC; - default: - return AUDIO_ENCODING_UNKNOWN; - } -#endif - return AUDIO_ENCODING_UNKNOWN; -} - -static void -gst_dvbaudiosink_base_init (gpointer klass) -{ - static GstElementDetails element_details = { - "A DVB audio sink", - "Generic/DVBAudioSink", - "Outputs a MPEG2 PES / ES into a DVB audio device for hardware playback", - "Felix Domke " - }; - GstElementClass *element_class = GST_ELEMENT_CLASS (klass); - - //gst_debug_set_active(TRUE); - - int fd = open("/proc/stb/info/model", O_RDONLY); - if ( fd > 0 ) - { - gchar string[9] = { 0, }; - ssize_t rd = read(fd, string, 8); - if ( rd >= 5 ) - { - string[rd] = 0; - if ( !strncasecmp(string, "DM7025", 6) ) { - pftype = DM; - hwtype = DM7025; - GST_INFO ("model is DM7025 set ati xilleon caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_ati_xilleon)); - } - else if ( !strncasecmp(string, "DM8000", 6) ) { - pftype = DM; - hwtype = DM8000; - GST_INFO ("model is DM8000 set broadcom dts caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_broadcom_dts)); - } - else if ( !strncasecmp(string, "DM800SE", 7) ) { - pftype = DM; - hwtype = DM800SE; - GST_INFO ("model is DM800SE set broadcom dts caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_broadcom_dts)); - } - else if ( !strncasecmp(string, "DM7020HD", 8) ) { - pftype = DM; - hwtype = DM7020HD; - GST_INFO ("model is DM7020HD set broadcom dts caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_broadcom_dts)); - } - else if ( !strncasecmp(string, "DM800", 5) ) { - pftype = DM; - hwtype = DM800; - GST_INFO ("model is DM800 set broadcom caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_broadcom)); - } - else if ( !strncasecmp(string, "DM500HD", 7) ) { - pftype = DM; - hwtype = DM500HD; - GST_INFO ("model is DM500HD set broadcom dts caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_broadcom_dts)); - } - } - close(fd); - } - - if (hwtype == HW_UNKNOWN) { - // Unfortunately we dont have sysinfo available so doing it the hard way - char line[256]; - char *processor; - FILE *file = fopen("/proc/cpuinfo", "r"); - while (fgets(line, sizeof(line) - 1, file) != NULL) - { - if (!strncmp(line, "cpu type", 8)) - { - strtok (line,":"); - processor = strtok (NULL,":"); - while(processor[0] == ' ') processor++; - break; - } - } - fclose(file); - - printf("Processor: %s\n", processor); - - // FIRST GENERATION - if( !strncasecmp(processor, "STX7100", 7) || - !strncasecmp(processor, "STB7100", 7) || - !strncasecmp(processor, "STI7100", 7)) { - pftype = HAVANA; - hwtype = STX7100; - GST_INFO ("setting STX7100 caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_stm_stx7100)); - } - else if(!strncasecmp(processor, "STX7101", 7)) { - pftype = HAVANA; - hwtype = STX7101; - GST_INFO ("setting STX7101 caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_stm_stx7101)); - } - else if(!strncasecmp(processor, "STX7109", 7)) { - pftype = HAVANA; - hwtype = STX7109; - GST_INFO ("setting STX7109 caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_stm_stx7109)); - } - // SECOND GENERATIONad_template_get (&sink_factory_stm_stx7111)); - else if(!strncasecmp(processor, "STX7105", 7)) { - pftype = HAVANA; - hwtype = STX7105; - GST_INFO ("setting STX7105 caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_stm_stx7105)); - } - else if(!strncasecmp(processor, "STX7111", 7)) { - pftype = HAVANA; - hwtype = STX7111; - GST_INFO ("setting STX7111 caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_stm_stx7111)); - } - // THIRD GENERATION - else if(!strncasecmp(processor, "STX7106", 7)) { - pftype = HAVANA; - hwtype = STX7106; - GST_INFO ("setting STX7106 caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_stm_stx7106)); - } - else if(!strncasecmp(processor, "STX7108", 7)) { - pftype = HAVANA; - hwtype = STX7108; - GST_INFO ("setting STX7108 caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_stm_stx7108)); - } - } - - gst_element_class_set_details (element_class, &element_details); -} - -static int -gst_dvbaudiosink_async_write(GstDVBAudioSink *self, unsigned char *data, unsigned int len); - -/* initialize the plugin's class */ -static void -gst_dvbaudiosink_class_init (GstDVBAudioSinkClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - GstBaseSinkClass *gstbasesink_class = GST_BASE_SINK_CLASS (klass); - GstElementClass *gelement_class = GST_ELEMENT_CLASS (klass); - - gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_dvbaudiosink_dispose); - gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_dvbaudiosink_set_property); - gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_dvbaudiosink_get_property); - g_object_class_install_property (gobject_class, PROP_LOCATION, - g_param_spec_string ("dump-filename", "Dump File Location", - "Filename that Packetized Elementary Stream will be written to", NULL, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - gstbasesink_class->start = GST_DEBUG_FUNCPTR (gst_dvbaudiosink_start); - gstbasesink_class->stop = GST_DEBUG_FUNCPTR (gst_dvbaudiosink_stop); - gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_dvbaudiosink_render); - gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_dvbaudiosink_event); - gstbasesink_class->unlock = GST_DEBUG_FUNCPTR (gst_dvbaudiosink_unlock); - gstbasesink_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_dvbaudiosink_unlock_stop); - gstbasesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_dvbaudiosink_set_caps); - - gelement_class->change_state = GST_DEBUG_FUNCPTR (gst_dvbaudiosink_change_state); - - gst_dvbaudiosink_signals[SIGNAL_GET_DECODER_TIME] = - g_signal_new ("get-decoder-time", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, - G_STRUCT_OFFSET (GstDVBAudioSinkClass, get_decoder_time), - NULL, NULL, gst_dvbsink_marshal_INT64__VOID, G_TYPE_INT64, 0); - - klass->get_decoder_time = gst_dvbaudiosink_get_decoder_time; - klass->async_write = gst_dvbaudiosink_async_write; -} - -/* initialize the new element - * instantiate pads and add them to element - * set functions - * initialize structure - */ -static void -gst_dvbaudiosink_init (GstDVBAudioSink *klass, GstDVBAudioSinkClass * gclass) -{ -// If AUDIO_SET_ENCODING ioctl is available us it, -// as using AUDIO_SET_BYPASS to change the encoding is not spec conform -#ifdef AUDIO_SET_ENCODING - klass->use_set_encoding = TRUE; -#else - klass->use_set_encoding = FALSE; -#endif - klass->bypass = BYPASS_UNKNOWN; - - klass->timestamp = 0; - klass->aac_adts_header_valid = FALSE; - - klass->initial_header = TRUE; - - klass->runtime_header_data_size = 0; - klass->pcm_bits_per_sample = 0; - klass->pcm_sub_frame_len = 0; - klass->pcm_sub_frame_per_pes = 0; - klass->pcm_break_buffer_size = 0; - - klass->no_write = 0; - klass->queue = NULL; - klass->fd = -1; - klass->dump_fd = -1; - klass->dump_filename = NULL; - - gst_base_sink_set_sync (GST_BASE_SINK(klass), FALSE); - gst_base_sink_set_async_enabled (GST_BASE_SINK(klass), TRUE); -} - -static void -gst_dvbaudiosink_dispose (GObject * object) -{ - GstDVBAudioSink *self = GST_DVBAUDIOSINK (object); - GstState state, pending; - GST_DEBUG_OBJECT (self, "dispose"); - - // hack start : for gstreamer decodebin2 bug... it tries to dispose .. - // but doesnt set the state to NULL when it is READY - switch(gst_element_get_state(GST_ELEMENT(object), &state, &pending, GST_CLOCK_TIME_NONE)) - { - case GST_STATE_CHANGE_SUCCESS: - GST_DEBUG_OBJECT(self, "success"); - if (state != GST_STATE_NULL) { - GST_DEBUG_OBJECT(self, "state %d in dispose.. set it to NULL (decodebin2 bug?)", state); - if (gst_element_set_state(GST_ELEMENT(object), GST_STATE_NULL) == GST_STATE_CHANGE_ASYNC) { - GST_DEBUG_OBJECT(self, "set state returned async... wait!"); - gst_element_get_state(GST_ELEMENT(object), &state, &pending, GST_CLOCK_TIME_NONE); - } - } - break; - case GST_STATE_CHANGE_ASYNC: - GST_DEBUG_OBJECT(self, "async"); - break; - case GST_STATE_CHANGE_FAILURE: - GST_DEBUG_OBJECT(self, "failure"); - break; - case GST_STATE_CHANGE_NO_PREROLL: - GST_DEBUG_OBJECT(self, "no preroll"); - break; - default: - break; - } - // hack end - - GST_DEBUG_OBJECT(self, "state in dispose %d, pending %d", state, pending); - - if (self->dump_filename) - { - g_free (self->dump_filename); - self->dump_filename = NULL; - } - - G_OBJECT_CLASS (parent_class)->dispose (object); -} - -static gboolean -gst_dvbaudiosink_set_location (GstDVBAudioSink * sink, const gchar * location) -{ - if (sink->dump_fd) - { - g_warning ("Changing the `dump-filename' property during operation is not supported."); - return FALSE; - } - - g_free (sink->dump_filename); - if (location != NULL) { - /* we store the filename as we received it from the application. On Windows - * this should be in UTF8 */ - sink->dump_filename = g_strdup (location); - } else { - sink->dump_filename = NULL; - } - - return TRUE; -} - -static void -gst_dvbaudiosink_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) -{ - GstDVBAudioSink *sink = GST_DVBAUDIOSINK (object); - - switch (prop_id) { - case PROP_LOCATION: - gst_dvbaudiosink_set_location (sink, g_value_get_string (value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static void -gst_dvbaudiosink_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) -{ - GstDVBAudioSink *sink = GST_DVBAUDIOSINK (object); - - switch (prop_id) { - case PROP_LOCATION: - g_value_set_string (value, sink->dump_filename); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - break; - } -} - -static gint64 -gst_dvbaudiosink_get_decoder_time (GstDVBAudioSink *self) -{ - if (self->bypass != BYPASS_UNKNOWN) { - gint64 cur = 0; - static gint64 last_pos = 0; - - ioctl(self->fd, AUDIO_GET_PTS, &cur); - - /* workaround until driver fixed */ - if (cur) - last_pos = cur; - else - cur = last_pos; - - cur *= 11111; - - return cur; - } - return GST_CLOCK_TIME_NONE; -} - -static gboolean -gst_dvbaudiosink_unlock (GstBaseSink * basesink) -{ - GstDVBAudioSink *self = GST_DVBAUDIOSINK (basesink); - GST_OBJECT_LOCK(self); - self->no_write |= 2; - GST_OBJECT_UNLOCK(self); - SEND_COMMAND (self, CONTROL_STOP); - GST_DEBUG_OBJECT (basesink, "unlock"); - return TRUE; -} - -static gboolean -gst_dvbaudiosink_unlock_stop (GstBaseSink * basesink) -{ - GstDVBAudioSink *self = GST_DVBAUDIOSINK (basesink); - GST_OBJECT_LOCK(self); - self->no_write &= ~2; - GST_OBJECT_UNLOCK(self); - GST_DEBUG_OBJECT (basesink, "unlock_stop"); - return TRUE; -} - -static gboolean -gst_dvbaudiosink_set_caps (GstBaseSink * basesink, GstCaps * caps) -{ - GstDVBAudioSink *self = GST_DVBAUDIOSINK (basesink); - GstStructure *structure = gst_caps_get_structure (caps, 0); - const char *type = gst_structure_get_name (structure); - unsigned int bypass = BYPASS_UNKNOWN; - - self->skip = 0; - - if (!strcmp(type, "audio/mpeg")) { - gint mpegversion; - gst_structure_get_int (structure, "mpegversion", &mpegversion); - switch (mpegversion) { - case 1: - { - gint layer; - gst_structure_get_int (structure, "layer", &layer); - if ( layer == 3 ) - bypass = BYPASS_MPEG1_L3; - else - bypass = BYPASS_MPEG1; - GST_INFO_OBJECT (self, "MIMETYPE %s version %d layer %d", type, mpegversion, layer); - break; - } - case 2: - case 4: - { - const gchar *stream_type = gst_structure_get_string (structure, "stream-type"); - if (!stream_type) - stream_type = gst_structure_get_string (structure, "stream-format"); - if (stream_type && !strcmp(stream_type, "adts")) - printf("MIMETYPE %s version %d (AAC-ADTS)", type, mpegversion); - else { - guint8 channels = 0xFF, rate_idx = 0xFF, obj_type = 0xFF; - const GValue *codec_data = gst_structure_get_value (structure, "codec_data"); - printf("MIMETYPE %s version %d (AAC-RAW)", type, mpegversion); - - // Get necessary data for header - if (codec_data) { - guint8 *h = GST_BUFFER_DATA(gst_value_get_buffer (codec_data)); - printf("have codec data\n"); - obj_type = ((h[0] & 0xC) >> 2) + 1; - rate_idx = ((h[0] & 0x3) << 1) | ((h[1] & 0x80) >> 7); - channels = (h[1] & 0x78) >> 3; - } - else { - gint rate_tmp, channels_tmp; - printf("have no codec data\n"); - if (gst_structure_get_int (structure, "rate", &rate_tmp) && gst_structure_get_int (structure, "channels", &channels_tmp)) { - do { - if (AdtsSamplingRates[rate_idx] == rate_tmp) - break; - ++rate_idx; - } while (AdtsSamplingRates[rate_idx]); - if (AdtsSamplingRates[rate_idx]) { - obj_type = 1; // hardcoded yet.. hopefully this works every time ;) - channels = (guint8)(channels_tmp&0xFF); - } - } - } - - if (channels != 0xFF && rate_idx != 0xFF && obj_type != 0xFF) { - printf("have codec data -> obj_type = %d, rate_idx = %d, channels = %d\n", - obj_type, rate_idx, channels); - - // AAC ADTS Header: - // 0: SSSSSSSS (S=Sync) - // 1: SSSS I LL P (I=Id L=Layer P=Protection) - // 2: OO RRRR P C (O=Profile R=Rate P=Private=0x0 C=Channels) - // 3: CC ZZZZ LL (Z=Zero=0x0 L=AAC Frame Length) - // 4: LLLLLLLL - // 5: LLL DDDDD (D=ADTS Buffer Fullness) - // 6: DDDDDD NN (N=Count Raw Data Blocks) - - /* Sync point over a full byte */ - self->aac_adts_header[0] = 0xFF; - - /* Sync point continued over first 4 bits + static 4 bits - * (ID, layer, protection)*/ - self->aac_adts_header[1] = 0xF1; - if (mpegversion == 2) - self->aac_adts_header[1] |= 8; - - /* Object type over first 2 bits */ - self->aac_adts_header[2] = obj_type << 6; - /* rate index over next 4 bits */ - self->aac_adts_header[2] |= rate_idx << 2; - /* channels over last bit */ - self->aac_adts_header[2] |= (channels & 0x4) >> 2; - - /* channels continued over next 2 bits + 4 bits at zero */ - self->aac_adts_header[3] = (channels & 0x3) << 6; - - /* Other fields will be set on runtime in gst_dvbaudiosink_render */ - self->aac_adts_header_valid = TRUE; - } - } - bypass = BYPASS_AAC; // always use AAC + ADTS yet.. - break; - } - default: - GST_ELEMENT_ERROR (self, STREAM, FORMAT, (NULL), ("unhandled mpeg version %i", mpegversion)); - break; - } - } - else if (!strcmp(type, "audio/x-ac3") || !strcmp(type, "audio/x-eac3")) { - GST_INFO_OBJECT (self, "MIMETYPE %s",type); - bypass = BYPASS_AC3; - } - else if (!strcmp(type, "audio/x-private1-dts")) { - GST_INFO_OBJECT (self, "MIMETYPE %s (DVD Audio - 2 byte skipping)",type); - bypass = BYPASS_DTS; - self->skip = 2; - } - else if (!strcmp(type, "audio/x-private1-ac3")) { - GST_INFO_OBJECT (self, "MIMETYPE %s (DVD Audio - 2 byte skipping)",type); - bypass = BYPASS_AC3; - self->skip = 2; - } - else if (!strcmp(type, "audio/x-private1-lpcm")) { - GST_INFO_OBJECT (self, "MIMETYPE %s (DVD Audio)",type); - bypass = BYPASS_LPCM; - } - else if (!strcmp(type, "audio/x-raw-int")) { - printf("X-RAW-INT ->\n"); - GST_INFO_OBJECT (self, "MIMETYPE %s", type); - gint endianess = G_BIG_ENDIAN; - gst_structure_get_int (structure, "endianness", &endianess); - - gint number_of_channels; - gst_structure_get_int (structure, "channels", &number_of_channels); - - gint samples_per_second; - gst_structure_get_int (structure, "rate", &samples_per_second); - - gst_structure_get_int (structure, "depth", &self->pcm_bits_per_sample); - - const unsigned char clpcm_prv[14] = { - 0xA0, //sub_stream_id - 0, 0, //resvd and UPC_EAN_ISRC stuff, unused - 0x0A, //private header length - 0, 9, //first_access_unit_pointer - 0x00, //emph,rsvd,stereo,downmix - 0x0F, //quantisation word length 1,2 - 0x0F, //audio sampling freqency 1,2 - 0, //resvd, multi channel type - 0, //bit shift on channel GR2, assignment - 0x80, //dynamic range control - 0, 0 //resvd for copyright management - }; - - self->runtime_header_data_size = sizeof(clpcm_prv); - self->runtime_header_data = - (guint8*) malloc(sizeof(guint8) * self->runtime_header_data_size); - - memcpy(self->runtime_header_data, clpcm_prv, self->runtime_header_data_size); - - //figure out size of subframe - //and set up sample rate - switch(samples_per_second) { - case 48000: self->pcm_sub_frame_len = 40; - break; - case 96000: self->runtime_header_data[8] |= 0x10; - self->pcm_sub_frame_len = 80; - break; - case 192000: self->runtime_header_data[8] |= 0x20; - self->pcm_sub_frame_len = 160; - break; - case 44100: self->runtime_header_data[8] |= 0x80; - self->pcm_sub_frame_len = 40; - break; - case 88200: self->runtime_header_data[8] |= 0x90; - self->pcm_sub_frame_len = 80; - break; - case 176400: self->runtime_header_data[8] |= 0xA0; - self->pcm_sub_frame_len = 160; - break; - default: break; - } - - self->pcm_sub_frame_len *= number_of_channels; - self->pcm_sub_frame_len *= (self->pcm_bits_per_sample / 8); - - //rewrite PES size to have as many complete subframes per PES as we can - self->pcm_sub_frame_per_pes = ((2048-18/*sizeof(lpcm_pes)*/)-14/*sizeof(lpcm_prv)*/)/self->pcm_sub_frame_len; - self->pcm_sub_frame_len *= self->pcm_sub_frame_per_pes; - - //set number of channels - self->runtime_header_data[10] = number_of_channels - 1; - - printf("X-RAW-INT - BITS %d\n", self->pcm_bits_per_sample); - - switch(self->pcm_bits_per_sample) { - case 16: break; - case 24: self->runtime_header_data[7] |= 0x20; - break; - default: printf("inappropriate bits per sample (%d) - must be 16 or 24\n", self->pcm_bits_per_sample); - break; - } - - if (endianess == G_BIG_ENDIAN) { - printf("X-RAW-INT - BIG_ENDIAN\n"); - bypass = BYPASS_PCMB; - } - else if (endianess == G_LITTLE_ENDIAN) { - printf("X-RAW-INT - LITTLE_ENDIAN\n"); - bypass = BYPASS_PCML; - } - else - return FALSE; - - printf("X-RAW-INT <-\n"); - } - else if (!strcmp(type, "audio/x-dts")) { - GST_INFO_OBJECT (self, "MIMETYPE %s",type); - bypass = BYPASS_DTS; - } - - else if (!strcmp(type, "audio/x-wma") || !strcmp(type, "audio/x-ms-wma")) { - GST_INFO_OBJECT (self, "MIMETYPE %s",type); - - const GValue *codec_data = gst_structure_get_value (structure, "codec_data"); - guint8 *h = GST_BUFFER_DATA(gst_value_get_buffer (codec_data)); - guint32 h_size = GST_BUFFER_SIZE(gst_value_get_buffer (codec_data)); - - // type_specific_data - #define WMA_VERSION_1 0x160 - #define WMA_VERSION_2_9 0x161 - #define WMA_VERSION_9_PRO 0x162 - #define WMA_LOSSLESS 0x163 - guint16 codec_id = 0; - gint wmaversion; - gst_structure_get_int (structure, "wmaversion", &wmaversion); - //TODO: Need to check posible values - switch(wmaversion) { - //TODO: What code for lossless ? - case 9: - codec_id = WMA_VERSION_9_PRO; - break; - case 2: - codec_id = WMA_VERSION_2_9 ; - break; - case 1: - default: - codec_id = WMA_VERSION_1; - break; - } - - self->initial_header_private_data_size = 104 + h_size; - self->initial_header_private_data = - (guint8*) malloc(sizeof(guint8) * self->initial_header_private_data_size); - memset (self->initial_header_private_data, 0, self->initial_header_private_data_size); - - guint8 ASF_Stream_Properties_Object[16] = - {0x91,0x07,0xDC,0xB7,0xB7,0xA9,0xCF,0x11,0x8E,0xE6,0x00,0xC0,0x0C,0x20,0x53,0x65}; - memcpy(self->initial_header_private_data + 0, ASF_Stream_Properties_Object, 16); // ASF_Stream_Properties_Object - - memcpy(self->initial_header_private_data + 16, &self->initial_header_private_data_size, 4); //FrameDateLength - - guint32 sizehi = 0; - memcpy(self->initial_header_private_data + 20, &sizehi, 4); // sizehi (not used) - - guint8 ASF_Audio_Media[16] = - {0x40,0x9E,0x69,0xF8,0x4D,0x5B,0xCF,0x11,0xA8,0xFD,0x00,0x80,0x5F,0x5C,0x44,0x2B}; - memcpy(self->initial_header_private_data + 24, ASF_Audio_Media, 16); //ASF_Audio_Media - - guint8 ASF_Audio_Spread[16] = - {0x50,0xCD,0xC3,0xBF,0x8F,0x61,0xCF,0x11,0x8B,0xB2,0x00,0xAA,0x00,0xB4,0xE2,0x20}; - memcpy(self->initial_header_private_data + 40, ASF_Audio_Spread, 16); //ASF_Audio_Spread - - memset(self->initial_header_private_data + 56, 0, 4); // time_offset (not used) - memset(self->initial_header_private_data + 60, 0, 4); // time_offset_hi (not used) - - guint32 type_specific_data_length = 18 + h_size; - memcpy(self->initial_header_private_data + 64, &type_specific_data_length, 4); //type_specific_data_length - - guint32 error_correction_data_length = 8; - memcpy(self->initial_header_private_data + 68, &error_correction_data_length, 4); //error_correction_data_length - - guint16 flags = 1; // stream_number + encrypted flags - memcpy(self->initial_header_private_data + 72, &flags, 2); //flags - - guint32 reserved = 0; - memcpy(self->initial_header_private_data + 74, &reserved, 4); // reserved - - - memcpy(self->initial_header_private_data + 78, &codec_id, 2); //codec_id - - gint16 number_of_channels; - gst_structure_get_int (structure, "channels", &number_of_channels); - memcpy(self->initial_header_private_data + 80, &number_of_channels, 2); //number_of_channels - - guint32 samples_per_second; - gst_structure_get_int (structure, "rate", &samples_per_second); - printf("samples_per_second = %d\n", samples_per_second); - memcpy(self->initial_header_private_data + 82, &samples_per_second, 4); //samples_per_second - - guint32 average_number_of_bytes_per_second; - gst_structure_get_int (structure, "bitrate", &average_number_of_bytes_per_second); - average_number_of_bytes_per_second /= 8; - printf("average_number_of_bytes_per_second = %d\n", average_number_of_bytes_per_second); - memcpy(self->initial_header_private_data + 86, &average_number_of_bytes_per_second, 4); //average_number_of_bytes_per_second - - gint16 block_alignment; - gst_structure_get_int (structure, "block_align", &block_alignment); - printf("block_alignment = %d\n", block_alignment); - memcpy(self->initial_header_private_data + 90, &block_alignment, 2); //block_alignment - - gint16 bits_per_sample; - gst_structure_get_int (structure, "depth", &bits_per_sample); - printf("bits_per_sample = %d\n", bits_per_sample); - memcpy(self->initial_header_private_data + 92, &bits_per_sample, 2); //bits_per_sample - - memcpy(self->initial_header_private_data + 94, &h_size, 2); - - memcpy(self->initial_header_private_data + 96, h, h_size); - - self->initial_header_private_data_valid = TRUE; - bypass = BYPASS_WMA; - } - else if (!strcmp(type, "audio/x-flac")) { - GST_INFO_OBJECT (self, "MIMETYPE %s",type); - bypass = BYPASS_FLAC; - } - else { - GST_ELEMENT_ERROR (self, STREAM, TYPE_NOT_FOUND, (NULL), ("unimplemented stream type %s", type)); - return FALSE; - } - - GST_INFO_OBJECT(self, "setting dvb mode 0x%02x\n", bypass); - - if (self->use_set_encoding) - { -#ifdef AUDIO_SET_ENCODING - unsigned int encoding = bypass_to_encoding(bypass); - if (ioctl(self->fd, AUDIO_SET_ENCODING, encoding) < 0) { - GST_ELEMENT_WARNING (self, STREAM, DECODE, (NULL), ("hardware decoder can't be set to encoding %i.", encoding)); - } -#endif - } - else - { - if (ioctl(self->fd, AUDIO_SET_BYPASS_MODE, bypass) < 0) { - if (bypass == BYPASS_DTS) { - GST_ELEMENT_ERROR (self, STREAM, TYPE_NOT_FOUND, (NULL), ("hardware decoder can't be set to bypass mode type %s", type)); - return FALSE; - } - GST_ELEMENT_WARNING (self, STREAM, DECODE, (NULL), ("hardware decoder can't be set to bypass mode %i.", bypass)); - } - } - self->bypass = bypass; - - printf("[A] SET_CAPS <- TRUE\n"); - return TRUE; -} - -static void -queue_push(queue_entry_t **queue_base, guint8 *data, size_t len) -{ - queue_entry_t *entry = malloc(sizeof(queue_entry_t)+len); - queue_entry_t *last = *queue_base; - guint8 *d = (guint8*)(entry+1); - memcpy(d, data, len); - entry->bytes = len; - entry->offset = 0; - if (!last) - *queue_base = entry; - else { - while(last->next) - last = last->next; - last->next = entry; - } - entry->next = NULL; -} - -static void -queue_pop(queue_entry_t **queue_base) -{ - queue_entry_t *base = *queue_base; - *queue_base = base->next; - free(base); -} - -static int -queue_front(queue_entry_t **queue_base, guint8 **data, size_t *bytes) -{ - if (!*queue_base) { - *bytes = 0; - *data = 0; - } - else { - queue_entry_t *entry = *queue_base; - *bytes = entry->bytes - entry->offset; - *data = ((guint8*)(entry+1))+entry->offset; - } - return *bytes; -} - -static gboolean -gst_dvbaudiosink_event (GstBaseSink * sink, GstEvent * event) -{ - GstDVBAudioSink *self = GST_DVBAUDIOSINK (sink); - GST_DEBUG_OBJECT (self, "EVENT %s", gst_event_type_get_name(GST_EVENT_TYPE (event))); - int ret=TRUE; - - switch (GST_EVENT_TYPE (event)) { - case GST_EVENT_FLUSH_START: - GST_OBJECT_LOCK(self); - self->no_write |= 1; - GST_OBJECT_UNLOCK(self); - SEND_COMMAND (self, CONTROL_STOP); - break; - case GST_EVENT_FLUSH_STOP: - ioctl(self->fd, AUDIO_CLEAR_BUFFER); - GST_OBJECT_LOCK(self); - while(self->queue) - queue_pop(&self->queue); - self->timestamp = 0; - self->no_write &= ~1; - GST_OBJECT_UNLOCK(self); - break; - case GST_EVENT_EOS: - { - struct pollfd pfd[2]; - int retval; - printf("[A] GST_EVENT_EOS\n"); - - //Notify the player that no addionional data will be injected -#ifdef AUDIO_FLUSH - ioctl(self->fd, AUDIO_FLUSH, 1/*NONBLOCK*/); -#endif - - pfd[0].fd = READ_SOCKET(self); - pfd[0].events = POLLIN; - pfd[1].fd = self->fd; - pfd[1].events = POLLIN; - - GST_PAD_PREROLL_UNLOCK (sink->sinkpad); - while (1) { - retval = poll(pfd, 2, 250); - printf("[A] poll %d\n", retval); - if (retval < 0) { - printf("poll in EVENT_EOS\n"); - ret=FALSE; - break; - } - - if (pfd[0].revents & POLLIN) { - printf("wait EOS aborted!!\n"); - ret=FALSE; - break; - } - - if (pfd[1].revents & POLLIN) { - printf("got buffer empty from driver!\n"); - break; - } - - if (sink->flushing) { - printf("wait EOS flushing!!\n"); - ret=FALSE; - break; - } - } - GST_PAD_PREROLL_LOCK (sink->sinkpad); - - break; - } - case GST_EVENT_NEWSEGMENT:{ - GstFormat fmt; - gboolean update; - gdouble rate, applied_rate; - gint64 cur, stop, time; - int skip = 0, repeat = 0, ret; - gst_event_parse_new_segment_full (event, &update, &rate, &applied_rate, &fmt, &cur, &stop, &time); - GST_DEBUG_OBJECT (self, "GST_EVENT_NEWSEGMENT rate=%f applied_rate=%f\n", rate, applied_rate); - - if (pftype == DM) //TODO: What is the purpose of this code? - { - int video_fd = open("/dev/dvb/adapter0/video0", O_RDWR); - if (fmt == GST_FORMAT_TIME) { - if ( rate > 1 ) - skip = (int) rate; - else if ( rate < 1 ) - repeat = 1.0/rate; - ret = ioctl(video_fd, VIDEO_SLOWMOTION, repeat); - ret = ioctl(video_fd, VIDEO_FAST_FORWARD, skip); - //gst_segment_set_newsegment_full (&dec->segment, update, rate, applied_rate, dformat, cur, stop, time); - } - close(video_fd); - } - break; - } - - default: - break; - } - - return ret; -} - -#define ASYNC_WRITE(data, len) do { \ - switch(gst_dvbaudiosink_async_write(self, data, len)) { \ - case -1: goto poll_error; \ - case -3: goto write_error; \ - default: break; \ - } \ - } while(0) - -static int -gst_dvbaudiosink_async_write(GstDVBAudioSink *self, unsigned char *data, unsigned int len) -{ - unsigned int written=0; - struct pollfd pfd[2]; - - pfd[0].fd = READ_SOCKET(self); - pfd[0].events = POLLIN; - pfd[1].fd = self->fd; - pfd[1].events = POLLOUT; - - do { -loop_start: - if (self->no_write & 1) { - GST_DEBUG_OBJECT (self, "skip %d bytes", len - written); - break; - } - else if (self->no_write & 6) { - // directly push to queue - GST_OBJECT_LOCK(self); - queue_push(&self->queue, data + written, len - written); - GST_OBJECT_UNLOCK(self); - GST_DEBUG_OBJECT (self, "pushed %d bytes to queue", len - written); - break; - } - else - GST_LOG_OBJECT (self, "going into poll, have %d bytes to write", len - written); -#if CHECK_DRAIN - if (poll(pfd, 2, -1) == -1) { - if (errno == EINTR) - continue; - return -1; - } -#else - pfd[1].revents = POLLOUT; -#endif - if (pfd[0].revents & POLLIN) { - /* read all stop commands */ - while (TRUE) { - gchar command; - int res; - READ_COMMAND (self, command, res); - if (res < 0) { - GST_DEBUG_OBJECT (self, "no more commands"); - /* no more commands */ - goto loop_start; - } - } - } - if (pfd[1].revents & POLLOUT) { - size_t queue_entry_size; - guint8 *queue_data; - GST_OBJECT_LOCK(self); - if (queue_front(&self->queue, &queue_data, &queue_entry_size)) { - int wr = write(self->fd, queue_data, queue_entry_size); - if ( self->dump_fd > 0 ) - write(self->dump_fd, queue_data, queue_entry_size); - if (wr < 0) { - switch (errno) { - case EINTR: - case EAGAIN: - break; - default: - GST_OBJECT_UNLOCK(self); - return -3; - } - } - else if (wr == queue_entry_size) { - queue_pop(&self->queue); - GST_DEBUG_OBJECT (self, "written %d queue bytes... pop entry", wr); - } - else { - self->queue->offset += wr; - GST_DEBUG_OBJECT (self, "written %d queue bytes... update offset", wr); - } - GST_OBJECT_UNLOCK(self); - continue; - } - GST_OBJECT_UNLOCK(self); - int wr = write(self->fd, data+written, len - written); - if ( self->dump_fd > 0 ) - write(self->dump_fd, data+written, len - written); - if (wr < 0) { - switch (errno) { - case EINTR: - case EAGAIN: - continue; - default: - return -3; - } - } - written += wr; - } - } while (written != len); - - return 0; -} - -static inline void Hexdump(unsigned char *Data, int length) -{ - - int k; - for (k = 0; k < length; k++) - { - printf("%02x ", Data[k]); - if (((k+1)&31)==0) - printf("\n"); - } - printf("\n"); - -} - -#define WRITE_COMPLETE_PACKAGE - -static inline size_t -buildPesHeader(unsigned char *data, int size, unsigned long long int timestamp, unsigned char stream_id, gboolean late_initial_header, unsigned int pcm_sub_frame_len) -{ - unsigned char *pes_header = data; - size_t pes_header_size; - - pes_header[0] = 0x00; - pes_header[1] = 0x00; - pes_header[2] = 0x01; - pes_header[3] = stream_id; - - if (stream_id == 0xBD && pcm_sub_frame_len > 0) { //PCM - //pes_header[4] = 0x07; //pes length - //pes_header[5] = 0xF1; //pes length - pes_header[4] = ((pcm_sub_frame_len+26)>>8) & 0xFF; // ((pcm_sub_frame_len+(18/*sizeof(lpcm_pes)*/-6)+14/*sizeof(lpcm_prv)*/)>>8) & 0xFF; - pes_header[5] = (pcm_sub_frame_len+26) & 0xFF; // (pcm_sub_frame_len+(18/*sizeof(lpcm_pes)*/-6)+14/*sizeof(lpcm_prv)*/) & 0xFF; - - pes_header[6] = 0x81; //fixed - - //printf("[A] LATE_INITIAL_HEADER = %d\n", late_initial_header); - - pes_header[7] = 0x01; - pes_header[8] = 0x09; //fixed - - pes_header[9] = 0x21; //PTS marker bits - pes_header[10] = 0x00; //PTS marker bits - pes_header[11] = 0x01; //PTS marker bits - pes_header[12] = 0x00; //PTS marker bits - pes_header[13] = 0x01; //PTS marker bits - - pes_header[14] = 0xFF; //first pes only, 0xFF after - pes_header[15] = 0xFF; //first pes only, 0xFF after - pes_header[16] = 0xFF; //first pes only, 0xFF after - - if (late_initial_header) { - pes_header[7] = 0x81; //fixed - - pes_header[14] = 0x1E; //first pes only, 0xFF after - pes_header[15] = 0x60; //first pes only, 0xFF after - pes_header[16] = 0x0A; //first pes only, 0xFF after - } - - pes_header[17] = 0xFF; - - pes_header_size = 18; - - return pes_header_size; - } - - pes_header[7] = 0x00; - pes_header[8] = 0x00; - pes_header_size = 9; - - /* do we have a timestamp? */ - if (timestamp != GST_CLOCK_TIME_NONE) { - unsigned long long pts = timestamp * 9LL / 100000 /* convert ns to 90kHz */; - - pes_header[7] = 0x80; - pes_header[8] = 0x05; - - pes_header[9] = 0x21 | ((pts >> 29) & 0x0E); - pes_header[10] = pts >> 22; - pes_header[11] = 0x01 | ((pts >> 14) & 0xFE); - pes_header[12] = pts >> 7; - pes_header[13] = 0x01 | ((pts << 1) & 0xFE); - - pes_header_size = 14; - - if (hwtype == DM7025) { // DM7025 needs DTS in PES header - int64_t dts = pts; // what to use as DTS-PTS offset? - pes_header[7] = 0xC0; - pes_header[8] = 0x0A; - pes_header[9] |= 0x10; - - pes_header[14] = 0x11 | ((dts >> 29) & 0x0E); - pes_header[15] = dts >> 22; - pes_header[16] = 0x01 | ((dts >> 14) & 0xFE); - pes_header[17] = dts >> 7; - pes_header[18] = 0x01 | ((dts << 1) & 0xFE); - - pes_header_size = 19; - } - } - - pes_header[4] = (size + pes_header_size - 6) >> 8; - pes_header[5] = (size + pes_header_size - 6) & 0xFF; - - pes_header[6] = 0x80; - - return pes_header_size; -} - -#define MPEG_AUDIO_PES_START_CODE 0xc0 -#define PRIVATE_STREAM_1_PES_START_CODE 0xbd -#define MAX_PES_PACKET_SIZE 65400 - -//#define DEBUG_EXT - -static GstFlowReturn -gst_dvbaudiosink_render (GstBaseSink * sink, GstBuffer * buffer) -{ - GstDVBAudioSink *self = GST_DVBAUDIOSINK (sink); - unsigned int data_len = GST_BUFFER_SIZE (buffer) - self->skip; - unsigned char *data = GST_BUFFER_DATA (buffer) + self->skip; - long long timestamp = GST_BUFFER_TIMESTAMP(buffer); - long long duration = GST_BUFFER_DURATION(buffer); - gboolean late_initial_header = FALSE; - -#ifdef DEBUG_EXT - printf("gst_dvbaudiosink_render 0\n"); -#endif - - if (self->bypass == BYPASS_UNKNOWN) { - GST_ELEMENT_ERROR (self, STREAM, FORMAT, (NULL), ("hardware decoder not setup (no caps in pipeline?)")); - return GST_FLOW_ERROR; - } - - if (self->fd < 0) - return GST_FLOW_OK; - - if (duration != -1 && timestamp != -1) { - if (self->timestamp == 0) - self->timestamp = timestamp; - else - timestamp = self->timestamp; - self->timestamp += duration; - } - else - self->timestamp = 0; - - unsigned char start_code = MPEG_AUDIO_PES_START_CODE; - if (self->bypass == BYPASS_AC3) { - start_code = PRIVATE_STREAM_1_PES_START_CODE; - } - else if (self->bypass == BYPASS_PCML || self->bypass == BYPASS_PCMB) { - start_code = PRIVATE_STREAM_1_PES_START_CODE; - } - -#ifdef DEBUG_EXT - printf("gst_dvbaudiosink_render 1\n"); -#endif - - if (self->initial_header) - { - if (self->bypass == BYPASS_PCML || self->bypass == BYPASS_PCMB) - { - late_initial_header = TRUE; - } - else if (self->bypass == BYPASS_WMA && self->initial_header_private_data_valid == TRUE) - { - unsigned char pes_header_initial[PES_MAX_HEADER_SIZE]; - size_t pes_header_size_initial; - - pes_header_size_initial = buildPesHeader(pes_header_initial, self->initial_header_private_data_size, 0, 0, FALSE/*late_initial_header*/, 0/*pcm_sub_frame_len*/); - -#ifdef WRITE_COMPLETE_PACKAGE - //printf("--> %d bytes\n", pes_header_size_initial + self->initial_header_private_data_size); - int write_buffer_size = pes_header_size_initial + self->initial_header_private_data_size; - unsigned char *write_buffer = - (unsigned char*) malloc(sizeof(unsigned char) * (write_buffer_size)); - memcpy(write_buffer, pes_header_initial, pes_header_size_initial); - memcpy(write_buffer + pes_header_size_initial, self->initial_header_private_data, self->initial_header_private_data_size); - ASYNC_WRITE(write_buffer, write_buffer_size); - free(write_buffer); -#else - ASYNC_WRITE(pes_header_initial, pes_header_size_initial); - ASYNC_WRITE(self->initial_header_private_data, self->initial_header_private_data_size); -#endif - - free(self->initial_header_private_data); - self->initial_header_private_data_valid = FALSE; - } - self->initial_header = FALSE; - } - -#ifdef DEBUG_EXT - printf("gst_dvbaudiosink_render - initial header written\n"); - printf("gst_dvbaudiosink_render - write pes packages\n"); -#endif - - /* LPCM workaround.. we also need the first two byte of the lpcm header.. (substreamid and num of frames) - i dont know why the mpegpsdemux strips out this two bytes... */ - if (self->bypass == BYPASS_LPCM && (data[0] < 0xA0 || data[0] > 0xAF)) { - if (data[-2] >= 0xA0 && data[-2] <= 0xAF) { - data -= 2; - data_len += 2; - } - } - - if (self->bypass == BYPASS_DTS) { // dts - int pos=0; - while((pos+3) < data_len) { - if (!strcmp((char*)(data+pos), "\x64\x58\x20\x25")) { // is DTS-HD ? - data_len = pos; - break; - } - ++pos; - } - } - - if (self->aac_adts_header_valid) - data_len += 7; - -#if 0 - printf("->Timestamp: %lld\n", timestamp); -#endif - - // The Player tells us that most of the pts is invalid for wma - //TODO: This can only be a quick hack and has to be investigated further - if (self->bypass == BYPASS_WMA) - timestamp = 0; - - unsigned char pes_header[PES_MAX_HEADER_SIZE]; - //memset (pes_header, '0', PES_MAX_HEADER_SIZE); - int pes_header_size = 0; - - unsigned int data_position = 0; - //int i = 0; - //printf("L ->\n"); - while (data_position < data_len) { - //printf("L\n"); -#define SPLIT_TO_BIG_PACKETS -#ifdef SPLIT_TO_BIG_PACKETS - unsigned int pes_packet_size = (data_len - data_position) <= MAX_PES_PACKET_SIZE ? - (data_len - data_position) : MAX_PES_PACKET_SIZE; -#else - unsigned int pes_packet_size = (data_len - data_position); -#endif - - // For PCM the max package size is not the pes size but the subframelen - if (self->bypass == BYPASS_PCML || self->bypass == BYPASS_PCMB) { - if (self->pcm_break_buffer_size > 0) - { // The breakbuffer is full, this means we have to attach the buffer in front of the normale data block - // Create a new buffer, not we have to free this on our own - // To detect if we have to free it, lets do not reset the pcm_break_buffer_Size - // here, but after writing the bytes -#if USE_DATA_TMP - unsigned char *tmp_data = (unsigned char*) malloc(self->pcm_sub_frame_len * sizeof(unsigned char)); - memcpy(tmp_data, self->pcm_break_buffer, self->pcm_break_buffer_size); - memcpy(tmp_data + self->pcm_break_buffer_size, data, self->pcm_sub_frame_len - self->pcm_break_buffer_size); - data = tmp_data; // TODO: actually we could reuse the breakbuffer for this, will spare us malloc and free calls -#else - memcpy(self->pcm_break_buffer + self->pcm_break_buffer_size, data, self->pcm_sub_frame_len - self->pcm_break_buffer_size); - data = self->pcm_break_buffer; -#endif - pes_packet_size = self->pcm_sub_frame_len; - } - - if (pes_packet_size < self->pcm_sub_frame_len) - { //If we dont have enough frames left than save them to the breakbuffer - self->pcm_break_buffer_size = pes_packet_size; - memcpy(self->pcm_break_buffer, data + data_position, self->pcm_break_buffer_size); -#ifdef DEBUG_EXT - printf("PCM %s - Unplayed=%d\n", __FUNCTION__, pes_packet_size); -#endif - break; - } - else - { // We have enough data so set the package size to subframelen - pes_packet_size = self->pcm_sub_frame_len; - } - } - - //unsigned char pes_header[PES_MAX_HEADER_SIZE]; - //memset (pes_header, '0', PES_MAX_HEADER_SIZE); - //int pes_header_size = 0; - -#ifdef DEBUG_EXT - printf("gst_dvbaudiosink_render - build PESHeader\n"); -#endif - pes_header_size = buildPesHeader(pes_header, pes_packet_size, - timestamp, start_code, late_initial_header, self->pcm_sub_frame_len); - - if (self->aac_adts_header_valid) { - self->aac_adts_header[3] &= 0xC0; - /* frame size over last 2 bits */ - self->aac_adts_header[3] |= (pes_packet_size & 0x1800) >> 11; - /* frame size continued over full byte */ - self->aac_adts_header[4] = (pes_packet_size & 0x1FF8) >> 3; - /* frame size continued first 3 bits */ - self->aac_adts_header[5] = (pes_packet_size & 7) << 5; - /* buffer fullness (0x7FF for VBR) over 5 last bits */ - self->aac_adts_header[5] |= 0x1F; - /* buffer fullness (0x7FF for VBR) continued over 6 first bits + 2 zeros for - * number of raw data blocks */ - self->aac_adts_header[6] = 0xFC; - memcpy(pes_header + pes_header_size, self->aac_adts_header, 7); - pes_header_size += 7; - pes_packet_size -= 7; - } - -#if 0 - printf("--> BEFORE %d\n", pes_header_size + self->runtime_header_data_size + pes_packet_size); - Hexdump(pes_header, pes_header_size); - if (self->runtime_header_data_size > 0) - Hexdump(self->runtime_header_data, self->runtime_header_data_size); - Hexdump(data + data_position, /*128*/ pes_packet_size); - printf("<--\n"); -#endif - - if (self->bypass == BYPASS_PCML) { - if (self->pcm_bits_per_sample == 16) { - int i; - for(i=0; i %d\n", pes_header_size + self->runtime_header_data_size + pes_packet_size); - Hexdump(pes_header, pes_header_size); - if (self->runtime_header_data_size > 0) - Hexdump(self->runtime_header_data, self->runtime_header_data_size); - Hexdump(data + data_position, /*128*/ pes_packet_size); - printf("<--\n"); -#endif - -//printf("W\n"); - -#ifdef WRITE_COMPLETE_PACKAGE - int write_buffer_size = pes_header_size + self->runtime_header_data_size + pes_packet_size; - unsigned char *write_buffer = - (unsigned char*) malloc(sizeof(unsigned char) * (write_buffer_size)); - memcpy(write_buffer, pes_header, pes_header_size); - if (self->runtime_header_data_size > 0) - memcpy(write_buffer + pes_header_size, self->runtime_header_data, self->runtime_header_data_size); - memcpy(write_buffer + pes_header_size + self->runtime_header_data_size, data + data_position, pes_packet_size); - ASYNC_WRITE(write_buffer, write_buffer_size); - free(write_buffer); -#else - ASYNC_WRITE(pes_header, pes_header_size); - if (self->runtime_header_data_size > 0) - ASYNC_WRITE(self->runtime_header_data, self->runtime_header_data_size); - ASYNC_WRITE(data + data_position, pes_packet_size); -#endif - if (self->aac_adts_header_valid){ - pes_packet_size += 7; - } - -#ifdef DEBUG_EXT - printf("gst_dvbaudiosink_render - pes package written\n"); -#endif - - if (late_initial_header) { - if (self->bypass == BYPASS_PCML || self->bypass == BYPASS_PCMB) { - late_initial_header = FALSE; - } - } - - data_position += pes_packet_size; - - if (self->bypass == BYPASS_PCML || self->bypass == BYPASS_PCMB) { - - //increment err... subframe count? - self->runtime_header_data[1] = ((self->runtime_header_data[1]+self->pcm_sub_frame_per_pes) & 0x1F); - - if (self->pcm_break_buffer_size > 0) - { -#if USE_DATA_TMP - free(data); -#endif - // Reset data pointer - data = GST_BUFFER_DATA (buffer) + self->skip; - - data_position -= self->pcm_break_buffer_size; - - self->pcm_break_buffer_size = 0; - } - } - } - //printf("L <-\n"); - -#ifdef DEBUG_EXT - printf("gst_dvbaudiosink_render - all pes packages written\n"); -#endif - - - return GST_FLOW_OK; -poll_error: - { - GST_ELEMENT_ERROR (self, RESOURCE, READ, (NULL), - ("poll on file descriptor: %s.", g_strerror (errno))); - GST_WARNING_OBJECT (self, "Error during poll"); - return GST_FLOW_ERROR; - } -write_error: - { - GST_ELEMENT_ERROR (self, RESOURCE, READ, (NULL), - ("write on file descriptor: %s.", g_strerror (errno))); - GST_WARNING_OBJECT (self, "Error during write"); - return GST_FLOW_ERROR; - } -} - -static gboolean -gst_dvbaudiosink_start (GstBaseSink * basesink) -{ - GstDVBAudioSink *self = GST_DVBAUDIOSINK (basesink); - gint control_sock[2]; - - GST_DEBUG_OBJECT (self, "start"); - - if (socketpair(PF_UNIX, SOCK_STREAM, 0, control_sock) < 0) { - perror("socketpair"); - goto socket_pair; - } - - READ_SOCKET (self) = control_sock[0]; - WRITE_SOCKET (self) = control_sock[1]; - - fcntl (READ_SOCKET (self), F_SETFL, O_NONBLOCK); - fcntl (WRITE_SOCKET (self), F_SETFL, O_NONBLOCK); - - return TRUE; - /* ERRORS */ -socket_pair: - { - GST_ELEMENT_ERROR (self, RESOURCE, OPEN_READ_WRITE, (NULL), - GST_ERROR_SYSTEM); - return FALSE; - } -} - -static gboolean -gst_dvbaudiosink_stop (GstBaseSink * basesink) -{ - GstDVBAudioSink *self = GST_DVBAUDIOSINK (basesink); - - GST_DEBUG_OBJECT (self, "stop"); - - if (self->fd >= 0) { - if (pftype == DM) //TODO: What is the purpose of this code? - { - int video_fd = open("/dev/dvb/adapter0/video0", O_RDWR); - - ioctl (self->fd, AUDIO_STOP); - ioctl (self->fd, AUDIO_SELECT_SOURCE, AUDIO_SOURCE_DEMUX); - - //TODO: This seems to me like a hack?! - if ( video_fd > 0 ) { - ioctl (video_fd, VIDEO_SLOWMOTION, 0); - ioctl (video_fd, VIDEO_FAST_FORWARD, 0); - close (video_fd); - } - } - close (self->fd); - } - - if (self->dump_fd > 0) - close (self->dump_fd); - - while(self->queue) - queue_pop (&self->queue); - - close (READ_SOCKET (self)); - close (WRITE_SOCKET (self)); - READ_SOCKET (self) = -1; - WRITE_SOCKET (self) = -1; - - return TRUE; -} - -static GstStateChangeReturn -gst_dvbaudiosink_change_state (GstElement * element, GstStateChange transition) -{ - GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; - GstDVBAudioSink *self = GST_DVBAUDIOSINK (element); - - switch (transition) { - case GST_STATE_CHANGE_NULL_TO_READY: - GST_DEBUG_OBJECT (self,"GST_STATE_CHANGE_NULL_TO_READY"); - break; - case GST_STATE_CHANGE_READY_TO_PAUSED: - GST_DEBUG_OBJECT (self,"GST_STATE_CHANGE_READY_TO_PAUSED"); - GST_OBJECT_LOCK(self); - self->no_write |= 4; - GST_OBJECT_UNLOCK(self); - - if (self->dump_filename) - self->dump_fd = open(self->dump_filename, O_RDWR|O_CREAT, 0555); - - self->fd = open("/dev/dvb/adapter0/audio0", O_RDWR|O_NONBLOCK); - - if (self->fd) { - ioctl(self->fd, AUDIO_CLEAR_BUFFER, NULL); - ioctl(self->fd, AUDIO_SELECT_SOURCE, AUDIO_SOURCE_MEMORY); - ioctl(self->fd, AUDIO_PLAY); - ioctl(self->fd, AUDIO_PAUSE); - } - break; - case GST_STATE_CHANGE_PAUSED_TO_PLAYING: - GST_DEBUG_OBJECT (self,"GST_STATE_CHANGE_PAUSED_TO_PLAYING"); - ioctl(self->fd, AUDIO_CONTINUE); - GST_OBJECT_LOCK(self); - self->no_write &= ~4; - GST_OBJECT_UNLOCK(self); - break; - default: - break; - } - - ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); - - switch (transition) { - case GST_STATE_CHANGE_PLAYING_TO_PAUSED: - GST_DEBUG_OBJECT (self,"GST_STATE_CHANGE_PLAYING_TO_PAUSED"); - GST_OBJECT_LOCK(self); - self->no_write |= 4; - GST_OBJECT_UNLOCK(self); - ioctl(self->fd, AUDIO_PAUSE); - SEND_COMMAND (self, CONTROL_STOP); - break; - case GST_STATE_CHANGE_PAUSED_TO_READY: - GST_DEBUG_OBJECT (self,"GST_STATE_CHANGE_PAUSED_TO_READY"); - break; - case GST_STATE_CHANGE_READY_TO_NULL: - GST_DEBUG_OBJECT (self,"GST_STATE_CHANGE_READY_TO_NULL"); - break; - default: - break; - } - return ret; -} - -/* entry point to initialize the plug-in - * initialize the plug-in itself - * register the element factories and pad templates - * register the features - * - * exchange the string 'plugin' with your elemnt name - */ -static gboolean -plugin_init (GstPlugin *plugin) -{ - return gst_element_register (plugin, "dvbaudiosink", - GST_RANK_PRIMARY, - GST_TYPE_DVBAUDIOSINK); -} - -/* this is the structure that gstreamer looks for to register plugins - * - * exchange the strings 'plugin' and 'Template plugin' with you plugin name and - * description - */ -GST_PLUGIN_DEFINE ( - GST_VERSION_MAJOR, - GST_VERSION_MINOR, - "dvb_audio_out", - "DVB Audio Output", - plugin_init, - VERSION, - "LGPL", - "GStreamer", - "http://gstreamer.net/" -) - diff --git a/libs/gst-plugins-dvbmediasink-0.10.1/src/gstdvbaudiosink.h b/libs/gst-plugins-dvbmediasink-0.10.1/src/gstdvbaudiosink.h deleted file mode 100644 index ca1a899..0000000 --- a/libs/gst-plugins-dvbmediasink-0.10.1/src/gstdvbaudiosink.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * GStreamer DVB Media Sink - * Copyright 2006 Felix Domke - * based on code by: - * Copyright 2005 Thomas Vander Stichele - * Copyright 2005 Ronald S. Bultje - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Alternatively, the contents of this file may be used under the - * GNU Lesser General Public License Version 2.1 (the "LGPL"), in - * which case the following provisions apply instead of the ones - * mentioned above: - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __GST_DVBAUDIOSINK_H__ -#define __GST_DVBAUDIOSINK_H__ - -#include -#include - -G_BEGIN_DECLS - -/* #defines don't like whitespacey bits */ -#define GST_TYPE_DVBAUDIOSINK \ - (gst_dvbaudiosink_get_type()) -#define GST_DVBAUDIOSINK(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DVBAUDIOSINK,GstDVBAudioSink)) -#define GST_DVBAUDIOSINK_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DVBAUDIOSINK,GstDVBAudioSinkClass)) -#define GST_DVBAUDIOSINK_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS ((obj),GST_TYPE_DVBAUDIOSINK,GstDVBAudioSinkClass)) -#define GST_IS_DVBAUDIOSINK(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DVBAUDIOSINK)) -#define GST_IS_DVBAUDIOSINK_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DVBAUDIOSINK)) - -typedef struct _GstDVBAudioSink GstDVBAudioSink; -typedef struct _GstDVBAudioSinkClass GstDVBAudioSinkClass; -typedef struct _GstDVBAudioSinkPrivate GstDVBAudioSinkPrivate; - -typedef struct queue_entry -{ - struct queue_entry *next; - size_t bytes; - size_t offset; -} queue_entry_t; - -struct _GstDVBAudioSink -{ - GstBaseSink element; - gboolean use_set_encoding; - - gboolean initial_header; - guint8 *initial_header_private_data; - guint32 initial_header_private_data_size; - gboolean initial_header_private_data_valid; - - guint8 *runtime_header_data; - guint32 runtime_header_data_size; - - guint8 aac_adts_header[7]; - gboolean aac_adts_header_valid; - - guint16 pcm_bits_per_sample; - guint32 pcm_sub_frame_len; - guint32 pcm_sub_frame_per_pes; - guint8 pcm_break_buffer[8192]; - guint32 pcm_break_buffer_size; - - gint control_sock[2]; - - gchar *dump_filename; - int fd; - int dump_fd; - - int skip; - int bypass; - - int no_write; - - queue_entry_t *queue; - - unsigned long long timestamp; -}; - -struct _GstDVBAudioSinkClass -{ - GstBaseSinkClass parent_class; - gint64 (*get_decoder_time) (GstDVBAudioSink *sink); - int (*async_write) (GstDVBAudioSink *sink, unsigned char *data, unsigned int size); -}; - -GType gst_dvbaudiosink_get_type (void); - -G_END_DECLS - -#endif /* __GST_DVBAUDIOSINK_H__ */ diff --git a/libs/gst-plugins-dvbmediasink-0.10.1/src/gstdvbsink-marshal.list b/libs/gst-plugins-dvbmediasink-0.10.1/src/gstdvbsink-marshal.list deleted file mode 100644 index 6fa758e..0000000 --- a/libs/gst-plugins-dvbmediasink-0.10.1/src/gstdvbsink-marshal.list +++ /dev/null @@ -1 +0,0 @@ -INT64:VOID diff --git a/libs/gst-plugins-dvbmediasink-0.10.1/src/gstdvbvideosink.c b/libs/gst-plugins-dvbmediasink-0.10.1/src/gstdvbvideosink.c deleted file mode 100644 index 9d1b691..0000000 --- a/libs/gst-plugins-dvbmediasink-0.10.1/src/gstdvbvideosink.c +++ /dev/null @@ -1,1965 +0,0 @@ - -/* GStreamer DVB Media Sink - * Copyright 2006 Felix Domke - * based on code by: - * Copyright 2005 Thomas Vander Stichele - * Copyright 2005 Ronald S. Bultje - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Alternatively, the contents of this file may be used under the - * GNU Lesser General Public License Version 2.1 (the "LGPL"), in - * which case the following provisions apply instead of the ones - * mentioned above: - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -/** - * SECTION:element-plugin - * - * - * Example launch line - * - * - * gst-launch -v -m audiotestsrc ! plugin ! fakesink silent=TRUE - * - * - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef __sh__ -#include -#endif - -#include - -#include "gstdvbvideosink.h" -#include "gstdvbsink-marshal.h" - -#ifndef VIDEO_GET_PTS -#define VIDEO_GET_PTS _IOR('o', 57, gint64) -#endif - -/* We add a control socket as in fdsrc to make it shutdown quickly when it's blocking on the fd. - * Poll is used to determine when the fd is ready for use. When the element state is changed, - * it happens from another thread while fdsink is poll'ing on the fd. The state-change thread - * sends a control message, so fdsink wakes up and changes state immediately otherwise - * it would stay blocked until it receives some data. */ - -/* the poll call is also performed on the control sockets, that way - * we can send special commands to unblock the poll call */ -#define CONTROL_STOP 'S' /* stop the poll call */ -#define CONTROL_SOCKETS(sink) sink->control_sock -#define WRITE_SOCKET(sink) sink->control_sock[1] -#define READ_SOCKET(sink) sink->control_sock[0] - -#define SEND_COMMAND(sink, command) \ -G_STMT_START { \ - unsigned char c; c = command; \ - write (WRITE_SOCKET(sink), &c, 1); \ -} G_STMT_END - -#define READ_COMMAND(sink, command, res) \ -G_STMT_START { \ - res = read(READ_SOCKET(sink), &command, 1); \ -} G_STMT_END - -GST_DEBUG_CATEGORY_STATIC (dvbvideosink_debug); -#define GST_CAT_DEFAULT dvbvideosink_debug - -#define COMMON_VIDEO_CAPS \ - "width = (int) [ 16, 4096 ], " \ - "height = (int) [ 16, 4096 ], " \ - "framerate = (fraction) [ 0, MAX ]" - -#define MPEG4V2_LIMITED_CAPS \ - "width = (int) [ 16, 800 ], " \ - "height = (int) [ 16, 600 ], " \ - "framerate = (fraction) [ 0, MAX ]" - -enum -{ - SIGNAL_GET_DECODER_TIME, - LAST_SIGNAL -}; - -static guint gst_dvb_videosink_signals[LAST_SIGNAL] = { 0 }; - -static GstStaticPadTemplate sink_factory_bcm7400 = -GST_STATIC_PAD_TEMPLATE ( - "sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ( - "video/mpeg, " - "mpegversion = (int) { 1, 2, 4 }, " - "systemstream = (boolean) false, " - COMMON_VIDEO_CAPS "; " - "video/x-h264, " - COMMON_VIDEO_CAPS "; " - "video/x-h263, " - COMMON_VIDEO_CAPS "; " - "video/x-msmpeg, " - MPEG4V2_LIMITED_CAPS ", mspegversion = (int) 43; " - "video/x-divx, " - MPEG4V2_LIMITED_CAPS ", divxversion = (int) [ 3, 5 ]; " - "video/x-xvid, " - MPEG4V2_LIMITED_CAPS "; " - "video/x-3ivx, " - MPEG4V2_LIMITED_CAPS "; ") -); - -static GstStaticPadTemplate sink_factory_bcm7405 = -GST_STATIC_PAD_TEMPLATE ( - "sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ( - "video/mpeg, " - "mpegversion = (int) { 1, 2, 4 }, " - "systemstream = (boolean) false, " - COMMON_VIDEO_CAPS "; " - "video/x-msmpeg, " - COMMON_VIDEO_CAPS ", mspegversion = (int) 43; " - "video/x-h264, " - COMMON_VIDEO_CAPS "; " - "video/x-h263, " - COMMON_VIDEO_CAPS "; " - "video/x-divx, " - COMMON_VIDEO_CAPS ", divxversion = (int) [ 3, 5 ]; " - "video/x-xvid, " - COMMON_VIDEO_CAPS "; " - "video/x-3ivx, " - COMMON_VIDEO_CAPS "; ") -); - - -static GstStaticPadTemplate sink_factory_bcm7401 = -GST_STATIC_PAD_TEMPLATE ( - "sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ( - "video/mpeg, " - "mpegversion = (int) { 1, 2, 4 }, " - "systemstream = (boolean) false, " - COMMON_VIDEO_CAPS "; " - "video/x-h264, " - COMMON_VIDEO_CAPS "; " - "video/x-h263, " - COMMON_VIDEO_CAPS "; ") -); - -static GstStaticPadTemplate sink_factory_ati_xilleon = -GST_STATIC_PAD_TEMPLATE ( - "sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_STATIC_CAPS ( - "video/mpeg, " - "mpegversion = (int) { 1, 2 }, " - "systemstream = (boolean) false, " - COMMON_VIDEO_CAPS "; ") -); - -#define SINK_FACTORY_STM_BASE \ -GST_STATIC_PAD_TEMPLATE ( \ - "sink", \ - GST_PAD_SINK, \ - GST_PAD_ALWAYS, \ - GST_STATIC_CAPS ( \ - " video/mpeg, " \ - " mpegversion = (int) { 1, 2, 4 }, " \ - " systemstream = (boolean) false; " \ - \ - "video/x-h263; " \ - "video/x-h264; " \ - \ - "video/x-divx, " \ - " divxversion = (int) { 3, 4, 5 }; " \ - "video/x-xvid; " \ - "video/x-3ivx; ") \ -) - -#define SINK_FACTORY_STM_BASE_EXTENDED \ -GST_STATIC_PAD_TEMPLATE ( \ - "sink", \ - GST_PAD_SINK, \ - GST_PAD_ALWAYS, \ - GST_STATIC_CAPS ( \ - " video/mpeg, " \ - " mpegversion = (int) { 1, 2, 4 }, " \ - " systemstream = (boolean) false; " \ - \ - "video/x-h263; " \ - "video/x-h264; " \ - \ - "video/x-divx, " \ - " divxversion = (int) { 3, 4, 5 }; " \ - "video/x-xvid; " \ - "video/x-3ivx; " \ - \ - "video/x-wmv, " \ - " wmvversion = (int) {1, 2, 3}; " \ - \ - "video/x-wmv, " \ - " wmvversion = (int) 3, " \ - " format = (fourcc) WVC1; ") \ -) - -//TODO: All but 7100 and 7101 have wmv and vc1 capability. Need to add it -// FIRST GENERATION -static GstStaticPadTemplate sink_factory_stm_stx7100 = SINK_FACTORY_STM_BASE; -static GstStaticPadTemplate sink_factory_stm_stx7101 = SINK_FACTORY_STM_BASE; -static GstStaticPadTemplate sink_factory_stm_stx7109 = SINK_FACTORY_STM_BASE_EXTENDED; - -// SECOND GENERATION -static GstStaticPadTemplate sink_factory_stm_stx7105 = SINK_FACTORY_STM_BASE_EXTENDED; -static GstStaticPadTemplate sink_factory_stm_stx7111 = SINK_FACTORY_STM_BASE_EXTENDED; - -// THIRD GENERATION -static GstStaticPadTemplate sink_factory_stm_stx7106 = SINK_FACTORY_STM_BASE_EXTENDED; -static GstStaticPadTemplate sink_factory_stm_stx7108 = SINK_FACTORY_STM_BASE_EXTENDED; - -#define DEBUG_INIT(bla) \ - GST_DEBUG_CATEGORY_INIT (dvbvideosink_debug, "dvbvideosink", 0, "dvbvideosink element"); - -GST_BOILERPLATE_FULL (GstDVBVideoSink, gst_dvbvideosink, GstBaseSink, - GST_TYPE_BASE_SINK, DEBUG_INIT); - -static gboolean gst_dvbvideosink_start (GstBaseSink * sink); -static gboolean gst_dvbvideosink_stop (GstBaseSink * sink); -static gboolean gst_dvbvideosink_event (GstBaseSink * sink, GstEvent * event); -static GstFlowReturn gst_dvbvideosink_render (GstBaseSink * sink, GstBuffer * buffer); -static gboolean gst_dvbvideosink_set_caps (GstBaseSink * sink, GstCaps * caps); -static gboolean gst_dvbvideosink_unlock (GstBaseSink * basesink); -static gboolean gst_dvbvideosink_unlock_stop (GstBaseSink * basesink); -static void gst_dvbvideosink_dispose (GObject * object); -static GstStateChangeReturn gst_dvbvideosink_change_state (GstElement * element, GstStateChange transition); -static gint64 gst_dvbvideosink_get_decoder_time (GstDVBVideoSink *self); - -#define PES_MAX_HEADER_SIZE 64 - -typedef enum { HW_UNKNOWN, - DM7025, DM800, DM8000, DM500HD, DM800SE, DM7020HD, - STX7100, STX7101, STX7109, STX7105, STX7111, STX7106, STX7108 -} hardware_type_t; - -typedef enum { PF_UNKNOWN, DM, HAVANA } platform_type_t; - -static hardware_type_t hwtype = HW_UNKNOWN; -static platform_type_t pftype = PF_UNKNOWN; - -//Please correct if wrong -#define STREAMTYPE_UNKNOWN 0xFF -#define STREAMTYPE_MPEG2 0x00 -#define STREAMTYPE_H264 0x01 -#define STREAMTYPE_H263 0x02 -#define STREAMTYPE_MPEG4_P2 0x04 -#define STREAMTYPE_MPEG1 0x06 -#define STREAMTYPE_XVID 0x0A -#define STREAMTYPE_DIVX311 0x0C -#define STREAMTYPE_DIVX4 0x0E -#define STREAMTYPE_DIVX5 0x0F -#define STREAMTYPE_FLV1 0x10 -#define STREAMTYPE_WMV 0x11 -#define STREAMTYPE_VC1 0x12 - -#define VIDEO_ENCODING_UNKNOWN 0xFF - -unsigned int streamtype_to_encoding (unsigned int streamtype) -{ -#ifdef VIDEO_SET_ENCODING - switch(streamtype) - { - case STREAMTYPE_MPEG2: - return VIDEO_ENCODING_AUTO; - case STREAMTYPE_H264: - return VIDEO_ENCODING_H264; - case STREAMTYPE_H263: - return VIDEO_ENCODING_H263; - case STREAMTYPE_MPEG4_P2: - return VIDEO_ENCODING_MPEG4P2; - case STREAMTYPE_MPEG1: - return VIDEO_ENCODING_AUTO; - case STREAMTYPE_XVID: - return VIDEO_ENCODING_MPEG4P2; - case STREAMTYPE_DIVX311: - return VIDEO_ENCODING_MPEG4P2; - case STREAMTYPE_DIVX4: - return VIDEO_ENCODING_MPEG4P2; - case STREAMTYPE_DIVX5: - return VIDEO_ENCODING_MPEG4P2; - case STREAMTYPE_FLV1: - return VIDEO_ENCODING_FLV1; - case STREAMTYPE_WMV: - return VIDEO_ENCODING_WMV; - case STREAMTYPE_VC1: - return VIDEO_ENCODING_VC1; - - default: - return VIDEO_ENCODING_UNKNOWN; - } -#endif - return VIDEO_ENCODING_UNKNOWN; -} - -static void -gst_dvbvideosink_base_init (gpointer klass) -{ - static GstElementDetails element_details = { - "A DVB video sink", - "Generic/DVBVideoSink", - "Output video PES / ES into a DVB video device for hardware playback", - "Felix Domke " - }; - GstElementClass *element_class = GST_ELEMENT_CLASS (klass); - - int fd = open("/proc/stb/info/model", O_RDONLY); - if ( fd > 0 ) - { - gchar string[9] = { 0, }; - ssize_t rd = read(fd, string, 8); - if ( rd >= 5 ) - { - if ( !strncasecmp(string, "DM7025", 6) ) { - hwtype = DM7025; - pftype = DM; - GST_INFO ("model is DM7025... set ati xilleon caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_ati_xilleon)); - } else if ( !strncasecmp(string, "DM500HD", 7) ) { - hwtype = DM500HD; - pftype = DM; - GST_INFO ("model is DM500HD... set bcm7405 caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_bcm7405)); - } else if ( !strncasecmp(string, "DM800SE", 7) ) { - hwtype = DM800SE; - pftype = DM; - GST_INFO ("model is DM800SE... set bcm7405 caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_bcm7405)); - } else if ( !strncasecmp(string, "DM7020HD", 8) ) { - hwtype = DM7020HD; - pftype = DM; - GST_INFO ("model is DM7020HD... set bcm7405 caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_bcm7405)); - } else if ( !strncasecmp(string, "DM8000", 6) ) { - hwtype = DM8000; - pftype = DM; - GST_INFO ("model is DM8000... set bcm7400 caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_bcm7400)); - } else if ( !strncasecmp(string, "DM800", 5) ) { - hwtype = DM800; - pftype = DM; - GST_INFO ("model is DM800 set bcm7401 caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_bcm7401)); - } - } - close(fd); - } - - if (hwtype == HW_UNKNOWN) { - // Unfortunately we dont have sysinfo available so doing it the hard way - char line[256]; - char *processor; - FILE *file = fopen("/proc/cpuinfo", "r"); - while (fgets(line, sizeof(line) - 1, file) != NULL) - { - if (!strncmp(line, "cpu type", 8)) - { - strtok (line,":"); - processor = strtok (NULL,":"); - while(processor[0] == ' ') processor++; - break; - } - } - fclose(file); - - printf("Processor: %s\n", processor); - - // FIRST GENERATION - if( !strncasecmp(processor, "STX7100", 7) || - !strncasecmp(processor, "STB7100", 7) || - !strncasecmp(processor, "STI7100", 7)) { - pftype = HAVANA; - hwtype = STX7100; - GST_INFO ("setting STX7100 caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_stm_stx7100)); - } - else if(!strncasecmp(processor, "STX7101", 7)) { - pftype = HAVANA; - hwtype = STX7101; - GST_INFO ("setting STX7101 caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_stm_stx7101)); - } - else if(!strncasecmp(processor, "STX7109", 7)) { - pftype = HAVANA; - hwtype = STX7109; - GST_INFO ("setting STX7109 caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_stm_stx7109)); - } - // SECOND GENERATIONad_template_get (&sink_factory_stm_stx7111)); - else if(!strncasecmp(processor, "STX7105", 7)) { - pftype = HAVANA; - hwtype = STX7105; - GST_INFO ("setting STX7105 caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_stm_stx7105)); - } - else if(!strncasecmp(processor, "STX7111", 7)) { - pftype = HAVANA; - hwtype = STX7111; - GST_INFO ("setting STX7111 caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_stm_stx7111)); - } - // THIRD GENERATION - else if(!strncasecmp(processor, "STX7106", 7)) { - pftype = HAVANA; - hwtype = STX7106; - GST_INFO ("setting STX7106 caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_stm_stx7106)); - } - else if(!strncasecmp(processor, "STX7108", 7)) { - pftype = HAVANA; - hwtype = STX7108; - GST_INFO ("setting STX7108 caps"); - gst_element_class_add_pad_template (element_class, - gst_static_pad_template_get (&sink_factory_stm_stx7108)); - } - } - - gst_element_class_set_details (element_class, &element_details); -} - -/* initialize the plugin's class */ -static void -gst_dvbvideosink_class_init (GstDVBVideoSinkClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - GstBaseSinkClass *gstbasesink_class = GST_BASE_SINK_CLASS (klass); - GstElementClass *element_class = GST_ELEMENT_CLASS (klass); - - gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_dvbvideosink_dispose); - - gstbasesink_class->start = GST_DEBUG_FUNCPTR (gst_dvbvideosink_start); - gstbasesink_class->stop = GST_DEBUG_FUNCPTR (gst_dvbvideosink_stop); - gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_dvbvideosink_render); - gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_dvbvideosink_event); - gstbasesink_class->unlock = GST_DEBUG_FUNCPTR (gst_dvbvideosink_unlock); - gstbasesink_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_dvbvideosink_unlock_stop); - gstbasesink_class->set_caps = GST_DEBUG_FUNCPTR (gst_dvbvideosink_set_caps); - - element_class->change_state = GST_DEBUG_FUNCPTR (gst_dvbvideosink_change_state); - - gst_dvb_videosink_signals[SIGNAL_GET_DECODER_TIME] = - g_signal_new ("get-decoder-time", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, - G_STRUCT_OFFSET (GstDVBVideoSinkClass, get_decoder_time), - NULL, NULL, gst_dvbsink_marshal_INT64__VOID, G_TYPE_INT64, 0); - - klass->get_decoder_time = gst_dvbvideosink_get_decoder_time; -} - -#define H264_BUFFER_SIZE (64*1024+2048) - -/* initialize the new element - * instantiate pads and add them to element - * set functions - * initialize structure - */ -static void -gst_dvbvideosink_init (GstDVBVideoSink *klass, GstDVBVideoSinkClass * gclass) -{ - FILE *f = fopen("/proc/stb/vmpeg/0/fallback_framerate", "r"); -#ifdef VIDEO_SET_ENCODING - klass->use_set_encoding = TRUE; -#else - klass->use_set_encoding = FALSE; -#endif - klass->streamtype = STREAMTYPE_UNKNOWN; - klass->initial_header = TRUE; - klass->initial_header_private_data_size = 0; - - klass->runtime_header_data_size = 0; - - klass->dec_running = FALSE; - klass->must_send_header = 1; - klass->h264_buffer = NULL; - klass->h264_nal_len_size = 0; - klass->codec_data = NULL; - klass->no_write = 0; - klass->queue = NULL; - klass->fd = -1; - - if (f) { - fgets(klass->saved_fallback_framerate, 16, f); - fclose(f); - } - - gst_base_sink_set_sync(GST_BASE_SINK (klass), FALSE); - gst_base_sink_set_async_enabled(GST_BASE_SINK (klass), TRUE); -} - -static void gst_dvbvideosink_dispose (GObject * object) -{ - GstDVBVideoSink *self = GST_DVBVIDEOSINK (object); - GstState state, pending; - GST_DEBUG_OBJECT(self, "dispose"); - - // hack start : for decodebin2 bug.. decodebin2 tries to dispose .. - // but doesnt set state to NULL when it is READY - switch(gst_element_get_state(GST_ELEMENT(object), &state, &pending, GST_CLOCK_TIME_NONE)) - { - case GST_STATE_CHANGE_SUCCESS: - GST_DEBUG_OBJECT(self, "success"); - if (state != GST_STATE_NULL) { - GST_DEBUG_OBJECT(self, "state %d in dispose.. set it to NULL (decodebin2 bug?)", state); - if (gst_element_set_state(GST_ELEMENT(object), GST_STATE_NULL) == GST_STATE_CHANGE_ASYNC) { - GST_DEBUG_OBJECT(self, "set state returned async... wait!"); - gst_element_get_state(GST_ELEMENT(object), &state, &pending, GST_CLOCK_TIME_NONE); - } - } - break; - case GST_STATE_CHANGE_ASYNC: - GST_DEBUG_OBJECT(self, "async"); - break; - case GST_STATE_CHANGE_FAILURE: - GST_DEBUG_OBJECT(self, "failure"); - break; - case GST_STATE_CHANGE_NO_PREROLL: - GST_DEBUG_OBJECT(self, "no preroll"); - break; - default: - break; - } - // hack end - - GST_DEBUG_OBJECT(self, "state in dispose %d, pending %d", state, pending); - - G_OBJECT_CLASS (parent_class)->dispose (object); -} - -static gint64 gst_dvbvideosink_get_decoder_time (GstDVBVideoSink *self) -{ - if (self->dec_running) { - gint64 cur = 0; - static gint64 last_pos = 0; - - ioctl(self->fd, VIDEO_GET_PTS, &cur); - - /* workaround until driver fixed */ - if (cur) - last_pos = cur; - else - cur = last_pos; - - cur *= 11111; - - return cur; - } - return GST_CLOCK_TIME_NONE; -} - -static gboolean gst_dvbvideosink_unlock (GstBaseSink * basesink) -{ - GstDVBVideoSink *self = GST_DVBVIDEOSINK (basesink); - GST_OBJECT_LOCK(self); - self->no_write |= 2; - GST_OBJECT_UNLOCK(self); - SEND_COMMAND (self, CONTROL_STOP); - GST_DEBUG_OBJECT (basesink, "unlock"); - return TRUE; -} - -static gboolean gst_dvbvideosink_unlock_stop (GstBaseSink * basesink) -{ - GstDVBVideoSink *self = GST_DVBVIDEOSINK (basesink); - GST_OBJECT_LOCK(self); - self->no_write &= ~2; - GST_OBJECT_UNLOCK(self); - GST_DEBUG_OBJECT (basesink, "unlock_stop"); - return TRUE; -} - -void queue_push(queue_entry_t **queue_base, guint8 *data, size_t len) -{ - queue_entry_t *entry = malloc(sizeof(queue_entry_t)+len); - queue_entry_t *last = *queue_base; - guint8 *d = (guint8*)(entry+1); - memcpy(d, data, len); - entry->bytes = len; - entry->offset = 0; - if (!last) - *queue_base = entry; - else { - while(last->next) - last = last->next; - last->next = entry; - } - entry->next = NULL; -} - -void queue_pop(queue_entry_t **queue_base) -{ - queue_entry_t *base = *queue_base; - *queue_base = base->next; - free(base); -} - -int queue_front(queue_entry_t **queue_base, guint8 **data, size_t *bytes) -{ - if (!*queue_base) { - *bytes = 0; - *data = 0; - } - else { - queue_entry_t *entry = *queue_base; - *bytes = entry->bytes - entry->offset; - *data = ((guint8*)(entry+1))+entry->offset; - } - return *bytes; -} - -static gboolean -gst_dvbvideosink_event (GstBaseSink * sink, GstEvent * event) -{ - GstDVBVideoSink *self = GST_DVBVIDEOSINK (sink); - GST_DEBUG_OBJECT (self, "EVENT %s", gst_event_type_get_name(GST_EVENT_TYPE (event))); - int ret=TRUE; - - switch (GST_EVENT_TYPE (event)) { - case GST_EVENT_FLUSH_START: - GST_OBJECT_LOCK(self); - self->no_write |= 1; - GST_OBJECT_UNLOCK(self); - SEND_COMMAND (self, CONTROL_STOP); - break; - case GST_EVENT_FLUSH_STOP: - ioctl(self->fd, VIDEO_CLEAR_BUFFER); - GST_OBJECT_LOCK(self); - self->must_send_header = 1; - if (hwtype == DM7025) - ++self->must_send_header; // we must send the sequence header twice on dm7025... - while (self->queue) - queue_pop(&self->queue); - self->no_write &= ~1; - GST_OBJECT_UNLOCK(self); - break; - case GST_EVENT_EOS: - { - struct pollfd pfd[2]; - int retval; - printf("[V] GST_EVENT_EOS\n"); - - //Notify the player that no addionional data will be injected -#ifdef VIDEO_FLUSH - ioctl(self->fd, VIDEO_FLUSH, 1/*NONBLOCK*/); -#endif - - pfd[0].fd = READ_SOCKET(self); - pfd[0].events = POLLIN; - pfd[1].fd = self->fd; - pfd[1].events = POLLIN; - - GST_PAD_PREROLL_UNLOCK (sink->sinkpad); - while (1) { - retval = poll(pfd, 2, 250); - printf("[V] poll %d\n", retval); - if (retval < 0) { - perror("poll in EVENT_EOS"); - ret=FALSE; - break; - } - - if (pfd[0].revents & POLLIN) { - GST_DEBUG_OBJECT (self, "wait EOS aborted!!\n"); - ret=FALSE; - break; - } - - if (pfd[1].revents & POLLIN) { - GST_DEBUG_OBJECT (self, "got buffer empty from driver!\n"); - break; - } - - if (sink->flushing) { - GST_DEBUG_OBJECT (self, "wait EOS flushing!!\n"); - ret=FALSE; - break; - } - } - GST_PAD_PREROLL_LOCK (sink->sinkpad); - - break; - } - case GST_EVENT_NEWSEGMENT:{ - GstFormat fmt; - gboolean update; - gdouble rate, applied_rate; - gint64 cur, stop, time; - int skip = 0, repeat = 0, ret; - gst_event_parse_new_segment_full (event, &update, &rate, &applied_rate, &fmt, &cur, &stop, &time); - GST_DEBUG_OBJECT (self, "GST_EVENT_NEWSEGMENT rate=%f applied_rate=%f\n", rate, applied_rate); - - if (fmt == GST_FORMAT_TIME) - { - if ( rate > 1 ) - skip = (int) rate; - else if ( rate < 1 ) - repeat = 1.0/rate; - - ret = ioctl(self->fd, VIDEO_SLOWMOTION, repeat); - ret = ioctl(self->fd, VIDEO_FAST_FORWARD, skip); -// gst_segment_set_newsegment_full (&dec->segment, update, rate, applied_rate, dformat, cur, stop, time); - } - break; - } - - default: - break; - } - - return ret; -} - -#define ASYNC_WRITE(data, len) do { \ - switch(AsyncWrite(sink, self, data, len)) { \ - case -1: goto poll_error; \ - case -3: goto write_error; \ - default: break; \ - } \ - } while(0) - -static int AsyncWrite(GstBaseSink * sink, GstDVBVideoSink *self, unsigned char *data, unsigned int len) -{ - unsigned int written=0; - struct pollfd pfd[2]; - - pfd[0].fd = READ_SOCKET(self); - pfd[0].events = POLLIN; - pfd[1].fd = self->fd; - pfd[1].events = POLLOUT | POLLPRI; - - do { -loop_start: - if (self->no_write & 1) { - GST_DEBUG_OBJECT (self, "skip %d bytes", len - written); - break; - } - else if (self->no_write & 6) { - // directly push to queue - GST_OBJECT_LOCK(self); - queue_push(&self->queue, data + written, len - written); - GST_OBJECT_UNLOCK(self); - GST_DEBUG_OBJECT (self, "pushed %d bytes to queue", len - written); - break; - } - else - GST_LOG_OBJECT (self, "going into poll, have %d bytes to write", len - written); - if (poll(pfd, 2, -1) == -1) { - if (errno == EINTR) - continue; - return -1; - } - if (pfd[0].revents & POLLIN) { - /* read all stop commands */ - while (TRUE) { - gchar command; - int res; - READ_COMMAND (self, command, res); - if (res < 0) { - GST_DEBUG_OBJECT (self, "no more commands"); - /* no more commands */ - goto loop_start; - } - } - } - if (pfd[1].revents & POLLPRI) { - GstStructure *s; - GstMessage *msg; - struct video_event evt; - if (ioctl(self->fd, VIDEO_GET_EVENT, &evt) < 0) - g_warning ("failed to ioctl VIDEO_GET_EVENT!"); - else { - GST_INFO_OBJECT (self, "VIDEO_EVENT %d", evt.type); - if (evt.type == VIDEO_EVENT_SIZE_CHANGED) { - s = gst_structure_new ("eventSizeChanged", - "aspect_ratio", G_TYPE_INT, evt.u.size.aspect_ratio == 0 ? 2 : 3, - "width", G_TYPE_INT, evt.u.size.w, - "height", G_TYPE_INT, evt.u.size.h, NULL); - msg = gst_message_new_element (GST_OBJECT (sink), s); - gst_element_post_message (GST_ELEMENT (sink), msg); - } else if (evt.type == VIDEO_EVENT_FRAME_RATE_CHANGED) { - s = gst_structure_new ("eventFrameRateChanged", - "frame_rate", G_TYPE_INT, evt.u.frame_rate, NULL); - msg = gst_message_new_element (GST_OBJECT (sink), s); - gst_element_post_message (GST_ELEMENT (sink), msg); - } else if (evt.type == 16 /*VIDEO_EVENT_PROGRESSIVE_CHANGED*/) { - s = gst_structure_new ("eventProgressiveChanged", - "progressive", G_TYPE_INT, evt.u.frame_rate, NULL); - msg = gst_message_new_element (GST_OBJECT (sink), s); - gst_element_post_message (GST_ELEMENT (sink), msg); - } else - g_warning ("unhandled DVBAPI Video Event %d", evt.type); - } - } - if (pfd[1].revents & POLLOUT) { - size_t queue_entry_size; - guint8 *queue_data; - GST_OBJECT_LOCK(self); - if (queue_front(&self->queue, &queue_data, &queue_entry_size)) { - int wr = write(self->fd, queue_data, queue_entry_size); - if (wr < 0) { - switch (errno) { - case EINTR: - case EAGAIN: - break; - default: - GST_OBJECT_UNLOCK(self); - return -3; - } - } - else if (wr == queue_entry_size) { - queue_pop(&self->queue); - GST_DEBUG_OBJECT (self, "written %d queue bytes... pop entry", wr); - } - else { - self->queue->offset += wr; - GST_DEBUG_OBJECT (self, "written %d queue bytes... update offset", wr); - } - GST_OBJECT_UNLOCK(self); - continue; - } - GST_OBJECT_UNLOCK(self); - int wr = write(self->fd, data+written, len - written); - if (wr < 0) { - switch (errno) { - case EINTR: - case EAGAIN: - continue; - default: - return -3; - } - } - written += wr; - } - } while (written != len); - - return 0; -} - -static inline void Hexdump(unsigned char *Data, int length) -{ - - int k; - for (k = 0; k < length; k++) - { - printf("%02x ", Data[k]); - if (((k+1)&31)==0) - printf("\n"); - } - printf("\n"); - -} - -//#define SEND_DTS -#define DYNAMIC_PIC -#define WRITE_COMPLETE_PACKAGE - -//WMV does not like this! -//#define RESEND_TIMESTAMP_EVERY_SUB_FRAME - - -//#define INJECT_XVID_DIRECTLY - -static size_t -buildPesHeader(unsigned char *data, int size, unsigned long long int timestamp, - unsigned char stream_id, unsigned int pic_start_code, unsigned int video_private_plus_size) -{ - unsigned char *pes_header = data; - size_t pes_header_size; - - pes_header[0] = 0x00; - pes_header[1] = 0x00; - pes_header[2] = 0x01; - pes_header[3] = stream_id; - - //pes_header[4] = size >> 8; - //pes_header[5] = size & 0xFF; - - pes_header[6] = 0x80; - - // No special flags - pes_header[7] = 0x00; // Flag - pes_header[8] = 0x00; // Len of additional data field - pes_header_size = 9; - - /* do we have a timestamp? */ - if (timestamp != GST_CLOCK_TIME_NONE) { - unsigned long long pts = timestamp * 9LL / 100000 /* convert ns to 90kHz */; - //printf("PTS: %llu\n", pts); - - // Timestamp present - pes_header[7] = 0x80; // Flag - pes_header[8] = 0x05; // Len of additional data field - - pes_header[9] = 0x21 | ((pts >> 29) & 0xE); - pes_header[10] = pts >> 22; - pes_header[11] = 0x01 | ((pts >> 14) & 0xFE); - pes_header[12] = pts >> 7; - pes_header[13] = 0x01 | ((pts << 1) & 0xFE); - - pes_header_size += 5; - -#ifdef SEND_DTS - // At the moment it seems that dts has only to be set for dm7025 - // and than only for audio -#endif - - } - - if (video_private_plus_size) { - int i; -#define PES_EXTENSION_DATA_PRESENT 0x01 -#define PES_PRIVATE_DATA_LENGTH 8 -#define PES_PRIVATE_DATA_FLAG 0x80 - - pes_header[7] |= PES_EXTENSION_DATA_PRESENT ; - pes_header[8] += (PES_PRIVATE_DATA_LENGTH+1); - - pes_header[pes_header_size + 0] = PES_PRIVATE_DATA_FLAG; -#if 1 - pes_header[pes_header_size + 1] = video_private_plus_size & 0xFF; - pes_header[pes_header_size + 2] = (video_private_plus_size >> 8) & 0xFF; - pes_header[pes_header_size + 3] = (video_private_plus_size >> 16) & 0xFF; -#else - pes_header[pes_header_size + 1] = size & 0xFF; - pes_header[pes_header_size + 2] = (size >> 8) & 0xFF; - pes_header[pes_header_size + 3] = (size >> 16) & 0xFF; -#endif - for (i = 4; i < (PES_PRIVATE_DATA_LENGTH+1); i++) - pes_header[pes_header_size + i] = 0x00; - - pes_header_size += (PES_PRIVATE_DATA_LENGTH+1); - } - - // FIXME: VC1 wants the size without the pic startcode but divx wants with size - // So these are different fields and should maybe be splitted up - if (pic_start_code <= 0xFF) { - pes_header[4] = (size + pes_header_size - 6) >> 8; - pes_header[5] = (size + pes_header_size - 6) & 0xFF; - } - - if (pic_start_code) { - pes_header[pes_header_size + 0] = 0x00; - pes_header[pes_header_size + 1] = 0x00; - pes_header[pes_header_size + 2] = 0x01; - pes_header[pes_header_size + 3] = pic_start_code & 0xFF; // 00, for picture start - -#ifdef DYNAMIC_PIC - pes_header_size += 4; - if (pic_start_code > 0xFF) { - pes_header[pes_header_size] = (pic_start_code >> 8) & 0xFF; // For any extra information (like in mpeg4p2, the pic_start_code) - pes_header_size += 1; - } -#else - pes_header[pes_header_size + 4] = (pic_start_code >> 8) & 0xFF; // For any extra information (like in mpeg4p2, the pic_start_code) - pes_header_size += 5; -#endif - } - - //FIXME: See above - if (pic_start_code > 0xFF) { - pes_header[4] = (size + pes_header_size - 6) >> 8; - pes_header[5] = (size + pes_header_size - 6) & 0xFF; - } - - return pes_header_size; -} - -#define VC1_VIDEO_PES_START_CODE 0xfd -#define VC1_FRAME_START_CODE 0x0d -#define PES_VERSION_FAKE_START_CODE 0x31 -#define MPEG_VIDEO_PES_START_CODE 0xe0 -#define H263_VIDEO_PES_START_CODE 0xfe -#define MAX_PES_PACKET_SIZE 65400 - -//#define DEBUG_EXT - -static GstFlowReturn -gst_dvbvideosink_render (GstBaseSink * sink, GstBuffer * buffer) -{ - GstDVBVideoSink *self = GST_DVBVIDEOSINK (sink); - unsigned char *data = GST_BUFFER_DATA(buffer); - unsigned int data_len = GST_BUFFER_SIZE (buffer); - long long timestamp = GST_BUFFER_TIMESTAMP(buffer); - //unsigned char keyframe = !GST_BUFFER_FLAG_IS_SET(buffer, GST_BUFFER_FLAG_DELTA_UNIT); - - //printf("kf: %d ts: %llu\n", keyframe, timestamp); - - if (self->streamtype == STREAMTYPE_UNKNOWN) { - GST_ELEMENT_ERROR (self, STREAM, FORMAT, (NULL), ("hardware decoder not setup (no caps in pipeline?)")); - return GST_FLOW_ERROR; - } - - if (self->fd < 0) - return GST_FLOW_OK; - -#ifdef DEBUG_EXT - printf("gst_dvbvideosink_render 1\n"); -#endif - - unsigned char start_code = MPEG_VIDEO_PES_START_CODE; - unsigned int pic_start_code = 0; - unsigned int insertVideoPrivateDataHeader = 0; - - if (self->streamtype == STREAMTYPE_WMV) { - insertVideoPrivateDataHeader = 1; - start_code = VC1_VIDEO_PES_START_CODE; - } - else if (self->streamtype == STREAMTYPE_VC1) { - start_code = VC1_VIDEO_PES_START_CODE; - pic_start_code = VC1_FRAME_START_CODE; - } - else if (self->streamtype == STREAMTYPE_DIVX4) { - unsigned char version = 4; - pic_start_code = (version << 8) | PES_VERSION_FAKE_START_CODE; - } - else if (self->streamtype == STREAMTYPE_DIVX5) { - unsigned char version = 5; - pic_start_code = (version << 8) | PES_VERSION_FAKE_START_CODE; - } - else if (self->streamtype == STREAMTYPE_H263) { - insertVideoPrivateDataHeader = 1; - start_code = H263_VIDEO_PES_START_CODE; - } - -#ifdef DEBUG_EXT - printf("gst_dvbvideosink_render - write initial header\n"); -#endif - - if (self->initial_header) - { - if (self->initial_header_private_data_size > 0) - { - unsigned char pes_header_initial[PES_MAX_HEADER_SIZE]; - size_t pes_header_size_initial; - - pes_header_size_initial = buildPesHeader(pes_header_initial, self->initial_header_private_data_size, GST_CLOCK_TIME_NONE, start_code, 0, 0); - -#if 0 - printf("-->\n"); - Hexdump(pes_header_initial, pes_header_size_initial); - Hexdump(self->initial_header_private_data, self->initial_header_private_data_size); - printf("<--\n"); -#endif - -#ifdef WRITE_COMPLETE_PACKAGE - //printf("--> %d bytes\n", pes_header_size_initial + self->initial_header_private_data_size); - unsigned char *write_buffer = (unsigned char*) malloc(sizeof(unsigned char) * (pes_header_size_initial + self->initial_header_private_data_size)); - memcpy(write_buffer, pes_header_initial, pes_header_size_initial); - memcpy(write_buffer + pes_header_size_initial, self->initial_header_private_data, self->initial_header_private_data_size); - ASYNC_WRITE(write_buffer, pes_header_size_initial + self->initial_header_private_data_size); - free(write_buffer); -#else - ASYNC_WRITE(pes_header_initial, pes_header_size_initial); - ASYNC_WRITE(self->initial_header_private_data, self->initial_header_private_data_size); -#endif - free(self->initial_header_private_data); - self->initial_header_private_data_size = 0; - } - - if (self->streamtype == STREAMTYPE_VC1) - { - unsigned char pes_header_initial[PES_MAX_HEADER_SIZE]; - size_t pes_header_size_initial; - - - /* For VC1 the codec private data is a standard vc1 sequence header so we just copy it to the output */ - guint32 codec_data_len = GST_BUFFER_SIZE(self->codec_data); - - pes_header_size_initial = buildPesHeader(pes_header_initial, codec_data_len, GST_CLOCK_TIME_NONE, start_code, 0, 0); - -#if 0 - printf("-->\n"); - Hexdump(pes_header_initial, pes_header_size_initial); - Hexdump(GST_BUFFER_DATA (self->codec_data), codec_data_len); - printf("<--\n"); -#endif - -#ifdef WRITE_COMPLETE_PACKAGE - { - unsigned char *write_buffer = (unsigned char*) malloc(sizeof(unsigned char) * (pes_header_size_initial + codec_data_len)); - memcpy(write_buffer, pes_header_initial, pes_header_size_initial); - memcpy(write_buffer + pes_header_size_initial, GST_BUFFER_DATA (self->codec_data), codec_data_len); - ASYNC_WRITE(write_buffer, pes_header_size_initial + codec_data_len); - free(write_buffer); - } -#else - ASYNC_WRITE(pes_header_initial, pes_header_size_initial); - ASYNC_WRITE(GST_BUFFER_DATA (self->codec_data), codec_data_len); -#endif - } - self->initial_header = FALSE; - } - -#ifdef DEBUG_EXT - printf("gst_dvbvideosink_render - initial header written\n"); - printf("gst_dvbvideosink_render - write pes packages\n"); -#endif - - unsigned int data_position = 0; - //int i = 0; - while (data_position < data_len) { -#define SPLIT_TO_BIG_PACKETS -#ifdef SPLIT_TO_BIG_PACKETS - unsigned int pes_packet_size = (data_len - data_position) <= MAX_PES_PACKET_SIZE ? - (data_len - data_position) : MAX_PES_PACKET_SIZE; -#else - unsigned int pes_packet_size = (data_len - data_position); -#endif - - //if (data_position != 0) { - //printf("> %d pos=%u size=%u max=%u len=%u remaining=%u\n", i++, data_position, pes_packet_size, MAX_PES_PACKET_SIZE, data_len, data_len - data_position); - //} - - unsigned char pes_header[PES_MAX_HEADER_SIZE]; - memset (pes_header, '0', PES_MAX_HEADER_SIZE); - int pes_header_size = 0; - - if (self->streamtype == STREAMTYPE_VC1 && data_position == 0 && pic_start_code != 0) { - const unsigned char Vc1FrameStartCode[] = {0, 0, 1, VC1_FRAME_START_CODE}; - if(data_len > 3 && (memcmp (data, Vc1FrameStartCode, 4) == 0)) { - printf("GOT IT!\n"); - pic_start_code = 0; - } - } - else if (self->streamtype == STREAMTYPE_H264 && data_position == 0 && self->h264_nal_len_size > 0) { - //This code replaces all nal length bytes with HEAD -#ifdef DEBUG_EXT - printf("gst_dvbvideosink_render - h264 replace nal lenght %d\n", self->h264_nal_len_size); -#endif - unsigned int pos = 0; - if (self->h264_nal_len_size == 4) { - while(TRUE) { - unsigned int pack_len = (data[pos] << 24) | (data[pos+1] << 16) | (data[pos+2] << 8) | data[pos+3]; - memcpy(data+pos, "\x00\x00\x00\x01", 4); - pos += 4; - if ((pos + pack_len) >= data_len) - break; - pos += pack_len; - } - } - else if (self->h264_nal_len_size == 3) { - while(TRUE) { - unsigned int pack_len = (data[pos] << 16) | (data[pos+1] << 8) | data[pos+2]; - memcpy(data+pos, "\x00\x00\x01", 3); - pos += 3; - if ((pos + pack_len) >= data_len) - break; - pos += pack_len; - } - } - else { - unsigned char *dest = GST_BUFFER_DATA (self->h264_buffer); - unsigned int dest_pos = 0; - while(TRUE) { - unsigned int pack_len = self->h264_nal_len_size == 2 ? (data[pos] << 8) | data[pos+1] : data[pos]; - if (dest_pos + pack_len <= H264_BUFFER_SIZE) { - memcpy(dest+dest_pos, "\x00\x00\x01", 3); - dest_pos += 3; - pos += self->h264_nal_len_size; - memcpy(dest+dest_pos, data+pos, pack_len); - dest_pos += pack_len; - if ((pos + pack_len) >= data_len) - break; - pos += pack_len; - } - else { - g_error("BUG!!!!!!!! H264 buffer to small skip video data!!.. please report!\n"); - break; - } - } - data = dest; - data_len = dest_pos; - } -#ifdef DEBUG_EXT - printf("gst_dvbvideosink_render - h264 nal lenght replaced\n"); -#endif - } -#if 1 - else if (self->streamtype == STREAMTYPE_DIVX5 || self->streamtype == STREAMTYPE_XVID) { - if (data_position == 0) { - int itr; - int end_itr = (pes_packet_size>128?124:pes_packet_size - 4); - unsigned char *data_p = data; - for (itr = 0; itr < end_itr; itr++) { - if (data_p[0] == 0x00 && data_p[1] == 0x00 && data_p[2] == 0x01 && data_p[3] == 0xb6) { - //video object layer found - int frametype = ((data_p[4] >> 6) & 0x3); - if (frametype == 1 /*god hates p-frames*/) - timestamp = GST_CLOCK_TIME_NONE; - break; - } - data_p++; - } - } - } -#endif - -#ifdef DEBUG_EXT - printf("gst_dvbvideosink_render - build PESHeader\n"); -#endif - if (insertVideoPrivateDataHeader) insertVideoPrivateDataHeader = data_len; - pes_header_size = buildPesHeader(pes_header, pes_packet_size, - timestamp, start_code, data_position==0?pic_start_code:0, - insertVideoPrivateDataHeader); - - insertVideoPrivateDataHeader = 0; - -#ifdef DEBUG_EXT - printf("gst_dvbvideosink_render - PESHeader built\n"); -#endif - -#if 0 - printf("--> %d\n", self->runtime_header_data_size); - Hexdump(pes_header, pes_header_size); - if (self->runtime_header_data_size > 0) - Hexdump(self->runtime_header_data, self->runtime_header_data_size); - Hexdump(data + data_position, pes_packet_size>128?128:pes_packet_size); - printf("<--\n"); -#endif - -#ifdef WRITE_COMPLETE_PACKAGE - { - //printf("--> %d bytes\n", pes_header_size + pes_packet_size); - unsigned char *write_buffer = (unsigned char*) malloc(sizeof(unsigned char) * (pes_header_size + self->runtime_header_data_size + pes_packet_size)); - memcpy(write_buffer, pes_header, pes_header_size); - if (self->runtime_header_data_size > 0) - memcpy(write_buffer + pes_header_size, self->runtime_header_data, self->runtime_header_data_size); - memcpy(write_buffer + pes_header_size + self->runtime_header_data_size, data + data_position, pes_packet_size); - ASYNC_WRITE(write_buffer, pes_header_size + self->runtime_header_data_size + pes_packet_size); - free(write_buffer); - } -#else //FIXME - ASYNC_WRITE(pes_header, pes_header_size); - if (self->runtime_header_data_size > 0) - ASYNC_WRITE(self->runtime_header_data, self->runtime_header_data_size); - ASYNC_WRITE(data + data_position, pes_packet_size - self->runtime_header_data_size); -#endif -#ifdef RESEND_TIMESTAMP_EVERY_SUB_FRAME -#else - timestamp = GST_CLOCK_TIME_NONE; -#endif - data_position += pes_packet_size; - //printf("< pos=%u size=%u\n", data_position, pes_packet_size); - } - -#ifdef DEBUG_EXT - printf("gst_dvbvideosink_render - pes packages written\n"); -#endif - - return GST_FLOW_OK; - -poll_error: - { - GST_ELEMENT_ERROR (self, RESOURCE, READ, (NULL), - ("poll on file descriptor: %s.", g_strerror (errno))); - GST_WARNING_OBJECT (self, "Error during poll"); - return GST_FLOW_ERROR; - } -write_error: - { - GST_ELEMENT_ERROR (self, RESOURCE, READ, (NULL), - ("write on file descriptor: %s.", g_strerror (errno))); - GST_WARNING_OBJECT (self, "Error during write"); - return GST_FLOW_ERROR; - } - self->must_send_header = 1; - if (hwtype == DM7025) - ++self->must_send_header; // we must send the sequence header twice on dm7025... -} - -static gboolean -gst_dvbvideosink_set_caps (GstBaseSink * basesink, GstCaps * caps) -{ - GstDVBVideoSink *self = GST_DVBVIDEOSINK (basesink); - GstStructure *structure = gst_caps_get_structure (caps, 0); - const char *mimetype = gst_structure_get_name (structure); - int streamtype = STREAMTYPE_UNKNOWN; - -#ifdef DEBUG_EXT - printf("gst_dvbvideosink_set_caps ->\n"); -#endif - - printf("\nMIMETYPE: %s\n", mimetype); - - if (!strcmp (mimetype, "video/mpeg")) { - gint mpegversion; - gst_structure_get_int (structure, "mpegversion", &mpegversion); - switch (mpegversion) { - case 1: - streamtype = STREAMTYPE_MPEG1; - GST_INFO_OBJECT (self, "MIMETYPE video/mpeg1 -> VIDEO_SET_STREAMTYPE, 6"); - break; - case 2: - streamtype = STREAMTYPE_MPEG2; - GST_INFO_OBJECT (self, "MIMETYPE video/mpeg2 -> VIDEO_SET_STREAMTYPE, 0"); - break; - case 4: //TODO - { - const GValue *codec_data = gst_structure_get_value (structure, "codec_data"); - if (codec_data) { - GST_INFO_OBJECT (self, "MPEG4 have codec data"); - self->codec_data = gst_value_get_buffer (codec_data); - gst_buffer_ref (self->codec_data); - } - streamtype = STREAMTYPE_MPEG4_P2; - GST_INFO_OBJECT (self, "MIMETYPE video/mpeg4 -> VIDEO_SET_STREAMTYPE, 4"); - } - break; - default: - GST_ELEMENT_ERROR (self, STREAM, FORMAT, (NULL), ("unhandled mpeg version %i", mpegversion)); - break; - } - - } else if (!strcmp (mimetype, "video/x-3ivx")) { - const GValue *codec_data = gst_structure_get_value (structure, "codec_data"); - if (codec_data) { - GST_INFO_OBJECT (self, "have 3ivx codec... handle as CT_MPEG4_PART2"); - self->codec_data = gst_value_get_buffer (codec_data); - gst_buffer_ref (self->codec_data); - } - streamtype = STREAMTYPE_MPEG4_P2; - GST_INFO_OBJECT (self, "MIMETYPE video/x-3ivx -> VIDEO_SET_STREAMTYPE, 4"); - - } else if (!strcmp (mimetype, "video/x-h264")) { - const GValue *cd_data = gst_structure_get_value (structure, "codec_data"); - streamtype = STREAMTYPE_H264; - if (cd_data) { -#ifdef DEBUG_EXT - printf("[V] video/x-h264 has codec_data\n"); -#endif - unsigned char tmp[2048]; - unsigned int tmp_len = 0; - GstBuffer *codec_data = gst_value_get_buffer (cd_data); - unsigned char *data = GST_BUFFER_DATA (codec_data); - unsigned int cd_len = GST_BUFFER_SIZE (codec_data); - unsigned int cd_pos = 0; - GST_INFO_OBJECT (self, "H264 have codec data..!"); - -#define AVCC_VERSION 0 -#define AVCC_PROFILE 1 -#define AVCC_COMPATIBILITY 2 -#define AVCC_LEVEL 3 -#define AVCC NAL_LENGTH_MINUS_ONE 4 -#define AVCC_NUM_PARAM_SETS 5 - - if (cd_len > 7 && data[AVCC_VERSION] == 1) { // avcC version - unsigned short len = (data[6] << 8) | data[7]; // Length of first sequence param set - if (cd_len >= (len + 8)) { - unsigned int i=0; - uint8_t profile_num[] = { 66, 77, 88, 100 }; - uint8_t profile_cmp[2] = { 0x67, 0x00 }; - const char *profile_str[] = { "baseline", "main", "extended", "high" }; - memcpy(tmp, "\x00\x00\x00\x01", 4); // Copy HEAD - tmp_len += 4; - memcpy(tmp+tmp_len, data+8, len); // Copy body of sequence paramter - for (i = 0; i < 4; ++i) { // Check every type and fix if necessary - profile_cmp[1] = profile_num[i]; - if (!memcmp(tmp+tmp_len, profile_cmp, 2)) { - uint8_t level_org = tmp[tmp_len+3]; - if (level_org > 0x29) { - GST_INFO_OBJECT (self, "H264 %s profile@%d.%d patched down to 4.1!", profile_str[i], level_org / 10 , level_org % 10); - tmp[tmp_len+3] = 0x29; // level 4.1 - } - else - GST_INFO_OBJECT (self, "H264 %s profile@%d.%d", profile_str[i], level_org / 10 , level_org % 10); - break; - } - } - tmp_len += len; - cd_pos = 8 + len; - if (cd_len > (cd_pos + 2)) { - len = (data[cd_pos+1] << 8) | data[cd_pos+2]; // Length of first picture param set - cd_pos += 3; - if (cd_len >= (cd_pos+len)) { - memcpy(tmp+tmp_len, "\x00\x00\x00\x01", 4); // Copy HEAD - tmp_len += 4; - memcpy(tmp+tmp_len, data+cd_pos, len); // Copy body of picture paramter - tmp_len += len; - - // Copy created pivate header - self->initial_header_private_data_size = tmp_len; - self->initial_header_private_data = - (guint8*) malloc(sizeof(guint8) * self->initial_header_private_data_size); - memcpy(self->initial_header_private_data, tmp, tmp_len); - self->h264_nal_len_size = (data[4] & 0x03) + 1; // Whereas data[4] is nallengthMinusOne - if (self->h264_nal_len_size < 3) - self->h264_buffer = gst_buffer_new_and_alloc(H264_BUFFER_SIZE); - } - else - GST_WARNING_OBJECT (self, "codec_data to short(4)"); - } - else - GST_WARNING_OBJECT (self, "codec_data to short(3)"); - } - else - GST_WARNING_OBJECT (self, "codec_data to short(2)"); - } - else if (cd_len <= 7) - GST_WARNING_OBJECT (self, "codec_data to short(1)"); - else - GST_WARNING_OBJECT (self, "wrong avcC version %d!", data[0]); - } - else - self->h264_nal_len_size = 0; - GST_INFO_OBJECT (self, "MIMETYPE video/x-h264 VIDEO_SET_STREAMTYPE, 1"); - - } else if (!strcmp (mimetype, "video/x-h263")) { - streamtype = STREAMTYPE_H263; - GST_INFO_OBJECT (self, "MIMETYPE video/x-h263 VIDEO_SET_STREAMTYPE, 2"); - const GValue *codec_data = gst_structure_get_value (structure, "codec_data"); - self->codec_data = gst_value_get_buffer (codec_data); - gst_buffer_ref (self->codec_data); - -#ifdef INJECT_XVID_DIRECTLY - } else if (!strcmp (mimetype, "video/x-xvid")) { - streamtype = STREAMTYPE_XVID; - GST_INFO_OBJECT (self, "MIMETYPE video/x-xvid -> VIDEO_SET_STREAMTYPE, 10"); - - } else if (!strcmp (mimetype, "video/x-divx") || !strcmp (mimetype, "video/x-msmpeg")) { -#else - } else if (!strcmp (mimetype, "video/x-divx") || !strcmp (mimetype, "video/x-msmpeg") || !strcmp (mimetype, "video/x-xvid")) { -#endif - gint divxversion = -1; -#ifndef INJECT_XVID_DIRECTLY - if(!strcmp (mimetype, "video/x-xvid")) - divxversion = 5; - else -#endif - if (!gst_structure_get_int (structure, "divxversion", &divxversion) && !gst_structure_get_int (structure, "msmpegversion", &divxversion)) - ; - - printf("\nDIVX %d\n", divxversion); - - switch (divxversion) { - case 0: - break; - case 3: - case 43: - { - #define B_GET_BITS(w,e,b) (((w)>>(b))&(((unsigned)(-1))>>((sizeof(unsigned))*8-(e+1-b)))) - #define B_SET_BITS(name,v,e,b) (((unsigned)(v))<<(b)) - static const guint8 brcm_divx311_sequence_header[] = { - 0x00, 0x00, 0x01, 0xE0, 0x00, 0x34, 0x80, 0x80, // PES HEADER - 0x05, 0x2F, 0xFF, 0xFF, 0xFF, 0xFF, - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x20, /* 0 .. 7 */ - 0x08, 0xC8, 0x0D, 0x40, 0x00, 0x53, 0x88, 0x40, /* 8 .. 15 */ - 0x0C, 0x40, 0x01, 0x90, 0x00, 0x97, 0x53, 0x0A, /* 16 .. 24 */ - 0x00, 0x00, 0x00, 0x00, - 0x30, 0x7F, 0x00, 0x00, 0x01, 0xB2, 0x44, 0x69, /* 0 .. 7 */ - 0x76, 0x58, 0x33, 0x31, 0x31, 0x41, 0x4E, 0x44 /* 8 .. 15 */ - }; - self->codec_data = gst_buffer_new_and_alloc(63); - guint8 *data = GST_BUFFER_DATA(self->codec_data); - gint height, width; - gst_structure_get_int (structure, "height", &height); - gst_structure_get_int (structure, "width", &width); - memcpy(data, brcm_divx311_sequence_header, 63); - data += 38; - data[0] = B_GET_BITS(width,11,4); - data[1] = B_SET_BITS("width [3..0]", B_GET_BITS(width,3,0), 7, 4) | - B_SET_BITS("'10'", 0x02, 3, 2) | - B_SET_BITS("height [11..10]", B_GET_BITS(height,11,10), 1, 0); - data[2] = B_GET_BITS(height,9,2); - data[3]= B_SET_BITS("height [1.0]", B_GET_BITS(height,1,0), 7, 6) | - B_SET_BITS("'100000'", 0x20, 5, 0); - streamtype = STREAMTYPE_DIVX311; - GST_INFO_OBJECT (self, "MIMETYPE video/x-divx vers. 3 -> VIDEO_SET_STREAMTYPE, 13"); - } - break; - case 4: - GST_INFO_OBJECT (self, "MIMETYPE video/x-divx vers. 4 -> VIDEO_SET_STREAMTYPE, 14"); - streamtype = STREAMTYPE_DIVX4; - break; - case 5: - case 6: - GST_INFO_OBJECT (self, "MIMETYPE video/x-divx vers. 5 -> VIDEO_SET_STREAMTYPE, 15"); - streamtype = STREAMTYPE_DIVX5; - break; - default: - GST_ELEMENT_ERROR (self, STREAM, FORMAT, (NULL), ("unhandled divx version %i", divxversion)); - break; - } - - if (streamtype == STREAMTYPE_DIVX4 || streamtype == STREAMTYPE_DIVX5) { - printf("\nAdding Divx4/5/6 fake header\n"); - self->runtime_header_data_size = 17; //Fakeheader size - self->runtime_header_data = (unsigned char*)malloc(sizeof(unsigned char) * self->runtime_header_data_size); - memset(self->runtime_header_data, 0, self->runtime_header_data_size); - - unsigned int startcode = 0x1b0; - self->runtime_header_data[0] = (startcode >> 24) & 0xFF; - self->runtime_header_data[1] = (startcode >> 16) & 0xFF; - self->runtime_header_data[2] = (startcode >> 8) & 0xFF; - self->runtime_header_data[3] = startcode & 0xFF; - - self->runtime_header_data[4] = 0x00; //Profile = reserved - - unsigned int startcode_user_data = 0x1b2; - self->runtime_header_data[5] = (startcode_user_data >> 24) & 0xFF; - self->runtime_header_data[6] = (startcode_user_data >> 16) & 0xFF; - self->runtime_header_data[7] = (startcode_user_data >> 8) & 0xFF; - self->runtime_header_data[8] = startcode_user_data & 0xFF; - - unsigned int sttc = 0x53545443; - self->runtime_header_data[9] = (sttc >> 24) & 0xFF; - self->runtime_header_data[10] = (sttc >> 16) & 0xFF; - self->runtime_header_data[11] = (sttc >> 8) & 0xFF; - self->runtime_header_data[12] = sttc & 0xFF; - - guint rate, rate_nu = 0, rate_de = 0; - gst_structure_get_fraction (structure, "framerate", &rate_nu, &rate_de); - - if (rate_nu != 0) - rate = (1000000000) / ((rate_nu * 1000)/rate_de); - else - rate = 0; - - //rate = rate_de / 10; - - printf("\nRate: %d %d -> %u\n", rate_nu, rate_de, rate); - self->runtime_header_data[13] = (rate >> 24) & 0xFF; - self->runtime_header_data[14] = (rate >> 16) & 0xFF; - self->runtime_header_data[15] = (rate >> 8) & 0xFF; - self->runtime_header_data[16] = rate & 0xFF; - } - - } else if (!strcmp (mimetype, "video/x-wmv")) { - gint wmvversion = -1, rate, rate_nu = -1, rate_de = -1, width = -1, height = -1; - guint32 format = 0xFF; - - #define WMV3_PRIVATE_DATA_LENGTH 4 - #define VC1_SEQUENCE_LAYER_METADATA_START_CODE 0x80 - #define VC1_FRAME_START_CODE 0x0d - - #define METADATA_STRUCT_A_START 12 - #define METADATA_STRUCT_B_START 24 - #define METADATA_STRUCT_B_FRAMERATE_START 32 - #define METADATA_STRUCT_C_START 8 - - const unsigned char SequenceLayerStartCode[] = {0x00, 0x00, 0x01, VC1_SEQUENCE_LAYER_METADATA_START_CODE}; - - const unsigned char Metadata[] = - { - 0x00, 0x00, 0x00, 0xc5, - 0x04, 0x00, 0x00, 0x00, - 0xc0, 0x00, 0x00, 0x00, /* Struct C set for for advanced profile*/ - 0x00, 0x00, 0x00, 0x00, /* Struct A */ - 0x00, 0x00, 0x00, 0x00, - 0x0c, 0x00, 0x00, 0x00, - 0x60, 0x00, 0x00, 0x00, /* Struct B */ - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00 - }; - - gst_structure_get_int (structure, "wmvversion", &wmvversion); - gst_structure_get_fourcc (structure, "format", &format); - gst_structure_get_fraction (structure, "framerate", &rate_nu, &rate_de); - gst_structure_get_int (structure, "width", &width); - gst_structure_get_int (structure, "height", &height); - - - rate = rate_de; - printf("Rate: %d -> %d\n", rate_de, rate); - printf("Format: %u\n", format); - -#define FOURCC_WMV3 0x33564D57 -#define FOURCC_WVC1 0x31435657 - - const GValue *codec_data = gst_structure_get_value (structure, "codec_data"); - guint8 *h = GST_BUFFER_DATA(gst_value_get_buffer (codec_data)); - guint32 h_size = GST_BUFFER_SIZE(gst_value_get_buffer (codec_data)); - - guint8 METADATA_START = 0; - if (format == FOURCC_WVC1) { - self->codec_data = gst_value_get_buffer (codec_data); - gst_buffer_ref (self->codec_data); - - self->initial_header_private_data_size = sizeof(SequenceLayerStartCode) + sizeof(Metadata); - METADATA_START = sizeof(SequenceLayerStartCode); - } - else if (format == FOURCC_WMV3) { - self->initial_header_private_data_size = sizeof(Metadata); - } - - self->initial_header_private_data = - (guint8*) malloc(sizeof(guint8) * self->initial_header_private_data_size); - memset (self->initial_header_private_data, 0, self->initial_header_private_data_size); - - if (format == FOURCC_WVC1) - memcpy (self->initial_header_private_data, SequenceLayerStartCode, sizeof(SequenceLayerStartCode)); - - memcpy(self->initial_header_private_data + METADATA_START , Metadata, sizeof(Metadata)); - - if (format == FOURCC_WMV3) - memcpy(self->initial_header_private_data + METADATA_START + METADATA_STRUCT_C_START, h, WMV3_PRIVATE_DATA_LENGTH); - - self->initial_header_private_data[METADATA_START + METADATA_STRUCT_A_START + 0] = (height >> 0) & 0xFF; - self->initial_header_private_data[METADATA_START + METADATA_STRUCT_A_START + 1] = (height >> 8) & 0xFF; - self->initial_header_private_data[METADATA_START + METADATA_STRUCT_A_START + 2] = (height >> 16) & 0xFF; - self->initial_header_private_data[METADATA_START + METADATA_STRUCT_A_START + 3] = height >> 24; - - self->initial_header_private_data[METADATA_START + METADATA_STRUCT_A_START + 4] = (width >> 0) & 0xFF; - self->initial_header_private_data[METADATA_START + METADATA_STRUCT_A_START + 5] = (width >> 8) & 0xFF; - self->initial_header_private_data[METADATA_START + METADATA_STRUCT_A_START + 6] = (width >> 16) & 0xFF; - self->initial_header_private_data[METADATA_START + METADATA_STRUCT_A_START + 7] = width >> 24; - - //Note: The rate returned by ffmpeg is slightly different (24 instead of 29,97) - self->initial_header_private_data[METADATA_START + METADATA_STRUCT_B_START + 8] = (rate >> 0) & 0xFF; - self->initial_header_private_data[METADATA_START + METADATA_STRUCT_B_START + 9] = (rate >> 8) & 0xFF; - self->initial_header_private_data[METADATA_START + METADATA_STRUCT_B_START + 10] = (rate >> 16) & 0xFF; - self->initial_header_private_data[METADATA_START + METADATA_STRUCT_B_START + 11] = rate >> 24; - - if (format == FOURCC_WVC1) - streamtype = STREAMTYPE_VC1; - else if (format == FOURCC_WMV3) - streamtype = STREAMTYPE_WMV; - } - if (streamtype != -STREAMTYPE_UNKNOWN) { - gint numerator, denominator; - if (gst_structure_get_fraction (structure, "framerate", &numerator, &denominator)) { - FILE *f = fopen("/proc/stb/vmpeg/0/fallback_framerate", "w"); - if (f) { - int valid_framerates[] = { 23976, 24000, 25000, 29970, 30000, 50000, 59940, 60000 }; - int framerate = (int)(((double)numerator * 1000) / denominator); - int diff = 60000; - int best = 0; - int i = 0; - for (; i < 7; ++i) { - int ndiff = abs(framerate - valid_framerates[i]); - if (ndiff < diff) { - diff = ndiff; - best = i; - } - } - fprintf(f, "%d", valid_framerates[best]); - fclose(f); - } - } - if (self->dec_running) { - ioctl(self->fd, VIDEO_STOP, 0); - self->dec_running = FALSE; - } - - if (self->use_set_encoding) - { -#ifdef VIDEO_SET_ENCODING - unsigned int encoding = streamtype_to_encoding(streamtype); - if (ioctl(self->fd, VIDEO_SET_ENCODING, encoding) < 0) { - GST_ELEMENT_WARNING (self, STREAM, DECODE, (NULL), ("hardware decoder can't be set to encoding %i.", encoding)); - } -#endif - } - else - { - if (ioctl(self->fd, VIDEO_SET_STREAMTYPE, streamtype) < 0 ) - if ( streamtype != 0 && streamtype != 6 ) - GST_ELEMENT_ERROR (self, STREAM, CODEC_NOT_FOUND, (NULL), ("hardware decoder can't handle streamtype %i", streamtype)); - } - self->streamtype = streamtype; - - ioctl(self->fd, VIDEO_PLAY); - self->dec_running = TRUE; - } else - GST_ELEMENT_ERROR (self, STREAM, TYPE_NOT_FOUND, (NULL), ("unimplemented stream type %s", mimetype)); - -#ifdef DEBUG_EXT - printf("gst_dvbvideosink_set_caps <-\n"); -#endif - - return TRUE; -} - -static int readMpegProc(char *str, int decoder) -{ - int val = -1; - char tmp[64]; - sprintf(tmp, "/proc/stb/vmpeg/%d/%s", decoder, str); - FILE *f = fopen(tmp, "r"); - if (f) - { - fscanf(f, "%x", &val); - fclose(f); - } - return val; -} - -static int readApiSize(int fd, int *xres, int *yres, int *aspect) -{ - video_size_t size; - if (!ioctl(fd, VIDEO_GET_SIZE, &size)) - { - *xres = size.w; - *yres = size.h; - *aspect = size.aspect_ratio == 0 ? 2 : 3; // convert dvb api to etsi - return 0; - } - return -1; -} - -static int readApiFrameRate(int fd, int *framerate) -{ - unsigned int frate; - if (!ioctl(fd, VIDEO_GET_FRAME_RATE, &frate)) - { - *framerate = frate; - return 0; - } - return -1; -} - -static gboolean -gst_dvbvideosink_start (GstBaseSink * basesink) -{ - GstDVBVideoSink *self = GST_DVBVIDEOSINK (basesink); - gint control_sock[2]; - - GST_DEBUG_OBJECT (self, "start"); - - - if (socketpair(PF_UNIX, SOCK_STREAM, 0, control_sock) < 0) { - perror("socketpair"); - goto socket_pair; - } - - READ_SOCKET (self) = control_sock[0]; - WRITE_SOCKET (self) = control_sock[1]; - - fcntl (READ_SOCKET (self), F_SETFL, O_NONBLOCK); - fcntl (WRITE_SOCKET (self), F_SETFL, O_NONBLOCK); - - return TRUE; - /* ERRORS */ -socket_pair: - { - GST_ELEMENT_ERROR (self, RESOURCE, OPEN_READ_WRITE, (NULL), - GST_ERROR_SYSTEM); - return FALSE; - } -} - -static gboolean -gst_dvbvideosink_stop (GstBaseSink * basesink) -{ - GstDVBVideoSink *self = GST_DVBVIDEOSINK (basesink); - FILE *f = fopen("/proc/stb/vmpeg/0/fallback_framerate", "w"); - GST_DEBUG_OBJECT (self, "stop"); - if (self->fd >= 0) - { - if (self->dec_running) { - ioctl(self->fd, VIDEO_STOP); - self->dec_running = FALSE; - } - ioctl(self->fd, VIDEO_SLOWMOTION, 0); - ioctl(self->fd, VIDEO_FAST_FORWARD, 0); - ioctl(self->fd, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_DEMUX); - close(self->fd); - } - - if (self->codec_data) - gst_buffer_unref(self->codec_data); - - if (self->h264_buffer) - gst_buffer_unref(self->h264_buffer); - - - while(self->queue) - queue_pop(&self->queue); - - if (f) { - fputs(self->saved_fallback_framerate, f); - fclose(f); - } - - close (READ_SOCKET (self)); - close (WRITE_SOCKET (self)); - READ_SOCKET (self) = -1; - WRITE_SOCKET (self) = -1; - - return TRUE; -} - -static GstStateChangeReturn -gst_dvbvideosink_change_state (GstElement * element, GstStateChange transition) -{ - GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS; - GstDVBVideoSink *self = GST_DVBVIDEOSINK (element); - - switch (transition) { - case GST_STATE_CHANGE_NULL_TO_READY: - GST_DEBUG_OBJECT (self,"GST_STATE_CHANGE_NULL_TO_READY"); - break; - case GST_STATE_CHANGE_READY_TO_PAUSED: - GST_DEBUG_OBJECT (self,"GST_STATE_CHANGE_READY_TO_PAUSED"); - - self->fd = open("/dev/dvb/adapter0/video0", O_RDWR|O_NONBLOCK); -// self->fd = open("/dump.pes", O_RDWR|O_CREAT|O_TRUNC, 0555); - - GST_OBJECT_LOCK(self); - self->no_write |= 4; - GST_OBJECT_UNLOCK(self); - - if (self->fd >= 0) { - GstStructure *s = 0; - GstMessage *msg = 0; - int aspect = -1, width = -1, height = -1, framerate = -1, - progressive = readMpegProc("progressive", 0); - - if (readApiSize(self->fd, &width, &height, &aspect) == -1) { - aspect = readMpegProc("aspect", 0); - width = readMpegProc("xres", 0); - height = readMpegProc("yres", 0); - } else - aspect = aspect == 0 ? 2 : 3; // dvb api to etsi - if (readApiFrameRate(self->fd, &framerate) == -1) - framerate = readMpegProc("framerate", 0); - - s = gst_structure_new ("eventSizeAvail", - "aspect_ratio", G_TYPE_INT, aspect == 0 ? 2 : 3, - "width", G_TYPE_INT, width, - "height", G_TYPE_INT, height, NULL); - msg = gst_message_new_element (GST_OBJECT (element), s); - gst_element_post_message (GST_ELEMENT (element), msg); - s = gst_structure_new ("eventFrameRateAvail", - "frame_rate", G_TYPE_INT, framerate, NULL); - msg = gst_message_new_element (GST_OBJECT (element), s); - gst_element_post_message (GST_ELEMENT (element), msg); - s = gst_structure_new ("eventProgressiveAvail", - "progressive", G_TYPE_INT, progressive, NULL); - msg = gst_message_new_element (GST_OBJECT (element), s); - gst_element_post_message (GST_ELEMENT (element), msg); - ioctl(self->fd, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_MEMORY); - ioctl(self->fd, VIDEO_FREEZE); - } - break; - case GST_STATE_CHANGE_PAUSED_TO_PLAYING: - GST_DEBUG_OBJECT (self,"GST_STATE_CHANGE_PAUSED_TO_PLAYING"); - ioctl(self->fd, VIDEO_CONTINUE); - GST_OBJECT_LOCK(self); - self->no_write &= ~4; - GST_OBJECT_UNLOCK(self); - break; - default: - break; - } - - ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); - - switch (transition) { - case GST_STATE_CHANGE_PLAYING_TO_PAUSED: - GST_DEBUG_OBJECT (self,"GST_STATE_CHANGE_PLAYING_TO_PAUSED"); - GST_OBJECT_LOCK(self); - self->no_write |= 4; - GST_OBJECT_UNLOCK(self); - ioctl(self->fd, VIDEO_FREEZE); - SEND_COMMAND (self, CONTROL_STOP); - break; - case GST_STATE_CHANGE_PAUSED_TO_READY: - GST_DEBUG_OBJECT (self,"GST_STATE_CHANGE_PAUSED_TO_READY"); - break; - case GST_STATE_CHANGE_READY_TO_NULL: - GST_DEBUG_OBJECT (self,"GST_STATE_CHANGE_READY_TO_NULL"); - break; - default: - break; - } - - return ret; -} - -/* entry point to initialize the plug-in - * initialize the plug-in itself - * register the element factories and pad templates - * register the features - * - * exchange the string 'plugin' with your elemnt name - */ -static gboolean -plugin_init (GstPlugin *plugin) -{ - return gst_element_register (plugin, "dvbvideosink", - GST_RANK_PRIMARY, - GST_TYPE_DVBVIDEOSINK); -} - -/* this is the structure that gstreamer looks for to register plugins - * - * exchange the strings 'plugin' and 'Template plugin' with you plugin name and - * description - */ -GST_PLUGIN_DEFINE ( - GST_VERSION_MAJOR, - GST_VERSION_MINOR, - "dvb_video_out", - "DVB Video Output", - plugin_init, - VERSION, - "LGPL", - "GStreamer", - "http://gstreamer.net/" -) diff --git a/libs/gst-plugins-dvbmediasink-0.10.1/src/gstdvbvideosink.h b/libs/gst-plugins-dvbmediasink-0.10.1/src/gstdvbvideosink.h deleted file mode 100644 index 471aa07..0000000 --- a/libs/gst-plugins-dvbmediasink-0.10.1/src/gstdvbvideosink.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * GStreamer DVB Media Sink - * Copyright 2006 Felix Domke - * based on code by: - * Copyright 2005 Thomas Vander Stichele - * Copyright 2005 Ronald S. Bultje - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Alternatively, the contents of this file may be used under the - * GNU Lesser General Public License Version 2.1 (the "LGPL"), in - * which case the following provisions apply instead of the ones - * mentioned above: - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __GST_DVBVIDEOSINK_H__ -#define __GST_DVBVIDEOSINK_H__ - -#define PACK_UNPACKED_XVID_DIVX5_BITSTREAM - -#include -#include - -G_BEGIN_DECLS - -/* #defines don't like whitespacey bits */ -#define GST_TYPE_DVBVIDEOSINK \ - (gst_dvbvideosink_get_type()) -#define GST_DVBVIDEOSINK(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DVBVIDEOSINK,GstDVBVideoSink)) -#define GST_DVBVIDEOSINK_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DVBVIDEOSINK,GstDVBVideoSinkClass)) -#define GST_IS_DVBVIDEOSINK(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DVBVIDEOSINK)) -#define GST_IS_DVBVIDEOSINK_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DVBVIDEOSINK)) - -typedef struct _GstDVBVideoSink GstDVBVideoSink; -typedef struct _GstDVBVideoSinkClass GstDVBVideoSinkClass; -typedef struct _GstDVBVideoSinkPrivate GstDVBVideoSinkPrivate; - -typedef struct queue_entry -{ - struct queue_entry *next; - size_t bytes; - size_t offset; -} queue_entry_t; - -struct _GstDVBVideoSink -{ - GstBaseSink element; - gboolean use_set_encoding; - - gint control_sock[2]; - - gint must_send_header; - - gboolean initial_header; - guint8 *initial_header_private_data; - guint32 initial_header_private_data_size; - - guint8 *runtime_header_data; - guint32 runtime_header_data_size; - - GstBuffer *h264_buffer; - gint h264_nal_len_size; - - GstBuffer *codec_data; - -#ifdef PACK_UNPACKED_XVID_DIVX5_BITSTREAM - /* data needed to pack bitstream (divx5 / xvid) */ - gint num_non_keyframes, must_pack_bitstream, time_inc_bits, time_inc; - GstBuffer *prev_frame; -#endif - - char saved_fallback_framerate[16]; - - int fd; - gboolean dec_running; - - int streamtype; - - int no_write; - - queue_entry_t *queue; -}; - -struct _GstDVBVideoSinkClass -{ - GstBaseSinkClass parent_class; - gint64 (*get_decoder_time) (GstDVBVideoSink *sink); -}; - -GType gst_dvbvideosink_get_type (void); - -G_END_DECLS - -#endif /* __GST_DVBVIDEOSINK_H__ */ diff --git a/libs/libstgles/.gitignore b/libs/libstgles/.gitignore deleted file mode 100644 index b46e405..0000000 --- a/libs/libstgles/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -Makefile -depcomp -install-sh diff --git a/libs/libstgles/AUTHORS b/libs/libstgles/AUTHORS deleted file mode 100644 index e69de29..0000000 diff --git a/libs/libstgles/ChangeLog b/libs/libstgles/ChangeLog deleted file mode 100644 index e69de29..0000000 diff --git a/libs/libstgles/Makefile.am b/libs/libstgles/Makefile.am deleted file mode 100644 index d7ce63b..0000000 --- a/libs/libstgles/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -lib_LTLIBRARIES = libstgles.la - -AM_CFLAGS = -Wall -g0 -Os -ftracer -fomit-frame-pointer -fvisibility=hidden -ldirectfb \ - -Iincludes \ - -Iincludes/EGL \ - -Iincludes/GLES \ - -I../../../tufsbox/cdkroot/usr/include \ - -I../../../tufsbox/cdkroot/usr/include/directfb - - -libstgles_la_SOURCES = \ - api/eglcore.c \ - api/glcore.c - -libstgles_la_LIBADD = -lpthread -lm -lc -lpthread -lrt - -libstgles_la_egldir = $(includedir)/EGL -libstgles_la_egl_HEADERS = \ - includes/EGL/egl.h \ - includes/EGL/eglext.h \ - includes/EGL/eglplatform.h - - -libstgles_la_glesdir = $(includedir)/GLES -libstgles_la_gles_HEADERS = \ - includes/GLES/gl.h \ - includes/GLES/glext.h \ - includes/GLES/glplatform.h - -libstgles_la_pkgconfigdir = $(libdir)/pkgconfig -libstgles_la_pkgconfig_DATA = libstgles.pc diff --git a/libs/libstgles/NEWS b/libs/libstgles/NEWS deleted file mode 100644 index e69de29..0000000 diff --git a/libs/libstgles/README b/libs/libstgles/README deleted file mode 100644 index e69de29..0000000 diff --git a/libs/libstgles/api/common.h b/libs/libstgles/api/common.h deleted file mode 100644 index 9957bd8..0000000 --- a/libs/libstgles/api/common.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _COMMON_H -#define _COMMON_H - -//#define DEBUG -//#define DRAWDEBUG - -#define MAINWINDOW_WIDTH 1280 -#define MAINWINDOW_HEIGHT 720 - -#define DFBCHECK(x...) \ - { \ - DFBResult err = x; \ - \ - if (err != DFB_OK) \ - { \ - fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \ - DirectFBErrorFatal( #x, err ); \ - } \ - } - -#endif diff --git a/libs/libstgles/api/eglcore.c b/libs/libstgles/api/eglcore.c deleted file mode 100644 index 251055b..0000000 --- a/libs/libstgles/api/eglcore.c +++ /dev/null @@ -1,309 +0,0 @@ - -#include -#include -#include - -#include - -#include "common.h" - -//-------------------------------------------------------------------------------------------------- - - - -//-------------------------------------------------------------------------------------------------- - -IDirectFB *m_dfb = NULL; -static IDirectFBDisplayLayer *m_displaylayer; -static IDirectFBScreen *m_screen; - -IDirectFBSurface *m_mainwindow; - - -static EGLBoolean m_vsync = EGL_FALSE; - -//-------------------------------------------------------------------------------------------------- - -EGLDisplay -eglGetDisplay (int display_id) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - return (EGLDisplay)1; -} - -EGLBoolean -eglInitialize (EGLDisplay dpy, - EGLint *major, - EGLint *minor) -{ - int argc = 0; - char**argv = NULL; - -#ifdef DEBUG - unsigned long vsync = 0; - int screen_width, screen_height; -#endif - -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - - DFBCHECK(DirectFBInit(&argc, &argv)); - DFBCHECK(DirectFBCreate(&m_dfb)); - - DFBCHECK (m_dfb->SetCooperativeLevel(m_dfb, DFSCL_FULLSCREEN)); - - /* Screen */ - DFBCHECK(m_dfb->GetScreen (m_dfb, DSCID_PRIMARY, &m_screen)); -#ifdef DEBUG - DFBCHECK(m_screen->GetSize(m_screen, &screen_width, &screen_height)); - printf("Screen Size: %dx%d\n", screen_width, screen_height); - DFBCHECK(m_screen->GetVSyncCount (m_screen, &vsync)); - printf("Screen Vsync: %lu\n", vsync); -#endif - - /* DisplayLayer */ - DFBCHECK (m_dfb->GetDisplayLayer(m_dfb, DLID_PRIMARY, &m_displaylayer)); -#ifdef DEBUG - DFBDisplayLayerDescription dlc; - m_displaylayer->GetDescription(m_displaylayer, &dlc); - if ((dlc.caps & DLCAPS_SCREEN_SIZE) == DLCAPS_SCREEN_SIZE) - printf("SCREEN_SIZE\n"); - else - printf("NO SCREEN_SIZE!!!\n"); -#endif - - - - return EGL_TRUE; -} - - -EGLBoolean -eglChooseConfig (EGLDisplay dpy, - const EGLint *attrib_list, - EGLConfig *configs, - EGLint config_size, - EGLint *num_config) -{ - EGLBoolean ret = EGL_FALSE; - -#ifdef DEBUG - printf("%s:%s[%d] ->\n", __FILE__, __func__, __LINE__); -#endif - - if (configs == NULL && config_size == 0) - { - *num_config = 1; - ret = EGL_TRUE; - } - else - { - configs[0] = (EGLConfig)1; - *num_config = 1; - ret = EGL_TRUE; - } -#ifdef DEBUG - printf("%s:%s[%d] <- ret=%d\n", __FILE__, __func__, __LINE__, ret); -#endif - - return ret; -} - - -EGLSurface -eglCreateWindowSurface (EGLDisplay dpy, - EGLConfig config, - NativeWindowType win, - const EGLint *attrib_list) -{ - EGLSurface ret; - -#ifdef DEBUG - int mainwindow_width, mainwindow_height; -#endif - -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - - /* Surface */ - DFBSurfaceDescription dsc; - dsc.flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_CAPS; - dsc.caps = DSCAPS_PRIMARY | DSCAPS_FLIPPING; - dsc.width = MAINWINDOW_WIDTH; - dsc.height = MAINWINDOW_HEIGHT; - DFBCHECK (m_dfb->CreateSurface(m_dfb, &dsc, &m_mainwindow)); - - ret = (EGLSurface)1; - -#ifdef DEBUG - DFBCHECK (m_mainwindow->GetSize (m_mainwindow, &mainwindow_width, &mainwindow_height)); - printf("MainWindow Size: %dx%d\n", mainwindow_width, mainwindow_height); -#endif - - return ret; -} - - -EGLBoolean -eglBindAPI (EGLenum api) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - - if (api == EGL_OPENGL_ES_API) - return EGL_TRUE; - return EGL_FALSE; -} - - -EGLContext -eglCreateContext (EGLDisplay dpy, - EGLConfig config, - EGLContext share_context, - const EGLint *attrib_list) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - - return (EGLContext)1; -} - - -EGLBoolean -eglMakeCurrent (EGLDisplay dpy, - EGLSurface draw, - EGLSurface read, - EGLContext ctx) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - - return EGL_TRUE; -} - -EGLBoolean -eglSwapInterval (EGLDisplay dpy, - EGLint interval) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - - if (interval > 0) m_vsync = EGL_TRUE; - else m_vsync = EGL_FALSE; - - // We do not care as we dont render video - return EGL_TRUE; -} - -EGLBoolean -eglSwapBuffers (EGLDisplay dpy, - EGLSurface surface) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - - //DFBSurfaceFlipFlags flags; - - DFBCHECK (m_mainwindow->Flip (m_mainwindow, NULL, m_vsync==EGL_TRUE?DSFLIP_WAITFORSYNC:0)); - return EGL_TRUE; -} - -const char * -eglQueryString(EGLDisplay dpy, EGLint name) -{ - char * string; - -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - - switch(name) - { - case EGL_VENDOR: return "Unknown"; //string = strdup("Unknown"); break; - case EGL_VERSION: return "1.4"; //string = strdup("1.4"); break; - case EGL_EXTENSIONS: return ""; //string = strdup(""); break; - case EGL_CLIENT_APIS: return ""; //tring = strdup(""); break; - default: return ""; //string = strdup(""); break; - } - return string; -} - -EGLBoolean -eglDestroyContext (EGLDisplay dpy, - EGLContext ctx) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - - return EGL_TRUE; -} - -EGLBoolean -eglDestroySurface (EGLDisplay dpy, - EGLSurface surface) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - - m_mainwindow->Release(m_mainwindow); - - return EGL_TRUE; -} - -EGLBoolean -eglTerminate (EGLDisplay dpy) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - m_displaylayer->Release(m_displaylayer); - m_screen->Release(m_screen); - m_dfb->Release(m_dfb); - - return EGL_TRUE; -} - -EGLBoolean -eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - if (attribute == EGL_WIDTH) *value = 1280; - else if (attribute == EGL_HEIGHT) *value = 720; - else return EGL_FALSE; - - return EGL_TRUE; -} - -EGLint -eglGetError(void) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - return EGL_SUCCESS; -} - -EGLBoolean -eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - return EGL_FALSE; -} - - - diff --git a/libs/libstgles/api/glcore.c b/libs/libstgles/api/glcore.c deleted file mode 100644 index a051455..0000000 --- a/libs/libstgles/api/glcore.c +++ /dev/null @@ -1,631 +0,0 @@ - -#include -#include -#include - - -#include -#include - -#include "common.h" - -#define GL_BLEND_BIT (1<<1) -#define GL_TEXTURE_2D_BIT (1<<2) - -static unsigned char m_color_clear_r = 0; -static unsigned char m_color_clear_g = 0; -static unsigned char m_color_clear_b = 0; -static unsigned char m_color_clear_a = 0; - -extern IDirectFB *m_dfb; -extern IDirectFBSurface *m_mainwindow; - -typedef struct { - void *addr; - /* unsigned */ int pitch; -} CoreSurfaceBufferLock; - -typedef struct { -IDirectFBSurface *surface; -//EGLDisplay display; -} EGLTexture; - -static EGLTexture egl_textures[256]; -static int texturesCurrent = 0; -static unsigned int texturesActive = GL_TEXTURE0; - -static int m_bound_texture; -static unsigned int m_drawflags = 0; - -GLvoid *g_glColorPointer = NULL; -GLsizei g_glColorPointerStride = 0; -GLint g_glColorPointerSize = 0; -GLenum g_glColorPointerType = 0; -GLint g_glColorPointerEnabled = 0; - -GLvoid *g_glTexCoordPointer = NULL; -GLsizei g_glTexCoordPointerStride = 0; -GLint g_glTexCoordPointerSize = 0; -GLenum g_glTexCoordPointerType = 0; -GLint g_glTexCoordPointerEnabled = 0; - -GLvoid *g_glVertexPointer = NULL; -GLsizei g_glVertexPointerStride = 0; -GLint g_glVertexPointerSize = 0; -GLenum g_glVertexPointerType = 0; -GLint g_glVertexPointerEnabled = 0; - -void glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ -#ifdef DEBUG - printf("%s:%s[%d] size=%d stride=%u \n", __FILE__, __func__, __LINE__, size, stride); -#endif - g_glColorPointerSize = size; - g_glColorPointerType = type; - if(stride) - g_glColorPointerStride = stride; - else - g_glColorPointerStride = size * sizeof(unsigned char); - g_glColorPointer = pointer; -} - -void glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ -#ifdef DEBUG - printf("%s:%s[%d] size=%d stride=%u \n", __FILE__, __func__, __LINE__, size, stride); -#endif - g_glTexCoordPointerSize = size; - g_glTexCoordPointerType = type; - if(stride) - g_glTexCoordPointerStride = stride; - else - g_glTexCoordPointerStride = size * sizeof(GLfloat); - g_glTexCoordPointer = pointer; -} - -void glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) -{ -#ifdef DEBUG - printf("%s:%s[%d] size=%d stride=%u \n", __FILE__, __func__, __LINE__, size, stride); -#endif - g_glVertexPointerSize = size; - g_glVertexPointerType = type; - if(stride) - g_glVertexPointerStride = stride; - else - g_glVertexPointerStride = size * sizeof(GLfloat); - g_glVertexPointer = pointer; -} - -void glEnableClientState(GLenum array) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - switch(array) - { - case GL_COLOR_ARRAY: g_glColorPointerEnabled = 1; break; - case GL_TEXTURE_COORD_ARRAY: g_glTexCoordPointerEnabled = 1; break; - case GL_VERTEX_ARRAY: g_glVertexPointerEnabled = 1; break; - default: break; - } -} -void glDisableClientState(GLenum array) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - switch(array) - { - case GL_COLOR_ARRAY: g_glColorPointerEnabled = 0; break; - case GL_TEXTURE_COORD_ARRAY: g_glTexCoordPointerEnabled = 0; break; - case GL_VERTEX_ARRAY: g_glVertexPointerEnabled = 0; break; - default: break; - } -} - - - - - -void glGenTextures (GLsizei n, GLuint *textures) -{ - texturesCurrent++; - texturesCurrent %= 256; - if (texturesCurrent == 0) - texturesCurrent++; /* 0 is reserved*/ - - while(1) - { - if (egl_textures[texturesCurrent].surface == NULL) - break; - - texturesCurrent++; - texturesCurrent %= 256; - if (texturesCurrent == 0) - texturesCurrent++; /* 0 is reserved*/ - } - *textures = texturesCurrent; -#ifdef DEBUG - printf("%s:%s[%d] n=%d texture=%d\n", __FILE__, __func__, __LINE__, n, *textures); -#endif -} - -void glDeleteTextures (GLsizei n, GLuint *textures) -{ -#ifdef DEBUG - printf("%s:%s[%d] -> n=%d texture=%d p=%p\n", __FILE__, __func__, __LINE__, n, *textures, (void*)egl_textures[*textures].surface ); -#endif - - if (egl_textures[*textures].surface == NULL) return; - - egl_textures[*textures].surface->Release(egl_textures[*textures].surface); - - egl_textures[*textures].surface = NULL; -#ifdef DEBUG - printf("%s:%s[%d] <-\n", __FILE__, __func__, __LINE__); -#endif - //*textures = 0; -} - -void glBindTexture (GLenum target, GLuint texture) -{ -#ifdef DEBUG - printf("%s:%s[%d] ---------------- texture=%d (%p)\n", __FILE__, __func__, __LINE__, texture, egl_textures[texture].surface); -#endif - //if (target == GL_TEXTURE_2D) - m_bound_texture = texture; -} - - -GLboolean glIsTexture (GLuint texture) { -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - return egl_textures[texture].surface == NULL?GL_FALSE:GL_TRUE; -} - -//Not implemented -void glTexParameteri (GLenum target, GLenum pname, GLint param) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - return; -} - -void glActiveTexture(GLenum texture) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - texturesActive = texture; -} - - -EGLint g_pixelformat = -1; - -//Hardcore translateion -void glTexImage2D (GLenum target, GLint level, GLint internalformat, - GLsizei width, GLsizei height, GLint border, GLenum format, - GLenum type, const GLvoid *pixels) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - - IDirectFBSurface * surface = NULL; - EGLSurface egl_surface = NULL; - DFBResult err = 0; - DFBSurfaceDescription dsc; - CoreSurfaceBufferLock lock; - - dsc.flags = (DFBSurfaceDescriptionFlags) (DSDESC_WIDTH | DSDESC_HEIGHT | - DSDESC_PIXELFORMAT | DSDESC_CAPS); - dsc.caps = DSCAPS_PREMULTIPLIED; - dsc.width = width; - dsc.height = height; - - dsc.pixelformat = DSPF_ARGB; - - m_dfb->CreateSurface( - m_dfb, - &dsc, - &surface); - -#if 0 - surface->Lock (surface, DSLF_WRITE, &lock.addr, &lock.pitch); - memcpy(lock.addr, pixels, width*height*4); - surface->Unlock (surface); -#else - DFBRectangle rect; - rect.x = 0; - rect.y = 0; - rect.w = width; - rect.h = height; - - surface->Write(surface, &rect, pixels, 4*width); -#endif - egl_textures[m_bound_texture].surface = surface; - -#ifdef DEBUG - printf("%s:%s[%d] ---------------- texture=%d (%p)\n", __FILE__, __func__, __LINE__, texturesCurrent, egl_textures[texturesCurrent].surface); -#endif -} - -void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, - GLint yoffset, GLsizei width, GLsizei height, - GLenum format, GLenum type, const GLvoid * pixels) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - glTexImage2D(target, level, 0, width, height, 0, format, type, pixels); - -} - - -void glDrawArrays(GLenum mode, GLint first, GLsizei count) -{ - int i, j; - -#ifdef DEBUG - printf("%s:%s[%d] ---------------------------------\n", __FILE__, __func__, __LINE__); - printf("%s:%s[%d] first=%d count=%u\n", __FILE__, __func__, __LINE__, first, count); -#endif - - if ((m_drawflags & GL_BLEND_BIT) == GL_BLEND_BIT) - m_mainwindow->SetPorterDuff (m_mainwindow, DSPD_SRC_OVER); - - if (mode == GL_QUADS) - { - /* - | [1] [3] - | [0] [2] - |_______ - */ - - if (!count) return; - - if(g_glVertexPointerEnabled == 0) return; - - unsigned char *glColorPointerItr = g_glColorPointer; - GLfloat *glVertexPointerItr = g_glVertexPointer; - GLfloat *glTexCoordPointerItr = g_glTexCoordPointer; - DFBSurfaceBlittingFlags dsbf; - unsigned char r=0, g=0, b=0, a=0; - - for (i=first/*0*/; i < count; i+=4 /*4 Coordinates*/) - { - dsbf = DSBLIT_BLEND_ALPHACHANNEL; - - //COLOR TODO: OTHER FORMATS AS U8 - if (g_glColorPointerEnabled) - { -#ifdef DEBUG - printf("\t[%d] r=%u g=%u b=%u a=%u\n", i, glColorPointerItr[0], glColorPointerItr[1], - glColorPointerItr[2], glColorPointerItr[3]); -#endif - r = glColorPointerItr[0]; - g = glColorPointerItr[1]; - b = glColorPointerItr[2]; - a = glColorPointerItr[3]; - - if ((m_drawflags & GL_BLEND_BIT) == GL_BLEND_BIT) - { - if (a != 0xff) - dsbf |= DSBLIT_BLEND_COLORALPHA; - } - else - dsbf = DSBLIT_NOFX; - - if (r != 0xff || g != 0xff || - b != 0xff || a != 0xff) - dsbf |= DSBLIT_COLORIZE; - - if ((dsbf & DSBLIT_BLEND_COLORALPHA) == DSBLIT_BLEND_COLORALPHA || (dsbf & DSBLIT_COLORIZE) == DSBLIT_COLORIZE) - m_mainwindow->SetColor (m_mainwindow, r, g, b, a); - -#ifdef DEBUG - glColorPointerItr += g_glColorPointerStride; - - printf("\t[%d] r=%u g=%u b=%u a=%u\n", i+1, glColorPointerItr[0], glColorPointerItr[1], - glColorPointerItr[2], glColorPointerItr[3]); - glColorPointerItr += g_glColorPointerStride; - - printf("\t[%d] r=%u g=%u b=%u a=%u\n", i+2, glColorPointerItr[0], glColorPointerItr[1], - glColorPointerItr[2], glColorPointerItr[3]); - glColorPointerItr += g_glColorPointerStride; - - printf("\t[%d] r=%u g=%u b=%u a=%u\n", i+3, glColorPointerItr[0], glColorPointerItr[1], - glColorPointerItr[2], glColorPointerItr[3]); - glColorPointerItr += g_glColorPointerStride; -#else - glColorPointerItr += 4 * g_glColorPointerStride; -#endif - } - - - //POSITIONS TODO: OTHER FORMATS AS FLOAT - /* LEGACY - GLfloat points[] = { -640.0f+glVertexPointerItr[i].x, -(-360.0f+m_vertex[i+1].y), 0.0f, - -640.0f+glVertexPointerItr[i+2].x, -(-360.0f+m_vertex[i+3].y), 0.0f, - -640.0f+glVertexPointerItr[i+3].x, -(-360.0f+m_vertex[i+2].y), 0.0f, - -640.0f+glVertexPointerItr[i+1].x, -(-360.0f+m_vertex[i+0].y), 0.0f }; - */ - - GLfloat points[12]; - memset(points, 0, 12*sizeof(GLfloat)); - -#ifdef DEBUG - printf("\t[%d] x=%f y=%f z=%f\n", i, glVertexPointerItr[0], glVertexPointerItr[1], - glVertexPointerItr[2]); -#endif - points[ 0] = glVertexPointerItr[0]/*x*/; - points[10] = glVertexPointerItr[1]/*y*/; - glVertexPointerItr = ((unsigned char*)glVertexPointerItr) + g_glVertexPointerStride; - -#ifdef DEBUG - printf("\t[%d] x=%f y=%f z=%f\n", i+1, glVertexPointerItr[0], glVertexPointerItr[1], - glVertexPointerItr[2]); -#endif - points[ 1] = glVertexPointerItr[1]/*y*/; - points[ 9] = glVertexPointerItr[0]/*x*/; - glVertexPointerItr = ((unsigned char*)glVertexPointerItr) + g_glVertexPointerStride; - -#ifdef DEBUG - printf("\t[%d] x=%f y=%f z=%f\n", i+2, glVertexPointerItr[0], glVertexPointerItr[1], - glVertexPointerItr[2]); -#endif - points[ 3] = glVertexPointerItr[0]/*x*/; - points[ 7] = glVertexPointerItr[1]/*y*/; - glVertexPointerItr = ((unsigned char*)glVertexPointerItr) + g_glVertexPointerStride; - -#ifdef DEBUG - printf("\t[%d] x=%f y=%f z=%f\n", i+3, glVertexPointerItr[0], glVertexPointerItr[1], - glVertexPointerItr[2]); -#endif - points[ 4] = glVertexPointerItr[1]/*y*/; - points[ 6] = glVertexPointerItr[0]/*x*/; - glVertexPointerItr = ((unsigned char*)glVertexPointerItr) + g_glVertexPointerStride; - - -#ifdef DRAWDEBUG - for (j=0; j<12; j+=3) - printf("\t\t[%d] x=%f y=%f z=%f\n", j/3, points[j], points[j+1], points[j+2]); -#endif - - DFBRectangle dstRectangle; - dstRectangle.w = points[6] - points[0]; - dstRectangle.h = -(points[7] - points[1]); - dstRectangle.x = points[0]; - dstRectangle.y = points[7]; - - DFBRectangle srcRectangle; - int w, h; - egl_textures[m_bound_texture].surface->GetSize(egl_textures[m_bound_texture].surface, &w, &h); - - if (g_glTexCoordPointerEnabled) - { -#define MIRROR -#ifdef MIRROR - GLfloat x1, y1, x2, y2; - - x1 = glTexCoordPointerItr[0]; - y1 = glTexCoordPointerItr[1]; - - glTexCoordPointerItr = ((unsigned char*)glTexCoordPointerItr) + 3* g_glTexCoordPointerStride; - - x2 = glTexCoordPointerItr[0]; - y2 = glTexCoordPointerItr[1]; - - glTexCoordPointerItr = ((unsigned char*)glTexCoordPointerItr) + g_glTexCoordPointerStride; - - if (x1 <= x2) { - srcRectangle.x = x1 * w; - srcRectangle.w = x2 * w - srcRectangle.x; - } - else { - srcRectangle.x = x2 * w; - srcRectangle.w = x1 * w - srcRectangle.x; - dsbf |= DSBLIT_FLIP_HORIZONTAL; - } - - if (y1 <= y2) { - srcRectangle.y = y1 * h; - srcRectangle.h = y2 * h - srcRectangle.y; - } - else { - srcRectangle.y = y2 * h; - srcRectangle.h = y1 * h - srcRectangle.y; - dsbf |= DSBLIT_FLIP_VERTICAL; - } - -#else - srcRectangle.x = glTexCoordPointerItr[0] * w; - srcRectangle.y = glTexCoordPointerItr[1] * h; - - glTexCoordPointerItr = ((unsigned char*)glTexCoordPointerItr) + 3* g_glTexCoordPointerStride; - - srcRectangle.w = glTexCoordPointerItr[0] * w - srcRectangle.x; - srcRectangle.h = glTexCoordPointerItr[1] * h - srcRectangle.y; - glTexCoordPointerItr = ((unsigned char*)glTexCoordPointerItr) + g_glTexCoordPointerStride; -#endif - } - else - { - srcRectangle.x = 0; - srcRectangle.y = 0; - srcRectangle.w = w; - srcRectangle.h = h; - } - - //DRAW -#ifdef DRAWDEBUG - printf("StrechBlit %d,%d:%d,%d -> %d,%d:%d,%d\n", srcRectangle.x, srcRectangle.y, srcRectangle.w, srcRectangle.h, - dstRectangle.x, dstRectangle.y, dstRectangle.w, dstRectangle.h); -#endif - //if (g_glColorPointerEnabled) m_mainwindow->FillRectangle (m_mainwindow, dstRectangle.x, dstRectangle.y, dstRectangle.w, dstRectangle.h); - - m_mainwindow->SetBlittingFlags(m_mainwindow, dsbf); - - if ((m_drawflags & GL_BLEND_BIT) == GL_BLEND_BIT) - m_mainwindow->SetDrawingFlags(m_mainwindow, DSDRAW_BLEND); - else - m_mainwindow->SetDrawingFlags(m_mainwindow, DSDRAW_NOFX); - - //m_mainwindow->SetColor (m_mainwindow, r, g, b, a); - -#if DEBUG - if (dsbf != DSBLIT_NOFX) - printf("StrechBlit %d,%d:%d,%d -> %d,%d:%d,%d\n", srcRectangle.x, srcRectangle.y, srcRectangle.w, srcRectangle.h, - dstRectangle.x, dstRectangle.y, dstRectangle.w, dstRectangle.h); -#endif - - m_mainwindow->StretchBlit(m_mainwindow, egl_textures[m_bound_texture].surface, &srcRectangle, &dstRectangle); - } - } -} - - -void glClearColor (GLclampf red,GLclampf green, GLclampf blue, GLclampf alpha) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - - m_color_clear_r = (unsigned char)(255.0 * red); - m_color_clear_g = (unsigned char)(255.0 * green); - m_color_clear_b = (unsigned char)(255.0 * blue); - m_color_clear_a = (unsigned char)(255.0 * alpha); -} - -void glClear (GLbitfield mask) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - - DFBCHECK (m_mainwindow->SetColor (m_mainwindow, m_color_clear_r, m_color_clear_g - , m_color_clear_b, m_color_clear_a)); - - m_mainwindow->SetDrawingFlags(m_mainwindow, DSDRAW_NOFX); - - DFBCHECK (m_mainwindow->FillRectangle (m_mainwindow, 0, 0, MAINWINDOW_WIDTH, MAINWINDOW_HEIGHT)); -} - -/* Core */ -void glEnable(GLenum cap) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - - switch(cap) - { - case GL_BLEND: m_drawflags |= GL_BLEND_BIT; break; - case GL_TEXTURE_2D: m_drawflags |= GL_TEXTURE_2D_BIT; break; - default: break; - } -} - -void glDisable(GLenum cap) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - - switch(cap) - { - case GL_BLEND: m_drawflags &= ~GL_BLEND_BIT; break; - case GL_TEXTURE_2D: m_drawflags &= ~GL_TEXTURE_2D_BIT; break; - default: break; - } -} - -void glFinish (void) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - eglSwapBuffers(NULL, NULL); -} - -/* Blending */ -void glBlendFunc (GLenum sfactor ,GLenum dfactor) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif -} - -void glScissor ( GLint x /* Specify the lower left corner of the scissor box, in pixels. The initial value is (0, 0).*/ - ,GLint y /* Specify the lower left corner of the scissor box, in pixels. The initial value is (0, 0).*/ - ,GLsizei width /* Specify the width of the scissor box. When a GL context is first attached to a surface (e.g. window), width and height are set to the dimensions of that surface. */ - , GLsizei height /* Specify the height of the scissor box. When a GL context is first attached to a surface (e.g. window), width and height are set to the dimensions of that surface. */ - - ) -{ -#ifdef DRAWDEBUG - printf("%s:%s[%d] %d %d %u %u\n", __FILE__, __func__, __LINE__, x, y, width, height); -#endif -} - - -void glPixelStorei( GLenum pname, GLint param) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif -} - -void glReadPixels (GLint x /*Specify the window coordinates of the first pixel that is read from the color buffer. This location is the lower left corner of a rectangular block of pixels.*/ - , GLint y/*Specify the window coordinates of the first pixel that is read from the color buffer. This location is the lower left corner of a rectangular block of pixels.*/ - , GLsizei width /*Specify the dimensions of the pixel rectangle. width of one correspond to a single pixel.*/ - , GLsizei height /* Specify the dimensions of the pixel rectangle. height of one correspond to a single pixel. */ - , GLenum format /*Specifies the format of the pixel data. Must be either GL_RGBA or GL_RGB. */ - , GLenum type /* Specifies the data type of the pixel data. Must be either GL_UNSIGNED_BYTE or GL_BYTE. */ - , GLvoid *pixels /* Returns the pixel data.*/ - ) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif -} - -void glViewport ( GLint x /* Specify the lower left corner of the viewport box, in pixels. The initial value is (0, 0).*/ - ,GLint y /* Specify the lower left corner of the viewport box, in pixels. The initial value is (0, 0).*/ - ,GLsizei width /* Specify the width of the viewport box. When a GL context is first attached to a surface (e.g. window), width and height are set to the dimensions of that surface. */ - ,GLsizei height /* Specify the height of the viewport box. When a GL context is first attached to a surface (e.g. window), width and height are set to the dimensions of that surface. */ - ) -{ -#ifdef DRAWDEBUG - printf("%s:%s[%d] %d,%d:%d,%d\n", __FILE__, __func__, __LINE__, x, y, width, height); -#endif -} - -/* Get */ -GLubyte * glGetString(GLenum name) -{ -#ifdef DEBUG - printf("%s:%s[%d]\n", __FILE__, __func__, __LINE__); -#endif - - GLubyte * ret; - switch(name) - { - case GL_VENDOR: return "Unknown Vendor"; //ret = (GLubyte *)strdup("Unknown Vendor"); break; - case GL_RENDERER: return "Unknown Render"; //ret = (GLubyte *)strdup("Unknown Render"); break; - case GL_VERSION: return "1.1"; //ret = (GLubyte *)strdup("1.1"); break; - case GL_EXTENSIONS: return "GL_EXT_texture_format_BGRA8888"; //ret = (GLubyte *)strdup("GL_EXT_texture_format_BGRA8888"); break; - default: return ""; //ret = (GLubyte *)strdup(""); break; - } - return ret; -} - -void glGetIntegerv(GLenum pname, GLint * params) -{ - *params = ""; -} - - diff --git a/libs/libstgles/configure.ac b/libs/libstgles/configure.ac deleted file mode 100644 index 77c471a..0000000 --- a/libs/libstgles/configure.ac +++ /dev/null @@ -1,12 +0,0 @@ -AC_INIT(libstgles,1-0,,libstgles-1.0) -AM_INIT_AUTOMAKE(libstgles,1.0) - -TUXBOX_APPS - -AC_PROG_CC -AC_PROG_CXX -AM_PROG_LIBTOOL - -AC_OUTPUT([ -Makefile -]) diff --git a/libs/libstgles/demo/dfbtest.c b/libs/libstgles/demo/dfbtest.c deleted file mode 100644 index 473d653..0000000 --- a/libs/libstgles/demo/dfbtest.c +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include -#include - -static IDirectFB *m_dfb = NULL; -static IDirectFBDisplayLayer *m_displaylayer; -static IDirectFBSurface *m_mainwindow; -static IDirectFBScreen *m_screen; - -#define DFBCHECK(x...) \ - { \ - DFBResult err = x; \ - \ - if (err != DFB_OK) \ - { \ - fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \ - DirectFBErrorFatal( #x, err ); \ - } \ - } - -#if 0 -DFBDisplayLayerCapabilities - DLCAPS_SCREEN_SIZE = 0x00200000, /* The layer size (defined by its source rectangle) - can be scaled to a different size on the screen - (defined by its screen/destination rectangle or - its normalized size) and does not have to be 1:1 - with it. */ -#endif - -int main(int argc, char *argv[]) -{ - unsigned long vsync = 0; - int screen_width, screen_height; - int mainwindow_width, mainwindow_height; - - DFBCHECK(DirectFBInit(&argc, &argv)); - DFBCHECK(DirectFBCreate(&m_dfb)); - - DFBCHECK (m_dfb->SetCooperativeLevel(m_dfb, DFSCL_FULLSCREEN)); - - /* Screen */ - DFBCHECK(m_dfb->GetScreen (m_dfb, DSCID_PRIMARY, &m_screen)); - DFBCHECK(m_screen->GetSize(m_screen, &screen_width, &screen_height)); - printf("Screen Size: %dx%d\n", screen_width, screen_height); - DFBCHECK(m_screen->GetVSyncCount (m_screen, &vsync)); - printf("Screen Vsync: %u\n", vsync); - - /* DisplayLayer */ - DFBCHECK (m_dfb->GetDisplayLayer(m_dfb, DLID_PRIMARY, &m_displaylayer)); - - DFBDisplayLayerDescription dlc; - m_displaylayer->GetDescription(m_displaylayer, &dlc); - if (dlc.caps & DLCAPS_SCREEN_SIZE == DLCAPS_SCREEN_SIZE) - printf("SCREEN_SIZE\n"); - else - printf("NO SCREEN_SIZE!!!\n"); - - /* Surface */ - DFBSurfaceDescription dsc; - dsc.flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_CAPS; - dsc.caps = (DFBSurfaceCapabilities) (DSCAPS_PRIMARY | DSCAPS_FLIPPING); - dsc.width = 1280; - dsc.height = 720; - DFBCHECK (m_dfb->CreateSurface(m_dfb, &dsc, &m_mainwindow)); - - DFBCHECK (m_mainwindow->GetSize (m_mainwindow, &mainwindow_width, &mainwindow_height)); - printf("MainWindow Size: %dx%d\n", mainwindow_width, mainwindow_height); - - DFBCHECK (m_mainwindow->SetColor (m_mainwindow, 0x80, 0x80, 0xff, 0xff)); - DFBCHECK (m_mainwindow->FillRectangle (m_mainwindow, 0, 0, 640, 720)); - DFBCHECK (m_mainwindow->SetColor (m_mainwindow, 0x80, 0xff, 0x80, 0xff)); - DFBCHECK (m_mainwindow->FillRectangle (m_mainwindow, 640, 0, 640, 720)); - - DFBCHECK (m_mainwindow->Flip (m_mainwindow, NULL, 0)); - - sleep(5); - - printf("Exiting...\n"); - m_mainwindow->Release(m_mainwindow); - m_displaylayer->Release(m_displaylayer); - m_screen->Release(m_screen); - m_dfb->Release(m_dfb); - - return 0; -} - diff --git a/libs/libstgles/demo/egltest.c b/libs/libstgles/demo/egltest.c deleted file mode 100644 index 7df6615..0000000 --- a/libs/libstgles/demo/egltest.c +++ /dev/null @@ -1,159 +0,0 @@ - - -#include -#include - -static EGLDisplay m_display; - EGLConfig m_config; - EGLSurface m_surface; - - EGLNativeWindowType m_nativeWindow; - EGLNativeDisplayType m_nativeDisplay; - EGLContext m_context; - char* m_eglext; - - -int main(int argc, char *argv[]) -{ - EGLBoolean eglStatus; - EGLint configCount; - EGLConfig* configList = NULL; - - EGLDisplay nativeDisplay = EGL_DEFAULT_DISPLAY; - - - - /* Display */ - m_display = eglGetDisplay(nativeDisplay); - if (m_display == EGL_NO_DISPLAY) - { - printf("EGL failed to obtain display"); - return false; - } - - /* Initialize */ - if (!eglInitialize(m_display, 0, 0)) - { - printf("EGL failed to initialize"); - return false; - } - - - /* Configuration */ - EGLint configAttrs[] = { - EGL_RED_SIZE, 8, - EGL_GREEN_SIZE, 8, - EGL_BLUE_SIZE, 8, - EGL_DEPTH_SIZE, 16, - EGL_STENCIL_SIZE, 0, - EGL_SAMPLE_BUFFERS, 0, - EGL_SAMPLES, 0, - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT, - EGL_NONE - }; - - // Find out how many configurations suit our needs - eglStatus = eglChooseConfig(m_display, configAttrs, NULL, 0, &configCount); - if (!eglStatus || !configCount) - { - printf("EGL failed to return any matching configurations: %d", eglStatus); - return false; - } - - // Allocate room for the list of matching configurations - configList = (EGLConfig*)malloc(configCount * sizeof(EGLConfig)); - if (!configList) - { - printf("kdMalloc failure obtaining configuration list"); - return false; - } - - // Obtain the configuration list from EGL - eglStatus = eglChooseConfig(m_display, configAttrs, - configList, configCount, &configCount); - if (!eglStatus || !configCount) - { - printf("EGL failed to populate configuration list: %d", eglStatus); - return false; - } - - // Select an EGL configuration that matches the native window - m_config = configList[0]; - - - /* Surface */ - m_surface = eglCreateWindowSurface(m_display, m_config, m_nativeWindow, NULL); - if (!m_surface) - { - printf("EGL couldn't create window surface"); - return false; - } - - /* Bind */ - eglStatus = eglBindAPI(EGL_OPENGL_ES_API); - if (!eglStatus) - { - printf("EGL failed to bind API: %d", eglStatus); - return false; - } - - /* Context */ - EGLint contextAttrs[] = - { - EGL_CONTEXT_CLIENT_VERSION, 2, - EGL_NONE - }; - - // Create an EGL context - if (m_context == EGL_NO_CONTEXT) - { - m_context = eglCreateContext(m_display, m_config, NULL, contextAttrs); - if (!m_context) - { - printf("EGL couldn't create context"); - return false; - } - } - - /* Make Current */ - // Make the context and surface current to this thread for rendering - eglStatus = eglMakeCurrent(m_display, m_surface, m_surface, m_context); - if (!eglStatus) - { - printf("EGL couldn't make context/surface current: %d", eglStatus); - return false; - } - - free(configList); - - /* Clear Screen */ - eglSwapInterval(m_display, 0); - - // For EGL backend, it needs to clear all the back buffers of the window - // surface before drawing anything, otherwise the image will be blinking - // heavily. The default eglWindowSurface has 3 gdl surfaces as the back - // buffer, that's why glClear should be called 3 times. - glClearColor (0.0f, 0.0f, 0.0f, 0.0f); - glClear (GL_COLOR_BUFFER_BIT); - eglSwapBuffers(m_display, m_surface); - - glClear (GL_COLOR_BUFFER_BIT); - eglSwapBuffers(m_display, m_surface); - - glClear (GL_COLOR_BUFFER_BIT); - eglSwapBuffers(m_display, m_surface); - - m_eglext = eglQueryString(m_display, EGL_EXTENSIONS); - printf("EGL extensions:%s", m_eglext); - - // setup for vsync disabled - eglSwapInterval(m_display, 0); - - printf("EGL window and context creation complete"); - - sleep(5); - - return 0; -} - diff --git a/libs/libstgles/includes/EGL/egl.h b/libs/libstgles/includes/EGL/egl.h deleted file mode 100644 index 50ddf1e..0000000 --- a/libs/libstgles/includes/EGL/egl.h +++ /dev/null @@ -1,188 +0,0 @@ -#ifndef __egl_h__ -#define __egl_h__ -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#if __GNUC__ >= 4 -# define EGLAPI __attribute__((visibility("default"))) extern -# define EGLAPIENTRY -#else -# define EGLAPI -# define EGLAPIENTRY -#endif - -typedef int EGLint; /* EGL int. */ -typedef int EGLenum; /* EGL enum. */ -typedef unsigned int EGLBoolean; /* EGL boolean. */ -typedef int EGLConfig; /* EGL config handle. */ -typedef void* EGLContext; /* EGL context handle. */ -typedef void* EGLDisplay; /* EGL display handle. */ -typedef void * EGLSurface; /* EGL Surface Handle. */ - - -/* Out-of-band attribute value. */ -#define EGL_DONT_CARE ((EGLint)-1) - -/* QuerySurface / CreatePbufferSurface targets */ - -#define EGL_HEIGHT 0x3056 /* EGL height. */ -#define EGL_WIDTH 0x3057 /* EGL width */ - -#define EGL_TEXTURE_FORMAT 0x3080/* Not supported. */ -#define EGL_TEXTURE_TARGET 0x3081 /* Not supported. */ -#define EGL_MIPMAP_TEXTURE 0x3082 /* Not supported. */ -#define EGL_MIPMAP_LEVEL 0x3083 /* Not supported. */ -#define EGL_RENDER_BUFFER 0x3086 /* Not supported. */ -#define EGL_COLORSPACE 0x3087 /* Not supported. */ -#define EGL_ALPHA_FORMAT 0x3088 /* Not supported. */ - - -/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */ -#define EGL_BACK_BUFFER 0x3084 /* Surface double buffered. */ -#define EGL_SINGLE_BUFFER 0x3085 /* Surface simple buffering. */ - - -/* OpenVG color spaces */ -#define EGL_COLORSPACE_sRGB 0x3089 /* EGL_COLORSPACE value. */ -#define EGL_COLORSPACE_LINEAR 0x308A /* EGL_COLORSPACE value. */ - -/* OpenVG alpha formats */ -#define EGL_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value. */ -#define EGL_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value. */ - - -/* Errors / GetError return values */ - -#define EGL_SUCCESS 0x3000 /* Function succeeded. */ -#define EGL_NOT_INITIALIZED 0x3001 /* EGL is not initialized, or could not be initialized, for the - specified display. */ -#define EGL_BAD_ACCESS 0x3002 /* EGL cannot access a requested resource (for example, a - context is bound in another thread). */ -#define EGL_BAD_ALLOC 0x3003 /* EGL failed to allocate resources for the requested operation. */ -#define EGL_BAD_ATTRIBUTE 0x3004 /* An unrecognized attribute or attribute value was passed in an attribute list.*/ -#define EGL_BAD_CONFIG 0x3005 /* An EGLConfig argument does not name a valid EGLConfig.*/ -#define EGL_BAD_CONTEXT 0x3006 /* An EGLContext argument does not name a valid EGLContext.*/ -#define EGL_BAD_CURRENT_SURFACE 0x3007 /* The current surface of the calling thread is a window, pbuffer, or pixmap that is no longer valid.*/ -#define EGL_BAD_DISPLAY 0x3008 /* An EGLDisplay argument does not name a valid EGLDisplay; or, EGL is not initialized on the specified EGLDisplay.*/ -#define EGL_BAD_MATCH 0x3009 /* Arguments are inconsistent; for example, an otherwise valid context requires buffers (e.g. depth or stencil) not allocated by an otherwise valid surface. */ -#define EGL_BAD_NATIVE_PIXMAP 0x300A /* An EGLNativePixmapType argument does not refer to a valid native pixmap.*/ -#define EGL_BAD_NATIVE_WINDOW 0x300B /* An EGLNativeWindowType argument does not refer to a valid native window.*/ -#define EGL_BAD_PARAMETER 0x300C /* One or more argument values are invalid. */ -#define EGL_BAD_SURFACE 0x300D /* An EGLSurface argument does not name a valid surface (window, pbuffer, or pixmap) configured for rendering.*/ -#define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management. */ - - -/* EGL aliases */ -#define EGL_FALSE 0 /* FALSE = 0 */ -#define EGL_TRUE 1 /* TRUE = 0 */ - -/* BindAPI/QueryAPI targets */ -#define EGL_OPENGL_ES_API 0x30A0 /* EGL binded to OpenGL ES. */ -#define EGL_OPENVG_API 0x30A1 /* EGL binded to OVG (not supported ). */ - - -/* Config attributes */ - -#define EGL_BUFFER_SIZE 0x3020 /* Depth bits of the color buffer. */ -#define EGL_ALPHA_SIZE 0x3021 /* Alpha Bits in the color buffer. */ -#define EGL_BLUE_SIZE 0x3022 /* Blue Bits in the color buffer. */ -#define EGL_GREEN_SIZE 0x3023 /* Green bits in the color buffer. */ -#define EGL_RED_SIZE 0x3024 /* Red bits of the color buffer */ -#define EGL_DEPTH_SIZE 0x3025 /* Not supported. */ -#define EGL_STENCIL_SIZE 0x3026 /* Not supported. */ -#define EGL_CONFIG_CAVEAT 0x3027 /* Enum any caveats for the configuration (always EGL_NONE). */ -#define EGL_CONFIG_ID 0x3028 /* Unique EGLConfig identifier. */ -#define EGL_LEVEL 0x3029 /* Not supported. */ -#define EGL_MAX_PBUFFER_HEIGHT 0x302A /* Not supported. */ -#define EGL_MAX_PBUFFER_PIXELS 0x302B /* Not supported. */ -#define EGL_MAX_PBUFFER_WIDTH 0x302C /* Not supported. */ -#define EGL_NATIVE_RENDERABLE 0x302D /* Not supported. */ -#define EGL_NATIVE_VISUAL_ID 0x302E /* Enum type of transparency supported (always EGL_NONE). */ -#define EGL_NATIVE_VISUAL_TYPE 0x302F /* Integer native visual type of the associated visual. */ - -#define EGL_SAMPLES 0x3031 /* Not supported. */ -#define EGL_SAMPLE_BUFFERS 0x3032 /* Not supported. */ -#define EGL_SURFACE_TYPE 0x3033 /* All types are always supported. */ -#define EGL_TRANSPARENT_TYPE 0x3034 /* Not supported. */ -#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 /* Not supported. */ -#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 /* Not supported. */ -#define EGL_TRANSPARENT_RED_VALUE 0x3037 /* Not supported. */ -#define EGL_NONE 0x3038 /* Attrib list terminator */ -#define EGL_BIND_TO_TEXTURE_RGB 0x3039 /* Not supported. */ -#define EGL_BIND_TO_TEXTURE_RGBA 0x303A /* Not supported. */ -#define EGL_MIN_SWAP_INTERVAL 0x303B /* Integer minimum swap interval (always 1). */ -#define EGL_MAX_SWAP_INTERVAL 0x303C /* integer maximum swap interval (always 1) */ -#define EGL_LUMINANCE_SIZE 0x303D /* Not supported. */ -#define EGL_ALPHA_MASK_SIZE 0x303E /* Not supported. */ -#define EGL_COLOR_BUFFER_TYPE 0x303F /* Enum color buffer type (always EGL_RGB_BUFFER) */ -#define EGL_RENDERABLE_TYPE 0x3040 /* Not supported #define EGL_MATCH_NATIVE_PIXMAP 0x3041 */ - - -/* Config attribute mask bits */ -#define EGL_PBUFFER_BIT 0x01 /* EGL_SURFACE_TYPE mask bits. */ -#define EGL_PIXMAP_BIT 0x02 /* EGL_SURFACE_TYPE mask bits. */ -#define EGL_WINDOW_BIT 0x04 /* EGL_SURFACE_TYPE mask bits */ -#define EGL_OPENGL_ES_BIT 0x01 /* EGL_RENDERABLE_TYPE mask bits. */ -#define EGL_OPENVG_BIT 0x02 /* EGL_RENDERABLE_TYPE mask bits. */ -#define EGL_OPENGL_ES2_BIT 0x04 /* EGL_RENDERABLE_TYPE mask bits. */ - - - -/* Out-of-band handle values */ -/* These values may vary depending on semantics of native concepts */ -#define EGL_DEFAULT_DISPLAY ((EGLDisplay)(NativeDisplayType)1) /* Default Display. */ -#define EGL_NO_CONTEXT ((EGLContext)0) /* EGL No Context. */ -#define EGL_NO_DISPLAY ((EGLDisplay)0) /* EGL No Display. */ -#define EGL_NO_SURFACE ((EGLSurface)0) /* EGL No Surface. */ - - -/* Config attribute values */ -#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value. */ -#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_NON_CONFORMANT_CONFIG value. */ -#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value. */ -#define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value. */ -#define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value. */ - -/* GetCurrentSurface targets */ -#define EGL_DRAW 0x3059 /* Selects the Draw buffer. */ -#define EGL_READ 0x305A /* Selects the Read buffer. */ - -/* QueryString targets */ -#define EGL_VENDOR 0x3053 -#define EGL_VERSION 0x3054 -#define EGL_EXTENSIONS 0x3055 -#define EGL_CLIENT_APIS 0x308D - -#define EGL_CONTEXT_CLIENT_VERSION 0x3098 - - -EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name); -EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(int display_id); -EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor); -EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy); -EGLAPI EGLint EGLAPIENTRY eglGetError(void); -EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api); -EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); -EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, NativeWindowType win, const EGLint *attrib_list); -EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface); -EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list); -EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx); -EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); -EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void); -EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw); -EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface); -EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); -EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); -EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval); - - -#ifdef __cplusplus -} -#endif - - -#endif /* egl_h__ */ diff --git a/libs/libstgles/includes/EGL/eglext.h b/libs/libstgles/includes/EGL/eglext.h deleted file mode 100644 index ab81694..0000000 --- a/libs/libstgles/includes/EGL/eglext.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef __egl_ext_h__ -#define __egl_ext_h__ -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -#ifdef __cplusplus -} -#endif - - -#endif /* egl_ext_h__ */ diff --git a/libs/libstgles/includes/EGL/eglplatform.h b/libs/libstgles/includes/EGL/eglplatform.h deleted file mode 100644 index 3648807..0000000 --- a/libs/libstgles/includes/EGL/eglplatform.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef __eglplatform_h__ -#define __eglplatform_h__ - -#ifdef __cplusplus -extern "C" { -#endif - -#define EGLAPI -#define EGLAPIENTRY - -#include -#define NativePixmapType IDirectFBSurface * -#define NativeDisplayType IDirectFBScreen * -#define NativeWindowType IDirectFBSurface * - - -/* EGL 1.2 types, renamed for consistency in EGL 1.3 */ -typedef NativeDisplayType EGLNativeDisplayType; -typedef NativePixmapType EGLNativePixmapType; -typedef NativeWindowType EGLNativeWindowType; - - - - -#ifdef __cplusplus -} -#endif -#endif /* eglplatform_h__ */ diff --git a/libs/libstgles/includes/GLES/gl.h b/libs/libstgles/includes/GLES/gl.h deleted file mode 100644 index 5b1aba8..0000000 --- a/libs/libstgles/includes/GLES/gl.h +++ /dev/null @@ -1,294 +0,0 @@ -#ifndef __gl_h__ -#define __gl_h__ - -#include "glplatform.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if __GNUC__ >= 4 -# define GLESAPI __attribute__((visibility("default"))) extern -# define GLESAPIENTRY -#else -# define GLESAPI -# define GLESAPIENTRY -#endif - - -typedef unsigned int GLenum; /* GL enum. */ -typedef unsigned char GLboolean; /* GL boolean. */ -typedef unsigned int GLbitfield; /* GL bitfield. */ -typedef signed char GLbyte; /* GL byte. */ -typedef short GLshort; /* GL short. */ -typedef int GLint; /* GL int. */ -typedef int GLsizei; /* GL size int. */ -typedef unsigned char GLubyte; /* GL unsigned byte. */ -typedef unsigned short GLushort; /* GL unsigned short. */ -typedef unsigned int GLuint; /* GL unsigned int. */ -typedef float GLfloat; /* GL float. */ -typedef float GLclampf; /* GL float clamped. */ -typedef double GLdouble; /* GL double. */ -typedef double GLclampd; /* GL double clamped. */ -typedef void GLvoid; /* GL void. */ - - -typedef enum -{ - GL_MODELVIEW, - GL_PROJECTION, - GL_TEXTURE, - GL_MATRIX_MODE_LAST -} GLMatrixMode; - - -/*************************************************************/ - -/* OpenGL ES core versions */ -#define GL_VERSION_ES_CM_1_0 1 -#define GL_VERSION_ES_CL_1_0 1 -#define GL_VERSION_ES_CM_1_1 1 -#define GL_VERSION_ES_CL_1_1 1 - -/* ClearBufferMask */ -#define GL_DEPTH_BUFFER_BIT 0x00000100 /* Has no effect, but must be set in glClear for forward - compatibility. */ -#define GL_COLOR_BUFFER_BIT 0x00004000 /* GL AttribMask GL_COLOR_BUFFER_BIT see glClear &nd - glPushAttrib. */ - -/* Boolean */ -#define GL_FALSE 0 -#define GL_TRUE 1 - -/* BeginMode */ -//#define GL_POINTS 0x0000 -//#define GL_LINES 0x0001 -//#define GL_LINE_LOOP 0x0002 -#define GL_TRIANGLES 0x0004 -#define GL_QUADS 0x0005 - -/* AlphaFunction */ -#define GL_LESS 0x0201 - -/* BlendingFactorDest */ -#define GL_ZERO 0 /* GL ZERO. */ -#define GL_ONE 1 /* GL ONE. */ -/* Not implemented. */ -/* Not supported. */ -#define GL_SRC_COLOR 0x0300 /* GL_SRC_COLOR see glBlendFunc */ -/* Not implemented. */ -#define GL_ONE_MINUS_SRC_COLOR 0x0301 /* GL_ONE_MINUS_SRC_COLOR see glBlendFunc */ -/* Blending uses alpha source. */ -#define GL_SRC_ALPHA GL_ONE/*SRC_ALPHA does not work so use ONE 0x0302*/ /* GL_SRC_ALPHA see glBlendFunc */ -/* Not implemented. */ -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 /* GL_ONE_MINUS_SRC_ALPHA see glBlendFunc */ -/* Not implemented. */ -#define GL_DST_ALPHA 0x0304 /* GL_DST_ALPHA see glBlendFunc */ -/* Not implemented. */ -#define GL_ONE_MINUS_DST_ALPHA 0x0305 /* GL_ONE_MINUS_DST_ALPHA see glBlendFunc */ - -/* BlendingFactorSrc */ -/* ClipPlaneName */ -/* ColorMaterialFace */ -/* ColorMaterialParameter */ -/* ColorPointerType */ -/* CullFaceMode */ -/* DepthFunction */ - -/* EnableCap */ -#define GL_TEXTURE_2D 0x0DE1 /* If enabled, two-dimensional texturing is performed. */ -#define GL_CULL_FACE 0x0B44 /* If enabled, cull polygons based on their winding in window - coordinates. */ -#define GL_BLEND 0x0BE2 /* Blending enabled. */ -#define GL_DEPTH_TEST 0x0B71 /* If enabled, primitive will be sorted by the z order. */ -#define GL_SCISSOR_TEST 0x0C11 /* If enabled, discard fragments that are outside the scissor - rectangle. */ -#define GL_VERTEX_ARRAY 0x8074 -#define GL_COLOR_ARRAY 0x8076 -#define GL_TEXTURE_COORD_ARRAY 0x8078 - -/* ErrorCode */ -#define GL_NO_ERROR 0 /* No error has been recorded. The value of this symbolic - constant is guaranteed to be 0. */ -#define GL_INVALID_ENUM 0x0500 /* Error enum invalid. */ -#define GL_INVALID_VALUE 0x0501 /* Error value invalid. */ -#define GL_INVALID_OPERATION 0x0502 /* Error operation invalid. */ -#define GL_STACK_OVERFLOW 0x0503 /* Error stack overflow, see glPushMatrix/glPopMatrix */ -#define GL_STACK_UNDERFLOW 0x0504 /* Error stack underflow, see glPushMatrix/glPopMatrix. */ -#define GL_OUT_OF_MEMORY 0x0505 /* Error out of memory. */ - -/* FogMode */ -/* FogParameter */ - -/* GetPName */ -#define GL_CURRENT_COLOR 0x0B00 /* Current color. */ -#define GL_VIEWPORT 0x0BA2 -#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 /* Modelview matrix stack pointer. */ -#define GL_MODELVIEW_MATRIX 0x0BA6 /* Modelview matrix stack. */ -#define GL_PROJECTION_MATRIX 0x0BA7 /* Projection matrix stack. */ -#define GL_BLEND_DST 0x0BE0 /* Blending destination function. */ -#define GL_BLEND_SRC 0x0BE1 /* Blending source function. */ -#define GL_SCISSOR_TEST 0x0C11 /* If enabled, discard fragments that are outside the scissor - rectangle.*/ -#define GL_COLOR_CLEAR_VALUE 0x0C22 /* Color-buffer clear value (RGBA mode). */ -#define GL_MAX_TEXTURE_SIZE 0x0D33 -#define GL_UNPACK_ALIGNMENT 0x0CF5 /* Value of GL_UNPACK_ALIGNMENT see glReadPixels. */ -#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 /* Maximum projection-matrix stack depth. */ -#define GL_MAX_VIEWPORT_DIMS 0x0D3A /* Maximum viewport dimensions. */ - -/* GetTextureParameter */ -/* HintMode */ -/* HintTarget */ -/* LightModelParameter */ -/* LightParameter */ - -/* DataType */ -#define GL_BYTE 0x1400 /* GL Data Type GL_BYTE. */ -#define GL_UNSIGNED_BYTE 0x1401 /* GL Data Type GL_UNSIGNED_BYTE. */ -#define GL_SHORT 0x1402 /* GL Data Type GL_SHORT. */ -#define GL_UNSIGNED_SHORT 0x1403 /* GL Data Type GL_UNSIGNED_SHORT. */ -#define GL_FLOAT 0x1406 /* GL Data Type GL_FLOAT. */ - -/* LogicOp */ -/* MaterialFace */ -/* MaterialParameter */ -/* MatrixMode */ -/* NormalPointerType */ - -/* PixelFormat */ -#define GL_ALPHA 0x1906 /* GL PixelFormat GL_ALPHA. */ -#define GL_RGB 0x1907 /* GL PixelFormat GL_RGB. */ -#define GL_RGBA 0x1908 /* GL PixelFormat GL_RGBA. */ -/* Not implemented. */ -#define GL_LUMINANCE 0x1909 -/* Not implemented. */ -#define GL_LUMINANCE_ALPHA 0x190A - -/* PixelStoreParameter */ -#define GL_UNPACK_ALIGNMENT 0x0CF5 /* Value of GL_UNPACK_ALIGNMENT see glReadPixels. */ - -/* PixelType */ -/* ShadingModel */ -/* StencilFunction */ -/* StencilOp */ - -/* StringName */ -#define GL_VENDOR 0x1F00 -#define GL_RENDERER 0x1F01 -#define GL_VERSION 0x1F02 -#define GL_EXTENSIONS 0x1F03 - -/* TexCoordPointerType */ -/* TextureEnvMode */ -/* TextureEnvParameter */ -/* TextureEnvTarget */ - -/* TextureMagFilter */ -#define GL_LINEAR 0x2601 - -/* TextureMinFilter */ - -/* TextureParameterName */ -#define GL_TEXTURE_MAG_FILTER 0x2800 -#define GL_TEXTURE_MIN_FILTER 0x2801 -#define GL_TEXTURE_WRAP_S 0x2802 -#define GL_TEXTURE_WRAP_T 0x2803 - -/* TextureTarget */ - -/* TextureUnit */ -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 - -/* TextureWrapMode */ -#define GL_CLAMP_TO_EDGE 0x812F - -/* VertexPointerType */ -/* LightName */ -/* Buffer Objects */ -/* Texture combine + dot3 */ - - - - - -//INTERNAL -#define GL_UNPACK_ROW_LENGTH 0x0CF2 /* Value of GL_UNPACK_ROW_LENGTH see glReadPixels. */ -#define GL_UNPACK_SKIP_ROWS 0x0CF3 /* Value of GL_UNPACK_SKIP_ROWS see glReadPixels. */ -#define GL_UNPACK_SKIP_PIXELS 0x0CF4 /* Value of GL_UNPACK_SKIP_PIXELS see glReadPixels. */ - -#define GL_CURRENT_BIT 0x00000001 /* GL AttribMask GL_CURRENT_BIT see glPushAttrib. */ -#define GL_ENABLE_BIT 0x00002000 /* GL AttribMask GL_CURRENT_BIT see glPushAttrib. */ -#define GL_ALL_ATTRIB_BITS 0x000fffff /* GL all AttribMask see glPushAttrib. */ - - - - -//http://www.khronos.org/opengles/sdk/1.1/docs/man/ - -GLESAPI void GLESAPIENTRY glGenTextures (GLsizei n, GLuint *textures); -GLESAPI void GLESAPIENTRY glDeleteTextures (GLsizei n, GLuint *textures); -GLESAPI void GLESAPIENTRY glBindTexture (GLenum target, GLuint texture); -GLESAPI GLboolean GLESAPIENTRY glIsTexture (GLuint texture); -GLESAPI void GLESAPIENTRY glActiveTexture(GLenum texture); - -GLESAPI void GLESAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); -GLESAPI void GLESAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, - GLsizei width, GLsizei height, GLint border, - GLenum format, GLenum type, const GLvoid *pixels); - -GLESAPI void GLESAPIENTRY glTexSubImage2D(GLenum target, GLint level, GLint xoffset, - GLint yoffset, GLsizei width, GLsizei height, - GLenum format, GLenum type, const GLvoid * pixels); - -GLESAPI void GLESAPIENTRY glColorPointer(GLint size, GLenum type, - GLsizei stride, const GLvoid * pointer); -GLESAPI void GLESAPIENTRY glTexCoordPointer(GLint size, GLenum type, - GLsizei stride, const GLvoid * pointer); -GLESAPI void GLESAPIENTRY glVertexPointer(GLint size, GLenum type, - GLsizei stride, const GLvoid * pointer); -GLESAPI void GLESAPIENTRY glEnableClientState(GLenum array); -GLESAPI void GLESAPIENTRY glDisableClientState(GLenum array); -GLESAPI void GLESAPIENTRY glDrawArrays(GLenum mode, GLint first, GLsizei count); - - -GLESAPI GLubyte * GLESAPIENTRY glGetString(GLenum name); - - -GLESAPI GLenum GLESAPIENTRY glGetError (void); -GLESAPI void GLESAPIENTRY glEnable(GLenum cap); -GLESAPI void GLESAPIENTRY glDisable(GLenum cap); -GLESAPI void GLESAPIENTRY glGetIntegerv(GLenum pname,GLint * params); -GLESAPI void GLESAPIENTRY glGetFloatv(GLenum pname,GLfloat * params); -GLESAPI void GLESAPIENTRY glGetBooleanv( GLenum pname, GLboolean *params ); -GLESAPI void GLESAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); -GLESAPI void GLESAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -GLESAPI void GLESAPIENTRY glClear (GLbitfield mask); -GLESAPI void GLESAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GLESAPI void GLESAPIENTRY glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ); -GLESAPI void GLESAPIENTRY glPixelStorei( GLenum pname, GLint param ); -GLESAPI void GLESAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); -GLESAPI void GLESAPIENTRY glPushAttrib(GLbitfield mask ); -GLESAPI void GLESAPIENTRY glPopAttrib (void); - -GLESAPI void GLESAPIENTRY glMatrixMode(GLMatrixMode mode); -GLESAPI void GLESAPIENTRY glLoadMatrix(GLfloat* matrix); -GLESAPI void GLESAPIENTRY glLoadIdentity (void); -GLESAPI void GLESAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); -GLESAPI void GLESAPIENTRY glMultMatrixf(const GLfloat *m); -GLESAPI void GLESAPIENTRY glRotatef (GLfloat angle,GLfloat x, GLfloat y, GLfloat z); -GLESAPI void GLESAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); -GLESAPI void GLESAPIENTRY glPushMatrix (void); -GLESAPI void GLESAPIENTRY glPopMatrix (void); -GLESAPI void GLESAPIENTRY glFinish (void); -GLESAPI void GLESAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); - -#define GL_FRAMEBUFFER 0 -#define GL_CLAMP 0 -#define glBindFramebuffer(target, framebuffer) {} - -#ifdef __cplusplus -} -#endif - -#endif /* gl_h__ */ diff --git a/libs/libstgles/includes/GLES/glext.h b/libs/libstgles/includes/GLES/glext.h deleted file mode 100644 index c22fdcf..0000000 --- a/libs/libstgles/includes/GLES/glext.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef __gl_ext_h_ -#define __gl_ext_h_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -#ifdef __cplusplus -} -#endif - -#endif /* __gl_ext_h_ */ diff --git a/libs/libstgles/includes/GLES/glplatform.h b/libs/libstgles/includes/GLES/glplatform.h deleted file mode 100644 index b587b9d..0000000 --- a/libs/libstgles/includes/GLES/glplatform.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef __glplatform_h__ -#define __glplatform_h__ -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* glplatform_h__ */ - - - diff --git a/libs/libstgles/libstgles.pc b/libs/libstgles/libstgles.pc deleted file mode 100644 index 6d9749b..0000000 --- a/libs/libstgles/libstgles.pc +++ /dev/null @@ -1,12 +0,0 @@ -prefix=/usr -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include - -Name: STGLES -Description: 3D graphics effects library -Version: 1.0 -Requires: directfb >= 1.4.11 -Libs: -L${libdir} -lstgles -Libs.private: -lrt -Cflags: -I${includedir} diff --git a/minimon-mips b/minimon-mips deleted file mode 120000 index e0189a1..0000000 --- a/minimon-mips +++ /dev/null @@ -1 +0,0 @@ -minimon-arm \ No newline at end of file diff --git a/minimon-sh4/Makefile.am b/minimon-sh4/Makefile.am deleted file mode 100644 index 81ff626..0000000 --- a/minimon-sh4/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -bin_PROGRAMS = minimon - -AM_LDFLAGS = -ljpeg -lusb -AM_CFLAGS = -Wall -g -DHAVE_LIBJPEG_TURBO - -minimon_SOURCES = minimon.c jpg.c - -SUBDIRS = virtual_fb diff --git a/minimon-sh4/autogen.sh b/minimon-sh4/autogen.sh deleted file mode 100755 index 8e30761..0000000 --- a/minimon-sh4/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-minimon-sh4" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/minimon-sh4/configure.ac b/minimon-sh4/configure.ac deleted file mode 100644 index dc6f853..0000000 --- a/minimon-sh4/configure.ac +++ /dev/null @@ -1,14 +0,0 @@ -AC_INIT([minimon],[1.0],[],[minimon]) -AC_PREREQ(2.53) - -AM_INIT_AUTOMAKE - -AC_PROG_CC -AC_PROG_CXX - -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) - -AC_OUTPUT([ -Makefile -]) diff --git a/minimon-sh4/jpg.c b/minimon-sh4/jpg.c deleted file mode 100644 index a8771d5..0000000 --- a/minimon-sh4/jpg.c +++ /dev/null @@ -1,218 +0,0 @@ -#include -#include -#include -#include -#include "jpeglib.h" -#include "jerror.h" - -#include "jpg.h" - -typedef struct -{ - struct jpeg_destination_mgr pub; /* public fields */ - - unsigned char ** outbuffer; /* target buffer */ - unsigned long * outsize; - unsigned char * newbuffer; /* newly allocated buffer */ - JOCTET * buffer; /* start of buffer */ - size_t bufsize; -} mem_dest_mgr; - -typedef mem_dest_mgr * mem_dest_mgr_ptr; - -static void init_mem_destination (j_compress_ptr cinfo) -{ -} - -static boolean empty_mem_output_buffer(j_compress_ptr cinfo) -{ - size_t nextsize; - JOCTET * nextbuffer; - mem_dest_mgr_ptr dest = (mem_dest_mgr_ptr) cinfo->dest; - - /* Try to allocate new buffer with double size */ - nextsize = dest->bufsize * 2; - nextbuffer = malloc(nextsize); - - if (nextbuffer == NULL) - ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10); - - memcpy(nextbuffer, dest->buffer, dest->bufsize); - - if (dest->newbuffer != NULL) - free(dest->newbuffer); - - dest->newbuffer = nextbuffer; - - dest->pub.next_output_byte = nextbuffer + dest->bufsize; - dest->pub.free_in_buffer = dest->bufsize; - - dest->buffer = nextbuffer; - dest->bufsize = nextsize; - - return TRUE; -} - -static void term_mem_destination(j_compress_ptr cinfo) -{ - mem_dest_mgr_ptr dest = (mem_dest_mgr_ptr) cinfo->dest; - - *dest->outbuffer = dest->buffer; - *dest->outsize = dest->bufsize - dest->pub.free_in_buffer; -} - -static void my_jpeg_mem_dest(j_compress_ptr cinfo, unsigned char ** outbuffer, unsigned long * outsize) -{ - mem_dest_mgr_ptr dest; - - if (outbuffer == NULL || outsize == NULL) /* sanity check */ - ERREXIT(cinfo, JERR_BUFFER_SIZE); - - /* The destination object is made permanent so that multiple JPEG images - * can be written to the same buffer without re-executing jpeg_mem_dest. - */ - if (cinfo->dest == NULL) /* first time for this JPEG object? */ - { - cinfo->dest = (struct jpeg_destination_mgr *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, - sizeof(mem_dest_mgr)); - } - - dest = (mem_dest_mgr_ptr) cinfo->dest; - dest->pub.init_destination = init_mem_destination; - dest->pub.empty_output_buffer = empty_mem_output_buffer; - dest->pub.term_destination = term_mem_destination; - dest->outbuffer = outbuffer; - dest->outsize = outsize; - dest->newbuffer = NULL; - - if (*outbuffer == NULL || *outsize == 0) - { - /* Allocate initial buffer */ - dest->newbuffer = *outbuffer = malloc(65536); - if (dest->newbuffer == NULL) - ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10); - *outsize = 65536; - } - - dest->pub.next_output_byte = dest->buffer = *outbuffer; - dest->pub.free_in_buffer = dest->bufsize = *outsize; -} - -#ifdef HAVE_LIBJPEG_TURBO -jpg_buf_t build_jpg_from_fb(unsigned char *fb_mem, int fb_width, int fb_height, int bits_per_pixel, int mon_width, int mon_height) -{ - int scanline; - struct jpeg_compress_struct cinfo; - struct jpeg_error_mgr jerr; - - cinfo.err = jpeg_std_error(&jerr); - jpeg_create_compress(&cinfo); - - jpg_buf_t jpg_buf; - jpg_buf.size = 1 << 20; - jpg_buf.ptr = NULL; - - my_jpeg_mem_dest(&cinfo, &jpg_buf.ptr, &jpg_buf.size); - - cinfo.image_width = mon_width; - cinfo.image_height = mon_height; - cinfo.input_components = 4; - cinfo.in_color_space = JCS_EXT_BGRX; - jpeg_set_defaults(&cinfo); - cinfo.dct_method = JDCT_FASTEST; - jpeg_set_quality(&cinfo, 70, TRUE); - - jpeg_start_compress(&cinfo, TRUE); - - - unsigned char buf[mon_width * 4]; - JSAMPROW row_ptr[1] = {buf}; - memset(buf, 0, mon_width*4); - if (fb_width >= mon_width) - while (cinfo.next_scanline < cinfo.image_height) - { - row_ptr[0] = &fb_mem[cinfo.next_scanline * fb_width * 4]; - jpeg_write_scanlines(&cinfo, row_ptr, 1); - } - else - { - for (scanline = 0; scanline < MIN(fb_height, mon_height); scanline++) - { - memcpy(buf, &fb_mem[scanline * fb_width * 4], fb_width * 4); - jpeg_write_scanlines(&cinfo, row_ptr, 1); - } - } - memset(buf, 0, mon_width*4); - for (scanline = fb_height; scanline < mon_height; scanline++) - { - jpeg_write_scanlines(&cinfo, row_ptr, 1); - } - - jpeg_finish_compress(&cinfo); - - jpeg_destroy_compress(&cinfo); - - return jpg_buf; -} -#else -static void convert_rgba_to_rgb(unsigned char *buf, unsigned char *fb_mem, int width) -{ - int i; - for (i = 0; i < width; i++) - { -// BGRX - unsigned int x = *(unsigned int *)fb_mem; - *buf++ = (x >> 16) & 0xff; - *buf++ = (x >> 8) & 0xff; - *buf++ = (x) & 0xff; - fb_mem += 4; - } -} - -jpg_buf_t build_jpg_from_fb(unsigned char *fb_mem, int fb_width, int fb_height, int bits_per_pixel, int mon_width, int mon_height) -{ - int scanline; - struct jpeg_compress_struct cinfo; - struct jpeg_error_mgr jerr; - - cinfo.err = jpeg_std_error(&jerr); - jpeg_create_compress(&cinfo); - - jpg_buf_t jpg_buf; - jpg_buf.size = 1 << 20; - jpg_buf.ptr = NULL; - - my_jpeg_mem_dest(&cinfo, &jpg_buf.ptr, &jpg_buf.size); - - cinfo.image_width = mon_width; - cinfo.image_height = mon_height; - cinfo.input_components = 3; - cinfo.in_color_space = JCS_RGB; - jpeg_set_defaults(&cinfo); - cinfo.dct_method = JDCT_FASTEST; - jpeg_set_quality(&cinfo, 70, TRUE); - - jpeg_start_compress(&cinfo, TRUE); - - JSAMPLE buf[mon_width * 3]; - JSAMPROW row_ptr[1] = {buf}; - memset(buf, 0, mon_width*3); - for (scanline = 0; scanline < MIN(fb_height, mon_height); scanline++) - { - convert_rgba_to_rgb(buf, &fb_mem[scanline * fb_width * 4], mon_width); - jpeg_write_scanlines(&cinfo, row_ptr, 1); - } - memset(buf, 0, mon_width*3); - for (scanline = fb_height; scanline < mon_height; scanline++) - { - jpeg_write_scanlines(&cinfo, row_ptr, 1); - } - - jpeg_finish_compress(&cinfo); - - jpeg_destroy_compress(&cinfo); - - return jpg_buf; -} -#endif diff --git a/minimon-sh4/jpg.h b/minimon-sh4/jpg.h deleted file mode 100644 index 97b1632..0000000 --- a/minimon-sh4/jpg.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef JPG_H -#define JPG_H - -#ifndef MIN -#define MIN(x, y) ((x < y) ? (x) : (y)) -#endif - -typedef struct -{ - unsigned long size; - unsigned char *ptr; -} jpg_buf_t; - -jpg_buf_t build_jpg_from_fb(unsigned char *fb_mem, int fb_width, int fb_height, int bits_per_pixel, int mon_width, int mon_height); - -#endif diff --git a/minimon-sh4/minimon b/minimon-sh4/minimon deleted file mode 100755 index e30f0cf..0000000 Binary files a/minimon-sh4/minimon and /dev/null differ diff --git a/minimon-sh4/minimon.c b/minimon-sh4/minimon.c deleted file mode 100644 index 3399c92..0000000 --- a/minimon-sh4/minimon.c +++ /dev/null @@ -1,332 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include "usb.h" - -#include "linux/fb.h" - -#include "jpg.h" - -static const char *progname = "minimon"; - -static int need_switch = 0; -static int have_idx = -1; - -typedef struct -{ - int mass_id; - int custom_id; - const char *name; - int width; - int height; -} id_info_t; - -// there are many more, -static id_info_t ids[] = -{ - {0x200a, 0x200b, "SPF-72H", 800, 480}, - {0x200e, 0x200f, "SPF-75H/76H", 800, 480}, - {0x200c, 0x200d, "SPF-83H", 800, 600}, - {0x2012, 0x2013, "SPF-85H/86H", 800, 600}, - {0x2016, 0x2017, "SPF-85P/86P", 800, 600}, - {0x2025, 0x2026, "SPF-87H", 800, 480}, - {0x2033, 0x2034, "SPF-87H v2", 800, 480}, - {0x201c, 0x201b, "SPF-105P", 1024, 600}, - {0x2027, 0x2028, "SPF-107H", 1024, 600}, - {0x2035, 0x2036, "SPF-107H v2", 1024, 600}, - {0x204f, 0x2050, "SPF-700T", 800, 600}, - {0x2039, 0x2040, "SPF-1000P", 1024, 600}, - {0, 0, } // end-of-list -}; - -static int in_list(int id, id_info_t *list) -{ - if (!list) - return 0; - - int idx = 0; - while (list->mass_id || list->custom_id) - { - if (id == list->mass_id) - { - // still in mass-storage mode, need to switch - need_switch = 1; - return idx; - } - else if (id == list->custom_id) - { - need_switch = 0; - return idx; - } - idx++; - list++; - } - - return -1; -} - -static struct usb_device *find_dev() -{ - struct usb_bus *bus; - struct usb_device *dev; - - usb_init(); - usb_find_busses(); - usb_find_devices(); - - for (bus = usb_busses; bus; bus = bus->next) - { - for (dev = bus->devices; dev; dev = dev->next) - { - if (dev->descriptor.idVendor == 0x04e8) - { - // found a Samsung device, good - int idx = -1; - if ((idx = in_list(dev->descriptor.idProduct, ids)) >= 0) - { - have_idx = idx; - return dev; - } - } - } - } - - return NULL; -} - -static usb_dev_handle *dev_open(struct usb_device *dev) -{ - int res = -1; - usb_dev_handle *udev; - int numeps = 0; - - udev = usb_open(dev); - if (!udev) - { - fprintf(stderr, "%s: failed to open device, exit.\n", progname); - exit(EXIT_FAILURE); - } - -// setuid(getuid()); - - res = usb_set_configuration(udev, 1); - - usb_claim_interface(udev, 0); - numeps = dev->config[0].interface[0].altsetting[0].bNumEndpoints; - if (numeps == 0) - { - fprintf(stderr, "%s: no endpoints, exit.\n", progname); - exit(EXIT_FAILURE); - } - - { - int eplist[] = { 0x2, 0x81, 0x83 }; - int eplength = sizeof(eplist)/sizeof(eplist[0]); - int *endpoint = eplist; - int i; - for (i = 0; i < eplength; i++) - { - res = usb_resetep(udev, *endpoint); - res = usb_clear_halt(udev, *endpoint); - endpoint++; - } - } - - return udev; -} - -static int send_jpg(jpg_buf_t *jpg_buf, usb_dev_handle *udev) -{ -#define URBBUF_MAX 0x20000 - char buf[URBBUF_MAX]; - -#define HDR_LEN 12 - char hdr[HDR_LEN] = {0xa5, 0x5a, 0x18, 0x04, 0xff, 0xff, 0xff, 0xff, 0x48, 0x00, 0x00, 0x00}; - *(int *)(hdr+4) = jpg_buf->size; - - memcpy(buf, hdr, HDR_LEN); - int off = HDR_LEN; - int jpg_off = 0; - int jpg_left = jpg_buf->size; - while (jpg_left > 0) - { - int nr = MIN(URBBUF_MAX - off, jpg_left); - memcpy(buf+off, &jpg_buf->ptr[jpg_off], nr); - // pad - memset(buf + off + nr, 0, URBBUF_MAX - off - nr); - - // write it out chunk by chunk - int timeout = 1000; - int endpoint = 0x2; - int res = usb_bulk_write(udev, endpoint, buf, URBBUF_MAX, timeout); - - if (res < 0) - return 0; - off = 0; // no header on subsequent chunks - jpg_off += nr; - jpg_left -= nr; - } - - return 1; -} - -int main(int argc, char *argv[]) -{ - if (argc != 2) - { - fprintf(stderr, "Usage: %s \n", progname); - return EXIT_FAILURE; - } - - int fd = open(argv[1], O_RDONLY); - if (fd < 0) - { - perror("minimon framebuffer"); - exit(EXIT_FAILURE); - } - - struct fb_fix_screeninfo sif; - if (ioctl(fd, FBIOGET_FSCREENINFO, &sif) < 0) - { - perror("minimon framebuffer info"); - exit(EXIT_FAILURE); - } - - printf("id %s\n", sif.id); - printf("type %d, aux %d\n", sif.type, sif.type_aux); - printf("visual %d\n", sif.visual); - printf("accel %d\n", sif.accel); - printf("line length %d\n", sif.line_length); - printf("mem %d\n", sif.smem_len); - - struct fb_var_screeninfo siv; - if (ioctl(fd, FBIOGET_VSCREENINFO, &siv) < 0) - { - perror("minimon framebuffer info"); - exit(EXIT_FAILURE); - } - - printf("res x %d y %d\n", siv.xres, siv.yres); - printf("bpp %d\n", siv.bits_per_pixel); - - while (1) - { - struct usb_device *dev = find_dev(index); - if (!dev) - { - fprintf(stderr, "%s: no photo frame device found, suspending...\n", progname); - sleep(1); - continue; - } - - if (need_switch) - { - fprintf(stderr, "%s: found %s, trying to switch to custom product mode...\n", - ids[have_idx].name, progname); - - usb_dev_handle *udev; - udev = usb_open(dev); - if (!udev) - { - fprintf(stderr, "%s: failed to open device, exit.\n", progname); - exit(EXIT_FAILURE); - } - - char buf[254]; - memset(buf, 0, 254); - int res = usb_control_msg(udev, USB_TYPE_STANDARD | USB_ENDPOINT_IN, - 0x06, 0xfe, 0xfe, buf, 0xfe, 1000); - fprintf(stderr, "%s: usb_control_msg() = %d\n", progname, res); - usb_close(udev); - sleep(1); - } - - dev = find_dev(index); - if (!dev || need_switch) - { - fprintf(stderr, "%s: no photo frame device found, suspending...\n", progname); - sleep(1); - continue; - } - - int mon_width = ids[have_idx].width; - int mon_height = ids[have_idx].height; - fprintf(stderr, "%s: found %s (%d x %d)\n", - progname, ids[have_idx].name, mon_width, mon_height); - - siv.xres = siv.xres_virtual = mon_width; - siv.yres = siv.yres_virtual = mon_height; - - if (ioctl(fd, FBIOPUT_VSCREENINFO, &siv)<0) - { - perror("FBIOPUT_VSCREENINFO"); - exit(EXIT_FAILURE); - } - - printf("resized fb to x %d y %d\n", siv.xres, siv.yres); - if (ioctl(fd, FBIOGET_FSCREENINFO, &sif) < 0) - { - perror("minimon framebuffer info"); - exit(EXIT_FAILURE); - } - - printf("resized line length %d\n", sif.line_length); - printf("resized mem %d\n", sif.smem_len); - - size_t fb_mem_size = siv.xres * siv.yres * siv.bits_per_pixel / 8; - void *fb_mem = mmap(NULL, fb_mem_size, PROT_READ, MAP_SHARED, fd, 0); - if (fb_mem == MAP_FAILED) - { - perror("minimon framebuffer mapping"); - exit(EXIT_FAILURE); - } - - usb_dev_handle *udev = dev_open(dev); - - while (1) - { - int transfer = 1; - - // poll status to avoid going back to photoframe mode - char buf[2]; - int res = usb_control_msg(udev, USB_TYPE_VENDOR | USB_ENDPOINT_IN, - 0x06, 0x0, 0x0, buf, 0x2, 1000); - if (res != 2) - { - break; - } - else if (buf[0] != 0) - { - transfer = 0; - } - - if (transfer) - { - fprintf(stderr, "."); - jpg_buf_t jpg_buf = build_jpg_from_fb((unsigned char *)fb_mem, siv.xres, siv.yres, siv.bits_per_pixel, mon_width, mon_height); - - if (!send_jpg(&jpg_buf, udev)) - { - free(jpg_buf.ptr); - break; - } - free(jpg_buf.ptr); - } - else - fprintf(stderr, "o"); - - usleep(500000); - } - - usb_close(udev); - munmap(fb_mem, fb_mem_size); - } - - close(fd); - - return EXIT_SUCCESS; -} diff --git a/minimon-sh4/virtual_fb/.tmp_versions/virtual_fb.mod b/minimon-sh4/virtual_fb/.tmp_versions/virtual_fb.mod deleted file mode 100644 index 02b719e..0000000 --- a/minimon-sh4/virtual_fb/.tmp_versions/virtual_fb.mod +++ /dev/null @@ -1,3 +0,0 @@ -/home/tango/DDT/apps/tools/minimon/virtual_fb/virtual_fb.ko -/home/tango/DDT/apps/tools/minimon/virtual_fb/virtual_fb.o - diff --git a/minimon-sh4/virtual_fb/Module.symvers b/minimon-sh4/virtual_fb/Module.symvers deleted file mode 100644 index e69de29..0000000 diff --git a/minimon-sh4/virtual_fb/virtual_fb.c b/minimon-sh4/virtual_fb/virtual_fb.c deleted file mode 100644 index 494f09f..0000000 --- a/minimon-sh4/virtual_fb/virtual_fb.c +++ /dev/null @@ -1,512 +0,0 @@ -/* - * Copyright 2004-2013 Freescale Semiconductor, Inc. All Rights Reserved. - * Copyright 2016 TangoCash mod for Samsung SPF PhotoFrames - */ - -/* - * The code contained herein is licensed under the GNU General Public - * License. You may obtain a copy of the GNU General Public License - * Version 2 or later at the following locations: - * - * http://www.opensource.org/licenses/gpl-license.html - * http://www.gnu.org/copyleft/gpl.html - */ - -/*! - * @defgroup Framebuffer Framebuffer Driver for surface sharing. - */ - -/*! - * @file virtual_fb.c - * - * @brief Virtual Frame buffer driver for surface sharing - * - * @ingroup Framebuffer - */ - -/*! - * Include files - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Driver name - */ -#define VIRT_FB_NAME "virtual_spf_fb" - -static int vfbcount = 1; -static int vfbwidth = 800; -static int vfbheight = 480; -module_param(vfbcount, int, 0); -module_param(vfbwidth, int, 0); -module_param(vfbheight, int, 0); -static struct fb_info ** g_fb_list; - -static int virtfb_map_video_memory(struct fb_info *fbi); -static int virtfb_unmap_video_memory(struct fb_info *fbi); - -/* - * Set fixed framebuffer parameters based on variable settings. - * - * @param info framebuffer information pointer - */ -static int virtfb_set_fix(struct fb_info *info) -{ - struct fb_fix_screeninfo *fix = &info->fix; - struct fb_var_screeninfo *var = &info->var; - - fix->line_length = var->xres_virtual * var->bits_per_pixel / 8; - - fix->type = FB_TYPE_PACKED_PIXELS; - fix->accel = FB_ACCEL_NONE; - fix->visual = FB_VISUAL_TRUECOLOR; - fix->xpanstep = 1; - fix->ywrapstep = 1; - fix->ypanstep = 1; - - return 0; -} - - -/* - * Set framebuffer parameters and change the operating mode. - * - * @param info framebuffer information pointer - */ -static int virtfb_set_par(struct fb_info *fbi) -{ - int retval = 0; - u32 mem_len; - - dev_dbg(fbi->device, "Reconfiguring framebuffer\n"); - - virtfb_set_fix(fbi); - - mem_len = fbi->var.yres_virtual * fbi->fix.line_length; - if (!fbi->fix.smem_start || !(mem_len == fbi->fix.smem_len)) - { - if (fbi->fix.smem_start) - virtfb_unmap_video_memory(fbi); - - if (virtfb_map_video_memory(fbi) < 0) - return -ENOMEM; - } - - - return retval; -} - - -/* - * Check framebuffer variable parameters and adjust to valid values. - * - * @param var framebuffer variable parameters - * - * @param info framebuffer information pointer - */ -static int virtfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) -{ - - /* fg should not bigger than bg */ - - if (var->xres_virtual < var->xres) - var->xres_virtual = var->xres; - - if (var->yres_virtual < var->yres) - var->yres_virtual = var->yres; - - if ((var->bits_per_pixel != 32) && (var->bits_per_pixel != 24) && - (var->bits_per_pixel != 16) && (var->bits_per_pixel != 12) && - (var->bits_per_pixel != 8)) - var->bits_per_pixel = 16; - - switch (var->bits_per_pixel) - { - case 8: - var->red.length = 3; - var->red.offset = 5; - var->red.msb_right = 0; - - var->green.length = 3; - var->green.offset = 2; - var->green.msb_right = 0; - - var->blue.length = 2; - var->blue.offset = 0; - var->blue.msb_right = 0; - - var->transp.length = 0; - var->transp.offset = 0; - var->transp.msb_right = 0; - break; - case 16: - var->red.length = 5; - var->red.offset = 11; - var->red.msb_right = 0; - - var->green.length = 6; - var->green.offset = 5; - var->green.msb_right = 0; - - var->blue.length = 5; - var->blue.offset = 0; - var->blue.msb_right = 0; - - var->transp.length = 0; - var->transp.offset = 0; - var->transp.msb_right = 0; - break; - case 24: - var->red.length = 8; - var->red.offset = 16; - var->red.msb_right = 0; - - var->green.length = 8; - var->green.offset = 8; - var->green.msb_right = 0; - - var->blue.length = 8; - var->blue.offset = 0; - var->blue.msb_right = 0; - - var->transp.length = 0; - var->transp.offset = 0; - var->transp.msb_right = 0; - break; - case 32: - var->red.length = 8; - var->red.offset = 16; - var->red.msb_right = 0; - - var->green.length = 8; - var->green.offset = 8; - var->green.msb_right = 0; - - var->blue.length = 8; - var->blue.offset = 0; - var->blue.msb_right = 0; - - var->transp.length = 8; - var->transp.offset = 24; - var->transp.msb_right = 0; - break; - } - - var->height = -1; - var->width = -1; - var->grayscale = 0; - - return 0; -} - -/* - * Pan or Wrap the Display - * - * This call looks only at xoffset, yoffset and the FB_VMODE_YWRAP flag - * - * @param var Variable screen buffer information - * @param info Framebuffer information pointer - */ -static int -virtfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) -{ - - if (info->var.yoffset == var->yoffset) - return 0; /* No change, do nothing */ - - if ((var->yoffset + info->var.yres) > info->var.yres_virtual) - return -EINVAL; - - info->var.yoffset = var->yoffset; - - return 0; -} - -/* - * Function to handle custom mmap for virtual framebuffer. - * - * @param fbi framebuffer information pointer - * - * @param vma Pointer to vm_area_struct - */ -static int virtfb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) -{ - u32 len; - unsigned long offset = vma->vm_pgoff << PAGE_SHIFT; - - if (offset < fbi->fix.smem_len) - { - /* mapping framebuffer memory */ - len = fbi->fix.smem_len - offset; - vma->vm_pgoff = (fbi->fix.smem_start + offset) >> PAGE_SHIFT; - } - else - { - return -EINVAL; - } - - len = PAGE_ALIGN(len); - if (vma->vm_end - vma->vm_start > len) - return -EINVAL; - - /* make buffers bufferable */ - vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); - - vma->vm_flags |= VM_IO | VM_RESERVED; - - if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, - vma->vm_end - vma->vm_start, vma->vm_page_prot)) - { - dev_dbg(fbi->device, "mmap remap_pfn_range failed\n"); - return -ENOBUFS; - } - - return 0; -} - -/*! - * This structure contains the pointers to the control functions that are - * invoked by the core framebuffer driver to perform operations like - * blitting, rectangle filling, copy regions and cursor definition. - */ -static struct fb_ops virtfb_ops = -{ - .owner = THIS_MODULE, - .fb_set_par = virtfb_set_par, - .fb_check_var = virtfb_check_var, - .fb_pan_display = virtfb_pan_display, - .fb_mmap = virtfb_mmap, -}; - - -/* - * Main framebuffer functions - */ - -/*! - * Allocates the DRAM memory for the frame buffer. This buffer is remapped - * into a non-cached, non-buffered, memory region to allow palette and pixel - * writes to occur without flushing the cache. Once this area is remapped, - * all virtual memory access to the video memory should occur at the new region. - * - * @param fbi framebuffer information pointer - * - * @return Error code indicating success or failure - */ -static int virtfb_map_video_memory(struct fb_info *fbi) -{ - if (fbi->fix.smem_len < fbi->var.yres_virtual * fbi->fix.line_length) - fbi->fix.smem_len = fbi->var.yres_virtual * - fbi->fix.line_length; - - fbi->screen_base = dma_alloc_coherent(fbi->device, - fbi->fix.smem_len, - (dma_addr_t *)&fbi->fix.smem_start, - GFP_DMA); - if (fbi->screen_base == 0) - { - dev_err(fbi->device, "Unable to allocate framebuffer memory\n"); - fbi->fix.smem_len = 0; - fbi->fix.smem_start = 0; - return -EBUSY; - } - - dev_dbg(fbi->device, "allocated fb @ paddr=0x%08X, size=%d.\n", - (uint32_t) fbi->fix.smem_start, fbi->fix.smem_len); - - fbi->screen_size = fbi->fix.smem_len; - - /* Clear the screen */ - memset((char *)fbi->screen_base, 0, fbi->fix.smem_len); - - return 0; -} - -/*! - * De-allocates the DRAM memory for the frame buffer. - * - * @param fbi framebuffer information pointer - * - * @return Error code indicating success or failure - */ -static int virtfb_unmap_video_memory(struct fb_info *fbi) -{ - dma_free_coherent(fbi->device, fbi->fix.smem_len, - fbi->screen_base, fbi->fix.smem_start); - fbi->screen_base = 0; - fbi->fix.smem_start = 0; - fbi->fix.smem_len = 0; - return 0; -} - -/*! - * Initializes the framebuffer information pointer. After allocating - * sufficient memory for the framebuffer structure, the fields are - * filled with custom information passed in from the configurable - * structures. This includes information such as bits per pixel, - * color maps, screen width/height and RGBA offsets. - * - * @return Framebuffer structure initialized with our information - */ -static struct fb_info *virtfb_init_fbinfo(struct fb_ops *ops) -{ - struct fb_info *fbi; - - /* - * Allocate sufficient memory for the fb structure - */ - fbi = framebuffer_alloc(sizeof(unsigned int), NULL); - if (!fbi) - return NULL; - - - fbi->var.activate = FB_ACTIVATE_NOW; - - fbi->fbops = ops; - fbi->flags = FBINFO_FLAG_DEFAULT; - - - return fbi; -} - - -static int virtfb_register(struct fb_info *fbi, unsigned int id) -{ - struct fb_videomode m; - int ret = 0; - - //TODO: Set framebuffer ID - sprintf(fbi->fix.id, "virtual_spf_fb%d", id); - - //Setup small default resolution - fbi->var.xres_virtual = fbi->var.xres = vfbwidth; - fbi->var.yres_virtual = fbi->var.yres = vfbheight; - fbi->var.bits_per_pixel = 32; - - virtfb_check_var(&fbi->var, fbi); - - virtfb_set_fix(fbi); - - /*added first mode to fbi modelist*/ - if (!fbi->modelist.next || !fbi->modelist.prev) - INIT_LIST_HEAD(&fbi->modelist); - fb_var_to_videomode(&m, &fbi->var); - fb_add_videomode(&m, &fbi->modelist); - - fbi->var.activate |= FB_ACTIVATE_FORCE; - acquire_console_sem(); - fbi->flags |= FBINFO_MISC_USEREVENT; - ret = fb_set_var(fbi, &fbi->var); - fbi->flags &= ~FBINFO_MISC_USEREVENT; - release_console_sem(); - - - ret = register_framebuffer(fbi); - if (ret < 0) - goto err0; - - return ret; -err0: - return ret; -} - -static void virtfb_unregister(struct fb_info *fbi) -{ - - unregister_framebuffer(fbi); -} - -/*! - * Main entry function for the framebuffer. The function registers the power - * management callback functions with the kernel and also registers the MXCFB - * callback functions with the core Linux framebuffer driver \b fbmem.c - * - * @return Error code indicating success or failure - */ -int __init virtfb_init(void) -{ - - u32 * fbNum; - int i, ret = 0; - - /* - * Initialize FB structures - */ - - g_fb_list = kzalloc(sizeof(struct fb_info*) * vfbcount, GFP_KERNEL); - for(i=0; ipar; - *fbNum = i; - - ret = virtfb_register(g_fb_list[i], i); - if (ret < 0) - goto virtfb_register_failed; - } - - - return 0; -virtfb_register_failed: -init_fbinfo_failed: - for(i=0; i -#include -#include -#include -#include "shmE2.h" - -main(int argc, char *argv[]) -{ - if (argc != 3 || (strcmp(argv[1], "set") != 0 && strcmp(argv[1], "del") != 0 && strcmp(argv[1], "get") != 0 && strcmp(argv[1], "check") != 0 && strcmp(argv[1], "create") != 0 && strcmp(argv[1], "inc") != 0 && strcmp(argv[1], "dec") != 0)) - { - printf("Usage: %s create shm\n", argv[0]); - printf("Usage: %s set variable=value\n", argv[0]); - printf("Usage: %s del all\n", argv[0]); - printf("Usage: %s del variable\n", argv[0]); - printf("Usage: %s get all\n", argv[0]); - printf("Usage: %s get variable\n", argv[0]); - printf("Usage: %s inc variable\n", argv[0]); - printf("Usage: %s dec variable\n", argv[0]); - printf("Usage: %s check variable\n", argv[0]); - exit(0); - } - - char *shm = NULL; - - if (strcmp(argv[1], "create") == 0 && strcmp(argv[2], "shm") == 0) - { - shm = createshm(); - if (shm == NULL) - { - perror("createshm"); - exit(1); - } - printf("shared mem created\n"); - exit(0); - } - - shm = findshm(); - if (shm == NULL) - { - perror("findshm"); - exit(1); - } - - if (strcmp(argv[1], "inc") == 0 && strcmp(argv[2], "all") != 0) - { - strcat(argv[2], "="); - if (incshmentry(shm, argv[2]) != 1) - { - printf("error: value not set\n"); - exit(1); - } - exit(0); - } - - if (strcmp(argv[1], "dec") == 0 && strcmp(argv[2], "all") != 0) - { - strcat(argv[2], "="); - if (decshmentry(shm, argv[2]) != 1) - { - printf("error: value not set\n"); - exit(1); - } - exit(0); - } - - if (strcmp(argv[1], "get") == 0 && strcmp(argv[2], "all") != 0) - { - char *shmbuf = NULL; - shmbuf = malloc(256); - strcat(argv[2], "="); - getshmentry(shm, argv[2], shmbuf, 256); - printf("%s\n", shmbuf); - free(shmbuf); - exit(0); - } - - if (strcmp(argv[1], "get") == 0 && strcmp(argv[2], "all") == 0) - { - char *shmbuf = NULL; - shmbuf = malloc(4096); - getshmentryall(shm, shmbuf, 4096); - printf("%s\n", shmbuf); - free(shmbuf); - exit(0); - } - - if (strcmp(argv[1], "set") == 0) - { - if (setshmentry(shm, argv[2]) != 1) - { - printf("error: value not set\n"); - exit(1); - } - exit(0); - } - - if (strcmp(argv[1], "del") == 0 && strcmp(argv[2], "all") != 0) - { - strcat(argv[2], "="); - delshmentry(shm, argv[2]); - exit(0); - } - - if (strcmp(argv[1], "del") == 0 && strcmp(argv[2], "all") == 0) - { - *shm = '\0'; - exit(0); - } - - if (strcmp(argv[1], "check") == 0) - { - strcat(argv[2], "="); - if (checkshmentry(shm, argv[2]) == 0) - printf("not exist\n"); - else - printf("exist\n"); - exit(0); - } - - exit(0); -} diff --git a/shmE2/shmE2.h b/shmE2/shmE2.h deleted file mode 100644 index 3f7b491..0000000 --- a/shmE2/shmE2.h +++ /dev/null @@ -1,347 +0,0 @@ -#ifndef SHME2 -#define SHME2 - -#include -#include - -#define SHMSZ 27 -#define KEY 1234 - -static char *createshm() -{ - int shmid; - key_t key = KEY; - char *shm = NULL; - - if ((shmid = shmget(key, SHMSZ, IPC_CREAT | 0666)) < 0) - { - return NULL; - } - - shm = (char *) shmat(shmid, NULL, 0); - if (shm == (char *) - 1) - return NULL; - - *shm = '\0'; - - return shm; -} - -static char *findshm() -{ - int shmid; - key_t key = KEY; - char *shm = NULL; - - if ((shmid = shmget(key, SHMSZ, 0666)) < 0) - { - return NULL; - } - - shm = (char *) shmat(shmid, NULL, 0); - if (shm == (char *) - 1) - return NULL; - - return shm; -} - -static int delshmentry(char *shm, char *key) -{ - if (shm == NULL) return -1; - char *vbuf = NULL, *shmbuf = NULL; - char *v, *s = shm; - int matchkey = 0; - int ret = 0; - - vbuf = (char *) malloc(256); - if (vbuf == NULL) - return -1; - v = vbuf; - memset(vbuf, '\0', 256); - - //FIXME: here we can have a segfault - shmbuf = (char *) malloc(4096); - if (shmbuf == NULL) - { - free(vbuf); - return -1; - } - memset(shmbuf, '\0', 4096); - - while (*s != '\0') - { - *v++ = *s++; - *v = '\0'; - if (strcmp(key, vbuf) == 0) - { - matchkey = 1; - ret = 1; - } - if (matchkey == 0 && *s == ';') - { - *v++ = ';'; - *v = '\0'; - strcat(shmbuf, vbuf); - v = vbuf; - s++; - } - if (matchkey == 1 && *s == ';') - { - matchkey = 0; - v = vbuf; - s++; - } - } - if (matchkey == 0) - { - *v++ = ';'; - *v = '\0'; - strcat(shmbuf, vbuf); - v = vbuf; - } - shmbuf[strlen(shmbuf) - 1] = '\0'; - *shm = '\0'; - strcpy(shm, shmbuf); - - free(vbuf); - free(shmbuf); - - return ret; -} - -static int setshmentry(char *shm, char *entry) -{ - if (shm == NULL) return -1; - char *buf = NULL; - char *c = NULL; - int pos = 0; - - if (strlen(entry) > 255) - return -1; - - buf = (char *) malloc(256); - if (buf == NULL) - return -1; - memset(buf, '\0', 256); - - c = strchr(entry, '='); - if (c != NULL) - pos = (c - entry) + 1; - else - { - free(buf); - return -1; - } - - strncpy(buf, entry, pos); - buf[pos] = '\0'; - - if (delshmentry(shm, buf) < 0) - { - free(buf); - return -1; - } - - if (*shm != '\0') - strcat(shm, ";"); - strcat(shm, entry); - - free(buf); - return 1; -} - -static int getshmentry(char *shm, char *key, char *buf, int buflen) -{ - if (shm == NULL) return -1; - char *v, *s = shm, *shmbuf; - int matchkey = 0; - int ret = 0; - - shmbuf = (char *) malloc(256); - if (shmbuf == NULL) - return -1; - memset(shmbuf, '\0', 256); - - v = shmbuf; - - while (*s != '\0') - { - *v++ = *s++; - *v = '\0'; - if (strcmp(key, shmbuf) == 0) - { - v = shmbuf; - matchkey = 1; - ret = 1; - } - if (matchkey == 0 && *s == ';') - { - v = shmbuf; - s++; - } - if (matchkey == 1 && *s == ';') - break; - } - if (matchkey == 0) - v = shmbuf; - *v = '\0'; - - strncpy(buf, shmbuf, buflen - 1); - buf[buflen] = '\0'; - free(shmbuf); - - return ret; -} - -static int checkshmentry(char *shm, char *key) -{ - if (shm == NULL) return -1; - char *v = NULL, *s = shm, *shmbuf = NULL; - int ret = 0; - - shmbuf = (char *) malloc(256); - if (shmbuf == NULL) - return -1; - memset(shmbuf, '\0', 256); - - v = shmbuf; - - while (*s != '\0') - { - *v++ = *s++; - *v = '\0'; - if (strcmp(key, shmbuf) == 0) - { - ret = 1; - break; - } - if (*s == ';') - { - v = shmbuf; - s++; - } - } - free(shmbuf); - return ret; -} - -static int getshmentryall(char *shm, char *shmbuf, int buflen) -{ - if (shm == NULL) return -1; - char *v = shmbuf, *s = shm; - int count = 0; - - while (*s != '\0') - { - *v++ = *s++; - *v = '\0'; - count++; - if (*s == ';') - { - if (count >= buflen - 1) - break; - s++; - *v++ = '\n'; - count++; - } - if (count >= buflen - 1) - break; - } - *v = '\0'; - - return 0; -} - -static int incshmentry(char *shm, char *entry) -{ - if (shm == NULL) return -1; - char *buf = NULL; - char *pch; - int value; - - if (strlen(entry) > 255) - return -1; - - buf = (char *) malloc(256); - if (buf == NULL) - return -1; - memset(buf, '\0', 256); - - getshmentry(shm, entry, buf, 256); - - if (strlen(buf) == 0) - { - sprintf(buf, "%s%d", entry, 1); - if (setshmentry(shm, buf) != 1) - { - free(buf); - return 0; - } - free(buf); - return 1; - } - - pch = strtok(buf, "="); - if (pch != NULL) - { - value = atoi(pch); - value++; - sprintf(buf, "%s%d", entry, value); - if (setshmentry(shm, buf) != 1) - { - free(buf); - return 0; - } - } - - free(buf); - return 1; -} - -static int decshmentry(char *shm, char *entry) -{ - if (shm == NULL) return -1; - char *buf = NULL; - char *pch; - int value; - - if (strlen(entry) > 255) - return -1; - - buf = (char *) malloc(256); - if (buf == NULL) - return -1; - memset(buf, '\0', 256); - - getshmentry(shm, entry, buf, 256); - - if (strlen(buf) == 0) - { - free(buf); - return 1; - } - - pch = strtok(buf, "="); - if (pch != NULL) - { - value = atoi(pch); - value--; - if (value < 1) - { - delshmentry(shm, entry); - free(buf); - return 1; - } - sprintf(buf, "%s%d", entry, value); - if (setshmentry(shm, buf) != 1) - { - free(buf); - return 0; - } - } - - free(buf); - return 1; -} - -#endif diff --git a/showiframe-aarch64 b/showiframe-aarch64 deleted file mode 120000 index a65315e..0000000 --- a/showiframe-aarch64 +++ /dev/null @@ -1 +0,0 @@ -showiframe-arm \ No newline at end of file diff --git a/showiframe-mips b/showiframe-mips deleted file mode 120000 index a65315e..0000000 --- a/showiframe-mips +++ /dev/null @@ -1 +0,0 @@ -showiframe-arm \ No newline at end of file diff --git a/showiframe-sh4/Makefile.am b/showiframe-sh4/Makefile.am deleted file mode 100644 index 31e8b07..0000000 --- a/showiframe-sh4/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -bin_PROGRAMS = showiframe - -showiframe_SOURCES = showiframe.cpp - -AM_CFLAGS = -Wall -Werror -I $(kerneldir)/include diff --git a/showiframe-sh4/autogen.sh b/showiframe-sh4/autogen.sh deleted file mode 100755 index a63dabf..0000000 --- a/showiframe-sh4/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-showiframe-sh4" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/showiframe-sh4/configure.ac b/showiframe-sh4/configure.ac deleted file mode 100644 index e02e4cb..0000000 --- a/showiframe-sh4/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT([showiframe],[1.0],[],[showiframe]) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_OUTPUT([ -Makefile -]) diff --git a/showiframe-sh4/showiframe.cpp b/showiframe-sh4/showiframe.cpp deleted file mode 100644 index ebdc694..0000000 --- a/showiframe-sh4/showiframe.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (c) donald@teamducktales - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void usage(char *name) -{ - printf("usage:\n\n"); - printf("\t%s path\n", name); - printf("\t%s -p path\n", name); - - exit(1); -} - -ssize_t write_all(int fd, const void *buf, size_t count) -{ - int retval; - char *ptr = (char *)buf; - size_t handledcount = 0; - while (handledcount < count) - { - retval = write(fd, &ptr[handledcount], count - handledcount); - - if (retval == 0) return -1; - if (retval < 0) - { - if (errno == EINTR) continue; - return retval; - } - handledcount += retval; - } - return handledcount; -} - -int showiframe(char *path, bool progress) -{ - - int m_video_clip_fd; - int f; - - printf("showSinglePic %s\n", path); - - f = open(path, O_RDONLY); - - if (f) - { - struct stat s; - fstat(f, &s); - - m_video_clip_fd = open("/dev/dvb/adapter0/video0", O_WRONLY); - if (ioctl(m_video_clip_fd, VIDEO_SET_FORMAT, VIDEO_FORMAT_16_9) < 0) - printf("VIDEO_SET_FORMAT failed (%m)\n"); - - if (m_video_clip_fd >= 0) - { - bool seq_end_avail = false; - size_t pos = 0; - unsigned char pes_header[] = { 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x80, 0x00, 0x00 }; - unsigned char seq_end[] = { 0x00, 0x00, 0x01, 0xB7 }; - unsigned char iframe[s.st_size]; - unsigned char stuffing[8192]; - memset(stuffing, 0, 8192); - read(f, iframe, s.st_size); - ioctl(m_video_clip_fd, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_MEMORY); - printf("VIDEO_SELECT_SOURCE MEMORY (%m)\n"); - ioctl(m_video_clip_fd, VIDEO_PLAY); - printf("VIDEO_PLAY (%m)\n"); - ioctl(m_video_clip_fd, VIDEO_CONTINUE); - printf("VIDEO_CONTINUE: (%m)\n"); - ioctl(m_video_clip_fd, VIDEO_CLEAR_BUFFER); - printf("VIDEO_CLEAR_BUFFER: (%m)\n"); - while (pos <= (s.st_size - 4) && !(seq_end_avail = (!iframe[pos] && !iframe[pos + 1] && iframe[pos + 2] == 1 && iframe[pos + 3] == 0xB7))) - ++pos; - - if ((iframe[3] >> 4) != 0xE) // no pes header - { - write_all(m_video_clip_fd, pes_header, sizeof(pes_header)); - } - else - { - iframe[4] = iframe[5] = 0x00; - } - write_all(m_video_clip_fd, iframe, s.st_size); - if (!seq_end_avail) - write_all(m_video_clip_fd, seq_end, sizeof(seq_end)); - write_all(m_video_clip_fd, stuffing, 8192); - - bool end = false; - char progress_ch [4]; - - while (!end) - { - sleep(1); - - if (progress) - { - int progress_fd = open("/proc/progress", O_RDONLY); - read(progress_fd, progress_ch, 4); - close(progress_fd); - - /* Dagobert: Sporadically the video device is not freed before e2 will access it (on ufs922, - * maybe on other too?). - * In that case no TV Picture is available until reboot. So I end showiframe - * a little bit earlier. - * Another solution, and I think a better one, is to kill showiframe from e2 - * if it is running, or wait until it stops. I think the sleep (1) here can be the problem. - * Under some circumstance this is enough time for e2 to try to open the video device itself. - */ - progress_ch[3] = '\0'; - if (atoi(progress_ch) >= 98) - end = true; - - } - } - - printf("********** end showiframe\n"); - - ioctl(m_video_clip_fd, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_DEMUX); - printf("VIDEO_SELECT_SOURCE DEMUX (%m)\n"); - close(m_video_clip_fd); - - } - close(f); - } - else - { - printf("could not open %s", path); - return -1; - } - - return 0; -} - -int main(int argc, char *argv[]) -{ - if (argc == 3) - { - if (strcmp(argv[1], "-p") == 0) - { - showiframe(argv[2], true); - } - } - else if (argc == 2) - { - showiframe(argv[1], false); - } - else - usage(argv[0]); - - return 0; -} diff --git a/showiframe-arm/Makefile.am b/showiframe/Makefile.am similarity index 100% rename from showiframe-arm/Makefile.am rename to showiframe/Makefile.am diff --git a/showiframe-arm/autogen.sh b/showiframe/autogen.sh similarity index 100% rename from showiframe-arm/autogen.sh rename to showiframe/autogen.sh diff --git a/showiframe-arm/configure.ac b/showiframe/configure.ac similarity index 100% rename from showiframe-arm/configure.ac rename to showiframe/configure.ac diff --git a/showiframe/showiframe b/showiframe/showiframe new file mode 100755 index 0000000..497d69a Binary files /dev/null and b/showiframe/showiframe differ diff --git a/showiframe-arm/showiframe.c b/showiframe/showiframe.c similarity index 100% rename from showiframe-arm/showiframe.c rename to showiframe/showiframe.c diff --git a/stfbcontrol/Makefile.am b/stfbcontrol/Makefile.am deleted file mode 100644 index b2a4462..0000000 --- a/stfbcontrol/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -bin_PROGRAMS = stfbcontrol - -stfbcontrol_SOURCES = stfbcontrol.c - -AM_CFLAGS = -Wall diff --git a/stfbcontrol/autogen.sh b/stfbcontrol/autogen.sh deleted file mode 100755 index 246e9a0..0000000 --- a/stfbcontrol/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-stfbcontrol" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/stfbcontrol/configure.ac b/stfbcontrol/configure.ac deleted file mode 100644 index 25f031b..0000000 --- a/stfbcontrol/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT([stfbcontrol],[1.0],[],[stfbcontrol]) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_OUTPUT([ -Makefile -]) diff --git a/stfbcontrol/stfbcontrol.c b/stfbcontrol/stfbcontrol.c deleted file mode 100644 index 025fe04..0000000 --- a/stfbcontrol/stfbcontrol.c +++ /dev/null @@ -1,283 +0,0 @@ -/*********************************************************************** - * - * File: stgfb/Linux/tests/stfbcontrol/stfbcontrol.c - * Copyright (c) 2000, 2004, 2005 STMicroelectronics Limited. - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive for - * more details. - * - \***********************************************************************/ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -/* - * This test builds against the version of stmfb.h in this source tree, rather - * than the one that is shipped as part of the kernel headers package for - * consistency. Normal user applications should use - */ -#include - -void usage(void) -{ - fprintf(stderr, "Usage: stfbcontrol [a num] [cc] [cs] [cr|cy] [fa|fy|fn] [hd|he] [hr|hy] [p|n] [rf|rv]\n"); - fprintf(stderr, "\ta num - Set framebuffer global alpha transparency (range 0-255)\n"); - fprintf(stderr, "\tcc - Enable CVBS output\n"); - fprintf(stderr, "\tcr - Enable component RGB outputs\n"); - fprintf(stderr, "\tcs - Enable Y/C (S-Video) outputs\n"); - fprintf(stderr, "\tcy - Enable component YUV outputs\n"); - fprintf(stderr, "\tfa - Turn adaptive flicker filter on\n"); - fprintf(stderr, "\tfy - Turn simple flicker filter on\n"); - fprintf(stderr, "\tfn - Turn flicker filter off\n"); - fprintf(stderr, "\tg num - Set framebuffer colour gain (range 0-255 = 0-100%%)\n"); - fprintf(stderr, "\thd - Disable HDMI output\n"); - fprintf(stderr, "\the - Enable HDMI output\n"); - fprintf(stderr, "\thr - Set HDMI to RGB output\n"); - fprintf(stderr, "\thy - Set HDMI to YCrCb output\n"); - fprintf(stderr, "\tp - Set framebuffer blend mode to assume premultiplied alpha\n"); - fprintf(stderr, "\tn - Set framebuffer blend mode to assume non-premultiplied alpha\n"); - fprintf(stderr, "\trf - Set framebuffer colour range to full RGB\n"); - fprintf(stderr, "\trv - Set framebuffer colour range to standard video\n"); - exit(1); -} - -/* - * Simple program to control aspects of the ST framebuffer using IOCTL extensions - * defined in stmfb.h - */ -int main(int argc, char **argv) -{ - int fbfd; - int alpha = 255; - int gain = 255; - int cgms = 0; - - struct stmfbio_var_screeninfo_ex varEx = {0}; - struct stmfbio_output_configuration outputConfig = {0}; - - if (argc < 2) - { - usage(); - } - - argc--; - argv++; - - if ((fbfd = open("/dev/fb0", O_RDWR)) < 0) - { - perror("Unable to open framebuffer"); - exit(1); - } - - varEx.layerid = 0; - varEx.caps = 0; - varEx.activate = STMFBIO_ACTIVATE_IMMEDIATE; - - outputConfig.outputid = 1; - if (ioctl(fbfd, STMFBIO_GET_OUTPUT_CONFIG, &outputConfig) < 0) - perror("Getting current output configuration failed"); - - outputConfig.caps = 0; - outputConfig.activate = STMFBIO_ACTIVATE_IMMEDIATE; - outputConfig.analogue_config = 0; - - while (argc > 0) - { - switch (**argv) - { - case 'a': - { - argc--; - argv++; - if (argc <= 0) - { - fprintf(stderr, "Missing alpha value\n"); - usage(); - } - - alpha = atoi(*argv); - if (alpha < 0 || alpha > 255) - { - fprintf(stderr, "Alpha value out of range\n"); - usage(); - } - - varEx.caps |= STMFBIO_VAR_CAPS_OPACITY; - varEx.opacity = alpha; - - break; - } - case 'c': - { - outputConfig.caps |= STMFBIO_OUTPUT_CAPS_ANALOGUE_CONFIG; - switch ((*argv)[1]) - { - case 'c': - outputConfig.analogue_config |= STMFBIO_OUTPUT_ANALOGUE_CVBS; - break; - case 'r': - outputConfig.analogue_config |= STMFBIO_OUTPUT_ANALOGUE_RGB; - break; - case 'y': - outputConfig.analogue_config |= STMFBIO_OUTPUT_ANALOGUE_YPrPb; - break; - case 's': - outputConfig.analogue_config |= STMFBIO_OUTPUT_ANALOGUE_YC; - break; - default: - usage(); - } - break; - } - case 'f': - { - varEx.caps |= STMFBIO_VAR_CAPS_FLICKER_FILTER; - switch ((*argv)[1]) - { - case 'a': - varEx.ff_state = STMFBIO_FF_ADAPTIVE; - break; - case 'y': - varEx.ff_state = STMFBIO_FF_SIMPLE; - break; - case 'n': - varEx.ff_state = STMFBIO_FF_OFF; - break; - default: - usage(); - } - break; - } - case 'g': - { - argc--; - argv++; - if (argc <= 0) - { - fprintf(stderr, "Missing gain value\n"); - usage(); - } - - gain = atoi(*argv); - if (gain < 0 || gain > 255) - { - fprintf(stderr, "gain value out of range\n"); - usage(); - } - - varEx.caps |= STMFBIO_VAR_CAPS_GAIN; - varEx.gain = gain; - - break; - } - case 'h': - { - outputConfig.caps |= STMFBIO_OUTPUT_CAPS_HDMI_CONFIG; - - switch ((*argv)[1]) - { - case 'r': - outputConfig.hdmi_config &= ~STMFBIO_OUTPUT_HDMI_YUV; - break; - case 'y': - outputConfig.hdmi_config |= STMFBIO_OUTPUT_HDMI_YUV; - break; - case 'd': - outputConfig.hdmi_config |= STMFBIO_OUTPUT_HDMI_DISABLED; - break; - case 'e': - outputConfig.hdmi_config &= ~STMFBIO_OUTPUT_HDMI_DISABLED; - break; - default: - usage(); - } - break; - } - case 'p': - { - varEx.caps |= STMFBIO_VAR_CAPS_PREMULTIPLIED; - varEx.premultiplied_alpha = 1; - break; - } - case 'n': - { - varEx.caps |= STMFBIO_VAR_CAPS_PREMULTIPLIED; - varEx.premultiplied_alpha = 0; - break; - } - case 'r': - { - switch ((*argv)[1]) - { - case 'f': - { - varEx.caps |= STBFBIO_VAR_CAPS_RESCALE_COLOUR_TO_VIDEO_RANGE; - varEx.rescale_colour_to_video_range = 0; - break; - } - case 'v': - { - varEx.caps |= STBFBIO_VAR_CAPS_RESCALE_COLOUR_TO_VIDEO_RANGE; - varEx.rescale_colour_to_video_range = 1; - break; - } - default: - usage(); - } - break; - } - case 'x': - { - argc--; - argv++; - if (argc <= 0) - { - fprintf(stderr, "Missing cgms value\n"); - usage(); - } - - cgms = atoi(*argv); - /* - * Note: This IOCTL is an _IO _not_ an _IOW, hence takes the argument - * value directly, not via a pointer. - */ - ioctl(fbfd, STMFBIO_SET_CGMS_ANALOG, cgms); - - break; - } - default: - { - fprintf(stderr, "Unknown option '%s'\n", *argv); - usage(); - } - } - - argc--; - argv++; - } - - if (varEx.caps != STMFBIO_VAR_CAPS_NONE) - { - if (ioctl(fbfd, STMFBIO_SET_VAR_SCREENINFO_EX, &varEx) < 0) - perror("setting extended screen info failed"); - } - - if (outputConfig.caps != STMFBIO_OUTPUT_CAPS_NONE) - { - if (ioctl(fbfd, STMFBIO_SET_OUTPUT_CONFIG, &outputConfig) < 0) - perror("setting output configuration failed"); - } - - return 0; -} diff --git a/tfd2mtd/Makefile.am b/tfd2mtd/Makefile.am deleted file mode 100644 index 6d76e5c..0000000 --- a/tfd2mtd/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -bin_PROGRAMS = tfd2mtd - -tfd2mtd_SOURCES = tfd2mtd.c - -AM_CFLAGS = -Wall diff --git a/tfd2mtd/autogen.sh b/tfd2mtd/autogen.sh deleted file mode 100755 index b4a8bac..0000000 --- a/tfd2mtd/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-tfd2mtd" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/tfd2mtd/configure.ac b/tfd2mtd/configure.ac deleted file mode 100644 index c5e6fe2..0000000 --- a/tfd2mtd/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT([tfd2mtd],[1.0],[],[tfd2mtd]) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_OUTPUT([ -Makefile -]) diff --git a/tfd2mtd/tfd2mtd.c b/tfd2mtd/tfd2mtd.c deleted file mode 100644 index e6612af..0000000 --- a/tfd2mtd/tfd2mtd.c +++ /dev/null @@ -1,178 +0,0 @@ -#include - -#define TFDFILEHEADERSIZE 10 -#define TFDFILEVERSION 1 - -typedef struct -{ - unsigned short int HdrSize; - unsigned short int CRC; - unsigned short int SysID; - unsigned short int FileVersion; - unsigned short int NrOfBlocks; -} tTFDFileHeader; - -typedef struct -{ - unsigned short int BlockSize; - unsigned short int CRC; - unsigned short int BlockType; - unsigned short int UncompressedSize; -} tTFDBlockHeader; - -typedef struct -{ - unsigned short int UncompressedSize; - unsigned short int CompressedSize; - unsigned short int CRC; -} tFlashHeader; - - -unsigned short int CRC16Table[] = -{ - 0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241, 0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440, - 0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40, 0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841, - 0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40, 0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41, - 0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641, 0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040, - 0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240, 0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441, - 0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41, 0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840, - 0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41, 0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40, - 0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640, 0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041, - 0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240, 0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441, - 0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41, 0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840, - 0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41, 0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40, - 0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640, 0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041, - 0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241, 0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440, - 0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40, 0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841, - 0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40, 0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41, - 0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641, 0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040 -}; - -unsigned short CRC16(unsigned short StartValue, void *StartAddress, unsigned long Length) -{ - volatile unsigned char *pData; - unsigned short CRC = StartValue; - - for (pData = StartAddress; pData < (unsigned char *) StartAddress + Length; pData++) - CRC = CRC16Table [*pData ^ (CRC & 0x00FF)] ^ (CRC >> 8); - - return CRC; -} - -void swapshort(unsigned short *s) -{ - *s = ((*s >> 8) & 0xff) | ((*s & 0xff) << 8); -} - -//Exit codes: 0 = successfull -// 1 = TFD processing failed but flash should be ok -// 2 = TFD processing failed and flash might be corrupted - -int main(int argc, char **argv) -{ - //reserve enough space to hold the data and header - unsigned char data[32780]; - - size_t ret, retdata; - tTFDFileHeader FileHeader; - tTFDBlockHeader *BlockHeader; - tFlashHeader *FlashHeader; - int i; - unsigned short CalcCRC; - - - //Read the file header - ret = fread(&FileHeader, 1, TFDFILEHEADERSIZE, stdin); - if (ret != TFDFILEHEADERSIZE) - { - fprintf(stderr, "Couldn't read file header. Just got %d bytes\n", ret); - return 1; - } - - //The TF7700 Toppy uses little endian - swapshort(&FileHeader.HdrSize); - swapshort(&FileHeader.CRC); - swapshort(&FileHeader.SysID); - swapshort(&FileHeader.FileVersion); - swapshort(&FileHeader.NrOfBlocks); - - if ((FileHeader.HdrSize + 2) != TFDFILEHEADERSIZE) - { - fprintf(stderr, "Invalid file header size. %d instead of %d\n", FileHeader.HdrSize + 2, TFDFILEHEADERSIZE); - return 1; - } - if (FileHeader.FileVersion != TFDFILEVERSION) - { - fprintf(stderr, "Invalid file version. %d instead of %d\n", FileHeader.FileVersion, TFDFILEVERSION); - return 1; - } - fprintf(stderr, "SysID = %d, NrOfBlocks = %d\n", FileHeader.SysID, FileHeader.NrOfBlocks); - - BlockHeader = (tTFDBlockHeader *)&data[0]; - FlashHeader = (tFlashHeader *)&data[2]; - - for (i = 0; i < FileHeader.NrOfBlocks; i++) - { - fprintf(stderr, "."); - ret = fread(BlockHeader, 1, sizeof(tTFDBlockHeader), stdin); - if (ret && (ret != sizeof(tTFDBlockHeader))) - { - fprintf(stderr, "\nReached EOF in the middle of a block header (%d instead of %d bytes)\n", ret, sizeof(tTFDBlockHeader)); - return 2; - } - - swapshort(&BlockHeader->BlockSize); - swapshort(&BlockHeader->CRC); - - retdata = fread(&data[sizeof(tTFDBlockHeader)], 1, BlockHeader->BlockSize - 6, stdin); - if (retdata != (BlockHeader->BlockSize - 6)) - { - fprintf(stderr, "\nReached EOF while reading a data block (%d instead of %d bytes)\n", retdata, BlockHeader->BlockSize - 6); - return 2; - } - - //Do a CRC-16 check - CalcCRC = CRC16(0, &BlockHeader->BlockType, BlockHeader->BlockSize - 2); - swapshort(&BlockHeader->BlockType); - swapshort(&BlockHeader->UncompressedSize); - - if (BlockHeader->CRC != CalcCRC) - { - fprintf(stderr, "\nInvalid CRC in block %d (0x%04x instead of 0x%04x)\n", i + 1, CalcCRC, BlockHeader->CRC); - return 2; - } - - //Create a flash header - FlashHeader->UncompressedSize = BlockHeader->UncompressedSize; - FlashHeader->CompressedSize = BlockHeader->BlockSize - 6; - FlashHeader->CRC = CRC16(0, &data[sizeof(tTFDBlockHeader)], BlockHeader->BlockSize - 6); - swapshort(&FlashHeader->UncompressedSize); - swapshort(&FlashHeader->CompressedSize); - swapshort(&FlashHeader->CRC); - - retdata = fwrite(&FlashHeader->UncompressedSize, 1, BlockHeader->BlockSize, stdout); - if (retdata != (BlockHeader->BlockSize)) - { - fprintf(stderr, "\nReached EOF while trying to write a data block (%d instead of %d bytes)\n", retdata, BlockHeader->BlockSize); - return 2; - } - }; - - //Write the flash trailer (fe fe de 77 ff ff) - FlashHeader->UncompressedSize = 0xfefe; - FlashHeader->CompressedSize = 0x77de; - FlashHeader->CRC = 0xffff; - - retdata = fwrite(&FlashHeader->UncompressedSize, 1, sizeof(tFlashHeader), stdout); - if (retdata != sizeof(tFlashHeader)) - { - fprintf(stderr, "\nFailed to write the last block (%d instead of %d bytes)\n", retdata, sizeof(tFlashHeader)); - return 2; - } - - - fprintf(stderr, "\ndone.\n"); - - return 0; -} - diff --git a/tffpctl/Makefile.am b/tffpctl/Makefile.am deleted file mode 100644 index f4ae490..0000000 --- a/tffpctl/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -bin_PROGRAMS = tffpctl - -tffpctl_SOURCES = tffpctl.c - -AM_CFLAGS = -Wall diff --git a/tffpctl/autogen.sh b/tffpctl/autogen.sh deleted file mode 100755 index 560f522..0000000 --- a/tffpctl/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-tffpctl" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/tffpctl/configure.ac b/tffpctl/configure.ac deleted file mode 100644 index 6b92707..0000000 --- a/tffpctl/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT([tffpctl],[1.0],[],[tffpctl]) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_OUTPUT([ -Makefile -]) diff --git a/tffpctl/frontpanel.h b/tffpctl/frontpanel.h deleted file mode 100644 index 54e009c..0000000 --- a/tffpctl/frontpanel.h +++ /dev/null @@ -1,177 +0,0 @@ -#ifndef FRONTPANEL_H -#define FRONTPANEL_H -/* - This device driver uses the following device entries: - - /dev/fpc c 62 0 # FP control (read/write, for clock- and timer operations, shutdown etc.) - /dev/rc c 62 1 # Remote Control (read-only) - /dev/fplarge c 62 2 # Direct access to the 8 character display (write-only) - /dev/fpsmall c 62 3 # Direct access to the 4 character display (write-only) - */ - -#include "tftypes.h" - -#define FRONTPANEL_MAJOR 62 /* experimental major number */ -#define FRONTPANEL_MINOR_FPC 0 -#define FRONTPANEL_MINOR_RC 1 -#define FRONTPANEL_MINOR_FPLARGE 2 -#define FRONTPANEL_MINOR_FPSMALL 3 - -/* RWSS SSSS SSSS SSSS KKKK KKKK NNNN NNNN - R = read - W = write - S = parameter size - K = ioctl magic = 0x3a - N = command number -*/ - -#define FRONTPANELGETTIME 0x40003a00 | (sizeof(frontpanel_ioctl_time) << 16) -#define FRONTPANELSETTIME 0x40003a01 -#define FRONTPANELSYNCSYSTIME 0x40003a02 -#define FRONTPANELCLEARTIMER 0x40003a03 -#define FRONTPANELSETTIMER 0x40003a04 -#define FRONTPANELBRIGHTNESS 0x40003a05 | (sizeof(frontpanel_ioctl_brightness) << 16) -#define FRONTPANELIRFILTER1 0x40003a06 -#define FRONTPANELIRFILTER2 0x40003a07 -#define FRONTPANELIRFILTER3 0x40003a08 -#define FRONTPANELIRFILTER4 0x40003a09 -#define FRONTPANELPOWEROFF 0x40003a0a -#define FRONTPANELBOOTREASON 0x40003a0b | (sizeof(frontpanel_ioctl_bootreason) << 16) -#define FRONTPANELCLEAR 0x40003a0c -#define FRONTPANELTYPEMATICDELAY 0x40003a0d | (sizeof(frontpanel_ioctl_typematicdelay) << 16) -#define FRONTPANELTYPEMATICRATE 0x40003a0e | (sizeof(frontpanel_ioctl_typematicrate) << 16) -#define FRONTPANELKEYEMULATION 0x40003a0f | (sizeof(frontpanel_ioctl_keyemulation) << 16) -#define FRONTPANELREBOOT 0x40003a10 -#define FRONTPANELSYNCFPTIME 0x40003a11 -#define FRONTPANELSETGMTOFFSET 0x40003a12 -#define FRONTPANELRESEND 0x40003a13 -#define FRONTPANELALLCAPS 0x40003a14 | (sizeof(frontpanel_ioctl_allcaps) << 16) -#define FRONTPANELSCROLLMODE 0x40003a15 | (sizeof(frontpanel_ioctl_scrollmode) << 16) -#define FRONTPANELICON 0x40003a20 | (sizeof(frontpanel_ioctl_icons) << 16) - -//The following icons belong to block 1 -#define FPICON_IRDOT 0x00000001 -#define FPICON_POWER 0x00000002 -#define FPICON_COLON 0x00000004 -#define FPICON_AM 0x00000008 -#define FPICON_PM 0x00000010 -#define FPICON_TIMER 0x00000020 -#define FPICON_AC3 0x00000040 -#define FPICON_TIMESHIFT 0x00000080 -#define FPICON_TV 0x00000100 -#define FPICON_MUSIC 0x00000200 -#define FPICON_DISH 0x00000400 -#define FPICON_MP3 0x00000800 -#define FPICON_TUNER1 0x00001000 -#define FPICON_TUNER2 0x00002000 -#define FPICON_REC 0x00004000 -#define FPICON_MUTE 0x00008000 -#define FPICON_PAUSE 0x00010000 -#define FPICON_FWD 0x00020000 -#define FPICON_RWD 0x00040000 -#define FPICON_xxx2 0x00080000 -#define FPICON_PLAY 0x00100000 -#define FPICON_xxx4 0x00200000 -#define FPICON_NETWORK 0x00400000 -#define FPICON_DOLBY 0x00800000 -#define FPICON_ATTN 0x01000000 -#define FPICON_DOLLAR 0x02000000 -#define FPICON_AUTOREWRIGHT 0x04000000 -#define FPICON_AUTOREWLEFT 0x08000000 - -//The following icons belong to block 2 -#define FPICON_CDCENTER 0x00000001 -#define FPICON_CD1 0x00000002 -#define FPICON_CD2 0x00000004 -#define FPICON_CD3 0x00000008 -#define FPICON_CD4 0x00000010 -#define FPICON_CD5 0x00000020 -#define FPICON_CD6 0x00000040 -#define FPICON_CD7 0x00000080 -#define FPICON_CD8 0x00000100 -#define FPICON_CD9 0x00000200 -#define FPICON_CD10 0x00000400 -#define FPICON_CD11 0x00000800 -#define FPICON_CD12 0x00001000 - -#define FPICON_HDD 0x00002000 -#define FPICON_HDDFRAME 0x00004000 -#define FPICON_HDD1 0x00008000 -#define FPICON_HDD2 0x00010000 -#define FPICON_HDD3 0x00020000 -#define FPICON_HDD4 0x00040000 -#define FPICON_HDD5 0x00080000 -#define FPICON_HDD6 0x00100000 -#define FPICON_HDD7 0x00200000 -#define FPICON_HDD8 0x00400000 -#define FPICON_HDDFULL 0x00800000 - -typedef struct -{ - word year; - word month; - word day; - word dow; - char sdow[4]; - word hour; - word min; - word sec; - dword now; -} frontpanel_ioctl_time; - -typedef struct -{ - byte bright; -} frontpanel_ioctl_brightness; - -typedef struct -{ - byte reason; -} frontpanel_ioctl_bootreason; - -typedef struct -{ - byte onoff; -} frontpanel_ioctl_irfilter; - -typedef struct -{ - dword Icons1; - dword Icons2; - byte BlinkMode; -} frontpanel_ioctl_icons; - -typedef struct -{ - byte TypematicDelay; -} frontpanel_ioctl_typematicdelay; - -typedef struct -{ - byte TypematicRate; -} frontpanel_ioctl_typematicrate; - -typedef struct -{ - byte KeyEmulation; -} frontpanel_ioctl_keyemulation; - -typedef struct -{ - byte AllCaps; -} frontpanel_ioctl_allcaps; - -typedef struct -{ - byte ScrollMode; - byte ScrollPause; - byte ScrollDelay; -} frontpanel_ioctl_scrollmode; - - -extern void vfdSetGmtWakeupTime(time_t time); -extern void vfdSetGmtTime(time_t time); -extern time_t vfdGetGmtTime(void); -extern int getBootReason(void); - -#endif diff --git a/tffpctl/tffpctl.c b/tffpctl/tffpctl.c deleted file mode 100644 index 98acdd2..0000000 --- a/tffpctl/tffpctl.c +++ /dev/null @@ -1,614 +0,0 @@ -/**************************************************************************/ -/* Name : Front Panel Driver Module control tool */ -/* */ -/* Author: Gustav Gans */ -/* */ -/* Licence: This file is subject to the terms and conditions of the */ -/* GNU General Public License version 2. */ -/* */ -/* 2008-06-10 V1.0 First release */ -/* 2008-07-19 V2.0 Added --typematicdelay, --typematicrate and */ -/* --keyemulationmode */ -/* 2009-01-06 V3.1 Added the --reboot command */ -/* Synced version number with front panel driver module */ -/* 2009-02-08 V3.2 Added GMT offset handling */ -/* 2009-01-06 V3.7 Added the --resend command */ -/* Synced version number with front panel driver module */ -/* 2009-06-25 V4.0 Added the --allcaps switch */ -/* 2009-06-29 V4.1 Added the following switches: */ -/* --scrollmode */ -/* --scrollpause */ -/* --scrolldelay */ -/* tffpctl now saves some settings into a file. */ -/* --restoresettings */ -/* 2011-07-23 V4.2 Added lonkeypress option to keyemulation mode */ -/**************************************************************************/ - -#define VERSION "V4.2" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "frontpanel.h" - -#define _FRONTPANELGETTIME 0x00 -#define _FRONTPANELSETTIME 0x01 -#define _FRONTPANELSYNCSYSTIME 0x02 -#define _FRONTPANELCLEARTIMER 0x03 -#define _FRONTPANELSETTIMER 0x04 -#define _FRONTPANELBRIGHTNESS 0x05 -#define _FRONTPANELIRFILTER1 0x06 -#define _FRONTPANELIRFILTER2 0x07 -#define _FRONTPANELIRFILTER3 0x08 -#define _FRONTPANELIRFILTER4 0x09 -#define _FRONTPANELPOWEROFF 0x0a -#define _FRONTPANELBOOTREASON 0x0b -#define _FRONTPANELCLEAR 0x0c -#define _FRONTPANELTYPEMATICDELAY 0x0d -#define _FRONTPANELTYPEMATICRATE 0x0e -#define _FRONTPANELKEYEMULATION 0x0f -#define _FRONTPANELREBOOT 0x10 -#define _FRONTPANELICON 0x11 -#define _HELP 0x12 -#define _FRONTPANELSYNCFPTIME 0x13 -#define _FRONTPANELSETGMTOFFSET 0x14 -#define _FRONTPANELRESEND 0x15 -#define _FRONTPANELALLCAPS 0x16 -#define _FRONTPANELSCROLLMODE 0x17 -#define _FRONTPANELSCROLLPAUSE 0x18 -#define _FRONTPANELSCROLLDELAY 0x19 -#define _FRONTPANELRESTORSETTINGS 0x1a - - -#define SETTINGSFILE "/etc/tffpctl.conf" -#define SETTINGSVERSION 1 - -typedef struct -{ - unsigned char Version; - unsigned char Brightness; - unsigned char IRFilter1; - unsigned char IRFilter2; - unsigned char IRFilter3; - unsigned char IRFilter4; - unsigned char AllCaps; - unsigned char TypematicDelay; - unsigned char TypematicRate; - unsigned char KeyemulationMode; - unsigned char ScrollMode; - unsigned char ScrollPause; - unsigned char ScrollDelay; - //--------------- for future enhancements: settings version 1 ends here -} tSettings; - -tSettings Settings; - -void Help(void) -{ - printf("Topfield TF7700HDPVR front panel controller " VERSION "\n\n"); - printf("usage: tffpctl [options]\n\n"); - - printf("--gettime returns the current frontpanel time\n"); - printf("--settime set the front panel time\n"); - printf("--syncsystime sets the system time from the FP time\n"); - printf("--syncfptime sets the FP time from the system time\n"); - printf("--setgmtoffset set the GMT offset from the timezone\n"); - printf("--cleartimers clears all front panel timers\n"); - printf("--settimer sets a front panel timer\n"); - printf("--brightness <0 to 5> adjusts the brightness of the front panel display\n"); - printf("--irfilter1 <0|1> turns IR mode 1 on or off\n"); - printf("--irfilter2 <0|1> turns IR mode 2 on or off\n"); - printf("--irfilter3 <0|1> turns IR mode 3 on or off\n"); - printf("--irfilter4 <0|1> turns IR mode 4 on or off\n"); - printf("--poweroff turns the power off\n"); - printf("--reboot initiates a hard reboot\n"); - printf("--bootreason returns the boot reason\n"); - printf("--cleardisplay clears the front panel display\n"); - printf("--resend sends the whole display buffer to the VFD\n"); - printf("--allcaps <0|1> show all chars of the big display in CAPS letters\n"); - printf("--icon defines which icons to displayed\n"); - - printf("--typematicdelay <0 to 255> delay between the first and the repeated keys\n"); - printf("--typematicrate <0 to 255> delay between the repeated key codes\n"); - printf(" the typematic rate unit is about 1/9th of a second\n"); - printf("--keyemulationmode <0 to 2> selects the emulation mode (0=TF7700, 1=UFS910, 2=TF7700LKP)\n"); - - printf("--scrollmode <0 to 2> selects a scroll mode (0=none, 1=once, 2=always)\n"); - printf("--scrollpause <1 to 255> sets the pause between the first 8 chars and the following scroll (n*100ms)\n"); - printf("--scrolldelay <1 to 255> sets the delay between 2 text shifts (n*100ms)\n"); - - printf("--restoresettings resends several settings to the frontpanel\n"); - - printf("--help this screen\n"); -} - -void LoadSettings(void) -{ - FILE *fp; - - Settings.Version = 0; - if ((fp = fopen(SETTINGSFILE, "rb"))) - { - fread(&Settings, sizeof(Settings), 1, fp); - fclose(fp); - } - - switch (Settings.Version) - { - case 0: - { - //Loading failed, use defaults - Settings.Brightness = 3; //Medium - Settings.IRFilter1 = 1; //Mode 1 and 4 active (my remote transmits on mode 4) - Settings.IRFilter2 = 0; - Settings.IRFilter3 = 0; - Settings.IRFilter4 = 1; - Settings.AllCaps = 1; //Capital characters on - Settings.TypematicDelay = 3; - Settings.TypematicRate = 1; - Settings.KeyemulationMode = 1; //Kathrein mode - Settings.ScrollMode = 1; //Scroll once - Settings.ScrollPause = 100; //1s pause until start of scroll - Settings.ScrollDelay = 10; //Scroll every 100ms - //no break here - } - } - Settings.Version = SETTINGSVERSION; -} - -void SaveSettings(void) -{ - FILE *fp; - - if ((fp = fopen(SETTINGSFILE, "wb"))) - { - fwrite(&Settings, sizeof(Settings), 1, fp); - fclose(fp); - } - else - { - printf("Failed to open %s\n", SETTINGSFILE); - } -} - -int main(int argc, char **argv) -{ - int file_fp; - - if ((file_fp = open("/dev/fpc", O_RDWR)) < 0) - { - if ((file_fp = open("/dev/.static/dev/fpc", O_RDWR)) < 0) - { - printf("FP: Error - can't open /dev/fpc\n"); - return 0; - } - } - - if (argc < 2) - { - Help(); - return 0; - } - - LoadSettings(); - - while (1) - { - int c; - int option_index = 0; - static struct option long_options[] = - { - {"gettime", no_argument , 0, 0}, - {"settime", required_argument, 0, 0}, - {"syncsystime", no_argument , 0, 0}, - - {"cleartimers", no_argument , 0, 0}, - {"settimer", required_argument, 0, 0}, - - {"brightness", required_argument, 0, 0}, - {"irfilter1", required_argument, 0, 0}, - {"irfilter2", required_argument, 0, 0}, - {"irfilter3", required_argument, 0, 0}, - {"irfilter4", required_argument, 0, 0}, - {"poweroff", no_argument , 0, 0}, - {"bootreason", no_argument , 0, 0}, - {"cleardisplay", no_argument , 0, 0}, - - {"typematicdelay", required_argument, 0, 0}, - {"typematicrate", required_argument, 0, 0}, - {"keyemulationmode", required_argument, 0, 0}, - {"reboot", no_argument , 0, 0}, - {"icon", required_argument, 0, 0}, - - {"help", no_argument , 0, 0}, - - {"syncfptime", no_argument , 0, 0}, - {"setgmtoffset", no_argument , 0, 0}, - - {"resend", no_argument , 0, 0}, - {"allcaps", required_argument, 0, 0}, - - {"scrollmode", required_argument, 0, 0}, - {"scrollpause", required_argument, 0, 0}, - {"scrolldelay", required_argument, 0, 0}, - - {"restoresettings", no_argument , 0, 0}, - - {NULL, 0, 0, 0} - }; - - c = getopt_long(argc, argv, "", long_options, &option_index); - if (c == -1) break; - - switch (c) - { - case 0: - { - switch (option_index) - { - case _FRONTPANELGETTIME: - { - frontpanel_ioctl_time fpdata; - - ioctl(file_fp, FRONTPANELGETTIME, &fpdata); - printf("%d-%2.2d-%2.2d %s %2.2d:%2.2d:%2.2d\n", fpdata.year, fpdata.month, fpdata.day, fpdata.sdow, fpdata.hour, fpdata.min, fpdata.sec); - break; - } - case _FRONTPANELSETTIME: - { - frontpanel_ioctl_time fpdata; - char s[8]; - - if (strlen(optarg) == 14) - { - //yyyymmddhhmmss - strncpy(s, &optarg[ 0], 4); - s[4] = '\0'; - fpdata.year = atoi(s); - strncpy(s, &optarg[ 4], 2); - s[2] = '\0'; - fpdata.month = atoi(s); - strncpy(s, &optarg[ 6], 2); - s[2] = '\0'; - fpdata.day = atoi(s); - strncpy(s, &optarg[ 8], 2); - s[2] = '\0'; - fpdata.hour = atoi(s); - strncpy(s, &optarg[10], 2); - s[2] = '\0'; - fpdata.min = atoi(s); - strncpy(s, &optarg[12], 2); - s[2] = '\0'; - fpdata.sec = atoi(s); - ioctl(file_fp, FRONTPANELSETTIME, &fpdata); - } - else - { - printf("Invalid settime parameter\n"); - } - break; - } - case _FRONTPANELSYNCSYSTIME: - { - ioctl(file_fp, FRONTPANELSYNCSYSTIME, NULL); - break; - } - case _FRONTPANELCLEARTIMER: - { - ioctl(file_fp, FRONTPANELCLEARTIMER, NULL); - break; - } - case _FRONTPANELSETTIMER: - { - frontpanel_ioctl_time fpdata; - char s[8]; - - if (strlen(optarg) == 12) - { - //yyyymmddhhmm - strncpy(s, &optarg[ 0], 4); - s[4] = '\0'; - fpdata.year = atoi(s); - strncpy(s, &optarg[ 4], 2); - s[2] = '\0'; - fpdata.month = atoi(s); - strncpy(s, &optarg[ 6], 2); - s[2] = '\0'; - fpdata.day = atoi(s); - strncpy(s, &optarg[ 8], 2); - s[2] = '\0'; - fpdata.hour = atoi(s); - strncpy(s, &optarg[10], 2); - s[2] = '\0'; - fpdata.min = atoi(s); - ioctl(file_fp, FRONTPANELSETTIMER, &fpdata); - } - else - { - printf("Invalid settimer parameter\n"); - } - break; - } - case _FRONTPANELBRIGHTNESS: - { - frontpanel_ioctl_brightness fpdata; - - fpdata.bright = atoi(optarg); - if (fpdata.bright > 5) fpdata.bright = 5; - Settings.Brightness = fpdata.bright; - SaveSettings(); - ioctl(file_fp, FRONTPANELBRIGHTNESS, &fpdata); - break; - } - case _FRONTPANELIRFILTER1: - { - frontpanel_ioctl_irfilter fpdata; - - fpdata.onoff = atoi(optarg); - if (fpdata.onoff > 1) fpdata.onoff = 1; - Settings.IRFilter1 = fpdata.onoff; - SaveSettings(); - ioctl(file_fp, FRONTPANELIRFILTER1, &fpdata); - break; - } - case _FRONTPANELIRFILTER2: - { - frontpanel_ioctl_irfilter fpdata; - - fpdata.onoff = atoi(optarg); - if (fpdata.onoff > 1) fpdata.onoff = 1; - Settings.IRFilter2 = fpdata.onoff; - SaveSettings(); - ioctl(file_fp, FRONTPANELIRFILTER2, &fpdata); - break; - } - case _FRONTPANELIRFILTER3: - { - frontpanel_ioctl_irfilter fpdata; - - fpdata.onoff = atoi(optarg); - if (fpdata.onoff > 1) fpdata.onoff = 1; - Settings.IRFilter3 = fpdata.onoff; - SaveSettings(); - ioctl(file_fp, FRONTPANELIRFILTER3, &fpdata); - break; - } - case _FRONTPANELIRFILTER4: - { - frontpanel_ioctl_irfilter fpdata; - - fpdata.onoff = atoi(optarg); - if (fpdata.onoff > 1) fpdata.onoff = 1; - Settings.IRFilter4 = fpdata.onoff; - SaveSettings(); - ioctl(file_fp, FRONTPANELIRFILTER4, &fpdata); - break; - } - case _FRONTPANELPOWEROFF: - { - ioctl(file_fp, FRONTPANELPOWEROFF, NULL); - break; - } - case _FRONTPANELREBOOT: - { - ioctl(file_fp, FRONTPANELREBOOT, NULL); - break; - } - case _FRONTPANELBOOTREASON: - { - frontpanel_ioctl_bootreason fpdata; - - ioctl(file_fp, FRONTPANELBOOTREASON, &fpdata); - printf("%d\n", fpdata.reason); - break; - } - case _FRONTPANELCLEAR: - { - ioctl(file_fp, FRONTPANELCLEAR, NULL); - break; - } - case _FRONTPANELICON: - { - frontpanel_ioctl_icons fpdata; - char s[12]; - - if (strlen(optarg) == 19) - { - //xxxxxxxx_xxxxxxxx_m - strncpy(s, &optarg[ 0], 8); - s[8] = '\0'; - fpdata.Icons1 = strtol(s, NULL, 16); - strncpy(s, &optarg[ 9], 8); - s[8] = '\0'; - fpdata.Icons2 = strtol(s, NULL, 16); - strncpy(s, &optarg[18], 1); - s[1] = '\0'; - fpdata.BlinkMode = strtol(s, NULL, 16) & 0x0f; - ioctl(file_fp, FRONTPANELICON, &fpdata); - } - else - { - printf("Invalid icon parameter\n"); - } - break; - } - case _FRONTPANELTYPEMATICDELAY: - { - frontpanel_ioctl_typematicdelay fpdata; - - fpdata.TypematicDelay = atoi(optarg); - Settings.TypematicDelay = fpdata.TypematicDelay; - SaveSettings(); - ioctl(file_fp, FRONTPANELTYPEMATICDELAY, &fpdata); - break; - } - case _FRONTPANELTYPEMATICRATE: - { - frontpanel_ioctl_typematicrate fpdata; - - fpdata.TypematicRate = atoi(optarg); - Settings.TypematicRate = fpdata.TypematicRate; - SaveSettings(); - ioctl(file_fp, FRONTPANELTYPEMATICRATE, &fpdata); - break; - } - case _FRONTPANELKEYEMULATION: - { - frontpanel_ioctl_keyemulation fpdata; - - fpdata.KeyEmulation = atoi(optarg); - Settings.KeyemulationMode = fpdata.KeyEmulation; - SaveSettings(); - ioctl(file_fp, FRONTPANELKEYEMULATION, &fpdata); - break; - } - case _FRONTPANELSYNCFPTIME: - { - ioctl(file_fp, FRONTPANELSYNCFPTIME, NULL); - break; - } - case _FRONTPANELSETGMTOFFSET: - { - time_t t = time(0); - struct tm *pTime = localtime(&t); - ioctl(file_fp, FRONTPANELSETGMTOFFSET, pTime->tm_gmtoff); - break; - } - case _FRONTPANELRESEND: - { - ioctl(file_fp, FRONTPANELRESEND, NULL); - break; - } - case _FRONTPANELALLCAPS: - { - frontpanel_ioctl_allcaps fpdata; - - fpdata.AllCaps = atoi(optarg); - if (fpdata.AllCaps > 1) fpdata.AllCaps = 1; - Settings.AllCaps = fpdata.AllCaps; - SaveSettings(); - ioctl(file_fp, FRONTPANELALLCAPS, &fpdata); - break; - } - case _FRONTPANELSCROLLMODE: - { - frontpanel_ioctl_scrollmode fpdata; - - fpdata.ScrollMode = atoi(optarg); - if (fpdata.ScrollMode > 2) fpdata.ScrollMode = 2; - Settings.ScrollMode = fpdata.ScrollMode; - fpdata.ScrollPause = Settings.ScrollPause; - fpdata.ScrollDelay = Settings.ScrollDelay; - SaveSettings(); - ioctl(file_fp, FRONTPANELSCROLLMODE, &fpdata); - break; - } - case _FRONTPANELSCROLLPAUSE: - { - frontpanel_ioctl_scrollmode fpdata; - - fpdata.ScrollPause = atoi(optarg); - Settings.ScrollPause = fpdata.ScrollPause; - fpdata.ScrollMode = Settings.ScrollMode; - fpdata.ScrollDelay = Settings.ScrollDelay; - SaveSettings(); - ioctl(file_fp, FRONTPANELSCROLLMODE, &fpdata); - break; - } - case _FRONTPANELSCROLLDELAY: - { - frontpanel_ioctl_scrollmode fpdata; - - fpdata.ScrollDelay = atoi(optarg); - Settings.ScrollDelay = fpdata.ScrollDelay; - fpdata.ScrollMode = Settings.ScrollMode; - fpdata.ScrollPause = Settings.ScrollPause; - SaveSettings(); - ioctl(file_fp, FRONTPANELSCROLLMODE, &fpdata); - break; - } - case _FRONTPANELRESTORSETTINGS: - { - frontpanel_ioctl_brightness Brightness; - frontpanel_ioctl_irfilter IRFilter; - frontpanel_ioctl_typematicdelay TypematicDelay; - frontpanel_ioctl_typematicrate TypematicRate; - frontpanel_ioctl_keyemulation KeyemulationMode; - frontpanel_ioctl_allcaps AllCaps; - frontpanel_ioctl_scrollmode ScrollMode; - - //Resend all settings to the front panel - Brightness.bright = Settings.Brightness; - ioctl(file_fp, FRONTPANELBRIGHTNESS, &Brightness); - - IRFilter.onoff = Settings.IRFilter1; - ioctl(file_fp, FRONTPANELIRFILTER1, &IRFilter); - - IRFilter.onoff = Settings.IRFilter2; - ioctl(file_fp, FRONTPANELIRFILTER2, &IRFilter); - - IRFilter.onoff = Settings.IRFilter3; - ioctl(file_fp, FRONTPANELIRFILTER3, &IRFilter); - - IRFilter.onoff = Settings.IRFilter4; - ioctl(file_fp, FRONTPANELIRFILTER4, &IRFilter); - - TypematicDelay.TypematicDelay = Settings.TypematicDelay; - ioctl(file_fp, FRONTPANELTYPEMATICDELAY, &TypematicDelay); - - TypematicRate.TypematicRate = Settings.TypematicRate; - ioctl(file_fp, FRONTPANELTYPEMATICRATE, &TypematicRate); - - KeyemulationMode.KeyEmulation = Settings.KeyemulationMode; - ioctl(file_fp, FRONTPANELKEYEMULATION, &KeyemulationMode); - - AllCaps.AllCaps = Settings.AllCaps; - ioctl(file_fp, FRONTPANELALLCAPS, &AllCaps); - - ScrollMode.ScrollMode = Settings.ScrollMode; - ScrollMode.ScrollPause = Settings.ScrollPause; - ScrollMode.ScrollDelay = Settings.ScrollDelay; - ioctl(file_fp, FRONTPANELSCROLLMODE, &ScrollMode); - break; - } - case _HELP: - { - Help(); - break; - } - } - break; - } - case '?': - { - break; - } - default: - { - printf("?? getopt returned character code 0%x ??\n", c); - } - } - } - - if (optind < argc) - { - printf("non-option ARGV-elements: "); - while (optind < argc) - { - printf("%s ", argv[optind++]); - } - printf("\n"); - } - close(file_fp); - - return 0; -} diff --git a/tffpctl/tftypes.h b/tffpctl/tftypes.h deleted file mode 100644 index 060d019..0000000 --- a/tffpctl/tftypes.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef TFTYPES_H -#define TFTYPES_H - -#define ulong64 unsigned long long -#define sulong64 static unsigned long long - -#ifndef dword -typedef unsigned long dword; -#endif -#ifndef word -typedef unsigned short word; -#endif -#ifndef byte -typedef unsigned char byte; -#endif -#if !defined(bool) && !defined(__cplusplus) -typedef unsigned char bool; -#endif - - -#define rvoid register void -#define rbyte register byte -#define rchar register char -#define rword register word -#define rdword register dword -#define rshort register short -#define rlong register long -#define rint register int - -#define svoid static void -#define sbyte static byte -#define schar static char -#define sword static word -#define sdword static dword -#define sshort static short -#define slong static long -#define sint static int - -#define vvoid volatile void -#define vbyte volatile byte -#define vchar volatile char -#define vword volatile word -#define vdword volatile dword -#define vshort volatile short -#define vlong volatile long -#define vint volatile int - -#define vsvoid volatile static void -#define vsbyte volatile static byte -#define vschar volatile static char -#define vsword volatile static word -#define vsdword volatile static dword -#define vsshort volatile static short -#define vslong volatile static long -#define vsint volatile static int - -#ifndef NULL -#define NULL 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef true -#define true 1 -#endif -#ifndef false -#define false 0 -#endif - -#endif diff --git a/ufs922_eeprom/eeprom.c b/ufs922_eeprom/eeprom.c deleted file mode 100644 index 51911d0..0000000 --- a/ufs922_eeprom/eeprom.c +++ /dev/null @@ -1,1116 +0,0 @@ -/* - * eeprom.c - * - * (c) 2009 Dagobert@teamducktales - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ - -/* - * Description: - * - * Startup of little eeprom read/write utility. the eeprom slots - * are based on the very first original fw, so maybe they have - * changed ... - * - * _ATTENTION_: Many thinks are untested in this module. Use on - * your own risk - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define cMaxDetails 16 - -#define cTypeUnused 0 -#define cTypeString 1 -#define cTypeValue 2 -#define cTypeByte 3 - -/* FIXME: Eigentlich müßte ich das anders machen, es - * gibt max 16 byte speicher insgesamt und die details - * definieren nur virtuell was drinne ist und zwar je - * nach größe ergibt sich die anzahl slot details. - * Derzeit ist meine definition von cTypeUndefined - * irreführend, denn wenn der erste 16 Byte hat sind zwar - * alle anderen als undefined definiert sind aber durch den - * ersten belegt. - */ - -typedef struct -{ - char *name; - int first_byte; - int number_bytes; - - int type; - - unsigned char *buffer; -} slot_detail_t; - -typedef struct -{ - unsigned char slot; - unsigned int i2c_bus; - unsigned char i2c_regs; - - slot_detail_t details[cMaxDetails]; - -} slot_t; - -#define cMaxSlots 42 - -slot_t ufs922_slots[cMaxSlots] = -{ - /* i2c addr = 0x50 */ - { - 0x00, 1, 0x50, - "Magic ", 0, 8, cTypeString, NULL, - "Product", 8, 8, cTypeByte, NULL, - "Empty03", 0, 16, cTypeUnused, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x10, 1, 0x50, - "Empty01", 0, 16, cTypeUnused, NULL, - "Empty02", 0, 16, cTypeUnused, NULL, - "Empty03", 0, 16, cTypeUnused, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x20, 1, 0x50, - "BootType ", 0, 1, cTypeValue, NULL, - "DeepStandby ", 1, 1, cTypeValue, NULL, - "RemoteAddr ", 2, 1, cTypeValue, NULL, - "FirstInstallation", 3, 1, cTypeValue, NULL, - "WakeupMode ", 4, 1, cTypeValue, NULL, - "LogOption ", 5, 1, cTypeValue, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x30, 1, 0x50, - "VideoOutput ", 0, 1, cTypeValue, NULL, - "HDMIFormat ", 1, 1, cTypeValue, NULL, - "Show_4_3 ", 2, 1, cTypeValue, NULL, - "AudioHDMI ", 3, 1, cTypeValue, NULL, - "TVAspect ", 4, 1, cTypeValue, NULL, - "Picture4_3 ", 5, 1, cTypeValue, NULL, - "Picture16_9 ", 6, 1, cTypeValue, NULL, - "ScartTV ", 7, 1, cTypeValue, NULL, - "ScartVCR ", 8, 1, cTypeValue, NULL, - "AudioDolby ", 9, 1, cTypeValue, NULL, - "TVSystem ", 10, 1, cTypeValue, NULL, - "AudioLanguage ", 11, 1, cTypeValue, NULL, - "SubtitleLanguage", 12, 1, cTypeValue, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x40, 1, 0x50, - "Tuner2Type ", 0, 1, cTypeValue, NULL, - "Tuner2SignalConfig", 1, 1, cTypeValue, NULL, - "Tuner1Connection ", 2, 1, cTypeValue, NULL, - "Tuner2Connection ", 3, 1, cTypeValue, NULL, - "OneCableType ", 4, 1, cTypeValue, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x50, 1, 0x50, - "LocalTimeOffset ", 0, 4, cTypeValue, NULL, - "WakeupTimer ", 4, 4, cTypeValue, NULL, - "TimeSetupChannelNumber", 8, 4, cTypeValue, NULL, - "SummerTime ", 12, 1, cTypeValue, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x60, 1, 0x50, - "Empty01", 0, 16, cTypeUnused, NULL, - "Empty02", 0, 16, cTypeUnused, NULL, - "Empty03", 0, 16, cTypeUnused, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x70, 1, 0x50, - "ForceDecrypt ", 0, 1, cTypeValue, NULL, - "ForceDecryptMode ", 1, 1, cTypeValue, NULL, - "AlphacryptMultiDecrypt", 2, 1, cTypeValue, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x80, 1, 0x50, - "ChannelCRC ", 0, 4, cTypeByte, NULL, - "SatelliteCRC ", 4, 4, cTypeByte, NULL, - "ChannelCRC_HDD ", 8, 4, cTypeByte, NULL, - "SatelliteCRC_HDD", 12, 4, cTypeByte, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x90, 1, 0x50, - "LastAudioVolume", 0, 1, cTypeValue, NULL, - "LastServiceType", 1, 1, cTypeValue, NULL, - "LastTVNumber ", 2, 4, cTypeValue, NULL, - "LastRadioNumber", 6, 4, cTypeValue, NULL, - "Audio_Mute ", 10, 1, cTypeValue, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0xa0, 1, 0x50, - "lockMainMenu ", 0, 1, cTypeValue, NULL, - "lockReceiver ", 1, 1, cTypeValue, NULL, - "SleepTimer ", 2, 1, cTypeValue, NULL, - "ChannelBannerDuration ", 3, 1, cTypeValue, NULL, - "PlaybackBannerDuration", 4, 1, cTypeValue, NULL, - "DisplayVolume ", 5, 1, cTypeValue, NULL, - "FrontDisplayBrightness", 6, 1, cTypeValue, NULL, - "EPGGrabbing ", 7, 1, cTypeValue, NULL, - "EPGStartView ", 8, 1, cTypeValue, NULL, - "AutomaticTimeshift ", 9, 1, cTypeValue, NULL, - "FunctionalRange ", 10, 1, cTypeValue, NULL, - "AudioDelay ", 11, 2, cTypeValue, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0xb0, 1, 0x50, - "PreRecordtimes ", 0, 2, cTypeValue, NULL, - "PostRecordtime ", 2, 2, cTypeValue, NULL, - "PinCode ", 4, 4, cTypeByte, NULL, - "EPGGrabbingTime", 8, 4, cTypeValue, NULL, - "FreeAccessFrom ", 12, 4, cTypeValue, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0xc0, 1, 0x50, - "FreeAccessUntil ", 0, 4, cTypeValue, NULL, - "DefaultRecordDuration", 4, 4, cTypeValue, NULL, - "FanControl ", 8, 1, cTypeByte, NULL, - "AutomaticSWDownload ", 9, 1, cTypeValue, NULL, - "TimeshiftBufferSize ", 12, 4, cTypeValue, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0xd0, 1, 0x50, - "MyLongitude", 0, 4, cTypeValue, NULL, - "Latitude ", 4, 4, cTypeValue, NULL, - "Empty03", 0, 16, cTypeUnused, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0xe0, 1, 0x50, - "Tuner1_SCR ", 0, 4, cTypeValue, NULL, - "Tuner2_SCR ", 4, 4, cTypeValue, NULL, - "Tuner1_SCR_Frequency", 8, 4, cTypeValue, NULL, - "Tuner2_SCR_Frequency", 12, 4, cTypeValue, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0xf0, 1, 0x50, - "Use_OneCable ", 0, 4, cTypeValue, NULL, - "MDU ", 4, 4, cTypeValue, NULL, - "Tuner1_PinCode", 8, 4, cTypeByte, NULL, - "Tuner2_PinCode", 12, 4, cTypeByte, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - /* i2c addr = 0x51 */ - { - 0x00, 1, 0x51, - "System_Lanauge", 0, 4, cTypeValue, NULL, - "Empty02", 0, 16, cTypeUnused, NULL, - "Empty03", 0, 16, cTypeUnused, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x10, 1, 0x51, - "ChannelListYear ", 0, 2, cTypeValue, NULL, - "ChannelListMonth", 2, 1, cTypeValue, NULL, - "ChannelListDay ", 3, 1, cTypeValue, NULL, - "FirmwareYear ", 4, 2, cTypeValue, NULL, - "FirmwareMonth ", 6, 1, cTypeValue, NULL, - "FirmwareDay ", 7, 1, cTypeValue, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x20, 1, 0x51, - "IpAddress ", 0, 4, cTypeByte, NULL, - "SubNet ", 4, 4, cTypeByte, NULL, - "Gateway ", 8, 4, cTypeByte, NULL, - "EEProm_DNS", 12, 4, cTypeByte, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x30, 1, 0x51, - "DHCP ", 0, 1, cTypeByte, NULL, - "TimeMode ", 1, 1, cTypeByte, NULL, - "SerialKbd", 2, 1, cTypeByte, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x40, 1, 0x51, - "Playback_Shuffle ", 0, 1, cTypeByte, NULL, - "Playback_Repeat ", 1, 1, cTypeByte, NULL, - "Playback_Duration", 2, 1, cTypeByte, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x50, 1, 0x51, - "FTP ", 0, 1, cTypeByte, NULL, - "4G_Limit", 1, 1, cTypeByte, NULL, - "UPnP ", 2, 1, cTypeByte, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x60, 1, 0x51, - "Empty01", 0, 16, cTypeUnused, NULL, - "Empty02", 0, 16, cTypeUnused, NULL, - "Empty03", 0, 16, cTypeUnused, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x70, 1, 0x51, - "Empty01", 0, 16, cTypeUnused, NULL, - "Empty02", 0, 16, cTypeUnused, NULL, - "Empty03", 0, 16, cTypeUnused, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x80, 1, 0x51, - "Empty01", 0, 16, cTypeUnused, NULL, - "Empty02", 0, 16, cTypeUnused, NULL, - "Empty03", 0, 16, cTypeUnused, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x90, 1, 0x51, - "Empty01", 0, 16, cTypeUnused, NULL, - "Empty02", 0, 16, cTypeUnused, NULL, - "Empty03", 0, 16, cTypeUnused, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0xa0, 1, 0x51, - "Empty01", 0, 16, cTypeUnused, NULL, - "Empty02", 0, 16, cTypeUnused, NULL, - "Empty03", 0, 16, cTypeUnused, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0xb0, 1, 0x51, - "Empty01", 0, 16, cTypeUnused, NULL, - "Empty02", 0, 16, cTypeUnused, NULL, - "Empty03", 0, 16, cTypeUnused, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0xc0, 1, 0x51, - "Empty01", 0, 16, cTypeUnused, NULL, - "Empty02", 0, 16, cTypeUnused, NULL, - "Empty03", 0, 16, cTypeUnused, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0xd0, 1, 0x51, - "Empty01", 0, 16, cTypeUnused, NULL, - "Empty02", 0, 16, cTypeUnused, NULL, - "Empty03", 0, 16, cTypeUnused, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0xe0, 1, 0x51, - "Empty01", 0, 16, cTypeUnused, NULL, - "Empty02", 0, 16, cTypeUnused, NULL, - "Empty03", 0, 16, cTypeUnused, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - /* i2c addr = 0x52 unused */ - - - /* i2c addr = 0x53 */ - { - 0xf0, 1, 0x53, - "TestFPGA ", 0, 1, cTypeByte, NULL, - "TestFPGAMode ", 1, 1, cTypeByte, NULL, - "ChannelChangeMode", 2, 1, cTypeByte, NULL, - "ConaxParingMode ", 3, 1, cTypeByte, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - - /* i2c addr = 0x54 - 56 unused */ - - /* i2c addr = 0x57 */ - { - 0x00, 1, 0x57, - "UpdateFlag", 0, 1, cTypeByte, NULL, - "Empty02", 0, 16, cTypeUnused, NULL, - "Empty03", 0, 16, cTypeUnused, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x10, 1, 0x57, - "UpdateUnit1UpdateFlag ", 0, 1, cTypeByte, NULL, - "UpdateUnit1FlashOffset", 4, 4, cTypeByte, NULL, - "UpdateUnit1DataLength ", 8, 4, cTypeValue, NULL, - "UpdateUnit1CRC ", 12, 4, cTypeValue, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x20, 1, 0x57, - "UpdateUnit2UpdateFlag ", 0, 1, cTypeByte, NULL, - "UpdateUnit2FlashOffset", 4, 4, cTypeByte, NULL, - "UpdateUnit2DataLength ", 8, 4, cTypeValue, NULL, - "UpdateUnit2CRC ", 12, 4, cTypeValue, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x30, 1, 0x57, - "UpdateUnit3UpdateFlag ", 0, 1, cTypeByte, NULL, - "UpdateUnit3FlashOffset", 4, 4, cTypeByte, NULL, - "UpdateUnit3DataLength ", 8, 4, cTypeValue, NULL, - "UpdateUnit3CRC ", 12, 4, cTypeValue, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x40, 1, 0x57, - "UpdateUnit4UpdateFlag ", 0, 1, cTypeByte, NULL, - "UpdateUnit4FlashOffset", 4, 4, cTypeByte, NULL, - "UpdateUnit4DataLength ", 8, 4, cTypeValue, NULL, - "UpdateUnit4CRC ", 12, 4, cTypeValue, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x50, 1, 0x57, - "UpdateUnit5UpdateFlag ", 0, 1, cTypeByte, NULL, - "UpdateUnit5FlashOffset", 4, 4, cTypeByte, NULL, - "UpdateUnit5DataLength ", 8, 4, cTypeValue, NULL, - "UpdateUnit5CRC ", 12, 4, cTypeValue, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x60, 1, 0x57, - "UpdateUnit6UpdateFlag ", 0, 1, cTypeByte, NULL, - "UpdateUnit6FlashOffset", 4, 4, cTypeByte, NULL, - "UpdateUnit6DataLength ", 8, 4, cTypeValue, NULL, - "UpdateUnit6CRC ", 12, 4, cTypeValue, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x70, 1, 0x57, - "UpdateUnit7UpdateFlag ", 0, 1, cTypeByte, NULL, - "UpdateUnit7FlashOffset", 4, 4, cTypeByte, NULL, - "UpdateUnit7DataLength ", 8, 4, cTypeValue, NULL, - "UpdateUnit7CRC ", 12, 4, cTypeValue, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x80, 1, 0x57, - "UpdateUnit8UpdateFlag ", 0, 1, cTypeByte, NULL, - "UpdateUnit8FlashOffset", 4, 4, cTypeByte, NULL, - "UpdateUnit8DataLength ", 8, 4, cTypeValue, NULL, - "UpdateUnit8CRC ", 12, 4, cTypeValue, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - { - 0x90, 1, 0x57, - "SWPackVersion ", 0, 4, cTypeString, NULL, - "ChannelDeltaVersion", 4, 4, cTypeString, NULL, - "Empty03", 0, 16, cTypeUnused, NULL, - "Empty04", 0, 16, cTypeUnused, NULL, - "Empty05", 0, 16, cTypeUnused, NULL, - "Empty06", 0, 16, cTypeUnused, NULL, - "Empty07", 0, 16, cTypeUnused, NULL, - "Empty08", 0, 16, cTypeUnused, NULL, - "Empty09", 0, 16, cTypeUnused, NULL, - "Empty10", 0, 16, cTypeUnused, NULL, - "Empty11", 0, 16, cTypeUnused, NULL, - "Empty12", 0, 16, cTypeUnused, NULL, - "Empty13", 0, 16, cTypeUnused, NULL, - "Empty14", 0, 16, cTypeUnused, NULL, - "Empty15", 0, 16, cTypeUnused, NULL, - "Empty16", 0, 16, cTypeUnused, NULL, - }, - - - -}; - -/* - * I2C Message - used for pure i2c transaction, also from /dev interface - */ -struct i2c_msg -{ - unsigned short addr; /* slave address */ - unsigned short flags; - unsigned short len; /* msg length */ - unsigned char *buf; /* pointer to msg data */ -}; - -/* This is the structure as used in the I2C_RDWR ioctl call */ -struct i2c_rdwr_ioctl_data -{ - struct i2c_msg *msgs; /* pointers to i2c_msgs */ - unsigned int nmsgs; /* number of i2c_msgs */ -}; - -#define I2C_SLAVE 0x0703 /* Change slave address */ -/* Attn.: Slave address is 7 or 10 bits */ - -#define I2C_SLAVE_FORCE 0x0706 /* Change slave address */ -#define I2C_RDWR 0x0707 /* Combined R/W transfer (one stop only)*/ - -int i2c_slave_force(int fd, char addr, char c1, char c2) -{ - char buf[256]; - - if (ioctl(fd, I2C_SLAVE_FORCE, addr) != 0) - { - printf("i2c failed 1\n"); - return -1; - } - - buf[0] = c1; - buf[1] = c2; - if (write(fd, buf, 2) != 2) - return -2; - - return 0; -} - -int i2c_slave_force_var(int fd, char addr, char *buffer, int len) -{ - if (ioctl(fd, I2C_SLAVE_FORCE, addr) != 0) - { - printf("i2c failed 1\n"); - return -1; - } - -//printf("buffer 0x%x\n", buffer[0]); - if (write(fd, buffer, len) != len) - return -2; - - return 0; -} - -int i2c_readreg(int fd_i2c, char addr, char *buffer, int len) -{ - struct i2c_rdwr_ioctl_data i2c_rdwr; - int err; - - /* */ - i2c_rdwr.nmsgs = 1; - i2c_rdwr.msgs = malloc(2 * 32); - i2c_rdwr.msgs[0].addr = addr; - i2c_rdwr.msgs[0].flags = 1; - i2c_rdwr.msgs[0].len = len; - i2c_rdwr.msgs[0].buf = malloc(len); - - memcpy(i2c_rdwr.msgs[0].buf, buffer, len); - - if ((err = ioctl(fd_i2c, I2C_RDWR, &i2c_rdwr)) < 0) - { - printf("i2c_readreg failed %d %d\n", err, errno); - printf("%s\n", strerror(errno)); - free(i2c_rdwr.msgs[0].buf); - free(i2c_rdwr.msgs); - - return -1; - } - - memcpy(buffer, i2c_rdwr.msgs[0].buf, len); - - free(i2c_rdwr.msgs[0].buf); - free(i2c_rdwr.msgs); - - return 0; -} - -int main(int argc, char *argv[]) -{ - int fd_i2c; - int vLoopAddr, vLoopSlot, vLoop; - -//#define dump_it -#ifdef dump_it - fd_i2c = open("/dev/i2c-1", O_RDWR); - - for (vLoopAddr = 0x50; vLoopAddr <= 0x57; vLoopAddr++) - { - for (vLoopSlot = 0x0; vLoopSlot <= 0xf; vLoopSlot++) - { - unsigned char reg = vLoopSlot * 0x10; - unsigned char buffer[16] = - {0x18, 0x74, 0x88, 0x7b, 0x94, 0x77, 0xb4, 0x0, 0x2c, 0x3a, 0xb4, 0x0, 0x1, 0x0, 0x0, 0x0}; - - i2c_slave_force_var(fd_i2c, vLoopAddr, ®, 1); - - i2c_readreg(fd_i2c, vLoopAddr, buffer, 16); - - printf("addr = 0x%02x, reg = 0x%02x ", vLoopAddr, reg); - for (vLoop = 0; vLoop < 16; vLoop++) - printf("0x%02x ", buffer[vLoop]); - - printf("\n"); - - } - - } -#else - for (vLoopSlot = 0; vLoopSlot < cMaxSlots; vLoopSlot++) - { - char device[256]; - - sprintf(device, "/dev/i2c-%d", ufs922_slots[vLoopSlot].i2c_bus); - - fd_i2c = open(device, O_RDWR); - - if (fd_i2c < 0) - { - printf("error opening %s \n", device); - return 1; - } - - - unsigned char buffer[16]; - - i2c_slave_force_var(fd_i2c, ufs922_slots[vLoopSlot].i2c_regs, &ufs922_slots[vLoopSlot].slot, 1); - - i2c_readreg(fd_i2c, ufs922_slots[vLoopSlot].i2c_regs, buffer, 16); - - for (vLoop = 0; vLoop < cMaxDetails; vLoop++) - { - if (ufs922_slots[vLoopSlot].details[vLoop].type == cTypeString) - { - ufs922_slots[vLoopSlot].details[vLoop].buffer = malloc(ufs922_slots[vLoopSlot].details[vLoop].number_bytes + 1); - - memcpy(ufs922_slots[vLoopSlot].details[vLoop].buffer, - buffer + ufs922_slots[vLoopSlot].details[vLoop].first_byte, - ufs922_slots[vLoopSlot].details[vLoop].number_bytes); - - ufs922_slots[vLoopSlot].details[vLoop].buffer[ufs922_slots[vLoopSlot].details[vLoop].number_bytes] = '\0'; - - printf("Name = %s [%d:%d] value = %s\n", - ufs922_slots[vLoopSlot].details[vLoop].name, - ufs922_slots[vLoopSlot].details[vLoop].first_byte, - ufs922_slots[vLoopSlot].details[vLoop].number_bytes, - ufs922_slots[vLoopSlot].details[vLoop].buffer); - } - else if (ufs922_slots[vLoopSlot].details[vLoop].type == cTypeValue) - { - unsigned long value; - int valueLoop; - - ufs922_slots[vLoopSlot].details[vLoop].buffer = malloc(ufs922_slots[vLoopSlot].details[vLoop].number_bytes); - - memcpy(ufs922_slots[vLoopSlot].details[vLoop].buffer, - buffer + ufs922_slots[vLoopSlot].details[vLoop].first_byte, - ufs922_slots[vLoopSlot].details[vLoop].number_bytes); - - value = 0; - - for (valueLoop = 0; valueLoop < ufs922_slots[vLoopSlot].details[vLoop].number_bytes; valueLoop++) - { - value |= ufs922_slots[vLoopSlot].details[vLoop].buffer[valueLoop] << - ((ufs922_slots[vLoopSlot].details[vLoop].number_bytes - valueLoop - 1) * 8); - /* - printf("value = %d\n", value); - printf("buffer = 0x%x shift = %d\n", ufs922_slots[vLoopSlot].details[vLoop].buffer[valueLoop],((ufs922_slots[vLoopSlot].details[vLoop].number_bytes - valueLoop - 1) * 8)); - */ - } - - printf("Name = %s [%d:%d] value = %d\n", - ufs922_slots[vLoopSlot].details[vLoop].name, - ufs922_slots[vLoopSlot].details[vLoop].first_byte, - ufs922_slots[vLoopSlot].details[vLoop].number_bytes, - value); - } - else if (ufs922_slots[vLoopSlot].details[vLoop].type == cTypeByte) - { - int valueLoop; - - ufs922_slots[vLoopSlot].details[vLoop].buffer = malloc(ufs922_slots[vLoopSlot].details[vLoop].number_bytes); - - memcpy(ufs922_slots[vLoopSlot].details[vLoop].buffer, - buffer + ufs922_slots[vLoopSlot].details[vLoop].first_byte, - ufs922_slots[vLoopSlot].details[vLoop].number_bytes); - - printf("Name = %s [%d:%d] value = ", - ufs922_slots[vLoopSlot].details[vLoop].name, - ufs922_slots[vLoopSlot].details[vLoop].first_byte, - ufs922_slots[vLoopSlot].details[vLoop].number_bytes); - - for (valueLoop = 0; valueLoop < ufs922_slots[vLoopSlot].details[vLoop].number_bytes; valueLoop++) - printf("0x%x ", ufs922_slots[vLoopSlot].details[vLoop].buffer[valueLoop]); - printf("\n"); - } - } - - close(fd_i2c); - } -#endif - - return 0; -} diff --git a/ustslave/Makefile.am b/ustslave/Makefile.am deleted file mode 100644 index be02a67..0000000 --- a/ustslave/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -bin_PROGRAMS = ustslave - -ustslave_SOURCES = ustslave.c - -AM_CFLAGS = -Wall diff --git a/ustslave/autogen.sh b/ustslave/autogen.sh deleted file mode 100755 index 89f5210..0000000 --- a/ustslave/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-ustslave" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/ustslave/configure.ac b/ustslave/configure.ac deleted file mode 100644 index 5a7efb5..0000000 --- a/ustslave/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT([ustslave],[1.0],[],[ustslave]) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_OUTPUT([ -Makefile -]) diff --git a/ustslave/ustslave.c b/ustslave/ustslave.c deleted file mode 100644 index 5fc7133..0000000 --- a/ustslave/ustslave.c +++ /dev/null @@ -1,456 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define ST_IOCTL_BASE 'l' -#define STCOP_GRANT _IOR(ST_IOCTL_BASE, 0, unsigned int) -#define STCOP_RESET _IOR(ST_IOCTL_BASE, 1, unsigned int) -#define STCOP_START STCOP_GRANT - -#define BUF_SIZE 4096 - -#define MAX_SECTIONS 100 -#define MAX_NAMELEN 40 - -#define SEC_LOAD 0x01 -#define SEC_NOT_LOAD 0x08 - -/* fixme: Dagobert: we should include -* here but I dont understand the automatic generated makefile here -* ->so use the hacky version here ... -* (Schischu): Actually this makes it easier to implement a stm22 stm23 detection, -* so leave it. -*/ -typedef struct -{ - char name[16]; /* coprocessor name */ - u_int flags; /* control flags */ - /* Coprocessor region: */ - unsigned long ram_start; /* Host effective address */ - u_int ram_size; /* region size (in bytes) */ - unsigned long cp_ram_start; /* coprocessor effective address */ - -} cop_properties_t; - -#define STCOP_GET_PROPERTIES _IOR(ST_IOCTL_BASE, 4, cop_properties_t*) - -typedef struct -{ - - unsigned int ID; - char Name[MAX_NAMELEN]; - unsigned int DestinationAddress; - unsigned int SourceAddress; - unsigned int Size; - unsigned int Alignment; - - unsigned int Flags; - unsigned int DontKnow2; -} tSecIndex; - -tSecIndex IndexTable[MAX_SECTIONS]; -int IndexCounter = 0; -int IDCounter = -1; - -unsigned int getKernelVersion() -{ - unsigned int version = 24; - struct utsname name; - uname(&name); - - if (!strncmp(name.release, "2.6.17", 6)) - version = 22; - else if (!strncmp(name.release, "2.6.23", 6)) - version = 23; - else // 2.6.32 - version = 24; - - printf("ustslave: Kernel Version: %d\n", version); - - return version; -} - - -int writeToSlave(int cpuf, int fd, off_t DestinationAddress, unsigned int SourceAddress, unsigned int Size) -{ - unsigned char *BUFFER = malloc(Size); - int err; - - err = lseek(fd, SourceAddress, SEEK_SET); - if (err < 0) - { - printf("error seeking SourceAddress\n"); - return 1; - } - - err = read(fd, BUFFER, Size); - if (err != Size) - { - printf("error read fd\n"); - return 1; - } - - err = lseek(cpuf, DestinationAddress, SEEK_SET); - - printf("seeking to %x\n", (int)DestinationAddress); - - if (err < 0) - { - printf("error seeking copo addi (addi = %x)\n", (int)DestinationAddress); - return 1; - } - - err = write(cpuf, BUFFER, Size); - if (err != Size) - { - printf("error write cpuf\n"); - return 1; - } - - free(BUFFER); - - return 0; -} - -int sectionToSlave(int cpuf, int fd, unsigned int *EntryPoint) -{ - int i = 0, err = 0; - int BootSection = -2; - int LastSection = -2; - unsigned long ramStart = 0; - unsigned char kernelVersion = getKernelVersion(); - - if (kernelVersion == 23 || kernelVersion == 24) - { - cop_properties_t cop; - - err = ioctl(cpuf, STCOP_GET_PROPERTIES, &cop); - if (err < 0) - { - printf("error ioctl STCOP_GET_PROPERTIES\n"); - return 1; - } - printf("base_address 0x%.8lx\n", cop.cp_ram_start); - ramStart = cop.cp_ram_start; - } - - for (i = 0; i < IndexCounter; i++) - { - if (IndexTable[i].Size > 0 && (IndexTable[i].Flags & (SEC_LOAD == SEC_LOAD))) - { - if (0 == strncmp(".boot", IndexTable[i].Name, 5)) - { - /* defer the loading of the (relocatable) .boot section until we know where to - * relocate it to. - */ - BootSection = i; - - continue; - } - - err = writeToSlave(cpuf, fd, IndexTable[i].DestinationAddress - ramStart, - IndexTable[i].SourceAddress, IndexTable[i].Size); - if (err != 0) return 1; - - LastSection = i; - } - } - - if (BootSection != -2) - { - //Add relocated .boot - unsigned int Alignment = 8; - - unsigned int DestinationAddress = (IndexTable[LastSection].DestinationAddress + IndexTable[LastSection].Size - + (1 << Alignment)) & ~((1 << Alignment) - 1); - - err = writeToSlave(cpuf, fd, DestinationAddress - ramStart, - IndexTable[BootSection].SourceAddress, IndexTable[BootSection].Size); - if (err != 0) return 1; - - *EntryPoint = DestinationAddress; - } - else - { - //We allready have the EntryPoint - } - - return 0; -} - -int printTable() -{ - int i = 0; - - for (i = 0; i < IndexCounter; i++) - { - if (IndexTable[i].Size > 0 && (IndexTable[i].Flags & (SEC_LOAD == SEC_LOAD))) - { - printf("%2d: %30s 0x%08X(- 0x%08X) 0x%08X(- 0x%08X) 0x%08X(%6u) 2**%d " - "0x%04X 0x%04X\n", - IndexTable[i].ID, - IndexTable[i].Name, - IndexTable[i].DestinationAddress, - IndexTable[i].DestinationAddress + IndexTable[i].Size, - IndexTable[i].SourceAddress, - IndexTable[i].SourceAddress + IndexTable[i].Size, - IndexTable[i].Size, - IndexTable[i].Size, - IndexTable[i].Alignment == 0x02 ? 1 : - IndexTable[i].Alignment == 0x04 ? 2 : - IndexTable[i].Alignment == 0x08 ? 3 : - IndexTable[i].Alignment == 0x10 ? 4 : - IndexTable[i].Alignment == 0x20 ? 5 : - IndexTable[i].Alignment == 0x40 ? 6 : - IndexTable[i].Alignment == 0x80 ? 7 : - IndexTable[i].Alignment == 0x100 ? 8 : - IndexTable[i].Alignment, - - IndexTable[i].Flags, - IndexTable[i].DontKnow2 - ); - } - } - - return 0; -} - -int addIndex(unsigned int DestinationAddress, unsigned int SourceAddress, unsigned int Size, unsigned int Alignment, - unsigned int Flags, unsigned int DontKnow2) -{ - /*printf("%2d: 0x%08X 0x%08X 0x%08X(%u) 2**%d\n", - IDCounter, DestinationAddress, SourceAddress, Size, Size, - Alignment==0x02?1: - Alignment==0x04?2: - Alignment==0x08?3: - Alignment==0x10?4: - Alignment==0x20?5: - Alignment==0x40?6: - Alignment==0x80?7: - Alignment==0x100?8: - Alignment);*/ - - IndexTable[IndexCounter].ID = IDCounter++; - IndexTable[IndexCounter].DestinationAddress = DestinationAddress; - IndexTable[IndexCounter].SourceAddress = SourceAddress; - IndexTable[IndexCounter].Size = Size; - IndexTable[IndexCounter].Alignment = Alignment; - - IndexTable[IndexCounter].Flags = Flags; - IndexTable[IndexCounter].DontKnow2 = DontKnow2; - - IndexCounter++; - - return 0; -} - -int readDescription(int fd, unsigned int Address, unsigned int Size) -{ - int SectionIndex = 0, err = 0; - int Position = 1; - unsigned char buf[BUF_SIZE]; - - err = lseek(fd, Address, SEEK_SET); - if (err < 0) - { - printf("error lseek Descritpion\n"); - return 1; - } - - err = read(fd, &buf, Size); - if (err != Size) - { - printf("error read Descritpion\n"); - return 1; - } - - while (Position < Size) - { - int i = 0; - - for (; buf[Position] != 0x00;) - { - - IndexTable[SectionIndex].Name[i++] = buf[Position++]; - } - Position++; - - IndexTable[SectionIndex].Name[i++] = 0x00; - - //printf("%2d : %s\n", IndexTable[SectionIndex].ID, IndexTable[SectionIndex].Name); - - SectionIndex++; - } - - return 0; -} - -int loadElf(int cpuf, int fd, unsigned int *entry_p, unsigned int *stack_p, int verbose) -{ - unsigned char buf[BUF_SIZE]; - int ReadBytes = 0, err = 0; - - //EntryPoint - err = lseek(fd, 0x18, SEEK_SET); - if (err < 0) - { - printf("error lseek(0x18) loadElf\n"); - return 1; - } - - err = read(fd, &buf, 4); - if (err != 4) - { - printf("error read(4) loadElf\n"); - return 1; - } - - *entry_p = buf[0] | buf[1] << 8 | buf[2] << 16 | buf[3] << 24; - //printf("EntryPoint is 0x%08X\n", *entry_p); - - //seek to the table address field - err = lseek(fd, 0x20, SEEK_SET); - if (err < 0) - { - printf("error lseek(0x18) loadElf\n"); - return 1; - } - - err = read(fd, &buf, 4); - if (err != 4) - { - printf("error read(4) loadElf\n"); - return 1; - } - - unsigned int TableAddress = buf[0] | buf[1] << 8 | buf[2] << 16 | buf[3] << 24; - //printf("TableAddress is 0x%08X\n", TableAddress); - - err = lseek(fd, TableAddress, SEEK_SET); - if (err < 0) - { - printf("error lseek(TableAdress) loadElf\n"); - return 1; - } - - while ((ReadBytes = read(fd, &buf, 10 * sizeof(int))) == (10 * sizeof(int))) - { - -// unsigned int IncreasingNumber = buf[0] | buf[1]<<8 | buf[2]<<16 | buf[3]<<24; - unsigned int Flags = buf[4] | buf[5] << 8 | buf[6] << 16 | buf[7] << 24; - unsigned int DontKnow2 = buf[8] | buf[9] << 8 | buf[10] << 16 | buf[11] << 24; - - unsigned int DestinationAddress = buf[12] | buf[13] << 8 | buf[14] << 16 | buf[15] << 24; - unsigned int SourceAddress = buf[16] | buf[17] << 8 | buf[18] << 16 | buf[19] << 24; - unsigned int Size = buf[20] | buf[21] << 8 | buf[22] << 16 | buf[23] << 24; - -// unsigned int DontKnow3 = buf[24] | buf[25]<<8 | buf[26]<<16 | buf[27]<<24; -// unsigned int DontKnow4 = buf[28] | buf[29]<<8 | buf[30]<<16 | buf[31]<<24; - - unsigned int Alignment = buf[32] | buf[33] << 8 | buf[34] << 16 | buf[35] << 24; - -// unsigned int DontKnow5 = buf[36] | buf[37]<<8 | buf[38]<<16 | buf[39]<<24; - - if (DestinationAddress == 0x00 && SourceAddress != 0x00) - { - //Source Address is address of description - err = readDescription(fd, SourceAddress, Size); - if (err != 0) return 1; - break; //Exit While - } - else - { - //Add Index to Table - addIndex(DestinationAddress, SourceAddress, Size, Alignment, Flags, DontKnow2); - } - } - if (ReadBytes != 10 * sizeof(int)) - { - printf("error ReadBytes\n"); - return 1; - } - - //printTable(); - - err = sectionToSlave(cpuf, fd, entry_p); - if (err != 0) return 1; - - //printf("start address = 0x%08X\n", *entry_p); - - return 0; -} - -int copLoadFile(int cpuf, char *infile, unsigned int *entry_p, unsigned int *stack_p, int verbose) -{ - int inf; - char *sfx; -// int pipe; -// unsigned char header[4]; - - printf("%s (file %s)\n", __FUNCTION__, infile); - - if ((inf = open(infile, O_RDONLY)) < 0) - { - printf("[%d] cannot open input file %s\n", errno, infile); - return (1); - } - - if ((sfx = strrchr(infile, '.'))) - { - sfx++; - if (strcmp(sfx, "elf") == 0) - return (loadElf(cpuf, inf, entry_p, stack_p, verbose)); - } - return 1; -} - -/* ------------------------------------------------------------------------ -** copRun: -** Prerequisite: the application image has already been loaded into -** coprocessor RAM. -*/ -int copRun(int cpuf, unsigned long entry_p, int verbose) -{ - //printf("\tstart execution...\n"); - - if (ioctl(cpuf, STCOP_START, entry_p) < 0) - { - printf("[%d] while triggering coprocessor start!\n", errno); - return (1); - } - - if (verbose) - printf("Coprocessor running! (from 0x%lx)\n", entry_p); - return (0); -} - - -int main(int argc, char *argv[]) -{ - int cpuf = -1; - int res; - unsigned int entry_p, stack_p; - /* - * Open the coprocessor device - */ - if ((cpuf = open(argv[1] /* /dev/st231-0 and -1*/, O_RDWR)) < 0) - { - printf("cannot open %s device (errno = %d)\n", argv[1], errno); - exit(1); - } - - /* - * Execute the command - */ - res = copLoadFile(cpuf, argv[2], &entry_p, &stack_p, 0); - if (res == 0) - res = copRun(cpuf, entry_p, 0); - - return res; -} diff --git a/vfdctl/Makefile.am b/vfdctl/Makefile.am deleted file mode 100644 index 92e1fbe..0000000 --- a/vfdctl/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 - -bin_PROGRAMS = vfdctl - -vfdctl_SOURCES = vfdctl.c - -AM_CFLAGS = -Wall diff --git a/vfdctl/autogen.sh b/vfdctl/autogen.sh deleted file mode 100755 index a21dc2c..0000000 --- a/vfdctl/autogen.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -package="tools-vfdctl" - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -cd "$srcdir" -echo "Generating configuration files for $package, please wait...." - -aclocal --force -libtoolize --force -autoconf --force -autoheader --force -automake --add-missing --force-missing --foreign diff --git a/vfdctl/configure.ac b/vfdctl/configure.ac deleted file mode 100644 index b146342..0000000 --- a/vfdctl/configure.ac +++ /dev/null @@ -1,13 +0,0 @@ -AC_INIT([vfdctl],[1.0],[],[vfdctl]) -AM_INIT_AUTOMAKE -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) -m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_HEADERS([config.h]) - -AC_PROG_CC -AC_PROG_CXX - -AC_OUTPUT([ -Makefile -]) diff --git a/vfdctl/vfdctl.c b/vfdctl/vfdctl.c deleted file mode 100644 index 3c7395e..0000000 --- a/vfdctl/vfdctl.c +++ /dev/null @@ -1,778 +0,0 @@ -/* -* -* vfdctl.c -* by nebman -* version v0.7.1 -* -* vfdctl is a little utility to control the display of the UFS910 receiver -* -* thx to captaintrip for his code -* -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define VFD_Display_Chars 0xc0425a00 -#define VFDICONDISPLAYONOFF 0xc0425a0a -#define VFDICONGETSTATE 0xc0425a0b -#define VFDDISPLAYWRITEONOFF 0xc0425a05 -#define VFDWRITECGRAM 0x40425a01 -#define SLEEPTIME 200000 -#define IN_CHAR 27 -#define true 1 -#define false 0 - -/* -* Umlauts: -* 128 ä, 129 ö, 130 ü -* 131 Ä, 132 Ö, 133 Ãœ -* 134 ß -* -* Special chars: -* 17 = | bis 21 = ||||| -* 22 = 6 horizontal bars filled from bottom of a total of 7 -* .. 27 = 1 horizontal bars filled from bottom of a total of 7 -*/ - -void setMessageToDisplay(char *); -void setMessageToDisplayEx(char *, int len); -void show_help(); -void close_device_vfd(); -void scrollText(char *text); -int iconOnOff(char *sym, unsigned char onoff); -void centeredText(char *text); -int writeCG(unsigned char adress, unsigned char pixeldata[5]); -void demoMode(void); -void sigfunc(int sig); -void inputRemote(char *text); -void refreshDisp(); -void printState(int index); -int getIconIndex(char *icon); -void printBitmap(char *filename, int animationSpeed); -void playVfdx(char *filename); - -#ifdef HAVE_SPARK7162_HARDWARE -#define VFD_LEN 8 -struct set_mode_s -{ - int compat; /* 0 = compatibility mode to vfd driver; 1 = nuvoton mode */ -}; - -struct set_brightness_s -{ - int level; -}; - -struct set_icon_s -{ - int icon_nr; - int on; -}; - -struct set_led_s -{ - int led_nr; - int on; -}; - -/* time must be given as follows: - * time[0] & time[1] = mjd ??? - * time[2] = hour - * time[3] = min - * time[4] = sec - */ -struct set_standby_s -{ - char time[5]; -}; - -struct set_time_s -{ - char time[5]; -}; - -struct aotom_ioctl_data -{ - union - { - struct set_icon_s icon; - struct set_led_s led; - struct set_brightness_s brightness; - struct set_mode_s mode; - struct set_standby_s standby; - struct set_time_s time; - } u; -}; - -const char *icons[46] = -{ - "fr", "plr", "play", "plf", "ff", "pause", "rec", "mute", "cycle", "dd", "lock", "ci", "usb", "hd", "rec2", "hd8", "hd7", /* 17 */ - "hd6", "hd5", "hd4", "hd3", "hdfull", "hd2", "hd1", "mp3", "ac3", "tvl", "music", "alert", "hdd", "clockpm", "clockam", /* 32 */ - "clock", "mail", "bt", "stby", "ter", "disk3", "disk2", "disk1", "disk0", "sat", "ts", "dot1", "cab", "all" -}; /* 46 */ - -static struct aotom_ioctl_data aotom_data; -static char textOff = 100; -#else -#define VFD_LEN 16 -const char *icons[16] = {"usb", "hd", "hdd", "lock", "bt", "mp3", "music", "dd", "mail", "mute", "play", "pause", "ff", "fr", "rec", "clock"}; -#endif - -const char *states[3] = {"off", "on", "not inited"}; - -int file_vfd; -char verbose = false; - -#define MAX_INPUT 200 -char outbuffer[16]; -char input[MAX_INPUT]; -int position = 0; -int offset = 0; - -int main(int argc, char **argv) -{ - // check command line argument count - if (argc == 1) - { - show_help(); - return EXIT_FAILURE; - } - - // function to catch SIGINT - signal(SIGINT, sigfunc); - - // open display file - if ((file_vfd = open("/dev/vfd", O_RDWR)) == -1) - { - printf("vfdctl: could not open vfd-device!\n"); - return EXIT_FAILURE; - } - - int i; - unsigned char centerText = false; - char *output = 0; - int animationSpeed = 500000; // default animation to 1/2 second - - for (i = 1; i < argc; i++) - { - char *cmd = argv[i]; - - if (strcmp(cmd, "-c") == 0) - { - centerText = true; - if (verbose) printf("option centered text active\n"); - } - else if (strcmp(cmd, "-v") == 0) - { - verbose = true; -#ifndef HAVE_SPARK7162_HARDWARE - } - else if (strcmp(cmd, "-s") == 0) - { - if (argc > 2) - { - i++; - animationSpeed = atoi(argv[i]) * 1000; - continue; - } - else - { - fprintf(stderr, "vfdctl: please specify animationspeed in milliseconds as 2nd argument\n"); - break; - } - } - else if (strcmp(cmd, "-b") == 0) - { - if (argc > 2) - { - printBitmap(argv[i + 1], animationSpeed); - } - else - { - fprintf(stderr, "vfdctl: please specify bitmap file as 2nd argument\n"); - } - break; - } - else if (strcmp(cmd, "-x") == 0) - { - if (argc > 2) - { - playVfdx(argv[i + 1]); - } - else - { - fprintf(stderr, "vfdctl: please specify .vfdx file as 2nd argument\n"); - } - break; -#endif - } - else if (cmd[0] == '+') - { - iconOnOff(cmd + 1, true); - } - else if (cmd[0] == '-') - { - iconOnOff(cmd + 1, false); -#ifdef HAVE_SPARK7162_HARDWARE - } - else if (strcmp(cmd, "texton") == 0) - { - textOff = 101; - ioctl(file_vfd, VFDDISPLAYWRITEONOFF, &textOff); - } - else if (strcmp(cmd, "textoff") == 0) - { - textOff = 100; - ioctl(file_vfd, VFDDISPLAYWRITEONOFF, &textOff); -#else - } - else if (strcmp(cmd, "demomode") == 0) - { - printf("vfdctl: starting demomode\n"); - demoMode(); - break; - } - else if (strcmp(cmd, "input") == 0) - { - fprintf(stderr, "vfdctl: starting remote control input mode\n"); - if (argc == 3) - { - inputRemote(argv[2]); - } - else - { - inputRemote(""); - } - break; - } - else if (strcmp(cmd, "iconstate") == 0) - { - if (argc == 3) - { - printState(getIconIndex(argv[2])); - } - else - { - printState(-1); - } - break; -#endif - } - else - { - output = cmd; - } - - } - - if (output) - { - if (strlen(output) > VFD_LEN) - scrollText(output); // scroll text if >VFD_LEN - else - { - if (centerText == true) - { - centeredText(output); - } - else - { - setMessageToDisplay(output); - } - } - } - if (verbose) printf("closing vfd device\n"); - close_device_vfd(); - - return EXIT_SUCCESS; -} - -int getIconIndex(char *icon) -{ - int i; - -#ifdef HAVE_SPARK7162_HARDWARE - for (i = 0; i < 46; i++) - { - if (strcmp(icon, icons[i]) == 0) - { - return i + 1; - } - } -#else - for (i = 0; i < 16; i++) - { - if (strcmp(icon, icons[i]) == 0) - { - return i; - } - } -#endif - printf("Icon %s does not exist!\n", icon); - exit(-1); -} - -// CODE captaintrip -void setMessageToDisplay(char *str) -{ - int i; - - struct ioctl_data - { - unsigned char start; - unsigned char data[64]; - unsigned char length; - } - writedisp_data; - - memset(writedisp_data.data, ' ', VFD_LEN); - - i = strlen(str); - if (i > VFD_LEN) i = VFD_LEN; - memcpy(writedisp_data.data, str, i); - - writedisp_data.start = 0; - writedisp_data.length = VFD_LEN; - - ioctl(file_vfd, VFD_Display_Chars, &writedisp_data); -} - -void close_device_vfd() -{ - if (file_vfd != -1) - close(file_vfd); -} - -void show_help() -{ -#ifdef HAVE_SPARK7162_HARDWARE - printf("vfdctl v0.7.1 Spark7162 - usage:\n\ -\tvfdctl [[-c] text] [+sym] [-sym] ...\n\ -\t-c\tcentered output\n\ -\tto set symbols use e.g. +usb or -usb\n\ -\tavailable symbols are fr,plr,play,plf,ff,pause,rec,mute,cycle,dd,lock,ci,usb,hd,rec2,hd8,hd7,hd6,hd5,hd4,hd3,hdfull,hd2,hd1\n\ -\t,mp3,ac3,tvl,music,alert,hdd,clockpm,clockam,clock,mail,bt,stby,ter,disk3,disk2,disk1,disk0,sat,ts,dot1,cab,all\n\ -\tspecial modes are: \n\ -\ttexton\tactivate text showing on VFD\n\ -\ttextoff\tdeactivate text showing on VFD\n"); -#else - printf("vfdctl v0.7.1 - usage:\n\ -\tvfdctl [[-c] text] [-s speed] [-b file] [+sym] [-sym] ...\n\ -\t-c\tcentered output\n\ -\t-s\tset animation speed in milliseconds for -b output\n\ -\t-b\toutput content of bitmap file\n\ -\t-x\tplay vfdx file (animated)\n\ -\tto set symbols use e.g. +usb or -usb\n\ -\tavailable symbols are usb,hd,hdd,lock,bt,mp3,music,dd,mail,mute,play,pause,ff,fr,rec,clock\n\ -\tspecial modes are: \n\ -\tvfdctl demomode to start demo loop\n\ -\tvfdctl input [text] for remote control input mode\n\ -\tvfdctl iconstate [iconname] to get the current icon state\n"); -#endif -} - -void centeredText(char *text) -{ - if (verbose) printf("centering text\n"); - - int ws = 0; // needed whitespace for centering - if (strlen(text) < VFD_LEN) - ws = (VFD_LEN - strlen(text)) / 2; - else - ws = 0; - - char *textout = malloc(VFD_LEN); - memset(textout, ' ', VFD_LEN); - memcpy(textout + ws, text, VFD_LEN - ws); - setMessageToDisplay(textout); - free(textout); -} - -void scrollText(char *text) -{ - int i, len = strlen(text); - char *out = malloc(VFD_LEN); - - for (i = 0; i <= (len - VFD_LEN); i++) // scroll text till end - { - memset(out, ' ', VFD_LEN); - memcpy(out, text + i, VFD_LEN); - setMessageToDisplay(out); - usleep(SLEEPTIME); - } - for (i = 1; i < VFD_LEN; i++) // scroll text with whitespaces from right - { - memset(out, ' ', VFD_LEN); - memcpy(out, text + len + i - VFD_LEN, VFD_LEN - i); - setMessageToDisplay(out); - usleep(SLEEPTIME); - } - - memcpy(out, text, VFD_LEN); // display first 16 chars after scrolling - setMessageToDisplay(out); - free(out); -} - -int iconOnOff(char *sym, unsigned char onoff) -{ - char icon = getIconIndex(sym); -#ifdef HAVE_SPARK7162_HARDWARE - aotom_data.u.icon.icon_nr = icon; - aotom_data.u.icon.on = onoff; - ioctl(file_vfd, VFDICONDISPLAYONOFF, &aotom_data); -#else - struct - { - unsigned char start; - unsigned char data[64]; - unsigned char length; - } data; - - data.start = 0x00; - data.data[0] = icon; - data.data[4] = onoff; - data.length = 5; - ioctl(file_vfd, VFDICONDISPLAYONOFF, &data); -#endif - - if (verbose) - printf("set icon %s(%x) %d \n", sym, icon, onoff); - return 0; -} - -int writeCG(unsigned char adress, unsigned char pixeldata[5]) -{ - struct - { - unsigned char start; - unsigned char data[64]; - unsigned char length; - } data; - - data.start = adress & 0x07; - data.data[0] = pixeldata[0]; - data.data[1] = pixeldata[1]; - data.data[2] = pixeldata[2]; - data.data[3] = pixeldata[3]; - data.data[4] = pixeldata[4]; - data.length = 5; - return ioctl(file_vfd, VFDWRITECGRAM, &data); -} - -void demoMode(void) -{ - char man1[5] = {0x02, 0x64, 0x1D, 0x64, 0x02}; - char man2[5] = {0x04, 0x64, 0x1D, 0x64, 0x04}; - char u[5] = {0x00, 0x1C, 0x20, 0x20, 0x3E}; - char f[5] = {0x00, 0x3E, 0x0A, 0x0A, 0x00}; - char s[5] = {0x20, 0x20, 0x2C, 0x12, 0x02}; - char neun[5] = {0x20, 0x20, 0x2E, 0x2A, 0x3E}; - char eins[5] = {0x00, 0x00, 0x3E, 0x00, 0x00}; - char nul[5] = {0x1C, 0x22, 0x22, 0x1C, 0x00}; - - char *writechars[7] = {man1, u, f, s, neun, eins, nul }; - char *writechars_ani[7] = {man2, u, f, s, neun, eins, nul }; - - int i; - for (i = 0; i < 7; i++) - { - writeCG(i, (unsigned char *)(writechars + i)); - } - - char test[9] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00}; - setMessageToDisplay(test); - - //animation - while (1) - { - usleep(750000); - writeCG(0, (unsigned char *)writechars_ani + 0); - setMessageToDisplay(test); - - usleep(750000); - writeCG(0, (unsigned char *)writechars + 0); - setMessageToDisplay(test); - } -} - -void sigfunc(int sig) -{ - if (sig != SIGINT) - return; - else - { - exit(-1); - } -} - -void appendToOutput(char c) -{ - //fprintf(stderr,"< appendToOutput\n"); - if (c == 0) return; - - input[position] = c; - if (position == MAX_INPUT) - return; - position++; - - refreshDisp(); - //fprintf(stderr,"appendToOutput >\n"); -} - -void refreshDisp() -{ - memset(&outbuffer[offset], ' ', 16 - offset); - if (position > 15 - offset) - { - memcpy(&outbuffer[offset], &input[position - 15 + offset], 15 - offset); - outbuffer[15] = IN_CHAR; - } - else - { - memcpy(&outbuffer[offset], &input, position); - outbuffer[position + offset] = IN_CHAR; - } - setMessageToDisplay(outbuffer); -} - -char decodeToChar(char in, char in2) -{ - //fprintf(stderr,"< decodeToChar\n"); - - if (in == 48 && in2 >= 48 && in2 <= 57) - { - return '0' + in2 - 48; - } - else if (in == 48 && in2 == 68) - { - return '.'; - } - return 0; -} - -void inputRemote(char *text) -{ - //fprintf(stderr, "< inputRemote(%s)\n", text); - - char *out = malloc(16); - memset(out, 0x10, 16); - memset(input, 0, MAX_INPUT); - memset(outbuffer, ' ', 16); - - if (text != (void *)0) - { - offset = strlen(text); - if (offset > 10) offset = 10; - memcpy(outbuffer, text, offset); - } - - outbuffer[offset] = IN_CHAR; - - FILE *fd = fopen("/dev/ttyAS1", "r"); - if (fd) - { - fprintf(stderr, "opened remote control\n"); - } - - setMessageToDisplay(outbuffer); - int in, in2, in3; - char dec_in; - - while ((in = fgetc(fd)) > 0) - { - in2 = fgetc(fd); - in3 = fgetc(fd); - - if (in3 == 10) - { - //fprintf(stderr,"we have input: %d %d\n", in, in2); - if (in == 53 && in2 == 53) - { - break; - } - else if (in == 53 && in2 == 67) - { - char *out = (char *)malloc(position + 1); - memcpy(out, &input, position); - *(out + position) = 0x00; - printf("%s", out); - break; - } - else if (in == 53 && in2 == 65) - { - //fprintf(stderr,"del\n"); - position--; - if (position < 0) position = 0; - refreshDisp(); - } - dec_in = decodeToChar(in, in2); - appendToOutput(dec_in); - } - } - - memset(&outbuffer, ' ', 16); - setMessageToDisplay(outbuffer); - fprintf(stderr, "bye\n"); - fclose(fd); -} - -void printState(int index) -{ - struct - { - unsigned char start; - unsigned char data[64]; - unsigned char length; - } data; - - memset(&data.data[0], 0, 64); - ioctl(file_vfd, VFDICONGETSTATE, &data); - - data.data[16] = 0x00; - if (data.data[17] != 0x1F) - { - printf("Failed to get icon state! Kernel not patched?\n"); - return; - } - - if (index == -1) - { - int i; - for (i = 0; i < 16; i++) - { - printf("%s: %s\n", icons[i], states[data.data[i]]); - } - } - else - { - printf("%s: %s\n", icons[index], states[data.data[index]]); - } -} - -void setMessageToDisplayEx(char *str, int len) -{ - struct ioctl_data - { - unsigned char start; - unsigned char data[64]; - unsigned char length; - } - writedisp_data; - - memset(writedisp_data.data, ' ', 16); - - if (len > 16) len = 16; - memcpy(writedisp_data.data, str, len); - - writedisp_data.start = 0; - writedisp_data.length = 16; - - ioctl(file_vfd, VFD_Display_Chars, &writedisp_data); -} - -void printBitmap(char *filename, int animationTime) -{ - FILE *fd; - int i, x; - unsigned char *buf; - unsigned char *tx; - - buf = malloc(35); - tx = malloc(17); - - fd = fopen(filename, "r"); - if (fd) - { - fread(buf, 35, 1, fd); // read character bitmaps - x = 0; - for (i = 0; i < 35; i += 5) - { - writeCG(x++, &buf[i]); - } - - while (fread(tx, 17, 1, fd) > 0) // read string to display - { - setMessageToDisplayEx((char *)tx, 16); - usleep(animationTime); - } - - fclose(fd); - - } - else - { - fprintf(stderr, "cannot open file\n"); - } - free(tx); - free(buf); -} - -void playVfdx(char *filename) -{ - FILE *fd; - int i, x; - unsigned char *buf; - char endless = 0; - char currentCharSet = 255; - -#pragma pack(1) - struct - { - char charSet; - char text[16]; - unsigned short sleepTime; - } line; -#pragma pack() - - buf = malloc(10 * 35); - fd = fopen(filename, "r"); - if (fd) - { - fread(&endless, 1, 1, fd); // read character bitmaps - fread(buf, 10 * 35, 1, fd); // read character bitmaps - - for (;;) - { - fseek(fd, 351L, SEEK_SET); - - while (fread(&line, sizeof(line), 1, fd) > 0) // read string to display - { - if (line.charSet != currentCharSet) - { - currentCharSet = line.charSet; - x = 0; - int start = line.charSet * 35; - for (i = start; i < start + 35; i += 5) - { - writeCG(x++, &buf[i]); - } - } - setMessageToDisplayEx(line.text, 16); - usleep(line.sleepTime * 1000); - } - - if (endless == 0) - { - break; - } - } - - fclose(fd); - - } - else - { - fprintf(stderr, "cannot open file\n"); - } - - free(buf); -} -