mdi_video.h 149 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415
/*****************************************************************************
*  Copyright Statement:
*  --------------------
*  This software is protected by Copyright and the information contained
*  herein is confidential. The software may not be copied and the information
*  contained herein may not be used or disclosed except with the written
*  permission of MediaTek Inc. (C) 2005
*
*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/

/*******************************************************************************
 * Filename:
 * ---------
 *  mdi_video.h
 *
 * Project:
 * --------
 *  MAUI
 *
 * Description:
 * ------------
 *  Interface to access video related functions.
 *
 * Author:
 * -------
 * -------
 *
 *==============================================================================
 *             HISTORY
 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *------------------------------------------------------------------------------
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 *------------------------------------------------------------------------------
 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
 *==============================================================================
 *******************************************************************************/
#ifndef _MDI_VIDEO_H
#define _MDI_VIDEO_H

#ifndef _MDI_DATATYPE_H_
#include "mdi_datatype.h"
#endif 

#ifndef _GDI_INCLUDE_H_
#include "gdi_include.h"
#endif
/* add for event type */
#include "custom_events_notify.h"
#include "cal_comm_def.h"
#include "med_api.h"
#include "mdi_camera.h"
#include "MMIDataType.h"
#include "kal_general_types.h"
#include "stack_config.h"
#include "mmi_frm_events_gprot.h"
#include "gdi_datatype.h"
#include "MMI_features.h"
#include "app_ltlcom.h"
#include "drv_sw_features_video.h"

#include "val_recorder_if.h"
#include "mpl_recorder.h"
#include "mm_comm_def.h"

#define MDI_VIDEO_SETTING_CAPMODE      CAL_FEATURE_CAMERA_STILL_CAPTURE_MODE
#define MDI_VIDEO_SETTING_CAMSCENE     CAL_FEATURE_CAMERA_SCENE_MODE
#define MDI_VIDEO_SETTING_CAPSIZE      CAL_FEATURE_CAMERA_STILL_CAPTURE_SIZE
#define MDI_VIDEO_SETTING_BANDING      CAL_FEATURE_CAMERA_BANDING_FREQ
#define MDI_VIDEO_SETTING_FLASH        CAL_FEATURE_CAMERA_FLASH_MODE
#define MDI_VIDEO_SETTING_AFRANGE      CAL_FEATURE_CAMERA_AF_RANGE_CONTROL
#define MDI_VIDEO_SETTING_ISO          CAL_FEATURE_CAMERA_BINNING_INFO
#define MDI_VIDEO_SETTING_WB           CAL_FEATURE_CAMERA_WB
#define MDI_VIDEO_SETTING_EFFECT       CAL_FEATURE_CAMERA_IMAGE_EFFECT
#define MDI_VIDEO_SETTING_AFMODE       CAL_FEATURE_CAMERA_AF_OPERATION_MODE
#define MDI_VIDEO_SETTING_AEMETER      CAL_FEATURE_CAMERA_AE_METERING_MODE
#define MDI_VIDEO_SETTING_SHARPNESS    CAL_FEATURE_CAMERA_SHARPNESS
#define MDI_VIDEO_SETTING_CONTRAST     CAL_FEATURE_CAMERA_CONTRAST
#define MDI_VIDEO_SETTING_SATURATION   CAL_FEATURE_CAMERA_SATURATION
#define MDI_VIDEO_SETTING_EV           CAL_FEATURE_CAMERA_EV_VALUE
#define MDI_VIDEO_SETTING_ZOOM         CAL_FEATURE_CAMERA_DIGITAL_ZOOM
#define MDI_VIDEO_SETTING_VIDEOSCENE   CAL_FEATURE_CAMERA_VIDEO_SCENE_MODE
#define MDI_VIDEO_SUPPORT_ITEM_MAX_NO  (CAMERA_SUPPORT_ITEM_MAX_NO)

typedef enum
{
    MDI_VIDEO_REC_RESOLUTION_128x96 = 0,             // SQCIF
    MDI_VIDEO_REC_RESOLUTION_160x120,             // QQVGA
    MDI_VIDEO_REC_RESOLUTION_176x144,            // QCIF
    MDI_VIDEO_REC_RESOLUTION_320x240,            // QVGA
    MDI_VIDEO_REC_RESOLUTION_400x240,            // WQVGA
    MDI_VIDEO_REC_RESOLUTION_352x288,            // CIF
    MDI_VIDEO_REC_RESOLUTION_432x240,            // CIF
    MDI_VIDEO_REC_RESOLUTION_480x320,            // HVGA
    MDI_VIDEO_REC_RESOLUTION_640x368,            // VGA
    MDI_VIDEO_REC_RESOLUTION_640x480,            // VGA
    MDI_VIDEO_REC_RESOLUTION_720x480,            // D1
    MDI_VIDEO_REC_RESOLUTION_800x480,            // WVGA
    MDI_VIDEO_REC_RESOLUTION_848x480,            // WVGA
    MDI_VIDEO_REC_RESOLUTION_720x576,            // D1
    MDI_VIDEO_REC_RESOLUTION_800x608,            // SVGA
    MDI_VIDEO_REC_RESOLUTION_1024x768,           // XGA
    MDI_VIDEO_REC_RESOLUTION_1280x720,           // 720P
    MDI_VIDEO_REC_RESOLUTION_1280x960,           // 4VGA
    MDI_VIDEO_REC_RESOLUTION_1280x1024,          // SXGA
    MDI_VIDEO_REC_RESOLUTION_1408x1152,          // 16CIF
    MDI_VIDEO_REC_RESOLUTION_1600x1200,          // 4SVGA
    MDI_VIDEO_REC_RESOLUTION_1920x1088,          // FHD
    MDI_VIDEO_REC_RESOLUTION_704x576,            // 4CIF
    MDI_VIDEO_REC_RESOLUTION_864x480,            // FWVGA      

    MDI_VIDEO_REC_RESOLUTION_96x128,              // SQCIF
    MDI_VIDEO_REC_RESOLUTION_120x160,            // QQVGA
    MDI_VIDEO_REC_RESOLUTION_144x176,            // QCIF
    MDI_VIDEO_REC_RESOLUTION_240x320,            // QVGA
    MDI_VIDEO_REC_RESOLUTION_240x400,            // WQVGA
    MDI_VIDEO_REC_RESOLUTION_288x352,            // CIF
    MDI_VIDEO_REC_RESOLUTION_240x432,            // CIF
    MDI_VIDEO_REC_RESOLUTION_320x480,            // HVGA
    MDI_VIDEO_REC_RESOLUTION_368x640,            // VGA
    MDI_VIDEO_REC_RESOLUTION_480x640,            // VGA
    MDI_VIDEO_REC_RESOLUTION_480x720,            // D1
    MDI_VIDEO_REC_RESOLUTION_480x800,            // WVGA
    MDI_VIDEO_REC_RESOLUTION_480x848,            // WVGA
    MDI_VIDEO_REC_RESOLUTION_576x720,            // D1
    MDI_VIDEO_REC_RESOLUTION_608x800,            // SVGA
    MDI_VIDEO_REC_RESOLUTION_768x1024,           // XGA
    MDI_VIDEO_REC_RESOLUTION_720x1280,           // 720P
    MDI_VIDEO_REC_RESOLUTION_960x1280,           // 4VGA
    MDI_VIDEO_REC_RESOLUTION_1024x1280,          // SXGA
    MDI_VIDEO_REC_RESOLUTION_1152x1408,          // 16CIF
    MDI_VIDEO_REC_RESOLUTION_1200x1600,          // 4SVGA
    MDI_VIDEO_REC_RESOLUTION_1088x1920,          // FHD
    MDI_VIDEO_REC_RESOLUTION_576x704,            // 4CIF
    MDI_VIDEO_REC_RESOLUTION_480x864,            // FWVGA 
    
    MDI_VIDEO_REC_RESOLUTION_176x208,
    
    MDI_VIDEO_REC_RESOLUTION_TOTAL_COUNT    
} mdi_video_rec_resolution_enum;

#define MDI_VIDEO_UI_ROTATE_0      MM_IMAGE_ROTATE_0
#define MDI_VIDEO_UI_ROTATE_90     MM_IMAGE_ROTATE_90         /**< clock-wise  90 degree. */
#define MDI_VIDEO_UI_ROTATE_180    MM_IMAGE_ROTATE_180        /**< clock-wise 180 degree. */
#define MDI_VIDEO_UI_ROTATE_270    MM_IMAGE_ROTATE_270        /**< clock-wise 270 degree. */
/******************************************************************************
* This data structure is used by MMI.
******************************************************************************/
typedef struct
{
    mdi_video_rec_resolution_enum video_size;
    U16 video_format;
    U16 storage;
    U16 quality;
} mdi_video_rec_spec_struct;


/* Main sensor */
#define MDI_VIDEO_MAIN_SENSOR               CAM_MAIN_CAMERA
/* Sub sensor */
#define MDI_VIDEO_SUB_SENSOR                CAM_SUB_CAMERA

/* EV value which is higher than default value by 4 levels */
#define MDI_VIDEO_EV_P4                      CAM_EV_POS_4_3
/* EV value which is higher than default value by 3 levels */
#define MDI_VIDEO_EV_P3                      CAM_EV_POS_3_3
/* EV value which is higher than default value by 2 levels */
#define MDI_VIDEO_EV_P2                      CAM_EV_POS_2_3
/* EV value which is higher than default value by 1 levels */
#define MDI_VIDEO_EV_P1                      CAM_EV_POS_1_3
/* Default EV value */
#define MDI_VIDEO_EV_0                       CAM_EV_ZERO
/* EV value which is lower than default value by 1 levels */
#define MDI_VIDEO_EV_N1                      CAM_EV_NEG_1_3
/* EV value which is lower than default value by 2 levels */
#define MDI_VIDEO_EV_N2                      CAM_EV_NEG_2_3
/* EV value which is lower than default value by 3 levels */
#define MDI_VIDEO_EV_N3                      CAM_EV_NEG_3_3
/* EV value which is lower than default value by 4 levels */
#define MDI_VIDEO_EV_N4                      CAM_EV_NEG_4_3
/* EV value which is specific for night mode */
#define MDI_VIDEO_EV_NIGHT                   CAM_EV_NIGHT_SHOT
/* Total count of EV */
#define MDI_VIDEO_EV_COUNT                   CAM_NO_OF_EV

/* Video effect: Normal */
#define MDI_VIDEO_EFFECT_NOMRAL              CAM_EFFECT_ENC_NORMAL
/* Video effect: Grayscale */
#define MDI_VIDEO_EFFECT_GRAYSCALE           CAM_EFFECT_ENC_GRAYSCALE
/* Video effect: Sepia */
#define MDI_VIDEO_EFFECT_SEPIA               CAM_EFFECT_ENC_SEPIA
/* Video effect: Sepia Green */
#define MDI_VIDEO_EFFECT_SEPIA_GREEN         CAM_EFFECT_ENC_SEPIAGREEN
/* Video effect: Sepia Blue */
#define MDI_VIDEO_EFFECT_SEPIA_BLUE          CAM_EFFECT_ENC_SEPIABLUE
/* Video effect: Color Invert */
#define MDI_VIDEO_EFFECT_COLOR_INVERT        CAM_EFFECT_ENC_COLORINV
/* Video effect: Gray Invert */
#define MDI_VIDEO_EFFECT_GRAY_INVERT         CAM_EFFECT_ENC_GRAYINV
/* Video effect: Blackborad */
#define MDI_VIDEO_EFFECT_BLACKBOARD          CAM_EFFECT_ENC_BLACKBOARD
/* Video effect: Whiteborad */
#define MDI_VIDEO_EFFECT_WHITEBOARD          CAM_EFFECT_ENC_WHITEBOARD
/* Video effect: Copper Carving */
#define MDI_VIDEO_EFFECT_COPPER_CARVING      CAM_EFFECT_ENC_COPPERCARVING
/* Video effect: Blue Carving */
#define MDI_VIDEO_EFFECT_BLUE_CARVING        CAM_EFFECT_ENC_BLUECARVING
/* Video effect: Embossment */
#define MDI_VIDEO_EFFECT_EMBOSSMENT          CAM_EFFECT_ENC_EMBOSSMENT
/* Video effect: Contrast */
#define MDI_VIDEO_EFFECT_CONTRAST            CAM_EFFECT_ENC_CONTRAST
/* Video effect: Jean */
#define MDI_VIDEO_EFFECT_JEAN                CAM_EFFECT_ENC_JEAN
/* Video effect: Sketch */
#define MDI_VIDEO_EFFECT_SKETCH              CAM_EFFECT_ENC_SKETCH
/* Video effect: Oil */
#define MDI_VIDEO_EFFECT_OIL                 CAM_EFFECT_ENC_OIL
/* Total count of video effect */
#define MDI_VIDEO_EFFECT_COUNT               CAM_NO_OF_EFFECT_ENC

/* White balance: Auto */
#define MDI_VIDEO_WB_AUTO                    CAM_WB_AUTO
/* White balance: Daylight */
#define MDI_VIDEO_WB_DAYLIGHT                CAM_WB_DAYLIGHT
/* White balance: Tungsten */
#define MDI_VIDEO_WB_TUNGSTEN                CAM_WB_TUNGSTEN
/* White balance: Fluorescent */
#define MDI_VIDEO_WB_FLUORESCENT             CAM_WB_FLUORESCENT
/* White balance: Cloud */
#define MDI_VIDEO_WB_CLOUD                   CAM_WB_CLOUD
/* White balance: Incandescence */
#define MDI_VIDEO_WB_INCANDESCENCE           CAM_WB_INCANDESCENCE
/* Total count of white balance */
#define MDI_VIDEO_WB_COUNT                   CAM_NO_OF_WB

/* Camera banding 50HZ */
#define MDI_VIDEO_BANDING_50HZ               CAM_BANDING_50HZ
/* Camera banding 60HZ */
#define MDI_VIDEO_BANDING_60HZ               CAM_BANDING_60HZ
/* Total count of camera banding */
#define MDI_VIDEO_BANDING_COUNT              CAM_NO_OF_BANDING

