format.h
Upload User: wstnjxml
Upload Date: 2014-04-03
Package Size: 7248k
Code Size: 3k
Category:

Windows CE

Development Platform:

C/C++

  1. /*****************************************************************************
  2.  *
  3.  * This program is free software ; you can redistribute it and/or modify
  4.  * it under the terms of the GNU General Public License as published by
  5.  * the Free Software Foundation; either version 2 of the License, or
  6.  * (at your option) any later version.
  7.  *
  8.  * This program is distributed in the hope that it will be useful,
  9.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11.  * GNU General Public License for more details.
  12.  *
  13.  * You should have received a copy of the GNU General Public License
  14.  * along with this program; if not, write to the Free Software
  15.  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  16.  *
  17.  * $Id: format.h 607 2006-01-22 20:58:29Z picard $
  18.  *
  19.  * The Core Pocket Media Player
  20.  * Copyright (c) 2004-2005 Gabor Kovacs
  21.  *
  22.  ****************************************************************************/
  23. #ifndef __FORMAT_H
  24. #define __FORMAT_H
  25. #define FTYPE_PLAYLIST 'P'
  26. #define FTYPE_VIDEO 'V'
  27. #define FTYPE_AUDIO 'A'
  28. #define BLOCKSIZE 32768
  29. //---------------------------------------------------------------
  30. // format and playlist 
  31. #define MEDIA_CLASS FOURCC('F','M','T','M')
  32. //---------------------------------------------------------------
  33. // format params
  34. #define FORMAT_CLASS FOURCC('F','M','T','_')
  35. // input stream (stream*)
  36. #define FORMAT_INPUT 0x32
  37. // input stream (stream*)
  38. #define FORMAT_OUTPUT 0x3B
  39. // duration (tick_t)
  40. #define FORMAT_DURATION 0x33
  41. // approx file position (int)
  42. #define FORMAT_FILEPOS 0x36
  43. // file size if available (int)
  44. #define FORMAT_FILESIZE 0x44
  45. // file reader alignment (int)
  46. #define FORMAT_FILEALIGN 0x49
  47. // buffer size (int)
  48. #define FORMAT_BUFFERSIZE 0x3A
  49. // update streams notify
  50. #define FORMAT_UPDATESTREAMS 0x41
  51. // release streams notify
  52. #define FORMAT_RELEASESTREAMS 0x4C
  53. // manual data feed (for probe data)
  54. #define FORMAT_DATAFEED 0x42
  55. // auto find subtitle files (bool)
  56. #define FORMAT_FIND_SUBTITLES 0x45
  57. // covertart stream no (int)
  58. #define FORMAT_COVERART 0x46
  59. // global comments (comment) (optional)
  60. #define FORMAT_GLOBAL_COMMENT 0x47
  61. // number of streams (int)
  62. #define FORMAT_STREAM_COUNT 0x48
  63. // use auto readsize (bool) 
  64. #define FORMAT_AUTO_READSIZE 0x4B
  65. // media has timing (bool)
  66. #define FORMAT_TIMING 0x4E
  67. // minimum buffer needed
  68. #define FORMAT_MIN_BUFFER 0x4F
  69. #define FORMAT_UPDATEMASK 0x50
  70. // output data streams (packet) 0x1000,0x1001,0x1002...
  71. #define FORMAT_STREAM 0x1000
  72. // comments by streams (comment) (optional)
  73. #define FORMAT_COMMENT 0x2000
  74. #define FORMAT_STREAM_PRIORITY 0x3000
  75. extern DLL int FormatEnum(void*, int* EnumNo, datadef* Out);
  76. typedef struct processstate
  77. {
  78. tick_t Time;
  79. bool_t Fill;
  80. int BufferUsedBefore;
  81. int BufferUsedAfter;
  82. } processstate;
  83. // sync or seek by time or by file position (-1 for no seek)
  84. typedef int (*fmtsync)(void* This,tick_t Time,int FilePos,bool_t PrevKey);
  85. // read input (only one chunk) to buffer
  86. typedef int (*fmtread)(void* This,int BufferMax,int* BufferUsed);
  87. // read packets and send them time syncorinzed to codecs 
  88. // time is updated after syncronization (return value ERR_SYNCED)
  89. typedef int (*fmtprocess)(void* This,processstate* State);
  90. typedef struct format
  91. {
  92. VMT_NODE
  93. fmtsync Sync;
  94. fmtread Read;
  95. fmtprocess Process;
  96. } format;
  97. void Format_Init();
  98. void Format_Done();
  99. #endif