NeroBurnAtOnce.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /******************************************************************************
  2. |* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  3. |* ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  4. |* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  5. |* PARTICULAR PURPOSE.
  6. |*
  7. |* Copyright 1995-2005 Nero AG. All Rights Reserved.
  8. |*-----------------------------------------------------------------------------
  9. |* NeroSDK / NeroAPI
  10. |*
  11. |* PROGRAM: NeroBurnAtOnce.h
  12. |*
  13. |* PURPOSE: Interface to BurnAtOnce functionality of Nero API.
  14. |* BurnAtOnce can burn DVD-Video data directly to DVDs without having
  15. |* to first generate all files on the harddisc.
  16. |*
  17. |* NOTES : This functionality is present up from NeroAPI 6.3.1.11
  18. ******************************************************************************/
  19. #ifndef NEROBURNATONCE_H
  20. #define NEROBURNATONCE_H
  21. #include "NeroAPI.h"
  22. #ifdef __cplusplus
  23. #include "NeroFileSystemContent.h"
  24. #if defined(__BORLANDC__)
  25. // NEROAPI expects structs to be 8byte aligned
  26. #pragma pack(push, 8)
  27. // tell Borland C++ Builder to treat enums as int
  28. #pragma option push -b
  29. #endif
  30. namespace FileSystemContent
  31. {
  32. // ask the IDataInputStream object you get in IFileProducer::ProduceFile
  33. // with GetOtherInterface("IBurnAtOnceInfo") to get a pointer to this object
  34. class IBurnAtOnceInfo : public InterfaceBase
  35. {
  36. public:
  37. // returns the offset to start of VIDEO_TS.IFO in blocks
  38. virtual DWORD GetOffset() const = 0;
  39. };
  40. }
  41. #endif // __cplusplus
  42. #ifdef __cplusplus
  43. class CBurnAtOnceRecorder;
  44. typedef CBurnAtOnceRecorder* NERO_BAO_HANDLE;
  45. extern "C"
  46. {
  47. #else // __cplusplus
  48. typedef void* NERO_BAO_HANDLE;
  49. #endif
  50. typedef struct tag_NERO_BURN_AT_ONCE
  51. {
  52. /* fill this with sizeof(NERO_BURN_AT_ONCE) */
  53. DWORD nwbaoSize;
  54. /* path to a directory to store temporary files
  55. * If NULL, system temp directory will be used */
  56. const char *nwbaoTempDirectory;
  57. /* The content of the filesystem
  58. * Important:
  59. * 1) All IFO and BUP files must have set the exact file size
  60. * 2) All other video files must have set the estimated size which will be
  61. * updated during burning. Note, that the estimated size should
  62. * be as exact as possible.
  63. * 3) For each video title set only add the first VOB file (e.g. VTS_01_1.VOB)
  64. * to the file system container and pass all the video data of this title set
  65. * in the file producer of this file. NeroAPI will automatically split the
  66. * file at the appropriate size (1 GB - logical block size).
  67. * 4) DVD-Video files will be sorted automatically
  68. * 5) It is guaranteed that the file data will be requested in the following order:
  69. * - VMGM_VOB (VIDEO_TS.VOB) [if present]
  70. * - For each video title set (VTS):
  71. * - VTSM_VOB (e.g. VTS_01_0.VOB) [if present]
  72. * - VTSTT_VOBS (e.g. VTS_01_1.VOB) [mandatory]
  73. * - VTSI file (e.g. VTS_01_0.IFO) [mandatory]
  74. * - VTSI backup (e.g. VTS_01_0.BUP) [mandatory]
  75. * - VMGMI (VIDEO_TS.IFO) [mandatory]
  76. * - Backup for VMGMI (VIDEO_TS.BUP) [mandatory]
  77. */
  78. #ifdef __cplusplus
  79. FileSystemContent::
  80. #else //__cplusplus
  81. struct
  82. #endif//__cplusplus
  83. IFileSystemDescContainer *nwbaoFSContainer;
  84. DWORD nwbaoReserved[64]; /* Should be zero */
  85. } NERO_WRITE_BURN_AT_ONCE;
  86. NEROAPI_API
  87. NEROAPI_BURN_ERROR NADLL_ATTR NeroBurnAtOnce(NERO_DEVICEHANDLE aDeviceHandle,
  88. NERO_WRITE_BURN_AT_ONCE *pBurnAtOnce,
  89. DWORD dwFlags, // set of NBF_ flags. Note, that not all NBF_ flags will be interpreted.
  90. DWORD dwSpeed, // In KB/s if NBF_SPEED_IN_KBS is present, in multiple of 150 KB/s otherwise
  91. NERO_PROGRESS* pNeroProgress,
  92. void *reserved);
  93. /* This is the second method to do BurnAtOnce with NeroAPI.
  94. * It allows more control by application but you have to make sure
  95. * by yourself to deliver the data in the correct order. Additionally,
  96. * NeroAPI will not cache any data in memory with this method and the
  97. * methods block until all the data is written. Therefore, your
  98. * application should implement some caching itself for performance reasons.
  99. *
  100. * Howto use:
  101. * 1) Fill the nwbaoFSContainer of NERO_WRITE_BURN_AT_ONCE to specify the
  102. * layout of the DVD.
  103. * 2) Call NeroBAOCreateHandle with the necessary information to get a NERO_BAO_HANDLE
  104. * 3) For each video file in the VIDEO_TS folder, call NeroBAOOpenFile, then write
  105. * all the data with NeroBAOWriteToFile and then call NeroBAOCloseFile.
  106. * Note:
  107. * it is absolutely important, that this is done in the correct order. See
  108. * notes on the nwbaoFSContainer above.
  109. * 4) After all video data is written, call NeroBAOCloseHandle. This will write additional
  110. * files that are present in the filesystem container and then finalize the disc.
  111. * 5) If an error occurs on your side and/or you want to cancel burning, just call
  112. * NeroBAOCloseHandle with dwFlags set to NBAOF_CANCELED or NBAOF_FAILED.
  113. * 6) If an error occurs on NeroAPI's side, also call NeroBAOCloseHandle to end burning
  114. * and do some cleanup.
  115. *
  116. * Notes:
  117. * - nwbaoFSContainer needs to be valid until NeroBAOCloseHandle is called.
  118. */
  119. NEROAPI_API
  120. NEROAPI_BURN_ERROR NADLL_ATTR NeroBAOCreateHandle(NERO_DEVICEHANDLE aDeviceHandle,
  121. NERO_WRITE_BURN_AT_ONCE *pBurnAtOnce,
  122. DWORD dwFlags, // set of NBF_ flags. Note, that not all NBF_ flags will be interpreted.
  123. DWORD dwSpeed, // In KB/s if NBF_SPEED_IN_KBS is present, in multiple of 150 KB/s otherwise
  124. NERO_PROGRESS* pNeroProgress,
  125. NERO_BAO_HANDLE* pBAOHandle, // will get the handle created by NeroAPI
  126. void *reserved);
  127. NEROAPI_API
  128. NEROAPI_BURN_ERROR NADLL_ATTR NeroBAOOpenFile(NERO_BAO_HANDLE hBAOHandle, const char *name, DWORD* pdwOffset, void *reserved);
  129. NEROAPI_API
  130. NEROAPI_BURN_ERROR NADLL_ATTR NeroBAOWriteToFile(NERO_BAO_HANDLE hBAOHandle,
  131. const void* lpBuffer, // data buffer
  132. DWORD nNumberOfBytesToWrite, // number of bytes to write
  133. // Must be multiple of 2048!
  134. LPDWORD lpNumberOfBytesWritten,
  135. void *reserved);
  136. NEROAPI_API
  137. NEROAPI_BURN_ERROR NADLL_ATTR NeroBAOCloseFile(NERO_BAO_HANDLE hBAOHandle,
  138. void *reserved);
  139. NEROAPI_API
  140. NEROAPI_BURN_ERROR NADLL_ATTR NeroBAOCloseHandle(NERO_BAO_HANDLE hBAOHandle, DWORD dwFlags, void *reserved);
  141. #define NBAOF_CANCELED (1<<0)
  142. #define NBAOF_FAILED (1<<1)
  143. #ifdef __cplusplus
  144. }
  145. #endif
  146. #if defined(__BORLANDC__)
  147. #pragma pack(pop)
  148. #pragma option pop
  149. #endif
  150. #endif // NEROBURNATONCE_H