#define MDI_VIDEO_VIDEO_SIZE_SQCIF           MDI_VIDEO_REC_RESOLUTION_128x96
#define MDI_VIDEO_VIDEO_SIZE_QQVGA           MDI_VIDEO_REC_RESOLUTION_160x120
#define MDI_VIDEO_VIDEO_SIZE_QCIF            MDI_VIDEO_REC_RESOLUTION_176x144
#define MDI_VIDEO_VIDEO_SIZE_QVGA            MDI_VIDEO_REC_RESOLUTION_320x240
#define MDI_VIDEO_VIDEO_SIZE_CIF             MDI_VIDEO_REC_RESOLUTION_352x288
#define MDI_VIDEO_VIDEO_SIZE_WQVGA           MDI_VIDEO_REC_RESOLUTION_400x240
#define MDI_VIDEO_VIDEO_SIZE_HVGA            MDI_VIDEO_REC_RESOLUTION_480x320
#define MDI_VIDEO_VIDEO_SIZE_NHD             MDI_VIDEO_REC_RESOLUTION_640x368
#define MDI_VIDEO_VIDEO_SIZE_VGA             MDI_VIDEO_REC_RESOLUTION_640x480
#define MDI_VIDEO_VIDEO_SIZE_WVGA            MDI_VIDEO_REC_RESOLUTION_800x480
#define MDI_VIDEO_VIDEO_SIZE_D1              MDI_VIDEO_REC_RESOLUTION_720x480
#define MDI_VIDEO_VIDEO_SIZE_D1_2            MDI_VIDEO_REC_RESOLUTION_720x576
#define MDI_VIDEO_VIDEO_SIZE_CIF_2           MDI_VIDEO_REC_RESOLUTION_432x240
#define MDI_VIDEO_VIDEO_SIZE_WVGA_2          MDI_VIDEO_REC_RESOLUTION_848x480
#define MDI_VIDEO_VIDEO_SIZE_SVGA            MDI_VIDEO_REC_RESOLUTION_800x608  
#define MDI_VIDEO_VIDEO_SIZE_XGA             MDI_VIDEO_REC_RESOLUTION_1024x768 
#define MDI_VIDEO_VIDEO_SIZE_720P            MDI_VIDEO_REC_RESOLUTION_1280x720 
#define MDI_VIDEO_VIDEO_SIZE_4VGA            MDI_VIDEO_REC_RESOLUTION_1280x960 
#define MDI_VIDEO_VIDEO_SIZE_SXGA            MDI_VIDEO_REC_RESOLUTION_1280x1024
#define MDI_VIDEO_VIDEO_SIZE_16CIF           MDI_VIDEO_REC_RESOLUTION_1408x1152
#define MDI_VIDEO_VIDEO_SIZE_4SVGA           MDI_VIDEO_REC_RESOLUTION_1600x1200
#define MDI_VIDEO_VIDEO_SIZE_FHD             MDI_VIDEO_REC_RESOLUTION_1920x1088
#define MDI_VIDEO_VIDEO_SIZE_4CIF            MDI_VIDEO_REC_RESOLUTION_704x576
#define MDI_VIDEO_VIDEO_SIZE_FWVGA           MDI_VIDEO_REC_RESOLUTION_864x480

#define MDI_VIDEO_VIDEO_SIZE_WP_QCIF         MDI_VIDEO_REC_RESOLUTION_176x208
#define MDI_VIDEO_VIDEO_SIZE_WP_QVGA         MDI_VIDEO_REC_RESOLUTION_240x320
#define MDI_VIDEO_VIDEO_SIZE_WP_WQVGA        MDI_VIDEO_REC_RESOLUTION_240x400
#define MDI_VIDEO_VIDEO_SIZE_WP_HVGA         MDI_VIDEO_REC_RESOLUTION_320x480
#define MDI_VIDEO_VIDEO_SIZE_WP_WVGA         MDI_VIDEO_REC_RESOLUTION_480x800

/* Video size: User Define, which is not defined in our support list */
#define MDI_VIDEO_VIDEO_SIZE_USER_DEFINE     MDI_VIDEO_REC_RESOLUTION_TOTAL_COUNT

/* Video quality: Fine */
#define MDI_VIDEO_REC_QTY_FINE               MPL_RECORDER_QUALITY_FINE
/* Video quality: High */
#define MDI_VIDEO_REC_QTY_HIGH               MPL_RECORDER_QUALITY_HIGH
/* Video quality: Normal */
#define MDI_VIDEO_REC_QTY_NORMAL             MPL_RECORDER_QUALITY_NORMAL
/* Video quality: Low */
#define MDI_VIDEO_REC_QTY_LOW                MPL_RECORDER_QUALITY_LOW
/* Total count of video quality */
#define MDI_VIDEO_REC_QTY_COUNT              MPL_RECORDER_QUALITY_MAX
#define MDI_VIDEO_REC_QTY_ALL                MPL_RECORDER_QUALITY_MAX

/* Video Storage:  */
#define MDI_VIDEO_REC_STORAGE_PHONE             MPL_RECORDER_STORAGE_PHONE
/* Video Storage:  */
#define MDI_VIDEO_REC_STORAGE_SD                MPL_RECORDER_STORAGE_CARD
/* Total count of video storage */
#define MDI_VIDEO_REC_STORAGE_COUNT              MPL_RECORDER_STORAGE_MAX
#define MDI_VIDEO_REC_STORAGE_ALL              MPL_RECORDER_STORAGE_MAX

/* Video telephony encode quality: Fine */
#define MDI_VIDEO_TEL_ENC_QTY_FINE           VCALL_ENC_QTY_FINE
/* Video telephony encode quality: Normal */
#define MDI_VIDEO_TEL_ENC_QTY_NORMAL         VCALL_ENC_QTY_NORMAL
/* Video telephony encode quality: Low */
#define MDI_VIDEO_TEL_ENC_QTY_LOW            VCALL_ENC_QTY_LOW
/* Total count of video telephony encode quality */
#define MDI_VIDEO_TEL_ENC_QTY_COUNT          VCALL_ENC_QTY_TOTAL

/* Video format: 3GP */
#define MDI_VIDEO_VIDEO_FORMAT_3GP           MPL_RECORDER_FORMAT_H263
/* Video format: MP4 */
#define MDI_VIDEO_VIDEO_FORMAT_MP4           MPL_RECORDER_FORMAT_MPEG4
/* Video format: MJPEG */
#define MDI_VIDEO_VIDEO_FORMAT_MJPEG         MPL_RECORDER_FORMAT_MJPEG

#define MDI_VIDEO_VIDEO_FORMAT_H264          MPL_RECORDER_FORMAT_H264

/* Total count of video format */
#define MDI_VIDEO_VIDEO_FORMAT_COUNT         MPL_RECORDER_FORMAT_MAX

/* Preview rotate: 0 degree */
#define MDI_VIDEO_PREVIEW_ROTATE_0           CAM_IMAGE_NORMAL
/* Preview rotate: 90 degree */
#define MDI_VIDEO_PREVIEW_ROTATE_90          CAM_IMAGE_ROTATE_90
/* Preview rotate: 180 degree */
#define MDI_VIDEO_PREVIEW_ROTATE_180         CAM_IMAGE_ROTATE_180
/* Preview rotate: 270 degree */
#define MDI_VIDEO_PREVIEW_ROTATE_270         CAM_IMAGE_ROTATE_270
/* Preview rotate: 0 degree + Mirror*/
#define MDI_VIDEO_PREVIEW_ROTATE_0_MIRROR    CAM_IMAGE_MIRROR
/* Preview rotate: 90 degree + Mirror */
#define MDI_VIDEO_PREVIEW_ROTATE_90_MIRROR   CAM_IMAGE_MIRROR_ROTATE_90
/* Preview rotate: 180 degree + Mirror */
#define MDI_VIDEO_PREVIEW_ROTATE_180_MIRROR  CAM_IMAGE_MIRROR_ROTATE_180
/* Preview rotate: 270 degree + Mirror */
#define MDI_VIDEO_PREVIEW_ROTATE_270_MIRROR  CAM_IMAGE_MIRROR_ROTATE_270

#define MDI_VIDEO_PREVIEW_ROTATE_RESET       (999)

#if defined(ISP_SUPPORT)
/* LCD rotate: 0 degree */
#define MDI_VIDEO_LCD_ROTATE_0            LCD_LAYER_ROTATE_NORMAL
/* LCD rotate: 90 degree */
#define MDI_VIDEO_LCD_ROTATE_90           LCD_LAYER_ROTATE_90
/* LCD rotate: 180 degree */
#define MDI_VIDEO_LCD_ROTATE_180          LCD_LAYER_ROTATE_180
/* LCD rotate: 270 degree */
#define MDI_VIDEO_LCD_ROTATE_270          LCD_LAYER_ROTATE_270
/* LCD rotate: 0 degree + Mirror */
#define MDI_VIDEO_LCD_ROTATE_0_MIRROR     LCD_LAYER_MIRROR
/* LCD rotate: 90 degree + Mirror */
#define MDI_VIDEO_LCD_ROTATE_90_MIRROR    LCD_LAYER_MIRROR_ROTATE_90
/* LCD rotate: 180 degree + Mirror */
#define MDI_VIDEO_LCD_ROTATE_180_MIRROR   LCD_LAYER_MIRROR_ROTATE_180
/* LCD rotate: 270 degree + Mirror */
#define MDI_VIDEO_LCD_ROTATE_270_MIRROR   LCD_LAYER_MIRROR_ROTATE_270
#else /* defined(ISP_SUPPORT) */ 
/* LCD rotate: 0 degree */
#define MDI_VIDEO_LCD_ROTATE_0            0
/* LCD rotate: 90 degree */
#define MDI_VIDEO_LCD_ROTATE_90           1
/* LCD rotate: 180 degree */
#define MDI_VIDEO_LCD_ROTATE_180          2
/* LCD rotate: 270 degree */
#define MDI_VIDEO_LCD_ROTATE_270          3
/* LCD rotate: 0 degree + Mirror */
#define MDI_VIDEO_LCD_ROTATE_0_MIRROR     4
/* LCD rotate: 90 degree + Mirror */
#define MDI_VIDEO_LCD_ROTATE_90_MIRROR    5
/* LCD rotate: 180 degree + Mirror */
#define MDI_VIDEO_LCD_ROTATE_180_MIRROR   6
/* LCD rotate: 270 degree + Mirror */
#define MDI_VIDEO_LCD_ROTATE_270_MIRROR   7
#endif /* defined(ISP_SUPPORT) */ 

/* Brightness value which is darker than default value by 5 levels */
#define MDI_VIDEO_BRIGHTNESS_N5              0
/* Brightness value which is darker than default value by 4 levels */
#define MDI_VIDEO_BRIGHTNESS_N4              1
/* Brightness value which is darker than default value by 3 levels */
#define MDI_VIDEO_BRIGHTNESS_N3              2
/* Brightness value which is darker than default value by 2 levels */
#define MDI_VIDEO_BRIGHTNESS_N2              3
/* Brightness value which is darker than default value by 1 levels */
#define MDI_VIDEO_BRIGHTNESS_N1              4
/* Default brightness value */
#define MDI_VIDEO_BRIGHTNESS_0               5
/* Brightness value which is brighter than default value by 1 level */
#define MDI_VIDEO_BRIGHTNESS_P1              6
/* Brightness value which is brighter than default value by 2 level */
#define MDI_VIDEO_BRIGHTNESS_P2              7
/* Brightness value which is brighter than default value by 3 level */
#define MDI_VIDEO_BRIGHTNESS_P3              8
/* Brightness value which is brighter than default value by 4 level */
#define MDI_VIDEO_BRIGHTNESS_P4              9
/* Brightness value which is brighter than default value by 5 level */
#define MDI_VIDEO_BRIGHTNESS_P5              10

/* Contrast value which is lower than default value by 5 levels */
#define MDI_VIDEO_CONTRAST_N5                0
/* Contrast value which is lower than default value by 4 levels */
#define MDI_VIDEO_CONTRAST_N4                1
/* Contrast value which is lower than default value by 3 levels */
#define MDI_VIDEO_CONTRAST_N3                2
/* Contrast value which is lower than default value by 2 levels */
#define MDI_VIDEO_CONTRAST_N2                3
/* Contrast value which is lower than default value by 1 levels */
#define MDI_VIDEO_CONTRAST_N1                4
/* Default contrast value */
#define MDI_VIDEO_CONTRAST_0                 5
/* Contrast value which is higher than default value by 1 levels */
#define MDI_VIDEO_CONTRAST_P1                6
/* Contrast value which is higher than default value by 2 levels */
#define MDI_VIDEO_CONTRAST_P2                7
/* Contrast value which is higher than default value by 3 levels */
#define MDI_VIDEO_CONTRAST_P3                8
/* Contrast value which is higher than default value by 4 levels */
#define MDI_VIDEO_CONTRAST_P4                9
/* Contrast value which is higher than default value by 5 levels */
#define MDI_VIDEO_CONTRAST_P5                10

/* Frame mode in which video content will stretch to video layer */
#define MDI_VIDEO_FRAME_MODE_STRETCH        MED_VID_FRAME_STRETCH

/* Frame mode in which video content will best fit the video layer from the outside */
#define MDI_VIDEO_FRAME_MODE_FIT_OUTSIDE    MED_VID_FRAME_FIT_OUTSIDE

/* Frame mode in which video content will best fit the video layer from the inside */
#define MDI_VIDEO_FRAME_MODE_FIT_INSIDE    MED_VID_FRAME_FIT_INSIDE

/* Max length of content info */
#define MDI_VIDEO_MAX_CONTENT_INFO_LEN       80

/* Max buffer size of content info */
#define MDI_VIDEO_CONTENT_BUFFER_SIZE        ((MDI_VIDEO_MAX_CONTENT_INFO_LEN + 1) * ENCODING_LENGTH)

/* Character count of the info title */
#define MDI_VIDEO_INFO_TITLE_CHAR_COUNT      32

#define MDI_VIDEO_MAX_TRACK_NUM (VID_MAX_VIDEO_TRACK_NUM)
#define MDI_VIDEO_MAX_SUBTITLE_NUM (VID_MAX_VIDEO_SUBTITLE_NUM)

#ifdef __MMI_OP11_PDL_FROM_SDP__
/* Max length of url buffer inside SDP*/
#define MDI_SDP_MAX_URL_LEN     256
/* Max SDP file size */
#define MDI_SDP_MAX_FILE_SIZE   40960

#define MDI_SDP_ATTRIB_PURGE    "X-purge"
#define MDI_SDP_ATTRIB_FSIZE    "X-filesize"
#define MDI_SDP_ATTRIB_FWALLOW  "X-FORWARD-ALLOWED"
#endif /* __MMI_OP11_PDL_FROM_SDP__ */

#if defined(__MTK_TARGET__)
    /* HW Rotator support */
    #define __MDI_VIDEO_HW_ROTATOR_SUPPORT__
    #define __MDI_VIDEO_HW_ROTATOR_BY_IDP__
#endif

#if defined(VA2_RENDERER_VP_VIDEO_PROCESSING_SUPPORTED)
    #define __MDI_VIDEO_PROCESSING_SUPPORT__
#endif

#ifdef __MMI_VIDEO_SUBTITLE_SUPPORT__
#define MDI_VDOPLY_MAX_SUBTITLE_LAYER_WIDTH (VIDEO_SUBTITLE_RECT_MAX_WIDTH)
#define MDI_VDOPLY_MAX_SUBTITLE_LAYER_HEIGHT (VIDEO_SUBTITLE_RECT_MAX_HEIGHT)
#endif

#if defined(__MTK_TARGET__)
/* Scene mode: Audo */
#define MDI_VIDEO_SCENE_MODE_AUTO                   CAM_VIDEO_AUTO
/* Scene mode: Night */
#define MDI_VIDEO_SCENE_MODE_NIGHT                  CAM_VIDEO_NIGHT
/* AF range mode: Auto */
#define MDI_VIDEO_AF_RANGE_AUTO                     CAM_AF_RANGE_AUTO
/* AF range mode: Landscape */
#define MDI_VIDEO_AF_RANGE_LANDSCAPE                CAM_AF_RANGE_LANDSCAPE
/* AF range mode: Macro */
#define MDI_VIDEO_AF_RANGE_MACRO                    CAM_AF_RANGE_MACRO
/* AF operation mode: Single zone */
#define MDI_VIDEO_AF_OPERATION_MODE_SINGLE_ZONE     CAM_AF_SINGLE_ZONE
/* AF operation mode: Continuous */
#define MDI_VIDEO_AF_OPERATION_MODE_CONTINUOUS      CAM_AF_CONTINUOUS
/* Image enhancement level: Low */
#define MDI_VIDEO_IE_LEVEL_LOW                      CAM_ADJUST_LOW_LEVEL
/* Image enhancement level: Medium */
#define MDI_VIDEO_IE_LEVEL_MEDIUM                   CAM_ADJUST_MED_LEVEL
/* Image enhancement level: High*/
#define MDI_VIDEO_IE_LEVEL_HIGH                     CAM_ADJUST_HIGH_LEVEL
#else
/* Scene mode: Audo */
#define MDI_VIDEO_SCENE_MODE_AUTO                   0
/* Scene mode: Night */
#define MDI_VIDEO_SCENE_MODE_NIGHT                  0
/* AF range mode: Auto */
#define MDI_VIDEO_AF_RANGE_AUTO                     0
/* AF range mode: Landscape */
#define MDI_VIDEO_AF_RANGE_LANDSCAPE                0
/* AF range mode: Macro */
#define MDI_VIDEO_AF_RANGE_MACRO                    0
/* AF operation mode: Single zone */
#define MDI_VIDEO_AF_OPERATION_MODE_SINGLE_ZONE     0
/* AF operation mode: Continuous */
#define MDI_VIDEO_AF_OPERATION_MODE_CONTINUOUS      0
/* Image enhancement level: Low */
#define MDI_VIDEO_IE_LEVEL_LOW                      0
/* Image enhancement level: Medium */
#define MDI_VIDEO_IE_LEVEL_MEDIUM                   0
/* Image enhancement level: High*/
#define MDI_VIDEO_IE_LEVEL_HIGH                     0
#endif

/* Video telephony display type enum */
typedef enum {
    MDI_VIDEO_TEL_DISPLAY_HIDE,     /* Video display type: hide */
    MDI_VIDEO_TEL_DISPLAY_IMAGE,    /* Video display type: image */    
    MDI_VIDEO_TEL_DISPLAY_VIDEO     /* Video display type: video */
} mdi_video_tel_disp_type_enum;

/* Video telephony codec event enum */
typedef enum {
    MDI_VIDEO_TEL_EVENT_CHANGE_ENCODE_SIZE,     /* Event: change encode size */
    MDI_VIDEO_TEL_EVENT_CHANGE_ENCODE_QUALITY,  /* Event: change encode quality */    
    MDI_VIDEO_TEL_EVENT_UPDATE_LCD,  /* Event: update lcd */        
    MDI_VIDEO_TEL_EVENT_ENC_PATH_BUILT,  /* Event: notify enc path is built */           
    MDI_VIDEO_TEL_EVENT_DEC_CH_CHANGE  /* Event: notify dec CH is changed (close camera) */               
} mdi_video_tel_codec_event_enum;

/* Stream type enum */
typedef enum
{
    MDI_VIDEO_STREAM_RTSP_URL,  /* Stream type in RSTP URL format */
    MDI_VIDEO_STREAM_SDP_FILE   /* Stream type in SDP File format */
} mdi_video_stream_type_enum;

/* Stream transport type enum */
typedef enum
{
    MDI_VIDEO_STREAM_TRANSPORT_UDP,  /* Stream transport type UDP */
    MDI_VIDEO_STREAM_TRANSPORT_TCP   /* Stream transport type TCP */
} mdi_video_stream_transport_type_enum;

/* Video track type enum */
typedef enum
{
    MDI_VIDEO_TRACK_NONE,   /* Video has no track in it */
    MDI_VIDEO_TRACK_AV,     /* Video has both audio and video tracks */
    MDI_VIDEO_TRACK_A_ONLY, /* Video has audio track only */
    MDI_VIDEO_TRACK_V_ONLY, /* Video has video track only */
    MDI_VIDEO_TRACK_COUNT   /* Count of video track enum */
} mdi_video_track_enum;

/* DRM state enum */
typedef enum
{
    MDI_VIDEO_DRM_EXIT,         /* Drm State: Exit */
    MDI_VIDEO_DRM_PERMITTED,    /* Drm State: Permitted */
    MDI_VIDEO_DRM_CONSUMING,    /* Drm State: Consuming */
    MDI_VIDEO_DRM_PLAY_FINISHED,/* Drm State: Finished */
    MDI_VIDEO_DRM_PAUSED,       /* Drm State: Paused */

    MDI_VIDEO_DRM_END           /* Count of drm state */
} mdi_video_drm_state_enum;


/* Video scenario type */
typedef enum
{
    MDI_VIDEO_SCENARIO_DEFAULT = MPL_DECODER,
    MDI_VIDEO_SCENARIO_QVGA = MPL_UPTO_QVGA,
    MDI_VIDEO_SCENARIO_CIF = MPL_UPTO_CIF,
    MDI_VIDEO_SCENARIO_PREVIEW = MPL_PREVIEW,
    MDI_VIDEO_SCENARIO_INFO = MPL_INFO,
    MDI_VIDEO_SCENARIO_MPEG4 = MPL_MPEG4_DECODER,
    MDI_VIDEO_SCENARIO_DEFAULT_N_SUBTITLE = MPL_DECODER_N_SUBTITLE,
    MDI_VIDEO_SCENARIO_QVGA_MPEG4SP = MPL_QVGA_MPEG4SP
} mdi_video_scenario_type_enum;

/* video 3D mode */
typedef enum
{
    MDI_VIDEO_3D_MODE_NONE = MPL_RENDERER_3D_MODE_OFF,
    MDI_VIDEO_3D_MODE_SIDE_BY_SIDE = MPL_RENDERER_3D_MODE_SIDE_BY_SIDE,
    MDI_VIDEO_3D_MODE_TOP_DOWN = MPL_RENDERER_3D_MODE_TOP_DOWN
} mdi_video_3d_mode_enum;

/* Video key frame direction */
typedef enum
{
    MDI_VIDEO_SEARCH_DIR_BACKWARD,
    MDI_VIDEO_SEARCH_DIR_FORWARD    
} mdi_video_search_dir_enum;

typedef struct
{
    U8 elapse_ticks;
    U8 sleep_ticks;
} mdi_video_sleep_struct;

/* Video information structure */
typedef enum
{
    MDI_VIDEO_TRACK_2D_NORMAL = MPL_VIDEO_2D_NORMAL,
    MDI_VIDEO_TRACK_3D = MPL_VIDEO_3D
} mdi_video_track_type_enum;

typedef struct
{
    U32 track_index;
    mdi_video_track_type_enum track_type;
} mdi_video_track_info;

typedef struct
{
    U32 track_index;
    U32 language;
} mdi_video_subtitle_info;

typedef enum
{
    MDI_VIDEO_THUMB_NONE = MPL_THUMBNAIL_NONE,
    MDI_VIDEO_THUMB_JPG = MPL_THUMBNAIL_JPG,
    MDI_VIDEO_THUMB_PNG = MPL_THUMBNAIL_PNG,
    MDI_VIDEO_THUMB_BMP = MPL_THUMBNAIL_BMP
} mdi_video_thumb_type_enum;

typedef struct
{
    WCHAR *title_desc_ptr;
    U16 title_desc_len;

    WCHAR *artist_desc_ptr;
    U16 artist_desc_len;

    WCHAR *date_desc_ptr;
    U16 date_desc_len;

    WCHAR *annotation_desc_ptr;
    U16 annotation_desc_len;

    WCHAR *type_desc_ptr;
    U16 type_desc_len;

    U8 *thumb_ptr;
    U32 thumb_allocated_len;
    U32 thumb_usaged_len;

    mdi_video_thumb_type_enum thumb_type;
}mdi_video_mot_meta_struct;


typedef struct
{
    U16 width;                      /* Width of the video */
    U16 height;                     /* Height of the video */
    U32 total_frame_count;          /* Total framecount of the video */
    U64 total_time_duration;        /* Total time duration of the video */
    mdi_video_track_enum track;     /* Track information of the video */
    //mdi_handle handle;              /* Handle of the opened video file */
    MMI_BOOL is_seekable;           /* Is this video seekable */
    MMI_BOOL is_stereo;             /* Not used */
    U8 aud_channel_no;              /* Audio channel count information */
    U16 aud_sample_rate;            /* Audio sample rate information */

    MMI_BOOL is_drm_streaming;      /* Is this is a drm streaming file */
    MMI_BOOL is_rec_allowed;        /* Recording is allowed or not */    
#ifdef __MMI_VIDEO_CLIPPER__ 
    MMI_BOOL is_proprietary;        /* Is proprietary */
#endif
    S32 drm_handle;                 /* DRM handle of this video */
    
#ifdef __MMI_VIDEO_3D_ANAGLYPH__
    U32 track_num;
    mdi_video_track_info track_info[MDI_VIDEO_MAX_TRACK_NUM];
#endif /* __MMI_VIDEO_3D_ANAGLYPH__ */ 
#ifdef __MMI_VIDEO_SUBTITLE_SUPPORT__    
    U32 subtitle_num;
    mdi_video_subtitle_info subtitle_info[MDI_VIDEO_MAX_SUBTITLE_NUM];
#endif  

    CHAR title_desc[MDI_VIDEO_CONTENT_BUFFER_SIZE];       /* Title information */
    CHAR artist_desc[MDI_VIDEO_CONTENT_BUFFER_SIZE];      /* Artist information */
    CHAR album_desc[MDI_VIDEO_CONTENT_BUFFER_SIZE];       /* Album information */
    CHAR author_desc[MDI_VIDEO_CONTENT_BUFFER_SIZE];      /* Author information */
    CHAR copyright_desc[MDI_VIDEO_CONTENT_BUFFER_SIZE];   /* Copyright information */
    CHAR date_desc[MDI_VIDEO_CONTENT_BUFFER_SIZE];        /* Date information */ 
} mdi_video_info_struct;

/* Video setting structure */
typedef struct
{
    U16 wb;                 /* Current white balance value cached in MDI-Video */
    U16 ev;                 /* Current EV value cached in MDI-Video */
    U16 banding;            /* Current camera banding value cached in MDI-Video */
    U16 effect;             /* Current effect value cached in MDI-Video */
    U16 zoom;               /* Current zoom value cached in MDI-Video */
    U16 brightness;         /* Current brightness value cached in MDI-Video */
    U16 contrast;           /* Current contrast value cached in MDI-Video */
    U16 saturation;         /* Current saturation value cached in MDI-Video */
    U16 hue;                /* Current hue value cached in MDI-Video */
    U16 preview_rotate;     /* Current preview rotate value cached in MDI-Video */
    U16 lcm_rotate;         /* Current lcm rotate value cached in MDI-Video */
    U16 night;              /* Current night mode value cached in MDI-Video */
    U16 flash;              /* Current flash light mode cached in MDI-Video */

    U16 dsc_mode;           /* Current scene mode value cached in MDI-Video */
    U16 af_operation_mode;  /* Current af operation mode value cached in MDI-Video */
    U16 af_range;           /* Current af range value cached in MDI-Video */
    U16 sharpness;          /* Current sharpness value cached in MDI-Video */
    U32 max_zoom_factor;    /* Current max zoom factor value cached in MDI-Video */
    U8 total_zoom_step;     /* Current total zoom sted cached in MDI-Video */

    U16 video_size;         /* Current video size cached in MDI-Video */
    U16 video_qty;          /* Current video quality cached in MDI-Video */
    U16 size_limit;         /* Current video limit of size cached in MDI-Video */
    U32 time_limit;         /* Current video time limit of size cached in MDI-Video */
    U16 record_aud;         /* Record audio or not flag cached in MDI-Video */
    U16 video_format;       /* Current video format cached in MDI-Video */
    U16 user_def_width;     /* User defined width cached in MDI-Video */
    U16 user_def_height;    /* User defined height cached in MDI-Video */

    BOOL overlay_frame_mode;            /* Overlay frame mode */
    U8 overlay_frame_depth;             /* Overlay frame depth */
    U8 overlay_frame_source_key;        /* Overlay frame source key */
    U16 overlay_frame_width;            /* Overlay frame width */
    U16 overlay_frame_height;           /* Overlay frame height */
    U32 overlay_frame_buffer_address;   /* Overlay frame buffer address */

    U16 peer_enc_qty;               /* Video Telephony: peer encode quality */
    BOOL notify_peer_on_camera_off; /* Video Telephony: notify peer when local camera is off */
    BOOL display_mirror;            /* Video Telephony: mirror display */
    U16  display_rotate;            /* Video Telephony: rotate display */

    U16 ui_rotate;         /* ui rotate angle */
    U16 storage;
    U32 encode_one_frame_duration; /* the duration for recording one frame [TimeLapse], ms */
} mdi_video_setting_struct;


#ifdef __MMI_OP11_PDL_FROM_SDP__
/* PDL sdp url structure */
typedef struct
{
    kal_char  url[MDI_SDP_MAX_URL_LEN];
    kal_uint32 byte_fsize;
    kal_bool   x_forward_allowed;
    kal_bool   x_purge;
}mdi_sdp_pdl_info;
#endif /* __MMI_OP11_PDL_FROM_SDP__ */


/*****************************************************************************
 * <GROUP CallBackFunctions>
 * FUNCTION
 *  mdi_record_result_callback
 * DESCRIPTION
 *  When recording, if there is any error or indication from media-task, MDI-Video module will invoke this callback function and pass the result to it.
 *  MMI application should handle this kind of error.
 * PARAMETERS
 *  ret: [IN] The result in MDI_RESULT enum type.
 * RETURNS
 *  void
 *****************************************************************************/
typedef void (*mdi_record_result_callback) (MDI_RESULT ret, void* user_data);

/*****************************************************************************
 * <GROUP CallBackFunctions>
 * FUNCTION
 *  mdi_save_result_callback
 * DESCRIPTION
 *  When merging and saving recorded video data, if there is any error or indication from media-task, MDI-Video module will invoke this callback function and pass the result to MMI applications.
 *  MMI application should handle this kind of error.
 * PARAMETERS
 *  ret: [IN] The result in MDI_RESULT enum type.
 * RETURNS
 *  void
 *****************************************************************************/
typedef void (*mdi_save_result_callback) (MDI_RESULT ret, void* user_data);

/*****************************************************************************
 * <GROUP CallBackFunctions>
 * FUNCTION
 *  mdi_open_result_callback
 * DESCRIPTION
 *  When open a file in async mode, if there is any error or indication (open succeefully) from media-task, MDI-Video module will invoke this callback function and pass the result to MMI appliactions.
 *  MMI application should handle this kind of error.
 * PARAMETERS
 *  ret : [IN] The result in MDI_RESULT enum type.
 *  video_info : [OUT] video information of this opened file, it will contain valid data if the open operation is succeeded.
 * RETURNS
 *  void
 *****************************************************************************/
typedef void (*mdi_open_result_callback)(MDI_RESULT ret, mdi_video_info_struct *video_info, void *user_data);

/*****************************************************************************
 * <GROUP CallBackFunctions>
 * FUNCTION
 *  mdi_play_finish_callback
 * DESCRIPTION
 *  When playing a video, if there is any error or indication (finished playing) from media-task, MDI-Video module will invoke this callback function and pass the result to MMI applications.
 *  MMI application should handle this kind of error.
 * PARAMETERS
 *  ret: [IN] The result in MDI_RESULT enum type.
 * RETURNS
 *  void
 *****************************************************************************/
typedef void (*mdi_play_finish_callback) (MDI_RESULT ret, void *user_data);

/*****************************************************************************
 * <GROUP CallBackFunctions>
 * FUNCTION
 *  mdi_seek_result_callback
 * DESCRIPTION
 *  When seeking, if there is any error or indication (finish seeking) from media-task, MDI-Video module will invoke this callback function and pass the result to MMI applications.
 *  MMI application should handle this kind of error.
 * PARAMETERS
 *  ret: [IN] The result in MDI_RESULT enum type.
 * RETURNS
 *  void
 *****************************************************************************/
typedef void (*mdi_seek_result_callback) (MDI_RESULT ret, void *user_data);

/*****************************************************************************
 * <GROUP CallBackFunctions>
 * FUNCTION
 *  mdi_get_thumbnail_result_callback
 * DESCRIPTION
 *  When getting thumbnail, if there is any error or indication (finish seeking) from media-task, MDI-Video module will invoke this callback function and pass the result to MMI applications.
 *  MMI application should handle this kind of error.
 * PARAMETERS
 *  ret: [IN] The result in MDI_RESULT enum type.
 * RETURNS
 *  void
 *****************************************************************************/
typedef void (*mdi_get_thumbnail_result_callback) (MDI_RESULT ret);

/*****************************************************************************
 * <GROUP CallBackFunctions>
 * FUNCTION
 *  mdi_merge_result_callback
 * DESCRIPTION
 *  When merge or encode video editors clips, if there is any error or indication (finish seeking) from media-task, MDI-Video module will invoke this callback function and pass the result to MMI applications.
 *  MMI application should handle this kind of error.
 * PARAMETERS
 *  ret: [IN] The result in MDI_RESULT enum type.
 * RETURNS
 *  void
 *****************************************************************************/
typedef void (*mdi_merge_result_callback) (MDI_RESULT ret);

/*****************************************************************************
 * <GROUP CallBackFunctions>
 * FUNCTION
 *  mdi_progressive_result_callback
 * DESCRIPTION
 *  When open a progressive download file in async mode, if there is any error or indication (open succeefully) from media-task, MDI-Video module will invoke this callback function and pass the result to MMI appliactions.
 *  MMI application should handle this kind of error.
 * PARAMETERS
 *  ret : [IN] The result in MDI_RESULT enum type.
 *  video_info : [OUT] video information of this opened file, it will contain valid data if the open operation is succeeded.
 * RETURNS
 *  void
 *****************************************************************************/
typedef void (*mdi_progressive_result_callback) (MDI_RESULT ret , mdi_video_info_struct* video_info, void *user_data);


/*****************************************************************************
 * <GROUP CallBackFunctions>
 * FUNCTION
 *  mdi_connect_result_callback
 * DESCRIPTION
 *  When open a stream file in async mode, if there is any error or indication (open succeefully) from media-task, MDI-Video module will invoke this callback function and pass the result to MMI appliactions.
 *  MMI application should handle this kind of error.
 * PARAMETERS
 *  ret : [IN] The result in MDI_RESULT enum type.
 *  video_info : [OUT] video information of this opened file, it will contain valid data if the open operation is succeeded.
 * RETURNS
 *  void
 *****************************************************************************/
typedef void (*mdi_connect_result_callback)(MDI_RESULT ret, mdi_video_info_struct* video_info, void *user_data);

/*****************************************************************************
 * <GROUP CallBackFunctions>
 * FUNCTION
 *  mdi_buffering_result_callback
 * DESCRIPTION
 *  When buffering video/audio data in async mode, if there is any error or indication (open succeefully) from media-task, MDI-Video module will invoke this callback function and pass the result to MMI appliactions.
 *  MMI application should handle this kind of error.
 * PARAMETERS
 *  ret : [IN] The result in MDI_RESULT enum type.
 *  video_info : [OUT] video information of this opened file, it will contain valid data if the open operation is succeeded.
 * RETURNS
 *  void
 *****************************************************************************/
typedef void (*mdi_buffering_result_callback)(MDI_RESULT ret, mdi_video_info_struct* video_info, void *user_data);

/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP CallBackFunctions>
 * FUNCTION
 *  mdi_event_callback
 * DESCRIPTION
 *
 * PARAMETERS
 *  codec_event : [IN]
 *  para : [IN]
 * RETURNS
 *  void
 *****************************************************************************/
typedef void (*mdi_video_tel_event_callback)(mdi_video_tel_codec_event_enum codec_event, S32 para, void* callback_userdata);
/* DOM-NOT_FOR_SDK-END */

/* Video get frame structure */
typedef struct
{
    gdi_handle player_layer_handle;
    gdi_handle subtitle_layer_handle;
} mdi_video_get_frame_struct;

/* Video seek structure */
typedef struct
{
    U64 time;    
    MMI_BOOL blocking;
    mdi_seek_result_callback seek_result_callback;
    void *user_data;

    /* get frame structure */
    MMI_BOOL get_frame;
    mdi_video_get_frame_struct frame;
} mdi_video_seek_struct;



/* Video play structure */
typedef struct
{
    gdi_handle player_layer_handle;
    gdi_handle subtitle_layer_handle;
    U32 blt_layer_flag;
    U32 play_layer_flag;
    U32 subtitle_layer_flag;
    U16 repeat_count;
    MMI_BOOL is_visual_update;
    MMI_BOOL is_play_audio;
    U8 audio_path;
    U16 rotate;
    S16 play_speed;
    mdi_play_finish_callback play_finish_callback;
    void *user_data;    
} mdi_video_play_struct;

/* Video update layer resume structure */
typedef struct
{
    gdi_handle player_layer_handle;
    gdi_handle subtitle_layer_handle;
    U32 blt_layer_flag;
    U32 play_layer_flag;
    U32 subtitle_layer_flag;
    BOOL is_visual_update;  
    U16 rotate;
} mdi_video_update_layer_resume_struct;


extern MMI_BOOL mdi_video_message_dispatcher(void *ilm_ptr);
extern void mdi_video_enable_mimic_task(module_type module_id);
extern void mdi_video_disable_mimic_task(void);

/**** RECORDER ****/
#if defined (__MMI_VIDEO_RECORDER__) || defined(__MMI_CAMCORDER__)
/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_force_set_ui_rotate
 * DESCRIPTION
 *  To force set ui rotate as desired orientation.
 * PARAMETERS
 *  void
 * RETURNS
 *  MDI_RES_VDOREC_SUCCEED : Succeed to set camera id.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to set camera id.
 *****************************************************************************/
extern MDI_RESULT mdi_video_rec_force_set_ui_rotate(U16 rotate);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_reset_ui_rotate
 * DESCRIPTION
 *  To reset ui rotate as "don't care".
 * PARAMETERS
 *  void
 * RETURNS
 *  MDI_RES_VDOREC_SUCCEED : Succeed to set camera id.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to set camera id.
 *****************************************************************************/
extern MDI_RESULT mdi_video_rec_reset_ui_rotate(void);
/* DOM-NOT_FOR_SDK-END */


/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_frame_rate_table_query_num_of_entry
 * DESCRIPTION
 *  To get error string id and popup type enum by error code.
 * PARAMETERS
 *  void
 * RETURNS
 *  row number of frame rate table in U16.
 *****************************************************************************/
extern U32 mdi_video_rec_query_entry_num_of_video_spec_table(void);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_frame_rate_table_query_num_of_entry
 * DESCRIPTION
 *  To get error string id and popup type enum by error code.
 * PARAMETERS
 *  void
 * RETURNS
 *  MDI_RES_VDOREC_SUCCEED : Succeed to set camera id.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to set camera id.
 *****************************************************************************/
extern MDI_RESULT mdi_video_rec_get_video_spec_by_index(U32 idx, mdi_video_rec_spec_struct * p_spec_entry_struct, U32 frt_entry_struct_size);

/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_get_error_info
 * DESCRIPTION
 *  To get error string id and popup type enum by error code.
 * PARAMETERS
 *  error_code : [IN] error code got from MDI APIs
 *  popup_type : [OUT] popup_type of this error_code 
 * RETURNS
 *  string_id in MMI_ID_TYPE correspounding error enum.
 *****************************************************************************/
extern MMI_ID_TYPE mdi_video_rec_get_error_info(MDI_RESULT error_code, mmi_event_notify_enum* popup_type);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_init
 * DESCRIPTION
 *  Initialize mdi video recorder.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOREC_SUCCEED : Succeed to initialize video recorder.
 *  MDI_RES_VDOPLY_ERR_FAILED : Fail to initialize video recorder.
 *****************************************************************************/
extern MDI_RESULT mdi_video_rec_init(void);
/* DOM-NOT_FOR_SDK-END */

/*****************************************************************************
 * FUNCTION
 *  mdi_video_set_camera_id
 * DESCRIPTION
 *  Choose the camera sensor.
 * PARAMETERS
 *  camera_id : [IN] Camera sensor id [main or sub]
 * RETURN VALUES
 *  MDI_RES_VDOREC_SUCCEED : Succeed to set camera id.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to set camera id.
 *****************************************************************************/
extern MDI_RESULT mdi_video_set_camera_id(U16 camera_id);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_set_record_rotation
 * DESCRIPTION
 *  Set UI rotation value
 * PARAMETERS
 *  value           : [IN]    rotation value
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_set_record_rotation(U8 value);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_detect_sensor_id
 * DESCRIPTION
 *  To detect camera sensor module id.
 * PARAMETERS
 *  cam_id : [IN] Main/Sub camera sensor id.
 * RETURN VALUES
 *  MDI_RES_VDOREC_SUCCEED : Succeed to detect camera sensor module id.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to detect camera sensor module id.
 *****************************************************************************/
extern MDI_RESULT mdi_video_detect_sensor_id(U8 cam_id);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_start_fast_zoom
 * DESCRIPTION
 *  Start fast zoom [smooth zoom]
 * PARAMETERS
 *  zoom_in         : [IN]        Zoom in/out
 *  zoom_limit      : [IN]        MAX ZOOM FACTOR ==> 8x zoom should fill in 80.
 *  zoom_step       : [IN]        How many zoom step to be operated per zoomin/zoomout operation.
 *  zoom_speed      : [IN]        How many frame to be inserted in each zoomin/zoomout zoom step.
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_start_fast_zoom(BOOL zoom_in, U8 zoom_limit, U8 zoom_step, U8 zoom_speed);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_stop_fast_zoom
 * DESCRIPTION
 *  Stop fast zoom
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_stop_fast_zoom(void);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_get_fast_zoom_factor
 * DESCRIPTION
 *  Get current zoom factor
 * PARAMETERS
 *  factor      : [OUT]   Zoom factor     
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_get_fast_zoom_factor(U32 *factor);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_get_fast_zoom_step
 * DESCRIPTION
 *  Get current zoom factor
 * PARAMETERS
 *  step        : [OUT]   Zoom step    
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_get_fast_zoom_step(U32 *step);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_power_on
 * DESCRIPTION
 *  To power on recorder hw.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOREC_SUCCEED : Succeed to power on camera module.
 *  MDI_RES_VDOREC_ERR_POWER_ON_FAILED : Fail to power on camera module.
 *****************************************************************************/
extern MDI_RESULT mdi_video_rec_power_on(const U16 app_id);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_power_off
 * DESCRIPTION
 *  To power off recorder hw.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOREC_SUCCEED : Succeed to power off camera module.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to power off camera module.
 *****************************************************************************/
extern MDI_RESULT mdi_video_rec_power_off(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_record_start
 * DESCRIPTION
 *  To start recording.
 * PARAMETERS
 *  filename : [IN] Video clip's filename.
 *  record_result_callback : [IN] Record result callback function ptr.
 * RETURN VALUES
 *  MDI_RES_VDOREC_SUCCEED : Succeed to start recording.
 *  MDI_RES_VDOREC_ERR_DISK_FULL : Fail to start recording due to disk is full.
 *  MDI_RES_VDOREC_ERR_WRITE_PROTECTION : Fail to start recording due to disk is in write protection mode.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to start recording due to open file fail.
 *  MDI_RES_VDOREC_ERR_RECORD_FAILED : Fail to start recording.
 *****************************************************************************/
extern MDI_RESULT mdi_video_rec_record_start(S8 *filename, mdi_record_result_callback record_result_callback,void *user_data);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_record_stop
 * DESCRIPTION
 *  To stop recording.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOREC_SUCCEED : Succeed to stop recording.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to stop recording.
 *****************************************************************************/
extern MDI_RESULT mdi_video_rec_record_stop(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_record_pause
 * DESCRIPTION
 *  To pause recording.
 * PARAMETERS
 *  stop_preview : [IN] To stop preview or not.
 * RETURN VALUES
 *  MDI_RES_VDOREC_SUCCEED : Succeed to pause recording.
 *  MDI_RES_VDOREC_RECORD_ALREADY_STOP : Fail to pause recording due to it is already stopped.
 *  MDI_RES_VDOREC_REACH_SIZE_LIMIT : Fail to pause recording due to due to it is reached record size limitation (already stopped).
 *  MDI_RES_VDOREC_ERR_DISK_FULL : Fail to pause recording due to disk is full (already stopped).
 *  MDI_RES_VDOREC_ERR_PAUSE_FAILED : Fail to pause recording.
 *****************************************************************************/
extern MDI_RESULT mdi_video_rec_record_pause(MMI_BOOL stop_preview);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_record_resume
 * DESCRIPTION
 *  To resume recording.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOREC_SUCCEED : Succeed to resume recording.
 *  MDI_RES_VDOREC_RECORD_ALREADY_STOP : Fail to resume recording due to it is already stopped.
 *  MDI_RES_VDOREC_ERR_RESUME_FAILED : Fail to resume recording.
 *****************************************************************************/
extern MDI_RESULT mdi_video_rec_record_resume(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_preview_start
 * DESCRIPTION
 *  To start preview for video recorder.
 * PARAMETERS
 *  preview_layer_handle : [IN] Layer handle of preview layer.
 *  blt_layer_flag : [IN] Blt out layer flag.
 *  preview_layer_flag : [IN] Preview layer flag.
 *  is_lcd_update : [IN] Update lcd or not.
 *  setting_p : [IN] Setting data.
 * RETURN VALUES
 *  MDI_RES_VDOREC_SUCCEED : Succeed to start preview.
 *  MDI_RES_VDOREC_ERR_HW_NOT_READY : Fail to start preview.
 *****************************************************************************/
extern MDI_RESULT mdi_video_rec_preview_start(
                    gdi_handle preview_layer_handle,
                    U32 blt_layer_flag,
                    U32 preview_layer_flag,
                    MMI_BOOL is_lcd_update,
                    mdi_video_setting_struct *setting_p);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_preview_stop
 * DESCRIPTION
 *  To stop preview or recorder.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOREC_SUCCEED : Succeed to stop preview.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to stop preview.
 *****************************************************************************/
extern MDI_RESULT mdi_video_rec_preview_stop(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_save_file
 * DESCRIPTION
 *  To merge and save file in non-blocking mode.
 * PARAMETERS
 *  filepath : [IN] Path to merge file.
 *  save_result_callback : [IN] Callback function for this operation.
 * RETURN VALUES
 *  MDI_RES_VDOREC_SUCCEED : Succeed to send save request to media task.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to send save request to media task.
 *****************************************************************************/
extern MDI_RESULT mdi_video_rec_save_file(S8 *filepath, mdi_save_result_callback save_result_callback, void* user_data);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_stop_save
 * DESCRIPTION
 *  To stop record saving.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOREC_SUCCEED : Succeed to stop save operation.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to stop save operation.
 *****************************************************************************/
extern MDI_RESULT mdi_video_rec_stop_save(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_has_unsaved_file
 * DESCRIPTION
 *  To check if there is an unsaved video clip.
 * PARAMETERS
 *  filepath : [IN] Path to check.
 * RETURN VALUES
 *  MMI_TRUE : There is unsaved video clip.
 *  MMI_FALSE : There is no unsaved video clip.
 *****************************************************************************/
extern BOOL       mdi_video_rec_has_unsaved_file(S8 *filepath);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_delete_unsaved_file
 * DESCRIPTION
 *  To delete unsaved video file.
 * PARAMETERS
 *  filepath : [IN] Path of unsaved video temp file to be deleted.
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_delete_unsaved_file(S8 *filepath);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_get_cur_record_time
 * DESCRIPTION
 *  To get current recorded time.
 * PARAMETERS
 *  cur_record_time : [OUT] Current recorded time.
 * RETURNS
 *  void
 ****************************************************************************/
extern void mdi_video_rec_get_cur_record_time(U64 *cur_record_time);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_get_record_frame_num
 * DESCRIPTION
 *  To get current recorded frame num.
 * PARAMETERS
 *  cur_record_num : [OUT] Current recorded frame num.
 * RETURNS
 *  void
 ****************************************************************************/
void mdi_video_rec_get_record_frame_num(U64 *cur_record_num);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_flash_setting
 * DESCRIPTION
 *  Turn on/off LED flash light
 * PARAMETERS
 *  is_on       : [IN]    On/off 
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_flash_setting(BOOL is_on);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_update_para_ev
 * DESCRIPTION
 *  To update ev setting value.
 * PARAMETERS
 *  para : [IN] Ev setting parameter.
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_update_para_ev(U16 para);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_update_para_zoom
 * DESCRIPTION
 *  To update zoom setting value
 * PARAMETERS
 *  para : [IN] Zoom setting parameter.
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_update_para_zoom(U16 para);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_update_para_effect
 * DESCRIPTION
 *  To update effect setting value.
 * PARAMETERS
 *  para : [IN] Effect setting parameter.
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_update_para_effect(U16 para);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_update_para_wb
 * DESCRIPTION
 *  To update wb setting value.
 * PARAMETERS
 *  para : [IN] White balance setting parameter.
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_update_para_wb(U16 para);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_update_para_night
 * DESCRIPTION
 *  To update night mode setting value
 * PARAMETERS
 *  para : [IN] Night mode setting parameter
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_update_para_night(U16 para);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_update_rec_size
 * DESCRIPTION
 *  To update rec width & height
 * PARAMETERS
 *  image_width     : [IN]        record image width
 *  image_height    : [IN]        record image height
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_update_rec_size(U16 image_width, U16 image_height);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_update_para_saturation
 * DESCRIPTION
 *  Update saturation setting value
 * PARAMETERS
 *  cam_para        [IN]        Saturation setting value
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_update_para_saturation(U16 para);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_update_para_contrast
 * DESCRIPTION
 *  Update contrast setting value
 * PARAMETERS
 *  cam_para        [IN]        Contrast setting value
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_update_para_contrast(U16 para);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_update_para_sharpness
 * DESCRIPTION
 *  Update sharpness setting value
 * PARAMETERS
 *  cam_para        [IN]        Sharpness setting value
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_update_para_sharpness(U16 para);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_update_para_hue
 * DESCRIPTION
 *  Update hue setting value
 * PARAMETERS
 *  cam_para        [IN]        Hue setting value
 * RETURNS
 *  void
 *****************************************************************************/
/* DOM-NOT_FOR_SDK-BEGIN */
extern void mdi_video_rec_update_para_hue(U16 para);
/* DOM-NOT_FOR_SDK-END */

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_get_max_zoom_factor
 * DESCRIPTION
 *  To get max zoom factor based on resoultion
 * PARAMETERS
 *  record_width : [IN] Record size width
 *  record_height : [IN] Record size height
 * RETURNS
 *  Current zoom factor.
 *****************************************************************************/
extern U16 mdi_video_rec_get_max_zoom_factor(S32 record_width, S32 record_height);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_get_record_file_size
 * DESCRIPTION
 *  To get current record file size
 * PARAMETERS
*   void
 * RETURNS
 *  Current file size of the recording.
 *****************************************************************************/
extern U64 mdi_video_rec_get_record_file_size(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_load_default_setting
 * DESCRIPTION
 *  Initialize default setting value for video preview/record structure.
 * PARAMETERS
 *  setting_p : [OUT] Setting data (All member data in its default values).
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_load_default_setting(mdi_video_setting_struct *setting_p);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_enable_partial_display
 * DESCRIPTION
 *  To enable video to preview outside lcd region
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOREC_SUCCEED : To enable partially display record preview data.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to enable partially display record preview data.
 *****************************************************************************/
extern MDI_RESULT mdi_video_rec_enable_partial_display(void);

#include "mdi_camera.h"

#define MDI_VIDEO_REC_AF_ZONE_MAX_NO 5         
typedef struct
{
    mdi_af_result_enum af_result;   /* AF result */
    U32 af_success_zone;            /* AF success zone */
}mdi_video_rec_af_result_struct;

typedef struct
{
    U32 af_zone_w;      /* Width */
    U32 af_zone_h;      /* Height */
    U32 af_zone_x;      /* Offset x */
    U32 af_zone_y;      /* Offset y */
}mdi_video_rec_af_zone_struct;

typedef struct
{
    U32 af_active_zone;     /* Active zone */
    mdi_video_rec_af_zone_struct af_zone[MDI_VIDEO_REC_AF_ZONE_MAX_NO];   /* AF zone array */
}mdi_video_rec_af_window_struct;

/*****************************************************************************
 * <GROUP  CallBackFunctions>       
 *
 * FUNCTION
 *  mdi_video_rec_af_ind_callback
 * DESCRIPTION
 *  AF result callback
 * PARAMETERS
 *  result_ind      : [IN]     AF result structure
 * RETURN VALUES
 *  void
 *****************************************************************************/
typedef void (*mdi_video_rec_af_ind_callback) (mdi_video_rec_af_result_struct result_ind, void* user_data);



/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_get_focus_zone
 * DESCRIPTION
 *  Get camera driver AF zone location for 6238 series and 
 *  the location coordinate is the preview layer not LCD 
 * PARAMETERS
 *  zone            : [OUT]       AF zone structure        
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_get_focus_zone(mdi_video_rec_af_window_struct *zone);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_start_autofocus_process
 * DESCRIPTION
 *  Start to do auto focus process
 * PARAMETERS
 *  handler        : [IN]        Auto focus finish callback function
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_start_autofocus_process(mdi_video_rec_af_ind_callback handler, void* user_data);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_stop_autofocus_process
 * DESCRIPTION
 *  Stop auto focus process
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_stop_autofocus_process(void);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_update_para_af_key
 * DESCRIPTION
 *  Update af key value
 * PARAMETERS
 *  cam_para        : [IN]        AF key
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_update_para_af_key(U16 cam_para);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_update_para_af_mode
 * DESCRIPTION
 *  Update af mode value
 * PARAMETERS
 *  cam_para        : [IN]        AF mode
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_update_para_af_mode(U16 cam_para);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_update_para_af_metering
 * DESCRIPTION
 *  Update af metering value
 * PARAMETERS
 *  cam_para        : [IN]        AF metering
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_update_para_af_metering(U16 cam_para);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_update_para_af_range
 * DESCRIPTION
 *  Update af range value for 6238 series video_rec
 * PARAMETERS
 *  cam_para        : [IN]        AF range value
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_update_para_af_range(U16 cam_para);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_update_para_af_operation_mode
 * DESCRIPTION
 *  Update af operation mode value for 6238 series video_rec
 * PARAMETERS
 *  cam_para        : [IN]        AF range value
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_update_para_af_operation_mode(U16 cam_para);


void mdi_video_rec_af_finish_ind(void *inMsg);



#if defined(__MMI_CAMERA__) || defined(__MMI_CAMCORDER__)
extern void mdi_video_rec_query_support_info(U32 mdi_setting_type, void *p_info);
extern void mdi_video_rec_query_zoom_info(mdi_camera_zoom_info *p_info);
#endif

#endif /* __MMI_VIDEO_RECORDER__ */

typedef struct
{
    U16 video_size;
    U16 quality;
    U16 storage;
    U16 video_format;
}mdi_video_rec_query_bitrate_struct;


extern MDI_RESULT mdi_video_rec_query_bitrate(mdi_video_rec_query_bitrate_struct* spec, U32* bitrate);

extern void mdi_video_rec_get_reserved_disc_size(U32 *size);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_update_blt_pause
 * DESCRIPTION
 *  Pause for update blt parameters, special function for Java use only; This function should be pariled with mdi_video_rec_resume_for_update_blt_para().
 * EXAMPLE
 *  mdi_video_rec_update_blt_pause();
 *  ....
 *  update related GDI layer configuration
 *  ....
 *  mdi_video_rec_update_blt_resume(); 
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOREC_SUCCEED : Succeed to pause to update blt layers.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to pause.
 *****************************************************************************/
extern MDI_RESULT mdi_video_rec_update_blt_pause(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_update_blt_resume
 * DESCRIPTION
 *  Resume for update blt parameters, special function for Java use only; This function should be pariled with mdi_video_rec_resume_for_update_blt_para().
 * EXAMPLE
 *  mdi_video_rec_update_blt_pause();
 *  ....
 *  update related GDI layer configuration
 *  ....
 *  mdi_video_rec_update_blt_resume();
 * PARAMETERS
 *  preview_layer_handle : [IN] Layer for preview.
 *  blt_layer_flag : [IN] Blt out layer flag.
 *  preview_layer_flag : [IN] Preview layer flag.
 *  is_lcd_update : [IN] Update lcd or not.
 * RETURNS
 *  MDI_RES_VDOREC_SUCCEED : Succeed to resume after updating blt layers.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to resume.
 *****************************************************************************/
 extern MDI_RESULT mdi_video_rec_update_blt_resume(
                    gdi_handle preview_layer_handle,
                    U32 blt_layer_flag,     
                    U32 preview_layer_flag, 
                    MMI_BOOL is_lcd_update);


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * FUNCTION
 *  mdi_video_rec_set_record_yuv
 * DESCRIPTION
 *  set to record YUV data
 * PARAMETERS
 *  is_yuv        : [IN]        TRUE or FALSE
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_rec_set_record_yuv(MMI_BOOL is_yuv);
/* DOM-NOT_FOR_SDK-END */

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_get_error_info
 * DESCRIPTION
 *  To get error string id and popup type enum by error code.
 * PARAMETERS
 *  error_code : [IN] Error code got from MDI APIs
 *  popup_type : [OUT] Popup_type of this error_code 
 * RETURNS
 *  string_id in MMI_ID_TYPE correspounding error enum.
 *****************************************************************************/
extern MMI_ID_TYPE mdi_video_ply_get_error_info(MDI_RESULT error_code, mmi_event_notify_enum* popup_type);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_init
 * DESCRIPTION
 *  To initialize mdi video player.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to initialze video player.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to initialze video player.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_init(void);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_open_file
 * DESCRIPTION
 *  To open video file (non-blocking open).
 * PARAMETERS
 *  filename : [IN] Videe clip's full file name
 *  open_result_callback : [IN] Open file result callback function
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to open video file, need to wait callback function when open operation is finished.
 *  MDI_RES_VDOPLY_ERR_DRM_PROHIBITED : Fail to open video file due to drm is prohibited.
 *  MDI_RES_VDOPLY_ERR_MEMORY_INSUFFICIENT : Fail to open video file due to memory is insufficient.
 *  MDI_RES_VDOPLY_ERR_FILE_TOO_LARGE : Fail to open video file due to file is too large.
 *  MDI_RES_VDOPLY_ERR_FRAMERATE_TOO_HIGH : Fail to open video file due to framerate is too high.
 *  MDI_RES_VDOPLY_ERR_OPEN_FILE_FAILED : Fail to open video file.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_open_file(
                    const U16 app_id,
                    const CHAR *filename,            
                    mdi_open_result_callback open_result_callback,
                    void *user_data);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_close_file
 * DESCRIPTION
 *  To close video file.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to close video file.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to close video file.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_close_file(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_play
 * DESCRIPTION
 *  To start play opened video.
 * PARAMETERS
 *  player_layer_handle : [IN] Layer handle of playback layer.
 *  blt_layer_flag : [IN] Layers to blt to LCM
 *  play_layer_flag : [IN] Layer for HW to draw
 *  repeat_count : [IN] Repeat how many times.
 *  is_visual_update : [IN] To update to LCM or not.
 *  is_play_audio : [IN] To play audio or not.
 *  audio_path : [IN] Audio output path.
 *  rotate : [IN] Rotate.
 *  play_speed : [IN] Play speed.
 *  play_finish_callback : [IN] Callback function.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to start play.
 *  MDI_RES_VDOPLY_ERR_DRM_PROHIBITED : Fail to start play due to drm check is prohibited.
 *  MDI_RES_VDOPLY_PROGRESSIVE_FILE_NOT_ENOUGH : Fail to start play due to the download data is not enough for progressive playback.
 *  MDI_RES_VDOPLY_REACH_STOP_TIME : Fail to start play due to it is stopped due to stop time is reached.
 *  MDI_RES_VDOPLY_ERR_PLAY_FAILED : Fail to start play.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_play(
                    gdi_handle player_layer_handle, 
                    U32 blt_layer_flag,
                    U32 play_layer_flag, 
                    U16 repeat_count, 
                    BOOL is_visual_update, 
                    BOOL is_play_audio,
                    U8 audio_path, 
                    U16 rotate, 
                    S16 play_speed, 
                    mdi_play_finish_callback play_finish_callback,
                    void *user_data);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_stop
 * DESCRIPTION
 *  To stop video playing.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to stop player.
 *  MDI_RES_VDOPLY_ALREADY_FINISHED : Fail to stop player due to it is already stopped.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_stop(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_seek
 * DESCRIPTION
 *  To seek video.
 * PARAMETERS
 *  time : [IN] Seek time stamp.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to seek.
 *  MDI_RES_VDOPLY_SEEK_PARTIAL_DONE : Succeed to do partial seek.
 *  MDI_RES_VDOPLY_ERR_SEEK_FAILED : Fail to seek.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_seek(U64 time);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_seek_and_get_frame
 * DESCRIPTION
 *  To seek video and get seek frame.
 * PARAMETERS
 *  time : [IN] Seek time stamp.
 *  player_layer_handle : [IN] Get frame on this layer.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to seek.
 *  MDI_RES_VDOPLY_SEEK_PARTIAL_DONE : Succeed to do partial seek.
 *  MDI_RES_VDOPLY_ERR_SEEK_FAILED : Fail to seek.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_seek_and_get_frame(U64 time, gdi_handle player_layer_handle);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_snapshot
 * DESCRIPTION
 *  To snapshot video and save as jpeg file.
 * PARAMETERS
 *  layer_handle : [IN] Video play layer.
 *  file_name : [IN] Filename for jpeg.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to snapshot.
 *  MDI_RES_VDOPLY_ERR_SNAPSHOT_DISK_FULL : Fail to snapshot due to disk is full.
 *  MDI_RES_VDOPLY_ERR_SNAPSHOT_WRITE_PROTECTION : Fail to snapshot due to the disk is in write protection mode.
 *  MDI_RES_VDOPLY_ERR_SNAPSHOT_FAILED : Fail to snapshot.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_snapshot(gdi_handle layer_handle, CHAR * file_name);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_get_cur_play_time
 * DESCRIPTION
 *  To get current play time.
 * PARAMETERS
 *  cur_play_time : [OUT] Current play time.
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_ply_get_cur_play_time(U64 *cur_play_time);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_non_block_seek
 * DESCRIPTION
 *  To seek video.
 * PARAMETERS
 *  time : [IN] Seek time stamp
 *  seek_result_callback : [IN] Seek result callback function
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to seek.
 *  MDI_RES_VDOPLY_SEEK_PARTIAL_DONE : Succeed to do partial seek.
 *  MDI_RES_VDOPLY_ERR_SEEK_FAILED : Fail to seek.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_non_block_seek(U64 time, mdi_seek_result_callback seek_result_callback, void *user_data);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_non_block_seek_and_get_frame
 * DESCRIPTION
 *  To seek video and get seek frame by non-blocking mode.
 * PARAMETERS
 *  time : [IN] Seek time stamp
 *  player_layer_handle : [IN] Get frame on this layer.
 *  seek_result_callback : [IN] Seek result callback function.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to seek.
 *  MDI_RES_VDOPLY_SEEK_PARTIAL_DONE : Succeed to do partial seek.
 *  MDI_RES_VDOPLY_ERR_SEEK_FAILED : Fail to seek.
 *****************************************************************************/
 extern MDI_RESULT mdi_video_ply_non_block_seek_and_get_frame(
                    U64 time,
                    gdi_handle player_layer_handle,
                    mdi_seek_result_callback seek_result_callback,
                    void *user_data);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_stop_non_block_seek
 * DESCRIPTION
 *  To stop non block seeking.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to stop non-blocking seek.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to stop non-blocking seek.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_stop_non_block_seek(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_get_frame
 * DESCRIPTION
 *  get seek frame.
 * PARAMETERS
 *  player_layer_handle : [IN]Get frame on this layer.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to get frame.
 *  MDI_RES_VDOPLY_ERR_GET_FRAME_FAILED : Fail to get frame
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_get_frame(gdi_handle player_layer_handle);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_set_brightness
 * DESCRIPTION
 *  To set brightness parameter for video player.
 * PARAMETERS
 *  brightness : [IN] Brightness value
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set brightness parameter to video player.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to set brightness parameter to video player.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_set_brightness(U16 brightness);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_set_contrast
 * DESCRIPTION
 *  To set contrast parameter to video player.
 * PARAMETERS
 *  contrast : [IN] Contrast value
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set EV parameter to video player.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to set EV parameter to video player.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_set_contrast(U16 contrast);

/* DOM-NOT_FOR_SDK-BEGIN */

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_get_default_frame_color_format
 * DESCRIPTION
 *  get default frame color format
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  GDI_COLOR_FORMAT_16 : RGB565
 *  GDI_COLOR_FORMAT_UYVY422 : UYVY422
 *****************************************************************************/
extern U32 mdi_video_ply_get_default_frame_color_format(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_set_track_index
 * DESCRIPTION
 *  Set track index
 * PARAMETERS
 *  index : [IN] track index
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set track index
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_set_track_index(U32 index);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_set_subtitle_track_index
 * DESCRIPTION
 *  Set subtitle track index
 * PARAMETERS
 *  index : [IN] subtitle track index
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set subtitle track index
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_set_subtitle_track_index(U32 index);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_set_subtitle_font_size
 * DESCRIPTION
 *  Set subtitle font size
 * PARAMETERS
 *  size : [IN] subtitle font size
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set subtitle font size
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_set_subtitle_font_size(U8 size);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_get_key_frame_time
 * DESCRIPTION
 *  Get key frame time
 * PARAMETERS
 *  time : [IN] input time
 *  dir : [IN] search direction
 *  key_frame_time: [OUT] the largest key frame time less than input time if dir is MDI_VIDEO_SEARCH_DIR_BACKWARD 
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to get key frame time
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to get key frame time
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_get_key_frame_time(U64 time, mdi_video_search_dir_enum dir, U64 *key_frame_time);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_get_mot_meta
 * DESCRIPTION
 *  To get MOT meta
 * PARAMETERS
 *  meta : [IN] MOT meta.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to get mot meta
 *  MDI_RES_VDORLY_ERR_FAILED : Fail to get mot meta
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_get_mot_meta(mdi_video_mot_meta_struct *info);

/* DOM-NOT_FOR_SDK-END */

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_enable_partial_display
 * DESCRIPTION
 *  To enable video to play outside lcd region.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to enable partial display (outside lcd region) to video player.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to enable partial display (outside lcd region) to video player.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_enable_partial_display(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_set_stop_time
 * DESCRIPTION
 *  Set stop time, currently for Java use only.
 * PARAMETERS
 *  stop_time : [IN] Stop time
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set stop time to video player.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to set stop time to video player.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_set_stop_time(U64 stop_time);

/* DOM-NOT_FOR_SDK-BEGIN */

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_set_frame_mode
 * DESCRIPTION
 *  Set frame mode
 * PARAMETERS
 *  mode : [IN] frame mode
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set stop time to video player.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to set stop time to video player.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_set_frame_mode(U8 mode);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_set_sleep_time
 * DESCRIPTION
 *  Set sleep time, currently for Java use only.
 * PARAMETERS
 *  elapse_ticks : [IN] elapse ticks
 *  sleep_ticks  : [IN] sleep ticks
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set stop time to video player.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to set stop time to video player.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_set_sleep_time(U8 elapse_ticks, U8 sleep_ticks);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_get_time_to_frame
 * DESCRIPTION
 *  This function is to map given time to the frame number.
 * PARAMETERS
 *  time : [IN] given timestamp 
 *  frame : [OUT] the frame index  
 * RETURNS
 *  MDI_RES_VDOPLY_SUCCEED : Succeed 
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_get_time_to_frame(U64 time, U32 *frame);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_get_frame_to_time
 * DESCRIPTION
 *  This function is to map given frame to the frame timestamp.
 * PARAMETERS
 *  frame : [IN] given frame index
 *  time  : [OUT] the timestamp of the given frame index        
 * RETURNS
 *  The result of this action.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_get_frame_to_time(U32 frame, U64 *time);

/* DOM-NOT_FOR_SDK-END */

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_set_audio_level
 * DESCRIPTION
 *  To set audio level, used by Java only
 * PARAMETERS
 *  aud_level : [IN] Audio level. 
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set audio level to video player.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to set audio level to video player.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_set_audio_level(U16 aud_level);

#ifdef __DRM_SUPPORT__
/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_drm_check_permission
 * DESCRIPTION
 *  To check if a video file has DRM permission
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Has permission
 *  MDI_RES_VDOPLY_ERR_DRM_PROHIBITED: No Permission
 *  MDI_RES_VDOPLY_ERR_OPEN_FILE_FAILED : Fail to open file.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_drm_check_permission(const CHAR *filename);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_drm_disable_consume_count
 * DESCRIPTION
 *  Do not consume drm count when next time play.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to disable drm consume count function.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to disable drm consume count function.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_drm_disable_consume_count(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_drm_disable_consume_time
 * DESCRIPTION
 *  Do not consume drm time when play
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to disable drm consume time function.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to disable drm consume time function.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_drm_disable_consume_time(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_drm_disable_time_limit_stop
 * DESCRIPTION
 *  Do not consume drm time limit for next time play.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to disable time limit stop check.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to disable time limit stop check.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_drm_disable_time_limit_stop(void);
#endif /*  __DRM_SUPPORT__ */

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_is_drm_file
 * DESCRIPTION
 *  Check if it is drm file or not.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MMI_TRUE : It is a drm file.
 *  MMI_FALSE : It is not a drm file.
 *****************************************************************************/
extern MMI_BOOL mdi_video_ply_is_drm_file(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_check_is_able_to_play
 * DESCRIPTION
 *  Check is able to play or not .
 * PARAMETERS
 *  file_name : [IN] Filename of the specific video file to be checked.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : This file is able to play.
 *  MDI_RES_VDOPLY_ERR_MEMORY_INSUFFICIENT : This file is not able to play due to memory is not enough.
 *  MDI_RES_VDOPLY_ERR_FAILED : This file is not able to play.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_check_is_able_to_play(CHAR *file_name);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_open_clip_file
 * DESCRIPTION
 *  To open video clip, this is a blocking function, will return untill file is opened.
 * PARAMETERS
 *  filename : [IN] Video clip's full file name
 *  info : [OUT] Video clip's info
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to open video file, need to wait callback function when open operation is finished.
 *  MDI_RES_VDOPLY_ERR_DRM_PROHIBITED : Fail to open video file due to drm is prohibited.
 *  MDI_RES_VDOPLY_ERR_MEMORY_INSUFFICIENT : Fail to open video file due to memory is insufficient.
 *  MDI_RES_VDOPLY_ERR_FILE_TOO_LARGE : Fail to open video file due to file is too large.
 *  MDI_RES_VDOPLY_ERR_FRAMERATE_TOO_HIGH : Fail to open video file due to framerate is too high.
 *  MDI_RES_VDOPLY_ERR_OPEN_FILE_FAILED : Fail to open video file.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_open_clip_file(
                    const U16 app_id,
                    const CHAR *filename, 
                    mdi_video_info_struct *info);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_close_clip_file
 * DESCRIPTION
 *  To close video clip.
 * PARAMETERS
 *  void
 * RETURNS
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to close video clip file.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to close video clip file.
 *****************************************************************************/
#define mdi_video_ply_close_clip_file mdi_video_ply_close_file

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_open_clip_id
 * DESCRIPTION
 *  To open video clip.
 * PARAMETERS
 *  video_id : [IN] Video clip resource id
 *  info : [OUT] Video clip's info
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to start play.
 *  MDI_RES_VDOPLY_ERR_DRM_PROHIBITED : Fail to start play due to drm check is prohibited.
 *  MDI_RES_VDOPLY_PROGRESSIVE_FILE_NOT_ENOUGH : Fail to start play due to the download data is not enough for progressive playback.
 *  MDI_RES_VDOPLY_REACH_STOP_TIME : Fail to start play due to it is stopped due to stop time is reached.
 *  MDI_RES_VDOPLY_ERR_PLAY_FAILED : Fail to start play.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_open_clip_id(
                    const U16 app_id,
                    U16 video_id, 
                    mdi_video_info_struct *info);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_close
 * DESCRIPTION
 *  To close video
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to close video file.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to close video file.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_close(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_close_clip_id
 * DESCRIPTION
 *  To close video clip from id.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to close video clip id.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to close video clip id.
 *****************************************************************************/
#define mdi_video_ply_close_clip_id mdi_video_ply_close


/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_open_clip_buffer
 * DESCRIPTION
 *  To open video clip from buffer.
 * PARAMETERS
 *  file_buffer : [IN] Video clip file buffer
 *  buffer_len : [IN] Video clip's buffer size
 *  info : [OUT] Video clip's info
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to open video buffer, need to wait callback function when open operation is finished.
 *  MDI_RES_VDOPLY_ERR_MEMORY_INSUFFICIENT : Fail to open video buffer due to memory is insufficient.
 *  MDI_RES_VDOPLY_ERR_FRAMERATE_TOO_HIGH : Fail to open video buffer due to framerate is too high.
 *  MDI_RES_VDOPLY_ERR_OPEN_FILE_FAILED : Fail to open video file.
 *****************************************************************************/
 extern MDI_RESULT mdi_video_ply_open_clip_buffer(
                    const U16 app_id,
                    const U8 *file_buffer,
                    const U32 buffer_len,
                    mdi_video_info_struct *info);
                    
/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_close_clip_buffer
 * DESCRIPTION
 *  To close video clip from buffer
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to close video clip buffer.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to close video clip buffer.
 *****************************************************************************/
#define mdi_video_ply_close_clip_buffer mdi_video_ply_close

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_enable_aud_only_video_clip
 * DESCRIPTION
 *  To enable playing aud only video file 
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to enable playing audio only video clip
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to enable playing audio only video clip
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_enable_aud_only_video_clip(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_set_scenario_type
 * DESCRIPTION
 *  To set scenario type
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to enable playing audio only video clip
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to enable playing audio only video clip
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_set_scenario_type(mdi_video_scenario_type_enum scenario);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_update_layer_pause
 * DESCRIPTION
 *  To pause for update layer parameters. It's a pecial function for Java & WAP use only; 
 *  This function should be pariled with mdi_video_ply_update_layer_resume().
 * PARAMETERS
 *  void
 * RETURNS
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to pause to update blt layers.
 *  MDI_RES_VDOPLY_ERR_FAILED : Fail to pause.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_update_layer_pause(void);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_update_layer_resume
 * DESCRIPTION
 *  Resume for update blt parameters. It's a special function for Java & WAP use only;
 *  This function should be pariled with mdi_video_ply_update_layer_pause().
 * PARAMETERS
 *  player_layer_handle : [IN] Layer handle of playback layer.
 *  blt_layer_flag : [IN] Layers to blt to LCM
 *  play_layer_flag : [IN] Layer for HW to draw
 *  is_visual_update : [IN] To update to LCM or not.
 *  rotate : [IN] Rotate.
 * RETURNS
 *  MDI_RES_VDOREC_SUCCEED : Succeed to resume after updating blt layers.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to resume.
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_update_layer_resume(
            gdi_handle player_layer_handle,
            U32 blt_layer_flag, 
            U32 play_layer_flag,
            BOOL is_visual_update,
            U16 rotate);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_get_default_seek_setting
 * DESCRIPTION
 *  The function is to get the default value for the seek structure
 * PARAMETERS
 *  seek : [OUT] The seek structure for mdi_video_ply_seek_ex()
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_ply_get_default_seek_setting(mdi_video_seek_struct *seek);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_seek_ex
 * DESCRIPTION
 *  The function is a combo function to seek
 * PARAMETERS
 *  seek : [IN] seek parameter
 * RETURNS
 *  void
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_seek_ex(mdi_video_seek_struct *seek);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_get_default_get_frame_setting
 * DESCRIPTION
 *  The function is to get the default value for the get frame structure
 * PARAMETERS
 *  frame : [OUT] The get frame structure for mdi_video_ply_get_frame_ex()
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_ply_get_default_get_frame_setting(mdi_video_get_frame_struct *frame);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_get_frame_ex
 * DESCRIPTION
 *  The function is a combo function to get frame
 * PARAMETERS
 *  frame : [IN] get frame parameter
 * RETURNS
 *  void
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_get_frame_ex(mdi_video_get_frame_struct *frame);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_get_default_play_setting
 * DESCRIPTION
 *  The function is to get the default value for the play structure
 * PARAMETERS
 *  play : [OUT] The play structure for mdi_video_ply_play_ex()
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_ply_get_default_play_setting(mdi_video_play_struct *play);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_play_ex
 * DESCRIPTION
 *  The function is a combo function to play
 * PARAMETERS
 *  play : [IN] play parameter
 * RETURNS
 *  void
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_play_ex(mdi_video_play_struct *play);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_get_default_resume_setting
 * DESCRIPTION
 *  The function is to get the default value for the resume structure
 * PARAMETERS
 *  resume : [OUT] The resume structure for mdi_video_ply_update_layer_resume_ex()
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_ply_get_default_resume_setting(mdi_video_update_layer_resume_struct *resume);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_ply_update_layer_resume_ex
 * DESCRIPTION
 *  The function is a combo function to update layer resume
 * PARAMETERS
 *  resume : [IN] resume parameter
 * RETURNS
 *  void
 *****************************************************************************/
extern MDI_RESULT mdi_video_ply_update_layer_resume_ex(mdi_video_update_layer_resume_struct *resume);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_is_playing
 * DESCRIPTION
 *  To check video player is currently playing or not
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MMI_TRUE : Video is playing now.
 *  MMI_FALSE : Video is not playing now.
 *****************************************************************************/
extern BOOL mdi_video_is_playing(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_check_proc_func
 * DESCRIPTION
 *  To check video player is currently playing or not
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MMI_RET_OK : Video is not playing now.
 *  MMI_RET_ERR : Video is playing now.
 *****************************************************************************/
extern mmi_ret mdi_video_check_proc_func(mmi_event_struct *event);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_is_recording
 * DESCRIPTION
 *  Toc check video recorder is currently recording or not
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MMI_TRUE : Video is recording now.
 *  MMI_FALSE : Video is not recording now.
 *****************************************************************************/
extern BOOL mdi_video_is_recording(void);



/**** Streaming ****/
#ifdef __MMI_VIDEO_STREAM__
/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_init
 * DESCRIPTION
 *  To initialize video streaming module.
 * PARAMETERS
 *  app_id
 * RETURNS
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to initialize video streaming module.
 *  MDI_RES_VDOPLY_ERR_FAILED : Fail to initialize video streaming module.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_init(const U16 app_id);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_deinit
 * DESCRIPTION
 *  To de-initialze video streaming module.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to de-initialize video streaming module.
 *  MDI_RES_VDOPLY_ERR_FAILED : Fail to de-initialize video streaming module.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_deinit(void);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_set_scenario
 * DESCRIPTION
 *  To set scenario type
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set scenario type
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to set scenario type
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_set_scenario(mdi_video_scenario_type_enum scenario);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_get_prefer_transport
 * DESCRIPTION
 *  To get prefer RTP transport
 * PARAMETERS
 *  mdi_video_stream_transport_type_enum *type
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to get prefer RTP transport
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to get prefer RTP transport
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_get_prefer_transport(mdi_video_stream_transport_type_enum *type);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_set_prefer_transport
 * DESCRIPTION
 *  To set prefer RTP transport
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set prefer RTP transport
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to set prefer RTP transport
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_set_prefer_transport(mdi_video_stream_transport_type_enum type);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_connect
 * DESCRIPTION
 *  blah
 * PARAMETERS
 *  data_account : [IN] 
 *  stream_type : [IN] 
 *  data_path : [IN] 
 *  use_proxy : [IN] 
 *  proxy : [IN] a string of proxy address
 *  port : [IN] 
 *  use_udp_port : [IN] 
 *  highest_udp_port : [IN]  
 *  lowest_udp_port : [IN] 
 *  connect_result_callback : [IN] 
 *  user_data : [IN] user_data for Callback function.
 * RETURNS
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to connect to server.
 *  MDI_RES_VDOPLY_ERR_FAILED : Fail to connect to server.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_connect(
                    U32 data_account, 
                    mdi_video_stream_type_enum stream_type, 
                    CHAR *data_path,
                    MMI_BOOL use_proxy,
                    CHAR *proxy,
                    U16 port,
                    MMI_BOOL use_udp_port,
                    U16 highest_udp_port,
                    U16 lowest_udp_port,
                    mdi_connect_result_callback connect_result_callback,
                    void *user_data);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_disconnect
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to disconnect to server.
 *  MDI_RES_VDOPLY_ERR_FAILED : Fail to disconnect to server.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_disconnect(void);

/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_is_connected
 * DESCRIPTION
 * 
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MMI_TRUE : It is connected with stream server.
 *  MMI_FALSE : It is not connected with stream server.
 *****************************************************************************/
extern MMI_BOOL   mdi_video_stream_is_connected(void);
/* DOM-NOT_FOR_SDK-END */

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_start_buffering
 * DESCRIPTION
 *  Start buffering.
 * PARAMETERS
 *  time : [IN] 
 *  buffering_result_callback : [IN] 
 *  user_data : [IN] user_data for Callback function.
 * RETURNS
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to start buffering.
 *  MDI_RES_VDOPLY_ERR_DRM_PROHIBITED : Fail to start buffering due to drm check is prohibited.
 *  MDI_RES_VDOPLY_REACH_STOP_TIME : Fail to start buffering due to it is stopped due to stop time is reached.
 *  MDI_RES_VDOPLY_ERR_PLAY_FAILED : Fail to start buffering.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_start_buffering(
                    U64 time, 
                    mdi_buffering_result_callback buffering_result_callback,
                    void *user_data);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_stop_buffering
 * DESCRIPTION
 * 
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to stop buffering.
 *  MDI_RES_VDOPLY_ERR_FAILED : Fail to stop buffering.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_stop_buffering(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_play
 * DESCRIPTION
 *  To start play streaming video.
 * PARAMETERS
 *  player_layer_handle : [IN]Layer handle of playback layer.
 *  blt_layer_flag : [IN]Layers to blt to LCM
 *  play_layer_flag : [IN]Layer for HW to draw
 *  is_visual_update : [IN]To update to LCM or not.
 *  audio_path : [IN]Audio output path.
 *  rotate : [IN]Rotate.
 *  play_finish_callback : [IN]Callback function.
 *  user_data : [IN] user_data for Callback function.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to start play.
 *  MDI_RES_VDOPLY_ERR_DRM_PROHIBITED : Fail to start play due to drm check is prohibited.
 *  MDI_RES_VDOPLY_REACH_STOP_TIME : Fail to start play due to it is stopped due to stop time is reached.
 *  MDI_RES_VDOPLY_ERR_PLAY_FAILED : Fail to start play.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_play(
                    gdi_handle player_layer_handle, 
                    U32 blt_layer_flag,
                    U32 play_layer_flag, 
                    MMI_BOOL is_visual_update, 
                    U8 audio_path, 
                    U16 rotate, 
                    mdi_play_finish_callback play_finish_callback,
                    void *user_data);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_stop
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to stop play.
 *  MDI_RES_VDOPLY_ERR_FAILED : Fail to stop play.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_stop(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_pause
 * DESCRIPTION
 *  To pause play stream video.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to pause stream play.
 *  MDI_RES_VDOPLY_ERR_FAILED : Fail to pause stream play.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_pause(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_resume
 * DESCRIPTION
 *  To resume playing streaming video
 * PARAMETERS
 *  player_layer_handle : [IN]Layer handle of playback layer.
 *  blt_layer_flag : [IN]Layers to blt to LCM
 *  play_layer_flag : [IN]Layer for HW to draw
 *  is_visual_update : [IN]To update to LCM or not.
 *  audio_path : [IN]Audio output path.
 *  rotate : [IN]Rotate.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to resume stream play.
 *  MDI_RES_VDOPLY_ERR_FAILED : Fail to resume stream play.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_resume(
                    gdi_handle player_layer_handle, 
                    U32 blt_layer_flag,
                    U32 play_layer_flag, 
                    MMI_BOOL is_visual_update, 
                    U8 audio_path, 
                    U16 rotate);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_drm_disable_consume_count
 * DESCRIPTION
 *  Do not consume drm count when play.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to disable consume drm count for next playing.
 *  MDI_RES_VDOPLY_ERR_FAILED : Fail to disable consume drm count for next playing.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_drm_disable_consume_count(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_drm_disable_consume_time
 * DESCRIPTION
 *  Do not consume drm count when play
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to disable consume drm time limitation for next playing.
 *  MDI_RES_VDOPLY_ERR_FAILED : Fail to disable consume drm time limitation for next playing.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_drm_disable_consume_time(void);      

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_get_buf_percentage
 * DESCRIPTION
 *  ooxx
 * PARAMETERS
 *  percentage : [OUT] stream buffer percentage.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to get buffer percentage of the stream downloaded data.
 *  MDI_RES_VDOPLY_ERR_FAILED : Fail to get buffer percentage of the stream downloaded data.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_get_buf_percentage(S32 *percentage);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_get_buf_status
 * DESCRIPTION
 *  ooxx
 * PARAMETERS
 *  buffered_time : [OUT] stream buffered absolute time.
 *  buffer_percentage : [OUT] fullness percentage of stream buffer pool.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to get buffer status of the stream downloaded data.
 *  MDI_RES_VDOPLY_ERR_FAILED : Fail to get buffer status of the stream downloaded data.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_get_buf_status(U64 *buffered_time, U32 *buffer_percentage);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_get_cur_play_time
 * DESCRIPTION
 * 
 * PARAMETERS
 *  cur_play_time : [OUT] Current play time.
 * RETURNS
 *  void
 *****************************************************************************/
extern void       mdi_video_stream_get_cur_play_time(U64 *cur_play_time);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_set_brightness
 * DESCRIPTION
 *  To set brightness parameter for video player.
 * PARAMETERS
 *  brightness : [IN] Brightness value
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set brightness parameter to video player.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to set brightness parameter to video player.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_set_brightness(U16 brightness);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_set_contrast
 * DESCRIPTION
 *  To set contrast parameter to video player.
 * PARAMETERS
 *  contrast : [IN] Contrast value
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set EV parameter to video player.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to set EV parameter to video player.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_set_contrast(U16 contrast);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_get_dimension
 * DESCRIPTION
 *  Get stream source dimension, this function may only be called after 
 *  calling mdi_video_stream_start_buffering, and buf percentage > 0
 * PARAMETERS
 *  video_width : [OUT] video width ptr
 *  video_height : [OUT] video height ptr 
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to get dimension.
 *  MDI_RES_VDOPLY_ERR_FAILED : Fail to get dimension.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_get_dimension(S32 *video_width, S32 *video_height);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_enable_partial_display
 * DESCRIPTION
 *  To enable video to play outside lcd region.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to enable partial display (outside lcd region) to video player.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to enable partial display (outside lcd region) to video player.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_enable_partial_display(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_set_frame_mode
 * DESCRIPTION
 *  To set stretch mode of video player before playback.
 * PARAMETERS
 *  mode : [IN] frame mode
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set stretch mode of video player.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to set stretch mode of video player.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_set_frame_mode(U8 mode);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_set_3d_mode
 * DESCRIPTION
 *  Set 3D mode
 * PARAMETERS
 *  mode : [IN] 3D mode
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set 3D mode to video player.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to set 3D mode to video player.
 *****************************************************************************/
MDI_RESULT mdi_video_stream_set_3d_mode(mdi_video_3d_mode_enum mode);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_set_prebuffer_time
 * DESCRIPTION
 *  To set the pre-buffer time that application want.
 * PARAMETERS
 *  U32 time: [IN] the pre-buffer time in millisecond. (min. 3000 ms)
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set pre-buffer time of video player.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to set pre-buffer time of video player.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_set_prebuffer_time(U32 time);

/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_set_stop_time
 * DESCRIPTION
 *  Set stop time for stream playback, currently for Java use only.
 * PARAMETERS
 *  stop_time : [IN] Stop time
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set stop time to video player.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to set stop time to video player.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_set_stop_time(U64 stop_time);
/* DOM-NOT_FOR_SDK-END */

/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_set_sleep_time
 * DESCRIPTION
 *  Set sleep time, currently for Java use only.
 * PARAMETERS
 *  elapse_ticks : [IN] elapse time to make one sleep operation.
 *  sleep_ticks  : [IN] time duration per sleep.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set sleep time to video player.
 *  MDI_RES_VDOREC_ERR_FAILED : Fail to set sleep time to video player.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_set_sleep_time(U8 elapse_ticks, U8 sleep_ticks);
/* DOM-NOT_FOR_SDK-END */

/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_set_audio_level
 * DESCRIPTION
 *  To set audio level, used by Java only
 * PARAMETERS
 *  aud_level : [IN] Audio level. 
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set audio level to video player.
 *  MDI_RES_VDORLY_ERR_FAILED : Fail to set audio level to video player.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_set_audio_level(U16 aud_level);
/* DOM-NOT_FOR_SDK-END */

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_is_drm_streaming
 * DESCRIPTION
 *  Check if it is drm stream or not.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MMI_TRUE : It is a drm file.
 *  MMI_FALSE : It is not a drm file.
 *****************************************************************************/
extern MMI_BOOL   mdi_video_stream_is_drm_streaming(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_get_info
 * DESCRIPTION
 *  To get stream audio info.
 * PARAMETERS
 *  aud_channel_no : [IN] Audio channel number.
 *  aud_sample_rate : [IN] Audio sample rate.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to get audio info.
 *  MDI_RES_VDORLY_ERR_FAILED : Fail to get audio info.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_get_audio_info(PU8 aud_channel_no, PU16 aud_sample_rate);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_stop_visual_update()
 * DESCRIPTION
 * Stop video update while not stopping the streaming playback. (audio will keep playing)
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to stop visual update.
 *  MDI_RES_VDORLY_ERR_FAILED : Fail to stop visual update.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_stop_visual_update(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_set_track
 * DESCRIPTION
 *  Enable user to config which track shall the streaming engine play. The possible values are
 *  MEDIA_STREAM_PLAY_TYPE_BOTH (both track)
 *  MEDIA_STREAM_PLAY_TYPE_AUDIO_ONLY (audio track)
 *  MEDIA_STREAM_PLAY_TYPE_VIDEO_ONLY (video track)
 * PARAMETERS
 *  type : [IN] 
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set track.
 *  MDI_RES_VDORLY_ERR_FAILED : Fail to set track.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_set_track(kal_uint8 type);

/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * FUNCTION
 *    mdi_video_stream_set_uaprof_diff
 * DESCRIPTION
 *    set the x-wap-profile-diff url string
 * PARAMETERS
 *    diff_p : [IN] pointer to the profile diff url string (char)
 * RETURNS
 *    MEI_RES_VDOPLY_SUCEED : if success, otherwise MDI_RES_VDOPLY_ERR_FAILED
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_set_uaprof_diff(CHAR* diff_p);
/* DOM-NOT_FOR_SDK-END */

/* DOM-NOT_FOR_SDK-BEGIN */
#ifdef __MMI_STREAM_REC__
/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_rec_open
 * DESCRIPTION
 *  Open the record engine and assigned the target filepath
 * PARAMETERS
 *  p_file_path : [IN] the filepath of saving the recorded file
 * RETURN VALUES
 *  MDI_RES_STREAM_REC_ERR_DISK_FULL : The assigned disk is fulled.
 *  MDI_RES_STREAM_REC_SUCCEED : Open succeed.
 *  MED_RES_STREAM_INVALID_SDP : The SDP is an invalid one.
 *  MED_RES_STREAM_UNSUPPORTED_CODEC : We don't support recording of this codec.
 *  MDI_RES_VDOPLY_ERR_UNSUPPORTED_FORMAT : This video is not supported.
 *  MDI_RES_STREAM_REC_ERR_FAILED : Other undefined errors.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_rec_open(CHAR* p_file_path);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_rec_close
 * DESCRIPTION
 *  Close the record engine and clean up
 * PARAMETERS
 *  none
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed.
 *  MDI_RES_VDORLY_ERR_FAILED : Failed.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_rec_close(void);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_rec_save
 * DESCRIPTION
 *  Save the record video in the assigned path.
 * PARAMETERS
 *  p_file_path : [IN] The filepath of saved files.
 *  save_result_callback : [IN] The callback function, which will return the result of saving
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to set track.
 *  MDI_RES_VDORLY_ERR_FAILED : Fail to set track.
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_rec_save(CHAR* p_file_path, void(* save_result_callback)(MDI_RESULT));


/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_rec_save_abort
 * DESCRIPTION
 *  Abort the current saving process.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Abort succesfully
 *****************************************************************************/
extern MDI_RESULT mdi_video_stream_rec_save_abort(void);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_rec_delete_unsaved_file
 * DESCRIPTION
 *  Remove the unsaved temp files in the assigned path
 * PARAMETERS
 *  dir : [IN] The filepath to be cleaned.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Deleted successfully.
 *****************************************************************************/
extern void mdi_video_stream_rec_delete_unsaved_file(CHAR* dir);


/*****************************************************************************
 * FUNCTION
 *  mdi_video_stream_rec_have_unsaved_file
 * DESCRIPTION
 *  Check if the assigned path have unsaved recording file or not
 * PARAMETERS
 *  dir : [IN] The path to check
 * RETURN VALUES
 *  KAL_TRUE : There is unsaved file.
 *  KAL_FALSE : There's no unsaved file.
 *****************************************************************************/
extern BOOL mdi_video_stream_rec_have_unsaved_file(CHAR* dir);
#endif /* __MMI_STREAM_REC__ */
/* DOM-NOT_FOR_SDK-END */
#endif /* __MMI_VIDEO_STREAM__ */


/**** Progressive ****/
#ifdef __MMI_VIDEO_PDL__
 /*****************************************************************************
 * FUNCTION
 *  mdi_video_progressive_open_file
 * DESCRIPTION
 *  To open progressive vidoe file.
 * PARAMETERS
 *  filename : [IN] Filename of the video.
 *  progressive_result_callback : [IN] Callback function of this open operation.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to open video file, need to wait callback function when open operation is finished.
 *  MDI_RES_VDOPLY_ERR_MEMORY_INSUFFICIENT : Fail to open video file due to memory is insufficient.
 *  MDI_RES_VDOPLY_ERR_OPEN_FILE_FAILED : Fail to open video file.
 *****************************************************************************/
extern MDI_RESULT mdi_video_progressive_open_file(
                    const U16 app_id,
                    const CHAR *filename,
                    mdi_progressive_result_callback progressive_result_callback,
                    void *user_data);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_progressive_close_file
 * DESCRIPTION
 *  To close the progressive video file.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to close progressive download file.
 *  MDI_RES_VDORLY_ERR_FAILED : Fail to close progressive download file.
 *****************************************************************************/
extern MDI_RESULT mdi_video_progressive_close_file(void);                    

/*****************************************************************************
 * FUNCTION
 *  mdi_video_progressive_get_max_play_time
 * DESCRIPTION
 *  To get the max play time of this progressive downloading file.
 * PARAMETERS
 *  max_play_time : [OUT] Max play time of this progressive downloading file.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to get max play time.
 *  MDI_RES_VDORLY_ERR_FAILED : Fail to get max play time.
 *****************************************************************************/
extern MDI_RESULT mdi_video_progressive_get_max_play_time(U64 *max_play_time);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_progressive_get_buf_percentage
 * DESCRIPTION
 *  To get current downloaded buffer percentage.
 * PARAMETERS
 *  buf_percentage : [OUT] Current buffer percentage.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to get buffer percentage.
 *  MDI_RES_VDORLY_ERR_FAILED : Fail to get buffer percentage.
 *****************************************************************************/
extern MDI_RESULT mdi_video_progressive_get_buf_percentage(S32 *buf_percentage);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_progressive_is_pdl_format
 * DESCRIPTION
 *  To check if this video file is in progresssive download support format.
 * PARAMETERS
 *  file_buf : [IN] Filepath of the specific video file.
 *  buf_size : [IN] Buffer size of the file buffer.
 *  is_pdl : [OUT] Is this file is progressive download format.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to check this file.
 *  MDI_RES_VDOPLY_ERR_OPEN_FILE_FAILED : Fail to check this file due to fail to open it.
 *  MDI_RES_VDOPLY_ERR_FAILED : Fail to check this file.
 *****************************************************************************/
extern MDI_RESULT mdi_video_progressive_is_pdl_format(U8 *file_buf, S32 buf_size, MMI_BOOL *is_pdl);

/* DOM-NOT_FOR_SDK-BEGIN */

/*****************************************************************************
 * FUNCTION
 *  mdi_video_progressive_scramble_buffer
 * DESCRIPTION
 *  To scramble buffer
 * PARAMETERS
 *  file_buffer : [IN]Filepath of the specific video file.
 *  buf_size : [IN]Buffer size of the file buffer.
 * RETURN VALUES
 *  MDI_RES_VDOPLY_SUCCEED : Succeed to check this file.
 *  MDI_RES_VDOPLY_ERR_FAILED : Fail to check this file.
 *****************************************************************************/
extern MDI_RESULT mdi_video_progressive_scramble_buffer(U8 *file_buffer, S32 buf_size);

/* DOM-NOT_FOR_SDK-END */

#endif /* __MMI_VIDEO_PDL__ */


/* DOM-NOT_FOR_SDK-BEGIN */
#ifdef __MMI_VIDEO_TELEPHONY__

/*****************************************************************************
 * FUNCTION
 *  mdi_video_tel_load_default_setting
 * DESCRIPTION
 *  Initialize default setting value for video preview/record structure.
 * PARAMETERS
 *  setting_p : [OUT]Setting data (All member data in its default values).
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_tel_load_default_setting(mdi_video_setting_struct *setting_p);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_tel_start
 * DESCRIPTION
 *  To start video telephony preview / decode
 * PARAMETERS
 *  peer_layer_handle : [IN] peer display layer handle
 *  local_layer_handle : [IN] local display layer handle 
 *  peer_disp_type : [IN] peer display type
 *  local_disp_type : [IN] local display type
 *  blt_layer_flag : [IN] which layers will be blt to lcd by driver
 *  peer_layer_flag : [IN] which layer is for peer display
 *  local_layer_flag : [IN] which layer is for local display 
 *  local_preview_setting_p : [IN] local preview video settings
 *  event_callback : [IN] call back function
 * RETURN VALUES
 *  MDI_RES_VDOTEL_SUCCEED : Succeed to start video telephony service.
 *  MDI_RES_VDOTEL_ERR_FAILED : Fail to start video telephony service.
 *****************************************************************************/
extern MDI_RESULT mdi_video_tel_start(
                    gdi_handle peer_layer_handle,
                    gdi_handle local_layer_handle,    
                    mdi_video_tel_disp_type_enum peer_disp_type,
                    mdi_video_tel_disp_type_enum local_disp_type,          
                    U32 blt_layer_flag,                                 
                    U32 peer_layer_flag,                                
                    U32 local_layer_flag,                                             
                    mdi_video_setting_struct *local_preview_setting_p,  
                    const U16 app_id,                       
                    mdi_video_tel_event_callback event_callback,
                    void* callback_userdata); 

/*****************************************************************************
 * FUNCTION
 *  mdi_video_tel_resume
 * DESCRIPTION
 *  To resume video telephony preview / decode
 * PARAMETERS
 *  peer_layer_handle : [IN] peer display layer handle
 *  local_layer_handle : [IN] local display layer handle 
 *  peer_disp_type : [IN] peer display type
 *  local_disp_type : [IN] local display type
 *  blt_layer_flag : [IN] which layers will be blt to lcd by driver
 *  peer_layer_flag : [IN] which layer is for peer display
 *  local_layer_flag : [IN] which layer is for local display 
 *  local_preview_setting_p : [IN] local preview video settings
 *  event_callback : [IN] call back function
 * RETURN VALUES
 *  MDI_RES_VDOTEL_SUCCEED : Succeed to start video telephony service.
 *  MDI_RES_VDOTEL_ERR_FAILED : Fail to start video telephony service.
 *****************************************************************************/
extern MDI_RESULT mdi_video_tel_resume(
                    gdi_handle peer_layer_handle,
                    gdi_handle local_layer_handle,    
                    mdi_video_tel_disp_type_enum peer_disp_type,
                    mdi_video_tel_disp_type_enum local_disp_type,          
                    U32 blt_layer_flag,                                 
                    U32 peer_layer_flag,                                
                    U32 local_layer_flag,                                                  
                    mdi_video_setting_struct *local_preview_setting_p,  
                    mdi_video_tel_event_callback event_callback,
                    void* callback_userdata); 

/*****************************************************************************
 * FUNCTION
 *  mdi_video_tel_pause
 * DESCRIPTION
 *  To pause video telephony preview / decode
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOTEL_SUCCEED : Succeed to stop video telephony service.
 *  MDI_RES_VDOTEL_ERR_FAILED : Fail to stop video telephony service.
 *****************************************************************************/
extern MDI_RESULT mdi_video_tel_pause(void); 

/*****************************************************************************
 * FUNCTION
 *  mdi_video_tel_stop
 * DESCRIPTION
 *  To stop video telephony preview / decode
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_VDOTEL_SUCCEED : Succeed to stop video telephony service.
 *  MDI_RES_VDOTEL_ERR_FAILED : Fail to stop video telephony service.
 *****************************************************************************/
extern MDI_RESULT mdi_video_tel_stop(void); 

/*****************************************************************************
 * FUNCTION
 *  mdi_video_tel_set_memory_param
 * DESCRIPTION
 *  To set memory config before start (memory usage is related to window size now)
 * PARAMETERS
 *  U32 main wnd width
 *  U32 main wnd height
 *  U32 sub wnd width
 *  U32 sub wnd height
 * RETURN VALUES
 *  MDI_RES_VDOTEL_SUCCEED : Succeed to set id.
 *  MDI_RES_VDOTEL_ERR_FAILED : Fail to set id.
 *****************************************************************************/
extern MDI_RESULT mdi_video_tel_set_memory_param(
    kal_bool is_set, 
    kal_uint32 main_wnd_width, 
    kal_uint32 main_wnd_height, 
    kal_uint32 sub_wnd_width, 
    kal_uint32 sub_wnd_height);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_tel_set_camera_id
 * DESCRIPTION
 *  To set sensor id for preview
 * PARAMETERS
 *  U16 sensor id
 * RETURN VALUES
 *  MDI_RES_VDOTEL_SUCCEED : Succeed to set id.
 *  MDI_RES_VDOTEL_ERR_FAILED : Fail to set id.
 *****************************************************************************/
extern MDI_RESULT mdi_video_tel_set_camera_id(U16 camera_id);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_tel_query_support_info
 * DESCRIPTION
 *  To query sensor info
 * PARAMETERS
 *  U32     info type
 *  void*   return info
 * RETURN VALUES
 *  void
 *****************************************************************************/
extern void mdi_video_tel_query_support_info(U32 mdi_setting_type, void *p_info);    

/*****************************************************************************
 * FUNCTION
 *  mdi_video_tel_query_zoom_info
 * DESCRIPTION
 *  To query zoom info
 * PARAMETERS
 *  mdi_camera_zoom_info*  return zoom info
 * RETURN VALUES
 *  void
 *****************************************************************************/
extern void mdi_video_tel_query_zoom_info(mdi_camera_zoom_info *p_info);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_tel_bypass_3a_stable
 * DESCRIPTION
 *  Bypass 3a stable when start preview
 * PARAMETERS
 *  none
 * RETURNS
 *  void
 *****************************************************************************/
extern void       mdi_video_tel_bypass_3a_stable(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_camera_hw_layer_get_content
 * DESCRIPTION
 *  Get preview buffer content.
 * PARAMETERS
 *  void
 * RETURN VALUES
 *  MDI_RES_CAMERA_SUCCEED      : Success
 *  MDI_RES_CAMERA_ERR_FAILED   : Failure
 *****************************************************************************/
extern MDI_RESULT mdi_video_tel_get_hw_layer_buffer_content(gdi_handle layer_handle, U8 *dst_buff_p, U32 dst_buff_size);

extern MDI_RESULT mdi_video_tel_get_peer_content(U8 *dst_buff_p, U32 dst_buff_size);

extern MDI_RESULT mdi_video_tel_get_local_content(U8 *dst_buff_p, U32 dst_buff_size);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_tel_update_para_ev
 * DESCRIPTION
 *  To update ev setting value.
 * PARAMETERS
 *  para : [IN] Ev setting parameter
 * RETURNS
 *  void
 *****************************************************************************/
extern void       mdi_video_tel_update_para_ev(U16 para);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_tel_update_para_contrast
 * DESCRIPTION
 *  To update contrast setting value.
 * PARAMETERS
 *  para : [IN] contrast setting parameter
 * RETURNS
 *  void
 *****************************************************************************/
extern void mdi_video_tel_update_para_contrast(U16 para);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_tel_update_para_zoom
 * DESCRIPTION
 *  To update zoom setting value.
 * PARAMETERS
 *  para : [IN] zoom setting parameter
 * RETURNS
 *  void
 *****************************************************************************/
extern void       mdi_video_tel_update_para_zoom(U16 para);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_tel_enable_vt_loopback
 * DESCRIPTION
 *  Enable VT task start loopback, this function is for UT use only.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
extern void       mdi_video_tel_enable_vt_loopback(void);

/*****************************************************************************
 * FUNCTION
 *  mdi_video_tel_disable_vt_loopback
 * DESCRIPTION
 *  Disable VT task start loopback, this function is for UT use only.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
extern void       mdi_video_tel_disable_vt_loopback(void);

typedef struct
{
    LOCAL_PARA_HDR 
} mdi_vt_loopback_active_req_struct;


typedef struct
{
    LOCAL_PARA_HDR 
} mdi_vt_loopback_deactive_req_struct;

#endif /* __MMI_VIDEO_TELEPHONY__ */
/* DOM-NOT_FOR_SDK-END */

/* DOM-NOT_FOR_SDK-BEGIN */
#ifdef __MMI_OP11_PDL_FROM_SDP__
/*****************************************************************************
 * FUNCTION
 *  mdi_sdp_open_pdl_sdp_file
 * DESCRIPTION
 *  Open and check a sdp file to check if it is a progressive download SDP file
 * PARAMETERS
 *  fp_p : [IN] File path
 *  pdl_info : [OUT] Related info of this SDP file.
 * RETURNS
 *  MDI_RES_SDP_ERR_OPEN_FILE_FAILED : Cannot open the file.
 *  MDI_RES_SDP_SUCCEED : The SDP file is a progressive download SDP file, parsed successfully.
 *  MDI_RES_SDP_ERR_FILE_TOO_LARGE : This SDP file is too large to be valid.
 *  MDI_RES_SDP_MEMORY_NOT_ENOUGH : The memory is not enough to parse it.
 *  MDI_RES_SDP_INVALID_FORMAT : This is not a valid SDP.
 *  MDI_RES_SDP_NON_PDL_FORMAT : This is a valid SDP, however, it is not for progressive download.
 *****************************************************************************/
extern mdi_result mdi_sdp_open_pdl_sdp_file(kal_wchar *fp_p, mdi_sdp_pdl_info *pdl_info);
#endif /* __MMI_OP11_PDL_FROM_SDP__ */
/* DOM-NOT_FOR_SDK-END */

#endif /* _MDI_VIDEO_H */